@oyasmi/pipiclaw 0.9.5-beta.4 → 0.9.6-beta.1
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/README.en.md +220 -126
- package/README.md +217 -123
- package/dist/agent/channel-runner.d.ts +1 -1
- package/dist/agent/channel-runner.js +1 -1
- package/dist/agent/prompt/sections.js +1 -1
- package/dist/agent/prompt/types.d.ts +2 -1
- package/dist/agent/session/compaction.d.ts +2 -0
- package/dist/agent/session/compaction.js +22 -14
- package/dist/agent/session/session-host.d.ts +1 -1
- package/dist/agent/session/session-host.js +3 -1
- package/dist/agent/stop-watchdog.js +5 -1
- package/dist/agent/turn/turn-state.d.ts +2 -0
- package/dist/agent/turn/turn-state.js +2 -1
- package/dist/agent/types.d.ts +3 -1
- package/dist/channel/attachments.d.ts +4 -0
- package/dist/channel/attachments.js +4 -0
- package/dist/channel/store.d.ts +1 -1
- package/dist/commands/catalog.js +25 -9
- package/dist/commands/router.js +5 -1
- package/dist/desk/commands.d.ts +14 -2
- package/dist/desk/commands.js +68 -20
- package/dist/desk/registry.d.ts +6 -2
- package/dist/desk/registry.js +70 -4
- package/dist/desk/types.d.ts +17 -0
- package/dist/dingtalk/bot.d.ts +1 -1
- package/dist/dingtalk/bot.js +4 -3
- package/dist/dingtalk/delivery.js +13 -8
- package/dist/dingtalk/inbound-media.d.ts +36 -14
- package/dist/dingtalk/inbound-media.js +71 -12
- package/dist/dingtalk/inbound.d.ts +9 -2
- package/dist/dingtalk/inbound.js +18 -2
- package/dist/dingtalk/media.d.ts +4 -10
- package/dist/dingtalk/media.js +58 -32
- package/dist/events/commands.d.ts +2 -0
- package/dist/events/commands.js +13 -8
- package/dist/events/history.d.ts +9 -0
- package/dist/events/history.js +66 -0
- package/dist/events/parse.js +7 -3
- package/dist/events/types.d.ts +3 -0
- package/dist/events/watcher.d.ts +3 -7
- package/dist/events/watcher.js +51 -56
- package/dist/jobs/kill.d.ts +23 -0
- package/dist/jobs/kill.js +65 -0
- package/dist/jobs/manager.d.ts +19 -18
- package/dist/jobs/manager.js +36 -103
- package/dist/memory/reflect.js +23 -3
- package/dist/memory/session-corpus.d.ts +1 -1
- package/dist/memory/session-corpus.js +70 -1
- package/dist/memory/session-search.js +13 -11
- package/dist/memory/store.d.ts +2 -0
- package/dist/memory/store.js +19 -9
- package/dist/playbooks/agent-delegation.md +34 -44
- package/dist/playbooks/memory-and-learning.md +4 -4
- package/dist/playbooks/runtime-orientation.md +1 -1
- package/dist/playbooks/task-lead.md +48 -64
- package/dist/runtime/bootstrap.d.ts +6 -0
- package/dist/runtime/bootstrap.js +11 -7
- package/dist/runtime/desk-runtime.d.ts +8 -2
- package/dist/runtime/desk-runtime.js +35 -4
- package/dist/runtime/durable-dispatch.d.ts +14 -2
- package/dist/runtime/durable-dispatch.js +207 -65
- package/dist/runtime/ingress-busy.js +17 -8
- package/dist/runtime/ingress-deps.d.ts +4 -1
- package/dist/runtime/ingress.js +6 -1
- package/dist/runtime/request-execution.js +7 -6
- package/dist/runtime/shutdown.d.ts +1 -0
- package/dist/runtime/shutdown.js +87 -35
- package/dist/runtime/task-control.d.ts +1 -0
- package/dist/runtime/task-control.js +25 -2
- package/dist/runtime/task-lane.d.ts +1 -0
- package/dist/runtime/task-lane.js +21 -6
- package/dist/runtime/task-spawn.d.ts +3 -2
- package/dist/runtime/task-spawn.js +3 -2
- package/dist/runtime/task-step.js +11 -2
- package/dist/runtime/turn-run.js +103 -66
- package/dist/security/command-guard.d.ts +1 -1
- package/dist/security/command-guard.js +237 -314
- package/dist/security/path-guard.js +48 -7
- package/dist/security/shell-parse.d.ts +10 -0
- package/dist/security/shell-parse.js +224 -0
- package/dist/security/types.d.ts +2 -0
- package/dist/subagents/commands.d.ts +1 -1
- package/dist/subagents/detached-discovery.d.ts +1 -1
- package/dist/subagents/discovery.d.ts +18 -199
- package/dist/subagents/discovery.js +35 -289
- package/dist/subagents/dispatch.d.ts +1 -2
- package/dist/subagents/dispatch.js +39 -20
- package/dist/subagents/external/antigravity-cli.d.ts +2 -0
- package/dist/subagents/external/antigravity-cli.js +517 -0
- package/dist/subagents/external/claude-code.js +8 -17
- package/dist/subagents/external/codex-cli.js +8 -18
- package/dist/subagents/external/cursor-cli.js +34 -31
- package/dist/subagents/external/dispatch.d.ts +21 -7
- package/dist/subagents/external/dispatch.js +139 -11
- package/dist/subagents/external/exec.js +3 -0
- package/dist/subagents/external/harness.d.ts +57 -33
- package/dist/subagents/external/harness.js +69 -40
- package/dist/subagents/external/reconciliation.js +1 -0
- package/dist/subagents/external/registry.js +4 -1
- package/dist/subagents/external/role-warnings.d.ts +4 -13
- package/dist/subagents/external/role-warnings.js +4 -28
- package/dist/subagents/external/run.d.ts +1 -2
- package/dist/subagents/external/run.js +11 -11
- package/dist/subagents/external/settlement.d.ts +2 -0
- package/dist/subagents/external/settlement.js +8 -2
- package/dist/subagents/format.d.ts +1 -1
- package/dist/subagents/format.js +1 -1
- package/dist/subagents/internal/outcome.d.ts +1 -2
- package/dist/subagents/internal/provider-retry.d.ts +1 -2
- package/dist/subagents/internal/provider-retry.js +1 -1
- package/dist/subagents/internal/run.d.ts +1 -2
- package/dist/subagents/internal/state.d.ts +1 -2
- package/dist/subagents/internal/worker.d.ts +1 -2
- package/dist/subagents/internal/worker.js +3 -1
- package/dist/subagents/resolve.d.ts +56 -0
- package/dist/subagents/resolve.js +202 -0
- package/dist/subagents/result.d.ts +1 -2
- package/dist/subagents/result.js +7 -3
- package/dist/subagents/run-record.d.ts +33 -2
- package/dist/subagents/run-record.js +2 -0
- package/dist/subagents/runs.d.ts +2 -24
- package/dist/subagents/runs.js +6 -0
- package/dist/subagents/task-envelope.d.ts +1 -2
- package/dist/subagents/task-envelope.js +8 -4
- package/dist/subagents/types.d.ts +93 -4
- package/dist/subagents/types.js +16 -1
- package/dist/subagents/workspace-lease.d.ts +11 -21
- package/dist/subagents/workspace-lease.js +48 -21
- package/dist/subagents/worktree.d.ts +10 -0
- package/dist/subagents/worktree.js +77 -0
- package/dist/tasks/archive.js +4 -0
- package/dist/tasks/commands.d.ts +3 -0
- package/dist/tasks/commands.js +16 -2
- package/dist/tasks/control.d.ts +2 -0
- package/dist/tasks/delivery.d.ts +2 -0
- package/dist/tasks/delivery.js +141 -21
- package/dist/tasks/loop-log.d.ts +2 -0
- package/dist/tasks/loop-log.js +9 -0
- package/dist/tools/bash.js +2 -0
- package/dist/tools/contract/presentation.js +3 -4
- package/dist/tools/event-manage.d.ts +2 -0
- package/dist/tools/event-manage.js +20 -2
- package/dist/tools/index.d.ts +2 -1
- package/dist/tools/index.js +2 -0
- package/dist/tools/registry.js +3 -1
- package/dist/tools/send-media.js +9 -5
- package/dist/tools/session-search.js +1 -1
- package/dist/tools/subagent-manage.d.ts +1 -1
- package/dist/tools/subagent-manage.js +15 -149
- package/dist/tools/subagent.d.ts +2 -0
- package/dist/tools/subagent.js +6 -1
- package/dist/tools/task-manage/factory.js +2 -2
- package/dist/tools/task-manage/lifecycle.d.ts +3 -3
- package/dist/tools/task-manage/lifecycle.js +49 -9
- package/dist/tools/task-manage/schema.d.ts +4 -1
- package/dist/tools/task-manage/schema.js +4 -1
- package/dist/tools/task-manage/types.d.ts +4 -1
- package/dist/tui/cli.d.ts +1 -6
- package/dist/tui/cli.js +29 -3
- package/dist/tui/client.d.ts +2 -0
- package/dist/tui/client.js +13 -4
- package/dist/usage/ledger.d.ts +1 -1
- package/dist/usage/render.js +1 -1
- package/examples/sub-agents/README.md +39 -73
- package/examples/sub-agents/agents/agy-main.md +23 -0
- package/examples/sub-agents/agents/claude-high.md +9 -9
- package/examples/sub-agents/agents/claude-main.md +9 -9
- package/examples/sub-agents/agents/codex-flash.md +9 -9
- package/examples/sub-agents/agents/codex-high.md +9 -9
- package/examples/sub-agents/agents/codex-main.md +9 -9
- package/examples/sub-agents/agents/codex-review.md +9 -9
- package/examples/sub-agents/agents/cursor-high.md +9 -9
- package/examples/sub-agents/agents/cursor-main.md +9 -9
- package/examples/sub-agents/agents/glm-flash.md +9 -9
- package/examples/sub-agents/agents/glm-high.md +9 -9
- package/package.json +8 -8
- package/examples/sub-agents/agents/scout.md +0 -30
- package/examples/sub-agents/roles/builder-hard.md +0 -34
- package/examples/sub-agents/roles/builder.md +0 -34
- package/examples/sub-agents/roles/explorer.md +0 -39
- package/examples/sub-agents/roles/git-committer.md +0 -43
- package/examples/sub-agents/roles/planner.md +0 -33
- package/examples/sub-agents/roles/reviewer.md +0 -33
- package/examples/sub-agents/roles/verifier.md +0 -35
- package/examples/sub-agents/roles/worker.md +0 -34
package/README.en.md
CHANGED
|
@@ -1,113 +1,204 @@
|
|
|
1
1
|
# Pipiclaw
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
<p align="left">
|
|
4
|
+
<a href="./README.md">简体中文</a> | <strong>English</strong>
|
|
5
|
+
</p>
|
|
4
6
|
|
|
5
|
-
|
|
7
|
+
<p align="left">
|
|
8
|
+
<a href="https://www.npmjs.com/package/@oyasmi/pipiclaw"><img src="https://img.shields.io/npm/v/@oyasmi/pipiclaw?color=blue&label=npm" alt="npm version"></a>
|
|
9
|
+
<img src="https://img.shields.io/badge/node-%3E%3D22.19.0-brightgreen" alt="Node.js >= 22.19.0">
|
|
10
|
+
<img src="https://img.shields.io/badge/platform-Linux%20%7C%20macOS%20%7C%20WSL2-lightgrey" alt="Platform">
|
|
11
|
+
<a href="./LICENSE"><img src="https://img.shields.io/badge/license-AGPL--3.0-orange" alt="License: AGPL v3"></a>
|
|
12
|
+
</p>
|
|
6
13
|
|
|
7
|
-
|
|
14
|
+
> **Turn DingTalk and your terminal into an always-on AI engineering workbench — assign a goal, close your laptop, and let it progress in the background across your models and coding agents, returning verified deliverables.**
|
|
8
15
|
|
|
9
|
-
-
|
|
10
|
-
- Runtime: Node.js `>= 22.19.0`, Linux / macOS; on Windows use WSL2
|
|
11
|
-
- License: [GNU AGPL v3](./LICENSE)
|
|
16
|
+
**Pipiclaw** is a DingTalk-first AI coding assistant runtime for individual developers. Assign a goal from DingTalk, the terminal, or your own scripts, keep its working context intact, and let it advance long-running work in the background while delegating to your existing models, **Claude Code**, **Codex CLI**, **Cursor CLI**, **Antigravity CLI**, or custom executors. Follow progress, steer mid-turn, pause or take over at any moment, and receive deliverables backed by verification evidence.
|
|
12
17
|
|
|
13
|
-
|
|
18
|
+
**[Key Highlights](#key-highlights) · [How It Works](#how-it-works) · [Use Cases](#use-cases) · [Quick Start](#quick-start) · [Common Commands](#common-commands) · [Documentation](#documentation)**
|
|
14
19
|
|
|
15
|
-
|
|
20
|
+
---
|
|
16
21
|
|
|
17
|
-
|
|
22
|
+
## Key Highlights
|
|
18
23
|
|
|
19
|
-
|
|
24
|
+
### 🚀 1. Work Keeps Moving When You Walk Away: Task Lane & Scheduled Events
|
|
20
25
|
|
|
21
|
-
|
|
26
|
+
Traditional CLI coding agents stop the moment you close the terminal or end a chat. Pipiclaw decouples long-horizon engineering work from ephemeral conversations:
|
|
22
27
|
|
|
23
|
-
|
|
28
|
+
- **Background Task Lane**: Multi-step, multi-hour projects advance in a dedicated background task lane **without blocking your chat**. Each task is backed by a human-readable Markdown **task spec** (goal, Definition of Done checklist, **work items**) and an append-only JSONL **task log** (steps, delegations, settlements). Task states are derived deterministically by the runtime from observed facts — never stuck in a hallucinated "waiting" state.
|
|
29
|
+
- **Scheduled Events & Zero-Token Sensors**: Trigger `one-shot` reminders or `periodic` (Cron) workflows. Run local `preAction` gate scripts as **zero-token conditional sensors**, or spawn fresh, isolated task instances from event templates (e.g., daily repo inspections or weekly release digests) with automatic overlap protection.
|
|
30
|
+
- **Deterministic Budgets & Circuit Breakers**: Built-in step and USD budgets, idle-loop detection, per-step timeouts, and consecutive-error guards pause runaway work automatically and notify you.
|
|
24
31
|
|
|
25
|
-
###
|
|
32
|
+
### 🤝 2. One Workflow Orchestrating All Your Top Coding Agents
|
|
26
33
|
|
|
27
|
-
|
|
34
|
+
Stop copy-pasting context across multiple terminal tabs. Pipiclaw lets your main assistant act as the lead, dispatching work to the right executor based on capability, cost, and execution boundaries:
|
|
28
35
|
|
|
29
|
-
|
|
36
|
+
- **Built-in Sub-Agents (`internal`)**: Spin up isolated in-process agents in milliseconds under Pipiclaw's security guards for fast retrieval, log triage, and focused analysis.
|
|
37
|
+
- **Heavyweight External Harnesses (`external`)**: Launch real **Claude Code**, **Codex CLI**, **Cursor CLI**, **Antigravity CLI (`agy`)**, GLM wrapper scripts, or custom shell commands to tackle multi-file implementations, write and run tests, and iterate autonomously.
|
|
38
|
+
- **Async Wakeup, Session Continuation & Independent Verification**: External runs execute in the background (with records and managed artifacts retained for 30 days) and automatically wake the originating channel upon completion. You can ask follow-up questions on finished external sessions, or dispatch CLI-enforced read-only agents (such as `codex-review`) for independent verification (`purpose: verify`).
|
|
30
39
|
|
|
31
|
-
###
|
|
40
|
+
### 💬 3. Native in DingTalk + Terminal TUI + OpenAI-Compatible Web API
|
|
32
41
|
|
|
33
|
-
|
|
42
|
+
- **Zero Public IP DingTalk Setup**: Built on **DingTalk Stream Mode** — connect directly from your laptop or private server without hosting webhook relays or exposing public ports.
|
|
43
|
+
- **Live AI Card Streaming**: Watch thinking steps, tool calls, and stage updates stream live in DingTalk AI Cards. Send a message mid-turn to adjust direction on the fly (`/steer`), queue the next request (`/followup`), or abort immediately (`/stop`). Deliver generated reports, screenshots, and exports as **native DingTalk attachments**.
|
|
44
|
+
- **One Assistant, Every Surface**: A single daemon serves multiple DMs and group chats concurrently (parallel across channels, serialized within each channel). The terminal UI (`pipiclaw tui`) and your own scripts connect to the exact same assistant over a local Unix socket or TCP **Web API** compatible with the official **OpenAI SDK (implemented Responses API subset)**.
|
|
34
45
|
|
|
35
|
-
###
|
|
46
|
+
### 🧠 4. Remembers Conventions, Respects Boundaries: Layered Memory & Desks
|
|
36
47
|
|
|
37
|
-
|
|
48
|
+
- **Shared by Default, Isolated on Demand**: Your terminal, DingTalk DMs, and group chats bind to the `default` desk out of the box — sharing long-term memory, daily journals, tasks, and working files with zero setup. When you want to separate projects or contexts, create an isolated desk with `/desk new <name>`.
|
|
49
|
+
- **Three-Layer Transparent Memory (No Keyword Guessing)**:
|
|
50
|
+
- **Desk Memory (`memory/*.md`)**: One durable fact per file with an auto-generated `MEMORY.md` index injected in full at session start — the model sees all your conventions up front without fragile RAG keyword matching.
|
|
51
|
+
- **Daily Journal (`journal/YYYY-MM-DD.md`)**: Day-by-day working notes written by the background reflect pass, keeping temporary progress out of permanent rules.
|
|
52
|
+
- **Automatic Reflection & Probation**: Automatically consolidates memory before context compaction, on `/new`, on shutdown, or during idle windows. Newly inferred facts enter a 30-day **probation period** before promotion; `/memory forget` leaves a hash tombstone so background reflection never resurrects forgotten items. Idle checks pass through a local deterministic gate first — **burning zero tokens when idle**.
|
|
38
53
|
|
|
39
|
-
|
|
54
|
+
### 🛡️ 5. Autonomous Yet Instantly Interruptible: Deterministic Control Plane & Local Ownership
|
|
40
55
|
|
|
41
|
-
-
|
|
42
|
-
-
|
|
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
|
|
56
|
+
- **LLM-Free Control Plane**: `/help`, `/stop`, `/steer`, `/followup`, `/tasks`, `/subagents`, `/events`, `/desk`, `/status`, `/usage`, and `/context` are handled directly by the runtime. **Even if a model provider is down or a turn is stuck**, you can still inspect state, pause tasks, or kill external processes (`/subagents cancel`) immediately.
|
|
57
|
+
- **Your Config, Your Plain-Text Data**: Works with built-in providers, OpenAI-compatible gateways, API keys, and subscription logins (`pipiclaw auth login`). Every memory, task, role, event, and audit log lives as human-readable Markdown, JSON, or JSONL under `~/.pipiclaw/`, protected by command, path, and network guards.
|
|
46
58
|
|
|
47
|
-
|
|
59
|
+
---
|
|
48
60
|
|
|
49
|
-
##
|
|
61
|
+
## How It Works
|
|
50
62
|
|
|
51
|
-
|
|
63
|
+
```mermaid
|
|
64
|
+
flowchart LR
|
|
65
|
+
subgraph Entries["Entry Surfaces (Channels)"]
|
|
66
|
+
DT["📱 DingTalk DM / Group<br/>(Stream Mode + AI Card)"]
|
|
67
|
+
TUI["💻 Terminal UI<br/>(pipiclaw tui)"]
|
|
68
|
+
API["🔌 Scripts & Clients<br/>(OpenAI SDK / Web API)"]
|
|
69
|
+
end
|
|
52
70
|
|
|
53
|
-
|
|
71
|
+
subgraph Runtime["Pipiclaw Runtime (Daemon)"]
|
|
72
|
+
CP["⚡ Deterministic Control Plane<br/>(/stop /steer /tasks /subagents ...)"]
|
|
73
|
+
CR["🧭 Channel Runner & Session Host<br/>(Serial per channel · Parallel across channels)"]
|
|
74
|
+
TL["🛤️ Background Task Lane<br/>(Independent execution · Budget & timeout guards)"]
|
|
75
|
+
EV["⏰ Scheduled Events & Sensors<br/>(Cron / One-shot / preAction)"]
|
|
76
|
+
end
|
|
77
|
+
|
|
78
|
+
subgraph Desk["Desk Context (default / custom)"]
|
|
79
|
+
MEM["🧠 Layered Memory & Journal<br/>(memory/*.md · journal/)"]
|
|
80
|
+
TSK["📋 Task Specs & Logs<br/>(tasks/<id>.md · <id>.jsonl)"]
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
subgraph Executors["Executors & Guards"]
|
|
84
|
+
INT["🔍 Built-in Tools & Internal Sub-Agents<br/>(Command / Path / Network Guards)"]
|
|
85
|
+
EXT["🛠️ External Coding Agents<br/>Claude Code · Codex · Cursor · Antigravity"]
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
DT & TUI & API --> CP & CR
|
|
89
|
+
EV -->|Wake / Spawn task instance| CR & TL
|
|
90
|
+
CR <--> Desk
|
|
91
|
+
TL <--> Desk
|
|
92
|
+
CR & TL --> INT & EXT
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
### Core Concepts at a Glance
|
|
96
|
+
|
|
97
|
+
| Concept | What It Is | Problem It Solves |
|
|
98
|
+
|---|---|---|
|
|
99
|
+
| **Channel** | A DingTalk DM, DingTalk group, or Web API / TUI conversation | Keeps each conversation history separate while acting as your remote control to assign, inspect, and steer work |
|
|
100
|
+
| **Desk** | A named work context (`default` built-in, custom desks on demand) | Owns the long-term memory, daily journal, tasks, scheduled events, and working directory for a body of work |
|
|
101
|
+
| **Task** | A one-off project running in the background task lane (`.md` spec + `.jsonl` log) | Advances multi-step, multi-hour deliverables independently of chat and survives restarts |
|
|
102
|
+
| **Event** | A `one-shot` or `periodic` (Cron) trigger with optional `preAction` or task template | Answers *"when to wake up"* — driving reminders, zero-token checks, and recurring task instances |
|
|
103
|
+
| **Sub-Agent** | An in-process lightweight role (`internal`) or external CLI process (`external`) | Answers *"who executes this step"* — uniting your subscriptions and external coding CLIs under one workflow |
|
|
104
|
+
|
|
105
|
+
---
|
|
106
|
+
|
|
107
|
+
## Use Cases
|
|
108
|
+
|
|
109
|
+
- **📱 Mobile Engineering Workbench**: Assign *"migrate this module to the new interface and add unit tests"* from DingTalk on your commute; the background task breaks down work items, dispatches Claude Code / Codex to implement and run tests, runs an independent `codex-review` check on the diff, and delivers the summary with test evidence to your phone.
|
|
110
|
+
- **⏰ Low-Noise Scheduled Inspections & Reports**: Set up daily or weekly event templates that run a local `preAction` script first, spawning a background task to investigate and deliver a DingTalk report only when new commits or anomalies appear.
|
|
111
|
+
- **🔀 Multi-Model & Multi-Agent Compute Routing**: Use fast or cost-effective models for everyday chat, route tough architectural trade-offs and root-cause debugging to `claude-high` / `codex-high` / `cursor-high`, batch mechanical edits with `codex-flash` / `glm-flash`, and leverage `agy-main` for long-context collaboration.
|
|
112
|
+
- **🤝 Multi-Surface Personal & Small-Team Collaboration**: Keep separate conversations across DMs and group chats while sharing one body of project memory by default — or split contexts cleanly with desks when needed.
|
|
113
|
+
- **🔌 Scriptable Personal Assistant via Official OpenAI SDK**: Enable the Web API and connect CI hooks, local scripts, or custom frontends to your assistant in a few lines of Python or JS.
|
|
114
|
+
|
|
115
|
+
> [!NOTE]
|
|
116
|
+
> **Scope & Security Boundaries**: Pipiclaw is designed for individual developers (and small-scale shared use of a single assistant) in self-hosted, single-instance deployments. It is not a hard multi-tenant SaaS platform and does not provide an OS-level sandbox. **External agents bypass Pipiclaw's built-in command and path guards** — their real permissions are governed by the target CLI's sandbox flags, the host user account, and the operating environment.
|
|
117
|
+
|
|
118
|
+
---
|
|
119
|
+
|
|
120
|
+
## Quick Start
|
|
121
|
+
|
|
122
|
+
Follow the steps below to go from **installation → 30-second terminal verification → DingTalk connection → external coding agent delegation**. Jump straight to any section if you already know what you need.
|
|
123
|
+
|
|
124
|
+
<details>
|
|
125
|
+
<summary>💡 <b>Shortcut: Let your favorite local AI Agent (Claude Code / Codex / Cursor) install and configure Pipiclaw for you</b></summary>
|
|
126
|
+
|
|
127
|
+
Copy and paste the prompt below into your local AI coding agent:
|
|
128
|
+
|
|
129
|
+
```text
|
|
130
|
+
Please install and initialize Pipiclaw for me:
|
|
131
|
+
|
|
132
|
+
1. Check Node.js >= 22.19.0; stop and explain if it is not met.
|
|
133
|
+
2. Run npm install -g @oyasmi/pipiclaw; on a permission failure do not sudo on your own.
|
|
134
|
+
3. Run pipiclaw once to initialize ~/.pipiclaw/; it prompting you to complete channel.json and exiting because it is still a template is normal.
|
|
135
|
+
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.
|
|
136
|
+
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.
|
|
137
|
+
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.
|
|
138
|
+
7. Honestly list the operations performed, files changed, verification results, and information still missing; do not pretend it succeeded.
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
</details>
|
|
142
|
+
|
|
143
|
+
### 1. Prerequisites & Installation
|
|
144
|
+
|
|
145
|
+
- **Node.js**: `>= 22.19.0`
|
|
146
|
+
- **OS**: Linux / macOS (on Windows, use WSL2)
|
|
54
147
|
|
|
55
148
|
```bash
|
|
56
149
|
npm install -g @oyasmi/pipiclaw
|
|
57
150
|
pipiclaw tui --help
|
|
58
151
|
```
|
|
59
152
|
|
|
60
|
-
The first real
|
|
153
|
+
The first real launch of `pipiclaw` or `pipiclaw tui` scaffolds `~/.pipiclaw/` (set `PIPICLAW_HOME=/your/path` to relocate the entire directory):
|
|
61
154
|
|
|
62
155
|
```text
|
|
63
156
|
~/.pipiclaw/
|
|
64
|
-
├── channel.json # Channel switches: DingTalk app, Web API
|
|
65
|
-
├── auth.json #
|
|
66
|
-
├── models.json #
|
|
67
|
-
├── settings.json #
|
|
68
|
-
├── tools.json #
|
|
69
|
-
├── security.json #
|
|
70
|
-
└── workspace/ #
|
|
157
|
+
├── channel.json # Channel switches & config: DingTalk app (dingtalk), Web API (webapi)
|
|
158
|
+
├── auth.json # Model credentials & login state
|
|
159
|
+
├── models.json # Custom model providers & gateways
|
|
160
|
+
├── settings.json # Default model & runtime settings
|
|
161
|
+
├── tools.json # Capability switches for web search/fetch, tasks, etc.
|
|
162
|
+
├── security.json # Command, path, and network guard policies
|
|
163
|
+
└── workspace/ # Shared rules (AGENTS.md / SOUL.md), skills/, sub-agents/, and desk-default/
|
|
71
164
|
```
|
|
72
165
|
|
|
73
|
-
|
|
166
|
+
### 2. Fastest Taste: Run in the Terminal in 30 Seconds
|
|
74
167
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
Terminal mode needs no DingTalk credentials, only a working model. Pick either way:
|
|
168
|
+
Terminal mode requires no DingTalk credentials — just a working model. Configure credentials using either option:
|
|
78
169
|
|
|
79
170
|
```bash
|
|
80
|
-
# Option A:
|
|
171
|
+
# Option A: Provide an API key via environment variable
|
|
81
172
|
export ANTHROPIC_API_KEY=sk-ant-...
|
|
82
173
|
|
|
83
|
-
# Option B:
|
|
174
|
+
# Option B: Log in to a subscription provider supported by the SDK
|
|
84
175
|
pipiclaw auth login
|
|
85
176
|
```
|
|
86
177
|
|
|
87
|
-
|
|
178
|
+
Launch the interactive terminal UI (initializes the `default` desk automatically on first run):
|
|
88
179
|
|
|
89
180
|
```bash
|
|
90
181
|
pipiclaw tui
|
|
91
182
|
```
|
|
92
183
|
|
|
93
|
-
|
|
184
|
+
Or run a one-shot non-interactive verification:
|
|
94
185
|
|
|
95
186
|
```bash
|
|
96
187
|
pipiclaw tui --print "Reply with only: Pipiclaw model call succeeded"
|
|
97
188
|
```
|
|
98
189
|
|
|
99
|
-
|
|
190
|
+
> Receiving an actual model reply confirms the full request pipeline is working (`--help` and `/model` only verify CLI or catalog visibility). To configure an enterprise gateway, local model, or default model, see the [Configuration Reference](https://github.com/oyasmi/pipiclaw/blob/main/docs/configuration.md).
|
|
100
191
|
|
|
101
|
-
### 3. Connect DingTalk
|
|
192
|
+
### 3. Connect DingTalk (No Public IP Required)
|
|
102
193
|
|
|
103
|
-
Create an enterprise internal
|
|
194
|
+
Create an enterprise internal application on the [DingTalk Open Platform](https://open-dev.dingtalk.com/):
|
|
104
195
|
|
|
105
|
-
1.
|
|
106
|
-
2. Enable the
|
|
107
|
-
3.
|
|
108
|
-
4. Recommended
|
|
196
|
+
1. Copy the **`Client ID`** and **`Client Secret`**
|
|
197
|
+
2. Enable the **Bot** capability
|
|
198
|
+
3. Select **Stream Mode** for message receiving
|
|
199
|
+
4. *(Recommended)* Create an AI Card template and copy its **`Card Template ID`** for live streaming updates
|
|
109
200
|
|
|
110
|
-
Edit `~/.pipiclaw/channel.json
|
|
201
|
+
Edit `~/.pipiclaw/channel.json` (make sure no `your-*` placeholder values remain):
|
|
111
202
|
|
|
112
203
|
```json
|
|
113
204
|
{
|
|
@@ -124,131 +215,134 @@ Edit `~/.pipiclaw/channel.json`:
|
|
|
124
215
|
}
|
|
125
216
|
```
|
|
126
217
|
|
|
127
|
-
-
|
|
128
|
-
-
|
|
129
|
-
-
|
|
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.
|
|
218
|
+
- **Required fields**: Only `clientId` and `clientSecret` are strictly required. `robotCode` falls back to `clientId` when empty; `cardTemplateId` can be left blank initially (AI Card is strongly recommended for daily use).
|
|
219
|
+
- **Access control**: `allowFrom: []` allows all senders; populate tester staff IDs during a staged rollout.
|
|
220
|
+
- **Web API**: Set `webapi.enabled` to `true` if you also want scripts or other clients to connect via the official OpenAI SDK (see [Web API](https://github.com/oyasmi/pipiclaw/blob/main/docs/webapi.md)).
|
|
133
221
|
|
|
134
|
-
Start the daemon:
|
|
222
|
+
Start the background daemon:
|
|
135
223
|
|
|
136
224
|
```bash
|
|
137
225
|
pipiclaw
|
|
138
226
|
```
|
|
139
227
|
|
|
140
|
-
|
|
228
|
+
Open DingTalk and **DM the bot** or **@mention it in a group** — no manual desk creation or binding is needed. Send `/model` to check the active model, then send a message to verify a live turn:
|
|
141
229
|
|
|
142
230
|
```text
|
|
143
231
|
Please introduce yourself and explain what you can do right now
|
|
144
232
|
```
|
|
145
233
|
|
|
146
|
-
If
|
|
234
|
+
*(If your first message does not go through, check [Deployment and Operations](https://github.com/oyasmi/pipiclaw/blob/main/docs/deployment-and-operations.md).)*
|
|
235
|
+
|
|
236
|
+
### 4. Enable External Agent Delegation (Claude / Codex / Cursor / Antigravity)
|
|
147
237
|
|
|
148
|
-
|
|
238
|
+
Install and log in to your target CLIs (`claude`, `codex`, Cursor's `agent`, or Antigravity's `agy`) under the same OS user account that runs Pipiclaw.
|
|
149
239
|
|
|
150
|
-
|
|
240
|
+
The package ships curated capability entries organized by executor, capability tier (`flash` / `main` / `high`), and read-only review (`codex-review`). Copy the entries you actually have accounts for into your workspace:
|
|
151
241
|
|
|
152
242
|
```bash
|
|
153
243
|
mkdir -p ~/.pipiclaw/workspace/sub-agents
|
|
154
244
|
PIPICLAW_PACKAGE_DIR="$(npm root -g)/@oyasmi/pipiclaw"
|
|
155
|
-
|
|
245
|
+
|
|
246
|
+
# Example: enable Claude Code and Codex main entries plus read-only independent review
|
|
247
|
+
cp "$PIPICLAW_PACKAGE_DIR"/examples/sub-agents/agents/{claude-main,codex-main,codex-review}.md \
|
|
156
248
|
~/.pipiclaw/workspace/sub-agents/
|
|
157
249
|
```
|
|
158
250
|
|
|
159
|
-
|
|
251
|
+
*(Entries for `cursor-main`, `cursor-high`, `agy-main`, `glm-high`, `glm-flash`, etc. are also included; see [Sub-Agent Examples](./examples/sub-agents/README.md).)*
|
|
160
252
|
|
|
161
|
-
|
|
162
|
-
/subagents roles
|
|
163
|
-
```
|
|
164
|
-
|
|
165
|
-
Once the entries show as available, describe the goal and acceptance criteria and let the main agent select an executor:
|
|
253
|
+
Role changes are discovered dynamically without restarting the daemon. Send:
|
|
166
254
|
|
|
167
255
|
```text
|
|
168
|
-
|
|
256
|
+
/subagents roles
|
|
169
257
|
```
|
|
170
258
|
|
|
171
|
-
|
|
259
|
+
Once the entries appear as available, describe your goal and acceptance criteria in plain language — the main agent will select the appropriate executor:
|
|
172
260
|
|
|
173
261
|
```text
|
|
174
|
-
|
|
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
|
|
262
|
+
Please hand this cross-module implementation to a suitable executor, then independently verify the final diff and send me the conclusion with evidence.
|
|
179
263
|
```
|
|
180
264
|
|
|
181
|
-
|
|
265
|
+
> [!IMPORTANT]
|
|
266
|
+
> External agents do not pass through Pipiclaw's built-in command and path guards, and the recommended write entries use permissive CLI flags. Read the authorization and sandbox guidance in the [Agent Delegation Guide](https://github.com/oyasmi/pipiclaw/blob/main/docs/sub-agents.md) before enabling them, and run long external delegations under the persistent `pipiclaw` daemon.
|
|
182
267
|
|
|
183
|
-
|
|
268
|
+
### 5. Optional: Enable Web Search & Fetch Tools
|
|
184
269
|
|
|
185
|
-
|
|
270
|
+
`web_search` and `web_fetch` are disabled by default. Edit `~/.pipiclaw/tools.json` and set `tools.web.enable: true` (supports DuckDuckGo, Tavily, Jina, and SearXNG; DuckDuckGo works out of the box without an API key). See [Configuration Reference](https://github.com/oyasmi/pipiclaw/blob/main/docs/configuration.md) for all fields.
|
|
186
271
|
|
|
187
|
-
|
|
272
|
+
---
|
|
188
273
|
|
|
189
|
-
|
|
190
|
-
<summary>Let your favorite AI agent install it for you</summary>
|
|
274
|
+
## Common Commands
|
|
191
275
|
|
|
192
|
-
|
|
276
|
+
Slash commands are split into **runtime-handled commands (work mid-turn and bypass the LLM)** and **session commands**:
|
|
193
277
|
|
|
194
|
-
|
|
195
|
-
Please install and initialize Pipiclaw for me:
|
|
278
|
+
### Available Anytime (Handled directly by the runtime — works even when busy or stuck)
|
|
196
279
|
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
280
|
+
| Command | Purpose |
|
|
281
|
+
|---|---|
|
|
282
|
+
| `/help [command]` | Show the top-level command list, or detailed subcommands and examples for a command (e.g. `/help tasks`) |
|
|
283
|
+
| `/status` | Inspect runtime status, active model, context usage, uptime, version, and desk task summary |
|
|
284
|
+
| `/stop` | Abort the current chat turn and clear queued messages (use `/tasks pause` for tasks, `/subagents cancel` for delegations) |
|
|
285
|
+
| `/steer <message>` | Steer the running turn after the current tool call finishes (default behavior for plain messages sent while busy) |
|
|
286
|
+
| `/followup <message>` | Queue a request to run after the current turn finishes |
|
|
287
|
+
| `/tasks [show\|log\|msg\|pause\|resume\|cancel\|archive\|doctor]` | Inspect, message (`msg`), pause, resume, or cancel background long-horizon tasks |
|
|
288
|
+
| `/subagents [list\|show\|output\|cancel\|roles]` | Inspect running/recent delegations, view outputs, browse roles, or terminate directly (`cancel`) |
|
|
289
|
+
| `/events <list\|show\|delete\|history>` | List, inspect, or delete scheduled events and view trigger history |
|
|
290
|
+
| `/desk [list\|new <name>\|bind <name>]` | View desk bindings, create a new desk, or bind the current channel to another desk |
|
|
291
|
+
| `/usage [7d\|month]` | View token usage and cost breakdown for the current desk and globally |
|
|
292
|
+
| `/context [detail]` | Inspect what is actually sent to the model: system prompt sections, tool definitions, and last-turn context |
|
|
293
|
+
| `/skills [list\|show <name>]` | List workspace and user-shared skills or view a specific skill |
|
|
294
|
+
| `/new` | Start a fresh conversation session |
|
|
295
|
+
|
|
296
|
+
### Available When Idle (Requires the current turn to finish)
|
|
209
297
|
|
|
210
298
|
| Command | Purpose |
|
|
211
299
|
|---|---|
|
|
212
|
-
| `/
|
|
213
|
-
| `/
|
|
214
|
-
| `/
|
|
215
|
-
| `/
|
|
216
|
-
| `/
|
|
217
|
-
| `/
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
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.
|
|
300
|
+
| `/memory [status\|list\|show\|forget\|journal]` | Inspect desk memories, probation items, daily journals, or delete and block a memory (`forget`) |
|
|
301
|
+
| `/model [provider/modelId\|modelId]` | View or switch the active model by exact ID or unique substring |
|
|
302
|
+
| `/thinking [off\|minimal\|low\|medium\|high\|xhigh\|max\|cycle]` | View or change the active model's reasoning effort level |
|
|
303
|
+
| `/compact [instructions]` | Manually compact the current session context with optional retention instructions |
|
|
304
|
+
| `/session` | Display message stats, token usage, and model info for the active session |
|
|
305
|
+
| `/reload` | Reload skills, tools, and resources while preserving conversation history |
|
|
306
|
+
|
|
307
|
+
See [Interaction and Commands](https://github.com/oyasmi/pipiclaw/blob/main/docs/interaction-and-commands.md) for full details.
|
|
308
|
+
|
|
309
|
+
---
|
|
227
310
|
|
|
228
311
|
## Documentation
|
|
229
312
|
|
|
230
|
-
The
|
|
313
|
+
The complete documentation index is at **[docs/README.md](https://github.com/oyasmi/pipiclaw/blob/main/docs/README.md)**. Jump straight to what you need:
|
|
231
314
|
|
|
232
|
-
| I want to
|
|
315
|
+
| I want to... | Guide |
|
|
233
316
|
|---|---|
|
|
234
|
-
|
|
|
235
|
-
| Claude Code / Codex /
|
|
236
|
-
|
|
|
237
|
-
|
|
|
238
|
-
|
|
|
239
|
-
|
|
|
240
|
-
|
|
|
317
|
+
| 💬 Understand DMs, groups, AI Cards, busy-time messages, and slash commands | [Interaction and Commands](https://github.com/oyasmi/pipiclaw/blob/main/docs/interaction-and-commands.md) |
|
|
318
|
+
| 🤝 Delegate to Claude Code / Codex / Cursor / Antigravity and author roles | [Agent Delegation](https://github.com/oyasmi/pipiclaw/blob/main/docs/sub-agents.md) · [Role Examples](./examples/sub-agents/README.md) |
|
|
319
|
+
| 📋 Use the background task lane, scheduled events, Cron templates, and budgets | [Events and Tasks](https://github.com/oyasmi/pipiclaw/blob/main/docs/events-and-tasks.md) |
|
|
320
|
+
| 🧠 Understand layered memory, daily journals, probation, and forgetting | [Memory](https://github.com/oyasmi/pipiclaw/blob/main/docs/memory.md) |
|
|
321
|
+
| ⚙️ Configure models, gateways, proxies, web tools, and workspace files | [Configuration Guide](https://github.com/oyasmi/pipiclaw/blob/main/docs/configuration.md) · [Field Reference](https://github.com/oyasmi/pipiclaw/blob/main/docs/configuration-reference.md) |
|
|
322
|
+
| 🔌 Connect scripts or custom clients via the official OpenAI SDK | [Web API](https://github.com/oyasmi/pipiclaw/blob/main/docs/webapi.md) |
|
|
323
|
+
| 🧩 Package reusable personal or project workflows as Skills | [Skills Guide](https://github.com/oyasmi/pipiclaw/blob/main/docs/skills.md) |
|
|
324
|
+
| 💡 Get higher leverage and end-to-end delivery from your setup | [Leverage Notes](https://github.com/oyasmi/pipiclaw/blob/main/docs/leverage/README.md) · [Design Philosophy](https://github.com/oyasmi/pipiclaw/blob/main/docs/design-philosophy.md) |
|
|
325
|
+
| 🛡️ Review default security guards, path/command rules, and external CLI boundaries | [Security Guide](https://github.com/oyasmi/pipiclaw/blob/main/docs/security.md) |
|
|
326
|
+
| 🚀 Deploy the daemon, upgrade, back up, and understand concurrency limits | [Deployment and Operations](https://github.com/oyasmi/pipiclaw/blob/main/docs/deployment-and-operations.md) · [Scaling and Concurrency](https://github.com/oyasmi/pipiclaw/blob/main/docs/scaling-and-concurrency.md) |
|
|
327
|
+
| 🏗️ Explore the module layering, runtime topology, and internals | [Architecture](https://github.com/oyasmi/pipiclaw/blob/main/docs/architecture.md) · [Runtime Mechanisms](https://github.com/oyasmi/pipiclaw/blob/main/docs/runtime-mechanisms.md) |
|
|
328
|
+
|
|
329
|
+
---
|
|
241
330
|
|
|
242
331
|
## Development
|
|
243
332
|
|
|
244
333
|
```bash
|
|
245
334
|
npm install
|
|
246
335
|
npm run build
|
|
247
|
-
npm run check
|
|
336
|
+
npm run check # lint + typecheck + arch + deadcode + unit test
|
|
248
337
|
```
|
|
249
338
|
|
|
250
|
-
|
|
339
|
+
- **Minimum verification**: `npm run typecheck` and `npm run test`
|
|
340
|
+
- **Architecture & dependency boundaries**: `npm run arch`
|
|
341
|
+
- **Deterministic full-stack E2E (offline, zero API cost)**: `npm run test:e2e`
|
|
342
|
+
- **Live model smoke suite**: `npm run test:e2e:live`
|
|
343
|
+
|
|
344
|
+
---
|
|
251
345
|
|
|
252
346
|
## License
|
|
253
347
|
|
|
254
|
-
GNU Affero General Public License v3.0.
|
|
348
|
+
Licensed under the [GNU Affero General Public License v3.0 (AGPL-3.0)](./LICENSE).
|