{"_id":"@7clave/agent-kit","_rev":"4-3aed9f90a77be483c674a61b59250f9c","name":"@7clave/agent-kit","dist-tags":{"latest":"0.3.0"},"versions":{"0.2.0":{"name":"@7clave/agent-kit","version":"0.2.0","keywords":["agent-kit","p256","custody","intent-flow","eip-712","agent","7clave","wallet"],"author":{"name":"7clave"},"license":"Apache-2.0","_id":"@7clave/agent-kit@0.2.0","maintainers":[{"name":"confclave","email":"confclave@gmail.com"}],"homepage":"https://mcp.7clave.com/agent-kit/guide.html","dist":{"shasum":"a93ef2450b02ca729c7d0fa1be2ada63f6131d46","tarball":"https://registry.npmjs.org/@7clave/agent-kit/-/agent-kit-0.2.0.tgz","fileCount":37,"integrity":"sha512-o8J/Pj1/RW7AZ0lnME5mIZVunEgQueS35Fm74R8eJ3gawNeNWEjMrV28ybxW0aNhR1OFZ1L9XlVYZMT9xUdnNA==","signatures":[{"sig":"MEYCIQCiigEP0jnIqa9mSvnUGM+PTFaRV9ZDjD8jeuhCLUSoygIhAOzVLjMZz7hdnLGsH3Ot7VaSN/F185FfGPpg3qUJ7DUU","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":220381},"type":"module","engines":{"node":">=22"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./provider":{"types":"./dist/provider/index.d.ts","import":"./dist/provider/index.js"},"./confirmer":{"types":"./dist/confirmer/index.d.ts","import":"./dist/confirmer/index.js"},"./package.json":"./package.json"},"gitHead":"a7254d88d026dce9867778e4074b4b60c58d1b93","private":false,"scripts":{"build":"node ../custody-sdk/scripts/build-kit.mjs","prepublishOnly":"test -f dist/index.js || (echo 'dist/ missing — run npm run build from monorepo first' && exit 1)"},"_npmUser":{"name":"confclave","email":"confclave@gmail.com"},"_npmVersion":"10.9.7","description":"Agent identity management and intent confirmation/commitment flow for the 7clave custody platform.","directories":{},"sideEffects":false,"_nodeVersion":"22.22.2","dependencies":{"zod":"^4.3.6","jose":"^6.0.11","canonicalize":"^2.0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/agent-kit_0.2.0_1779693112239_0.5746017226539875","host":"s3://npm-registry-packages-npm-production"}},"0.2.1":{"name":"@7clave/agent-kit","version":"0.2.1","keywords":["agent-kit","p256","custody","intent-flow","eip-712","agent","7clave","wallet"],"author":{"name":"7clave"},"license":"Apache-2.0","_id":"@7clave/agent-kit@0.2.1","maintainers":[{"name":"confclave","email":"confclave@gmail.com"}],"homepage":"https://mcp.7clave.com/agent-kit/guide.html","dist":{"shasum":"4b1ea45752bb89c1a6e6d2483a97b5c5a85b2fa9","tarball":"https://registry.npmjs.org/@7clave/agent-kit/-/agent-kit-0.2.1.tgz","fileCount":37,"integrity":"sha512-HxynCKvUnDD2K5VdUhI07vm2HraMRhSzIbZWtQMpvJypGSi6uyapaDpTpsEemGu9QchByP58sLaeTcjRdYi09g==","signatures":[{"sig":"MEUCIH08xsmNIMXUoqZQeQHSMLRmuAaFJ3sSbHvnCwK1mQzhAiEAvU2FYUDoi7mWUQt6paaLUYNOxZRMOxC9aJy1E2sWS9I=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":223071},"type":"module","engines":{"node":">=22"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./provider":{"types":"./dist/provider/index.d.ts","import":"./dist/provider/index.js"},"./confirmer":{"types":"./dist/confirmer/index.d.ts","import":"./dist/confirmer/index.js"},"./package.json":"./package.json"},"gitHead":"b61290da4013d54aa876df9a5997c1e38fa1a00b","private":false,"scripts":{"build":"node ../custody-sdk/scripts/build-kit.mjs","prepublishOnly":"test -f dist/index.js || (echo 'dist/ missing — run npm run build from monorepo first' && exit 1)"},"_npmUser":{"name":"confclave","email":"confclave@gmail.com"},"_npmVersion":"10.9.7","description":"Agent identity management and intent confirmation/commitment flow for the 7clave custody platform.","directories":{},"sideEffects":false,"_nodeVersion":"22.22.2","dependencies":{"zod":"^4.3.6","jose":"^6.0.11","canonicalize":"^2.0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/agent-kit_0.2.1_1780375089074_0.674572920221687","host":"s3://npm-registry-packages-npm-production"}},"0.2.2":{"name":"@7clave/agent-kit","version":"0.2.2","keywords":["agent-kit","p256","custody","intent-flow","eip-712","agent","7clave","wallet"],"author":{"name":"7clave"},"license":"Apache-2.0","_id":"@7clave/agent-kit@0.2.2","maintainers":[{"name":"confclave","email":"confclave@gmail.com"}],"homepage":"https://mcp.7clave.com/agent-kit/guide.html","dist":{"shasum":"4cb0627e29a1b760d230e09ef5fb3181a93d3895","tarball":"https://registry.npmjs.org/@7clave/agent-kit/-/agent-kit-0.2.2.tgz","fileCount":37,"integrity":"sha512-oHJkkaqugzEhBI0iSARlzNdJxv/d297dR6GRzMpD72p6SMfHXOgD7ArxBO84EPNZPpQrG42G7JB87xArmUlm2Q==","signatures":[{"sig":"MEUCIQD8i7PC2ibSi0/8DNLItjU05+QBzEFYrlOplrTwgkreNwIgOpEO11/X6KI6TFJxTRCzSp/8Hc4MONa9F0zahT7BVmY=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":232073},"type":"module","engines":{"node":">=22"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./provider":{"types":"./dist/provider/index.d.ts","import":"./dist/provider/index.js"},"./confirmer":{"types":"./dist/confirmer/index.d.ts","import":"./dist/confirmer/index.js"},"./package.json":"./package.json"},"gitHead":"178cfec7fa6fd740250039eff72a850c1af9a84a","private":false,"scripts":{"build":"node ../custody-sdk/scripts/build-kit.mjs","prepublishOnly":"test -f dist/index.js || (echo 'dist/ missing — run npm run build from monorepo first' && exit 1)"},"_npmUser":{"name":"confclave","email":"confclave@gmail.com"},"_npmVersion":"10.9.7","description":"Agent identity management and intent confirmation/commitment flow for the 7clave custody platform.","directories":{},"sideEffects":false,"_nodeVersion":"22.22.2","dependencies":{"zod":"^4.3.6","jose":"^6.0.11","canonicalize":"^2.0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/agent-kit_0.2.2_1780959055390_0.10149132019027385","host":"s3://npm-registry-packages-npm-production"}},"0.3.0":{"name":"@7clave/agent-kit","version":"0.3.0","private":false,"description":"Agent identity management and intent confirmation/commitment flow for the 7clave custody platform.","type":"module","license":"Apache-2.0","author":{"name":"7clave"},"keywords":["agent-kit","p256","custody","intent-flow","eip-712","agent","7clave","wallet"],"homepage":"https://mcp.7clave.com/agent-kit/guide.html","sideEffects":false,"engines":{"node":">=22"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./provider":{"types":"./dist/provider/index.d.ts","import":"./dist/provider/index.js"},"./confirmer":{"types":"./dist/confirmer/index.d.ts","import":"./dist/confirmer/index.js"},"./package.json":"./package.json"},"dependencies":{"zod":"^4.3.6","jose":"^6.0.11","canonicalize":"^2.0.0"},"scripts":{"build":"node ../custody-sdk/scripts/build-kit.mjs","prepublishOnly":"test -f dist/index.js || (echo 'dist/ missing — run npm run build from monorepo first' && exit 1)"},"publishConfig":{"access":"public"},"_id":"@7clave/agent-kit@0.3.0","_nodeVersion":"22.22.2","_npmVersion":"10.9.7","dist":{"integrity":"sha512-ffud6V9nRm/B2zTftAshP2fGvjXr0us9YCxVWFZktbckLwK/aLvEYRXZpnSTdjEzDi3UmuYTKKXqIiLRWLOQMw==","shasum":"0f7bad5de5be1cf9890aa0734cc94c1b5b64ba9f","tarball":"https://registry.npmjs.org/@7clave/agent-kit/-/agent-kit-0.3.0.tgz","fileCount":45,"unpackedSize":304139,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIHfYPHN0UbJP3zwOLVHvRqbOUF7PFph98rlTqGFQatEAAiBC3S7IWn9NCRx6jXosS1wZ1NN+zry0rBrKstjcKGCuCQ=="}]},"_npmUser":{"name":"confclave","email":"confclave@gmail.com"},"directories":{},"maintainers":[{"name":"confclave","email":"confclave@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/agent-kit_0.3.0_1784597770622_0.0561306568181692"},"_hasShrinkwrap":false}},"time":{"created":"2026-05-25T07:11:52.076Z","modified":"2026-07-21T01:36:10.973Z","0.2.0":"2026-05-25T07:11:52.400Z","0.2.1":"2026-06-02T04:38:09.208Z","0.2.2":"2026-06-08T22:50:55.541Z","0.3.0":"2026-07-21T01:36:10.823Z"},"author":{"name":"7clave"},"license":"Apache-2.0","homepage":"https://mcp.7clave.com/agent-kit/guide.html","keywords":["agent-kit","p256","custody","intent-flow","eip-712","agent","7clave","wallet"],"description":"Agent identity management and intent confirmation/commitment flow for the 7clave custody platform.","maintainers":[{"name":"confclave","email":"confclave@gmail.com"}],"readme":"# @7clave/agent-kit\n\n**P-256 agent identity, 4-step intent flow, and EIP-712 signing primitives\nfor the 7clave custody platform. Zero `@7clave/*` runtime deps.**\n\nSelf-contained agent kit for the 7clave custody platform. Covers P-256\nidentity, the 4-step intent flow (propose → fetch → sign → commit),\ntransparent enrollment, account/address discovery, and EIP-712 typed-data\nsigning — everything an autonomous agent needs to move funds through\ncustody without ever touching operator surface.\n\nThe package has **zero `@7clave/*` runtime dependencies** — installing it\npulls only `zod`, `jose`, and `canonicalize`. ESM-only, Node ≥ 22.\n\nFor the full guide, see **https://mcp.7clave.com/agent-kit/guide.html**.\n\n## Entry points\n\nThe kit exposes exactly three subpaths, split by trust boundary:\n\n| Import | Use it on | What it gives you |\n|---|---|---|\n| `@7clave/agent-kit` | the machine that holds the agent's P-256 key | crypto primitives, key store, identity resolution, the 4-step intent flow (`createSessionContext`, `execIntent`, `proposeFetchCommit`), enrollment, `signTypedData` |\n| `@7clave/agent-kit/provider` | an MCP **server** orchestrating custody for an agent (Model 2) | `proposeFetch`, `commitWithSignature`, `withSigning`, `createSubmitSignatureHandler` — no function here ever takes a private key |\n| `@7clave/agent-kit/confirmer` | the agent's **client** machine (Model 2) | `signCommitObject`, `createSigningTransport` — holds the P-256 identity key and confirms operation payloads |\n\n```js\nimport { resolveAgentIdentity, createSessionContext, execIntent } from '@7clave/agent-kit';\nimport { proposeFetch, commitWithSignature } from '@7clave/agent-kit/provider';\nimport { signCommitObject, createSigningTransport } from '@7clave/agent-kit/confirmer';\n```\n\n## Quick start\n\nThree minimal examples, one per subpath. All three assume you already have a\n`CUSTODY_API_KEY` from your operator and an HTTP adapter (anything that maps\n`{method, path, body, headers}` to an HTTPS request — a thin `fetch` wrapper\nwill do).\n\n### Example 1 — Model 3: sign and execute an intent locally\n\nThe agent process holds its own P-256 key on disk and runs the full\npropose → fetch → sign → commit flow itself. This is what\n`@7clave/mcp-wallet` does internally.\n\n```ts\nimport {\n  Agent,\n  createFileKeyStore,\n  execIntent,\n} from '@7clave/agent-kit';\nimport { createFetchAdapter } from './myFetchAdapter.js'; // your transport\n\nconst agent = new Agent({\n  adapter: createFetchAdapter({\n    baseUrl: process.env.CUSTODY_API_URL!,\n    apiKey: process.env.CUSTODY_API_KEY!,\n  }),\n  clientInfo: { sdk: 'my-app', platform: 'node', version: '0.1.0' },\n  // Optional: `lookupName` is the bootstrap `?agent_name=` selector — defaults\n  // to a derived label. The server UUID is the canonical identity post-enrol.\n  // Called once, after the server tells us our agent_id.\n  onIdentityResolved: async (identity) =>\n    createFileKeyStore(`${process.env.HOME}/.my-app/keys/${identity.agentId}`),\n});\n\nawait agent.ready(); // resolves /me, loads-or-generates key, enrols\n\nconst result = await execIntent(agent.session, {\n  // intent payload — shape depends on intent type (Transfer, Fund, x402Pay, …)\n  type: 'Transfer',\n  to: '0x…',\n  amount: '1.50',\n  token: 'USDC',\n  chain_id: 8453,\n});\nconsole.log(result);\n```\n\n### Example 2 — Model 2 provider (server side, no private key)\n\nAn MCP server that orchestrates intents on behalf of a remote client. The\nserver never sees the agent's private key; it only proposes + fetches and\ncommits a signature the client returns.\n\n```ts\nimport { proposeFetch, commitWithSignature } from '@7clave/agent-kit/provider';\nimport { intentsClient } from './myClient.js'; // your IntentClient instance\n\n// Step 1-2: propose + fetch the commit object.\nconst signingRequest = await proposeFetch({\n  intents: intentsClient,\n  domainId: 'dom_…',\n  payload: { type: 'Transfer', to: '0x…', amount: '1.50', token: 'USDC' },\n});\n// Hand `{request_id, payload, display_info, algorithm}` to the client.\n// Keep `challenge` SERVER-SIDE — never send it to the client.\n\n// …client signs, returns { signature, p256Pubkey } over the wire…\n\n// Step 4: commit with the client-supplied signature.\nconst committed = await commitWithSignature({\n  intents: intentsClient,\n  domainId: 'dom_…',\n  sessionId: signingRequest.request_id,\n  challenge: signingRequest.challenge, // re-attached server-side\n  signature: clientSignature,\n  p256Pubkey: clientPubkey,\n});\n```\n\n### Example 3 — Model 2 confirmer (client side, signs only)\n\nThe client holds the P-256 key and signs commit objects the server forwards.\nNo knowledge of the custody backend URL or API key needed on the client.\n\n```ts\nimport { signCommitObject } from '@7clave/agent-kit/confirmer';\nimport { jwkToPrivateKey } from '@7clave/agent-kit';\n\nconst privateKey = await jwkToPrivateKey(myStoredJwk);\n\nconst signature = await signCommitObject(\n  {\n    payload: signingRequest.payload,         // from the server\n    display_info: signingRequest.display_info,\n  },\n  privateKey,\n);\n// POST { signature, p256Pubkey } back to the MCP server.\n```\n\n## Model-3 usage\n\nThe canonical Model-3 consumer (agent holds the P-256 key on local disk and\ncalls custody directly) is `@7clave/mcp-wallet` — its 9 stdio tools are built\nentirely on this kit's root entrypoint.\n\n## API stability\n\nThis package is pre-1.0. The three subpath exports (root, `/provider`,\n`/confirmer`) are stable in shape — adding a fourth subpath, or moving a\nfunction across subpath boundaries, would be a breaking change and is not\nplanned. Individual function signatures may evolve until 1.0; track the\nCHANGELOG for any rename or parameter-order change.\n\n## Security\n\nHolds private key material in memory and (via `createFileKeyStore`) on disk.\nThe process running this kit is fully trusted with the P-256 key; on-disk\nkey files must live on persistent storage with restricted ACL; the custody\nbackend URL must use TLS. Full threat model and deployment checklist in the\nguide above.\n\n## License\n\nApache-2.0 — explicit patent grant on a signing / key-management kit.\n","readmeFilename":"README.md"}