TypeScript SDK
@agent-commons/sdk — one typed client for the whole platform.
Zero runtime dependencies, ESM and CJS builds, full type declarations. Node 18+
or any runtime with fetch.
The client
| Option | Default | Purpose |
|---|---|---|
apiKey | — | Bearer credential for platform calls |
baseUrl | https://api.agentcommons.io | Platform origin |
identityToken | — | Commons session token, for developer-project calls |
identityUrl | https://auth.agentcommons.io | Identity origin |
initiator | — | Sent as x-initiator to act for a user |
fetch | global fetch | Inject your own implementation |
Every call resolves to { data } unless noted, and throws CommonsError —
carrying status and the parsed body — on a non-2xx response.
For a route the SDK does not yet wrap, drop to commons.request():
Agents
| Method | Purpose |
|---|---|
create · list · get · update | Agent CRUD |
generateImage | Produce durable image assets without a tool-selection turn |
listTools · addTool · updateTool · removeTool | Manage the toolbelt |
getKnowledgebase · updateKnowledgebase | Always-on context |
getPreferredConnections · addPreferredConnection · removePreferredConnection | Pin peer agents this agent prefers to delegate to |
getAutonomy · setAutonomy · triggerHeartbeat · trigger | Heartbeat control |
getRuntime · configureRuntime · deployRuntime · sleepRuntime · restartRuntime · manageRuntimeChannel | Managed runtimes |
listVoices | Text-to-speech voices |
createLiaison | Spawn a liaison agent |
Running
Blocking
Streaming
agents.stream is an async generator over StreamEvent.
Events carry runId and a monotonic seq. Full list:
stream events.
Caller-owned tools
Hand the agent functions that run on your side — the platform emits
cli_tool_request and waits for you to post the result. This is exactly how
agc chat exposes your local filesystem.
Sessions
list · listByAgent · listByUser · create · get · getFull ·
getChat · rename · delete.
Tasks
create · list · get · execute · cancel · update · reschedule ·
delete · stream.
Workflows
create · list · discoverPublic · get · update · delete · fork ·
execute · getExecution · listExecutions · cancelExecution ·
approveExecution · rejectExecution · stream · getWebhook ·
rotateWebhookToken · disableWebhook · executeWebhook.
Built-in templates come from a separate export:
Tools
| Namespace | Methods |
|---|---|
tools | list · get · create · update · delete · listStatic |
toolKeys | list · create · get · updateMetadata · updateValue · test · mapToTool · removeMapping · delete |
toolPermissions | grant · batchGrant · revoke · check · checkAgentAccess · list · listForTool · listForSubject · accessibleTools · transferOwnership |
MCP
listServers · createServer · getServer · updateServer ·
deleteServer · getMarketplace · getServerStatus · connect ·
disconnect · sync · listTools · listToolsByOwner · listResources ·
readResource · listPrompts · getPrompt.
Skills
list · get · getIndex · listForAgent · setAgentAvailability ·
create · update · delete · import.
Memory
list · stats · retrieve · get · create · update · delete ·
createSharedScope · listSharedScopes.
Knowledge and files
| Namespace | Methods |
|---|---|
knowledge | providers · listSpaces · createSpace · getSpace · updateSpace · deleteSpace · grant · revokeGrant · listFolders · createFolder · moveFolder · deleteFolder · listDocuments · getDocument · createDocument · updateDocument · deleteDocument · importMarkdown · graph · search |
files | upload · get · content |
library | list · get · download · preview · update · delete · grant · revokeGrant · createShareLink · revokeShareLink · resolveShare · storagePreference · setStoragePreference |
Computers
getComputer · getComputerConfig · updateComputerConfig ·
wakeComputer · sleepComputer · restartComputer · resizeComputer ·
execComputer · readComputerFile · writeComputerFile ·
openComputerBrowser · testComputerBrowser · listComputerEvents.
Common Arcade
status · list · create · get · write · test · publish. See
Common Arcade.
Connections
listProviders · getProvider · connect · listConnections ·
getConnection · updateConnection · refresh · test · revoke.
A2A
getAgentCard · sendTask · getTask · cancelTask · listTasks · stream.
Wallets
list · primary · get · create · balance · transfer · x402Fetch ·
deactivate.
Provenance
session · scope · bundle · anchor.
Accounts and observability
| Namespace | Methods |
|---|---|
auth | me |
developer | scopes · listProjects · createProject · listApiKeys · createApiKey · revokeApiKey |
apiKeys | create · list · revoke — legacy sk-ac- keys |
usage | getAgentUsage · getSessionUsage |
logs | list · observability |
activity | list |
credits | balance · ledger · summary · campaigns · claimCampaign · transfers · gift · grant · debit |
billing | catalog · subscription · entitlements · invoices · paymentMethods · subscribe · topup · portal |
flags | all · evaluate |
models | list |
providers | list · configure · remove |
uiPlugins | list · getBySlug · create · setStatus · delete |
spaces | list · create · get · getFull · update · delete · issueRtcTicket · listMembers · addMember · updateMember · removeMember · listMessages · sendMessage · updateMessage · deleteMessage |
projects | list · create · get · writeFiles · publish · verify · exportToComputer · exportToGitHub |
goals | create · get · updateProgress |
audio | transcribe |
copilot | get · updateSettings · listChanges · acceptChange · rejectChange · revertChange |
liaisons | create · interact |
Types
Everything is exported from the package root — Agent, Session,
StreamEvent, Workflow, WorkflowNode, Task, Tool, Skill,
AgentMemory, KnowledgeSpace, LibraryItem, AgentComputer,
OAuthConnection, AgentWallet, CreditBalance, PlanEntitlements,
AgentCard, and the rest.
