@oyasmi/pipiclaw 0.9.5 → 0.9.6-beta.2

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 (345) hide show
  1. package/README.en.md +300 -142
  2. package/README.md +295 -140
  3. package/dist/agent/builtin-commands.d.ts +1 -1
  4. package/dist/agent/builtin-commands.js +1 -1
  5. package/dist/agent/channel-runner.d.ts +4 -3
  6. package/dist/agent/channel-runner.js +17 -28
  7. package/dist/agent/maintenance-context.js +2 -2
  8. package/dist/agent/prompt/builder.d.ts +1 -1
  9. package/dist/agent/prompt/builder.js +1 -1
  10. package/dist/agent/prompt/extension.d.ts +1 -1
  11. package/dist/agent/prompt/extension.js +1 -1
  12. package/dist/agent/prompt/manifest.d.ts +6 -1
  13. package/dist/agent/prompt/manifest.js +12 -5
  14. package/dist/agent/prompt/resources.d.ts +0 -3
  15. package/dist/agent/prompt/resources.js +0 -6
  16. package/dist/agent/prompt/sections.d.ts +2 -2
  17. package/dist/agent/prompt/sections.js +36 -26
  18. package/dist/agent/prompt/types.d.ts +3 -2
  19. package/dist/agent/runner-factory.js +1 -1
  20. package/dist/agent/session/command-extension.js +3 -1
  21. package/dist/agent/session/compaction-summary.js +3 -6
  22. package/dist/agent/session/compaction.d.ts +2 -0
  23. package/dist/agent/session/compaction.js +22 -14
  24. package/dist/agent/session/event-guards.d.ts +2 -1
  25. package/dist/agent/session/event-guards.js +6 -0
  26. package/dist/agent/session/model-selection.d.ts +2 -1
  27. package/dist/agent/session/model-selection.js +5 -5
  28. package/dist/agent/session/session-events.js +31 -4
  29. package/dist/agent/session/session-host.d.ts +5 -3
  30. package/dist/agent/session/session-host.js +20 -16
  31. package/dist/agent/status-render.js +3 -0
  32. package/dist/agent/stop-watchdog.js +5 -1
  33. package/dist/agent/turn/task-digest.d.ts +2 -5
  34. package/dist/agent/turn/task-digest.js +25 -45
  35. package/dist/agent/turn/turn-context.js +4 -6
  36. package/dist/agent/turn/turn-error.d.ts +1 -1
  37. package/dist/agent/turn/turn-error.js +9 -0
  38. package/dist/agent/turn/turn-pipeline.d.ts +10 -5
  39. package/dist/agent/turn/turn-pipeline.js +36 -7
  40. package/dist/agent/turn/turn-prompt.d.ts +2 -0
  41. package/dist/agent/turn/turn-prompt.js +2 -1
  42. package/dist/agent/turn/turn-recovery.js +4 -1
  43. package/dist/agent/turn/turn-state.d.ts +2 -0
  44. package/dist/agent/turn/turn-state.js +2 -1
  45. package/dist/agent/types.d.ts +23 -3
  46. package/dist/agent/types.js +2 -0
  47. package/dist/app/auth-command.d.ts +25 -0
  48. package/dist/app/auth-command.js +200 -67
  49. package/dist/app/home.d.ts +7 -8
  50. package/dist/app/home.js +143 -56
  51. package/dist/channel/attachments.d.ts +4 -0
  52. package/dist/channel/attachments.js +4 -0
  53. package/dist/channel/channel-context.d.ts +6 -0
  54. package/dist/channel/config.d.ts +3 -0
  55. package/dist/channel/config.js +11 -5
  56. package/dist/channel/store.d.ts +1 -1
  57. package/dist/commands/catalog.js +42 -10
  58. package/dist/commands/router.js +5 -1
  59. package/dist/desk/commands.d.ts +44 -5
  60. package/dist/desk/commands.js +162 -28
  61. package/dist/desk/paths.d.ts +6 -0
  62. package/dist/desk/paths.js +21 -1
  63. package/dist/desk/registry.d.ts +17 -2
  64. package/dist/desk/registry.js +122 -12
  65. package/dist/desk/types.d.ts +83 -1
  66. package/dist/dingtalk/bot.d.ts +1 -1
  67. package/dist/dingtalk/bot.js +4 -3
  68. package/dist/dingtalk/config.js +10 -10
  69. package/dist/dingtalk/delivery.js +15 -8
  70. package/dist/dingtalk/inbound-media.d.ts +36 -14
  71. package/dist/dingtalk/inbound-media.js +71 -12
  72. package/dist/dingtalk/inbound.d.ts +9 -2
  73. package/dist/dingtalk/inbound.js +17 -2
  74. package/dist/dingtalk/media.d.ts +4 -10
  75. package/dist/dingtalk/media.js +58 -32
  76. package/dist/events/commands.d.ts +2 -0
  77. package/dist/events/commands.js +13 -8
  78. package/dist/events/history.d.ts +9 -0
  79. package/dist/events/history.js +66 -0
  80. package/dist/events/parse.js +7 -3
  81. package/dist/events/types.d.ts +3 -0
  82. package/dist/events/watcher.d.ts +4 -8
  83. package/dist/events/watcher.js +53 -58
  84. package/dist/jobs/kill.d.ts +23 -0
  85. package/dist/jobs/kill.js +65 -0
  86. package/dist/jobs/manager.d.ts +19 -18
  87. package/dist/jobs/manager.js +36 -103
  88. package/dist/main.js +15 -3
  89. package/dist/memory/boundary-work.d.ts +2 -1
  90. package/dist/memory/boundary-work.js +1 -1
  91. package/dist/memory/lifecycle.d.ts +2 -1
  92. package/dist/memory/lifecycle.js +2 -2
  93. package/dist/memory/reflect-job.d.ts +2 -1
  94. package/dist/memory/reflect-job.js +1 -1
  95. package/dist/memory/reflect.d.ts +2 -1
  96. package/dist/memory/reflect.js +25 -4
  97. package/dist/memory/scheduler.d.ts +2 -1
  98. package/dist/memory/scheduler.js +1 -1
  99. package/dist/memory/session-corpus.d.ts +1 -1
  100. package/dist/memory/session-corpus.js +76 -1
  101. package/dist/memory/session-search.d.ts +2 -1
  102. package/dist/memory/session-search.js +14 -12
  103. package/dist/memory/sidecar-worker.d.ts +2 -1
  104. package/dist/memory/sidecar-worker.js +2 -4
  105. package/dist/memory/store.d.ts +2 -0
  106. package/dist/memory/store.js +19 -9
  107. package/dist/models/credential-work.d.ts +7 -0
  108. package/dist/models/credential-work.js +36 -0
  109. package/dist/models/login-ui.js +4 -4
  110. package/dist/models/provider-login.js +7 -6
  111. package/dist/models/requests.d.ts +8 -0
  112. package/dist/models/requests.js +69 -0
  113. package/dist/models/runtime.d.ts +3 -1
  114. package/dist/models/runtime.js +9 -2
  115. package/dist/playbooks/agent-delegation.md +20 -45
  116. package/dist/playbooks/background-jobs.md +1 -1
  117. package/dist/playbooks/catalog.js +1 -1
  118. package/dist/playbooks/delegation-inline.md +25 -0
  119. package/dist/playbooks/delegation-recovery.md +28 -0
  120. package/dist/playbooks/event-scheduling.md +18 -37
  121. package/dist/playbooks/event-sensors.md +26 -0
  122. package/dist/playbooks/event-task-template.md +22 -0
  123. package/dist/playbooks/learning-and-skills.md +26 -0
  124. package/dist/playbooks/memory-operations.md +36 -0
  125. package/dist/playbooks/outbound-media.md +2 -2
  126. package/dist/playbooks/runtime-files.md +29 -0
  127. package/dist/playbooks/runtime-operations.md +25 -0
  128. package/dist/playbooks/runtime-orientation.md +18 -53
  129. package/dist/playbooks/task-lead.md +22 -68
  130. package/dist/playbooks/task-manage.md +38 -0
  131. package/dist/playbooks/task-recovery.md +24 -0
  132. package/dist/playbooks/task-verify.md +22 -0
  133. package/dist/runtime/bootstrap.d.ts +10 -0
  134. package/dist/runtime/bootstrap.js +93 -29
  135. package/dist/runtime/daemon-lock.js +3 -3
  136. package/dist/runtime/desk-runtime.d.ts +40 -7
  137. package/dist/runtime/desk-runtime.js +330 -44
  138. package/dist/runtime/durable-dispatch.d.ts +14 -2
  139. package/dist/runtime/durable-dispatch.js +207 -65
  140. package/dist/runtime/ingress-busy.js +17 -8
  141. package/dist/runtime/ingress-commands.js +24 -4
  142. package/dist/runtime/ingress-deps.d.ts +4 -1
  143. package/dist/runtime/ingress.js +6 -1
  144. package/dist/runtime/request-execution.js +7 -6
  145. package/dist/runtime/shutdown.d.ts +4 -1
  146. package/dist/runtime/shutdown.js +88 -35
  147. package/dist/runtime/task-close.d.ts +1 -1
  148. package/dist/runtime/task-close.js +6 -3
  149. package/dist/runtime/task-control.d.ts +2 -3
  150. package/dist/runtime/task-control.js +38 -11
  151. package/dist/runtime/task-input.js +1 -1
  152. package/dist/runtime/task-lane-types.d.ts +12 -2
  153. package/dist/runtime/task-lane-types.js +9 -0
  154. package/dist/runtime/task-lane.d.ts +2 -0
  155. package/dist/runtime/task-lane.js +38 -20
  156. package/dist/runtime/task-step.d.ts +3 -3
  157. package/dist/runtime/task-step.js +34 -16
  158. package/dist/runtime/transports.js +6 -5
  159. package/dist/runtime/turn-run.js +103 -66
  160. package/dist/security/command-guard.d.ts +1 -1
  161. package/dist/security/command-guard.js +259 -314
  162. package/dist/security/path-guard.js +48 -7
  163. package/dist/security/shell-parse.d.ts +10 -0
  164. package/dist/security/shell-parse.js +224 -0
  165. package/dist/security/types.d.ts +2 -0
  166. package/dist/subagents/commands.d.ts +1 -1
  167. package/dist/subagents/commands.js +14 -5
  168. package/dist/subagents/completion-wake.js +6 -0
  169. package/dist/subagents/detached-discovery.d.ts +1 -1
  170. package/dist/subagents/discovery.d.ts +18 -199
  171. package/dist/subagents/discovery.js +35 -289
  172. package/dist/subagents/dispatch.d.ts +1 -2
  173. package/dist/subagents/dispatch.js +50 -29
  174. package/dist/subagents/external/antigravity-cli.d.ts +2 -0
  175. package/dist/subagents/external/antigravity-cli.js +517 -0
  176. package/dist/subagents/external/claude-code.js +8 -17
  177. package/dist/subagents/external/codex-cli.js +8 -18
  178. package/dist/subagents/external/cursor-cli.js +34 -31
  179. package/dist/subagents/external/dispatch.d.ts +21 -7
  180. package/dist/subagents/external/dispatch.js +146 -12
  181. package/dist/subagents/external/exec.js +3 -0
  182. package/dist/subagents/external/harness.d.ts +57 -33
  183. package/dist/subagents/external/harness.js +69 -40
  184. package/dist/subagents/external/reconciliation.js +1 -0
  185. package/dist/subagents/external/registry.js +4 -1
  186. package/dist/subagents/external/role-warnings.d.ts +4 -13
  187. package/dist/subagents/external/role-warnings.js +4 -28
  188. package/dist/subagents/external/run.d.ts +1 -2
  189. package/dist/subagents/external/run.js +16 -26
  190. package/dist/subagents/external/settlement.d.ts +2 -0
  191. package/dist/subagents/external/settlement.js +13 -3
  192. package/dist/subagents/format.d.ts +1 -1
  193. package/dist/subagents/format.js +1 -1
  194. package/dist/subagents/internal/outcome.d.ts +1 -2
  195. package/dist/subagents/internal/outcome.js +19 -12
  196. package/dist/subagents/internal/provider-retry.d.ts +1 -2
  197. package/dist/subagents/internal/provider-retry.js +2 -4
  198. package/dist/subagents/internal/run.d.ts +2 -3
  199. package/dist/subagents/internal/run.js +27 -4
  200. package/dist/subagents/internal/state.d.ts +2 -5
  201. package/dist/subagents/internal/state.js +1 -2
  202. package/dist/subagents/internal/worker.d.ts +1 -2
  203. package/dist/subagents/internal/worker.js +20 -10
  204. package/dist/subagents/resolve.d.ts +56 -0
  205. package/dist/subagents/resolve.js +202 -0
  206. package/dist/subagents/result.d.ts +6 -4
  207. package/dist/subagents/result.js +39 -6
  208. package/dist/subagents/run-record.d.ts +54 -2
  209. package/dist/subagents/run-record.js +7 -0
  210. package/dist/subagents/runs.d.ts +6 -31
  211. package/dist/subagents/runs.js +26 -31
  212. package/dist/subagents/task-envelope.d.ts +1 -2
  213. package/dist/subagents/task-envelope.js +13 -4
  214. package/dist/subagents/task-settlement.js +1 -0
  215. package/dist/subagents/types.d.ts +105 -6
  216. package/dist/subagents/types.js +16 -1
  217. package/dist/subagents/workspace-lease.d.ts +41 -24
  218. package/dist/subagents/workspace-lease.js +159 -24
  219. package/dist/subagents/worktree.d.ts +52 -0
  220. package/dist/subagents/worktree.js +363 -0
  221. package/dist/tasks/archive.js +4 -0
  222. package/dist/tasks/brief.d.ts +5 -1
  223. package/dist/tasks/brief.js +19 -5
  224. package/dist/tasks/commands.d.ts +6 -1
  225. package/dist/tasks/commands.js +32 -7
  226. package/dist/tasks/control.d.ts +11 -0
  227. package/dist/tasks/delivery.d.ts +2 -0
  228. package/dist/tasks/delivery.js +141 -21
  229. package/dist/tasks/loop-log.d.ts +12 -0
  230. package/dist/tasks/loop-log.js +10 -1
  231. package/dist/tasks/receipts.d.ts +7 -3
  232. package/dist/tasks/receipts.js +34 -5
  233. package/dist/tools/bash.d.ts +3 -0
  234. package/dist/tools/bash.js +29 -15
  235. package/dist/tools/contract/presentation.js +7 -5
  236. package/dist/tools/edit-diff.d.ts +11 -0
  237. package/dist/tools/edit-diff.js +148 -0
  238. package/dist/tools/edit-match.d.ts +18 -0
  239. package/dist/tools/edit-match.js +242 -0
  240. package/dist/tools/edit.d.ts +10 -2
  241. package/dist/tools/edit.js +91 -361
  242. package/dist/tools/event-manage.d.ts +2 -1
  243. package/dist/tools/event-manage.js +46 -39
  244. package/dist/tools/file-observations.d.ts +9 -0
  245. package/dist/tools/file-observations.js +50 -0
  246. package/dist/tools/glob-match.d.ts +3 -1
  247. package/dist/tools/glob-match.js +40 -17
  248. package/dist/tools/glob.d.ts +1 -0
  249. package/dist/tools/glob.js +39 -19
  250. package/dist/tools/grep-command.d.ts +13 -0
  251. package/dist/tools/grep-command.js +77 -0
  252. package/dist/tools/grep.js +96 -201
  253. package/dist/tools/index.d.ts +6 -2
  254. package/dist/tools/index.js +9 -4
  255. package/dist/tools/job.js +12 -11
  256. package/dist/tools/read.d.ts +2 -0
  257. package/dist/tools/read.js +10 -2
  258. package/dist/tools/registry.d.ts +16 -11
  259. package/dist/tools/registry.js +32 -12
  260. package/dist/tools/send-media.js +9 -5
  261. package/dist/tools/session-search.d.ts +2 -1
  262. package/dist/tools/session-search.js +15 -5
  263. package/dist/tools/skill.js +13 -12
  264. package/dist/tools/subagent-manage.d.ts +1 -1
  265. package/dist/tools/subagent-manage.js +25 -152
  266. package/dist/tools/subagent.d.ts +24 -2
  267. package/dist/tools/subagent.js +24 -18
  268. package/dist/tools/task-manage/control-tools.js +1 -1
  269. package/dist/tools/task-manage/factory.d.ts +2 -2
  270. package/dist/tools/task-manage/factory.js +40 -4
  271. package/dist/tools/task-manage/lifecycle.d.ts +3 -3
  272. package/dist/tools/task-manage/lifecycle.js +56 -13
  273. package/dist/tools/task-manage/schema.d.ts +4 -1
  274. package/dist/tools/task-manage/schema.js +4 -1
  275. package/dist/tools/task-manage/shared.d.ts +1 -1
  276. package/dist/tools/task-manage/types.d.ts +5 -1
  277. package/dist/tools/write-content.d.ts +7 -1
  278. package/dist/tools/write-content.js +18 -6
  279. package/dist/tools/write.d.ts +3 -0
  280. package/dist/tools/write.js +6 -2
  281. package/dist/tui/cli.d.ts +6 -6
  282. package/dist/tui/cli.js +120 -28
  283. package/dist/tui/client.d.ts +7 -0
  284. package/dist/tui/client.js +67 -16
  285. package/dist/tui/frontend.d.ts +2 -0
  286. package/dist/tui/pitui-frontend.d.ts +4 -0
  287. package/dist/tui/pitui-frontend.js +27 -0
  288. package/dist/tui/render.d.ts +1 -0
  289. package/dist/tui/render.js +5 -0
  290. package/dist/tui/session.js +6 -0
  291. package/dist/usage/ledger.d.ts +1 -1
  292. package/dist/usage/render.js +1 -1
  293. package/dist/web/client.d.ts +1 -0
  294. package/dist/web/client.js +11 -0
  295. package/dist/web/fetch.js +6 -3
  296. package/dist/webapi/auth.d.ts +0 -3
  297. package/dist/webapi/auth.js +3 -7
  298. package/dist/webapi/config.js +17 -14
  299. package/dist/webapi/key-command.js +41 -41
  300. package/dist/webapi/response-state.d.ts +7 -1
  301. package/dist/webapi/response-state.js +166 -3
  302. package/dist/webapi/routes/websocket.js +24 -1
  303. package/dist/webapi/server.d.ts +3 -1
  304. package/dist/webapi/server.js +32 -1
  305. package/dist/webapi/service.js +8 -0
  306. package/dist/webapi/transport.d.ts +2 -0
  307. package/dist/webapi/transport.js +11 -1
  308. package/examples/sub-agents/README.md +43 -75
  309. package/examples/sub-agents/agy-main.md +21 -0
  310. package/examples/sub-agents/claude-high.md +21 -0
  311. package/examples/sub-agents/claude-main.md +21 -0
  312. package/examples/sub-agents/codex-flash.md +21 -0
  313. package/examples/sub-agents/codex-high.md +21 -0
  314. package/examples/sub-agents/codex-main.md +21 -0
  315. package/examples/sub-agents/codex-review.md +20 -0
  316. package/examples/sub-agents/cursor-high.md +20 -0
  317. package/examples/sub-agents/cursor-main.md +20 -0
  318. package/examples/sub-agents/glm-flash.md +21 -0
  319. package/examples/sub-agents/glm-high.md +21 -0
  320. package/examples/sub-agents/pi-scout.md +20 -0
  321. package/package.json +11 -12
  322. package/dist/agent/session/request-tools.d.ts +0 -3
  323. package/dist/agent/session/request-tools.js +0 -20
  324. package/dist/models/api-keys.d.ts +0 -11
  325. package/dist/models/api-keys.js +0 -22
  326. package/dist/playbooks/memory-and-learning.md +0 -55
  327. package/examples/sub-agents/agents/claude-high.md +0 -23
  328. package/examples/sub-agents/agents/claude-main.md +0 -23
  329. package/examples/sub-agents/agents/codex-flash.md +0 -23
  330. package/examples/sub-agents/agents/codex-high.md +0 -23
  331. package/examples/sub-agents/agents/codex-main.md +0 -23
  332. package/examples/sub-agents/agents/codex-review.md +0 -23
  333. package/examples/sub-agents/agents/cursor-high.md +0 -22
  334. package/examples/sub-agents/agents/cursor-main.md +0 -22
  335. package/examples/sub-agents/agents/glm-flash.md +0 -23
  336. package/examples/sub-agents/agents/glm-high.md +0 -23
  337. package/examples/sub-agents/agents/scout.md +0 -30
  338. package/examples/sub-agents/roles/builder-hard.md +0 -34
  339. package/examples/sub-agents/roles/builder.md +0 -34
  340. package/examples/sub-agents/roles/explorer.md +0 -39
  341. package/examples/sub-agents/roles/git-committer.md +0 -43
  342. package/examples/sub-agents/roles/planner.md +0 -33
  343. package/examples/sub-agents/roles/reviewer.md +0 -33
  344. package/examples/sub-agents/roles/verifier.md +0 -35
  345. package/examples/sub-agents/roles/worker.md +0 -34
