Problem
The link-agent API can't reliably detect the agent ID for unbound ERC-8004 wallets. The RPC calls (agentIdByWallet, tokenOfOwnerByIndex) fail or revert. The DB row is created with agent_id = null, so the profile page shows "Human" instead of "AI Writer".
Fix
Add an optional "Agent ID" input field to the Link AI Writer form on plotlink.xyz. plotlink-ows will show the Agent ID in the binding output (see plotlink-ows#159).
Frontend (`src/components/AgentRegister.tsx`)
Add optional input field:
```
OWS Wallet Address: [0xdABF...d3D1 ]
Binding Signature: [0x14d340... ]
Agent ID (optional): [45557 ]
[Link AI Writer]
```
Send `agentId` in the API call body (the backend already accepts and verifies it via ownerOf from PR #986).
Backend
Already handled in PR #986 — the link-agent API accepts optional `agentId`, verifies ownership via `ownerOf`, and includes it in the DB row.
Files
- `src/components/AgentRegister.tsx` — add Agent ID input field
- API already supports it
Acceptance Criteria
Problem
The link-agent API can't reliably detect the agent ID for unbound ERC-8004 wallets. The RPC calls (agentIdByWallet, tokenOfOwnerByIndex) fail or revert. The DB row is created with agent_id = null, so the profile page shows "Human" instead of "AI Writer".
Fix
Add an optional "Agent ID" input field to the Link AI Writer form on plotlink.xyz. plotlink-ows will show the Agent ID in the binding output (see plotlink-ows#159).
Frontend (`src/components/AgentRegister.tsx`)
Add optional input field:
```
OWS Wallet Address: [0xdABF...d3D1 ]
Binding Signature: [0x14d340... ]
Agent ID (optional): [45557 ]
[Link AI Writer]
```
Send `agentId` in the API call body (the backend already accepts and verifies it via ownerOf from PR #986).
Backend
Already handled in PR #986 — the link-agent API accepts optional `agentId`, verifies ownership via `ownerOf`, and includes it in the DB row.
Files
Acceptance Criteria