{"_id":"@aimarket/agent","_rev":"4-d15f52ac19ed8d4e53db34ff778018a9","name":"@aimarket/agent","dist-tags":{"latest":"0.2.1"},"versions":{"0.1.0":{"name":"@aimarket/agent","version":"0.1.0","license":"MIT","_id":"@aimarket/agent@0.1.0","maintainers":[{"name":"alexar76","email":"alexar76@rambler.ru"}],"homepage":"https://github.com/alexar76/aimarket-sdks/tree/main/typescript","bugs":{"url":"https://github.com/alexar76/aimarket-sdks/issues"},"dist":{"shasum":"bf418229f5e6fbcbff049f40777160e4bd8681a3","tarball":"https://registry.npmjs.org/@aimarket/agent/-/agent-0.1.0.tgz","fileCount":16,"integrity":"sha512-slaUD+6K37x9BLkx3+C+NvB3E+/PQJwzfNftA6cq83kKlr8XP+fZlwc0sFm0dv03lcPKPmgAgZt7UwgZ4WErzQ==","signatures":[{"sig":"MEUCIC+UiJEHjYGftlw7gCMl9T62fgrPDZ5DzKxg+1lyJAZ4AiEAn5R1AfvxHzbFprXZ9qYWcNeMJ2VAuKyCIbHY6F/X6Qw=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":46281},"main":"dist/index.js","types":"dist/index.d.ts","gitHead":"01a0e2f0eea1249d9c57fa0f264adc89260f84b4","scripts":{"lint":"eslint src/","test":"vitest run","build":"tsc","prepublishOnly":"npm run build"},"_npmUser":{"name":"alexar76","email":"alexar76@rambler.ru"},"repository":{"url":"git+https://github.com/alexar76/aimarket-sdks.git","type":"git"},"_npmVersion":"10.9.4","description":"AI Market Protocol v2 consumer SDK for TypeScript — Electron, Node.js, web apps","directories":{},"_nodeVersion":"22.22.1","dependencies":{"viem":"^2.52.2","tweetnacl":"^1.0.3","@noble/curves":"^2.2.0","@noble/hashes":"^2.2.0","tweetnacl-util":"^0.15.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"eslint":"^8.57.0","vitest":"^1.6.0","typescript":"^5.4.0","@types/node":"^20.0.0"},"_npmOperationalInternal":{"tmp":"tmp/agent_0.1.0_1781291720995_0.32848833621188045","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@aimarket/agent","version":"0.1.1","license":"MIT","_id":"@aimarket/agent@0.1.1","maintainers":[{"name":"alexar76","email":"alexar76@rambler.ru"}],"homepage":"https://github.com/alexar76/aimarket-sdks/tree/main/typescript","bugs":{"url":"https://github.com/alexar76/aimarket-sdks/issues"},"dist":{"shasum":"e4bad47934d3fd8ad52bd4b05f420e5005e7acb0","tarball":"https://registry.npmjs.org/@aimarket/agent/-/agent-0.1.1.tgz","fileCount":16,"integrity":"sha512-LPNGqnadGAryVrYMhAYohIQfCAoSmAWvbubtH1zgA+KV3GlujWWlMa2G9j0tRXOyQ3f/W9aGJodxfrSV6rdzuw==","signatures":[{"sig":"MEUCIDNSspAwBg2uAVFjDWETvx81UTBFEoBpTjP8ni9gbCupAiEAvax40M7BTZQLq+Q/qMAfj5j0HcLODMFAW0J1W2ksyAs=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":51197},"main":"dist/index.js","types":"dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js","require":"./dist/index.js"}},"gitHead":"d42f93e6262861b0f4fc66b146b0f335c1337b97","scripts":{"lint":"eslint src/","test":"vitest run","build":"tsc","prepublishOnly":"npm run build"},"_npmUser":{"name":"alexar76","email":"alexar76@rambler.ru"},"repository":{"url":"git+https://github.com/alexar76/aimarket-sdks.git","type":"git"},"_npmVersion":"10.9.4","description":"AI Market Protocol v2 consumer SDK for TypeScript — Electron, Node.js, web apps","directories":{},"_nodeVersion":"22.22.1","dependencies":{"viem":"^2.52.2","tweetnacl":"^1.0.3","@noble/curves":"^2.2.0","@noble/hashes":"^2.2.0","tweetnacl-util":"^0.15.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"eslint":"^8.57.0","vitest":"^1.6.0","typescript":"^5.4.0","@types/node":"^20.0.0"},"_npmOperationalInternal":{"tmp":"tmp/agent_0.1.1_1782902813427_0.3684894339478175","host":"s3://npm-registry-packages-npm-production"}},"0.2.0":{"name":"@aimarket/agent","version":"0.2.0","license":"MIT","_id":"@aimarket/agent@0.2.0","maintainers":[{"name":"alexar76","email":"alexar76@rambler.ru"}],"homepage":"https://github.com/alexar76/aimarket-sdks/tree/main/typescript","bugs":{"url":"https://github.com/alexar76/aimarket-sdks/issues"},"dist":{"shasum":"8cf27c476515ccb7a180f90ce16e20bc4c47ac72","tarball":"https://registry.npmjs.org/@aimarket/agent/-/agent-0.2.0.tgz","fileCount":16,"integrity":"sha512-zJSRZDClOL4eIL/lHm7N8LS7Px4KfQvBxymsSv+WBNQLmJQa+pS3WG/ILtTZvbuAF5wlDdQGR5Kiu/7VvFOwwg==","signatures":[{"sig":"MEUCIQDfwRGnPZ9zRu6DYxg0a1WAgKKPL+qaFrfuPu1HsPkKSQIgQ1lcOXC3WoXELhx8SasNRx4l/Yl2AP20+bMxaAdIhwY=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":56101},"main":"dist/index.js","types":"dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js","require":"./dist/index.js"}},"gitHead":"a42aa97adcfa119d2abb4e36e2e0bf2f16d035e0","scripts":{"lint":"eslint src/","test":"vitest run","build":"tsc","prepublishOnly":"npm run build"},"_npmUser":{"name":"alexar76","email":"alexar76@rambler.ru"},"repository":{"url":"git+https://github.com/alexar76/aimarket-sdks.git","type":"git"},"_npmVersion":"10.9.4","description":"AI Market Protocol v2 consumer SDK for TypeScript — Electron, Node.js, web apps","directories":{},"_nodeVersion":"22.22.1","dependencies":{"viem":"^2.52.2","tweetnacl":"^1.0.3","@noble/curves":"^2.2.0","@noble/hashes":"^2.2.0","tweetnacl-util":"^0.15.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"eslint":"^8.57.0","vitest":"^1.6.0","typescript":"^5.4.0","@types/node":"^20.0.0"},"_npmOperationalInternal":{"tmp":"tmp/agent_0.2.0_1784622499873_0.3787147128732744","host":"s3://npm-registry-packages-npm-production"}},"0.2.1":{"name":"@aimarket/agent","version":"0.2.1","description":"AI Market Protocol v2 consumer SDK for TypeScript — Electron, Node.js, web apps","repository":{"type":"git","url":"git+https://github.com/alexar76/aimarket-sdks.git"},"homepage":"https://github.com/alexar76/aimarket-sdks/tree/main/typescript","license":"MIT","main":"dist/index.js","types":"dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","require":"./dist/index.js","import":"./dist/index.js","default":"./dist/index.js"}},"publishConfig":{"access":"public"},"scripts":{"build":"tsc","test":"vitest run","lint":"eslint src/","prepublishOnly":"npm run build"},"dependencies":{"@noble/curves":"^2.2.0","@noble/hashes":"^2.2.0","tweetnacl":"^1.0.3","tweetnacl-util":"^0.15.1","viem":"^2.52.2"},"devDependencies":{"@types/node":"^20.0.0","eslint":"^8.57.0","typescript":"^5.4.0","vitest":"^1.6.0"},"_id":"@aimarket/agent@0.2.1","gitHead":"cfc937cee55848b0deb803c7db08ff3a27a3bcbd","bugs":{"url":"https://github.com/alexar76/aimarket-sdks/issues"},"_nodeVersion":"22.22.1","_npmVersion":"10.9.4","dist":{"integrity":"sha512-pdCV7Ik1Co61yJpETEFw4CyEijd180w30ANa5UQ2PO4/9DgPC0gE7I+z0/e0FDCPEYjQcm9VhQhhQQ8PrdxBZQ==","shasum":"78c6799c6922e4eeb21e106eada8ecb23014ec88","tarball":"https://registry.npmjs.org/@aimarket/agent/-/agent-0.2.1.tgz","fileCount":18,"unpackedSize":68437,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQC419rzoRd0w8Ac7H88/2dND8EKLl0lNWO/3H257WOSYwIgZOuwZGJCrAVj87cnjXoIFdsYcmdaLx2GWhWRUMyMGZE="}]},"_npmUser":{"name":"alexar76","email":"alexar76@rambler.ru"},"directories":{},"maintainers":[{"name":"alexar76","email":"alexar76@rambler.ru"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/agent_0.2.1_1785184151510_0.4222177010104131"},"_hasShrinkwrap":false}},"time":{"created":"2026-06-12T19:15:20.822Z","modified":"2026-07-27T20:29:11.902Z","0.1.0":"2026-06-12T19:15:21.486Z","0.1.1":"2026-07-01T10:46:53.587Z","0.2.0":"2026-07-21T08:28:20.002Z","0.2.1":"2026-07-27T20:29:11.708Z"},"bugs":{"url":"https://github.com/alexar76/aimarket-sdks/issues"},"license":"MIT","homepage":"https://github.com/alexar76/aimarket-sdks/tree/main/typescript","repository":{"type":"git","url":"git+https://github.com/alexar76/aimarket-sdks.git"},"description":"AI Market Protocol v2 consumer SDK for TypeScript — Electron, Node.js, web apps","maintainers":[{"name":"alexar76","email":"alexar76@rambler.ru"}],"readme":"# @aimarket/agent\n\nAI Market Protocol v2 consumer SDK for **TypeScript** — Electron, Node.js servers, and web apps.\n\nDiscover, pay for, and invoke AI capabilities from the decentralized marketplace, with production cryptography:\n\n- **Ed25519** (`ed25519:<base64>`) for canonical hub / invoke signatures\n- **EIP-712** (`keccak256` + secp256k1, `eip712:0x<r><s><v>`) for on-chain channel debits\n\nPart of the [AIMarket SDKs](https://github.com/alexar76/aimarket-sdks) (Dart · TypeScript · Rust) — all three ship the same version and the same model shapes, enforced by an ecosystem parity guard in CI.\n\n## Install\n\n```bash\n# Published on npm (v0.1.1+ — CommonJS require() on Node 20/22):\nnpm install @aimarket/agent\n\n# ESM / TypeScript:\nimport { AimarketAgent } from '@aimarket/agent';\n\n# CommonJS:\nconst { AimarketAgent } = require('@aimarket/agent');\n```\n\n## Quick start\n\n```ts\nimport { AimarketAgent } from '@aimarket/agent';\n\nconst agent = new AimarketAgent({\n  hubUrl: 'https://modelmarket.dev',\n  walletKey: loadYourWalletKey(),\n});\n\n// Discover capabilities for an intent — returns a ranked PlanStep[].\nconst plan = await agent.discover({\n  intent: 'ATS scoring rules for fintech roles',\n  budget: 1.0,\n  limit: 5,\n});\n\n// Open a $5 channel (good for ~50 calls), then invoke the best match.\nconst channel = await agent.openChannel(5.0);\nconst result = await agent.invoke({\n  capabilityId: plan[0].capability.capability_id,\n  input: { target_role: 'Senior PM', industry: 'fintech' },\n  channelId: channel.channel_id,\n});\n\nconsole.log('Output:', result.result, '· cost $', result.price_usd, '· TEE', result.tee_verified);\nawait agent.closeChannel(channel.channel_id);\n```\n\n## Links\n\n- Ecosystem & live demos: <https://modeldev.modelmarket.dev>\n- Protocol spec & schemas: <https://github.com/alexar76/aimarket-protocol>\n\n## License\n\nMIT\n","readmeFilename":"README.md"}