{"_id":"@0xragna/agent-rep","name":"@0xragna/agent-rep","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@0xragna/agent-rep","version":"1.0.0","description":"AgentRep SDK — On-chain reputation for AI agents","type":"module","main":"dist/index.js","types":"dist/index.d.ts","exports":{".":{"import":"./dist/index.js","types":"./dist/index.d.ts"}},"scripts":{"build":"tsc","dev":"tsc --watch"},"dependencies":{"viem":"^2.52.2"},"devDependencies":{"@types/node":"^26.0.0","typescript":"^5.7.0"},"keywords":["agent","reputation","soulbound","base","web3","ai"],"license":"MIT","_id":"@0xragna/agent-rep@1.0.0","gitHead":"fc6a9d114dd5496afb531d07b4ec5dfb34d38f19","_nodeVersion":"22.22.2","_npmVersion":"10.9.7","dist":{"integrity":"sha512-dBq1c3mX8C0Uz3oTjJk2vGOZC4RLWmmgQNtEbzXMIYPd2TF8T4rdRXkwCAAiFA0/lMzqf3aPv04rpf7lEIF9wA==","shasum":"ebd9c64f3a884bb3390757ab6fece31770dc92e7","tarball":"https://registry.npmjs.org/@0xragna/agent-rep/-/agent-rep-1.0.0.tgz","fileCount":5,"unpackedSize":58265,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIHQS3Wzjrq1pO+Qal1Ed6B6l5ug67D7RWDIoFtBgTVnuAiBWNdOtrNERwix/PHx+lfWmn1q3F8vY6nt4Eq1zZ2hPUQ=="}]},"_npmUser":{"name":"0xragna","email":"ragradar@gmail.com"},"directories":{},"maintainers":[{"name":"0xragna","email":"ragradar@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/agent-rep_1.0.0_1782022941085_0.2952873122948261"},"_hasShrinkwrap":false}},"time":{"created":"2026-06-21T06:22:20.798Z","1.0.0":"2026-06-21T06:22:21.249Z","modified":"2026-06-21T06:22:21.584Z"},"maintainers":[{"name":"0xragna","email":"ragradar@gmail.com"}],"description":"AgentRep SDK — On-chain reputation for AI agents","keywords":["agent","reputation","soulbound","base","web3","ai"],"license":"MIT","readme":"# @ragna/agent-rep\n\nOn-chain reputation protocol for AI agents. Soulbound identity + reputation scoring on Base.\n\n## Install\n\n```bash\nnpm install @ragna/agent-rep\n```\n\n## Quick Start\n\n```typescript\nimport { AgentRepClient } from '@ragna/agent-rep';\n\n// Read-only (no wallet needed)\nconst client = new AgentRepClient();\n\n// Get agent info\nconst agent = await client.getAgent(1);\nconsole.log(agent.name);        // \"RagRadar\"\nconsole.log(agent.reputation);  // 100n (raw, use formatReputation)\n\n// Check reputation\nconst percent = await client.getReputationPercent(1);\nconsole.log(percent);           // \"1.00\"\n\nconst good = await client.isGoodStanding(1);\nconsole.log(good);              // false (needs >= 5.00%)\n\n// Total agents\nconst total = await client.totalAgents();\n```\n\n## Write Operations (needs wallet)\n\n```typescript\nimport { AgentRepClient } from '@ragna/agent-rep';\nimport { baseSepolia } from 'viem/chains';\n\nconst client = new AgentRepClient({\n  chain: baseSepolia,\n  privateKey: '0x...', // your private key\n});\n\n// Register agent\nconst tx = await client.register('MyAgent', 'https://my-api.com');\n\n// Stake ETH\nconst stakeTx = await client.stake(1, parseEther('0.01'));\n\n// Score agent (requires scorer role)\nconst scoreTx = await client.score(1, 'api_uptime_30d');\n```\n\n## Contract\n\n- **Base Sepolia**: `0xF11c856D021900f9c312e0e80913A7a0D6af40ED`\n- **Base Mainnet**: coming soon\n\n## API\n\n| Method | Description |\n|--------|-------------|\n| `getAgent(id)` | Get full agent info |\n| `getAgentByAddress(addr)` | Get agent ID by owner |\n| `getReputationPercent(id)` | Rep as \"75.50\" string |\n| `isGoodStanding(id)` | Check if >= 5.00% |\n| `totalAgents()` | Total registered |\n| `isScorer(addr)` | Check scorer role |\n| `isSlasher(addr)` | Check slasher role |\n| `getConstants()` | Contract constants |\n| `register(name, endpoint)` | Register new agent |\n| `score(id, reason)` | Add reputation (scorer) |\n| `slash(id, reason)` | Reduce reputation (slasher) |\n| `stake(id, amount)` | Stake ETH |\n| `unstake(id, amount)` | Unstake ETH |\n| `getAgents(start?, count?)` | Get all agents |\n\n## Utilities\n\n```typescript\nAgentRepClient.formatReputation(7550n); // \"75.50%\"\nAgentRepClient.formatStake(1000000000000000000n); // \"1.0000 ETH\"\n```\n\n## License\n\nMIT\n","readmeFilename":"README.md","_rev":"1-6ca600bac7ebe875de8e9c7f602d0045"}