Archive dockerfile, agntcy-alignment-docs, and nodejs-sdk changes now that implementation is complete and pushed to develop. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1.5 KiB
1.5 KiB
Context
The SDK wraps the AgentIdP REST API. It must handle authentication transparently — caller provides clientId + clientSecret, SDK manages token acquisition and refresh automatically.
Architecture
- Single entrypoint:
sdk/src/index.tsexportsAgentIdPClientand all types AgentIdPClientconstructor takes{ baseUrl, clientId, clientSecret }- Internal
TokenManagerhandles token acquisition, caching, and refresh (re-issues when expired) - Four service classes:
AgentRegistryClient,CredentialClient,TokenClient,AuditClient AgentIdPClientcomposes all four- HTTP: native
fetch(Node 18+ built-in) — no axios dependency - Types: re-exported from
sdk/src/types.ts— mirrors the main app types
Standards
- TypeScript strict mode, zero
any - DRY: shared
request()helper handles auth header, JSON parse, error mapping - All errors are typed
AgentIdPErrorwithcodeandmessage - JSDoc on all public methods
Package structure
sdk/
src/
index.ts — exports AgentIdPClient + all types
client.ts — AgentIdPClient (composes all services)
token-manager.ts — token acquisition and refresh
services/
agents.ts — AgentRegistryClient
credentials.ts — CredentialClient
token.ts — TokenClient
audit.ts — AuditClient
types.ts — all request/response types
errors.ts — AgentIdPError class
package.json
tsconfig.json
README.md
Open Questions
(none)