{"_id":"@atel-ai/atel-sdk","_rev":"5-241735e710b9bf6f6d2d70261c7f0693","name":"@atel-ai/atel-sdk","dist-tags":{"latest":"1.3.1"},"versions":{"1.2.16":{"name":"@atel-ai/atel-sdk","version":"1.2.16","license":"MIT","_id":"@atel-ai/atel-sdk@1.2.16","maintainers":[{"name":"atelai","email":"qianweibusiness@outlook.com"}],"homepage":"https://github.com/LawrenceLiang-BTC/atel-sdk#readme","bugs":{"url":"https://github.com/LawrenceLiang-BTC/atel-sdk/issues"},"bin":{"atel":"bin/atel.mjs"},"dist":{"shasum":"6294789774688a05375ad21855d7daea1c423d36","tarball":"https://registry.npmjs.org/@atel-ai/atel-sdk/-/atel-sdk-1.2.16.tgz","fileCount":110,"integrity":"sha512-pQsfMDYoifSrPxNqIO0FfVqUQWgpLk6x1eIcFXPTVh2OPFB7wloxdnkIv5Yb98caIZjnoAbNIxwcAfNhoPUgiA==","signatures":[{"sig":"MEYCIQD5KAVw1oT8ejFqCLopX5kvL6wXTKGTikWCbBjk4LvSJwIhAKRT5KNKGpdB357VfGdRpNcKc+9PxDyHWNlMlvLHeCgT","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":1074456},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js"},"./package.json":"./package.json"},"scripts":{"test":"vitest --run","build":"tsc","clean":"rm -rf dist","serve":"tsx src/service/server.ts","doctor":"tsx scripts/doctor.ts","demo:real":"tsx demo/real-api-demo.ts","test:perf":"vitest --run tests/performance.test.ts","run:cluster":"tsx scripts/agent-cluster-runner.ts","smoke:anchor":"tsx scripts/testnet-anchor-smoke.ts","build:release":"tsc && tsx scripts/obfuscate.ts","prepublishOnly":"npm run clean && npm run build && npm test","quickstart:local":"tsx demo/quickstart-local.ts","wallets:generate":"tsx scripts/generate-test-wallets.ts","acceptance:deploy":"tsx scripts/deploy-acceptance.ts","quickstart:network":"tsx demo/quickstart-network.ts"},"_npmUser":{"name":"atelai","email":"qianweibusiness@outlook.com"},"repository":{"url":"git+https://github.com/LawrenceLiang-BTC/atel-sdk.git","type":"git"},"_npmVersion":"10.9.4","description":"ATEL Protocol SDK - Agent Trust & Exchange Layer","directories":{},"_nodeVersion":"22.22.1","dependencies":{"ajv":"^8.17.1","bs58":"^6.0.0","uuid":"^11.1.0","ethers":"^6.16.0","express":"^5.2.1","nat-upnp":"^1.1.1","form-data":"^4.0.5","tweetnacl":"^1.0.3","ajv-formats":"^3.0.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.21.0","vitest":"^3.2.4","supertest":"^7.2.2","typescript":"^5.7.0","@types/node":"^25.2.3","@types/uuid":"^10.0.0","@types/express":"^5.0.6","@types/supertest":"^6.0.3","javascript-obfuscator":"^5.3.0"},"_npmOperationalInternal":{"tmp":"tmp/atel-sdk_1.2.16_1777123160166_0.5512055533050362","host":"s3://npm-registry-packages-npm-production"}},"1.2.17":{"name":"@atel-ai/atel-sdk","version":"1.2.17","license":"MIT","_id":"@atel-ai/atel-sdk@1.2.17","maintainers":[{"name":"atelai","email":"qianweibusiness@outlook.com"}],"homepage":"https://github.com/AtelLab/atel-sdk#readme","bugs":{"url":"https://github.com/AtelLab/atel-sdk/issues"},"bin":{"atel":"bin/atel.mjs"},"dist":{"shasum":"c0d8924824fa770f7da356fbae403644d2ebf330","tarball":"https://registry.npmjs.org/@atel-ai/atel-sdk/-/atel-sdk-1.2.17.tgz","fileCount":110,"integrity":"sha512-b2xoP/990YdfKqQS3XD1IUsiJmnxawDwpjc4o/b2WSRNfQSOB27cXy5xPxk3q1TZpsCo8WkuVNVhQY73l4n8jQ==","signatures":[{"sig":"MEUCIQD4mn3fhRRFascu3zB2Ysrh8M0smlWBwAkZRvwY/mEwFAIga4b8zaAdIIETFS/+YIDqZ4INdaxy7MKAn5qk+5vd9Yk=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":1080324},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js"},"./package.json":"./package.json"},"scripts":{"test":"vitest --run","build":"tsc","clean":"rm -rf dist","serve":"tsx src/service/server.ts","doctor":"tsx scripts/doctor.ts","demo:real":"tsx demo/real-api-demo.ts","test:perf":"vitest --run tests/performance.test.ts","run:cluster":"tsx scripts/agent-cluster-runner.ts","smoke:anchor":"tsx scripts/testnet-anchor-smoke.ts","build:release":"tsc && tsx scripts/obfuscate.ts","prepublishOnly":"npm run clean && npm run build && npm test","quickstart:local":"tsx demo/quickstart-local.ts","wallets:generate":"tsx scripts/generate-test-wallets.ts","acceptance:deploy":"tsx scripts/deploy-acceptance.ts","quickstart:network":"tsx demo/quickstart-network.ts"},"_npmUser":{"name":"atelai","email":"qianweibusiness@outlook.com"},"repository":{"url":"git+https://github.com/AtelLab/atel-sdk.git","type":"git"},"_npmVersion":"10.9.4","description":"ATEL Protocol SDK - Agent Trust & Exchange Layer","directories":{},"_nodeVersion":"22.22.1","dependencies":{"ajv":"^8.17.1","bs58":"^6.0.0","uuid":"^11.1.0","ethers":"^6.16.0","express":"^5.2.1","nat-upnp":"^1.1.1","form-data":"^4.0.5","tweetnacl":"^1.0.3","ajv-formats":"^3.0.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.21.0","vitest":"^3.2.4","supertest":"^7.2.2","typescript":"^5.7.0","@types/node":"^25.2.3","@types/uuid":"^10.0.0","@types/express":"^5.0.6","@types/supertest":"^6.0.3","javascript-obfuscator":"^5.3.0"},"_npmOperationalInternal":{"tmp":"tmp/atel-sdk_1.2.17_1777199285613_0.2269805086276384","host":"s3://npm-registry-packages-npm-production"}},"1.2.18":{"name":"@atel-ai/atel-sdk","version":"1.2.18","license":"MIT","_id":"@atel-ai/atel-sdk@1.2.18","maintainers":[{"name":"atelai","email":"qianweibusiness@outlook.com"}],"homepage":"https://github.com/AtelLab/atel-sdk#readme","bugs":{"url":"https://github.com/AtelLab/atel-sdk/issues"},"bin":{"atel":"bin/atel.mjs"},"dist":{"shasum":"fc859e1fd4427e8fc40e44851a868e825f04c3a9","tarball":"https://registry.npmjs.org/@atel-ai/atel-sdk/-/atel-sdk-1.2.18.tgz","fileCount":110,"integrity":"sha512-x4fN+kIQG2KUSrrZuVCp/daxu5rmV8jDcKU0fMNhOIK4tcbcyTsUVNo1MywQIQkwBmPc/YYkBC8c3zlOXGzbkA==","signatures":[{"sig":"MEUCICY7oMSQdhF2QaZIs0ZHk/LZqz8i64fuNpubFi1WeRgzAiEAnDwE4fSus6I5VtI4IUmi5KM4rhGSNHgwi1J9VM5/r+Y=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":1081428},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js"},"./package.json":"./package.json"},"gitHead":"4eba3a12e47b8c431578b41be8aa22c5acf4cfb8","scripts":{"test":"vitest --run","build":"tsc","clean":"rm -rf dist","serve":"tsx src/service/server.ts","doctor":"tsx scripts/doctor.ts","demo:real":"tsx demo/real-api-demo.ts","test:perf":"vitest --run tests/performance.test.ts","run:cluster":"tsx scripts/agent-cluster-runner.ts","smoke:anchor":"tsx scripts/testnet-anchor-smoke.ts","build:release":"tsc && tsx scripts/obfuscate.ts","prepublishOnly":"npm run clean && npm run build && npm test","quickstart:local":"tsx demo/quickstart-local.ts","wallets:generate":"tsx scripts/generate-test-wallets.ts","acceptance:deploy":"tsx scripts/deploy-acceptance.ts","quickstart:network":"tsx demo/quickstart-network.ts"},"_npmUser":{"name":"atelai","email":"qianweibusiness@outlook.com"},"repository":{"url":"git+https://github.com/AtelLab/atel-sdk.git","type":"git"},"_npmVersion":"11.6.2","description":"ATEL Protocol SDK - Agent Trust & Exchange Layer","directories":{},"_nodeVersion":"24.11.1","dependencies":{"ajv":"^8.17.1","bs58":"^6.0.0","uuid":"^11.1.0","ethers":"^6.16.0","express":"^5.2.1","nat-upnp":"^1.1.1","form-data":"^4.0.5","tweetnacl":"^1.0.3","ajv-formats":"^3.0.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.21.0","vitest":"^3.2.4","supertest":"^7.2.2","typescript":"^5.7.0","@types/node":"^25.2.3","@types/uuid":"^10.0.0","@types/express":"^5.0.6","@types/supertest":"^6.0.3","javascript-obfuscator":"^5.3.0"},"_npmOperationalInternal":{"tmp":"tmp/atel-sdk_1.2.18_1777208891460_0.9666210502547261","host":"s3://npm-registry-packages-npm-production"}},"1.3.0":{"name":"@atel-ai/atel-sdk","version":"1.3.0","license":"MIT","_id":"@atel-ai/atel-sdk@1.3.0","maintainers":[{"name":"atelai","email":"qianweibusiness@outlook.com"}],"homepage":"https://github.com/AtelLab/atel-sdk#readme","bugs":{"url":"https://github.com/AtelLab/atel-sdk/issues"},"bin":{"atel":"bin/atel.mjs"},"dist":{"shasum":"4ac7da707f6ba55d04e2ee352f81c86a0faf8717","tarball":"https://registry.npmjs.org/@atel-ai/atel-sdk/-/atel-sdk-1.3.0.tgz","fileCount":112,"integrity":"sha512-3biHXbjqGXRpbdt/SGN0p15ebfzHB4PmIIIfFj6W4VMqapxeGtdGt6U2FLDL5bo8KN/eRUdqBasEqFTnJ3mBsw==","signatures":[{"sig":"MEQCIFuF+lk/KOVDrWUvCPLoJKNoV/3nnMk9EkyQVMJFaMD9AiAUmpuRhSLkvuCwsU8MB9UBd9VNtqBBOVfhZv+yoyeQAg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":1125837},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js"},"./package.json":"./package.json"},"gitHead":"7c973e4a8a807e67cc97704ef81023de6d52f8f6","scripts":{"test":"vitest --run","build":"tsc","clean":"rm -rf dist","serve":"tsx src/service/server.ts","doctor":"tsx scripts/doctor.ts","demo:real":"tsx demo/real-api-demo.ts","test:perf":"vitest --run tests/performance.test.ts","run:cluster":"tsx scripts/agent-cluster-runner.ts","smoke:anchor":"tsx scripts/testnet-anchor-smoke.ts","build:release":"tsc && tsx scripts/obfuscate.ts","prepublishOnly":"npm run clean && npm run build && npm test","quickstart:local":"tsx demo/quickstart-local.ts","wallets:generate":"tsx scripts/generate-test-wallets.ts","acceptance:deploy":"tsx scripts/deploy-acceptance.ts","quickstart:network":"tsx demo/quickstart-network.ts"},"_npmUser":{"name":"atelai","email":"qianweibusiness@outlook.com"},"repository":{"url":"git+https://github.com/AtelLab/atel-sdk.git","type":"git"},"_npmVersion":"11.6.2","description":"ATEL Protocol SDK - Agent Trust & Exchange Layer","directories":{},"_nodeVersion":"24.11.1","dependencies":{"ajv":"^8.17.1","bs58":"^6.0.0","uuid":"^11.1.0","ethers":"^6.16.0","express":"^5.2.1","nat-upnp":"^1.1.1","form-data":"^4.0.5","tweetnacl":"^1.0.3","ajv-formats":"^3.0.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.21.0","vitest":"^3.2.4","supertest":"^7.2.2","typescript":"^5.7.0","@types/node":"^25.2.3","@types/uuid":"^10.0.0","@types/express":"^5.0.6","@types/supertest":"^6.0.3","javascript-obfuscator":"^5.3.0"},"_npmOperationalInternal":{"tmp":"tmp/atel-sdk_1.3.0_1777558271124_0.0049252539245754345","host":"s3://npm-registry-packages-npm-production"}},"1.3.1":{"name":"@atel-ai/atel-sdk","version":"1.3.1","description":"ATEL Protocol SDK - Agent Trust & Exchange Layer","repository":{"type":"git","url":"git+https://github.com/AtelLab/atel-sdk.git"},"type":"module","main":"./dist/index.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js"},"./package.json":"./package.json"},"types":"./dist/index.d.ts","bin":{"atel":"bin/atel.mjs"},"publishConfig":{"access":"public"},"scripts":{"build":"tsc","build:release":"tsc && tsx scripts/obfuscate.ts","clean":"rm -rf dist","test":"vitest --run","test:perf":"vitest --run tests/performance.test.ts","wallets:generate":"tsx scripts/generate-test-wallets.ts","run:cluster":"tsx scripts/agent-cluster-runner.ts","acceptance:deploy":"tsx scripts/deploy-acceptance.ts","doctor":"tsx scripts/doctor.ts","quickstart:local":"tsx demo/quickstart-local.ts","quickstart:network":"tsx demo/quickstart-network.ts","demo:real":"tsx demo/real-api-demo.ts","smoke:anchor":"tsx scripts/testnet-anchor-smoke.ts","serve":"tsx src/service/server.ts","prepublishOnly":"npm run clean && npm run build && npm test"},"dependencies":{"ajv":"^8.17.1","ajv-formats":"^3.0.1","bs58":"^6.0.0","ethers":"^6.16.0","express":"^5.2.1","form-data":"^4.0.5","nat-upnp":"^1.1.1","tweetnacl":"^1.0.3","uuid":"^11.1.0"},"devDependencies":{"@types/express":"^5.0.6","@types/node":"^25.2.3","@types/supertest":"^6.0.3","@types/uuid":"^10.0.0","javascript-obfuscator":"^5.3.0","supertest":"^7.2.2","tsx":"^4.21.0","typescript":"^5.7.0","vitest":"^3.2.4"},"license":"MIT","_id":"@atel-ai/atel-sdk@1.3.1","bugs":{"url":"https://github.com/AtelLab/atel-sdk/issues"},"homepage":"https://github.com/AtelLab/atel-sdk#readme","_nodeVersion":"22.22.1","_npmVersion":"10.9.4","dist":{"integrity":"sha512-n/gIkg3HMK1nBEEjcGPneA0wWR3BOET2NGaHZOukavCFasboL5a/YwF/BpdbBgbr/khzsaxVXmICENVozupn2g==","shasum":"9a546021cd3fb8a9643c7aba8789ef4fb590c730","tarball":"https://registry.npmjs.org/@atel-ai/atel-sdk/-/atel-sdk-1.3.1.tgz","fileCount":112,"unpackedSize":1121336,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCICh/D5jAxNsIOI7UVWpBC94hkwdimFe4PoY6sDPwnaLMAiEAi4ho/Fl0Om5eq2u94WzGfw3qYJDvKrXFe/atmnwcDU4="}]},"_npmUser":{"name":"atelai","email":"qianweibusiness@outlook.com"},"directories":{},"maintainers":[{"name":"atelai","email":"qianweibusiness@outlook.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/atel-sdk_1.3.1_1778255794539_0.9925046256064185"},"_hasShrinkwrap":false}},"time":{"created":"2026-04-25T13:19:20.063Z","modified":"2026-05-08T15:56:34.926Z","1.2.16":"2026-04-25T13:19:20.401Z","1.2.17":"2026-04-26T10:28:05.799Z","1.2.18":"2026-04-26T13:08:11.649Z","1.3.0":"2026-04-30T14:11:11.331Z","1.3.1":"2026-05-08T15:56:34.811Z"},"bugs":{"url":"https://github.com/AtelLab/atel-sdk/issues"},"license":"MIT","homepage":"https://github.com/AtelLab/atel-sdk#readme","repository":{"type":"git","url":"git+https://github.com/AtelLab/atel-sdk.git"},"description":"ATEL Protocol SDK - Agent Trust & Exchange Layer","maintainers":[{"name":"atelai","email":"qianweibusiness@outlook.com"}],"readme":"# ATEL Runtime (SDK Compatibility Layer)\n\n**Agent Trust & Exchange Layer** — The ATEL protocol runtime and SDK compatibility layer for trustworthy, auditable multi-agent collaboration.\n\n## Core Capabilities\n\nATEL provides the cryptographic primitives and protocol building blocks that enable secure AI agent collaboration:\n\n- **🔐 Identity & Verification** — Ed25519 keypairs, DID creation, signing & verification\n- **📋 Policy Enforcement** — Scoped consent tokens, call tracking, deterministic hashing\n- **🔍 Execution Tracing** — Tamper-evident, hash-chained audit logs with auto-checkpoints\n- **✅ Proof Generation** — Merkle-tree proof bundles with multi-check verification\n- **⚓ On-Chain Anchoring** — Multi-chain proof anchoring (Base/BSC)\n- **📊 Trust Scoring** — Local trust computation based on execution history\n- **🔔 Notification & Callback Runtime** — Local notify, callback, inbox, and recovery flow\n- **👥 P2P Access Control** — Relationship-based friend system with temporary sessions\n- **🎁 Bitrefill A2B Board** — single-command gift cards / phone top-up / eSIM / subscription refill, AVIP-anchored on Base\n\n## Key Features\n\n### Runtime Model\n- ATEL handles DID identity, relay, inbox, callback, notification, and paid order state\n- OpenClaw or your own runtime handles reasoning and tool use\n- For normal hosted users, Remote MCP is the intended primary entry path\n- This package remains the optional Runtime layer for self-hosted, OpenClaw-native, and linked-runtime execution\n- Cross-platform CLI (Linux/macOS/Windows)\n- Paid Platform orders currently support two settlement chains:\n  - `Base`\n  - `BSC`\n- For paid orders, the chain truth source is always `order.chain`\n\n### Bitrefill A2B Board\n\nBuy gift cards, top up phones, buy eSIMs, or refill subscriptions from Bitrefill with a single CLI command. The user's Smart Account on Base pays directly to Bitrefill; the ATEL Platform runs the AVIP execution trace (5 steps), generates a CompletionProof, and anchors every step on Base via `AnchorRegistryV2`. No escrow, no trust-score side effects — A2B is a *single-sided* AVIP flow because the counterparty is a Web2 merchant, not another agent.\n\n```bash\n# Setup (once): BITREFILL_API_KEY lives only in ATEL Platform; users need nothing.\nexport ATEL_USER_SMART_ACCOUNT=0x...   # user's Smart Account on Base\natel init my-agent\natel balance base                      # confirm USDC >= 0.50\n\n# Use it:\natel bitrefill buy    --brand \"Amazon US\"   --amount 10 --description \"buy me a $10 Amazon card\"\natel bitrefill topup  --brand \"T-Mobile US\" --amount 20 --phone \"+14155550100\" --description \"...\"\natel bitrefill esim   --brand \"Airalo US\"   --amount 10 --description \"...\"\natel bitrefill refill --brand \"Netflix US\"  --amount 15 --description \"...\"\n\natel bitrefill search \"Amazon\" --country US\natel bitrefill status <orderId>\n```\n\nA successful call returns the `redemption` object (code / link / pin / instructions),\nthe `paymentTxHash` on Base, the `auditUrl` pointing at the CompletionProof (Intent + 5 traces all anchored), and before/after USDC balances. The LLM trigger rules live in `skill/atel-agent/SKILL.md`.\n\n### P2P Friend System\n- Relationship-based access control (friends-only mode)\n- Friend request workflow with approval\n- Temporary sessions for non-friends (time & task limits)\n- DID alias system (@alias syntax)\n- Rate limiting and security validation\n\n### Trust & Verification\n- Tamper-evident execution traces\n- Merkle-tree proof generation\n- On-chain anchoring (Base/BSC)\n- Local trust score computation\n- Callback-driven execution and recovery\n\n### Developer Experience\n- Comprehensive CLI with detailed help\n- Unified output format (human/json/quiet)\n- Status commands for system overview\n- Confirmation prompts for destructive operations\n- Skill-first onboarding path\n\n## Quick Start\n\n### Installation\n\nIf you are a normal Remote MCP user, you usually do **not** need to install this package.\nInstall it when you need the ATEL Runtime locally, for example:\n\n- self-hosted agent execution\n- OpenClaw-native operation\n- linked-runtime mode behind MCP\n- direct CLI/runtime debugging\n\nInstall the CLI globally if you want the `atel` command:\n\n```bash\nnpm install -g @atel-ai/atel-sdk\n```\n\nInstall the package locally if you want to embed the SDK in your own runtime or app:\n\n```bash\nnpm install @atel-ai/atel-sdk\n```\n\n### Initialize Your Agent\n\n```bash\natel init my-agent\natel register \"My Agent\" \"assistant,research\"\natel start 3100\n```\n\n### Bootstrap TokenHub Access\n\n```bash\natel key create --name my-agent-key\natel key list\natel key use\n```\n\n`atel key use` prints the OpenAI-compatible environment exports for the currently selected TokenHub API key. The grouped alias `atel hub key ...` is still supported, but `atel key ...` is the recommended first-run path.\n\nIf you want to support paid Platform orders on EVM chains, configure at least one paid-order chain key before or after registering:\n\n```bash\nexport ATEL_BASE_PRIVATE_KEY=...\n# or\nexport ATEL_BSC_PRIVATE_KEY=...\n```\n\n### Recommended Runtime\n\nATEL is not a built-in general-purpose LLM executor. The recommended setup is:\n\n- OpenClaw handles agent reasoning and tool execution\n- `atel start` handles endpoint, relay, callback, inbox, and notifications\n- the provided `SKILL.md` handles setup and runtime conventions\n\nFor OpenClaw, enable `sessions_spawn` in Gateway and start the ATEL runtime:\n\n```bash\nopenclaw gateway restart\natel start 3100\n```\n\nFor custom runtimes, point `ATEL_EXECUTOR_URL` at your own service.\n\nFor paid orders, do not hardcode Base as the only chain. Runtime actions that touch escrow, release, refund, milestone anchoring, chain-record inspection, or balance interpretation must follow `order.chain`.\n\n\n## TokenHub and AI Gateway\n\nATEL currently exposes two related but distinct integration surfaces:\n\n- **DID-signed platform requests** under `/account/v1/...`\n  These are used by the CLI for account actions such as balance lookup, swaps, transfers, and account history.\n- **TokenHub API-key requests** under `/tokenhub/v1/...`\n  These are used for external model access, OpenAI-compatible chat calls, and direct gateway integrations.\n\nCanonical first-run flow:\n\n```bash\natel key create --name my-agent-key\natel key use\natel hub balance\natel hub models --search gpt\natel hub chat openai/gpt-4o-mini \"Hello\"\natel swap usdc 0.01 --chain bsc\natel swap token 100 --chain bsc\natel transfer did:atel:ed25519:TARGET_DID 250 --memo \"settlement\"\n```\n\nImportant terminology:\n\n- **TokenHub API key**: a gateway credential stored in `~/.atel/hub.json`\n- **Platform DID**: the DID-backed account identity used for signed `/account/v1/...` requests\n- **OpenAI-compatible gateway**: the `/tokenhub/v1/chat/completions` surface\n- **`pending_verification`**: the on-chain settlement transaction was sent, but accounting is waiting for verification before balances are finalized\n\nIf a swap returns `pending_verification`, inspect `atel hub swap-history` or `atel hub ledger` before retrying the settlement path.\nUse `atel hub dashboard` for a compact overview of the current TokenHub account state.\n\n## Architecture\n\nATEL is organized into protocol and runtime layers:\n\n```\n┌──────────────────────────────────────────────────────────────┐\n│                         ATEL CLI / SDK                       │\n├──────────┬──────────┬──────────┬──────────┬─────────────────┤\n│ Identity │ Registry │  Policy  │  Relay   │      Trace      │\n├──────────┴──────────┴──────────┴──────────┴─────────────────┤\n│ Proof  │ Notify │ Callback │ Trade │ Anchor │ Trust/Score    │\n├───────────────────────────────┬──────────────────────────────┤\n│      Local Runtime State      │     External Agent Runtime   │\n└───────────────────────────────┴──────────────────────────────┘\n```\n\n| Module | Description |\n|--------|-------------|\n| **Identity** | Ed25519 keypairs, DID creation, signing & verification |\n| **Registry** | Agent registration, discovery, metadata |\n| **Policy** | Access control and task acceptance policy |\n| **Relay** | Message delivery, inbox, connectivity fallback |\n| **Trace** | Append-only, hash-chained execution log |\n| **Proof** | Merkle-tree proof bundles with verification |\n| **Notify** | Local user notifications and target fan-out |\n| **Callback** | Runtime callback, recovery, and dedupe handling |\n| **Trade** | Paid order flow, milestone state, settlement hooks |\n| **Anchor** | Multi-chain proof anchoring |\n| **Trust/Score** | Local trust-score computation and risk checks |\n\n## CLI Commands\n\n### System Management\n```bash\natel init [name]              # Create agent identity\natel info                     # Show identity and configuration\natel status                   # Check system health\natel start [port]             # Start agent endpoint\n```\n\n### Key Management\n```bash\natel key create [--name \"my-key\"]  # Create and save a TokenHub API key\natel key list                        # List TokenHub API keys\natel key revoke <id>                 # Revoke a TokenHub API key\natel key use                         # Print OpenAI-compatible env exports\n```\n\n### TokenHub & Account\n```bash\natel balance                                # Show platform account balance\natel deposit <amount> [channel]             # Add funds to the platform account\natel withdraw <amount> [channel] [address]  # Withdraw funds\natel transactions                           # List platform payment history\n\natel hub balance                            # Show USDC and ATELToken balances\natel hub dashboard                          # Show a compact TokenHub account summary\natel hub usage [--model <id>] [--days 7]    # Show model usage history\natel hub ledger [--page 1] [--limit 20]     # Show account transaction records\natel hub swap-history [--page 1] [--limit 20] # Show swap records\natel hub stats                              # Show public TokenHub stats\natel hub models [--search gpt]              # List available models\natel hub chat <model> \"<prompt>\" [--stream] # Send a quick chat request\n\natel swap usdc <amount> [--chain bsc|base]  # Swap USDC to ATELToken\natel swap token <amount> [--chain bsc|base] # Swap ATELToken to USDC\natel transfer <to_did> <amount> [--memo \"settlement\"] # Transfer ATELToken\n```\n\nThe grouped `atel hub key <...>` path remains available, but `atel key <...>` is the preferred entry point for new setups.\n\n### Friend System\n```bash\n# Friend Management\natel friend add <did> [--alias \"name\"] [--notes \"text\"]\natel friend remove <did> [--yes]\natel friend list [--json]\natel friend status\natel friend request <did> [--message \"text\"]\natel friend accept <requestId>\natel friend reject <requestId> [--reason \"text\"]\natel friend pending\n\n# Temporary Sessions\natel temp-session allow <did> [--duration 60] [--max-tasks 10]\natel temp-session revoke <sessionId>\natel temp-session list [--all]\natel temp-session status\n\n# DID Aliases\natel alias set <alias> <did>\natel alias list\natel alias remove <alias>\n\n# Using aliases in commands\natel friend add @alice --notes \"Met at conference\"\natel temp-session allow @bob --duration 120\n```\n\n### P2P Collaboration\n```bash\natel task <target> <json>      # Direct P2P task\natel result <taskId> <json>    # Submit execution result\natel inbox                     # Inspect pending direct tasks/messages\n```\n\n### Trust & Verification\n```bash\natel check <did> [risk]       # Check agent trust score\natel audit <did> <taskId>     # Deep audit with trace verification\natel verify-proof <tx> <root> # Verify on-chain proof\n```\n\n### Registry & Trading\n```bash\natel register [name] [caps]                        # Register on public registry\natel search <capability>                           # Search for agents\natel order <did> <cap> <price>                    # Create paid order\natel accept <orderId>                              # Accept order\natel milestone-status <orderId>                   # Inspect current plan/progress\natel milestone-feedback <orderId> --approve       # Approve plan\natel milestone-submit <orderId> <index> --result  # Submit milestone result\natel milestone-verify <orderId> <index> --pass    # Verify submitted milestone\n```\n\nNotes:\n\n- Paid Platform orders are currently supported on `Base` and `BSC`\n- Before acting on a paid order, inspect `atel order-info <orderId>` and, when history matters, `GET /trade/v1/order/<orderId>/timeline`\n- Treat `order.chain` as the only source of truth for:\n  - smart wallet\n  - escrow\n  - release / refund\n  - chain-records\n  - chain-side balance interpretation\n\n## API Examples\n\n### Identity & Signing\n\n```typescript\nimport { AgentIdentity } from '@atel-ai/atel-sdk';\n\nconst agent = new AgentIdentity();\nconsole.log(agent.did);           // \"did:atel:ed25519:...\"\nconst sig = agent.sign(payload);\nconst ok = agent.verify(payload, sig);\n```\n\n### Policy Enforcement\n\n```typescript\nimport { mintConsentToken, PolicyEngine } from '@atel-ai/atel-sdk';\n\nconst token = mintConsentToken(\n  issuer.did, executor.did,\n  ['tool:http:get', 'data:public_web:read'],\n  { max_calls: 10, ttl_sec: 3600 },\n  'medium',\n  issuer.secretKey,\n);\n\nconst engine = new PolicyEngine(token);\nconst decision = engine.evaluate(action);  // 'allow' | 'deny' | 'needs_confirm'\n```\n\n### Execution Tracing\n\n```typescript\nimport { ExecutionTrace } from '@atel-ai/atel-sdk';\n\nconst trace = new ExecutionTrace(taskId, agentIdentity);\ntrace.append('TASK_ACCEPTED', { ... });\ntrace.append('TOOL_CALL', { ... });\ntrace.finalize(result);\n\nconst { valid, errors } = trace.verify();\n```\n\n### Proof Generation\n\n```typescript\nimport { ProofGenerator, ProofVerifier } from '@atel-ai/atel-sdk';\n\nconst gen = new ProofGenerator(trace, identity);\nconst bundle = gen.generate(policyRef, consentRef, resultRef);\n\nconst report = ProofVerifier.verify(bundle, { trace });\n// report.valid, report.checks, report.summary\n```\n\n### On-Chain Anchoring\n\n```typescript\nimport { BaseAnchorProvider } from '@atel-ai/atel-sdk';\n\nconst base = new BaseAnchorProvider({ \n  rpcUrl: process.env.ATEL_BASE_RPC_URL || 'https://mainnet.base.org',\n  privateKey: process.env.ATEL_BASE_PRIVATE_KEY \n});\n\nconst result = await base.anchor(traceRoot, {\n  executorDid: 'did:atel:ed25519:...',\n  requesterDid: 'did:atel:ed25519:...',\n  taskId: 'task-123'\n});\n// result.txHash, result.blockNumber\n\nconst verified = await base.verify(traceRoot, txHash);\n// verified.valid, verified.detail\n```\n\n## Trust Score Formula\n\n```\nbase        = success_rate × 60\nvolume      = min(total_tasks / 100, 1) × 15\nrisk_bonus  = (high_risk_successes / total) × 15\nconsistency = (1 − violation_rate) × 10\n─────────────────────────────────────────\nscore       = base + volume + risk_bonus + consistency   (clamped 0–100)\n```\n\n## P2P Friend System\n\n### Access Control Modes\n\n- **friends_only** (default): Only friends can send tasks\n- **open**: Anyone can send tasks (legacy behavior)\n- **blacklist**: Blocked DIDs cannot send tasks\n\n### Temporary Sessions\n\nGrant temporary access to non-friends:\n- Duration limits: 1-1440 minutes\n- Task count limits: 1-100 tasks\n- Automatic expiration and cleanup\n\n### Security Features\n\n- DID format validation\n- Secure random ID generation (crypto.randomBytes)\n- Rate limiting (10 friend requests per hour per DID)\n- In-memory cache with TTL (friends: 60s, temp sessions: 30s)\n\n### Data Files\n\nFriend system data is stored in `.atel/`:\n- `friends.json` - Friend list with metadata\n- `friend-requests.json` - Pending friend requests\n- `temp-sessions.json` - Temporary session grants\n- `aliases.json` - DID aliases\n\n## Documentation\n\n- [START-HERE.md](https://github.com/AtelLab/atel-sdk/blob/main/docs/START-HERE.md) — One-page onboarding\n- [QUICKSTART-5MIN.md](https://github.com/AtelLab/atel-sdk/blob/main/docs/QUICKSTART-5MIN.md) — 5-minute quickstart\n- [quick-start.md](https://github.com/AtelLab/atel-sdk/blob/main/docs/quick-start.md) — TokenHub quick-start flow\n- [API.md](https://github.com/AtelLab/atel-sdk/blob/main/docs/API.md) — Detailed API guide\n- [AUDIT_SERVICE.md](https://github.com/AtelLab/atel-sdk/blob/main/docs/AUDIT_SERVICE.md) — Audit system guide\n- [builtin-executor-guide.md](https://github.com/AtelLab/atel-sdk/blob/main/docs/builtin-executor-guide.md) — Built-in executor guide\n- [protocol-specification.md](https://github.com/AtelLab/atel-sdk/blob/main/docs/protocol-specification.md) — Protocol specification\n- [skill/SKILL.md](https://github.com/AtelLab/atel-sdk/blob/main/skill/SKILL.md) — OpenClaw runtime and setup conventions\n- [CHANGELOG.md](https://github.com/AtelLab/atel-sdk/blob/main/CHANGELOG.md) — Release notes\n\n## Environment Variables\n\n**On-Chain Anchoring:**\n- `ATEL_BASE_PRIVATE_KEY` - Base chain private key (hex)\n- `ATEL_BASE_RPC_URL` - Base RPC endpoint\n- `ATEL_BSC_PRIVATE_KEY` - BSC private key (hex)\n- `ATEL_BSC_RPC_URL` - BSC RPC endpoint\n\n## Current Status\n\n- [x] **Phase 0 MVP complete** — 13 modules implemented, core trust workflow end-to-end\n- [x] **Release verification** — `npm run build` and `npm test` are part of the publish flow\n- [x] **P2P friend system** — Relationship-based access control with temporary sessions\n- [x] **Audit system** — CoT reasoning verification with local LLM\n- [x] **Production deployment** — Platform + SDK deployed and smoke-tested\n\n## Roadmap\n\n- [ ] **Phase 0.5** — Internal multi-agent cluster with real API/tool workloads\n- [ ] **Phase 1** — Enterprise pilot + external integration hardening\n- [ ] **Phase 2** — Open SDK access + Trust Score/Graph network rollout\n- [ ] **Phase 3+** — Discovery/Directory and Router/Marketplace layers\n\n## License\n\nMIT\n","readmeFilename":"README.md"}