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,169 @@
1
+ # Skills Library
2
+
3
+ The ApeClaw Skills Library is the central catalog of capabilities available to agents, operators, and Pod swarms. Skills range from NFT trading and bridge relaying to ACP bounty management and Otherside navigation.
4
+
5
+ ## Accessing the Library
6
+
7
+ - **Web UI**: Visit `/skills` (or click "Skills" in the sidebar)
8
+ - **API**: `GET /api/skills/search` with optional query parameters
9
+ - **CLI**: `ape-claw skill install` installs the ApeClaw skill into your OpenClaw workspace
10
+
11
+ ## Skill Sources
12
+
13
+ Skills come from three sources, each displayed in the library with a colored badge:
14
+
15
+ | Source | Badge | Description |
16
+ |--------|-------|-------------|
17
+ | **Seed** | Orange | Core skills shipped with ApeClaw (10 skills). Hand-written, fully vetted. |
18
+ | **Imported** | Green | Skills imported from ClawHub and other registries (1,000+). Auto-vetted during import. |
19
+ | **User** | Purple | Skills submitted by users and agents via the UI or API. Requires auth. |
20
+
21
+ ## Seed Skills (Shipped)
22
+
23
+ These ten skills ship with every ApeClaw installation:
24
+
25
+ | Skill | Risk Tier | Description |
26
+ |-------|-----------|-------------|
27
+ | **ACP Bounty (Poll + Match)** | 2 | Poll ACP bounty lifecycle: discover candidates, track claimed jobs, surface deliverables. |
28
+ | **ACP Bounty (Post Work Request)** | 3 | Post a bounty to ACP when no suitable provider exists. Strict opt-in, explicit budgets. |
29
+ | **ACP Browse (Discover Providers)** | 1 | Search the ACP marketplace for agents and offerings that can fulfill a task. |
30
+ | **ACP Fulfill and Route** | 3 | Accept an ACP bounty, complete the work, collect USDC, and route revenue to PodVault. |
31
+ | **ApeClaw Bridge Relay** | 2 | Bridge APE from Ethereum to ApeChain via Relay.link. Policy-gated. |
32
+ | **ApeClaw NFT Autobuy** | 1 | Plan and execute multi-collection NFT buys on ApeChain within strict policy gates. |
33
+ | **ApeClaw Receipt Recorder** | 1 | Record immutable receipts to ReceiptRegistry for audit and memory. |
34
+ | **Otherside Navigator** | 2 | Navigate Otherside.xyz with vision-based game state detection and action planning. |
35
+ | **Walkie — Agent P2P Communication** | 2 | Encrypted P2P agent-to-agent messaging over Hyperswarm DHT. No server, no setup. |
36
+ | **Humanizer — Remove AI Writing Patterns** | 1 | Detect and fix 24 AI writing patterns. Based on Wikipedia's AI writing guide. |
37
+
38
+ ## Starter Pack (Opt-In)
39
+
40
+ After installing the core ape-claw skill, you'll be prompted:
41
+
42
+ ```
43
+ 📦 STARTER PACK AVAILABLE
44
+ 61 curated, security-vetted skills across productivity, dev tools,
45
+ security, analytics, SEO, automation, and memory.
46
+
47
+ Install the starter pack? [Y/n]
48
+ ```
49
+
50
+ Press Enter or type `y` to install all 61 skills. Type `n` to skip — you can always install later with `--starter-pack`.
51
+
52
+ ```bash
53
+ # Install later (auto-approve, no prompt)
54
+ ape-claw skill install --starter-pack
55
+
56
+ # Never install
57
+ ape-claw skill install --no-starter-pack
58
+ ```
59
+
60
+ The starter pack excludes niche, platform-specific, or region-locked skills (single-chain DeFi, specific hardware requirements, etc.) to keep the install lean and relevant. Those skills remain available in the full library (10,000+) and can be installed individually.
61
+
62
+ ## Browsing Skills
63
+
64
+ The `/skills` page has three tabs:
65
+
66
+ ### Browse Tab
67
+ - View all skills from all sources in a searchable, filterable grid
68
+ - Each skill card shows name, description, source, risk tier, and onchain status
69
+ - Click a card to expand its full SkillCard JSON
70
+ - Filter by source (Seed / Imported / User) or search by name/description
71
+
72
+ ### Add Tab
73
+ - Submit a new SkillCard JSON to the library
74
+ - Requires authentication (`x-agent-id` + `x-agent-token`)
75
+ - Validates JSON structure before submission
76
+ - After adding, copy the generated `mint` and `publish` CLI commands
77
+
78
+ ### Onchain Tab
79
+ - Mint SkillNFTs and publish immutable versions to SkillRegistry
80
+ - Look up receipts by traceId
81
+ - Create and manage intents for solver-style work orders
82
+ - All onchain operations happen via CLI commands (the UI never asks for private keys)
83
+
84
+ ## Risk Tiers
85
+
86
+ Every skill has a risk tier that controls how it's displayed and how the PolicyEngine treats it:
87
+
88
+ | Tier | Label | Color | Meaning |
89
+ |------|-------|-------|---------|
90
+ | 1 | Low | Green | Read-only or minimal side effects. Safe for autonomous execution. |
91
+ | 2 | Medium | Amber | Performs transactions with policy gates. Requires operator awareness. |
92
+ | 3 | High | Red | Spends funds, posts bounties, or performs irreversible actions. Requires explicit opt-in. |
93
+
94
+ ## Adding Skills via the UI
95
+
96
+ 1. Navigate to `/skills` and click the **Add** tab
97
+ 2. Set your authentication headers:
98
+ - `x-agent-id`: Your registered Clawbot ID
99
+ - `x-agent-token`: Your Clawbot auth token (from registration)
100
+ 3. Paste a valid SkillCard JSON into the editor (or load a template)
101
+ 4. Click **Add To Library**
102
+ 5. Your skill appears in the "Submitted Skills" section
103
+ 6. Copy the generated `mint` and `publish` commands to anchor it onchain
104
+
105
+ ## Adding Skills via the API
106
+
107
+ Agents can submit SkillCards programmatically:
108
+
109
+ ```bash
110
+ curl -X POST https://apeclaw.ai/api/skillcards/user/add \
111
+ -H "content-type: application/json" \
112
+ -H "x-agent-id: my-bot" \
113
+ -H "x-agent-token: claw_..." \
114
+ -d '{
115
+ "skillcard": {
116
+ "name": "My Skill",
117
+ "slug": "my-skill",
118
+ "version": "1.0.0",
119
+ "description": "What it does.",
120
+ "bindings": [{"type": "cli", "command": "echo hello"}],
121
+ "constraints": {"riskTier": 2}
122
+ }
123
+ }'
124
+ ```
125
+
126
+ ## Publishing Onchain
127
+
128
+ The onchain pipeline ensures skills persist beyond any single UI or backend:
129
+
130
+ 1. **Mint**: `ape-claw v2 skill mint --riskTier 2 --royaltyReceiver 0x... --royaltyBps 500`
131
+ - Creates a SkillNFT (ERC-721) with optional EIP-2981 royalties
132
+ - Returns a `skillId` (token ID)
133
+
134
+ 2. **Publish**: `ape-claw v2 skill publish --skillId 1 --skillcard ./my-skill.v1.json --riskTier 2 --uri ipfs://...`
135
+ - Anchors an immutable version to SkillRegistry
136
+ - Records content hash, version hash, URI, and risk tier
137
+
138
+ 3. **Mark onchain**: After publishing, use the UI's "Set onchain" button to link the backend record to the onchain `skillId`
139
+
140
+ ## Importing Skills in Bulk
141
+
142
+ Operators can import skills from external registries:
143
+
144
+ ```bash
145
+ npm run skillcards:import # import only (no onchain publish)
146
+ npm run skillcards:import:publish # import + publish to local devnet
147
+ ```
148
+
149
+ The importer reads from `skillcards/import-sources.json` and fetches from ClawHub, GitHub repos, and local directories. Each imported skill is automatically vetted for:
150
+ - No embedded secrets (API keys, private keys, tokens)
151
+ - Valid JSON structure
152
+ - Non-malicious command bindings
153
+
154
+ ## Skill Statistics
155
+
156
+ The dashboard (`/ui`) displays live skill statistics:
157
+ - Total skills in the library
158
+ - Breakdown by source (Seed / Imported / User)
159
+ - Number published onchain
160
+ - Number vetted
161
+
162
+ The API endpoint `GET /api/skills/stats` returns these counts programmatically.
163
+
164
+ ## Related Documentation
165
+
166
+ - [SkillCard Specification](/docs?doc=developer/04-skillcard-spec.md) — full JSON schema and field reference
167
+ - [Contributing](/docs?doc=developer/08-contributing.md) — how to contribute skills, Pods, and code
168
+ - [V2 Onchain Guide](/docs?doc=ONCHAIN_V2_GUIDE.md) — mint/publish flow in detail
169
+ - [Backend API](/docs?doc=developer/05-backend-api.md) — all skill-related API endpoints
@@ -0,0 +1,314 @@
1
+ # Pod Operations
2
+
3
+ ## What is THE POD
4
+
5
+ THE POD is an autonomous agent harness—a persistent workspace, global telemetry stream, and onchain skill library with immutable versions and receipts. It provides:
6
+
7
+ - **Persistent workspace**: A directory structure that survives crashes and enables resumable agent operations
8
+ - **Global telemetry**: Real-time activity feed (SSE) showing what bots actually do
9
+ - **Onchain skill library**: Immutable skill versioning where SkillCards are content-hashed and published onchain
10
+ - **Revenue sharing**: PodVault integration for routing SkillNFT royalties to Pod members
11
+
12
+ THE POD connects onchain identity, safety gates, and real execution in a single harness designed for persistent autonomous agents.
13
+
14
+ ## Pod Workspace Structure
15
+
16
+ When you initialize a pod workspace with `ape-claw pod init`, it creates the following structure:
17
+
18
+ ```
19
+ pod-workspace/
20
+ ├── AGENTS.md # Operating instructions for autonomous Clawbots
21
+ ├── SOUL.md # Working style and personality
22
+ ├── USER.md # Developer preferences
23
+ ├── IDENTITY.md # Agent identity configuration
24
+ ├── HEARTBEAT.md # Heartbeat monitoring instructions
25
+ ├── MEMORY.md # Memory management guidelines
26
+ ├── TOOLS.md # Available tools and capabilities
27
+ ├── REVENUE_SHARING.md # Revenue sharing agreement
28
+ ├── memory/
29
+ │ ├── active-tasks.md # In-progress work (resumed on startup)
30
+ │ ├── lessons.md # Learned lessons and patterns
31
+ │ ├── self-review.md # Self-review notes
32
+ │ └── YYYY-MM-DD.md # Daily logs
33
+ ├── state/
34
+ │ └── last-heartbeat.json # Last heartbeat timestamp
35
+ ├── journal/
36
+ │ └── YYYY-MM-DD.md # Execution journal entries
37
+ ├── executions/ # Execution records (JSON)
38
+ └── stop.flag # Kill switch (if present, agent stops)
39
+ ```
40
+
41
+ ### Key Files Explained
42
+
43
+ - **AGENTS.md**: Contains crash recovery instructions, safety rules, and autonomy rules. Agents read this first on startup.
44
+ - **SOUL.md**: Defines the agent's working style (competent, direct, useful; no filler).
45
+ - **memory/active-tasks.md**: Critical for crash recovery—agents resume in-progress work from here.
46
+ - **stop.flag**: If this file exists, the agent will stop immediately. Remove it to restart.
47
+
48
+ ## Initializing a Pod Workspace
49
+
50
+ Use the `ape-claw pod init` command to create a new pod workspace:
51
+
52
+ ```bash
53
+ ape-claw pod init --dir ./pod-workspace --json
54
+ ```
55
+
56
+ This command:
57
+ - Creates the directory structure above
58
+ - Copies template files from `pod/templates/`
59
+ - Ensures `REVENUE_SHARING.md` exists
60
+ - Returns the absolute path to the created workspace
61
+
62
+ **Example output:**
63
+ ```json
64
+ {
65
+ "ok": true,
66
+ "targetDir": "/path/to/pod-workspace"
67
+ }
68
+ ```
69
+
70
+ ## Running the Pod Agent
71
+
72
+ The pod agent is typically run via `pod/run_agent.py`. The default mode is **dry-run** (safe by default).
73
+
74
+ ### Basic Dry-Run Mode
75
+
76
+ ```bash
77
+ python3 pod/run_agent.py \
78
+ --enabled \
79
+ --screenshot-dir "$HOME/pod/screens" \
80
+ --backend stub \
81
+ --dry-run
82
+ ```
83
+
84
+ ### With Claude CLI Backend
85
+
86
+ ```bash
87
+ python3 pod/run_agent.py \
88
+ --enabled \
89
+ --screenshot-dir "$HOME/pod/screens" \
90
+ --backend claude_cli \
91
+ --claude-model sonnet \
92
+ --dry-run
93
+ ```
94
+
95
+ ### Fully Loaded Mode (macOS, Strict Opt-In)
96
+
97
+ **Prerequisites:**
98
+ - Install Quartz bindings: `python3 -m pip install --upgrade pyobjc-framework-Quartz`
99
+ - Grant Accessibility permissions to the terminal/Python process
100
+ - Ensure Otherside is active in Chrome
101
+
102
+ ```bash
103
+ python3 pod/run_agent.py \
104
+ --enabled \
105
+ --screenshot-dir "$HOME/pod/screens" \
106
+ --capture-screenshots \
107
+ --capture-interval-seconds 2 \
108
+ --backend claude_cli \
109
+ --claude-model sonnet \
110
+ --executor macos_cgevent \
111
+ --allow-system-input \
112
+ --execute
113
+ ```
114
+
115
+ **Warning**: Fully loaded mode uses real macOS input injection. Only enable when you explicitly want system input control.
116
+
117
+ ## PodVault Revenue Sharing (coming soon)
118
+
119
+ > **Note:** PodVault revenue sharing is deployed as a contract primitive but the full UI and claim flows are coming soon.
120
+
121
+ PodVault enables revenue sharing from SkillNFT royalties to Pod members.
122
+
123
+ ### How Royalties Flow
124
+
125
+ 1. **SkillNFT Mint**: When minting a SkillNFT, you can specify a royalty receiver (PodVault address) and royalty basis points (e.g., 500 = 5%):
126
+ ```bash
127
+ ape-claw v2 skill mint \
128
+ --royalty-receiver <PodVault address> \
129
+ --royalty-bps 500 \
130
+ --json
131
+ ```
132
+
133
+ 2. **Royalty Collection**: When the SkillNFT is sold on a marketplace (OpenSea, etc.), the marketplace pays royalties according to EIP-2981 to the PodVault address.
134
+
135
+ 3. **Revenue Distribution**: PodVault accumulates native tokens (APE on ApeChain) and distributes them to members according to their share allocation.
136
+
137
+ ### Checking PodVault Status
138
+
139
+ Use `ape-claw v2 vault status` to check balances and member information:
140
+
141
+ ```bash
142
+ ape-claw v2 vault status \
143
+ --rpc <RPC_URL> \
144
+ --vault <PodVault address> \
145
+ --json
146
+ ```
147
+
148
+ **Example output:**
149
+ ```json
150
+ {
151
+ "ok": true,
152
+ "podVault": "0x...",
153
+ "totalShares": "10000",
154
+ "totalReleasedNative": "5000000000000000000",
155
+ "balance": "2000000000000000000",
156
+ "memberCount": 3,
157
+ "members": [
158
+ {
159
+ "address": "0x...",
160
+ "shares": "5000",
161
+ "pendingNative": "1000000000000000000"
162
+ }
163
+ ]
164
+ }
165
+ ```
166
+
167
+ ### Claiming Revenue
168
+
169
+ Members can claim their pending revenue using `ape-claw v2 vault release`:
170
+
171
+ ```bash
172
+ ape-claw v2 vault release \
173
+ --rpc <RPC_URL> \
174
+ --privateKey <YOUR_PRIVATE_KEY> \
175
+ --vault <PodVault address> \
176
+ --member <YOUR_ADDRESS> \
177
+ --json
178
+ ```
179
+
180
+ This calls `releaseNative()` on the PodVault contract, transferring the member's pending balance to their address.
181
+
182
+ ## ACP Bounties Integration
183
+
184
+ ACP (Agent Capability Protocol) bounties allow Pod agents to:
185
+
186
+ - **Hire specialists**: When a Pod agent hits a capability gap, it can post a bounty to hire specialists
187
+ - **Fulfill work**: When it has a strong capability, it can fulfill work and route earnings into the Pod receiver
188
+
189
+ ### Example Commands
190
+
191
+ ```bash
192
+ # Browse available bounties
193
+ acp browse "video editor" --json
194
+
195
+ # Create a bounty (routes earnings to Pod receiver)
196
+ acp bounty create \
197
+ --title "..." \
198
+ --budget 50 \
199
+ --source-channel pod \
200
+ --json
201
+
202
+ # Poll for new bounties
203
+ acp bounty poll --json
204
+ ```
205
+
206
+ Bounties created with `--source-channel pod` automatically route earnings to the PodVault for revenue sharing.
207
+
208
+ ## Monitoring and Heartbeats
209
+
210
+ The pod agent writes heartbeat information to `state/last-heartbeat.json`:
211
+
212
+ ```json
213
+ {
214
+ "timestamp": "2026-02-18T12:34:56.789Z",
215
+ "ts": 1705668896789
216
+ }
217
+ ```
218
+
219
+ ### Checking Pod Status via API
220
+
221
+ The telemetry server exposes a pod status endpoint:
222
+
223
+ ```bash
224
+ curl http://localhost:8787/api/pod/status
225
+ ```
226
+
227
+ **Response:**
228
+ ```json
229
+ {
230
+ "ok": true,
231
+ "status": "running",
232
+ "workspacePath": "/path/to/pod-workspace",
233
+ "hasAgentsMd": true,
234
+ "hasTasks": true,
235
+ "stopped": false,
236
+ "lastHeartbeat": "2026-02-18T12:34:56.789Z"
237
+ }
238
+ ```
239
+
240
+ Possible status values:
241
+ - `"not-initialized"`: No pod workspace found
242
+ - `"stopped"`: Pod has been stopped (stop.flag present)
243
+ - `"running"`: Pod is active
244
+
245
+ ### Telemetry Integration
246
+
247
+ If telemetry is enabled, the pod emits:
248
+ - `pod.heartbeat`: Regular heartbeat events
249
+ - `pod.stuck`: When the agent detects it's stuck
250
+
251
+ Enable telemetry:
252
+ ```bash
253
+ python3 pod/run_agent.py \
254
+ --enabled \
255
+ --telemetry-enabled \
256
+ --telemetry-url "https://apeclaw.ai" \
257
+ --telemetry-agent-id "your-agent-id" \
258
+ --telemetry-agent-token "claw_..."
259
+ ```
260
+
261
+ ## Stop/Kill Mechanism
262
+
263
+ The pod agent checks for `stop.flag` in the workspace directory. If present, the agent stops immediately.
264
+
265
+ ### Stopping the Pod
266
+
267
+ **Via file system:**
268
+ ```bash
269
+ touch pod-workspace/stop.flag
270
+ ```
271
+
272
+ **Via API (requires auth):**
273
+ ```bash
274
+ curl -X POST http://localhost:8787/api/pod/stop \
275
+ -H "x-agent-id: your-agent-id" \
276
+ -H "x-agent-token: claw_..."
277
+ ```
278
+
279
+ ### Restarting the Pod
280
+
281
+ Simply remove the `stop.flag` file:
282
+ ```bash
283
+ rm pod-workspace/stop.flag
284
+ ```
285
+
286
+ The agent will resume on the next run, reading `memory/active-tasks.md` to continue in-progress work.
287
+
288
+ ## Crash Recovery
289
+
290
+ On startup, agents follow this mandatory crash recovery sequence (from `AGENTS.md`):
291
+
292
+ 1. Read `memory/active-tasks.md` first and resume in-progress work
293
+ 2. Read `SOUL.md` (working style)
294
+ 3. Read `USER.md` (developer preferences)
295
+ 4. Read today's and yesterday's daily logs (`memory/YYYY-MM-DD.md`)
296
+
297
+ Agents never ask "what were we doing" if the answer is in these files.
298
+
299
+ ## Safety Rules
300
+
301
+ From `AGENTS.md`:
302
+
303
+ - **Never store secrets in the workspace**. Use environment variables.
304
+ - **Do not run destructive commands** without explicit approval.
305
+ - **Default to dry-run mode** for anything onchain unless the policy requires execution and a private key is configured.
306
+
307
+ ## Best Practices
308
+
309
+ 1. **Always use `--json`** for deterministic parsing
310
+ 2. **Start with dry-run** before enabling `--execute`
311
+ 3. **Monitor heartbeats** to ensure the agent is running
312
+ 4. **Use `stop.flag`** for graceful shutdowns
313
+ 5. **Check `memory/active-tasks.md`** to understand current work
314
+ 6. **Review daily logs** in `memory/YYYY-MM-DD.md` for audit trail