package/README.en.md CHANGED
@@ -1,254 +1,412 @@
1
+ <div align="center">
2
+
1
3
  # Pipiclaw
2
4
 
3
- [简体中文](./README.md) | **English**
5
+ **Your Always-On Personal AI Engineering Assistant in DingTalk & the Terminal**
6
+
7
+ Hand off a goal from your phone — Pipiclaw remembers your project conventions, orchestrates your models and coding agents in the background, and comes back with verified deliverables.
8
+
9
+ <p>
10
+ <a href="./README.md">简体中文</a> · <strong>English</strong> · <a href="https://github.com/oyasmi/pipiclaw/blob/master/docs/README.md">Documentation</a>
11
+ </p>
4
12
 
5
- **Turn DingTalk into an AI engineering entry point that keeps working.**
13
+ <p>
14
+ <a href="https://www.npmjs.com/package/@oyasmi/pipiclaw"><img src="https://img.shields.io/npm/v/@oyasmi/pipiclaw?color=2563eb&label=npm" alt="npm version"></a>
15
+ <a href="https://github.com/oyasmi/pipiclaw/actions/workflows/ci.yml"><img src="https://github.com/oyasmi/pipiclaw/actions/workflows/ci.yml/badge.svg?branch=master" alt="CI status"></a>
16
+ <img src="https://img.shields.io/badge/node-%3E%3D22.19.0-16a34a" alt="Node.js >= 22.19.0">
17
+ <img src="https://img.shields.io/badge/platform-Linux%20%7C%20macOS%20%7C%20WSL2-64748b" alt="Platform">
18
+ <a href="./LICENSE"><img src="https://img.shields.io/badge/license-AGPL--3.0-ea580c" alt="License: AGPL v3"></a>
19
+ </p>
6
20
 
