{"_id":"@amoghacloud/agentbase","name":"@amoghacloud/agentbase","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@amoghacloud/agentbase","version":"1.0.0","description":"A Node.js SDK allowing autonomous AI agents to programmatically register and manage their own permanent identities on the Base Mainnet `AgentRegistry`.","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"keywords":[],"author":"","license":"ISC","dependencies":{"ethers":"^6.16.0"},"_id":"@amoghacloud/agentbase@1.0.0","gitHead":"3de11d371ff29b559fd93e40dcb4c4bea71a03bf","_nodeVersion":"22.22.0","_npmVersion":"10.9.4","dist":{"integrity":"sha512-xG7VgwZhDHyuqJCL/kSQxiBhXNJFyRF9gL/iHVS+zTX4N8ddfA45sty5hTVaxVKjVWjfukMRObAOGGcA/ynPRw==","shasum":"bffd89665eb2704cac1a45c9d79b1d890cb0b6bb","tarball":"https://registry.npmjs.org/@amoghacloud/agentbase/-/agentbase-1.0.0.tgz","fileCount":4,"unpackedSize":8937,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIB/xwgJCMGVBcx943fCooW3F9I5+x9FZdGBiBtN+N1oxAiEA9A7OSKc9bjDR45k2Rj9+VPfDyTbNa3HHLwLoh7Fc6jw="}]},"_npmUser":{"name":"amoghacloud","email":"amoghacloud@gmail.com"},"directories":{},"maintainers":[{"name":"amoghacloud","email":"amoghacloud@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/agentbase_1.0.0_1779664393286_0.5089693400136601"},"_hasShrinkwrap":false}},"time":{"created":"2026-05-24T23:13:13.165Z","1.0.0":"2026-05-24T23:13:13.428Z","modified":"2026-05-24T23:13:13.604Z"},"maintainers":[{"name":"amoghacloud","email":"amoghacloud@gmail.com"}],"description":"A Node.js SDK allowing autonomous AI agents to programmatically register and manage their own permanent identities on the Base Mainnet `AgentRegistry`.","keywords":[],"license":"ISC","readme":"# @amoghacloud/agentbase\n\nA Node.js SDK allowing autonomous AI agents to programmatically register and manage their own permanent identities on the Base Mainnet `AgentRegistry`.\n\nBecause modern AI agents often possess their own internal wallets (e.g., via Langchain or Coinbase Developer Platform MPC wallets), this SDK enables them to interact with the registry automatically without human intervention.\n\n## Installation\n\n```bash\nnpm install @amoghacloud/agentbase ethers\n```\n\n## Quick Start\n\nAI Agents can wake up, check if they are registered, and register themselves if necessary.\n\n```javascript\nconst { AgentRegistryClient } = require('@amoghacloud/agentbase');\n\n// 1. Initialize with the agent's private key\n// (Ensure the agent's wallet holds at least 0.001 ETH on Base Mainnet)\nconst agentClient = new AgentRegistryClient(process.env.AGENT_PRIVATE_KEY);\n\nasync function bootAgent() {\n    console.log(\"Agent booting up...\");\n\n    // 2. Programmatically register identity\n    // The SDK automatically generates the SHA-256 metadata hash and pays the fee.\n    const receipt = await agentClient.registerIdentity(\n        \"Auto-Trader Bot v2\",\n        \"Claude 3.5 Sonnet\",\n        \"ipfs://QmYourManifestHash\"\n    );\n\n    console.log(`Successfully registered! My on-chain Agent ID is: ${receipt.id}`);\n}\n\nbootAgent();\n```\n\n## API Reference\n\n### `new AgentRegistryClient(signerOrPrivateKey, [rpcUrl])`\n- **`signerOrPrivateKey`**: A raw hex private key or an `ethers.Signer` object.\n- **`rpcUrl`**: Defaults to `https://mainnet.base.org`.\n\n### `client.registerIdentity(name, model, metadataURI)`\nRegisters a new agent. Handles the `0.001 ETH` fee and local SHA-256 generation automatically.\n- Returns: `{ id: string, txHash: string, metadataHash: string }`\n\n### `client.getIdentity(id)`\nLooks up an agent by ID on the ledger.\n- Returns an object containing the agent's `name`, `controller` address, `metadataURI`, and `active` status.\n\n### `client.getStats()`\nReturns global network statistics including total registered agents and contract TVL.\n\n## License\nMIT\n","readmeFilename":"README.md","_rev":"1-77a2dc13ef93d7e123f50db9f617a8e5"}