{"_id":"@agent-trust/sdk","_rev":"4-e8eb4b9ec83d8a360696fffc15a56ba0","name":"@agent-trust/sdk","dist-tags":{"latest":"1.3.0"},"versions":{"1.0.0":{"name":"@agent-trust/sdk","version":"1.0.0","keywords":["ai","agent","trust","sdk","client","certificate","jwt","reputation","ai-agents","agenttrust"],"author":{"name":"AgentTrust"},"license":"MIT","_id":"@agent-trust/sdk@1.0.0","maintainers":[{"name":"mmsadek96","email":"mmsadek96@gmail.com"}],"homepage":"https://github.com/mmsadek96/agentgateway/tree/main/packages/agent-sdk#readme","bugs":{"url":"https://github.com/mmsadek96/agentgateway/issues"},"dist":{"shasum":"b38e8d861360c77a3190809af3b5a558d3867a52","tarball":"https://registry.npmjs.org/@agent-trust/sdk/-/sdk-1.0.0.tgz","fileCount":14,"integrity":"sha512-No1KSUhcIHpAq7UR/0RIONULrGCziIeGHRRjQEe94j7SO9CIeeveRsQ5aJrsUDkxBo4f+Pnp1YuJKXMD1hQQfg==","signatures":[{"sig":"MEYCIQDFVINoVAA5njOi23EFI+Z5VcdXAsgTP5sMdyluvWmKCAIhAPmYSDxuPcivn4RJxDudXEtU8DyMJNUgxFEt8lvjMphk","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":23509},"main":"dist/index.js","types":"dist/index.d.ts","engines":{"node":">=18.0.0"},"gitHead":"86ecf7e0d9d2ebafbccbabb2281f5c1e01652efd","scripts":{"dev":"tsc --watch","build":"tsc"},"_npmUser":{"name":"mmsadek96","email":"mmsadek96@gmail.com"},"repository":{"url":"git+https://github.com/mmsadek96/agentgateway.git","type":"git","directory":"packages/agent-sdk"},"_npmVersion":"10.9.3","description":"Client SDK for AI agents to request trust certificates and interact with AgentTrust Gateways. Zero dependencies.","directories":{},"_nodeVersion":"22.20.0","dependencies":{},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.3.3"},"_npmOperationalInternal":{"tmp":"tmp/sdk_1.0.0_1771718397144_0.8638722664736613","host":"s3://npm-registry-packages-npm-production"}},"1.1.0":{"name":"@agent-trust/sdk","version":"1.1.0","keywords":["ai","agent","trust","sdk","client","certificate","jwt","reputation","ai-agents","agenttrust"],"author":{"name":"AgentTrust"},"license":"MIT","_id":"@agent-trust/sdk@1.1.0","maintainers":[{"name":"mmsadek96","email":"mmsadek96@gmail.com"}],"homepage":"https://github.com/mmsadek96/agentgateway/tree/main/packages/agent-sdk#readme","bugs":{"url":"https://github.com/mmsadek96/agentgateway/issues"},"dist":{"shasum":"55d425b486e71be8452d5435d2cb23bda4e50a07","tarball":"https://registry.npmjs.org/@agent-trust/sdk/-/sdk-1.1.0.tgz","fileCount":14,"integrity":"sha512-6lpWhtjFs84mRIpx4Ir6L0mKpIO6S6u3mlrWP3Ap3Ns98Fnaf/7Az+VAMuXcnvi9FmX3gnsWq4LTMQR50fIg3Q==","signatures":[{"sig":"MEUCIQDuwvZLCNehI5ziBcFEgwJNJK6p1EcJ+7tPRo4NaSX5ogIgVzEABXTgkaIdYiUdDWWFTHVno0ul1Je27JC9xfo2tjU=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":23509},"main":"dist/index.js","types":"dist/index.d.ts","engines":{"node":">=18.0.0"},"gitHead":"89ee78af4222f7fcd572f292218d8d5e4e53322a","scripts":{"dev":"tsc --watch","build":"tsc"},"_npmUser":{"name":"mmsadek96","email":"mmsadek96@gmail.com"},"repository":{"url":"git+https://github.com/mmsadek96/agentgateway.git","type":"git","directory":"packages/agent-sdk"},"_npmVersion":"10.9.3","description":"Client SDK for AI agents to request trust certificates and interact with AgentTrust Gateways. Zero dependencies.","directories":{},"_nodeVersion":"22.20.0","dependencies":{},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.3.3"},"_npmOperationalInternal":{"tmp":"tmp/sdk_1.1.0_1771722249208_0.2602614266148031","host":"s3://npm-registry-packages-npm-production"}},"1.2.0":{"name":"@agent-trust/sdk","version":"1.2.0","keywords":["ai","agent","trust","sdk","client","certificate","jwt","reputation","ai-agents","agenttrust","scope","scope-manifest","authorization"],"author":{"name":"AgentTrust"},"license":"MIT","_id":"@agent-trust/sdk@1.2.0","maintainers":[{"name":"mmsadek96","email":"mmsadek96@gmail.com"}],"homepage":"https://github.com/mmsadek96/agentgateway/tree/main/packages/agent-sdk#readme","bugs":{"url":"https://github.com/mmsadek96/agentgateway/issues"},"dist":{"shasum":"2e1f68a9fabb3e5819eb011047017c6a80ad781b","tarball":"https://registry.npmjs.org/@agent-trust/sdk/-/sdk-1.2.0.tgz","fileCount":14,"integrity":"sha512-2P9QlZp8O/jlBWD05dIfQ/58l/lvq4awL+e6fdwAaMWk1qvKE/2b9rZ0zAXN3JpuzR2K/j/UONL6L7JQnIRAZQ==","signatures":[{"sig":"MEUCIHHmYqznWEcENXapqZbxQqe4E9PpOTsHRQaXUfSJC08SAiEAlp+DYhna/Guz9M2+e9rtm/9NQeNVNTB+aLejQFnhQJ4=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":27240},"main":"dist/index.js","types":"dist/index.d.ts","engines":{"node":">=18.0.0"},"gitHead":"ef3e81df8dfad43657bc0252f1e0e646aaf8abfa","scripts":{"dev":"tsc --watch","build":"tsc"},"_npmUser":{"name":"mmsadek96","email":"mmsadek96@gmail.com"},"repository":{"url":"git+https://github.com/mmsadek96/agentgateway.git","type":"git","directory":"packages/agent-sdk"},"_npmVersion":"10.9.3","description":"Client SDK for AI agents to request trust certificates with scope manifests and interact with AgentTrust Gateways. Zero dependencies.","directories":{},"_nodeVersion":"22.20.0","dependencies":{},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.3.3"},"_npmOperationalInternal":{"tmp":"tmp/sdk_1.2.0_1771725542301_0.6581011553899556","host":"s3://npm-registry-packages-npm-production"}},"1.3.0":{"name":"@agent-trust/sdk","version":"1.3.0","description":"Client SDK for AI agents to request trust certificates with scope manifests and interact with AgentTrust Gateways. Zero dependencies.","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"build":"tsc","dev":"tsc --watch"},"keywords":["ai","agent","trust","sdk","client","certificate","jwt","reputation","ai-agents","agenttrust","scope","scope-manifest","authorization"],"author":{"name":"AgentTrust"},"license":"MIT","homepage":"https://github.com/mmsadek96/agentgateway/tree/main/packages/agent-sdk#readme","repository":{"type":"git","url":"git+https://github.com/mmsadek96/agentgateway.git","directory":"packages/agent-sdk"},"bugs":{"url":"https://github.com/mmsadek96/agentgateway/issues"},"dependencies":{},"devDependencies":{"typescript":"^5.3.3"},"engines":{"node":">=18.0.0"},"_id":"@agent-trust/sdk@1.3.0","gitHead":"c49ce282b8f88fa534e2414e17a2edec7f555a42","_nodeVersion":"22.20.0","_npmVersion":"10.9.3","dist":{"integrity":"sha512-1fl1Y6eHcaO2s2c4NW0GvP+Y68oWD3Kp2M0K8abqF4KHDzasSdHIuZBTrPCxVJZJVAlt4U6OFLiXp24zEBImag==","shasum":"23f0a0c9a5b82f2b0c97686ce6c416f93a075cf3","tarball":"https://registry.npmjs.org/@agent-trust/sdk/-/sdk-1.3.0.tgz","fileCount":14,"unpackedSize":27513,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIGAfRrlMyFW7DowyTccbKcIKSGF2TC7CD3r1n02Hufc3AiEAgXPMQMA21L/VTAinkmAJWIF3rpYQB1/U3M0/xOltNXY="}]},"_npmUser":{"name":"mmsadek96","email":"mmsadek96@gmail.com"},"directories":{},"maintainers":[{"name":"mmsadek96","email":"mmsadek96@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/sdk_1.3.0_1771781760992_0.6910391766700281"},"_hasShrinkwrap":false}},"time":{"created":"2026-02-21T23:59:57.078Z","modified":"2026-02-22T17:36:01.298Z","1.0.0":"2026-02-21T23:59:57.284Z","1.1.0":"2026-02-22T01:04:09.358Z","1.2.0":"2026-02-22T01:59:02.430Z","1.3.0":"2026-02-22T17:36:01.139Z"},"bugs":{"url":"https://github.com/mmsadek96/agentgateway/issues"},"author":{"name":"AgentTrust"},"license":"MIT","homepage":"https://github.com/mmsadek96/agentgateway/tree/main/packages/agent-sdk#readme","keywords":["ai","agent","trust","sdk","client","certificate","jwt","reputation","ai-agents","agenttrust","scope","scope-manifest","authorization"],"repository":{"type":"git","url":"git+https://github.com/mmsadek96/agentgateway.git","directory":"packages/agent-sdk"},"description":"Client SDK for AI agents to request trust certificates with scope manifests and interact with AgentTrust Gateways. Zero dependencies.","maintainers":[{"name":"mmsadek96","email":"mmsadek96@gmail.com"}],"readme":"# @agent-trust/sdk\n\nClient SDK for AI agents to request trust certificates and interact with AgentTrust Gateways. Zero runtime dependencies. Part of the [AgentTrust](https://github.com/mmsadek96/agentgateway) ecosystem.\n\n## Install\n\n```bash\nnpm install @agent-trust/sdk\n```\n\n## Quick Start\n\n```typescript\nimport { createAgentClient } from '@agent-trust/sdk';\n\nconst agent = createAgentClient({\n  stationUrl: 'https://agentgateway-6f041c655eb3.herokuapp.com',\n  apiKey: 'YOUR_API_KEY',\n  agentId: 'my-agent-001'\n});\n\n// Discover what a gateway offers\nconst catalog = await agent.discoverGateway('https://shop.example.com/agent-gateway');\nconsole.log(catalog.actions);\n\n// Execute an action (certificate is handled automatically)\nconst result = await agent.executeAction(\n  'https://shop.example.com/agent-gateway',\n  'search_products',\n  { query: 'mechanical keyboard' }\n);\n\n// Execute multiple actions in sequence\nconst results = await agent.executeBatch(\n  'https://shop.example.com/agent-gateway',\n  [\n    { actionName: 'search_products', params: { query: 'keyboard' } },\n    { actionName: 'get_product', params: { productId: 'prod_001' } }\n  ]\n);\n```\n\n## Features\n\n- **Automatic certificate management** — requests, caches, and refreshes JWT certificates\n- **Gateway discovery** — programmatically discover available actions\n- **Action execution** — call gateway actions with automatic auth\n- **Batch execution** — run multiple actions in sequence\n- **Auto-retry** — retries once with fresh certificate on 401\n- **Zero dependencies** — uses native `fetch` (Node 18+)\n- **On-chain recording** — every certificate and reputation change is recorded on Base L2, creating an immutable trust history verifiable on [BaseScan](https://basescan.org/address/0xD3cAf18d292168075653322780EF961BF6394c11)\n\n## API\n\n### `createAgentClient(config)`\n\nCreates an agent client instance.\n\n```typescript\nconst agent = createAgentClient({\n  stationUrl: string,  // URL of the AgentTrust Station\n  apiKey: string,      // Developer API key\n  agentId: string      // Agent's external ID\n});\n```\n\n### Methods\n\n| Method | Description |\n|--------|-------------|\n| `getCertificate(forceRefresh?)` | Get a signed JWT certificate |\n| `getScore()` | Get current reputation score |\n| `getStationInfo()` | Get station metadata |\n| `discoverGateway(url)` | Discover gateway's available actions |\n| `executeAction(url, action, params)` | Execute a single action |\n| `executeBatch(url, actions)` | Execute multiple actions in sequence |\n| `hasCachedCertificate()` | Check if a valid certificate is cached |\n| `clearCertificateCache()` | Clear the cached certificate |\n\n## Links\n\n- [Full documentation](https://github.com/mmsadek96/agentgateway)\n- [Live Station](https://agentgateway-6f041c655eb3.herokuapp.com/)\n- [API docs](https://agentgateway-6f041c655eb3.herokuapp.com/docs)\n\n## License\n\nMIT\n","readmeFilename":"README.md"}