Skip to content

feat: register-agent command (#5 sub-task)#26

Merged
anajuliabit merged 1 commit intomainfrom
feat/register-agent
May 6, 2026
Merged

feat: register-agent command (#5 sub-task)#26
anajuliabit merged 1 commit intomainfrom
feat/register-agent

Conversation

@anajuliabit
Copy link
Copy Markdown
Collaborator

Branched off main. Adds the 11th #5 sub-task. No auth required — `POST https://reppo.ai/api/v1/agents/register\` is the bootstrap endpoint that mints a new agent identity (id + accessToken + Base wallet).

Summary

`reppo register-agent --name --description ` — register a new agent on the Reppo platform. Returns:
```jsonc
{ "id": "...", // persistent agent id
"accessToken": "...", // bearer token for /api/v1/agents/* calls
"walletAddress": "0x..." } // funded Base wallet provisioned by Reppo
```

The platform API is two separate auth surfaces:

  • `reppo.ai/api/v1/agents/...` — uses the persistent `accessToken` from this command (Bearer header). For agent-scoped pod metadata submissions.
  • `api.reppo.xyz/...` — uses an EIP-191 wallet-signed 24h session token. Separate `reppo auth` flow lands in the next PR.

Pre-flight

Code When
`INVALID_NAME` Empty/whitespace-only `--name`
`INVALID_DESCRIPTION` Empty/whitespace-only `--description`
`PLATFORM_API_UNREACHABLE` Network error (DNS, TLS, refused)
`PLATFORM_API_ERROR` Non-2xx response, with platform's error message
`PLATFORM_API_INVALID_RESPONSE` 200 OK but missing expected fields

Endpoint quirk: hardcoded URL

`reppo.ai/api/v1/agents/register` is on a different host than `REPPO_API_URL` (which defaults to `api.reppo.xyz`). For now the URL is hardcoded with a comment that this might unify later. We can add a `REPPO_AGENTS_API_URL` env var if needed.

Updated #5 status

Sub-task Status
`register-agent` shipping in this PR
`query emissions-due` next PR (depends on `reppo auth` flow)
`create-datanet` intentionally not an agent surface — `POST /me/subnets` uses Privy session cookies (browser-only). Documented as such; recommend pointing users at the dashboard.
`swap` deferred-by-scope (Uniswap V3 multi-tx)

Smoke tests (local)

  • `npm run lint` exits 0
  • `npm run typecheck` exits 0
  • `npm test` — 92/92 passing (90 prior + 2 new)
  • `npm run build` emits `dist/commands/register-agent.js`
  • `reppo register-agent --help` renders usage
  • empty `--name` → `INVALID_NAME`
  • empty `--description` → `INVALID_DESCRIPTION`

End-to-end registration against the live platform was NOT exercised in this PR — that would create real agent identities. Will be covered when the integration harness (PR #8 successor) gets a way to mock the platform API.

🤖 Generated with Claude Code

Register a new agent identity on the Reppo platform via
POST https://reppo.ai/api/v1/agents/register (no auth required).
Returns id + accessToken + funded Base wallet address.

- src/commands/register-agent.ts: thin POST wrapper, hardcoded
  endpoint (the agents API lives at reppo.ai/api/v1, separate
  host from REPPO_API_URL which points at api.reppo.xyz). Uses
  Node 20+ built-in fetch. Surfaces network errors as
  PLATFORM_API_UNREACHABLE and non-2xx responses as
  PLATFORM_API_ERROR with the platform's error message.
- src/bin.ts: register; trim TODO list to 3.
- README + status line.
- src/__tests__/command-error-paths.test.ts: 2 cases
  (INVALID_NAME, INVALID_DESCRIPTION).

Output emits warnings about saving credentials and funding the
new wallet — re-registration creates a NEW identity with a NEW
walletAddress; previous pods stay attributed to the prior wallet.

Note on #5 progress: this also surfaces a finding from the docs
search — `create-datanet` requires Privy session cookies (browser
auth), so it's intentionally not an agent-API surface. Documented
in bin.ts TODO and tracking issue #5. Remaining 3: query
emissions-due, create-datanet (browser-only), swap.

Pipeline: lint, typecheck, test (92/92), build all green.
@anajuliabit anajuliabit merged commit 140a112 into main May 6, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant