{"_id":"@agentfabric/sdk","_rev":"2-a4ceb1f989dc58de7d8b6202de2c68e5","name":"@agentfabric/sdk","dist-tags":{"latest":"1.0.1"},"versions":{"1.0.0":{"name":"@agentfabric/sdk","version":"1.0.0","keywords":["ai-agents","filecoin","web3","memory","decentralized"],"author":{"name":"Agent Fabric Team"},"license":"MIT","_id":"@agentfabric/sdk@1.0.0","maintainers":[{"name":"defimessiah","email":"defimessaih@gmail.com"}],"dist":{"shasum":"22a3bf61c2eb9eefeb5578e2f53fdafa537c0a10","tarball":"https://registry.npmjs.org/@agentfabric/sdk/-/sdk-1.0.0.tgz","fileCount":10,"integrity":"sha512-yAQKNEF0QAgtWEp1T73GBn9V1pAQzLq6LWNYi5A8k0XgN36R9Kh8P3JuyrNy89ML7zKykTqHJAiVkt+IbtzJFw==","signatures":[{"sig":"MEUCIHs7iqZgKFWyRTnLDJ+iRAjJvjUOSeeyoS4mvfU2UamMAiEAn4qBJiXQZM4jLC5hNlCsuDt4wXMvCKgBQZE9MlADDcA=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":13414},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","scripts":{"build":"tsc","prepublishOnly":"npm run build"},"_npmUser":{"name":"defimessiah","email":"defimessaih@gmail.com"},"_npmVersion":"10.9.4","description":"Agent Fabric SDK - Decentralized cloud for AI agents","directories":{},"_nodeVersion":"22.22.1","dependencies":{"axios":"^1.6.7","ethers":"^6.11.1"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.3.3","@types/node":"^20.11.0","@types/axios":"^0.9.36"},"_npmOperationalInternal":{"tmp":"tmp/sdk_1.0.0_1773794518322_0.4832514826047949","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@agentfabric/sdk","version":"1.0.1","description":"Agent Fabric SDK - Decentralized cloud for AI agents","type":"module","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"build":"tsc","prepublishOnly":"npm run build"},"keywords":["ai-agents","filecoin","web3","memory","decentralized"],"author":{"name":"Agent Fabric Team"},"license":"MIT","dependencies":{"axios":"^1.6.7","ethers":"^6.11.1"},"devDependencies":{"@types/axios":"^0.9.36","@types/node":"^20.11.0","typescript":"^5.3.3"},"_id":"@agentfabric/sdk@1.0.1","_nodeVersion":"22.22.1","_npmVersion":"10.9.4","dist":{"integrity":"sha512-PsfZutsFQmIWQ544yP8eGY7uakYzQrsol7jqimAV6aY2zP4JrHfscAZZI5TUOKDt2LOj7h0aAl6PqlppZCiGtA==","shasum":"19149127e4bc841701c26e41793d8bf93ba8239a","tarball":"https://registry.npmjs.org/@agentfabric/sdk/-/sdk-1.0.1.tgz","fileCount":10,"unpackedSize":14478,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIF1FKFfQxVA9Dbccp3IbKGoKXe9cF8TMSEvaIWNIHBZNAiEAxye/7459ElHqs4u8U9KjmqTVhuE/vlgj1LOrZFv1wnk="}]},"_npmUser":{"name":"defimessiah","email":"defimessaih@gmail.com"},"directories":{},"maintainers":[{"name":"defimessiah","email":"defimessaih@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/sdk_1.0.1_1773810695861_0.6938705875454725"},"_hasShrinkwrap":false}},"time":{"created":"2026-03-18T00:41:58.237Z","modified":"2026-03-18T05:11:36.178Z","1.0.0":"2026-03-18T00:41:58.476Z","1.0.1":"2026-03-18T05:11:36.010Z"},"author":{"name":"Agent Fabric Team"},"license":"MIT","keywords":["ai-agents","filecoin","web3","memory","decentralized"],"description":"Agent Fabric SDK - Decentralized cloud for AI agents","maintainers":[{"name":"defimessiah","email":"defimessaih@gmail.com"}],"readme":"# 🚀 Agent Fabric SDK (`@agentfabric/sdk`)\n\n**The Unstoppable Infrastructure for AI Agents.**\nGive your autonomous AI agent a permanent brain on **Filecoin/IPFS** with just 3 lines of code.\n\n![Agent Fabric](https://img.shields.io/badge/Agent_Fabric-Active-00ffff?style=for-the-badge)\n![NPM Version](https://img.shields.io/badge/npm-v1.0.0-cb3837?style=for-the-badge)\n![License](https://img.shields.io/badge/license-MIT-green?style=for-the-badge)\n\n## 🧠 What is this?\nAI agents suffer from **amnesia**. When a server reboots, their local state is wiped. Centralized databases (like AWS S3) introduce trust boundaries and massive Web2 overhead.\n\n**Agent Fabric** is a decentralized, pay-per-request infrastructure layer. \nWe allow AI agents to cryptographically pin their JSON state directly to the Filecoin network via Lighthouse. They pay for this compute natively using EVM micro-transactions on **Base Sepolia**.\n\n## ⚡ Hackathon Quickstart Guide\n\n### 1. Install the SDK\n```bash\nnpm install @agentfabric/sdk ethers\n```\n\n### 2. Fund Your Agent (The Paymaster)\nAgent Fabric runs on the **x402 Protocol**. To use the API, your agent's wallet must hold at least **0.0001 ETH** on the `AgentPaymaster` smart contract deployed on Base Sepolia.\n> **Contract Address (Base Sepolia):** `0x64a968FF205eb8DAC54Cc6A860704d8F263D7519`\n\n*(You can deposit funds via our Frontend Dashboard at `https://agentfabric.netlify.app`)*\n\n### 3. Initialize Your Agent's Brain\nDrop this into your Node.js bot:\n\n```typescript\nimport { AgentFabric } from '@agentfabric/sdk';\n\n// 1. Give the agent its private key. \n// The SDK automatically handles the cryptographic EVM signatures required for x402 authentication.\nconst agent = new AgentFabric({ \n    privateKey: process.env.AGENT_PRIVATE_KEY \n});\n\nasync function main() {\n    console.log(\"Saving state to Filecoin...\");\n\n    // 2. Pass any JSON object you want the agent to remember forever.\n    const result = await agent.storeMemory({ \n        current_mission: \"DeFi Arbitrage\",\n        trades_executed: 42,\n        profit_usd: 1400.50\n    });\n\n    console.log(`✅ Success! Memory pinned to Filecoin.`);\n    console.log(`🔗 Verifiable IPFS URL: ${result.lighthouseUrl}`);\n}\n\nmain();\n```\n\n## 🛠️ API Reference\n\n### `new AgentFabric(config: AgentFabricConfig)`\nCreates a new instance of the SDK.\n- `privateKey` (string, required): The hex private key of the agent's EVM wallet.\n- `apiUrl` (string, optional): Overrides the default Agent Fabric gateway.\n\n### `agent.storeMemory(state: Record<string, any>)`\nCryptographically signs the `state` payload, validates the agent's Base Sepolia balance, and pins the JSON to Filecoin.\nReturns:\n```typescript\n{\n    success: boolean;\n    message: string;\n    cid: string;          // The IPFS/Filecoin Content Identifier\n    lighthouseUrl: string;// Public gateway link to view the data\n    agentId: string;      // The recovered EVM public address\n    cost: string;         // The micro-transaction cost deducted\n    timestamp: string;\n}\n```\n\n---\nBuilt with ❤️ for the Agentic Economy.\n","readmeFilename":"README.md"}