Skip to content

Reference

AGENSAI publishes one library on npm: agensai. It is the MCP server, the pairing tool, and the daemon. one package, three commands (pair, serve, disconnect).

This page lists the internal AGENSAI lib (private; you read it, you fork what you need) plus the canonical JAW + JustaName SDK references.

Internal AGENSAI lib

Lives in apps/mcp/src/lib/. Not published. It's the contract that the MCP commands, MCP tools, examples, and dashboard hooks all build against.

Top-level surface:

ModulePurpose
account.tsChain-rooted JAW Account factories. getEnsAccount (chainId 1, for ENS publishing) and getOpAccount (per-L2, for grants and sendCalls).
chain/Supported chains, RPC URLs, JustaName + ENS gateway clients.
ens/Forward + reverse resolution, subname issuance helper, text record reader.
permissions/Permission DSL → ERC-7715 compiler. Wildcard sentinels.
tokens/Token registry (USDC, ETH, etc.), parseAmount helper, ERC-7528 native sentinel.
fleet/Reads + writes for the canonical 3-tier ENS records (main → orchestrator → agents).
agent/v2 helpers: createAgentV2, revokeAgent, permissionAdd, killSwitchSweep.
keychain/Keychain interface. Ships FileKeychainBackend (mode 0600 plaintext).
lib-errors.tsAgensaiError, PermissionError, ResolutionError, PermissionViolationError, ExecutionRevertedError.
types/Permission, EnsName, AgentSnapshot, Handoff.

Read the source in apps/mcp/src/lib/ for full function signatures and JSDoc.

JAW SDK

The wallet primitives. Smart accounts, permissions, gas.

  • JAW docs, official.
  • @jaw.id/core, Account.create, Account.fromLocalAccount, grantPermissions, revokePermission, sendCalls.
  • @jaw.id/wagmi, React/Wagmi connector for browser flows.

Skill-rule cites we lean on across AGENSAI's docs:

JustaName SDK

The ENS layer. Subnames, text records, CCIP-Read resolution.

Skill-rule cite for ENS-side flows:

  • ens-identity.md, SIWE construction for subname updates, signer requirements.

Examples

  • The examples/ directory ships four self-contained agents you can clone and run.

API key

Sign up at app.agensai.xyz. The same JAW API key drives both the JAW SDK (smart accounts, permissions) and the JustaName SDK (subname issuance under agensai.eth), see account-api.md line 278: "The same API key from dashboard.jaw.id works for both JAW SDK and JustaName SDK, you do NOT need a separate key."