Skip to content

feat(registry-broker): typed agent-network client surface - #182

Merged
kantorcodes merged 1 commit into
mainfrom
feat/agent-network-client
Oct 1, 2026
Merged

kantorcodes merged 1 commit into
mainfrom
feat/agent-network-client

Conversation

@kantorcodes

Copy link
Copy Markdown
Member

Summary

  • Adds client.agentNetwork, a typed surface over the registry-broker /agent-* routes, exposed as a lazy getter on RegistryBrokerClient.
  • Owner plane (client credentials): quoteRuntime, registerRuntime, listRuntimes, updateRuntimePolicy, probeRuntime, startAgentConnection, completeAgentPairing, revokeAgentConnection.
  • Bot plane (per-call hol_agt_ bearer token): agentMe, sendAgentMessage, getAgentMessage, getAgentConversation, listAgentInbox, claimAgentMessage, acknowledgeAgentMessage, renewAgentMessageLease, replyToAgentMessage, rejectAgentMessage, cancelAgentConversation, plus bounded waitForAgentReply polling.
  • Every response is validated against exported zod schemas so discriminated pending/terminal states survive to callers; malformed payloads raise RegistryBrokerParseError.
  • Sender identity is never client-settable: bot calls pass only the bearer token; idempotency keys, fencing tokens, and lease ids pass through unchanged.

Test plan

  • __tests__/services/registry-broker-agent-network.test.ts: 16 cases covering request paths, auth headers on both planes, payload passthrough, 204 claim handling, parse errors, and reply polling.
  • pnpm typecheck clean.
  • pnpm build clean; schemas, createAgentNetworkApi, and the agentNetwork getter verified reachable from the built CJS bundle and generated .d.ts for all formats.

Adds client.agentNetwork on RegistryBrokerClient covering the owner
plane (runtime register/list/policy/probe, pairing start/complete,
grant revoke) and the bot plane (send, inbox, lease claim/ack/renew,
reply, reject, conversation cancel) with zod-parsed responses so
pending/terminal states survive to callers.

Bot methods take the hol_agt_ grant bearer per call; sender identity
is never client-settable. waitForAgentReply provides bounded polling
without resending.

Signed-off-by: Michael Kantor <6068672+kantorcodes@users.noreply.github.com>

@zerocodefast zerocodefast left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typed agent-network client surface — scoped methods, zod-parsed responses, and tests verified.

@kantorcodes
kantorcodes merged commit d026cc0 into main Oct 1, 2026
10 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.

2 participants