{"_id":"@dealworks/agent-economy","_rev":"2-e26da3cff510afb46144f87c92cdac93","name":"@dealworks/agent-economy","dist-tags":{"latest":"0.1.1"},"versions":{"0.1.0":{"name":"@dealworks/agent-economy","version":"0.1.0","keywords":["mcp","model-context-protocol","openclaw","cursor","claude","agent","economy","escrow","payments","stripe","fiduciary","ai-agent","autonomous-agent","delivery-vs-payment","dvp","contracts"],"author":{"name":"deal.works"},"license":"MIT","_id":"@dealworks/agent-economy@0.1.0","maintainers":[{"name":"swgoettelman","email":"swgoettelman@gmail.com"}],"homepage":"https://deal.works","bugs":{"url":"https://github.com/swgoettelman/deal.works/issues"},"bin":{"dealworks-agent-economy":"dist/index.js"},"dist":{"shasum":"67721f5e9688e7f38225d7fbb562984819886e78","tarball":"https://registry.npmjs.org/@dealworks/agent-economy/-/agent-economy-0.1.0.tgz","fileCount":46,"integrity":"sha512-Svh41eKmJ7ndxlmm21mIUqk7xUYnbxJGpL94yF4x4oM/X5f9mWDNIfVOrx5cjMQ0jpn3+8atMVumCKluY8A7eg==","signatures":[{"sig":"MEYCIQCgxCho2y1N7Iy+Da9I3d9p4mxXOLMwabWF8ee+6V69iAIhAJsi0fL2vhz9Z1jEKNPIKd1tMCMBGEuFEgOXL+3Skk67","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":59121},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","engines":{"node":">=18.0.0"},"gitHead":"f15ab22100b5a1584ed810f44ea979576524ef60","scripts":{"dev":"tsc --watch","build":"tsc","clean":"rm -rf dist","start":"node dist/index.js","typecheck":"tsc --noEmit","prepublishOnly":"pnpm run build"},"_npmUser":{"name":"swgoettelman","email":"swgoettelman@gmail.com"},"repository":{"url":"git+https://github.com/swgoettelman/deal.works.git","type":"git","directory":"packages/agent-economy"},"_npmVersion":"11.6.2","description":"The fiduciary and economic engine for autonomous AI agents. Equip OpenClaw, Cursor, or Claude Desktop agents with escrow, Delivery-vs-Payment contracts, and Stripe payment rails.","directories":{},"_nodeVersion":"24.11.1","dependencies":{"zod":"^3.23.8","@modelcontextprotocol/sdk":"^1.25.3"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.7.0","@types/node":"^22.0.0"},"_npmOperationalInternal":{"tmp":"tmp/agent-economy_0.1.0_1772214348278_0.3511032492647568","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@dealworks/agent-economy","version":"0.1.1","description":"MCP server for agent-to-agent economic coordination on deal.works","type":"module","main":"./dist/index.js","module":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"bin":{"agent-economy":"dist/cli.js"},"scripts":{"build":"tsc","dev":"tsc --watch","start":"node dist/cli.js","lint":"eslint src --ext .ts","type-check":"tsc --noEmit","clean":"rm -rf dist","test":"vitest run","test:watch":"vitest"},"keywords":["mcp","model-context-protocol","deal-works","agent-economy","dvp","escrow","attestation"],"author":{"name":"deal.works"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/goettelman/deal-works.git","directory":"packages/agent-economy"},"engines":{"node":">=18"},"dependencies":{"@modelcontextprotocol/sdk":"^1.0.0","zod":"^3.24.2","zod-to-json-schema":"^3.24.3"},"devDependencies":{"@types/node":"^22.13.5","typescript":"^5.7.3","vitest":"^3.0.7"},"peerDependencies":{"@goettelman/database":"workspace:*"},"peerDependenciesMeta":{"@goettelman/database":{"optional":true}},"gitHead":"f8aa6c08d1333bf12d45d40df7590609c085b6e0","_id":"@dealworks/agent-economy@0.1.1","bugs":{"url":"https://github.com/goettelman/deal-works/issues"},"homepage":"https://github.com/goettelman/deal-works#readme","_nodeVersion":"24.11.1","_npmVersion":"11.6.2","dist":{"integrity":"sha512-CX61Be6zd7yDHvVGsm8YXBc54vSzEpQMx9k3gFyLGnhMSPRhWAnT+Tt+h39gYzLfrXEw8neTKc3UkIdgumP7Pw==","shasum":"6e8f2862069d8912df60a2a2ed211dfcd90d371a","tarball":"https://registry.npmjs.org/@dealworks/agent-economy/-/agent-economy-0.1.1.tgz","fileCount":18,"unpackedSize":49312,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIFVJWER6GULXgFyGIpTJPQy6OVuulOZLaO0IQg4qLKJJAiEA8TLm4w0mVa1PAVeoPd+E8vG3KDLDLLroDwldKwY4LCs="}]},"_npmUser":{"name":"swgoettelman","email":"swgoettelman@gmail.com"},"directories":{},"maintainers":[{"name":"swgoettelman","email":"swgoettelman@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/agent-economy_0.1.1_1772246694933_0.15159952736673232"},"_hasShrinkwrap":false}},"time":{"created":"2026-02-27T17:45:48.171Z","modified":"2026-02-28T02:44:55.243Z","0.1.0":"2026-02-27T17:45:48.430Z","0.1.1":"2026-02-28T02:44:55.090Z"},"bugs":{"url":"https://github.com/goettelman/deal-works/issues"},"author":{"name":"deal.works"},"license":"MIT","homepage":"https://github.com/goettelman/deal-works#readme","keywords":["mcp","model-context-protocol","deal-works","agent-economy","dvp","escrow","attestation"],"repository":{"type":"git","url":"git+https://github.com/goettelman/deal-works.git","directory":"packages/agent-economy"},"description":"MCP server for agent-to-agent economic coordination on deal.works","maintainers":[{"name":"swgoettelman","email":"swgoettelman@gmail.com"}],"readme":"# @dealworks/agent-economy\n\nMCP server for agent-to-agent economic coordination on deal.works.\n\n## Overview\n\nThe agent-economy package provides three MCP tools for autonomous agents to coordinate economic transactions:\n\n- **draft_dvp_contract**: Create Delivery vs Payment (DvP) contracts with escrow\n- **check_escrow_status**: Monitor escrow state and block confirmations\n- **log_attestation**: Record attestations for delivery, quality, and disputes\n\n## Installation\n\n```bash\nnpm install @dealworks/agent-economy\n```\n\n## Usage\n\n### As an MCP Server\n\nRun directly via npx:\n\n```bash\nnpx @dealworks/agent-economy\n```\n\nOr with demo mode (no real API calls):\n\n```bash\nAGENT_ECONOMY_DEMO_MODE=true npx @dealworks/agent-economy\n```\n\n### Claude Desktop Configuration\n\nAdd to your Claude Desktop config (`~/Library/Application Support/Claude/claude_desktop_config.json`):\n\n```json\n{\n  \"mcpServers\": {\n    \"agent-economy\": {\n      \"command\": \"npx\",\n      \"args\": [\"@dealworks/agent-economy\"],\n      \"env\": {\n        \"DEAL_WORKS_API_KEY\": \"your-api-key-here\"\n      }\n    }\n  }\n}\n```\n\nFor demo mode:\n\n```json\n{\n  \"mcpServers\": {\n    \"agent-economy\": {\n      \"command\": \"npx\",\n      \"args\": [\"@dealworks/agent-economy\"],\n      \"env\": {\n        \"AGENT_ECONOMY_DEMO_MODE\": \"true\"\n      }\n    }\n  }\n}\n```\n\n### Programmatic Usage\n\n```typescript\nimport { createAgentEconomyServer } from \"@dealworks/agent-economy\";\nimport { StdioServerTransport } from \"@modelcontextprotocol/sdk/server/stdio.js\";\n\nconst server = createAgentEconomyServer({\n  apiBaseUrl: \"https://api.deal.works/v1\",\n  apiKey: process.env.DEAL_WORKS_API_KEY,\n  demoMode: {\n    enabled: false,\n  },\n});\n\nconst transport = new StdioServerTransport();\nawait server.connect(transport);\n```\n\n## Tools\n\n### draft_dvp_contract\n\nCreate a DvP contract between two agents:\n\n```json\n{\n  \"buyerAgentWallet\": \"0x1234...5678\",\n  \"sellerAgentWallet\": \"0xabcd...ef01\",\n  \"amount\": 1000,\n  \"deliverableDescription\": \"API integration for data analysis\",\n  \"deadlineAt\": \"2026-03-15T00:00:00Z\"\n}\n```\n\n### check_escrow_status\n\nCheck the status of an escrow:\n\n```json\n{\n  \"contractId\": \"dvp_abc123\"\n}\n```\n\nReturns:\n- Current status (PENDING_FUNDING, FUNDED, RELEASED, REFUNDED, DISPUTED)\n- Block confirmations (0-12+)\n- Finality state (isFinalized: true when 12+ confirmations)\n\n### log_attestation\n\nRecord an attestation for a contract:\n\n```json\n{\n  \"contractId\": \"dvp_abc123\",\n  \"attestationType\": \"DELIVERY_CONFIRMED\",\n  \"attestorWallet\": \"0x1234...5678\",\n  \"evidenceHash\": \"QmXxx...\",\n  \"notes\": \"Deliverable meets all requirements\"\n}\n```\n\nAttestation types:\n- DELIVERY_CONFIRMED\n- QUALITY_VERIFIED\n- DEADLINE_MET\n- DISPUTE_FILED\n- DISPUTE_RESOLVED\n\n## Environment Variables\n\n| Variable | Description | Required |\n|----------|-------------|----------|\n| `DEAL_WORKS_API_KEY` | API key for authentication | Yes (production) |\n| `AGENT_ECONOMY_API_URL` | Base URL for v1 API routes | No (defaults to https://api.deal.works/v1) |\n| `AGENT_ECONOMY_DEMO_MODE` | Set to \"true\" for demo mode | No |\n\n## Demo Mode\n\nDemo mode simulates all operations without making real API calls. Useful for:\n- Local development\n- Testing integrations\n- Demos and presentations\n\nIn demo mode:\n- Contracts get generated IDs and addresses\n- Escrow always shows 12 confirmations (finalized)\n- Attestations return simulated on-chain hashes\n\n## License\n\nMIT\n","readmeFilename":"README.md"}