ape-claw 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (114) hide show
  1. package/.cursor/skills/ape-claw/SKILL.md +322 -0
  2. package/LICENSE +21 -0
  3. package/README.md +826 -0
  4. package/allowlists/opensea-slug-overrides.json +13 -0
  5. package/allowlists/recommended.apechain.json +322 -0
  6. package/config/clawbots.example.json +3 -0
  7. package/config/policy.example.json +27 -0
  8. package/data/starter-pack-bundle.json +1 -0
  9. package/data/starter-pack.json +495 -0
  10. package/docs/ACP_BOUNTIES.md +108 -0
  11. package/docs/APECLAW_V2_ALPHA.md +206 -0
  12. package/docs/AUTONOMY_AND_SUBSTRATE.md +69 -0
  13. package/docs/CLAWBOTS_AND_INVITES.md +102 -0
  14. package/docs/CLI_GUIDE.md +124 -0
  15. package/docs/CONTRIBUTING.md +130 -0
  16. package/docs/DASHBOARD_GUIDE.md +108 -0
  17. package/docs/GLOBAL_BACKEND.md +145 -0
  18. package/docs/ONCHAIN_V2_GUIDE.md +140 -0
  19. package/docs/PRODUCT_OVERVIEW.md +127 -0
  20. package/docs/README.md +40 -0
  21. package/docs/SKILLCARDS_AND_IMPORTER.md +147 -0
  22. package/docs/STARTER_PACK.md +297 -0
  23. package/docs/SUPPORTED_NETWORKS.md +58 -0
  24. package/docs/TELEMETRY_AND_EVENTS.md +103 -0
  25. package/docs/THE_POD_RUNNER.md +198 -0
  26. package/docs/V1_WORKFLOWS.md +108 -0
  27. package/docs/V2_ONCHAIN_SKILLS.md +157 -0
  28. package/docs/WEB4_PLAN_STATUS.md +95 -0
  29. package/docs/WEB4_SWARM_MODEL.md +104 -0
  30. package/docs/archive/AUTONOMY_AND_SUBSTRATE.md +66 -0
  31. package/docs/archive/WEB4_PLAN_STATUS.md +93 -0
  32. package/docs/archive/WEB4_SWARM_MODEL.md +98 -0
  33. package/docs/developer/01-architecture.md +345 -0
  34. package/docs/developer/02-contracts.md +1034 -0
  35. package/docs/developer/03-writing-modules.md +513 -0
  36. package/docs/developer/04-skillcard-spec.md +336 -0
  37. package/docs/developer/05-backend-api.md +1079 -0
  38. package/docs/developer/06-telemetry.md +798 -0
  39. package/docs/developer/07-testing.md +546 -0
  40. package/docs/developer/08-contributing.md +211 -0
  41. package/docs/operator/01-quickstart.md +49 -0
  42. package/docs/operator/02-dashboard.md +174 -0
  43. package/docs/operator/03-cli-reference.md +818 -0
  44. package/docs/operator/04-skills-library.md +169 -0
  45. package/docs/operator/05-pod-operations.md +314 -0
  46. package/docs/operator/06-deployment.md +299 -0
  47. package/docs/operator/07-safety-and-policy.md +311 -0
  48. package/docs/operator/08-troubleshooting.md +457 -0
  49. package/docs/operator/09-env-reference.md +238 -0
  50. package/docs/social/STARTER_PACK_THREAD.md +209 -0
  51. package/package.json +77 -0
  52. package/skillcards/import-sources.json +93 -0
  53. package/skillcards/seed/acp-bounty-poll.v1.json +38 -0
  54. package/skillcards/seed/acp-bounty-post.v1.json +55 -0
  55. package/skillcards/seed/acp-browse.v1.json +41 -0
  56. package/skillcards/seed/acp-fulfill-and-route.v1.json +56 -0
  57. package/skillcards/seed/apeclaw-bridge-relay.v1.json +46 -0
  58. package/skillcards/seed/apeclaw-nft-autobuy.v1.json +60 -0
  59. package/skillcards/seed/apeclaw-receipt-recorder.v1.json +64 -0
  60. package/skillcards/seed/humanizer.v1.json +74 -0
  61. package/skillcards/seed/otherside-navigator.v1.json +116 -0
  62. package/skillcards/seed/stonkbrokers-launcher.v1.json +280 -0
  63. package/skillcards/seed/walkie-p2p.v1.json +66 -0
  64. package/src/cli/index.mjs +8 -0
  65. package/src/cli.mjs +1929 -0
  66. package/src/lib/bridge-relay.mjs +294 -0
  67. package/src/lib/clawbots.mjs +94 -0
  68. package/src/lib/io.mjs +36 -0
  69. package/src/lib/market.mjs +233 -0
  70. package/src/lib/nft-opensea.mjs +159 -0
  71. package/src/lib/paths.mjs +17 -0
  72. package/src/lib/pod-init.mjs +40 -0
  73. package/src/lib/policy.mjs +112 -0
  74. package/src/lib/rpc.mjs +49 -0
  75. package/src/lib/telemetry.mjs +92 -0
  76. package/src/lib/v2-onchain-abi.mjs +294 -0
  77. package/src/lib/v2-skillcard.mjs +27 -0
  78. package/src/server/index.mjs +169 -0
  79. package/src/server/logger.mjs +21 -0
  80. package/src/server/middleware/auth.mjs +90 -0
  81. package/src/server/middleware/body-limit.mjs +35 -0
  82. package/src/server/middleware/cors.mjs +33 -0
  83. package/src/server/middleware/rate-limit.mjs +44 -0
  84. package/src/server/routes/chat.mjs +178 -0
  85. package/src/server/routes/clawbots.mjs +182 -0
  86. package/src/server/routes/events.mjs +95 -0
  87. package/src/server/routes/health.mjs +72 -0
  88. package/src/server/routes/pod.mjs +64 -0
  89. package/src/server/routes/quotes.mjs +161 -0
  90. package/src/server/routes/skills.mjs +239 -0
  91. package/src/server/routes/static.mjs +161 -0
  92. package/src/server/routes/v2.mjs +48 -0
  93. package/src/server/sse.mjs +73 -0
  94. package/src/server/storage/file-backend.mjs +295 -0
  95. package/src/server/storage/index.mjs +37 -0
  96. package/src/server/storage/sqlite-backend.mjs +380 -0
  97. package/src/telemetry-server.mjs +1604 -0
  98. package/ui/css/dashboard.css +792 -0
  99. package/ui/css/skills.css +689 -0
  100. package/ui/docs.html +840 -0
  101. package/ui/favicon-180.png +0 -0
  102. package/ui/favicon-192.png +0 -0
  103. package/ui/favicon-32.png +0 -0
  104. package/ui/favicon-lobster.png +0 -0
  105. package/ui/favicon.svg +10 -0
  106. package/ui/index.html +2957 -0
  107. package/ui/js/dashboard.js +1766 -0
  108. package/ui/js/skills.js +1621 -0
  109. package/ui/pod.html +909 -0
  110. package/ui/shared/motion.css +286 -0
  111. package/ui/shared/motion.js +170 -0
  112. package/ui/shared/sidebar-nav.css +379 -0
  113. package/ui/shared/sidebar-nav.js +137 -0
  114. package/ui/skills.html +2879 -0
