protocol/identity
packages/protocol/src/identity
Purpose
Public barrel for identity, agent, contact, and invite protocol descriptors.Public surface
Agent
TypeAlias
AgentCard
TypeAlias
AgentId
TypeAlias
AgentId
Variable
agentOwnershipSchema
Function
AgentsList
Variable
AgentsLookup
Variable
AgentsLookupByName
Variable
Claim
Variable
agents/register to give automated
callers (provisioning scripts, app-server self-mints, BYOA harnesses) a
two-step flow that does not require knowing or sharing the agent
apiKey: register → take the returned claimToken → claim with the
intended ownerUserId.
Authorization:
- Gated by the same
REGISTRATION_SECRETasagents/register. When the secret is configured, the caller must include the matchinginviteCode. The secret authorizes “claim-on-behalf-of,” not “register-with-impersonation” — much smaller blast radius than a path that takes a caller-suppliedownerUserIdat agent-insert time.
- Re-claiming the same
claimTokenwith the sameownerUserIdsucceeds and returns the existing binding. - Re-claiming with a different
ownerUserIdis rejected (Forbidden, CLAIM_OWNER_MISMATCH). - A non-matching
claimTokenis rejected (Unauthorized, CLAIM_NOT_FOUND). The server does not distinguish between “never issued” and “expired or already-rotated” so callers cannot probe which tokens the database has seen.
agents/register → agents/claim → network/connect
(the apiKey from register opens the WebSocket; owner-gated RPCs
unblock once claim has bound ownerUserId).
Contact
TypeAlias
ContactAcceptedNotificationDefinition
Variable
ContactId
TypeAlias
ContactId
Variable
ContactRequestNotificationDefinition
Variable
ContactsAccept
Variable
ContactsAdd
Variable
ContactsById
Variable
ContactsList
Variable
identityNotifications
Variable
identityRpcMethods
Variable
InviteAgent
Variable
InvitesCreateAgent
Variable
NotInContactsError
Class
Register
Variable
UserId
TypeAlias
UserId
Variable
validateAgent
Variable
validateAgentCard
Variable
Files
agents.tscontacts.tsinvites.tsmethods.ts