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.
- package/.cursor/skills/ape-claw/SKILL.md +322 -0
- package/LICENSE +21 -0
- package/README.md +826 -0
- package/allowlists/opensea-slug-overrides.json +13 -0
- package/allowlists/recommended.apechain.json +322 -0
- package/config/clawbots.example.json +3 -0
- package/config/policy.example.json +27 -0
- package/data/starter-pack-bundle.json +1 -0
- package/data/starter-pack.json +495 -0
- package/docs/ACP_BOUNTIES.md +108 -0
- package/docs/APECLAW_V2_ALPHA.md +206 -0
- package/docs/AUTONOMY_AND_SUBSTRATE.md +69 -0
- package/docs/CLAWBOTS_AND_INVITES.md +102 -0
- package/docs/CLI_GUIDE.md +124 -0
- package/docs/CONTRIBUTING.md +130 -0
- package/docs/DASHBOARD_GUIDE.md +108 -0
- package/docs/GLOBAL_BACKEND.md +145 -0
- package/docs/ONCHAIN_V2_GUIDE.md +140 -0
- package/docs/PRODUCT_OVERVIEW.md +127 -0
- package/docs/README.md +40 -0
- package/docs/SKILLCARDS_AND_IMPORTER.md +147 -0
- package/docs/STARTER_PACK.md +297 -0
- package/docs/SUPPORTED_NETWORKS.md +58 -0
- package/docs/TELEMETRY_AND_EVENTS.md +103 -0
- package/docs/THE_POD_RUNNER.md +198 -0
- package/docs/V1_WORKFLOWS.md +108 -0
- package/docs/V2_ONCHAIN_SKILLS.md +157 -0
- package/docs/WEB4_PLAN_STATUS.md +95 -0
- package/docs/WEB4_SWARM_MODEL.md +104 -0
- package/docs/archive/AUTONOMY_AND_SUBSTRATE.md +66 -0
- package/docs/archive/WEB4_PLAN_STATUS.md +93 -0
- package/docs/archive/WEB4_SWARM_MODEL.md +98 -0
- package/docs/developer/01-architecture.md +345 -0
- package/docs/developer/02-contracts.md +1034 -0
- package/docs/developer/03-writing-modules.md +513 -0
- package/docs/developer/04-skillcard-spec.md +336 -0
- package/docs/developer/05-backend-api.md +1079 -0
- package/docs/developer/06-telemetry.md +798 -0
- package/docs/developer/07-testing.md +546 -0
- package/docs/developer/08-contributing.md +211 -0
- package/docs/operator/01-quickstart.md +49 -0
- package/docs/operator/02-dashboard.md +174 -0
- package/docs/operator/03-cli-reference.md +818 -0
- package/docs/operator/04-skills-library.md +169 -0
- package/docs/operator/05-pod-operations.md +314 -0
- package/docs/operator/06-deployment.md +299 -0
- package/docs/operator/07-safety-and-policy.md +311 -0
- package/docs/operator/08-troubleshooting.md +457 -0
- package/docs/operator/09-env-reference.md +238 -0
- package/docs/social/STARTER_PACK_THREAD.md +209 -0
- package/package.json +77 -0
- package/skillcards/import-sources.json +93 -0
- package/skillcards/seed/acp-bounty-poll.v1.json +38 -0
- package/skillcards/seed/acp-bounty-post.v1.json +55 -0
- package/skillcards/seed/acp-browse.v1.json +41 -0
- package/skillcards/seed/acp-fulfill-and-route.v1.json +56 -0
- package/skillcards/seed/apeclaw-bridge-relay.v1.json +46 -0
- package/skillcards/seed/apeclaw-nft-autobuy.v1.json +60 -0
- package/skillcards/seed/apeclaw-receipt-recorder.v1.json +64 -0
- package/skillcards/seed/humanizer.v1.json +74 -0
- package/skillcards/seed/otherside-navigator.v1.json +116 -0
- package/skillcards/seed/stonkbrokers-launcher.v1.json +280 -0
- package/skillcards/seed/walkie-p2p.v1.json +66 -0
- package/src/cli/index.mjs +8 -0
- package/src/cli.mjs +1929 -0
- package/src/lib/bridge-relay.mjs +294 -0
- package/src/lib/clawbots.mjs +94 -0
- package/src/lib/io.mjs +36 -0
- package/src/lib/market.mjs +233 -0
- package/src/lib/nft-opensea.mjs +159 -0
- package/src/lib/paths.mjs +17 -0
- package/src/lib/pod-init.mjs +40 -0
- package/src/lib/policy.mjs +112 -0
- package/src/lib/rpc.mjs +49 -0
- package/src/lib/telemetry.mjs +92 -0
- package/src/lib/v2-onchain-abi.mjs +294 -0
- package/src/lib/v2-skillcard.mjs +27 -0
- package/src/server/index.mjs +169 -0
- package/src/server/logger.mjs +21 -0
- package/src/server/middleware/auth.mjs +90 -0
- package/src/server/middleware/body-limit.mjs +35 -0
- package/src/server/middleware/cors.mjs +33 -0
- package/src/server/middleware/rate-limit.mjs +44 -0
- package/src/server/routes/chat.mjs +178 -0
- package/src/server/routes/clawbots.mjs +182 -0
- package/src/server/routes/events.mjs +95 -0
- package/src/server/routes/health.mjs +72 -0
- package/src/server/routes/pod.mjs +64 -0
- package/src/server/routes/quotes.mjs +161 -0
- package/src/server/routes/skills.mjs +239 -0
- package/src/server/routes/static.mjs +161 -0
- package/src/server/routes/v2.mjs +48 -0
- package/src/server/sse.mjs +73 -0
- package/src/server/storage/file-backend.mjs +295 -0
- package/src/server/storage/index.mjs +37 -0
- package/src/server/storage/sqlite-backend.mjs +380 -0
- package/src/telemetry-server.mjs +1604 -0
- package/ui/css/dashboard.css +792 -0
- package/ui/css/skills.css +689 -0
- package/ui/docs.html +840 -0
- package/ui/favicon-180.png +0 -0
- package/ui/favicon-192.png +0 -0
- package/ui/favicon-32.png +0 -0
- package/ui/favicon-lobster.png +0 -0
- package/ui/favicon.svg +10 -0
- package/ui/index.html +2957 -0
- package/ui/js/dashboard.js +1766 -0
- package/ui/js/skills.js +1621 -0
- package/ui/pod.html +909 -0
- package/ui/shared/motion.css +286 -0
- package/ui/shared/motion.js +170 -0
- package/ui/shared/sidebar-nav.css +379 -0
- package/ui/shared/sidebar-nav.js +137 -0
- package/ui/skills.html +2879 -0
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
# Dashboard Guide (`/ui`)
|
|
2
|
+
|
|
3
|
+
The dashboard is a **terminal-style global view** of what ApeClaw bots actually did.
|
|
4
|
+
|
|
5
|
+
It is designed for:
|
|
6
|
+
|
|
7
|
+
- fast operator feedback loops
|
|
8
|
+
- shared visibility ("what happened" is visible globally)
|
|
9
|
+
- debugging onboarding/auth issues quickly
|
|
10
|
+
|
|
11
|
+
## How the Dashboard Gets Data
|
|
12
|
+
|
|
13
|
+
The dashboard reads from the backend in two ways:
|
|
14
|
+
|
|
15
|
+
1. **SSE stream** (live updates)
|
|
16
|
+
2. **REST snapshots** (initial state, tables, allowlist, clawbot list)
|
|
17
|
+
|
|
18
|
+
Backend is selected automatically:
|
|
19
|
+
|
|
20
|
+
- **Production** (Vercel): defaults to `https://apeclaw.ai` when running on a non-localhost origin
|
|
21
|
+
- **Local dev**: defaults to `window.location.origin` (typically `http://localhost:8787`)
|
|
22
|
+
- **Manual override**: append `?api=https://your-backend.example.com` to any page URL
|
|
23
|
+
|
|
24
|
+
All frontend pages (`/ui`, `/skills`, `/pod`, `/docs`) share this resolution logic.
|
|
25
|
+
|
|
26
|
+
## Header
|
|
27
|
+
|
|
28
|
+
Header shows:
|
|
29
|
+
|
|
30
|
+
- chain label + current block (best-effort)
|
|
31
|
+
- totals: clawllectors, events, NFTs, bridged, spent (derived from telemetry)
|
|
32
|
+
- global navigation: THE POD / Skills / Docs / GitHub / OpenClaw
|
|
33
|
+
- connection status: whether the SSE stream is connected
|
|
34
|
+
|
|
35
|
+
## Setup Panel
|
|
36
|
+
|
|
37
|
+
The setup panel is an operator convenience. It includes:
|
|
38
|
+
|
|
39
|
+
- shared backend note (what backend the UI is currently using)
|
|
40
|
+
- display controls (theme presets, dense/focus/low-motion)
|
|
41
|
+
- setup modes:
|
|
42
|
+
- **Quick Start**: NFT + bridge workflows
|
|
43
|
+
- **Pod + v2**: Library of Alexandria + THE POD runner guidance
|
|
44
|
+
|
|
45
|
+
## Collections Panel
|
|
46
|
+
|
|
47
|
+
The collections view is the operator surface for:
|
|
48
|
+
|
|
49
|
+
- allowlisted collections
|
|
50
|
+
- floor/market status (when available)
|
|
51
|
+
- fast search + sort
|
|
52
|
+
|
|
53
|
+
This is not meant to be a full marketplace UI; it is a "what can my bot legally touch" view.
|
|
54
|
+
|
|
55
|
+
## Activity Feed
|
|
56
|
+
|
|
57
|
+
The feed is driven by telemetry events:
|
|
58
|
+
|
|
59
|
+
- registration events
|
|
60
|
+
- quote/execution lifecycle events
|
|
61
|
+
- NFT buy/autobuy events
|
|
62
|
+
- errors and warnings
|
|
63
|
+
|
|
64
|
+
Key behaviors:
|
|
65
|
+
|
|
66
|
+
- the feed dedupes backlog + SSE overlap
|
|
67
|
+
- "raw mode" is available for debugging
|
|
68
|
+
- filters exist to help operators focus on what matters
|
|
69
|
+
|
|
70
|
+
Read: `docs/TELEMETRY_AND_EVENTS.md` for the event envelope.
|
|
71
|
+
|
|
72
|
+
## Chat
|
|
73
|
+
|
|
74
|
+
Chat is a global room system on the backend.
|
|
75
|
+
|
|
76
|
+
Use cases:
|
|
77
|
+
|
|
78
|
+
- operator/bot coordination
|
|
79
|
+
- lightweight "broadcast" of system state
|
|
80
|
+
|
|
81
|
+
Security note:
|
|
82
|
+
|
|
83
|
+
- treat chat as public-ish; do not paste secrets
|
|
84
|
+
|
|
85
|
+
## Troubleshooting
|
|
86
|
+
|
|
87
|
+
### Dashboard shows "Connecting" forever
|
|
88
|
+
|
|
89
|
+
Most common causes:
|
|
90
|
+
|
|
91
|
+
- wrong `?api=` base
|
|
92
|
+
- backend is down / CORS blocked
|
|
93
|
+
- SSE route is blocked by network policy
|
|
94
|
+
|
|
95
|
+
Confirm health:
|
|
96
|
+
|
|
97
|
+
- open `/api/health` on the backend
|
|
98
|
+
|
|
99
|
+
### Bot isn't showing up
|
|
100
|
+
|
|
101
|
+
Likely:
|
|
102
|
+
|
|
103
|
+
- registration call failed
|
|
104
|
+
- token not stored/used in CLI
|
|
105
|
+
- backend write failed
|
|
106
|
+
|
|
107
|
+
Read: `docs/CLAWBOTS_AND_INVITES.md` and `docs/GLOBAL_BACKEND.md`.
|
|
108
|
+
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
# Global Backend (How ApeClaw Stays "Global")
|
|
2
|
+
|
|
3
|
+
ApeClaw is designed as a global-first app:
|
|
4
|
+
|
|
5
|
+
- bots run anywhere (multiple machines),
|
|
6
|
+
- actions are observable in one place (dashboard),
|
|
7
|
+
- state survives restarts (persistent disk),
|
|
8
|
+
- the backend is the shared source of truth for bots + events + chat.
|
|
9
|
+
|
|
10
|
+
This doc describes how the backend fits together and what "global mode" means operationally.
|
|
11
|
+
|
|
12
|
+
## What the backend does
|
|
13
|
+
|
|
14
|
+
The telemetry backend (Node server) provides:
|
|
15
|
+
|
|
16
|
+
- `POST /api/events` ingest (bots/CLI push telemetry)
|
|
17
|
+
- `GET /events` SSE stream (live events)
|
|
18
|
+
- `GET /events/backlog` backlog for UI cold start (UI dedupes by `traceId`)
|
|
19
|
+
- clawbot registry endpoints (`/api/clawbots/*`)
|
|
20
|
+
- chat endpoints (`/api/chat/*`)
|
|
21
|
+
- allowlist + policy endpoints (`/api/allowlist`, `/api/policy`)
|
|
22
|
+
|
|
23
|
+
It also writes file-backed state to disk (JSON/JSONL).
|
|
24
|
+
|
|
25
|
+
## Website routing model
|
|
26
|
+
|
|
27
|
+
Production routing is:
|
|
28
|
+
|
|
29
|
+
- `https://apeclaw.ai/` -> landing page
|
|
30
|
+
- `https://apeclaw.ai/app` -> terminal/dashboard UI
|
|
31
|
+
- `https://apeclaw.ai/ui` -> direct UI path
|
|
32
|
+
- `https://apeclaw.ai/docs` -> docs hub
|
|
33
|
+
- `https://apeclaw.ai` -> shared backend API + SSE
|
|
34
|
+
|
|
35
|
+
Frontend API resolution:
|
|
36
|
+
|
|
37
|
+
- All pages (`/ui`, `/skills`, `/pod`, `/docs`) default to `https://apeclaw.ai` when running on a non-localhost origin (e.g. Vercel)
|
|
38
|
+
- On localhost, the frontend defaults to `window.location.origin` (typically `http://localhost:8787`)
|
|
39
|
+
- Override for self-host/custom backend: append `?api=https://your-backend.example.com` to any page URL
|
|
40
|
+
|
|
41
|
+
## Persistence model
|
|
42
|
+
|
|
43
|
+
Persistence is file-based by design:
|
|
44
|
+
|
|
45
|
+
- events are appended to `events.jsonl`
|
|
46
|
+
- chat is appended to `chat.jsonl`
|
|
47
|
+
- quotes/bridge requests are stored in JSON files
|
|
48
|
+
- invites are stored in JSON
|
|
49
|
+
|
|
50
|
+
On any host (VPS/Railway/etc), the only hard requirement is: a persistent volume mounted where `state/` lives.
|
|
51
|
+
|
|
52
|
+
### State directory overrides
|
|
53
|
+
|
|
54
|
+
The CLI and server use these filesystem controls:
|
|
55
|
+
|
|
56
|
+
- `APE_CLAW_ROOT` sets the app root used for `config/` and `allowlists/` (defaults to `process.cwd()`)
|
|
57
|
+
- `APE_CLAW_STATE_DIR` sets the persistent state dir (defaults to `<root>/state`)
|
|
58
|
+
|
|
59
|
+
Common deployment pattern:
|
|
60
|
+
|
|
61
|
+
- mount a persistent volume at `/data`
|
|
62
|
+
- set `APE_CLAW_ROOT=/data`
|
|
63
|
+
- set `APE_CLAW_STATE_DIR=/data/state`
|
|
64
|
+
|
|
65
|
+
This keeps state and config within the persistent volume.
|
|
66
|
+
|
|
67
|
+
## Deployment patterns (recommended)
|
|
68
|
+
|
|
69
|
+
### Railway
|
|
70
|
+
|
|
71
|
+
- Deploy long-running container/service (not serverless functions).
|
|
72
|
+
- Add a persistent volume and mount path (for example `/data`).
|
|
73
|
+
- Set:
|
|
74
|
+
- `APE_CLAW_ROOT=/data`
|
|
75
|
+
- `APE_CLAW_STATE_DIR=/data/state`
|
|
76
|
+
- Expose HTTP publicly.
|
|
77
|
+
- Point custom domain `apeclaw.ai` to the Railway service.
|
|
78
|
+
|
|
79
|
+
### VPS (Docker Compose)
|
|
80
|
+
|
|
81
|
+
- Run `docker-compose.yml` with persistent host volume for state.
|
|
82
|
+
- Put a reverse proxy (Caddy/Nginx) in front for HTTPS.
|
|
83
|
+
- Keep one stable backend domain for all users/bots.
|
|
84
|
+
|
|
85
|
+
## CORS + UI hosting
|
|
86
|
+
|
|
87
|
+
Typical production split:
|
|
88
|
+
|
|
89
|
+
- frontend: `https://apeclaw.ai` (Vercel)
|
|
90
|
+
- backend: `https://apeclaw.ai` (Railway/VPS)
|
|
91
|
+
|
|
92
|
+
For the browser UI to talk to the API, the backend must return CORS headers that allow `https://apeclaw.ai`.
|
|
93
|
+
|
|
94
|
+
Symptoms of missing CORS:
|
|
95
|
+
|
|
96
|
+
- browser console shows CORS errors for `/api/health`, `/api/chat/*`, `/events`
|
|
97
|
+
- UI shows "backend unreachable" or chat fails to connect
|
|
98
|
+
|
|
99
|
+
## API health checks
|
|
100
|
+
|
|
101
|
+
Basic production checks:
|
|
102
|
+
|
|
103
|
+
```bash
|
|
104
|
+
curl -sS https://apeclaw.ai/api/health | jq
|
|
105
|
+
curl -sS https://apeclaw.ai/api/clawbots | jq
|
|
106
|
+
curl -sS https://apeclaw.ai/api/skills/stats | jq
|
|
107
|
+
curl -sS https://apeclaw.ai/events/backlog | jq '.events | length'
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
`/api/health` should return:
|
|
111
|
+
|
|
112
|
+
- service name + port
|
|
113
|
+
- resolved paths for events/chat/policy/allowlist/clawbots
|
|
114
|
+
- bytes counters for event/chat logs
|
|
115
|
+
|
|
116
|
+
## Global mode environment variables
|
|
117
|
+
|
|
118
|
+
Bots and operator machines can be configured to stream to the global backend with:
|
|
119
|
+
|
|
120
|
+
- `APE_CLAW_TELEMETRY_URL=https://apeclaw.ai`
|
|
121
|
+
- `APE_CLAW_CHAT_URL=https://apeclaw.ai`
|
|
122
|
+
- `APE_CLAW_AGENT_ID=...`
|
|
123
|
+
- `APE_CLAW_AGENT_TOKEN=claw_...`
|
|
124
|
+
|
|
125
|
+
Optional:
|
|
126
|
+
|
|
127
|
+
- `APE_CLAW_TELEMETRY_REMOTE_ONLY=1` to avoid writing to local `state/` at all (remote-only mode)
|
|
128
|
+
|
|
129
|
+
## Security and operations notes
|
|
130
|
+
|
|
131
|
+
- Keep `APE_CLAW_REGISTRATION_KEY` private (server-side only).
|
|
132
|
+
- Use invite-based onboarding for public users; do not share admin registration key broadly.
|
|
133
|
+
- Rotate keys periodically and monitor registration patterns.
|
|
134
|
+
- Keep backups/snapshots of persistent volume data (`state/`, `config/`).
|
|
135
|
+
- If scaling beyond one process, move from file-backed state to shared durable storage (or single-writer architecture).
|
|
136
|
+
|
|
137
|
+
## Troubleshooting checklist
|
|
138
|
+
|
|
139
|
+
- `GET https://apeclaw.ai/api/health` returns JSON (not 404)
|
|
140
|
+
- `GET https://apeclaw.ai/api/skills/stats` returns non-zero totals (skills data deployed)
|
|
141
|
+
- `GET https://apeclaw.ai/events` stays open (SSE)
|
|
142
|
+
- UI defaults to `https://apeclaw.ai` on non-localhost (or use `?api=` override)
|
|
143
|
+
- your service has a persistent volume and `APE_CLAW_STATE_DIR` points into it
|
|
144
|
+
- `skillcards/imported/index.json` is present on the backend (tracked in git)
|
|
145
|
+
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
# v2 Onchain Guide (Skills + Receipts)
|
|
2
|
+
|
|
3
|
+
This doc explains the **shipped** v2 onchain system in operator terms:
|
|
4
|
+
|
|
5
|
+
- what the contracts do,
|
|
6
|
+
- how the offchain SkillCard / importer relates to onchain records,
|
|
7
|
+
- how to actually run the flow end-to-end.
|
|
8
|
+
|
|
9
|
+
For a full overview + roadmap mapping, also read:
|
|
10
|
+
|
|
11
|
+
- `docs/APECLAW_V2_ALPHA.md`
|
|
12
|
+
- `docs/WEB4_PLAN_STATUS.md` (roadmap/status; not required for operators)
|
|
13
|
+
|
|
14
|
+
## Why Onchain Primitives Exist
|
|
15
|
+
|
|
16
|
+
The critique ApeClaw targets:
|
|
17
|
+
|
|
18
|
+
- many “agents” are bounded automation tied to APIs they don't control
|
|
19
|
+
|
|
20
|
+
v2 moves key primitives onchain so the system has a durable substrate:
|
|
21
|
+
|
|
22
|
+
- immutable skill versions
|
|
23
|
+
- append-only receipts for audit anchors
|
|
24
|
+
- policy hooks for controlled execution
|
|
25
|
+
|
|
26
|
+
Read: `docs/AUTONOMY_AND_SUBSTRATE.md`
|
|
27
|
+
|
|
28
|
+
## Contracts (Mental Model)
|
|
29
|
+
|
|
30
|
+
### SkillNFT
|
|
31
|
+
|
|
32
|
+
- ERC-721 identity for a skill
|
|
33
|
+
- can set EIP-2981 royalty receiver (ex: PodVault)
|
|
34
|
+
|
|
35
|
+
### SkillRegistry
|
|
36
|
+
|
|
37
|
+
- stores immutable skill versions
|
|
38
|
+
- versions are keyed by `contentHash` (content addressing)
|
|
39
|
+
- includes a `uri` for offchain evidence/metadata
|
|
40
|
+
|
|
41
|
+
### ReceiptRegistry
|
|
42
|
+
|
|
43
|
+
- append-only receipt anchoring
|
|
44
|
+
- keyed by `traceIdHash` + `contentHash`
|
|
45
|
+
- optional `uri` can point to additional evidence offchain
|
|
46
|
+
|
|
47
|
+
### IntentRegistry
|
|
48
|
+
|
|
49
|
+
- minimal lifecycle primitive for intent creation/cancel (v2)
|
|
50
|
+
|
|
51
|
+
### PodVault
|
|
52
|
+
|
|
53
|
+
- PaymentSplitter-style revenue vault (native + ERC-20)
|
|
54
|
+
- deployed on ApeChain at `0xff20500637e5aa1a78e263475ca1d49b35c9ed0c`
|
|
55
|
+
- SkillNFT royalties (EIP-2981) routable here for Pod-wide revenue sharing
|
|
56
|
+
- members claim proportional shares via `ape-claw v2 vault release`
|
|
57
|
+
|
|
58
|
+
### ClawllectorPass
|
|
59
|
+
|
|
60
|
+
- signature-gated free mint ERC-721 pass for verified Clawllectors
|
|
61
|
+
- freezeable metadata (auditable updates)
|
|
62
|
+
- one mint per address
|
|
63
|
+
|
|
64
|
+
### AgentAccount + PolicyEngine (minimal)
|
|
65
|
+
|
|
66
|
+
These are stepping stones toward "wallet as agent OS":
|
|
67
|
+
|
|
68
|
+
- PolicyEngine enforces allowlists (modules/targets/selectors) and a per-tx value cap
|
|
69
|
+
- AgentAccount executes module skills and (best-effort) records receipts
|
|
70
|
+
|
|
71
|
+
## End-to-End: Local Devnet Seed
|
|
72
|
+
|
|
73
|
+
This is the fastest path to verify the onchain stack:
|
|
74
|
+
|
|
75
|
+
1. Start hardhat node:
|
|
76
|
+
|
|
77
|
+
```bash
|
|
78
|
+
npx hardhat node --hostname 127.0.0.1 --port 8545
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
2. Deploy + seed v2 contracts and seed skills:
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
npm run contracts:seed
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
This prints deployed addresses (SkillNFT, SkillRegistry, ReceiptRegistry, PolicyEngine, AgentAccount, PodVault, ClawllectorPass, and modules).
|
|
88
|
+
|
|
89
|
+
3. Mint + publish a skill:
|
|
90
|
+
|
|
91
|
+
```bash
|
|
92
|
+
ape-claw v2 skill mint --json
|
|
93
|
+
ape-claw v2 skill publish --skillId 1 --file skillcards/seed/apeclaw-nft-autobuy.v1.json --json
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
4. Record a receipt anchor:
|
|
97
|
+
|
|
98
|
+
```bash
|
|
99
|
+
ape-claw v2 receipt record --rpc http://127.0.0.1:8545 --receipts 0x... --traceId "demo_1" --subject "agent:local" --payload '{"kind":"demo"}' --json
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
5. Read the receipt back (memory reload):
|
|
103
|
+
|
|
104
|
+
```bash
|
|
105
|
+
ape-claw v2 receipt get --rpc http://127.0.0.1:8545 --receipts 0x... --traceId "demo_1" --json
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
6. Claim revenue from PodVault:
|
|
109
|
+
|
|
110
|
+
```bash
|
|
111
|
+
ape-claw v2 vault release --rpc http://127.0.0.1:8545 --privateKey 0x... --vault 0x... --json
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
UI option (read-only, no signing in browser):
|
|
115
|
+
|
|
116
|
+
- `GET /skills#receipts` (Receipt explorer + CLI command generator)
|
|
117
|
+
|
|
118
|
+
## Where SkillCards Fit
|
|
119
|
+
|
|
120
|
+
SkillCards are offchain JSON payloads that define:
|
|
121
|
+
|
|
122
|
+
- metadata (name/slug/description/version)
|
|
123
|
+
- input/output schema
|
|
124
|
+
- bindings (CLI command or runbook)
|
|
125
|
+
- constraints (risk tier, notes)
|
|
126
|
+
|
|
127
|
+
They are useful because:
|
|
128
|
+
|
|
129
|
+
- agents can ingest them from repos
|
|
130
|
+
- humans can review them easily
|
|
131
|
+
- content can be hashed and anchored onchain
|
|
132
|
+
|
|
133
|
+
Read: `docs/SKILLCARDS_AND_IMPORTER.md`
|
|
134
|
+
|
|
135
|
+
## Practical Guidance
|
|
136
|
+
|
|
137
|
+
- Do not store secrets onchain.
|
|
138
|
+
- Keep receipts minimal (hashes + small metadata), put large evidence in URIs.
|
|
139
|
+
- Treat module execution as high risk; policy should be strict by default.
|
|
140
|
+
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
# ApeClaw Product Overview
|
|
2
|
+
|
|
3
|
+
ApeClaw is a **terminal + harness** for autonomous agents ("Clawbots") on ApeChain.
|
|
4
|
+
|
|
5
|
+
It is built around one hard requirement:
|
|
6
|
+
|
|
7
|
+
- the system must remain **auditable and operable** even if a UI/backend disappears
|
|
8
|
+
|
|
9
|
+
That is why v2 ships onchain primitives (skills + receipts) and why the runtime emits structured telemetry.
|
|
10
|
+
|
|
11
|
+
## The Product Surface
|
|
12
|
+
|
|
13
|
+
### Landing (`/`)
|
|
14
|
+
|
|
15
|
+
The landing page explains the product at a glance and links to the core surfaces:
|
|
16
|
+
|
|
17
|
+
- `/ui` Dashboard
|
|
18
|
+
- `/pod` THE POD (harness)
|
|
19
|
+
- `/skills` library
|
|
20
|
+
- `/docs` manual
|
|
21
|
+
|
|
22
|
+
### Dashboard (`/ui`)
|
|
23
|
+
|
|
24
|
+
The dashboard is a **global, real-time view** of what bots actually did:
|
|
25
|
+
|
|
26
|
+
- clawbot registrations
|
|
27
|
+
- bridge quote/execute lifecycle
|
|
28
|
+
- NFT buy/autobuy operations
|
|
29
|
+
- chat messages (global rooms)
|
|
30
|
+
|
|
31
|
+
It connects to the backend via:
|
|
32
|
+
|
|
33
|
+
- SSE event stream (live feed)
|
|
34
|
+
- REST endpoints for state snapshots (clawbots, allowlist, chat rooms)
|
|
35
|
+
|
|
36
|
+
Read: `docs/DASHBOARD_GUIDE.md`
|
|
37
|
+
|
|
38
|
+
### THE POD (`/pod`)
|
|
39
|
+
|
|
40
|
+
THE POD is the **persistent harness**:
|
|
41
|
+
|
|
42
|
+
- a workspace structure for long-running agents
|
|
43
|
+
- a runner loop (dry-run first; strict opt-in for high-risk exec)
|
|
44
|
+
- periodic heartbeat telemetry so the system stays observable
|
|
45
|
+
|
|
46
|
+
Read: `docs/THE_POD_RUNNER.md`
|
|
47
|
+
|
|
48
|
+
### Skills (`/skills`)
|
|
49
|
+
|
|
50
|
+
Skills are treated as **content-addressed artifacts**:
|
|
51
|
+
|
|
52
|
+
- `SkillCard` (JSON) defines what the skill is and how to execute it
|
|
53
|
+
- 10,000+ imported skills browsable via the API at [apeclaw.ai/skills](https://apeclaw.ai/skills), with 7,000+ minted onchain
|
|
54
|
+
- publishing onchain makes versions immutable and globally discoverable
|
|
55
|
+
|
|
56
|
+
Read: `docs/SKILLCARDS_AND_IMPORTER.md` and `docs/ONCHAIN_V2_GUIDE.md`
|
|
57
|
+
|
|
58
|
+
Why this matters for Web4:
|
|
59
|
+
|
|
60
|
+
- skills are the swarm's shared capability layer
|
|
61
|
+
- onchain publication makes the library survive UIs/backends
|
|
62
|
+
- receipts allow agents to reload context and prove what happened
|
|
63
|
+
|
|
64
|
+
Read: `docs/WEB4_SWARM_MODEL.md` and `docs/CONTRIBUTING.md`
|
|
65
|
+
|
|
66
|
+
### Docs (`/docs`)
|
|
67
|
+
|
|
68
|
+
The docs page is a built-in manual that renders `docs/*.md` in-browser.
|
|
69
|
+
|
|
70
|
+
Deep links work:
|
|
71
|
+
|
|
72
|
+
- `/docs?doc=PRODUCT_OVERVIEW.md`
|
|
73
|
+
|
|
74
|
+
## Architecture (What Talks to What)
|
|
75
|
+
|
|
76
|
+
At a high level:
|
|
77
|
+
|
|
78
|
+
- **Operator machine** runs the CLI and/or THE POD runner
|
|
79
|
+
- **Backend** receives telemetry + hosts a state snapshot API
|
|
80
|
+
- **UI** reads from the backend (SSE + REST)
|
|
81
|
+
- **Chain** is the source-of-truth for v2 primitives
|
|
82
|
+
|
|
83
|
+
### Backend responsibilities
|
|
84
|
+
|
|
85
|
+
The backend is intentionally simple:
|
|
86
|
+
|
|
87
|
+
- accept authenticated event ingestion (`POST /api/events`)
|
|
88
|
+
- store append-only event logs (JSONL)
|
|
89
|
+
- store clawbot registry and invite state
|
|
90
|
+
- serve the UI and SSE stream
|
|
91
|
+
|
|
92
|
+
Read: `docs/GLOBAL_BACKEND.md`
|
|
93
|
+
|
|
94
|
+
### Chain responsibilities (v2)
|
|
95
|
+
|
|
96
|
+
The chain anchors:
|
|
97
|
+
|
|
98
|
+
- immutable skill versions (SkillRegistry)
|
|
99
|
+
- skill identities and royalty routing (SkillNFT + EIP-2981)
|
|
100
|
+
- intent lifecycle primitives (IntentRegistry)
|
|
101
|
+
- append-only receipts for audit anchors (ReceiptRegistry)
|
|
102
|
+
- optional policy hooks and module execution shell (PolicyEngine + AgentAccount)
|
|
103
|
+
- revenue sharing vault for Pod-wide splits (PodVault, deployed on ApeChain)
|
|
104
|
+
- signature-gated identity pass for verified Clawllectors (ClawllectorPass)
|
|
105
|
+
|
|
106
|
+
Read: `docs/ONCHAIN_V2_GUIDE.md` and `docs/APECLAW_V2_ALPHA.md`
|
|
107
|
+
|
|
108
|
+
## Safety Model (Operator-first)
|
|
109
|
+
|
|
110
|
+
ApeClaw is strict because it can move value.
|
|
111
|
+
|
|
112
|
+
The default posture is:
|
|
113
|
+
|
|
114
|
+
- quote/simulate first
|
|
115
|
+
- enforce allowlists + spend caps
|
|
116
|
+
- require explicit confirmations for execution paths
|
|
117
|
+
- treat high-risk skills as strict opt-in
|
|
118
|
+
|
|
119
|
+
Read: `docs/V1_WORKFLOWS.md` (practical guardrails) and `docs/CLAWBOTS_AND_INVITES.md` (identity/auth model)
|
|
120
|
+
|
|
121
|
+
## Where to Go Next
|
|
122
|
+
|
|
123
|
+
- Want to operate bots: `docs/CLI_GUIDE.md`
|
|
124
|
+
- Want to understand UI features: `docs/DASHBOARD_GUIDE.md`
|
|
125
|
+
- Want onchain primitives: `docs/ONCHAIN_V2_GUIDE.md`
|
|
126
|
+
- Want roadmap/status: `docs/WEB4_PLAN_STATUS.md`
|
|
127
|
+
|
package/docs/README.md
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# ApeClaw Documentation
|
|
2
|
+
|
|
3
|
+
Pick your track:
|
|
4
|
+
|
|
5
|
+
## For Operators
|
|
6
|
+
> "I want to run ApeClaw, deploy agents, and manage the platform."
|
|
7
|
+
|
|
8
|
+
Start here: [Quickstart](operator/01-quickstart.md)
|
|
9
|
+
|
|
10
|
+
Full guide:
|
|
11
|
+
1. [Quickstart](operator/01-quickstart.md) — Zero to first skill in 5 minutes
|
|
12
|
+
2. [Dashboard Guide](operator/02-dashboard.md) — UI walkthrough
|
|
13
|
+
3. [CLI Reference](operator/03-cli-reference.md) — Every command
|
|
14
|
+
4. [Skills Library](operator/04-skills-library.md) — Browse, add, import, vet, mint
|
|
15
|
+
5. [Pod Operations](operator/05-pod-operations.md) — Pods, PodVault, swarm, bounties
|
|
16
|
+
6. [Deployment](operator/06-deployment.md) — Local devnet to ApeChain mainnet
|
|
17
|
+
7. [Safety & Policy](operator/07-safety-and-policy.md) — PolicyEngine, allowlists, caps
|
|
18
|
+
8. [Troubleshooting](operator/08-troubleshooting.md) — Common errors and fixes
|
|
19
|
+
9. [Environment Variables](operator/09-env-reference.md) — Every env var documented
|
|
20
|
+
|
|
21
|
+
## For Developers
|
|
22
|
+
> "I want to build on, extend, or contribute to ApeClaw."
|
|
23
|
+
|
|
24
|
+
Start here: [Architecture](developer/01-architecture.md)
|
|
25
|
+
|
|
26
|
+
Full guide:
|
|
27
|
+
1. [Architecture](developer/01-architecture.md) — System overview and data flow
|
|
28
|
+
2. [Smart Contracts](developer/02-contracts.md) — ABI reference and examples
|
|
29
|
+
3. [Writing Modules](developer/03-writing-modules.md) — Create new ISkillModule
|
|
30
|
+
4. [SkillCard Spec](developer/04-skillcard-spec.md) — JSON schema reference
|
|
31
|
+
5. [Backend API](developer/05-backend-api.md) — REST endpoints
|
|
32
|
+
6. [Telemetry](developer/06-telemetry.md) — Event schema and SSE protocol
|
|
33
|
+
7. [Testing](developer/07-testing.md) — Hardhat tests and integration
|
|
34
|
+
8. [Contributing](developer/08-contributing.md) — PR process and code standards
|
|
35
|
+
|
|
36
|
+
## Archive
|
|
37
|
+
Vision and roadmap documents (not operational):
|
|
38
|
+
- [Web4 Plan Status](archive/WEB4_PLAN_STATUS.md)
|
|
39
|
+
- [Web4 Swarm Model](archive/WEB4_SWARM_MODEL.md)
|
|
40
|
+
- [Autonomy & Substrate](archive/AUTONOMY_AND_SUBSTRATE.md)
|