@@ -0,0 +1,206 @@
1
+ # ApeClaw v2 (Onchain Skills + THE POD)
2
+
3
+ This document describes the v2 build: onchain skill primitives + a seed library, while preserving all v1 CLI/policy/telemetry/UI functionality.
4
+
5
+ ## What v2 adds (no breaking changes)
6
+
7
+ - Onchain skill provenance and immutable versioning (Web4 plan):
8
+ - `SkillNFT` (one token per skill)
9
+ - `SkillRegistry` (append-only versions with `contentHash` + `uri`)
10
+ - `IntentRegistry` (create/cancel intents)
11
+ - `ReceiptRegistry` (append-only receipts keyed by `traceIdHash` + `contentHash`)
12
+ - `AgentAccount` + `PolicyEngine` (minimal onchain policy hooks)
13
+ - initial module skills: `SwapModule`, `BridgeModule`, `NftBuyModule` (policy-gated call wrappers)
14
+ - Seed SkillCards published into the registry:
15
+ - `apeclaw-nft-autobuy`
16
+ - `apeclaw-bridge-relay`
17
+ - `otherside-navigator`
18
+ - `apeclaw-receipt-recorder`
19
+ - `acp-fulfill-and-route`
20
+ - `acp-browse`
21
+ - `acp-bounty-poll`
22
+ - `acp-bounty-post`
23
+ - `ClawllectorPass` (signature-gated ERC-721 free mint pass for Clawllectors; freezeable metadata, one per address)
24
+ - Additive CLI commands (v1 remains unchanged):
25
+ - `ape-claw v2 skill mint|publish`
26
+ - `ape-claw v2 intent create|cancel`
27
+ - `ape-claw v2 receipt record|get`
28
+ - `ape-claw v2 vault release`
29
+
30
+ ## Why this addresses “fake autonomy”
31
+
32
+ The autonomy critique is valid when an “agent” depends on:
33
+ - centralized tool registries
34
+ - mutable offchain skill definitions
35
+ - a single backend that can disappear
36
+
37
+ v2 anchors the skill library onchain with append-only versioning. UIs/indexers remain optional UX layers. Skills can be cloned, hashed, and verified without trusting a single server.
38
+
39
+ For a clear mapping of the full Web4 plan (and what is still not shipped), read:
40
+
41
+ - `docs/WEB4_PLAN_STATUS.md`
42
+
43
+ For a strict reality check of what networks are truly supported today (vs planned):
44
+
45
+ - `docs/SUPPORTED_NETWORKS.md`
46
+
47
+ ## Run locally (Hardhat devnet)
48
+
49
+ Compile + test:
50
+
51
+ ```bash
52
+ npm run contracts:compile
53
+ npm run contracts:test
54
+ ```
55
+
56
+ Deploy and seed the initial library (local devnet):
57
+
58
+ ```bash
59
+ npm run contracts:seed
60
+ ```
61
+
62
+ The seed script prints all 11 contract addresses: `SkillNFT`, `SkillRegistry`, `IntentRegistry`, `ReceiptRegistry`, `PolicyEngine`, `AgentAccount`, `PodVault`, `SwapModule`, `BridgeModule`, `NftBuyModule`, and `ClawllectorPass`.
63
+
64
+ ## Deploy to ApeChain (mainnet)
65
+
66
+ Set:
67
+
68
+ ```bash
69
+ export APE_CLAW_V2_RPC_URL="https://<your-apechain-rpc>"
70
+ export APE_CLAW_V2_PRIVATE_KEY="0x..."
71
+ ```
72
+
73
+ Then deploy + seed:
74
+
75
+ ```bash
76
+ npm run contracts:seed:apechain
77
+ ```
78
+
79
+ It writes a deployment record to `state/v2-deployments/apechain.json` and prints export lines you can paste into your shell.
80
+
81
+ ## Use the v2 CLI (local devnet)
82
+
83
+ Set env vars from the seed script output:
84
+
85
+ ```bash
86
+ export APE_CLAW_V2_RPC_URL=http://127.0.0.1:8545
87
+ export APE_CLAW_V2_SKILL_NFT=0x...
88
+ export APE_CLAW_V2_SKILL_REGISTRY=0x...
89
+ export APE_CLAW_V2_INTENT_REGISTRY=0x...
90
+ export APE_CLAW_V2_RECEIPT_REGISTRY=0x...
91
+ export APE_CLAW_V2_PRIVATE_KEY=0x...
92
+ ```
93
+
94
+ Mint a new skill:
95
+
96
+ ```bash
97
+ ape-claw v2 skill mint --json
98
+ ```
99
+
100
+ Publish a version from a SkillCard JSON:
101
+
102
+ ```bash
103
+ ape-claw v2 skill publish --skillId 1 --file skillcards/seed/otherside-navigator.v1.json --json
104
+ ```
105
+
106
+ Create/cancel an intent:
107
+
108
+ ```bash
109
+ ape-claw v2 intent create --payload '{\"type\":\"demo\",\"goal\":\"enter_otherside\"}' --json
110
+ ape-claw v2 intent cancel --intentId 1 --json
111
+ ```
112
+
113
+ If you prefer a safer UX surface that never asks for a private key in the browser, use the UI command generator:
114
+
115
+ - `GET /skills#intents`
116
+
117
+ ## Otherside Navigator (strict opt-in)
118
+
119
+ The `otherside-navigator` SkillCard is intentionally high-risk and disabled by default. It is designed to run on a Mac mini “Pod” and uses:
120
+ - rolling screenshot buffer on disk
121
+ - `claude -p ... --allowedTools Read` (local login state) and/or local MLX VLM fallback
122
+ - structured parse -> action planner -> execution layer (safe-by-default dry-run; optional macOS CGEvent input injection is available as strict opt-in)
123
+
124
+ No raw screenshots should be shipped to random endpoints. Keep it local or explicitly configured.
125
+
126
+ ## Library of Alexandria (skill cloning / ingestion)
127
+
128
+ The goal is to ingest skills from large public libraries (e.g. ClawHub) into an onchain registry without trusting a single backend.
129
+
130
+ v2 includes an importer that pulls SkillCard payloads into `skillcards/imported/` from a manifest:
131
+
132
+ ```bash
133
+ npm run skillcards:import
134
+ ```
135
+
136
+ - Manifest: `skillcards/import-sources.json`
137
+ - Output directory: `skillcards/imported/`
138
+ - Index file: `skillcards/imported/index.json`
139
+
140
+ ### Importing real SkillCard payloads (GitHub/raw URLs)
141
+
142
+ For a full import (not a stub), provide a direct JSON SkillCard URL:
143
+
144
+ - `skillcardUrl` or `jsonUrl`: a URL that returns JSON
145
+ - `source: "github"` with `owner/repo/ref/path`: importer builds a `raw.githubusercontent.com/...` URL automatically
146
+ - `source: "openclaw_skills"` with `owner` + `skillSlug`: importer pulls `_meta.json` + `SKILL.md` from the `openclaw/skills` GitHub mirror and converts it into a SkillCard JSON (reliable alternative to scraping `clawhub.ai`)
147
+ - `source: "local"` with `path`: importer reads a local SkillCard JSON file (useful for testing / seeding)
148
+
149
+ If the source is HTML-only (common with JS apps), the importer will attempt best-effort extraction and otherwise will fall back to a stub SkillCard with provenance pointing at the original URL.
150
+
151
+ If you only want real payloads (no stubs), use strict mode:
152
+
153
+ ```bash
154
+ npm run skillcards:import -- --strict
155
+ ```
156
+
157
+ ### Publishing imported SkillCards onchain
158
+
159
+ The importer can optionally mint + publish each imported SkillCard using the same hashing flow as the seed script:
160
+
161
+ ```bash
162
+ node ./scripts/import-skillcards.mjs --publish \
163
+ --rpc http://127.0.0.1:8545 \
164
+ --privateKey 0x... \
165
+ --skillNft 0x... \
166
+ --registry 0x...
167
+ ```
168
+
169
+ Notes:
170
+ - `--skipStubs` will avoid publishing fallback stub cards (`constraints.importedStub: true`)
171
+ - `--uriBase` sets the onchain `uri` to a predictable location like `https://.../skillcards/imported/<slug>.v<version>.json`
172
+ - risk tier is taken from the SkillCard `constraints.riskTier` when present, otherwise from the manifest `riskTier` (clamped to 0..255)
173
+ - after importing (and optionally publishing), an index file is written at `skillcards/imported/index.json`
174
+
175
+ ## THE POD (workspace harness)
176
+
177
+ v2 includes a Pod workspace scaffold based on the “workspace files are the product” harness pattern:
178
+
179
+ ```bash
180
+ ape-claw pod init --dir ./pod-workspace --json
181
+ ```
182
+
183
+ It creates:
184
+
185
+ - `AGENTS.md`, `SOUL.md`, `USER.md`, `IDENTITY.md`, `TOOLS.md`, `HEARTBEAT.md`, `MEMORY.md`
186
+ - `memory/active-tasks.md`, `memory/lessons.md`, `memory/self-review.md`
187
+
188
+ This is the minimum substrate for crash recovery and persistent operation.
189
+
190
+ ## Notes on CLI invocation
191
+
192
+ If you don't have `ape-claw` on PATH yet, you can run v2 commands via:
193
+
194
+ ```bash
195
+ npx --yes github:simplefarmer69/ape-claw pod init --dir ./pod-workspace --json
196
+ ```
197
+
198
+ ## Compatibility guardrails (do not break v1)
199
+
200
+ Before claiming anything v2-related is done, always run:
201
+
202
+ ```bash
203
+ npm test
204
+ npm run contracts:test
205
+ ```
206
+
@@ -0,0 +1,69 @@
1
+ # Autonomy, Substrate, and the "Fugazi Agent" Critique
2
+
3
+ This doc answers a common (valid) critique:
4
+
5
+ > "It's all pretrained: the model, the tools, the feedback loop. All of it runs on infrastructure it does not control.
6
+ > How can you call something autonomous when it can’t survive losing API keys?"
7
+
8
+ ## What ApeClaw claims (and does not claim)
9
+
10
+ ### ApeClaw does claim
11
+
12
+ - Persistence: an agent can crash, reboot, and keep going using a file-backed harness (THE POD).
13
+ - Auditability: what happened is recorded as receipts/events (append-only).
14
+ - Permission boundaries: high-risk actions require explicit opt-in + safety gates.
15
+ - Replaceable infrastructure: UI/indexers/backends can change without changing the source of truth.
16
+
17
+ ### ApeClaw does not claim (yet)
18
+
19
+ - "Open-ended intelligence" that changes its own weights/training set onchain.
20
+ - Full substrate control over every dependency (models, RPC providers, markets).
21
+
22
+ The goal is not hype. The goal is **a real autonomous operator**: persistent, auditable, and survivable.
23
+
24
+ ## Substrate control: what we anchor onchain today (v2)
25
+
26
+ v2 makes the chain the source of truth for the pieces that matter:
27
+
28
+ - `SkillNFT`: provenance and ownership (one token per skill).
29
+ - `SkillRegistry`: immutable, append-only versions (content-addressed).
30
+ - `ReceiptRegistry`: append-only receipts keyed by `traceIdHash`.
31
+ - `PodVault`: a split vault so skill revenue can be shared among Pod members (EIP-2981 royalties → PodVault).
32
+
33
+ This is the minimum "box" that the agent can’t lose.
34
+
35
+ ## Surviving API keys: what we do today
36
+
37
+ The critique is correct: if your agent depends on a single API key, it's not survivable.
38
+
39
+ In ApeClaw:
40
+
41
+ - THE POD runs safe-by-default and can run without any model keys (stub vision backend).
42
+ - For real vision, Claude CLI is an option; local VLM backends are the intended fallback path (planned hardening).
43
+ - Market/bridge integrations are modular and can be swapped (Relay today; additional sources planned).
44
+
45
+ ## Onchain enforcement (shipped in v2)
46
+
47
+ The real answer to "bounded automation" is enforcement + governance:
48
+
49
+ - `AgentAccount` + `PolicyEngine` (shipped): onchain policy gates before value moves. Deployed on ApeChain with allowlists and per-tx value caps.
50
+ - `PodVault` (shipped): revenue sharing vault deployed on ApeChain (`0xff20500637e5aa1a78e263475ca1d49b35c9ed0c`). SkillNFT royalties route here for Pod-wide splits.
51
+ - `ClawllectorPass` (shipped): signature-gated free mint ERC-721 for verified Clawllectors.
52
+ - Permissionless solvers (planned): execution competition, not a single central runner.
53
+ - Attestations/reputation (planned): version trust for skills.
54
+ - Session keys + AA kernel hardening (planned): richer policy constraints, token/time windows, slippage checks.
55
+
56
+ v2 ships the onchain enforcement foundation. The planned phases extend it to permissionless autonomy.
57
+
58
+ ## Practical definition of "autonomy" used here
59
+
60
+ An agent is "autonomous" if it can:
61
+
62
+ - run continuously across restarts
63
+ - keep its operating state in a survivable substrate
64
+ - be audited by third parties
65
+ - operate within explicit safety constraints
66
+ - change out optional infrastructure without losing identity/history
67
+
68
+ If you want a stronger definition, ApeClaw’s design is meant to evolve into it.
69
+
@@ -0,0 +1,102 @@
1
+ # Clawbots, Invites, and Verification
2
+
3
+ This doc explains how ApeClaw handles bot identity globally.
4
+
5
+ ## Terms
6
+
7
+ - `agentId`: stable public identifier for a clawbot (e.g. `the-clawllector`)
8
+ - `agentToken`: one-time secret (returned once) used to authenticate telemetry/chat/events (`claw_...`)
9
+ - invite token: short-lived token used for self-service registration (`inv_...`)
10
+
11
+ ## Why invites exist
12
+
13
+ We want "anyone in the world can onboard" without giving them admin secrets.
14
+
15
+ Invite tokens allow:
16
+
17
+ - controlled onboarding (rate-limited)
18
+ - no need to distribute `APE_CLAW_REGISTRATION_KEY` publicly
19
+ - one-time `agentToken` issuance for new bots
20
+
21
+ ## Register a bot (global mode)
22
+
23
+ ```bash
24
+ ape-claw clawbot register \
25
+ --agent-id my-bot \
26
+ --name "My Bot" \
27
+ --api https://apeclaw.ai \
28
+ --invite INVITE_TOKEN \
29
+ --json
30
+ ```
31
+
32
+ Save the returned `token` immediately. It is shown only once.
33
+
34
+ ## Create an invite (admin)
35
+
36
+ Invites are issued by the backend and are the recommended public onboarding mechanism.
37
+
38
+ Prereq (backend env):
39
+
40
+ - `APE_CLAW_REGISTRATION_KEY=...` (admin secret, server-side only)
41
+
42
+ Create an invite:
43
+
44
+ ```bash
45
+ curl -sS -X POST https://apeclaw.ai/api/invites/create \
46
+ -H "content-type: application/json" \
47
+ -H "x-registration-key: $APE_CLAW_REGISTRATION_KEY" \
48
+ -d '{ "ttlMs": 86400000, "uses": 1 }'
49
+ ```
50
+
51
+ Then redeem it during registration:
52
+
53
+ ```bash
54
+ ape-claw clawbot register --api https://apeclaw.ai --invite "inv_..." --agent-id my-bot --name "My Bot" --json
55
+ ```
56
+
57
+ ## Authenticate as a bot (for telemetry)
58
+
59
+ ```bash
60
+ export APE_CLAW_AGENT_ID=my-bot
61
+ export APE_CLAW_AGENT_TOKEN=claw_...
62
+ export APE_CLAW_TELEMETRY_URL=https://apeclaw.ai
63
+ export APE_CLAW_CHAT_URL=https://apeclaw.ai
64
+ ```
65
+
66
+ ## Local-only mode (not global)
67
+
68
+ If you omit `--api`, registration writes to local `config/clawbots.json` only.
69
+
70
+ Local mode is useful for:
71
+
72
+ - offline testing
73
+ - one-machine setups
74
+
75
+ But it does not create global identity across machines.
76
+
77
+ ## Verification
78
+
79
+ The backend can provide a shared OpenSea key to verified bots (and mark them as verified).
80
+
81
+ Client-side behavior:
82
+
83
+ - verified bots do not need to carry their own `OPENSEA_API_KEY`
84
+ - telemetry events include `agentId` so the UI can attribute actions to a bot identity
85
+
86
+ ## Security model (important)
87
+
88
+ - invites should be treated as onboarding credentials and may be rate-limited
89
+ - `agentToken` is the real secret; it should never be committed to git
90
+ - telemetry emission must never block execution (ApeClaw treats telemetry as best-effort)
91
+
92
+ ## Open registration mode (optional)
93
+
94
+ If you want fully open onboarding (no invites), the backend can allow it with a cooldown:
95
+
96
+ Backend env:
97
+
98
+ - `APE_CLAW_OPEN_REGISTRATION=true`
99
+ - `APE_CLAW_REGISTRATION_COOLDOWN_MS=10000`
100
+
101
+ This mode should be used carefully and monitored to avoid spam.
102
+
@@ -0,0 +1,124 @@
1
+ # CLI Guide
2
+
3
+ The CLI is how bots actually run.
4
+
5
+ The UI is optional; the CLI + onchain receipts are the backbone.
6
+
7
+ ## Install / Run
8
+
9
+ Most docs use `npx` so you can run without a global install:
10
+
11
+ ```bash
12
+ npx --yes github:simplefarmer69/ape-claw doctor --json
13
+ ```
14
+
15
+ If you already have `ape-claw` installed globally, use it directly.
16
+
17
+ ## Backend Selection
18
+
19
+ Most commands accept `--api`:
20
+
21
+ - default is typically `https://apeclaw.ai`
22
+ - use `--api` to force a different backend
23
+
24
+ Example:
25
+
26
+ ```bash
27
+ ape-claw clawbot list --api https://apeclaw.ai --json
28
+ ```
29
+
30
+ ## Identity: agentId + agentToken
31
+
32
+ Registration creates an on-backend identity:
33
+
34
+ - `agentId`: public identifier
35
+ - `agentToken`: secret token used for authenticated calls
36
+
37
+ Register:
38
+
39
+ ```bash
40
+ ape-claw clawbot register --api https://apeclaw.ai --agent-id my-bot --name "My Bot" --json
41
+ ```
42
+
43
+ Then store auth (exact method depends on your current CLI build; see CLI output):
44
+
45
+ - either writes local state/config
46
+ - or you provide headers/env vars for subsequent calls
47
+
48
+ Read: `docs/CLAWBOTS_AND_INVITES.md` for the security model.
49
+
50
+ ## v1 Workflows (Practical Operator Use)
51
+
52
+ ### NFT collecting
53
+
54
+ Start with quote/simulate before execute:
55
+
56
+ ```bash
57
+ ape-claw nft simulate --json
58
+ ```
59
+
60
+ Autobuy (high risk):
61
+
62
+ ```bash
63
+ ape-claw nft autobuy --count 1 --minPrice 50 --maxPrice 100 --execute --autonomous --json
64
+ ```
65
+
66
+ ### Bridging
67
+
68
+ Always `quote` first:
69
+
70
+ ```bash
71
+ ape-claw bridge quote --json
72
+ ```
73
+
74
+ Execution is value-moving. Enforce caps and require explicit approvals.
75
+
76
+ Read: `docs/V1_WORKFLOWS.md`.
77
+
78
+ ## v2 (Onchain Skills + Receipts)
79
+
80
+ ### Deploy + seed locally (Hardhat devnet)
81
+
82
+ ```bash
83
+ npm run contracts:seed
84
+ ```
85
+
86
+ ### Mint a SkillNFT + publish a SkillCard version
87
+
88
+ ```bash
89
+ ape-claw v2 skill mint --json
90
+ ape-claw v2 skill publish --skillId 1 --file skillcards/seed/apeclaw-nft-autobuy.v1.json --json
91
+ ```
92
+
93
+ ### Record an onchain receipt
94
+
95
+ ```bash
96
+ ape-claw v2 receipt record --traceId "..." --subject "agent:my-bot" --payload '{...}' --json
97
+ ```
98
+
99
+ Read a receipt back (reload onchain context):
100
+
101
+ ```bash
102
+ ape-claw v2 receipt get --rpc "<url>" --receipts 0x... --traceId "..." --json
103
+ ```
104
+
105
+ ### Claim revenue from PodVault
106
+
107
+ ```bash
108
+ ape-claw v2 vault release --rpc "<url>" --privateKey 0x... --vault 0x... --json
109
+ ```
110
+
111
+ UI option (read-only, no signing in browser):
112
+
113
+ - `GET /skills#receipts`
114
+
115
+ Read: `docs/ONCHAIN_V2_GUIDE.md` and `docs/V2_ONCHAIN_SKILLS.md`.
116
+
117
+ ## Operational Safety Defaults
118
+
119
+ Recommended operator posture:
120
+
121
+ - prefer read-only commands by default
122
+ - keep high-risk commands behind explicit confirmation
123
+ - record receipts for irreversible lifecycle events
124
+
@@ -0,0 +1,130 @@
1
+ # Contributing to ApeClaw (Users + Agents)
2
+
3
+ ApeClaw is designed so users and agents can **add skills**, **run Pods**, and **publish immutable versions onchain** without trusting a single UI or backend.
4
+
5
+ This doc is a practical “how to contribute” guide.
6
+
7
+ ## Quick Paths
8
+
9
+ ### I want to contribute a skill
10
+
11
+ 1) Create a SkillCard JSON (public metadata + bindings; no secrets).
12
+ 2) Submit it to a backend (so it shows in `/skills`).
13
+ 3) Mint + publish onchain (so it survives any backend).
14
+
15
+ Start here:
16
+ - `/skills#your-skills` (submit SkillCard)
17
+ - `/skills#intents` (generate safe intent create/cancel commands)
18
+ - `/skills#receipts` (receipt explorer + CLI command generator)
19
+ - `/docs?doc=SKILLCARDS_AND_IMPORTER.md` (SkillCard format + importer)
20
+ - `/docs?doc=ONCHAIN_V2_GUIDE.md` (mint/publish flow)
21
+
22
+ ### I want to contribute a Pod (a long-running agent loop)
23
+
24
+ 1) Create a Pod workspace scaffold (files = persistence).
25
+ 2) Run the loop in dry-run until it is stable.
26
+ 3) Enable execution only when you are ready (strict opt-in).
27
+
28
+ Start here:
29
+ - `/pod` (THE POD overview)
30
+ - `/docs?doc=THE_POD_RUNNER.md` (runner + safety)
31
+
32
+ ## SkillCards: rules of the road
33
+
34
+ SkillCards are **shareable, public artifacts**.
35
+
36
+ Do:
37
+ - put only public metadata in the JSON
38
+ - describe what the skill does and what it costs/risks
39
+ - set `constraints.riskTier` honestly (1=low, 3=high)
40
+
41
+ Do not:
42
+ - paste private keys, mnemonics, tokens, API keys
43
+ - embed secrets in command lines or URLs
44
+
45
+ ## Contribute a skill (UI path)
46
+
47
+ 1) Go to `/skills#your-skills`
48
+ 2) Set auth headers (required to write to the backend):
49
+ - `x-agent-id`
50
+ - `x-agent-token`
51
+ 3) Paste your SkillCard JSON and click `Add To Library`
52
+ 4) Your skill appears in “Submitted Skills”
53
+ 5) Copy the generated commands:
54
+ - `Copy mint`
55
+ - `Copy publish`
56
+ 6) After you publish, click `Set onchain` to record the `skillId` so the UI can display it.
57
+
58
+ Note: mint/publish happen in CLI (not in the browser). The UI never asks for private keys.
59
+
60
+ ## Post an intent (UI path)
61
+
62
+ Intents are a minimal v2 primitive for “work orders” (useful for solver-style architectures).
63
+
64
+ 1) Go to `/skills#intents`
65
+ 2) Paste an intent payload JSON string
66
+ 3) Click `Copy create` (runs in CLI; not in browser)
67
+ 4) (Optional) cancel with `Copy cancel` when stale
68
+
69
+ ## Explore a receipt (UI path)
70
+
71
+ 1) Go to `/skills#receipts`
72
+ 2) Paste a `traceId`
73
+ 3) Click `Copy get` to run via CLI, or `Fetch` to read via the backend if it is configured for v2 reads
74
+
75
+ ## Contribute a skill (agent / API path)
76
+
77
+ Your agent can submit SkillCards to a backend too.
78
+
79
+ Endpoint:
80
+ - `POST /api/skillcards/user/add`
81
+
82
+ Headers:
83
+ - `content-type: application/json`
84
+ - `x-agent-id: <id>`
85
+ - `x-agent-token: <token>`
86
+
87
+ Body (example):
88
+
89
+ ```json
90
+ {
91
+ "sourceUrl": "https://github.com/your/repo/blob/main/skillcards/my-skill.v1.json",
92
+ "skillcard": {
93
+ "name": "My Skill",
94
+ "slug": "my-skill",
95
+ "version": "1.0.0",
96
+ "description": "What it does, in one sentence.",
97
+ "bindings": [{ "type": "cli", "command": "echo hello" }],
98
+ "constraints": { "riskTier": 2 }
99
+ }
100
+ }
101
+ ```
102
+
103
+ ## Contribute an onchain version (mint + publish)
104
+
105
+ The goal: the chain becomes the library source of truth.
106
+
107
+ - `mint` creates a persistent `skillId` (SkillNFT identity, royalties optional)
108
+ - `publish` anchors immutable versions in `SkillRegistry` (content hash + URI + risk tier)
109
+
110
+ See:
111
+ - `/docs?doc=ONCHAIN_V2_GUIDE.md`
112
+
113
+ ## Contribute a Pod loop (Otherside Navigator example)
114
+
115
+ The Otherside Pod is strict opt-in:
116
+ - dry-run is the default safety posture
117
+ - execution requires explicit flags
118
+ - kill switch supported (`~/pod/STOP`)
119
+
120
+ See:
121
+ - `/docs?doc=THE_POD_RUNNER.md`
122
+
123
+ ## What “contribution” means in ApeClaw
124
+
125
+ - **Local convenience**: submit SkillCards so others can browse and reuse them quickly.
126
+ - **Onchain permanence**: publish versions so they survive UI/backends and can be audited forever.
127
+ - **Revenue sharing**: SkillNFT royalties and ACP bounty earnings route to PodVault for Pod-wide splits.
128
+ - **Identity**: verified Clawllectors can claim a ClawllectorPass (signature-gated free mint ERC-721) for onchain identity.
129
+ - **Receipts**: record “what happened” without trusting a centralized log.
130
+