pi-messenger 0.10.0 → 0.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +86 -0
- package/README.md +102 -16
- package/config.ts +6 -0
- package/crew/agents/crew-plan-sync.md +1 -1
- package/crew/agents/crew-planner.md +18 -2
- package/crew/agents/crew-reviewer.md +1 -1
- package/crew/agents/crew-worker.md +23 -1
- package/crew/agents.ts +220 -44
- package/crew/handlers/coordination.ts +275 -0
- package/crew/handlers/plan.ts +328 -42
- package/crew/handlers/review.ts +18 -13
- package/crew/handlers/revise.ts +374 -0
- package/crew/handlers/status.ts +91 -57
- package/crew/handlers/sync.ts +6 -6
- package/crew/handlers/task.ts +214 -92
- package/crew/handlers/work.ts +171 -132
- package/crew/index.ts +26 -49
- package/crew/live-progress.ts +58 -0
- package/crew/lobby.ts +470 -0
- package/crew/prompt.ts +112 -0
- package/crew/registry.ts +114 -0
- package/crew/spawn.ts +103 -0
- package/crew/state-autonomous.ts +134 -0
- package/crew/state-planning.ts +263 -0
- package/crew/state.ts +14 -82
- package/crew/store.ts +154 -21
- package/crew/task-actions.ts +123 -0
- package/crew/types.ts +17 -2
- package/crew/utils/config.ts +66 -14
- package/crew/utils/discover.ts +26 -65
- package/crew/utils/install.ts +39 -333
- package/crew/utils/progress.ts +18 -5
- package/feed.ts +88 -23
- package/handlers.ts +66 -34
- package/index.ts +350 -160
- package/install.mjs +14 -63
- package/overlay-actions.ts +511 -0
- package/overlay-render.ts +650 -0
- package/overlay.ts +614 -537
- package/package.json +11 -4
- package/skills/pi-messenger-crew/SKILL.md +194 -24
- package/store.ts +17 -8
- package/vitest.config.ts +10 -0
- package/ARCHITECTURE.md +0 -220
- package/crew/agents/crew-interview-generator.md +0 -79
- package/crew/handlers/interview.ts +0 -211
- package/crew-overlay.ts +0 -233
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,91 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.12.0] - 2026-02-21
|
|
4
|
+
|
|
5
|
+
### Added
|
|
6
|
+
- **Thinking level support** - Agents support `thinking: <level>` in frontmatter (off, minimal, low, medium, high, xhigh). Config `thinking.<role>` overrides per-agent frontmatter. Applied via `--thinking` flag to spawned processes.
|
|
7
|
+
- **Advisory dependencies** - Dependencies are now informational context, not scheduling blockers. All `todo` tasks are eligible for assignment regardless of dependency status. Workers see dependency completion state (done/in-progress/not started) in their prompt and coordinate via reservations and DMs. Configurable via `dependencies` config (`"advisory"` default, `"strict"` for blocking mode). Transitive dependencies pruned from plans automatically.
|
|
8
|
+
- **Auto-work on plan completion** - Planning automatically starts autonomous work when tasks are created (default behavior). Pass `autoWork: false` to review the plan first. A steer message triggers the LLM to call `work { autonomous: true }` on its next turn.
|
|
9
|
+
- **Continuous worker refill** - Overlay automatically spawns replacement workers when tasks complete, maintaining concurrency up to the configured limit throughout execution.
|
|
10
|
+
- **Prompt-based planning** - `plan` action accepts an inline `prompt` parameter as the spec when no PRD file is available. The planner breaks down arbitrary requests into parallel tasks the same way it handles PRD files.
|
|
11
|
+
- **Live feed with flash notifications** - Feed tracks last-seen timestamp and highlights new events. Significant events (task completions, messages, plan changes) trigger flash notifications in the status bar.
|
|
12
|
+
- **Task revision** - `[p]` revises a single task's spec via the planner. `[P]` revises an entire subtree (target + transitive dependents), preserving done tasks and resetting revisable ones to `todo`. Re-plan with steering prompt injects user guidance into the planning-progress.md Notes section.
|
|
13
|
+
- **Chat UX redesign** - Global `[m]` key activates chat input from any overlay state (vim-style command mode). Plain text broadcasts to all peers; `@name message` sends DMs. Tab autocompletes agent names after `@` (Shift+Tab cycles backwards). Feed gets 60/40 space allocation when workers active. `[f]` toggles feed-focus mode (tasks compress to 2-line summary). Visual improvements: system events dimmed, colored agent names, separator dots between groups.
|
|
14
|
+
- **Auto-dismiss on completion** - Overlay auto-closes with snapshot handover 3 seconds after all tasks complete. Only triggers when the overlay witnessed tasks in progress. Any keypress cancels.
|
|
15
|
+
- **Worker coordination & chatter** - Workers receive environmental context (concurrent tasks, dependency summaries, recent feed, ready tasks) and coordination instructions. Four configurable levels (`none`|`minimal`|`moderate`|`chatty`, default: `chatty`) control verbosity. At `chatty`, workers DM peers and broadcast announcements, creating a chat-room effect in the overlay. New `coordination` config field.
|
|
16
|
+
- **Lobby workers** - `+` spawns workers: assigns ready tasks directly when available, otherwise pre-spawns idle lobby workers that join the mesh and chat. Lobby workers receive task assignments via steer message when tasks become available. Token budgets per coordination level cap spending while idle.
|
|
17
|
+
- **Auto-spawn on plan completion** - Workers auto-spawn when planning finishes and ready tasks exist. Lobby workers assigned first, then fresh workers up to concurrency limit.
|
|
18
|
+
- **TUI coordination level control** - `[v]` cycles coordination level at runtime (`chatty` → `none` → `minimal` → `moderate`).
|
|
19
|
+
- **Configurable `concurrency.max`** - Crew config field (default: 10) lets the user lower the worker ceiling. `+`/`-` keys respect the configured max.
|
|
20
|
+
- **Stuck task UX** - `[q]` Stop works on any `in_progress` task, not just those with live workers. `[s]` Start rejects when the agent is already busy. Detail view shows "Worker not running" warning for orphaned tasks.
|
|
21
|
+
- **Chatter mitigation** - Per-worker outgoing message rate limiting via `messageBudgets` config. Coordination level and per-worker token count displayed in overlay header.
|
|
22
|
+
- **Broadcast filtering** - Worker broadcasts now go to the feed only (no inbox delivery, no LLM turn interrupts). Eliminates O(N^2) token cascades between workers. DMs, user broadcasts, and planner broadcasts still deliver to inboxes in real-time. Detection via `PI_CREW_WORKER` env var set at spawn time. Worker name consistency also fixed in `agents.ts` via `PI_AGENT_NAME`.
|
|
23
|
+
- **Worker exit feed notifications** - Lobby workers that exit without a task assignment now appear as `leave` events in the feed.
|
|
24
|
+
- **2026-02-12 Overlay redesign** - Replaced tabbed `/messenger` UI with a unified crew dashboard layout (status, workers, tasks, feed, agents row, legend), added `Ctrl+T` snapshot transfer, `Ctrl+B` background/reattach support, empty-state system diagnostics, and inline `@all` / `@name` messaging in the overlay input flow.
|
|
25
|
+
- **Task progress system** - Added per-task append-only progress logs (`tasks/task-N.progress.md`) with `task.progress`, system auto-entries (assignment, review verdicts, shutdown resets, crash/failure outcomes), and retry-context injection in worker prompts.
|
|
26
|
+
- **Interactive Crew task manager** - Crew overlay now supports list/detail modes, task actions (reset/cascade-reset/unblock/start/block/delete), in-overlay confirmations, block-reason input, live worker messaging, context-aware key hints, and transient success/failure notifications.
|
|
27
|
+
- **Live worker concurrency adjustment** - In the Crew overlay, `+`/`-` now adjusts worker concurrency live during execution (clamped to 1-10).
|
|
28
|
+
- **Auto-open overlay on autonomous work** - The Crew overlay now opens automatically when autonomous mode starts, showing live worker progress without requiring `/messenger`. Configurable via `autoOverlay` (default: `true`). Escape dismisses; won't reopen until a new autonomous session.
|
|
29
|
+
- **Auto-open overlay on planning work** - The Crew overlay now opens automatically when planning starts and when an in-progress planning run is restored on session start/switch/fork/tree. Configurable via `autoOverlayPlanning` (default: `true`). Uses per-run planning IDs to avoid reopen loops within the same run after dismissal.
|
|
30
|
+
- **Task splitting** - New `task.split` action supports an inspect phase (returns spec/progress/deps/dependents) and an execute phase that creates subtasks, rewires downstream dependencies, converts the parent to a milestone, and auto-completes milestones when all subtasks are done. Milestones can't be started manually and are never dispatched to workers.
|
|
31
|
+
- **Planning observability state** - Added first-class planning run state with pass/phase tracking and persistence at `.pi/messenger/crew/planning-state.json`. Status, Crew UI, and feed now expose planning progress (`plan.start`, `plan.pass.*`, `plan.review.*`, `plan.done`, `plan.failed`) so long planning runs are visible by default. Planning runs with no updates for 5 minutes are flagged as stalled in status and Crew UI, with periodic refresh so stalls surface without requiring user interaction.
|
|
32
|
+
- **Planning cwd normalization** - Planning state now canonicalizes project paths (realpath) and compares by canonical path, fixing false negatives when sessions use `/tmp/...` while persisted state resolves to `/private/tmp/...`.
|
|
33
|
+
- **Structured planning outline** - Planner prompts now require ordered sections (PRD understanding, reviewed resources, sequential steps, parallel task graph). Latest structured output is persisted to `.pi/messenger/crew/planning-outline.md` for audit/review.
|
|
34
|
+
|
|
35
|
+
- **Lobby worker keep-alive** - Lobby workers now survive the full planning phase via a file-based keep-alive signal. The orchestrator creates a `.alive` file per lobby worker; the worker's `turn_end` hook checks the file and injects a minimal steer message to prevent the session from exiting. File is deleted on task assignment, planning completion, or shutdown. ~25 tokens per keep-alive cycle.
|
|
36
|
+
- **`prompt` tool parameter** - The `prompt` parameter (used by `plan` and `task.revise`/`task.revise-tree`) is now declared in the tool schema so LLMs can discover it without the skill loaded.
|
|
37
|
+
- **Dynamic overlay width** - Overlay adapts to terminal width (clamped 40-100) instead of a fixed size. Fits half-width and quarter-width windows on smaller screens.
|
|
38
|
+
- **Live coordination level display** - Status bar hints now show the actual coordination level (`v:chatty`, `v:none`, etc.) instead of the opaque `v:Coord` label.
|
|
39
|
+
|
|
40
|
+
### Changed
|
|
41
|
+
- **Default `planning.maxPasses` reduced to 1** - Single-pass planning is now the default. Multi-pass planning with reviewer feedback is still available by setting `planning.maxPasses` in user or project config.
|
|
42
|
+
- **Structural cleanup** - Extracted `crew/prompt.ts` (worker prompt builder), `crew/spawn.ts` (shared spawn logic), `crew/registry.ts` (unified worker registry replacing separate maps in agents.ts and lobby.ts). Split `crew/state.ts` into `state-autonomous.ts` and `state-planning.ts` with a barrel re-export.
|
|
43
|
+
- **Crew agent locality** - Crew agents are now discovered from extension-local `crew/agents/` plus project overrides in `.pi/messenger/crew/agents/`. Removed auto-install/update copy machinery and converted `crew.install` / `--crew-install` to informational commands.
|
|
44
|
+
|
|
45
|
+
### Removed
|
|
46
|
+
- **Legacy key-based routing** - Removed the `join`, `claim`, `unclaim`, `complete`, `swarm`, `list`, `rename`, `reserve`, `release`, and `broadcast` tool parameters and the legacy routing block in `index.ts` that duplicated `crew/index.ts` action-based routing. All callers should use `action`-based syntax (e.g., `{ action: "join" }` instead of `{ join: true }`).
|
|
47
|
+
- **Interview handler** - Removed `crew/handlers/interview.ts`, `crew-interview-generator.md` agent, and the `interview` action. The feature spawned an LLM to generate questions for the user but never worked (got stuck). Agent moved to deprecated list for cleanup on existing installs.
|
|
48
|
+
|
|
49
|
+
### Fixed
|
|
50
|
+
- **Overlay rendering corruption from multi-line bash args** - `extractArgsPreview` returned raw bash `command` strings containing newlines (comments, `&&` chains, heredocs). These embedded newlines broke overlay rows, cascading layout corruption through the workers section, task list, and feed. Newlines are now collapsed to spaces at the extraction point.
|
|
51
|
+
- **Fire-and-forget dynamic import in `task-actions.ts`** - `killWorkerByTask` was imported via `import("./registry.js").then(...)` which swallowed errors silently. Replaced with a static import since no circular dependency exists.
|
|
52
|
+
- **Stale legacy syntax in user-facing strings** - Five handler/index strings still referenced removed `{ join: true }` / `{ list: true }` / `{ to: "..." }` syntax. Updated to action-based equivalents.
|
|
53
|
+
- **SIGKILL escalation never fired** - After `proc.kill("SIGTERM")`, Node.js immediately sets `proc.killed = true`. Both `killWorkerByTask` and `runAgent` graceful shutdown checked `!proc.killed` before escalating to SIGKILL, which was always false. Workers ignoring SIGTERM could hang indefinitely. Now checks only `exitCode === null`.
|
|
54
|
+
- **Lobby worker assignment zombie state** - State was mutated before the disk write, so a failed write left the worker permanently marked as assigned but invisible to future assignment. Reordered to write first, mutate on success.
|
|
55
|
+
- **Lobby assignment race in work handler** - If a lobby worker exited between availability check and assignment, the task got stuck as `in_progress` with no worker. Added return value check with rollback.
|
|
56
|
+
- **Autonomous state checks not cwd-scoped** - Auto-dismiss, snapshot generation, and revision guards used a global flag instead of per-project checks, blocking operations for unrelated projects.
|
|
57
|
+
- **Task flicker from lobby worker spawn** - Orchestrator and worker generated independent random names so `assigned_to` never matched. Task was also pre-set to `in_progress` but the worker expected `todo`. Fixed name propagation via env var, made `task.start` idempotent for the assigned agent, and added ownership guards in close handlers.
|
|
58
|
+
- **`[q]` Stop couldn't kill lobby-spawned workers** - Stop only checked one worker registry. Lobby workers are tracked separately and now have their own kill path.
|
|
59
|
+
- **Double-formatted message previews** - Overlay stored pre-formatted previews that the display layer formatted again. Now stores raw text; preview limit raised from 60 to 200 chars.
|
|
60
|
+
- **Stale workersHeight in trim loop** - Worker-line overflow trimming used a pre-computed height, causing over-trim to 0 workers on small terminals.
|
|
61
|
+
- **Artifact I/O crash** - Uncaught exceptions in child process event handlers crashed pi. Wrapped all artifact writes with try/catch.
|
|
62
|
+
- **Input field scrolling** - Text was clipped at the field edge instead of scrolling to keep the cursor visible.
|
|
63
|
+
- **Session shutdown orphans** - Workers now killed at the top of session shutdown, preventing orphan processes.
|
|
64
|
+
- **Task list blank line padding** - Task list no longer pads with empty lines. Surplus space goes to the feed.
|
|
65
|
+
- **`getLobbyWorkerCount` counted dead workers** - Registry function didn't filter exited processes, inflating the "N in lobby" status bar count.
|
|
66
|
+
- **`models.analyst` config was dead** - Config type and docs existed but `interview.ts` and `sync.ts` never read it. Now wired to both analyst handler call sites.
|
|
67
|
+
|
|
68
|
+
## [0.11.0] - 2026-02-08
|
|
69
|
+
|
|
70
|
+
### Added
|
|
71
|
+
- **Test suite** — 53 tests across 7 Vitest suites covering store CRUD, state machine, config merging, agent discovery, model resolution, graceful shutdown, and live progress (including cwd isolation). Includes test helpers for temp directories and mock contexts.
|
|
72
|
+
- **Per-agent runtime config** — Model override with 4-level priority: per-task > per-wave `model` param > config `crew.models.worker` > agent `.md` frontmatter. Environment variable override via `crew.work.env` config (not exposed as tool param to prevent API keys in logs).
|
|
73
|
+
- **Graceful shutdown** — `AbortSignal` threaded from tool execute through to spawned workers. On abort: discovers worker name via PID-based registry scan, writes shutdown message to worker inbox, waits 30s grace period, SIGTERM, waits 5s, SIGKILL. Tasks reset to `todo` for retry. Workers instructed to release reservations and exit without committing.
|
|
74
|
+
- **Live crew progress** — In-memory pub/sub store fed by worker JSONL events. Overlay Crew tab shows Active Workers section with tool name, call count, tokens, and elapsed time updating every second. Status bar shows active worker count during autonomous mode (`🔨N`).
|
|
75
|
+
- **`shutdownGracePeriodMs` config** — Configurable grace period before SIGTERM (default: 30000).
|
|
76
|
+
|
|
77
|
+
### Changed
|
|
78
|
+
- **Dynamic overlay height** — Content area scales with terminal size (8-25 lines) instead of hardcoded 10. On a standard 24-row terminal, visible content goes from 10 to 15 lines.
|
|
79
|
+
- **Handler signatures simplified** — Removed unused `state` and `dirs` parameters from plan and review handlers.
|
|
80
|
+
|
|
81
|
+
### Fixed
|
|
82
|
+
- **`deepMerge` crash** — Merging config with `models` key crashed when the target didn't have the key. Hardened for undefined target keys.
|
|
83
|
+
- **Result/task association** — Worker results now matched by `taskId` field instead of array index, since `spawnAgents` returns in completion order not submission order.
|
|
84
|
+
|
|
85
|
+
### Removed
|
|
86
|
+
- `attemptsPerTask` field from `AutonomousState` — declared but never populated by any code.
|
|
87
|
+
- `ARCHITECTURE.md` from repo (moved to external docs).
|
|
88
|
+
|
|
3
89
|
## [0.10.0] - 2026-02-05
|
|
4
90
|
|
|
5
91
|
### Fixed
|
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
# Pi Messenger
|
|
6
6
|
|
|
7
|
-
**What if multiple agents in different terminals sharing a folder could talk to each other like they're in a chat room?** Join, see who's online and what they're doing. Claim tasks, reserve files, send messages.
|
|
7
|
+
**What if multiple agents in different terminals sharing a folder could talk to each other like they're in a chat room?** Join, see who's online and what they're doing. Claim tasks, reserve files, send messages. An extension for [Pi coding agent](https://pi.dev/) — install it and go. No daemon, no server, just files.
|
|
8
8
|
|
|
9
9
|
[](https://www.npmjs.com/package/pi-messenger)
|
|
10
10
|
[](LICENSE)
|
|
@@ -16,13 +16,15 @@
|
|
|
16
16
|
pi install npm:pi-messenger
|
|
17
17
|
```
|
|
18
18
|
|
|
19
|
-
Crew agents
|
|
19
|
+
Crew agents ship with the extension (`crew/agents/*.md`) and are discovered automatically. The `pi-messenger-crew` skill is auto-loaded from the extension.
|
|
20
|
+
|
|
21
|
+
To show available crew agents:
|
|
20
22
|
|
|
21
23
|
```bash
|
|
22
24
|
npx pi-messenger --crew-install
|
|
23
25
|
```
|
|
24
26
|
|
|
25
|
-
|
|
27
|
+
To customize an agent for one project, copy it to `.pi/messenger/crew/agents/` and edit it.
|
|
26
28
|
|
|
27
29
|
To remove the extension:
|
|
28
30
|
|
|
@@ -30,7 +32,7 @@ To remove the extension:
|
|
|
30
32
|
npx pi-messenger --remove
|
|
31
33
|
```
|
|
32
34
|
|
|
33
|
-
To
|
|
35
|
+
To remove stale crew agent copies from the shared legacy directory (`~/.pi/agent/agents/`):
|
|
34
36
|
|
|
35
37
|
```bash
|
|
36
38
|
npx pi-messenger --crew-uninstall
|
|
@@ -96,7 +98,14 @@ Crew turns a PRD into a dependency graph of tasks, then executes them in paralle
|
|
|
96
98
|
2. **Work** — Workers implement ready tasks (all dependencies met) in parallel waves. A single `work` call runs one wave. `autonomous: true` runs waves back-to-back until everything is done or blocked.
|
|
97
99
|
3. **Review** — Reviewer checks each implementation: SHIP, NEEDS_WORK, or MAJOR_RETHINK.
|
|
98
100
|
|
|
99
|
-
No special PRD format required — the planner auto-discovers `PRD.md`, `SPEC.md`, `DESIGN.md`, etc. in your project root and `docs/`.
|
|
101
|
+
No special PRD format required — the planner auto-discovers `PRD.md`, `SPEC.md`, `DESIGN.md`, etc. in your project root and `docs/`. Or skip the file entirely:
|
|
102
|
+
|
|
103
|
+
```typescript
|
|
104
|
+
pi_messenger({ action: "plan", prompt: "Scan the codebase for bugs" })
|
|
105
|
+
|
|
106
|
+
// Plan + auto-start autonomous work when planning completes
|
|
107
|
+
pi_messenger({ action: "plan" }) // auto-starts workers (default)
|
|
108
|
+
```
|
|
100
109
|
|
|
101
110
|
### Wave Execution
|
|
102
111
|
|
|
@@ -116,20 +125,94 @@ The planner structures tasks to maximize parallelism. Foundation work has no dep
|
|
|
116
125
|
|
|
117
126
|
### Crew Configuration
|
|
118
127
|
|
|
119
|
-
Add to `~/.pi/agent/pi-messenger.json`:
|
|
128
|
+
Crew spawns multiple LLM sessions in parallel — it can burn tokens fast. Start with a cheap worker model and scale up once you've seen the workflow. Add this to `~/.pi/agent/pi-messenger.json`:
|
|
129
|
+
|
|
130
|
+
```json
|
|
131
|
+
{ "crew": { "models": { "worker": "claude-haiku-4-5" } } }
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
The planner and reviewer keep their frontmatter defaults; only workers (the bulk of the spend) get the cheap model. Override per-role as needed:
|
|
135
|
+
|
|
136
|
+
```json
|
|
137
|
+
{
|
|
138
|
+
"crew": {
|
|
139
|
+
"models": {
|
|
140
|
+
"worker": "claude-haiku-4-5",
|
|
141
|
+
"planner": "claude-sonnet-4-6",
|
|
142
|
+
"reviewer": "claude-sonnet-4-6"
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
Model strings accept `provider/model` format for explicit provider selection and `:level` suffix for inline thinking control. These work anywhere a model is specified — config, frontmatter, or per-task override:
|
|
149
|
+
|
|
150
|
+
```json
|
|
151
|
+
{
|
|
152
|
+
"crew": {
|
|
153
|
+
"models": {
|
|
154
|
+
"worker": "anthropic/claude-haiku-4-5",
|
|
155
|
+
"planner": "openrouter/anthropic/claude-sonnet-4:high"
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
The `:level` suffix and the `thinking.<role>` config are independent — if both are set, the suffix takes precedence and the `--thinking` flag is skipped to avoid double-application.
|
|
162
|
+
|
|
163
|
+
Full config reference (all fields optional — only set what you want to change):
|
|
120
164
|
|
|
121
165
|
```json
|
|
122
166
|
{
|
|
123
167
|
"crew": {
|
|
124
|
-
"concurrency": { "workers": 2 },
|
|
168
|
+
"concurrency": { "workers": 2, "max": 10 },
|
|
169
|
+
"coordination": "chatty",
|
|
170
|
+
"models": { "worker": "claude-haiku-4-5" },
|
|
125
171
|
"review": { "enabled": true, "maxIterations": 3 },
|
|
126
|
-
"planning": { "maxPasses":
|
|
127
|
-
"work": {
|
|
172
|
+
"planning": { "maxPasses": 1 },
|
|
173
|
+
"work": {
|
|
174
|
+
"maxAttemptsPerTask": 5,
|
|
175
|
+
"maxWaves": 50
|
|
176
|
+
}
|
|
128
177
|
}
|
|
129
178
|
}
|
|
130
179
|
```
|
|
131
180
|
|
|
132
|
-
|
|
181
|
+
| Setting | Description | Default |
|
|
182
|
+
|---------|-------------|---------|
|
|
183
|
+
| `concurrency.workers` | Default parallel workers per wave | `2` |
|
|
184
|
+
| `concurrency.max` | Maximum workers allowed (hard ceiling is 10) | `10` |
|
|
185
|
+
| `dependencies` | Dependency scheduling mode: `advisory` or `strict` | `"advisory"` |
|
|
186
|
+
| `coordination` | Worker coordination level: `none`, `minimal`, `moderate`, `chatty` | `"chatty"` |
|
|
187
|
+
| `messageBudgets` | Max outgoing messages per worker per level (sends rejected after limit) | `{ none: 0, minimal: 2, moderate: 5, chatty: 10 }` |
|
|
188
|
+
| `models.planner` | Model for planner agent | `anthropic/claude-opus-4-6` |
|
|
189
|
+
| `models.worker` | Model for workers (overridden by per-task or per-wave `model` param) | `anthropic/claude-haiku-4-5` |
|
|
190
|
+
| `models.reviewer` | Model for reviewer agent | `anthropic/claude-opus-4-6` |
|
|
191
|
+
| `models.analyst` | Model for analyst (plan-sync) agent | `anthropic/claude-haiku-4-5` |
|
|
192
|
+
| `thinking.planner` | Thinking level for planner agent | (from frontmatter) |
|
|
193
|
+
| `thinking.worker` | Thinking level for worker agents | (from frontmatter) |
|
|
194
|
+
| `thinking.reviewer` | Thinking level for reviewer agents | (from frontmatter) |
|
|
195
|
+
| `thinking.analyst` | Thinking level for analyst agents | (from frontmatter) |
|
|
196
|
+
| `review.enabled` | Auto-review after task completion | `true` |
|
|
197
|
+
| `review.maxIterations` | Max review/fix cycles per task | `3` |
|
|
198
|
+
| `planning.maxPasses` | Max planner/reviewer refinement passes | `1` |
|
|
199
|
+
| `work.maxAttemptsPerTask` | Auto-block after N failures | `5` |
|
|
200
|
+
| `work.maxWaves` | Max autonomous waves | `50` |
|
|
201
|
+
| `work.shutdownGracePeriodMs` | Grace period before SIGTERM on abort | `30000` |
|
|
202
|
+
| `work.env` | Environment variables passed to spawned workers | `{}` |
|
|
203
|
+
|
|
204
|
+
### Default Agent Models
|
|
205
|
+
|
|
206
|
+
Each crew agent ships with a default model in its frontmatter. Override any of these via `crew.models.<role>` in config:
|
|
207
|
+
|
|
208
|
+
| Agent | Role | Default Model |
|
|
209
|
+
|-------|------|---------------|
|
|
210
|
+
| `crew-planner` | planner | `anthropic/claude-opus-4-6` |
|
|
211
|
+
| `crew-worker` | worker | `anthropic/claude-haiku-4-5` |
|
|
212
|
+
| `crew-reviewer` | reviewer | `anthropic/claude-opus-4-6` |
|
|
213
|
+
| `crew-plan-sync` | analyst | `anthropic/claude-haiku-4-5` |
|
|
214
|
+
|
|
215
|
+
Agent definitions live in `crew/agents/` within the extension. To customize one for a project, copy it to `.pi/messenger/crew/agents/` and edit the frontmatter — project-level agents override extension defaults by name. Agents support `thinking: <level>` in frontmatter (off, minimal, low, medium, high, xhigh). Config `thinking.<role>` overrides the frontmatter value.
|
|
133
216
|
|
|
134
217
|
## API Reference
|
|
135
218
|
|
|
@@ -153,7 +236,7 @@ Crew agents (planner, worker, reviewer, interview-generator, plan-sync) are **au
|
|
|
153
236
|
|
|
154
237
|
| Action | Description |
|
|
155
238
|
|--------|-------------|
|
|
156
|
-
| `plan` | Create plan from PRD (`prd` optional — auto-discovers if omitted) |
|
|
239
|
+
| `plan` | Create plan from PRD or inline prompt (`prd`, `prompt` optional — auto-discovers PRD if omitted, auto-starts workers unless `autoWork: false`) |
|
|
157
240
|
| `work` | Run ready tasks (`autonomous`, `concurrency` optional) |
|
|
158
241
|
| `review` | Review implementation (`target` task ID required) |
|
|
159
242
|
| `task.list` | List all tasks |
|
|
@@ -167,8 +250,8 @@ Crew agents (planner, worker, reviewer, interview-generator, plan-sync) are **au
|
|
|
167
250
|
| `crew.status` | Overall crew status |
|
|
168
251
|
| `crew.validate` | Validate plan dependencies |
|
|
169
252
|
| `crew.agents` | List available crew agents |
|
|
170
|
-
| `crew.install` |
|
|
171
|
-
| `crew.uninstall` | Remove crew
|
|
253
|
+
| `crew.install` | Show discovered crew agents and their sources |
|
|
254
|
+
| `crew.uninstall` | Remove stale shared-directory crew agent copies |
|
|
172
255
|
|
|
173
256
|
### Swarm (Spec-Based)
|
|
174
257
|
|
|
@@ -190,7 +273,8 @@ Create `~/.pi/agent/pi-messenger.json`:
|
|
|
190
273
|
"scopeToFolder": false,
|
|
191
274
|
"nameTheme": "default",
|
|
192
275
|
"stuckThreshold": 900,
|
|
193
|
-
"stuckNotify": true
|
|
276
|
+
"stuckNotify": true,
|
|
277
|
+
"autoOverlayPlanning": true
|
|
194
278
|
}
|
|
195
279
|
```
|
|
196
280
|
|
|
@@ -205,6 +289,8 @@ Create `~/.pi/agent/pi-messenger.json`:
|
|
|
205
289
|
| `stuckThreshold` | Seconds of inactivity before stuck detection | `900` |
|
|
206
290
|
| `stuckNotify` | Show notification when a peer appears stuck | `true` |
|
|
207
291
|
| `autoStatus` | Auto-generate status messages from activity | `true` |
|
|
292
|
+
| `autoOverlay` | Auto-open overlay when autonomous crew work starts | `true` |
|
|
293
|
+
| `autoOverlayPlanning` | Auto-open Crew overlay when planning starts or is restored in-progress | `true` |
|
|
208
294
|
| `crewEventsInFeed` | Include crew task events in activity feed | `true` |
|
|
209
295
|
| `contextMode` | Context injection level: `full`, `minimal`, `none` | `"full"` |
|
|
210
296
|
|
|
@@ -216,9 +302,9 @@ Pi-messenger is a [pi extension](https://github.com/badlogic/pi-mono) that hooks
|
|
|
216
302
|
|
|
217
303
|
Incoming messages wake the receiving agent via `pi.sendMessage()` with `triggerTurn: true` and `deliverAs: "steer"`, which injects the message as a steering prompt that resumes the agent. File reservations are enforced by returning `{ block: true }` from a `tool_call` hook on write/edit operations. The `/messenger` overlay uses `ctx.ui.custom()` for the chat TUI, and `ctx.ui.setStatus()` keeps the status bar updated with peer count and unread messages.
|
|
218
304
|
|
|
219
|
-
Crew workers are spawned as `pi --mode json` subprocesses with the agent's system prompt, model, and tool restrictions from their `.md` definitions. Progress is tracked via JSONL streaming. The planner and reviewer work the same way — just pi instances with different agent configs.
|
|
305
|
+
Crew workers are spawned as `pi --mode json` subprocesses with the agent's system prompt, model, and tool restrictions from their `.md` definitions. Progress is tracked via JSONL streaming — the overlay subscribes to a live progress store that shows each worker's current tool, call count, and token usage in real time. Aborting a work run triggers graceful shutdown: each worker receives an inbox message asking it to stop, followed by a grace period before SIGTERM. The planner and reviewer work the same way — just pi instances with different agent configs.
|
|
220
306
|
|
|
221
|
-
All coordination is file-based, no daemon required.
|
|
307
|
+
All coordination is file-based, no daemon required. Shared state (registry, inboxes, swarm claims/completions) lives in `~/.pi/agent/messenger/`. Activity feed and crew data are project-scoped under `.pi/messenger/` inside your project. Dead agents are detected via PID checks and cleaned up automatically.
|
|
222
308
|
|
|
223
309
|
## Credits
|
|
224
310
|
|
package/config.ts
CHANGED
|
@@ -26,6 +26,8 @@ export interface MessengerConfig {
|
|
|
26
26
|
stuckThreshold: number;
|
|
27
27
|
stuckNotify: boolean;
|
|
28
28
|
autoStatus: boolean;
|
|
29
|
+
autoOverlay: boolean;
|
|
30
|
+
autoOverlayPlanning: boolean;
|
|
29
31
|
crewEventsInFeed: boolean;
|
|
30
32
|
}
|
|
31
33
|
|
|
@@ -42,6 +44,8 @@ const DEFAULT_CONFIG: MessengerConfig = {
|
|
|
42
44
|
stuckThreshold: 900,
|
|
43
45
|
stuckNotify: true,
|
|
44
46
|
autoStatus: true,
|
|
47
|
+
autoOverlay: true,
|
|
48
|
+
autoOverlayPlanning: true,
|
|
45
49
|
crewEventsInFeed: true,
|
|
46
50
|
};
|
|
47
51
|
|
|
@@ -155,6 +159,8 @@ export function loadConfig(cwd: string): MessengerConfig {
|
|
|
155
159
|
stuckThreshold: typeof merged.stuckThreshold === "number" ? merged.stuckThreshold : DEFAULT_CONFIG.stuckThreshold,
|
|
156
160
|
stuckNotify: merged.stuckNotify !== false,
|
|
157
161
|
autoStatus: merged.autoStatus !== false,
|
|
162
|
+
autoOverlay: merged.autoOverlay !== false,
|
|
163
|
+
autoOverlayPlanning: merged.autoOverlayPlanning !== false,
|
|
158
164
|
crewEventsInFeed: merged.crewEventsInFeed !== false,
|
|
159
165
|
};
|
|
160
166
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
name: crew-planner
|
|
3
3
|
description: Analyzes codebase and PRD to create a comprehensive task breakdown
|
|
4
4
|
tools: read, bash, web_search, pi_messenger
|
|
5
|
-
model: claude-opus-4-
|
|
5
|
+
model: anthropic/claude-opus-4-6
|
|
6
6
|
crewRole: planner
|
|
7
7
|
maxOutput: { bytes: 204800, lines: 5000 }
|
|
8
8
|
parallel: false
|
|
@@ -66,7 +66,7 @@ Create a task breakdown following the exact output format below. Guidelines:
|
|
|
66
66
|
- **4-8 tasks** typically (scale with complexity)
|
|
67
67
|
- Each task should be **completable in one work session**
|
|
68
68
|
- Group related work but keep tasks focused
|
|
69
|
-
-
|
|
69
|
+
- Include tests in each task's acceptance criteria
|
|
70
70
|
- Include specific files to create/modify when known
|
|
71
71
|
- Include acceptance criteria in task descriptions
|
|
72
72
|
|
|
@@ -80,6 +80,22 @@ Tasks execute in waves — all tasks whose dependencies are met run concurrently
|
|
|
80
80
|
- **Dependencies should reflect real data flow.** Task B depends on Task A only if B imports types, calls functions, or reads files that A creates. Conceptual ordering ("settings before server") isn't a dependency unless the server literally imports from the settings module.
|
|
81
81
|
- **Front-load foundation tasks with no dependencies** so multiple streams can start from wave 1.
|
|
82
82
|
|
|
83
|
+
### Anti-Patterns to Avoid
|
|
84
|
+
|
|
85
|
+
- **No standalone "types" or "config" tasks.** If every other task depends on a types-only task, you've created a bottleneck. The first task that needs shared types should define them alongside its real work.
|
|
86
|
+
- **No integration funnels.** A task that depends on everything (tasks 1-5 all as deps) forces serialization. Split integration so pieces can start as each module completes.
|
|
87
|
+
- **No redundant transitive deps.** If B depends on A, and C depends on B, don't list A in C's dependencies — it's already satisfied through B.
|
|
88
|
+
- **Tests belong in their task.** Include unit tests in each implementation task's acceptance criteria. A standalone "Testing" task at the end is always on the critical path.
|
|
89
|
+
|
|
90
|
+
### Dependency Descriptions
|
|
91
|
+
|
|
92
|
+
Be specific about what each dependency provides. Workers may start before dependencies complete and need to know what to expect:
|
|
93
|
+
- Name the **files** each task creates or modifies
|
|
94
|
+
- Name the **exported symbols** (functions, types, classes) other tasks will import
|
|
95
|
+
- Describe **interface shapes** (function signatures, type fields) so workers can code against them even before the dependency is done
|
|
96
|
+
|
|
97
|
+
Workers coordinate via file reservations and direct messages. They can define local interfaces and adapt when dependency outputs appear. Your dependency descriptions help them make good decisions.
|
|
98
|
+
|
|
83
99
|
## Output Format
|
|
84
100
|
|
|
85
101
|
Your final output MUST include both formats:
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
name: crew-reviewer
|
|
3
3
|
description: Reviews task implementations for quality and correctness
|
|
4
4
|
tools: read, bash, pi_messenger
|
|
5
|
-
model:
|
|
5
|
+
model: anthropic/claude-opus-4-6
|
|
6
6
|
crewRole: reviewer
|
|
7
7
|
maxOutput: { bytes: 102400, lines: 2000 }
|
|
8
8
|
parallel: true
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
name: crew-worker
|
|
3
3
|
description: Implements a single crew task with mesh coordination
|
|
4
4
|
tools: read, write, edit, bash, pi_messenger
|
|
5
|
-
model: claude-
|
|
5
|
+
model: anthropic/claude-haiku-4-5
|
|
6
6
|
crewRole: worker
|
|
7
7
|
maxOutput: { bytes: 204800, lines: 5000 }
|
|
8
8
|
parallel: true
|
|
@@ -54,6 +54,14 @@ pi_messenger({ action: "reserve", paths: ["src/path/to/files/"], reason: "<TASK_
|
|
|
54
54
|
3. Write tests if applicable
|
|
55
55
|
4. Run tests to verify: `bash({ command: "npm test" })` or equivalent
|
|
56
56
|
|
|
57
|
+
**Progress Logging:** After each significant step above, log what you did:
|
|
58
|
+
|
|
59
|
+
```typescript
|
|
60
|
+
pi_messenger({ action: "task.progress", id: "<TASK_ID>", message: "Added JWT validation to src/auth/middleware.ts" })
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
Keep entries concise — one line per step. This helps the next agent pick up where you left off if the task gets interrupted.
|
|
64
|
+
|
|
57
65
|
## Phase 5: Commit
|
|
58
66
|
|
|
59
67
|
```bash
|
|
@@ -85,6 +93,15 @@ pi_messenger({
|
|
|
85
93
|
})
|
|
86
94
|
```
|
|
87
95
|
|
|
96
|
+
## Shutdown Handling
|
|
97
|
+
|
|
98
|
+
If you receive a message saying "SHUTDOWN REQUESTED":
|
|
99
|
+
1. Stop what you're doing
|
|
100
|
+
2. Release reservations: `pi_messenger({ action: "release" })`
|
|
101
|
+
3. Do NOT mark the task as done — leave it as in_progress for retry
|
|
102
|
+
4. Do NOT commit anything
|
|
103
|
+
5. Exit immediately
|
|
104
|
+
|
|
88
105
|
## Important Rules
|
|
89
106
|
|
|
90
107
|
- ALWAYS join first, before any other pi_messenger calls
|
|
@@ -93,3 +110,8 @@ pi_messenger({
|
|
|
93
110
|
- ALWAYS release before completing
|
|
94
111
|
- If you encounter a blocker, use `task.block` with a clear reason
|
|
95
112
|
- Follow existing code patterns and conventions
|
|
113
|
+
|
|
114
|
+
## Coordination
|
|
115
|
+
|
|
116
|
+
Follow the coordination instructions in your task prompt's "Coordination" section.
|
|
117
|
+
If no coordination section is present, do not send messages — focus on your task.
|