7
- Pipiclaw is a DingTalk-first AI coding assistant runtime for individual developers. Assign a goal from DingTalk or the terminal, keep its working context, and let it progress in the background using your existing models, Claude Code, Codex CLI, or custom executors. Follow progress, add instructions, pause or cancel work, and retrieve the result with its verification evidence.
21
+ **[Why Pipiclaw](#why-pipiclaw) · [In Action](#see-it-in-action) · [Quick Start](#quick-start) · [Core Capabilities](#core-capabilities) · [Slash Commands](#common-commands) · [FAQ](#faq) · [Docs](#documentation)**
8
22
 
9
- - npm: [`@oyasmi/pipiclaw`](https://www.npmjs.com/package/@oyasmi/pipiclaw)
10
- - Runtime: Node.js `>= 22.19.0`, Linux / macOS; on Windows use WSL2
11
- - License: [GNU AGPL v3](./LICENSE)
23
+ </div>
24
+
25
+ ---
12
26
 
13
27
  ## Why Pipiclaw
14
28
 
15
- ### Use your existing executors as needed
29
+ Even if you already pay for **Claude Code**, **Codex CLI**, **Cursor**, and top LLM APIs, three everyday friction points slow down real engineering work:
16
30
 
17
- Pipiclaw supports two kinds of delegation at once: built-in sub-agents do lightweight work in-process such as retrieval and log triage; external agents launch real Claude Code, Codex CLI, or any script to handle heavy tasks that need long runs, many files, and repeated self-testing.
31
+ 1. **Work stops when you step away**: Terminal coding agents are tied to an open window — step out for a meeting or commute, and you lose visibility and momentum.
32
+ 2. **Copy-pasting across isolated tools**: You triage logs in one tab, implement in Claude Code, and run a review in Codex — acting as the human glue copying context back and forth.
33
+ 3. **Repeating project context every session**: Every fresh chat forgets your repo layout, deployment rules, and personal conventions unless you repeat them.
18
34
 
19
- In DingTalk daemon mode, external tasks keep running in the background after dispatch and automatically wake the channel that dispatched them on completion. You can use `/subagents` at any time to check run status, the actual command, and outputs, use `/subagents cancel` to terminate directly, and let the main agent keep asking follow-up questions on a finished Claude Code / Codex session. The repo ships recommended capability-and-cost entries plus earlier job-style role templates for reference.
35
+ **Pipiclaw turns your existing models and coding CLIs into one cohesive, always-reachable assistant.** Running on your dev machine or server, it connects directly to **DingTalk** (with zero public IP setup), an interactive **Terminal UI**, and an **OpenAI-compatible Web API** — remembering your conventions, advancing long tasks in the background, and delivering verified results wherever you are.
20
36
 
21
- ### Work does not end when a conversation ends
37
+ | What You Care About | Typical Chatbots | Standalone Coding CLIs | **Pipiclaw** |
38
+ |---|---|---|---|
39
+ | **Reachable Anywhere** | Mobile-friendly, but blind to your local repo & tools | Full local power, but chained to your laptop screen | **DingTalk DM/Group + Terminal + OpenAI SDK on one brain** |
40
+ | **Multi-Hour Work** | Times out after one reply | Blocks your terminal; dies if disconnected | **Dedicated background tasks that run without blocking chat** |
41
+ | **Multi-Agent Synergy** | Locked to a single model | Separate tabs & manual context handoffs | **Orchestrates built-in models + Claude / Codex / Cursor / Antigravity** |
42
+ | **Persistent Memory** | Ephemeral chats or brittle keyword search | Static rule files only | **Auto-curated long-term memory + daily journals you can inspect or delete** |
43
+ | **Instant Human Control** | Wait until generation finishes | `Ctrl-C` at your keyboard | **Instant `/stop`, mid-turn `/steer`, task pause, or process kill from phone/CLI** |
22
44
 
23
- Pipiclaw is one personal assistant: by default the terminal, DingTalk DMs and group chats all share long-term memory, a daily journal, tasks, scheduled events and working files (kept in the default desk, `default`), while each keeps its own conversation — just start chatting. Sharing also means that something you tell the assistant in a DM may be recalled in a group; when you want to keep a project or purpose apart, use the advanced [desk mechanism](https://github.com/oyasmi/pipiclaw/blob/main/docs/scaling-and-concurrency.md#按需分开工位): each desk has its own memory, tasks and files. Each task is a one-off project with goals, done criteria, and work items in a Markdown contract, and steps, dispatches, and settlements in a JSONL task log; tasks run in a background task lane, independent of chat, and you can check progress, add instructions, pause or cancel them with `/tasks` at any time. Scheduled and recurring work uses event templates to create an independent task instance per occurrence. The runtime pauses a task with a notice when a budget, idle-loop, step-timeout or repeated-error boundary is reached.
45
+ ---
24
46
 
25
- ### Natively at home in DingTalk
47
+ ## See It in Action
26
48
 
27
- Pipiclaw uses DingTalk Stream Mode, so no self-hosted message relay or public IP is needed. AI Cards can continuously show thinking, tool execution, and status updates; while a task runs you can still use `/steer` to adjust direction, `/followup` to queue the next thing, and `/stop` to abort the current turn. Generated reports, screenshots, and exported files can be delivered as native DingTalk attachments.
49
+ Here is what a typical workflow looks like once Pipiclaw is running on your workstation:
28
50
 
29
- A single bot instance can serve many direct and group chats at once: every DM and every group is a channel, and model turns in different channels can progress in parallel; within one channel turns run serially so one conversation's context is not modified by multiple turns at once. Note that isolation between desks is not code-directory isolation; if several channels point at the same project directory, you should still avoid having the main agent edit the same set of files concurrently, or prepare separate Git worktrees for parallel implementation. See [Scaling and concurrency](https://github.com/oyasmi/pipiclaw/blob/main/docs/scaling-and-concurrency.md) for the full boundaries.
51
+ ```text
52
+ 09:15 [On your commute · DingTalk DM]
53
+ You ──▶ "Switch the user export endpoint to streaming, add large-file unit tests, and have
54
+ codex-review independently check the diff before sending me the result."
55
+
56
+ 09:16 [Background task starts · Chat stays free]
57
+ Bot ──▶ Creates a background task, breaks down work items, and launches local claude-main
58
+ to implement and run tests.
59
+ (Meanwhile, you can keep chatting in the exact same window about other issues.)
60
+
61
+ 09:32 [Steer anytime]
62
+ You ──▶ Check progress with "/tasks", then send:
63
+ "/tasks msg export-stream Make sure CSV exports preserve UTF-8 BOM compatibility"
64
+
65
+ 09:48 [Independent verification & mobile delivery]
66
+ Bot ──▶ claude-main passes tests → dispatches read-only codex-review to audit the diff →
67
+ pushes a clean summary, test proof, and benchmark CSV straight to your DingTalk app.
68
+ ```
30
69
 
31
- ### Autonomous, and always interruptible
70
+ What else users build into their daily routine:
32
71
 
33
- Scheduled events are good for reminders, periodic checks, and zero-token conditional sensors; the task ledger is good for long-running work that spans hours and sessions. Runtime status, model usage, tasks, memory, and delegation runs all have control commands that do not go through the LLM, so even when the model is unavailable or the current turn is stuck, you can still inspect and intervene.
72
+ - **⏰ Zero-Noise Scheduled Inspections**: Run Cron events with a local gate script first — **burning zero tokens when nothing changed**, and spinning up an investigation task only when new commits or error spikes appear.
73
+ - **🔀 Smart Compute Routing Across Subscriptions**: Use fast, affordable models for quick Q&A; route thorny architecture or root-cause debugging to `claude-high` / `codex-high` / `cursor-high`; batch mechanical edits with `codex-flash` / `glm-flash`; hand long-context collaboration to `agy-main`.
74
+ - **🗂️ Clean Context Separation When Needed**: Share one memory across DMs, groups, and terminal by default — or spin up isolated **Desks** (`/desk new side-project`) for separate repos and initiatives.
75
+ - **🔌 Drop-In Automation with Official OpenAI SDKs**: Flip on the built-in Web API and call your assistant from Python, Node.js, or CI scripts in five lines of code.
34
76
 
35
- ### Your config, data, and way of working
77
+ ---
36
78
 
37
- Models support built-in providers, OpenAI-compatible gateways, API keys, and subscription login. Memory, tasks, roles, events, and working rules are all stored in human-readable files on your machine. Pipiclaw provides command, path, and network guards plus an audit log; when you need stronger isolation, you can put the whole process in its own account or container.
79
+ ## Quick Start
38
80
 
39
- ## What it's good for
81
+ Go from zero to an always-on setup in minutes: **60-second terminal run → 5-minute DingTalk connection → external coding agents → 24/7 background service**. *(For a detailed step-by-step onboarding walkthrough including OpenAI-compatible gateway snippets, `curl` checks, and DingTalk setup troubleshooting, see **[docs/quickstart.md](https://github.com/oyasmi/pipiclaw/blob/master/docs/quickstart.md)**.)*
40
82
 
41
- - Providing an always-online dev assistant, internal tech support, or ops collaboration entry point in DingTalk
42
- - Delivering complete changes with code, tests, documentation, and appropriate checks, with independent review based on risk
43
- - Following up on coding, investigation, migration, reporting, and periodic work that spans hours or days
44
- - Keeping a separate conversation per group and direct chat, sharing one body of memory by default and splitting it with desks when needed
45
- - Reusing existing model gateways, Claude Code / Codex CLI accounts, and personal or project conventions
83
+ <details>
84
+ <summary>💡 <b>Shortcut: Paste this prompt into Claude Code / Codex / Cursor and let it set up Pipiclaw for you</b></summary>
46
85
 
47
- Pipiclaw targets individual developers and supports self-hosted, single-instance operation. It is not a hard multi-tenant SaaS, and it does not provide an OS-level sandbox; the real permissions an external agent holds are determined together by the target CLI's sandbox parameters, the run account, and the host environment.
86
+ ```text
87
+ Please install and initialize Pipiclaw for me:
48
88
 
49
- ## Quick start
89
+ 1. Check Node.js >= 22.19.0; stop and explain if it is not met.
90
+ 2. Run npm install -g @oyasmi/pipiclaw; on a permission failure do not sudo on your own.
91
+ 3. Run `pipiclaw auth status` once to initialize ~/.pipiclaw/, and share the generated initial Web API key (`pk_...`) printed on stdout with me.
92
+ 4. Ask me whether I want to use an environment API key, a custom provider in ~/.pipiclaw/models.json, or run `pipiclaw auth login` myself; do not invent missing values.
93
+ 5. If I want to connect DingTalk, collect clientId, clientSecret, optional cardTemplateId, and allowFrom item by item, write them into the dingtalk section of channel.json, and set dingtalk.enabled to true.
94
+ 6. When configuration is done, ask first whether to start. Terminal mode uses `pipiclaw tui` (or `pipiclaw tui --cwd .` inside a repo); background daemon mode uses `pipiclaw` (local Web API socket + http://127.0.0.1:8787/v1 are enabled out of the box).
95
+ 7. Honestly list the operations performed, files changed, verification results, and information still missing; do not pretend it succeeded.
96
+ ```
97
+
98
+ </details>
50
99
 
51
- The steps below cover local verification, DingTalk setup, and external-agent configuration in order. If you already have a clear goal, jump straight to the relevant part.
100
+ ### Step 1: Install & Run Out of the Box (No DingTalk Setup Needed)
52
101
 
53
- ### 1. Install and confirm the CLI
102
+ Prerequisites: **Node.js `>= 22.19.0`** on **Linux / macOS** (on Windows, use **WSL2**).
54
103
 
55
104
  ```bash
56
105
  npm install -g @oyasmi/pipiclaw
57
- pipiclaw tui --help
58
106
  ```
59
107
 
60
- The first real start of `pipiclaw` or `pipiclaw tui` creates:
108
+ On first run, Pipiclaw automatically initializes `~/.pipiclaw/`, **enables the local Web API (`socket` + `http://127.0.0.1:8787/v1`) with a generated default key (`pk_...`)**, and prompts you to log in if no model credential is configured yet.
61
109
 
62
- ```text
63
- ~/.pipiclaw/
64
- ├── channel.json # Channel switches: DingTalk app, Web API
65
- ├── auth.json # model credentials
66
- ├── models.json # custom model providers
67
- ├── settings.json # default model and runtime settings
68
- ├── tools.json # capability switches for web tools, tasks, etc.
69
- ├── security.json # command, path, and network guards
70
- └── workspace/ # shared config and extensions; the default desk's data is in desk-default/
71
- ```
110
+ You can also configure a model beforehand (pick either):
72
111
 
73
- Set `PIPICLAW_HOME=/your/path` to relocate this directory as a whole.
112
+ ```bash
113
+ # Option A: Interactive login for supported subscription / API-key providers
114
+ pipiclaw auth login
74
115
 
75
- ### 2. Fastest taste: get it working in the terminal first
116
+ # Option B: Export an API key (Anthropic shown as example)
117
+ export ANTHROPIC_API_KEY=sk-ant-...
118
+ ```
76
119
 
77
- Terminal mode needs no DingTalk credentials, only a working model. Pick either way:
120
+ Launch the interactive terminal UI (pass `--cwd .` inside a repository to bind the desk's working directory):
78
121
 
79
122
  ```bash
80
- # Option A: use an API key
81
- export ANTHROPIC_API_KEY=sk-ant-...
82
-
83
- # Option B: log in to a subscription provider supported by the SDK
84
- pipiclaw auth login
123
+ pipiclaw tui
85
124
  ```
86
125
 
87
- Then chat right in the terminal (the first run initializes the default desk):
126
+ Or start the background daemon directly (both `pipiclaw tui` and OpenAI SDK clients connect right away):
88
127
 
89
128
  ```bash
90
- pipiclaw tui
129
+ pipiclaw
91
130
  ```
92
131
 
93
- It can also be used for scripted one-shot requests:
132
+ Or run a quick one-liner to verify the end-to-end model connection:
94
133
 
95
134
  ```bash
96
- pipiclaw tui --print "Reply with only: Pipiclaw model call succeeded"
135
+ pipiclaw tui --print "Reply with only: Pipiclaw is ready"
97
136
  ```
98
137
 
99
- Only an actual model reply proves that the request path works; `pipiclaw tui --help` and `/model` only prove that the CLI or model catalog is visible. To connect an enterprise gateway, a local model, or set a default model, see [Configuration reference](https://github.com/oyasmi/pipiclaw/blob/main/docs/configuration.md).
138
+ > Using an OpenAI-compatible proxy/gateway, DeepSeek, GLM, or local Ollama? Copy the built-in `_examples` block in `~/.pipiclaw/models.json`, or check the [Configuration Quickstart](https://github.com/oyasmi/pipiclaw/blob/master/docs/configuration.md).
100
139
 
101
- ### 3. Connect DingTalk
140
+ ### Step 2: Connect DingTalk When Needed (No Public IP Required)
102
141
 
103
- Create an enterprise internal app on the [DingTalk Open Platform](https://open-dev.dingtalk.com/):
142
+ Pipiclaw uses **DingTalk Stream Mode**, so any laptop or private server with outbound internet access connects directly — no public IP, domain name, or webhook relay required:
104
143
 
105
- 1. Get the `Client ID` and `Client Secret`
106
- 2. Enable the bot capability
107
- 3. Enable Stream Mode
108
- 4. Recommended: create an AI Card template and get its `Card Template ID`
144
+ 1. Create an **Enterprise Internal App** on the [DingTalk Open Platform](https://open-dev.dingtalk.com/) and copy its **`Client ID`** and **`Client Secret`**.
145
+ 2. Add the **Bot** capability, choose **Stream Mode** for message receiving, and publish the app.
146
+ 3. *(Recommended)* Create an AI Card template and copy its **`Card Template ID`** for live streaming progress cards.
109
147
 
110
- Edit `~/.pipiclaw/channel.json`:
148
+ Edit `~/.pipiclaw/channel.json` — set `dingtalk.enabled` to `true` and fill in your credentials:
111
149
 
112
150
  ```json
113
151
  {
114
152
  "dingtalk": {
115
153
  "enabled": true,
116
- "clientId": "your-dingtalk-client-id",
117
- "clientSecret": "your-dingtalk-client-secret",
154
+ "clientId": "your-actual-client-id",
155
+ "clientSecret": "your-actual-client-secret",
118
156
  "robotCode": "",
119
- "cardTemplateId": "",
157
+ "cardTemplateId": "optional-card-template-id",
120
158
  "cardTemplateKey": "content",
121
159
  "allowFrom": []
122
160
  },
123
- "webapi": { "enabled": false, "socket": true }
161
+ "webapi": {
162
+ "enabled": true,
163
+ "socket": true,
164
+ "tcp": "127.0.0.1:8787",
165
+ "tls": null,
166
+ "keys": [{ "name": "default", "sha256": "...", "desks": ["default"] }]
167
+ }
124
168
  }
125
169
  ```
126
170
 
127
- - The `dingtalk` and `webapi` sections each have an `enabled` switch; turn on at least one. `webapi` lets scripts and other clients connect to your assistant through the official OpenAI SDK using the implemented Responses subset (see [Web API](https://github.com/oyasmi/pipiclaw/blob/main/docs/webapi.md)).
128
- - The only hard-required DingTalk fields are `clientId` and `clientSecret`.
129
- - When `robotCode` is empty it falls back to `clientId`.
130
- - `cardTemplateId` can be left empty for now; configuring an AI Card is recommended for real use.
131
- - `allowFrom: []` means all senders are allowed; during a limited rollout, fill in tester staff IDs.
132
- - The file must not keep any `your-*` placeholder values.
171
+ - Only `clientId` and `clientSecret` are strictly required (`robotCode` falls back to `clientId` when empty).
172
+ - `allowFrom: []` allows anyone with access to the DingTalk app; add your DingTalk `staffId` if you want to restrict access.
133
173
 
134
- Start the daemon:
174
+ Start the service:
135
175
 
136
176
  ```bash
137
177
  pipiclaw
138
178
  ```
139
179
 
140
- In DingTalk, message the bot directly or @ it in a group — there is no desk to create or bind. New DMs and groups join the default desk on their first authorized message; `allowFrom` still controls who may use it. Send `/model` to inspect the model reference, and a normal message to verify a real call:
180
+ Open DingTalk on your phone or desktop, **DM the bot** or **@mention it in a group**, send `/status` to check health, and start chatting!
141
181
 
142
- ```text
143
- Please introduce yourself and explain what you can do right now
144
- ```
145
-
146
- If the first message does not succeed, start from [Deployment and operations](https://github.com/oyasmi/pipiclaw/blob/main/docs/deployment-and-operations.md).
182
+ ### Step 3: Plug In Claude Code / Codex / Cursor / Antigravity (Optional)
147
183
 
148
- ### 4. Enable external agent delegation
149
-
150
- First install and log in to the target CLI under the same account that runs Pipiclaw, then copy the capability entries you need. This enables the main Claude Code and Codex entries:
184
+ If you already have `claude`, `codex`, Cursor's `agent`, or Antigravity's `agy` installed and logged in under the same OS user, enable them in two commands:
151
185
 
152
186
  ```bash
153
187
  mkdir -p ~/.pipiclaw/workspace/sub-agents
154
188
  PIPICLAW_PACKAGE_DIR="$(npm root -g)/@oyasmi/pipiclaw"
155
- cp "$PIPICLAW_PACKAGE_DIR"/examples/sub-agents/agents/{claude-main,codex-main}.md \
189
+
190
+ # Copy the entries matching the subscriptions you own (Claude, Codex & read-only review shown)
191
+ cp "$PIPICLAW_PACKAGE_DIR"/examples/sub-agents/{claude-main,codex-main,codex-review}.md \
156
192
  ~/.pipiclaw/workspace/sub-agents/
157
193
  ```
158
194
 
159
- Role file changes are rediscovered at runtime. Send:
195
+ *(Curated profiles for `claude-high`, `codex-high`, `codex-flash`, `cursor-main`, `cursor-high`, `agy-main`, `glm-high`, and `glm-flash` are also included — see [Sub-Agent Examples](https://github.com/oyasmi/pipiclaw/blob/master/examples/sub-agents/README.md).)*
196
+
197
+ **No restart needed.** Send `/subagents roles` in chat to confirm availability, then delegate naturally:
160
198
 
161
199
  ```text
162
- /subagents roles
200
+ Hand this cross-module refactor to a suitable external coding agent, run the test suite, and perform an independent read-only review before reporting back.
163
201
  ```
164
202
 
165
- Once the entries show as available, describe the goal and acceptance criteria and let the main agent select an executor:
203
+ > [!IMPORTANT]
204
+ > **Permission Notice**: External coding agents run as standalone OS processes and bypass Pipiclaw's built-in command/path guards (and write-capable templates pass permissive CLI flags by default). Review the [Agent Delegation Guide](https://github.com/oyasmi/pipiclaw/blob/master/docs/sub-agents.md) before enabling them.
166
205
 
167
- ```text
168
- Please hand this cross-module implementation to a suitable executor, then independently check the final changes.
206
+ ### Step 4: Keep It Running 24/7 in the Background (Recommended)
207
+
208
+ To keep your assistant online when you close your terminal, run `pipiclaw` under `pm2` or `systemd` on an always-on workstation, Mac mini, or server:
209
+
210
+ ```bash
211
+ # Quick background setup with pm2
212
+ pm2 start pipiclaw --name pipiclaw && pm2 save
169
213
  ```
170
214
 
171
- Common control entry points:
215
+ For production `systemd` unit files, environment isolation, backups, and troubleshooting, see [Deployment & Operations](https://github.com/oyasmi/pipiclaw/blob/master/docs/deployment-and-operations.md).
172
216
 
173
- ```text
174
- /subagents # running and recently completed delegations
175
- /subagents show <runId> # status, actual argv, artifact directory, stderr
176
- /subagents output <runId> # view text output
177
- /subagents cancel <runId|all> # terminate directly, not through the model
178
- /subagents roles [name] # view the role directory and a single role's config
217
+ ---
218
+
219
+ ## Core Capabilities
220
+
221
+ ### 💬 1. Live Streaming Across DingTalk, Terminal & SDK
222
+
223
+ - **Real-Time AI Cards**: Watch reasoning steps and tool calls unfold live in DingTalk. Need to adjust course while it's working? Just send a message to steer mid-turn (`/steer`), or queue your next request with `/followup`.
224
+ - **Native File Delivery**: Generated reports, CSV exports, screenshots, and archives arrive directly in DingTalk as native file attachments.
225
+ - **Official OpenAI SDK Compatibility**: Both `pipiclaw tui` and your own Python/JS scripts talk to the same assistant via the built-in OpenAI Responses-compatible [Web API](https://github.com/oyasmi/pipiclaw/blob/master/docs/webapi.md).
226
+
227
+ ### 🛤️ 2. Non-Blocking Background Tasks & Scheduled Events
228
+
229
+ - **Dedicated Task Lane**: Multi-step projects progress in the background without tying up your conversation, persisting every checklist item and step on disk so work resumes cleanly across restarts.
230
+ - **Built-In Cost & Safety Guardrails**: Step limits, USD budgets, per-step timeouts, and error circuit breakers automatically pause runaway tasks and notify you when human input is needed.
231
+ - **Timers & Zero-Token Sensors**: Schedule one-off reminders or recurring Cron jobs, optionally gated by local check scripts so idle inspections cost zero tokens.
232
+
233
+ ### 🤝 3. Unified Multi-Agent Orchestration
234
+
235
+ - **Lead Assistant + Specialized Workers**: Your main assistant owns context, planning, and acceptance — spinning up fast **built-in sub-agents** for quick searches/log triage, and **Claude Code / Codex / Cursor / Antigravity** for heavy multi-file coding and test loops.
236
+ - **Async Wakeups & Follow-Ups**: Long external runs execute in the background, wake your chat automatically when done, support session continuation for follow-up questions, and can be killed anytime via `/subagents cancel`.
237
+
238
+ ### 🧠 4. Transparent, Controllable Memory
239
+
240
+ - **Long-Term Conventions + Daily Journals**: Durable project rules live in `memory/*.md` and load automatically at session start (no brittle keyword guessing), while day-to-day progress stays neatly separated in daily `journal/` files.
241
+ - **Probation & Permanent Forgetting**: Newly inferred habits enter a 30-day probation window first, and `/memory forget <name>` deletes unwanted entries permanently so background maintenance never brings them back.
242
+
243
+ ### 🛡️ 5. Instant Takeover & 100% Local Plain-Text Data
244
+
245
+ - **LLM-Independent Controls**: Commands like `/stop`, `/tasks`, `/subagents`, `/status`, and `/usage` execute directly in the local runtime — **responding instantly even if an upstream model API is slow or unreachable**.
246
+ - **Plain-Text Data Ownership**: Every config, memory, journal, task spec, and usage ledger lives as readable Markdown or JSON under `~/.pipiclaw/`, protected by built-in command, path, and network guards.
247
+
248
+ ### Mental Model at a Glance
249
+
250
+ ```mermaid
251
+ flowchart LR
252
+ subgraph You["Where You Talk (Channels)"]
253
+ DT["📱 DingTalk DM / Group"]
254
+ TUI["💻 Terminal (pipiclaw tui)"]
255
+ SDK["🔌 Your Scripts (OpenAI SDK)"]
256
+ end
257
+
258
+ subgraph Assistant["Your Pipiclaw Assistant"]
259
+ CMD["⚡ Instant Slash Controls<br/>(/stop · /tasks · /subagents ...)"]
260
+ CHAT["💬 Interactive Chat & Routing"]
261
+ TASK["🛤️ Background Tasks & Cron Events"]
262
+ end
263
+
264
+ subgraph Desk["Desk (default / custom workspaces)"]
265
+ MEM["🧠 Long-Term Memory · Daily Journal · Repo CWD"]
266
+ end
267
+
268
+ subgraph Workers["Tools & Coding Agents"]
269
+ LOCAL["🔍 Built-In Tools & Fast Internal Sub-Agents"]
270
+ CLI["🛠️ Claude Code · Codex · Cursor · Antigravity"]
271
+ end
272
+
273
+ DT & TUI & SDK --> CMD & CHAT
274
+ CHAT & TASK <--> Desk
275
+ CHAT & TASK --> LOCAL & CLI
179
276
  ```
180
277
 
181
- External agents do not go through Pipiclaw's command and path guards. The recommended entries above use permissive CLI flags; before using them, read the authorization, security boundary, and sandbox notes in the [Agent delegation guide](https://github.com/oyasmi/pipiclaw/blob/main/docs/sub-agents.md).
278
+ | Everyday Term | What It Means for You |
279
+ |---|---|
280
+ | **Channel** | A conversation window (a DingTalk DM, a DingTalk group, or a terminal/API session), each keeping its own chat history. |
281
+ | **Desk** | A named workspace owning memory, journals, tasks, events, and a working directory. Everything shares `default` out of the box; create more only when you want separation. |
282
+ | **Task** | A multi-step project advancing in the background without blocking chat — inspectable, steerable, and resumable anytime. |
283
+ | **Event** | A one-time alarm or Cron schedule that wakes the assistant or spawns recurring tasks (optionally gated by a local check script). |
284
+ | **Sub-Agent** | A helper dispatched for a specific job — either a fast built-in reader or an external CLI like Claude Code or Codex. |
182
285
 
183
- Long-running external delegations should run in the long-lived daemon; without one, the runtime embedded in `pipiclaw tui` handles external-run completions only while the terminal is open.
286
+ ---
184
287
 
185
- ### 5. Optional: enable web tools
288
+ ## Common Commands
186
289
 
187
- `web_search` / `web_fetch` are off by default. Edit `~/.pipiclaw/tools.json`, set `tools.web.enable: true`, and configure a search provider. DuckDuckGo, Tavily, Jina, and SearXNG are supported; DuckDuckGo is the default. See [Configuration reference](https://github.com/oyasmi/pipiclaw/blob/main/docs/configuration.md) for the full fields.
290
+ Type `/` in DingTalk or the terminal to control your assistant (send `/help` for the full list, or `/help <command>` for examples):
188
291
 
189
- <details>
190
- <summary>Let your favorite AI agent install it for you</summary>
292
+ ### ⚡ Available Anytime (Responds instantly — even mid-reply or if a model hangs)
191
293
 
192
- Hand the following request to Claude Code, Codex, or another local AI agent:
294
+ | Command | When to Use It |
295
+ |---|---|
296
+ | `/help [command]` | Browse all commands, or view subcommands and examples for one (e.g. `/help tasks`) |
297
+ | `/status` | Check health, active model, context usage, uptime, and background task summary |
298
+ | `/stop` | Immediately abort the current chat reply and clear queued messages |
299
+ | `/steer <message>` | Nudge or redirect a running reply on the fly (plain messages sent while busy do this by default) |
300
+ | `/followup <message>` | Queue your next request to run right after the current reply finishes |
301
+ | `/tasks [show\|msg\|pause\|resume\|cancel...]` | Check background task progress, send instructions (`msg`), pause, resume with extra budget, or cancel |
302
+ | `/subagents [list\|show\|output\|cancel\|roles]` | Inspect active/recent Claude/Codex delegations, read live output, or `cancel` a process immediately |
303
+ | `/events <list\|show\|delete\|history>` | List or delete scheduled reminders/Cron jobs and inspect trigger history |
304
+ | `/desk [list\|new\|cwd\|bind]` | View desks, create a new desk, or set its repo directory (note: `bind` waits until the active turn ends) |
305
+ | `/usage [7d\|month]` | View token consumption and cost breakdown for your desk and globally |
306
+ | `/context [detail]` | See exactly how much system prompt, tool schema, and history is sent to the model |
307
+ | `/skills [list\|show <name>]` | List loaded workspace and shared user skills |
308
+ | `/new` | Start a fresh chat session while keeping your long-term desk memory intact |
309
+
310
+ ### 🛋️ Available When Idle (Run after the current reply finishes)
311
+
312
+ | Command | When to Use It |
313
+ |---|---|
314
+ | `/memory [status\|list\|show\|forget\|journal]` | Browse saved memories, read daily journals, or permanently delete/block an item (`forget`) |
315
+ | `/model [name-or-substring]` | Check the active model or switch models by exact ID or unique substring |
316
+ | `/thinking [low\|medium\|high\|cycle...]` | Tune reasoning depth (lower for snappy chat, higher for hard debugging) |
317
+ | `/compact [instructions]` | Compress a long chat history manually, optionally telling it what details to preserve |
318
+ | `/session` | Check message counts and token stats for the current conversation |
319
+ | `/reload` | Hot-reload updated skills and workspace resources without restarting |
193
320
 
194
- ```text
195
- Please install and initialize Pipiclaw for me:
321
+ ---
196
322
 
197
- 1. Check Node.js >= 22.19.0; stop and explain if it is not met.
198
- 2. Run npm install -g @oyasmi/pipiclaw; on a permission failure do not sudo on your own.
199
- 3. Run pipiclaw once to initialize ~/.pipiclaw/; it prompting you to complete channel.json and exiting because it is still a template is normal.
200
- 4. Ask me whether I want to use an API key, a custom provider, or a subscription login supported by pipiclaw auth login; do not invent missing values.
201
- 5. If I want to connect DingTalk, collect clientId, clientSecret, optional cardTemplateId, and allowFrom item by item, write them into the `dingtalk` section of channel.json, and remove all your-* placeholder values.
202
- 6. When configuration is done, ask first whether to start. Terminal mode uses pipiclaw tui; DingTalk mode uses pipiclaw, and after it starts message the bot directly or @ it in a group — no desk needs to be created or bound.
203
- 7. Honestly list the operations performed, files changed, verification results, and information still missing; do not pretend it succeeded.
323
+ ## Where Your Data & Config Live
324
+
325
+ Everything lives in `~/.pipiclaw/` (override anytime via `PIPICLAW_HOME=/your/path`) — backing up or moving machines is as simple as copying one folder:
326
+
327
+ ```text
328
+ ~/.pipiclaw/
329
+ ├── channel.json # DingTalk bot credentials, AI Card template & Web API switches
330
+ ├── auth.json # Model credentials (managed via pipiclaw auth login)
331
+ ├── models.json # Custom model providers, OpenAI-compatible gateways & local endpoints
332
+ ├── settings.json # Default model, fallback model & runtime preferences
333
+ ├── tools.json # Feature toggles such as web search/fetch (off by default; keyless DuckDuckGo supported)
334
+ ├── security.json # Command, path & network guard policies
335
+ └── workspace/ # Your personal assets:
336
+ ├── SOUL.md # Customize assistant persona, tone & language preferences
337
+ ├── AGENTS.md # Shared engineering rules & workflow conventions
338
+ ├── skills/ # Reusable workflow skills (also loads shared skills from ~/.agents/skills/)
339
+ ├── sub-agents/ # Enabled external coding agent profiles
340
+ └── desk-default/ # Default desk's memory/, daily journal/, and background tasks/
204
341
  ```
205
342
 
343
+ See the **[Configuration Quickstart](https://github.com/oyasmi/pipiclaw/blob/master/docs/configuration.md)** for common recipes (custom gateways, proxies via `PIPICLAW_PROXY`, web tools, and more).
344
+
345
+ ---
346
+
347
+ ## FAQ
348
+
349
+ <details>
350
+ <summary><b>1. Do I need a cloud server, domain name, or public IP for DingTalk?</b></summary>
351
+
352
+ **No.** Pipiclaw connects outbound via DingTalk's official Stream Mode. Any laptop, desktop, or private server with regular internet access works out of the box.
206
353
  </details>
207
354
 
208
- ## Common commands
355
+ <details>
356
+ <summary><b>2. Will tasks keep running if I close my laptop lid?</b></summary>
209
357
 
210
- | Command | Purpose |
211
- |---|---|
212
- | `/help` | Full command help for the current version |
213
- | `/stop` | Stop the current turn; a task-driven turn also pauses its task |
214
- | `/steer <message>` | Adjust the running turn |
215
- | `/followup <message>` | Queue the next request |
216
- | `/desk [list\|new <name>\|bind <name>]` | Advanced: create a desk, or switch the current channel to another desk |
217
- | `/status` | Execution status, model, context, uptime, and version |
218
- | `/usage [7d\|month]` | Model usage and cost for the current desk and globally |
219
- | `/tasks ...` | View, diagnose, and control long-running tasks |
220
- | `/subagents ...` | View and control delegation runs and the role directory |
221
- | `/memory ...` | View the current desk's long-term memory |
222
- | `/model [ref]` | View or switch the model |
223
-
224
- `/help`, `/stop`, `/steer`, `/followup`, `/desk`, `/events`, `/tasks`, `/status`, `/usage`, `/context`, and `/subagents` are handled directly by the runtime and work mid-turn. `/stop` does not cancel an already dispatched delegation run; use `/subagents cancel`.
225
-
226
- See [Interaction and commands](https://github.com/oyasmi/pipiclaw/blob/main/docs/interaction-and-commands.md) for full interaction details.
358
+ Pipiclaw runs locally on the host where you installed it. If your laptop goes to sleep, the process pauses until wake-up (and then automatically reconnects and resumes). For **true 24/7 mobile access**, run Pipiclaw on an always-on desktop, Mac mini, home server, or cloud VM.
359
+ </details>
360
+
361
+ <details>
362
+ <summary><b>3. Does delegating to Claude Code / Codex cost extra? What is the security model?</b></summary>
363
+
364
+ Pipiclaw adds zero middleman fees — it invokes the official CLIs already installed and authenticated on your machine using your existing subscriptions or API keys.
365
+ **Security scope**: Pipiclaw is built for individual developers (and small trusted setups sharing one assistant), not hard multi-tenant SaaS isolation. External coding CLIs run under your OS user account and **bypass Pipiclaw's built-in command/path guards**. Run them in dedicated project directories or under a dedicated OS user. Read the [Security Guide](https://github.com/oyasmi/pipiclaw/blob/master/docs/security.md) for details.
366
+ </details>
367
+
368
+ <details>
369
+ <summary><b>4. How do I enable web search or upgrade Pipiclaw?</b></summary>
370
+
371
+ - **Enable web search**: Set `tools.web.enable: true` in `~/.pipiclaw/tools.json` (DuckDuckGo works immediately with no API key; Tavily, Jina, and SearXNG are also supported).
372
+ - **Upgrade**: Run `npm install -g @oyasmi/pipiclaw@latest` and restart the `pipiclaw` process. Your `~/.pipiclaw/` data and memories stay untouched.
373
+ </details>
374
+
375
+ ---
227
376
 
228
377
  ## Documentation
229
378
 
230
- The full index is at **[docs/README.md](https://github.com/oyasmi/pipiclaw/blob/main/docs/README.md)**. Good starting points:
379
+ Explore the full user guides in **[docs/README.md](https://github.com/oyasmi/pipiclaw/blob/master/docs/README.md)** *(currently primarily in Chinese)*:
231
380
 
232
- | I want to understand | Doc |
381
+ | Goal | Guide |
233
382
  |---|---|
234
- | DingTalk, TUI, AI Card, and control commands | [Interaction and commands](https://github.com/oyasmi/pipiclaw/blob/main/docs/interaction-and-commands.md) |
235
- | Claude Code / Codex / built-in sub-agent delegation | [Agent delegation](https://github.com/oyasmi/pipiclaw/blob/main/docs/sub-agents.md) |
236
- | Configuring models, tools, and the workspace | [Configuration reference](https://github.com/oyasmi/pipiclaw/blob/main/docs/configuration.md) |
237
- | Memory, scheduled events, and long-running tasks | [Memory](https://github.com/oyasmi/pipiclaw/blob/main/docs/memory.md) · [Events and tasks](https://github.com/oyasmi/pipiclaw/blob/main/docs/events-and-tasks.md) |
238
- | Default security boundaries and external agent authorization | [Security guide](https://github.com/oyasmi/pipiclaw/blob/main/docs/security.md) |
239
- | Deployment, upgrades, backup, and troubleshooting | [Deployment and operations](https://github.com/oyasmi/pipiclaw/blob/main/docs/deployment-and-operations.md) |
240
- | The concurrency model and capacity limits for many groups and DMs | [Scaling and concurrency](https://github.com/oyasmi/pipiclaw/blob/main/docs/scaling-and-concurrency.md) |
383
+ | ⚡ Step-by-step first-run onboarding, gateway snippets & FAQ | [Quick Start Guide](https://github.com/oyasmi/pipiclaw/blob/master/docs/quickstart.md) |
384
+ | 💬 Master DMs, groups, AI Card modes & slash commands | [Interaction & Commands](https://github.com/oyasmi/pipiclaw/blob/master/docs/interaction-and-commands.md) |
385
+ | ⚙️ Configure custom models, gateways, proxies & web search | [Configuration Quickstart](https://github.com/oyasmi/pipiclaw/blob/master/docs/configuration.md) · [Field Reference](https://github.com/oyasmi/pipiclaw/blob/master/docs/configuration-reference.md) |
386
+ | 🤝 Set up & customize Claude Code / Codex / Cursor / Antigravity | [Agent Delegation](https://github.com/oyasmi/pipiclaw/blob/master/docs/sub-agents.md) · [Profile Examples](https://github.com/oyasmi/pipiclaw/blob/master/examples/sub-agents/README.md) |
387
+ | 📋 Run background tasks, Cron inspections & budgets | [Events & Tasks](https://github.com/oyasmi/pipiclaw/blob/master/docs/events-and-tasks.md) |
388
+ | 🧠 Manage long-term memory, journals, probation & forgetting | [Memory Guide](https://github.com/oyasmi/pipiclaw/blob/master/docs/memory.md) |
389
+ | 🧩 Package reusable personal or project workflows as Skills | [Skills Guide](https://github.com/oyasmi/pipiclaw/blob/master/docs/skills.md) · [Built-In Tools](https://github.com/oyasmi/pipiclaw/blob/master/docs/tools.md) |
390
+ | 🔌 Connect Python/JS scripts or custom UIs via OpenAI SDK | [Web API Guide](https://github.com/oyasmi/pipiclaw/blob/master/docs/webapi.md) |
391
+ | 💡 Best practices for high-leverage autonomous delivery | [Leverage Notes](https://github.com/oyasmi/pipiclaw/blob/master/docs/leverage/README.md) · [Design Philosophy](https://github.com/oyasmi/pipiclaw/blob/master/docs/design-philosophy.md) |
392
+ | 🚀 Host 24/7 with systemd/pm2, review guards & troubleshoot | [Deployment & Operations](https://github.com/oyasmi/pipiclaw/blob/master/docs/deployment-and-operations.md) · [Security Guide](https://github.com/oyasmi/pipiclaw/blob/master/docs/security.md) · [Scaling & Concurrency](https://github.com/oyasmi/pipiclaw/blob/master/docs/scaling-and-concurrency.md) |
393
+
394
+ ---
241
395
 
242
- ## Development
396
+ ## Building from Source & Contributing
397
+
398
+ Want to build from source, customize locally, or contribute?
243
399
 
244
400
  ```bash
245
- npm install
246
- npm run build
247
- npm run check # lint + typecheck + deadcode + test
401
+ git clone https://github.com/oyasmi/pipiclaw.git
402
+ cd pipiclaw
403
+ npm install && npm run build && npm run check
248
404
  ```
249
405
 
250
- Minimal verification: `npm run typecheck` and `npm run test`. `npm run test:e2e` is deterministic, offline, and credential-free; the small real-model smoke suite uses `npm run test:e2e:live`.
406
+ For module boundaries, runtime internals, and engineering conventions, see [Architecture](https://github.com/oyasmi/pipiclaw/blob/master/docs/architecture.md), [Runtime Mechanisms](https://github.com/oyasmi/pipiclaw/blob/master/docs/runtime-mechanisms.md), and [AGENTS.md](https://github.com/oyasmi/pipiclaw/blob/master/AGENTS.md). Issues and Pull Requests are welcome!
407
+
408
+ ---
251
409
 
252
410
  ## License
253
411
 
254
- GNU Affero General Public License v3.0. See [LICENSE](./LICENSE).
412
+ Licensed under the [GNU Affero General Public License v3.0 (AGPL-3.0)](./LICENSE).