{"_id":"@agrentingai/paperclip-adapter","_rev":"6-bd737d37cf30e5b4400486663699a0d1","name":"@agrentingai/paperclip-adapter","dist-tags":{"latest":"0.5.1"},"versions":{"0.2.0":{"name":"@agrentingai/paperclip-adapter","version":"0.2.0","keywords":["paperclip","agrenting","adapter","ai-agents","cacp"],"author":{"name":"AgRenting"},"license":"MIT","_id":"@agrentingai/paperclip-adapter@0.2.0","maintainers":[{"name":"agrenting","email":"zaali@live.com"}],"homepage":"https://github.com/AgRenting/paperclip-adapter#readme","bugs":{"url":"https://github.com/AgRenting/paperclip-adapter/issues"},"dist":{"shasum":"5978a7ec48a4da7e437c18d81739b40476e7f6cf","tarball":"https://registry.npmjs.org/@agrentingai/paperclip-adapter/-/paperclip-adapter-0.2.0.tgz","fileCount":32,"integrity":"sha512-/nyYGrl6TwSyuvYR9k5P/J+i8oRRFbXEKGnQ8OgoEQvyil3YBby1E0zZqAoy7ltYxnrnIWXnA/qezaO4sGMZqw==","signatures":[{"sig":"MEUCIQD9ySaQye2GjD5hauUpz7L8lof7isAW7N3ER7kGA+1+JwIgVJNfz0sfMz6PZOlPPYw3dU9cXTaDxbgt7BbVj9f8/0A=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":542006},"type":"module","engines":{"node":">=20.0.0"},"exports":{"./ui":{"types":"./dist/ui/index.d.ts","import":"./dist/ui/index.js","require":"./dist/ui/index.cjs"},"./server":{"types":"./dist/server/index.d.ts","import":"./dist/server/index.js","require":"./dist/server/index.cjs"}},"gitHead":"a5a94bbff1eeb51955b6aec813d29f1634a865d1","scripts":{"dev":"tsup --watch","lint":"eslint server/src/ ui/src/","test":"vitest run","build":"tsup","typecheck":"tsc --noEmit"},"_npmUser":{"name":"agrenting","email":"zaali@live.com"},"repository":{"url":"git+https://github.com/AgRenting/paperclip-adapter.git","type":"git"},"_npmVersion":"11.11.0","description":"Paperclip adapter for Agrenting — remote AI agent orchestration via the Agrenting platform","directories":{},"_nodeVersion":"24.14.1","_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.0.0","react":"^18.2.0","eslint":"^8.56.0","vitest":"^4.1.4","typescript":"^5.9.3","@types/node":"^20.11.0","@typescript-eslint/parser":"^8.58.2","@typescript-eslint/eslint-plugin":"^8.58.2"},"peerDependencies":{"react":">=18.0.0"},"peerDependenciesMeta":{"react":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/paperclip-adapter_0.2.0_1776184382355_0.8439791353461248","host":"s3://npm-registry-packages-npm-production"}},"0.2.2":{"name":"@agrentingai/paperclip-adapter","version":"0.2.2","keywords":["paperclip","agrenting","adapter","ai-agents"],"author":{"name":"AgRenting"},"license":"MIT","_id":"@agrentingai/paperclip-adapter@0.2.2","maintainers":[{"name":"agrenting","email":"zaali@live.com"}],"homepage":"https://github.com/AgRenting/paperclip-adapter#readme","bugs":{"url":"https://github.com/AgRenting/paperclip-adapter/issues"},"dist":{"shasum":"98609afc8802b9def913571cad0d43ddbe0a43f6","tarball":"https://registry.npmjs.org/@agrentingai/paperclip-adapter/-/paperclip-adapter-0.2.2.tgz","fileCount":32,"integrity":"sha512-KjmIQ6iZS26UqemXW5XMG9Yw2ACx9RcWzVHdI2XXr+iwRdY5j59LC/3f7NAbrJQ4xZBenPmiqQhArwnBT85wXQ==","signatures":[{"sig":"MEQCIDTmgtGiiAVGxt8qDoemmyWgTnasskcKOQlHLRC8/UfMAiA4kYztr6pbm+84MmJO2HYWIrdDeJTyOpOxEYkV8XSh0g==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":542510},"type":"module","engines":{"node":">=20.0.0"},"exports":{"./ui":{"types":"./dist/ui/index.d.ts","import":"./dist/ui/index.js","require":"./dist/ui/index.cjs"},"./server":{"types":"./dist/server/index.d.ts","import":"./dist/server/index.js","require":"./dist/server/index.cjs"}},"gitHead":"0fd2b0bf62712f874c01a224ed38274fcce7e34c","scripts":{"dev":"tsup --watch","lint":"eslint server/src/ ui/src/","test":"vitest run","build":"tsup","typecheck":"tsc --noEmit"},"_npmUser":{"name":"agrenting","email":"zaali@live.com"},"repository":{"url":"git+https://github.com/AgRenting/paperclip-adapter.git","type":"git"},"_npmVersion":"11.11.0","description":"Paperclip adapter for Agrenting — remote AI agent orchestration via the Agrenting platform","directories":{},"_nodeVersion":"24.14.1","_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.0.0","react":"^18.2.0","eslint":"^8.56.0","vitest":"^4.1.4","typescript":"^5.9.3","@types/node":"^20.11.0","@typescript-eslint/parser":"^8.58.2","@typescript-eslint/eslint-plugin":"^8.58.2"},"peerDependencies":{"react":">=18.0.0"},"peerDependenciesMeta":{"react":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/paperclip-adapter_0.2.2_1776191457619_0.9251614110089073","host":"s3://npm-registry-packages-npm-production"}},"0.3.0":{"name":"@agrentingai/paperclip-adapter","version":"0.3.0","keywords":["paperclip","paperclipai","agrenting","adapter","ai-agents","agent-adapter"],"author":{"name":"AgRenting"},"license":"MIT","_id":"@agrentingai/paperclip-adapter@0.3.0","maintainers":[{"name":"agrenting","email":"zaali@live.com"}],"homepage":"https://agrenting.com/docs/platform/paperclip-adapter","bugs":{"url":"https://github.com/AgRenting/paperclip-adapter/issues"},"dist":{"shasum":"00691fb0154ebb627476aef26b56f12bcf6fa8af","tarball":"https://registry.npmjs.org/@agrentingai/paperclip-adapter/-/paperclip-adapter-0.3.0.tgz","fileCount":32,"integrity":"sha512-EQHlfi2e50BfRUg1wihpoEkmP5uGiNm95r70H8KXrycfjl33NfaDq+Wc3T8tsffXk8ah0907BLZRzMbiAOkfqw==","signatures":[{"sig":"MEQCIFb5SH25iNLtpyYowhReOEuXiNDeU2D/FUuhtMRhmIXEAiAsMbe/+OGncTZ/fbmLvKSVYAs70pHgdkir2GhlIcyUDA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":571637},"type":"module","engines":{"node":">=20.0.0"},"exports":{"./ui":{"types":"./dist/ui/index.d.ts","import":"./dist/ui/index.js","require":"./dist/ui/index.cjs"},"./server":{"types":"./dist/server/index.d.ts","import":"./dist/server/index.js","require":"./dist/server/index.cjs"}},"gitHead":"840b9ea5b5aa6387fb7a16b79a35a95842acd931","scripts":{"dev":"tsup --watch","lint":"eslint server/src/ ui/src/","test":"vitest run","build":"tsup","typecheck":"tsc --noEmit"},"_npmUser":{"name":"agrenting","email":"zaali@live.com"},"repository":{"url":"git+https://github.com/AgRenting/paperclip-adapter.git","type":"git"},"_npmVersion":"11.4.2","description":"Paperclip adapter for Agrenting — remote AI agent orchestration via the Agrenting platform. Implements the canonical Paperclip AgentAdapter contract for plugin loading via ~/.paperclip/adapter-plugins.json.","directories":{},"_nodeVersion":"22.17.0","_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.0.0","react":"^18.2.0","eslint":"^8.56.0","vitest":"^4.1.4","typescript":"^5.9.3","@types/node":"^20.11.0","@typescript-eslint/parser":"^8.58.2","@typescript-eslint/eslint-plugin":"^8.58.2"},"peerDependencies":{"react":">=18.0.0"},"peerDependenciesMeta":{"react":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/paperclip-adapter_0.3.0_1778075091746_0.6091648852609661","host":"s3://npm-registry-packages-npm-production"}},"0.4.0":{"name":"@agrentingai/paperclip-adapter","version":"0.4.0","keywords":["paperclip","paperclipai","agrenting","adapter","ai-agents","agent-adapter"],"author":{"name":"AgRenting"},"license":"MIT","_id":"@agrentingai/paperclip-adapter@0.4.0","maintainers":[{"name":"agrenting","email":"zaali@live.com"}],"homepage":"https://agrenting.com/docs/platform/paperclip-adapter","bugs":{"url":"https://github.com/AgRenting/paperclip-adapter/issues"},"dist":{"shasum":"fe0ff9c6d84a39df9e466e9e3dbcfc0fd67255bc","tarball":"https://registry.npmjs.org/@agrentingai/paperclip-adapter/-/paperclip-adapter-0.4.0.tgz","fileCount":17,"integrity":"sha512-dFZPia+ZdZXUwG6IE5Yq5RqcPJicQheo+SChBLFbZ8laALA78288f9srIQcYt3tCpQf1PE0mDgMI3CS31Qprkg==","signatures":[{"sig":"MEUCIQCoAkjlgvzylpKQLpOiQYdM1uDgrJ6cV5YtPieOX+uxXwIgaaGjPTkb+4a0QSX+595uiN232hFS3dXtwprNO/uwBVg=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":533025},"type":"module","engines":{"node":">=20.0.0"},"exports":{".":{"types":"./dist/server/index.d.ts","import":"./dist/server/index.js","require":"./dist/server/index.cjs"},"./ui":{"types":"./dist/ui/index.d.ts","import":"./dist/ui/index.js","require":"./dist/ui/index.cjs"},"./server":{"types":"./dist/server/index.d.ts","import":"./dist/server/index.js","require":"./dist/server/index.cjs"}},"gitHead":"e094b4c9e2f79ce1ae8a8e986ed827879aba7a03","scripts":{"dev":"tsup --watch","lint":"eslint server/src/ ui/src/","test":"vitest run","build":"tsup","typecheck":"tsc --noEmit","prepublishOnly":"npm test && npm run typecheck && npm run lint && npm run build"},"_npmUser":{"name":"agrenting","email":"zaali@live.com"},"repository":{"url":"git+https://github.com/AgRenting/paperclip-adapter.git","type":"git"},"_npmVersion":"11.12.1","description":"Hire and monitor remote Agrenting marketplace agents from Paperclip through the canonical ServerAdapterModule contract.","directories":{},"_nodeVersion":"26.0.0","dependencies":{"@paperclipai/adapter-utils":"2026.707.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.0.0","react":"^18.2.0","eslint":"^8.56.0","vitest":"^4.1.4","typescript":"^5.9.3","@types/node":"^20.11.0","@typescript-eslint/parser":"^8.58.2","@typescript-eslint/eslint-plugin":"^8.58.2"},"peerDependencies":{"react":">=18.0.0"},"peerDependenciesMeta":{"react":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/paperclip-adapter_0.4.0_1784358144183_0.4600189574695561","host":"s3://npm-registry-packages-npm-production"}},"0.5.0":{"name":"@agrentingai/paperclip-adapter","version":"0.5.0","keywords":["paperclip","paperclipai","agrenting","adapter","ai-agents","agent-adapter"],"author":{"name":"AgRenting"},"license":"MIT","_id":"@agrentingai/paperclip-adapter@0.5.0","maintainers":[{"name":"agrenting","email":"zaali@live.com"}],"homepage":"https://agrenting.com/docs/platform/paperclip-adapter","bugs":{"url":"https://github.com/AgRenting/paperclip-adapter/issues"},"dist":{"shasum":"1d4c1207f89f2c7402e5633a349d713e7ab8569b","tarball":"https://registry.npmjs.org/@agrentingai/paperclip-adapter/-/paperclip-adapter-0.5.0.tgz","fileCount":17,"integrity":"sha512-k5BoimGbsGEIocNORsnuJPBRgq7jVk7HEDmPgnGr9OXxi7oYCIn8yqRR7TiKjN6GLRnaP+Rz1LDdC9CEZC9PLQ==","signatures":[{"sig":"MEUCICb41WfLAYoIYRx2DRJa/h3yyt6GrGYS39u2UpOmVsjbAiEA4531o2ZkIeon97wBViDjRL6kfp3h6DYI8tiCj6UnMT8=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"sig":"MEUCIQCLKQEIf8jMFQ3W0qZD8iV2daVsIWP2H/lopbiYZXFwKgIgZX0KNASBtUOR/v0i8bd08eEkUhaHpURhuo1ADRytVNE=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":815206},"type":"module","engines":{"node":">=20.0.0"},"exports":{".":{"types":"./dist/server/index.d.ts","import":"./dist/server/index.js","require":"./dist/server/index.cjs"},"./ui":{"types":"./dist/ui/index.d.ts","import":"./dist/ui/index.js","require":"./dist/ui/index.cjs"},"./server":{"types":"./dist/server/index.d.ts","import":"./dist/server/index.js","require":"./dist/server/index.cjs"}},"gitHead":"929a092502262a0b99fdb9c2da657f916ebaef46","scripts":{"dev":"tsup --watch","lint":"eslint server/src/ ui/src/","test":"vitest run","build":"tsup","verify":"npm test && npm run typecheck && npm run lint && npm run build","prepack":"npm run build --silent >/dev/null","typecheck":"tsc --noEmit","prepublishOnly":"npm test && npm run typecheck && npm run lint && npm run build"},"_npmUser":{"name":"agrenting","email":"zaali@live.com"},"repository":{"url":"git+https://github.com/AgRenting/paperclip-adapter.git","type":"git"},"_npmVersion":"11.19.0","description":"Hire and monitor remote Agrenting marketplace agents from Paperclip through the canonical ServerAdapterModule contract.","directories":{},"_nodeVersion":"22.19.0","dependencies":{"@paperclipai/adapter-utils":"2026.707.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.0.0","react":"^18.2.0","eslint":"^8.56.0","vitest":"^4.1.4","typescript":"^5.9.3","@types/node":"^20.11.0","@typescript-eslint/parser":"^8.58.2","@typescript-eslint/eslint-plugin":"^8.58.2"},"peerDependencies":{"react":">=18.0.0"},"peerDependenciesMeta":{"react":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/paperclip-adapter_0.5.0_1790617364934_0.6332942496597003","host":"s3://npm-registry-packages-npm-production"}},"0.5.1":{"_id":"@agrentingai/paperclip-adapter@0.5.1","bugs":{"url":"https://github.com/AgRenting/paperclip-adapter/issues"},"dist":{"shasum":"4502507697254749dce7a4539b8fb03d381512fe","tarball":"https://registry.npmjs.org/@agrentingai/paperclip-adapter/-/paperclip-adapter-0.5.1.tgz","fileCount":17,"integrity":"sha512-EIqhaETSe/G/UDa5OSKre483MVmwicbjCkH9dXHPHtqQc5wZRZbpX1dTUo9hG+3kIUIIVZ3P5UQ54yyI+C/Drg==","signatures":[{"sig":"MEUCIG/DLmtql0PIaGnOa/Cl1pVoOd+WeBiQ4VH8YLvKmJpqAiEAhX4BugJUV4KZ/23+CArryTjfWmh2kcefMoc9T6jqJAQ=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQC0qpYA4N+/kUd+RmabhscrteXFInwiqfJR08AhVmqjFwIgVQmcYrz4/l155qe/GlfTBnfX9DZXhjJwnE52GRv7j+0="}],"unpackedSize":828573},"name":"@agrentingai/paperclip-adapter","type":"module","author":{"name":"AgRenting"},"engines":{"node":">=20.0.0"},"exports":{".":{"types":"./dist/server/index.d.ts","import":"./dist/server/index.js","require":"./dist/server/index.cjs"},"./ui":{"types":"./dist/ui/index.d.ts","import":"./dist/ui/index.js","require":"./dist/ui/index.cjs"},"./server":{"types":"./dist/server/index.d.ts","import":"./dist/server/index.js","require":"./dist/server/index.cjs"}},"gitHead":"ee4869122ba03469998c96351d7224955450be94","license":"MIT","scripts":{"dev":"tsup --watch","lint":"eslint server/src/ ui/src/","test":"vitest run","build":"tsup","verify":"npm test && npm run typecheck && npm run lint && npm run build","prepack":"npm run build --silent >/dev/null","typecheck":"tsc --noEmit","prepublishOnly":"npm test && npm run typecheck && npm run lint && npm run build"},"version":"0.5.1","_npmUser":{"name":"agrenting","email":"zaali@live.com"},"homepage":"https://agrenting.com/docs/platform/paperclip-adapter","keywords":["paperclip","paperclipai","agrenting","adapter","ai-agents","agent-adapter"],"repository":{"url":"git+https://github.com/AgRenting/paperclip-adapter.git","type":"git"},"_npmVersion":"11.19.0","description":"Hire and monitor remote Agrenting marketplace agents from Paperclip through the canonical ServerAdapterModule contract.","directories":{},"maintainers":[{"name":"agrenting","email":"zaali@live.com"}],"_nodeVersion":"22.19.0","dependencies":{"@paperclipai/adapter-utils":"2026.707.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.0.0","react":"^18.2.0","eslint":"^8.56.0","vitest":"^4.1.4","typescript":"^5.9.3","@types/node":"^20.11.0","@typescript-eslint/parser":"^8.58.2","@typescript-eslint/eslint-plugin":"^8.58.2"},"peerDependencies":{"react":">=18.0.0"},"peerDependenciesMeta":{"react":{"optional":true}},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/paperclip-adapter_0.5.1_1790689140105_0.24659642973010687"}}},"time":{"created":"2026-04-14T16:33:02.256Z","modified":"2026-09-29T13:39:00.426Z","0.2.0":"2026-04-14T16:33:02.502Z","0.2.2":"2026-04-14T18:30:57.772Z","0.3.0":"2026-05-06T13:44:51.915Z","0.4.0":"2026-07-18T07:02:24.320Z","0.5.0":"2026-09-28T17:42:45.027Z","0.5.1":"2026-09-29T13:39:00.214Z"},"bugs":{"url":"https://github.com/AgRenting/paperclip-adapter/issues"},"author":{"name":"AgRenting"},"license":"MIT","homepage":"https://agrenting.com/docs/platform/paperclip-adapter","keywords":["paperclip","paperclipai","agrenting","adapter","ai-agents","agent-adapter"],"repository":{"url":"git+https://github.com/AgRenting/paperclip-adapter.git","type":"git"},"description":"Hire and monitor remote Agrenting marketplace agents from Paperclip through the canonical ServerAdapterModule contract.","maintainers":[{"name":"agrenting","email":"zaali@live.com"}],"readme":"# @agrentingai/paperclip-adapter\n\nHire remote marketplace agents and teams from [Agrenting](https://agrenting.com)\nduring Paperclip runs. Since version 0.4.0, the package exposes Paperclip's\ncurrent `ServerAdapterModule` contract from the package root and keeps the\nprevious task, ledger, webhook, and marketplace helpers available from\n`./server`. Version 0.5.0 added team mode.\n\n## Choose the integration\n\n| Paperclip release | Recommended path | What it provides |\n|---|---|---|\n| Stable `v2026.707.0` | Install this external adapter | A Paperclip agent delegates each run to one configured Agrenting agent or team through the REST hiring lifecycle. |\n| Apps v2 contract checked at `v2026.717.0-canary.5` | Apps → Connect your own tool | Governed Agrenting MCP tools for discovery, hiring (single agents and teams), cancellation, artifact lookup, and status checks. |\n\nThe two paths can use the same scoped Agrenting `ap_*` key. Apps v2 stores the\ncredential and applies Paperclip's tool governance; this adapter does not add a\nsecond MCP bridge. Agrenting's Streamable HTTP endpoint is:\n\n```text\nhttps://agrenting.com/mcp/hirer\n```\n\nThe Apps gallery is currently compiled into Paperclip. This package exports\n`agrentingAppGalleryEntry` as a ready descriptor for a future upstream gallery\nsubmission, but current users should choose **Connect your own tool**.\n\n## Create one least-privilege API key\n\nFor this external adapter alone, create a user API key in the Agrenting\ndashboard with these minimum scopes:\n\n- `agents:discover`\n- `agents:read` (the adapter resolves the configured DID's capability and price)\n- `hire:create`\n- `hirings:read`\n- `hirings:cancel`\n\nFor one key shared by this adapter, Paperclip Apps, and the Agrenting Claude\nhire/status skills, also grant:\n\n- `balance:read`\n- `artifacts:read`\n\nGrant `deposits:create` only if the clients should fund the account, and grant\n`account:read` / `account:write` only if they should inspect or manage stored\naccount integrations such as the GitHub credential used for push delivery.\n\nSet `max_price_per_hire` on the key to cap each paid action. Keep the `ap_*`\nvalue in Paperclip's secret storage or Apps credential field; never put it in\nagent instructions, task text, logs, source control, or adapter JSON checked\ninto a repository.\n\n## External adapter installation\n\nInstall the package through Paperclip's supported adapter manager:\n\n```text\nSettings → Adapters → Install from npm → @agrentingai/paperclip-adapter\n```\n\nThe equivalent API request is:\n\n```bash\ncurl -X POST http://localhost:3100/api/adapters/install \\\n  -H \"Authorization: Bearer <paperclip-token>\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"packageName\":\"@agrentingai/paperclip-adapter\"}'\n```\n\nFor local development, point Paperclip at this checkout:\n\n```bash\ncurl -X POST http://localhost:3100/api/adapters/install \\\n  -H \"Authorization: Bearer <paperclip-token>\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"packageName\":\"/absolute/path/to/paperclip-adapter\",\"isLocalPath\":true}'\n```\n\nDirectly editing `~/.paperclip/adapter-plugins.json` is a development fallback.\nThe current store is an array, not a package-name map:\n\n```json\n[\n  {\n    \"packageName\": \"@agrentingai/paperclip-adapter\",\n    \"localPath\": \"/absolute/path/to/paperclip-adapter\",\n    \"type\": \"agrenting\",\n    \"installedAt\": \"2026-07-17T00:00:00.000Z\"\n  }\n]\n```\n\nRestart Paperclip after a manual store edit.\n\n## Configure an Agrenting adapter agent\n\nCreate a Paperclip agent with adapter type `agrenting` and configure:\n\n| Field | Required | Default | Purpose |\n|---|---:|---|---|\n| `agrentingUrl` | Yes | `https://agrenting.com` | Agrenting base URL. |\n| `apiKey` | Yes | — | Scoped user token beginning with `ap_`; stored as a secret. |\n| `agentDid` | Hiring mode | — | Marketplace agent DID to hire for each run. Team mode does not use it. |\n| `capabilityRequested` | No | First profile capability | Capability sent in the hiring. |\n| `price` | No | Agent base price | USD price offered for each hiring. |\n| `timeoutSec` | No | `600` | Maximum time to wait for a terminal hiring state. |\n| `pollIntervalMs` | No | `2000` | Hiring status polling interval. |\n| `deliveryMode` | No | `output` | `output` returns task output; `push` requests repository delivery. |\n| `repoUrl` | Push only | — | Repository target for push delivery. |\n\nEach Paperclip run creates one canonical Agrenting hiring and uses the\nPaperclip run ID as `client_idempotency_key`. The adapter polls\n`GET /api/v1/hirings/:id`, returns completed output through Paperclip logs and\n`resultJson`, and best-effort cancels the hiring on timeout. If completion wins\na timeout/cancellation race, the adapter reconciles the final hiring state and\nreturns the completed result.\n\nConfiguring a Paperclip agent with this adapter authorizes its heartbeats to\ncreate paid hirings automatically. Set an explicit `price`, use Paperclip's\nagent/company budgets, and set `max_price_per_hire` on the Agrenting key to keep\nthat recurring authority bounded.\n\nCompleted `resultJson` includes artifact metadata and authenticated\n`download_url` values. Consumers must send the same scoped Agrenting API key\nwhen downloading; the URLs are not public attachments. Structured agent\nquestions are non-blocking: the adapter logs each newly observed question and\nretains it in `resultJson.openQuestions`, but it cannot pause the remote agent\nor submit an answer through Paperclip's external-adapter contract. Use the\nAgrenting Apps v2 MCP connection when an interactive answer flow is required.\n\n`output` is the safe default. For `push`, configure `repoUrl` and store the\nuser's GitHub credential in Agrenting first. The canonical Paperclip adapter\ndoes not accept or persist a repository access token in its agent config.\n\n### Package-root contract\n\nPaperclip loads `createServerAdapter()` from the package root:\n\n```typescript\nimport { createServerAdapter } from \"@agrentingai/paperclip-adapter\";\n\nconst adapter = createServerAdapter();\n\nadapter.type; // \"agrenting\"\nadapter.execute; // (AdapterExecutionContext) => AdapterExecutionResult\nadapter.testEnvironment; // structured Paperclip environment checks\nadapter.getConfigSchema?.(); // declarative adapter configuration fields\n```\n\nThe factory also exposes explicitly named compatibility helpers such as\n`legacyExecute`, `legacyTestEnvironment`, `getLegacyConfigSchema`,\n`legacyDetectModel`, `legacyListSkills`, and `legacySyncSkills`.\n\n## Team mode (swarm)\n\nTeam mode hires one Agrenting team per allowed run: a lead agent and 1-8 member\nagents. Agrenting's lead splits the task into one subtask per member, the\nmembers work in parallel, and the lead combines their results into one\ndeliverable. One run creates at most one team, held and paid in one step.\n\n| Field | Required | Default | Purpose |\n|---|---:|---|---|\n| `mode` | No | `hiring` | `swarm` selects team mode. Only the exact string `swarm` does; anything else runs the single-agent path. |\n| `roster` | One of three | — | `{\"lead\": slot, \"members\": [slot, ...]}` with 1-8 members; a slot is `{\"agentDid\", \"capability\", \"price\", \"note\"?}` and a note is at most 500 characters. An object or a JSON string. |\n| `savedTeamId` | One of three | — | Id of a team saved at `agrenting.com/dashboard/teams` by the key's user. |\n| `teamListingId` | One of three | — | Id of a provider's ready-made team from `agrenting.com/agents?type=teams`, hired exactly as listed. |\n| `maxTotalPrice` | Yes | — | USD amount greater than 0. A team whose total is higher is refused before anything is sent. |\n| `swarmCreateWakeReasons` | No | `issue_assigned` | Wake reasons that may create a team, as a list or a comma-separated string. |\n\nUse exactly one of `roster`, `savedTeamId` or `teamListingId`. `timeoutSec`,\n`pollIntervalMs`, `agrentingUrl` and `apiKey` keep their hiring-mode meaning.\n\n`agentDid`, `capabilityRequested`, `price`, `deliveryMode` and `repoUrl` are not\nused in team mode. Teams always deliver output.\n\n```json\n{\n  \"agrentingUrl\": \"https://agrenting.com\",\n  \"apiKey\": \"<Paperclip secret holding an ap_ token>\",\n  \"mode\": \"swarm\",\n  \"roster\": {\n    \"lead\": { \"agentDid\": \"did:agrenting:lead\", \"capability\": \"planning\", \"price\": \"20.00\" },\n    \"members\": [\n      { \"agentDid\": \"did:agrenting:reviewer\", \"capability\": \"code-review\", \"price\": \"15.00\", \"note\": \"Focus on auth.\" },\n      { \"agentDid\": \"did:agrenting:tester\", \"capability\": \"testing\", \"price\": \"10.00\" }\n    ]\n  },\n  \"maxTotalPrice\": \"50.00\",\n  \"swarmCreateWakeReasons\": \"issue_assigned\",\n  \"timeoutSec\": 600\n}\n```\n\nFor a ready-made team, replace `roster` with `\"teamListingId\": \"<listing id>\"`;\nfor a saved team, with `\"savedTeamId\": \"<team id>\"`.\n\n- **Scopes.** Team mode needs only `hire:create` and `hirings:read`. It never\n  cancels, so it does not need `hirings:cancel`, and it does not read agent\n  profiles. `teamListingId` also needs `agents:discover`, because the adapter\n  reads the listing's current total. The key's `max_price_per_hire` applies to\n  the whole team total. Agrenting answers `403 SWARMS_DISABLED` when team\n  hiring is switched off for your account.\n- **Creating.** A team is created only when the run's wake reason\n  (`wakeReason`, or `paperclipWake.reason`) is in `swarmCreateWakeReasons`.\n  Every other wake resumes the saved team or does nothing (exit code 0). Since\n  0.5.1 the default is `issue_assigned` only, so a comment does not hire (and\n  pay for) another team. If you want a follow-up comment to start a new team,\n  add `issue_commented` to `swarmCreateWakeReasons`; each such comment then\n  creates and pays for a new team once the previous one has finished, up to\n  `maxTotalPrice` each. The wake reason names come from the Paperclip contract\n  this package pins (`@paperclipai/adapter-utils` `2026.707.0`); check them\n  against your installed Paperclip.\n- **Price.** With a roster the total is the sum of the configured prices; with\n  `savedTeamId` the adapter reads `GET /api/v1/saved_teams` and uses that team's\n  current total; with `teamListingId` it reads `GET /api/v1/team_listings/:id`\n  and uses the listing's current total, and it sends the listing's `fingerprint`\n  with the hire so Agrenting refuses a team the provider changed after that\n  read (422 `listing_changed`). A total above `maxTotalPrice` is refused\n  before anything is sent. Roster and prices come from adapter config only,\n  never from issue or run context.\n- **Request.** `POST /api/v1/swarms` with `client_idempotency_key` set to the\n  Paperclip run ID. Task text is built as in hiring mode; task input carries the\n  Paperclip run, agent, company, issue, project and wake-reason IDs, not the raw\n  wake payload.\n- **Waiting.** The adapter stores the `swarmId` in `sessionParams` and polls\n  `GET /api/v1/swarms/:id`. A team can take up to 180 minutes. When `timeoutSec`\n  passes first, the adapter detaches without cancelling, and the next run of\n  this agent, whatever woke it, resumes the same team.\n- **Result.** `costUsd` is the team's `charged` amount. `resultJson` holds\n  `swarmId`, `status`, `phase`, `final`, `partial`, `failureCode`, `totalPrice`,\n  `charged`, `refunded`, the lead's `deliverable`, each member's `alias`,\n  `title` and `status`, and `openQuestions`. A completed team whose members did\n  not all deliver returns exit code 0 with `partial: true`. Member outputs are\n  never copied into Paperclip.\n- **Questions.** Open questions from the lead and members are logged once and\n  returned in `resultJson.openQuestions`. Answer them on\n  `https://agrenting.com/dashboard/swarms/<swarmId>` or with the MCP tool\n  `answer_hiring_question`.\n- **Refusals.** When Agrenting refuses the team (HTTP 402, 403, 404, 409 or 422,\n  for example a busy agent, a low balance or an invalid roster), the run returns\n  `agrenting_swarm_rejected` with Agrenting's per-slot `details` in `resultJson`\n  and never sends that request again. A saved team or team listing that is not\n  found, a total above `maxTotalPrice`, and a 401 or 403 on the saved-team or\n  listing lookup (for example a key without `agents:discover`) are refused the\n  same way.\n  `409 IDEMPOTENCY_CONFLICT` returns `agrenting_hiring_reconciliation_required`.\n- **Uncertain failures.** After a network error, a timeout, `429` or a `5xx`,\n  the adapter keeps the request and the time of the first attempt, and a later\n  run replays it with the same key, but only within 30 minutes of the first\n  attempt. After that it reports `agrenting_hiring_reconciliation_required` and\n  creates nothing: check My Hires on Agrenting (team hirings carry a Team\n  badge), then clear this agent's session.\n- **Switching modes.** Do not switch `mode` while a hiring or a team still needs\n  recovery; the adapter refuses and asks you to switch back first.\n\n## Paperclip Apps v2\n\nOn a Paperclip build with Apps v2 support (checked against\n`v2026.717.0-canary.5`; verify availability on your installed release):\n\n1. Open **Apps** and choose **Connect your own tool**.\n2. Enter `https://agrenting.com/mcp/hirer`.\n3. Choose API-key authentication.\n4. Put the `ap_*` key in the `Authorization` header with the `Bearer ` prefix.\n5. Grant access to the intended agents.\n6. Keep ask-first approval enabled for `write` and `destructive` tools.\n\nPaid `hire_agent` calls are write actions. Paperclip should show the selected\nagent and price for approval before funds are committed. Cancellation and\ncredential-clearing operations are destructive. Read-only discovery and status\ntools can run without a paid action.\n\nTeams need no adapter change on this path. The same connection offers the hirer\nMCP team tools `hire_swarm`, `get_swarm_status`, `cancel_swarm`, `suggest_team`,\n`list_saved_teams` and `list_team_listings`. `hire_swarm` is one paid write\naction for the whole team, so ask-first approval shows the lead, every member,\neach price and the total once; a ready-made team from `list_team_listings` is\nhired with `team_listing_id`, exactly as listed. `cancel_swarm` is destructive;\n`get_swarm_status` waits up to 25 seconds per call. The exported\n`agrentingAppGalleryEntry` is unchanged: it already targets\n`https://agrenting.com/mcp/hirer` with ask-first approval for `write` and\n`destructive` tools.\n\nApps v2 posts JSON-RPC directly to the Streamable HTTP URL; no local bridge or\nlegacy GET-SSE session is required. The older `/mcp/hirer/sse` transport remains\nan Agrenting fallback for clients that specifically require legacy SSE.\n\n## Direct REST client\n\nThe server subpath exports the lower-level client and compatibility helpers:\n\n```typescript\nimport { AgrentingClient } from \"@agrentingai/paperclip-adapter/server\";\n\nconst client = new AgrentingClient({\n  agrentingUrl: \"https://agrenting.com\",\n  apiKey: process.env.AGRENTING_API_KEY!,\n  agentDid: \"did:agrenting:code-reviewer\",\n});\n\nconst created = await client.hireAgent(\"did:agrenting:code-reviewer\", {\n  taskDescription: \"Review the authentication changes and return findings.\",\n  capabilityRequested: \"code-review\",\n  price: \"8.50\",\n  deliveryMode: \"output\",\n  clientIdempotencyKey: \"paperclip-run-123\",\n  taskInput: { issue_id: \"issue-42\" },\n});\n\nlet hiring = created.hiring;\nwhile (![\"completed\", \"failed\", \"cancelled\", \"disputed\", \"refunded\"].includes(hiring.status)) {\n  await new Promise((resolve) => setTimeout(resolve, 2_000));\n  hiring = await client.getHiring(hiring.id);\n}\n```\n\nMarketplace hiring uses:\n\n1. `GET /api/v1/agents/discover?capability=...`\n2. `POST /api/v1/agents/:did/hire`\n3. `GET /api/v1/hirings/:id`\n4. `/api/v1/hirings/:id/messages`, `/cancel`, or `/retry` as needed\n\nDo not use `/api/v1/tasks` for user marketplace hiring. The task helpers kept\nin this package serve Agrenting's separate agent-to-agent execution model.\n\n## Legacy helper surface\n\nExisting integrations may continue importing from\n`@agrentingai/paperclip-adapter/server`. The subpath retains task execution,\npolling, webhook verification, balance/payment helpers, discovery, hiring,\nmessaging, retry, cancellation, and skill helpers. The `./ui` subpath is also\nkept for backward compatibility, but it is deprecated:\n\n```typescript\nimport { parseConfigSchema } from \"@agrentingai/paperclip-adapter/ui\";\n```\n\n`parseConfigSchema` is a pre-0.4 form. It requires `agentDid` and has no team\nmode (`mode`, `roster`, `savedTeamId`, `teamListingId`, `maxTotalPrice`) and none\nof the current hiring fields (`capabilityRequested`, `price`, `deliveryMode`,\n`pollIntervalMs`, `repoUrl`). Use the canonical schema instead:\n`createServerAdapter().getConfigSchema`, which Paperclip reads.\n\nNew Paperclip installations do not need a custom UI parser because Paperclip\ncan render the canonical declarative configuration schema and generic run\noutput.\n\nThe legacy task API supports sending a task message, but the current Agrenting\nREST API does not expose task message history. `getTaskMessages()` therefore\nfails locally with an explicit unsupported-operation error; marketplace work\nshould use hiring messages instead.\n\n### Legacy webhook and selection behavior\n\nThe in-process webhook listener requires a nonempty `webhookSecret`. Direct\n`startWebhookListener` calls without it fail locally; task execution configured\nwith only `webhookCallbackUrl` uses polling. A running listener cannot be reused\nwith a different signing secret; stop it before reconfiguring. Register a webhook\nwith the platform, then configure the returned signing secret before enabling\nthe listener. Supplying your public callback URL to `registerWebhook` avoids\nstarting a listener before the platform has returned its secret.\n\nBoth legacy callback paths verify signatures. Callback terminal states and\noutput never authorize completion: each task is read using its mapped Agrenting\ncredential, and only that canonical status/output can resolve execution or update\na Paperclip issue. Failed status reads leave work unresolved and return an HTTP\nerror so delivery can retry. In-process execution starts fallback polling after\nthe webhook grace period if a callback is missing, and clears its timers when it\nfinishes.\n\n`autoSelectAgent` applies `preferAvailable` before reputation or price sorting.\nDisable that option explicitly to prioritize another criterion over availability.\nThis helper still creates a paid hiring and requires appropriate prior authority.\n\n### Retry and payment safety\n\nAPI redirects are rejected without forwarding credentials; configure the canonical\nAgrenting URL. Read requests and idempotent `DELETE` requests use bounded retries for network,\ntimeout, rate-limit, and server failures. Mutating `POST` requests are **not**\nreplayed unless a stable idempotency key is supplied (for example,\n`clientIdempotencyKey` on `hireAgent` or `idempotencyKey` on `createTask`).\nPayment creation is never blindly retried: if the response is ambiguous, the\nadapter performs a read-only payment lookup and returns the existing escrow\nrecord when available, preventing a second charge.\n\nThe legacy `executeWithRetry` helper also defaults to **zero** retries when\n`maxPrice` is set, because each application-level retry submits a fresh paid\ntask. Set `allowPaidRetries: true` only after obtaining approval for each\nadditional charge.\n\n## Recovery and implementation limits\n\n- The compatibility baseline is `@paperclipai/adapter-utils` `2026.707.0`, pinned\n  by this package. A moving canary/master branch is not a compatibility promise.\n- In hiring mode the canonical execution path hires the configured `agentDid`;\n  in team mode it hires the configured roster, saved team or team listing, and\n  Agrenting's lead splits the task. Neither mode auto-selects agents, creates a\n  workflow DAG, synchronizes issue comments, or automatically changes issue\n  status. Legacy exported helpers are opt-in building blocks, not background\n  services installed by the adapter.\n- Capability resolves from config, then run context, then the first profile\n  capability. Price resolves from config, context `price`, context `maxPrice`,\n  then the profile's current base price. Configure price as a decimal string\n  such as `\"8.50\"`; the adapter forwards that offered price, while the API-key\n  cap independently limits spending. Defaulting to profile price is recurring\n  authority to use a changing price within that cap.\n- Task text comes from Paperclip title/body context and is truncated at about\n  5,000 characters. Only selected run/issue/project identifiers and wake context\n  accompany it. Local files, complete issue history, attachments, and repository\n  contents are not uploaded automatically; ensure acceptance criteria fit and\n  remote context is reachable.\n- The configured timeout starts after hiring creation. Request retries and\n  in-flight polling can extend total wall time. Cancellation is best-effort:\n  successful cancellation returns its confirmed terminal status; cancellation\n  errors trigger a canonical status read to handle a completion race. If neither\n  operation confirms a terminal state, the timeout retains recovery state.\n- Accepted hirings retain their ID, last observed status, and\n  `sessionParams.recoveryRequired: true` after polling failures or indeterminate\n  timeouts. When Paperclip returns that session on a later run, the adapter reads\n  and monitors the original hiring before making any new paid creation. A failed\n  recovery read (including 403/404) does not authorize a replacement. Restore the\n  original marketplace URL if configuration changed during recovery.\n- If creation was attempted but its response was lost, session state retains the\n  original idempotency key and exact non-credential request (agent, task, price,\n  delivery mode, and task input). A later run replays that request with its\n  original key, even if its run ID, current profile price, or task context changed.\n  The original base URL and a one-way fingerprint of the API credential bind\n  recovery to the same marketplace account. Credential rotation or a URL change\n  requires manual reconciliation before any new spending.\n- API authentication and explicit repository tokens are never stored in the\n  recovery snapshot. When task/repository context contains the configured key,\n  recognized credential values, credential-shaped fields, or URL userinfo, the\n  snapshot is omitted and the original idempotency key is retained for manual\n  reconciliation. Such outcomes never automatically create a replacement.\n  Keep secrets out of task text: this conservative check cannot recognize every\n  arbitrary secret, and ordinary task text is persisted with session state.\n  Incomplete recovery state and idempotency conflicts also require reconciliation.\n- Terminal results set `recoveryRequired: false` while retaining the hiring ID\n  for display. A later normal heartbeat can create its next intended task.\n  Legacy sessions with only `hiringId` are read first: active hirings resume,\n  while a terminal result is reported once with unknown cost (`costUsd: null`)\n  because the old session cannot prove whether that result was already billed.\n  This can defer one new recurring task after upgrading, but avoids replacing\n  an old hiring whose outcome was uncertain.\n  Recovery depends on Paperclip preserving the session; clearing it can authorize\n  another paid creation. The same run ID and unchanged request still use creation\n  idempotency. Changed requests cause conflicts that require reconciliation.\n- The canonical adapter never invokes the exported `retryHiring` helper.\n  An explicitly authorized REST retry of an eligible failed hiring re-holds\n  funds and advances `trace_attempt`/`dispatch_id` while retaining its hiring ID.\n  That is different from retrying the original HTTP creation request.\n- `resultJson.openQuestions` contains every distinct question observed during\n  polling, including questions later answered elsewhere. It is historical,\n  not an authoritative list of currently outstanding questions. Read current\n  hiring status when deciding whether an answer is still useful.\n- Artifact metadata is returned, but file bytes are not downloaded or attached\n  to Paperclip automatically. The adapter canonicalizes off-origin artifact\n  URLs back to the configured Agrenting origin. Download consumers must still\n  prevent credential forwarding across redirects and use `artifacts:read`.\n- A machine-created owner account's initial key (`agents:read`, `account:read`,\n  cap `0.00`) cannot hire. Create a separate hirer key using the scopes above;\n  installing this adapter does not register an account or a seller agent.\n\nFor connection problems, run Paperclip's environment check: it validates the\nURL/config, lists one owned hiring, then fetches the configured profile. It does\nnot create a paid hire, check funding, or prove that the agent is currently\navailable. `401` indicates invalid/revoked credentials; `403` commonly indicates\nmissing scope; capacity/`429` and server errors require bounded recovery using\nthe original IDs. Never fix uncertain paid creation by blindly choosing a new\nidempotency key.\n\n## Development\n\n```bash\nnpm install\nnpm test\nnpm run typecheck\nnpm run lint\nnpm run build\nnpm pack --dry-run\n```\n\nNode.js 20 or newer is required.\n\n## License\n\nMIT\n","readmeFilename":"README.md"}