pi-crew 0.11.0 → 0.11.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.
- package/CHANGELOG.md +155 -9
- package/README.md +161 -1037
- package/agents/verifier.md +18 -7
- package/dist/index.mjs +744 -90644
- package/docs/README.md +57 -46
- package/docs/architecture.md +87 -33
- package/docs/commands-reference.md +9 -5
- package/docs/troubleshooting.md +3 -2
- package/package.json +1 -3
- package/schema.json +39 -0
- package/skills/real-test-pi-crew/REPORT-TEMPLATE.md +2 -0
- package/skills/real-test-pi-crew/SKILL.md +371 -34
- package/src/agents/agent-config.ts +1 -1
- package/src/agents/discover-agents.ts +1 -1
- package/src/config/config-validation.ts +15 -2
- package/src/config/config.ts +47 -13
- package/src/config/defaults.ts +0 -1
- package/src/config/env-vars.ts +35 -0
- package/src/config/types.ts +19 -5
- package/src/errors.ts +2 -2
- package/src/extension/async-notifier.ts +23 -0
- package/src/extension/crew-vibes/config.ts +0 -21
- package/src/extension/crew-vibes/index.ts +0 -2
- package/src/extension/crew-vibes/render.ts +1 -50
- package/src/extension/help.ts +21 -12
- package/src/extension/knowledge-injection.ts +2 -1
- package/src/extension/management.ts +8 -3
- package/src/extension/notification-sink.ts +17 -0
- package/src/extension/register.ts +7 -2
- package/src/extension/registration/command-utils.ts +28 -2
- package/src/extension/registration/commands/dashboard.ts +11 -1
- package/src/extension/registration/commands/manage.ts +36 -19
- package/src/extension/registration/commands/run.ts +24 -2
- package/src/extension/registration/commands/shared.ts +23 -1
- package/src/extension/registration/commands/status.ts +25 -2
- package/src/extension/registration/context-builder.ts +8 -2
- package/src/extension/registration/health-notify-policy.ts +100 -0
- package/src/extension/registration/lazy-configurers.ts +35 -0
- package/src/extension/registration/lifecycle-handlers.ts +91 -30
- package/src/extension/registration/lifecycle.ts +75 -10
- package/src/extension/registration/observability.ts +98 -35
- package/src/extension/registration/registration-types.ts +7 -5
- package/src/extension/registration/runtime-cleanup.ts +9 -3
- package/src/extension/registration/subagent-helpers.ts +38 -0
- package/src/extension/registration/subagent-tools.ts +16 -6
- package/src/extension/registration/team-tool.ts +10 -3
- package/src/extension/registration/terminal-status-wiring.ts +172 -0
- package/src/extension/registration/viewers.ts +6 -0
- package/src/extension/registration/wire-cross-extension.ts +28 -0
- package/src/extension/run-compare.ts +220 -0
- package/src/extension/run-export.ts +37 -5
- package/src/extension/run-maintenance.ts +155 -5
- package/src/extension/team-tool/dispatch/index.ts +3 -2
- package/src/extension/team-tool/dispatch/manage.ts +5 -2
- package/src/extension/team-tool/goal.ts +4 -1
- package/src/extension/team-tool/handle-settings.ts +33 -4
- package/src/extension/team-tool/health-monitor.ts +21 -7
- package/src/extension/team-tool/lifecycle-actions.ts +49 -1
- package/src/extension/team-tool/plan.ts +10 -0
- package/src/extension/team-tool/routing-hint.ts +63 -0
- package/src/extension/team-tool/status.ts +4 -0
- package/src/extension/team-tool.ts +52 -6
- package/src/extension/webhook-notify.ts +382 -0
- package/src/observability/metric-sink.ts +12 -2
- package/src/prompt/prompt-runtime.ts +82 -31
- package/src/prompt/worker-events-channel.ts +12 -0
- package/src/runtime/README.md +1 -1
- package/src/runtime/async-runner.ts +87 -1
- package/src/runtime/background-runner.ts +313 -234
- package/src/runtime/broker/crew-broker.ts +17 -11
- package/src/runtime/broker/delegate/shadow-lifecycle.ts +92 -0
- package/src/runtime/broker/wait-status-cache.ts +1 -1
- package/src/runtime/child-pi/child-pi-timers.ts +1 -1
- package/src/runtime/child-pi/mock-fixtures.ts +48 -0
- package/src/runtime/crew-agent-records.ts +337 -45
- package/src/runtime/deadletter.ts +43 -1
- package/src/runtime/delegate-spawn.ts +5 -1
- package/src/runtime/dispatch-batch.ts +72 -5
- package/src/runtime/goal-workflow/goal-loop-runner.ts +73 -4
- package/src/runtime/heartbeat/heartbeat-watcher.ts +7 -0
- package/src/runtime/model/model-fallback.ts +21 -1
- package/src/runtime/model/pi-args.ts +8 -10
- package/src/runtime/recovery/crash-recovery.ts +25 -1
- package/src/runtime/run-worker.ts +12 -1
- package/src/runtime/scheduling/global-worker-cap.ts +13 -6
- package/src/runtime/scheduling/run-coalesced-task-group.ts +27 -1
- package/src/runtime/scheduling/scheduler.ts +49 -13
- package/src/runtime/scheduling/semaphore.ts +148 -20
- package/src/runtime/scratchpad/README.md +1 -1
- package/src/runtime/scratchpad/protocol.ts +1 -1
- package/src/runtime/settings-store.ts +1 -1
- package/src/runtime/skill-instructions.ts +22 -0
- package/src/runtime/stale-reconciler.ts +85 -13
- package/src/runtime/task-display.ts +1 -1
- package/src/runtime/task-runner/pre-execution.ts +26 -2
- package/src/runtime/task-runner/prompt-builder.ts +142 -45
- package/src/runtime/task-runner.ts +21 -1
- package/src/runtime/team-runner.ts +38 -1
- package/src/runtime/workspace-lock.ts +4 -1
- package/src/schema/config-schema.ts +18 -0
- package/src/schema/team-tool-schema.ts +17 -0
- package/src/state/atomic-write.ts +53 -0
- package/src/state/contracts.ts +109 -0
- package/src/state/coordination/locks.ts +191 -33
- package/src/state/coordination/mailbox.ts +140 -15
- package/src/state/crew-init.ts +87 -12
- package/src/state/event-log/cursor.ts +37 -1
- package/src/state/event-log/event-log-rotation.ts +72 -7
- package/src/state/stores/active-run-registry.ts +13 -1
- package/src/state/stores/state-store.ts +112 -22
- package/src/state/types.ts +4 -0
- package/src/ui/adaptive-card.ts +65 -0
- package/src/ui/agents-jobs-browser.ts +70 -64
- package/src/ui/card-colors.ts +36 -7
- package/src/ui/dashboard-panes/agents-pane.ts +55 -14
- package/src/ui/dashboard-panes/cancellation-pane.ts +0 -42
- package/src/ui/dashboard-panes/health-pane.ts +7 -5
- package/src/ui/dashboard-panes/mailbox-pane.ts +22 -6
- package/src/ui/dashboard-panes/metrics-pane.ts +15 -7
- package/src/ui/dashboard-panes/pane-theme.ts +21 -0
- package/src/ui/dashboard-panes/plan-pane.ts +63 -30
- package/src/ui/dashboard-panes/progress-pane.ts +3 -2
- package/src/ui/dashboard-panes/schedules-pane.ts +44 -21
- package/src/ui/dashboard-panes/transcript-pane.ts +11 -5
- package/src/ui/dwf-phase-display.ts +3 -20
- package/src/ui/format-helpers.ts +22 -0
- package/src/ui/heartbeat-aggregator.ts +34 -0
- package/src/ui/inline-panel/crew-editor.ts +13 -3
- package/src/ui/inline-panel/index.ts +60 -4
- package/src/ui/keybinding-map.ts +251 -35
- package/src/ui/live-conversation-overlay.ts +180 -47
- package/src/ui/live-run-sidebar.ts +134 -55
- package/src/ui/mascot.ts +32 -16
- package/src/ui/overlays/agent-picker-overlay.ts +81 -26
- package/src/ui/overlays/confirm-overlay.ts +55 -29
- package/src/ui/overlays/help-overlay.ts +108 -53
- package/src/ui/overlays/mailbox-compose-overlay.ts +89 -50
- package/src/ui/overlays/mailbox-detail-overlay.ts +137 -57
- package/src/ui/powerbar-publisher.ts +0 -1
- package/src/ui/rail.ts +333 -0
- package/src/ui/run-dashboard.ts +193 -79
- package/src/ui/run-snapshot-cache.ts +18 -1
- package/src/ui/settings-overlay.ts +81 -39
- package/src/ui/spinner.ts +26 -2
- package/src/ui/terminal-status.ts +7 -1
- package/src/ui/theme-adapter.ts +0 -45
- package/src/ui/theme-discovery.ts +12 -6
- package/src/ui/tool-progress-formatter.ts +128 -9
- package/src/ui/tool-renderers/brief-mode.ts +10 -67
- package/src/ui/tool-renderers/index.ts +374 -523
- package/src/ui/transcript-viewer.ts +30 -12
- package/src/ui/widget/index.ts +32 -52
- package/src/ui/widget/task-list.ts +64 -32
- package/src/ui/widget/widget-formatters.ts +3 -402
- package/src/ui/widget/widget-model.ts +28 -7
- package/src/ui/widget/widget-renderer.ts +201 -128
- package/src/ui/widget/widget-types.ts +0 -2
- package/src/utils/incremental-reader.ts +11 -3
- package/src/utils/paths.ts +94 -12
- package/src/utils/project-markers.ts +40 -0
- package/src/utils/visual.ts +0 -4
- package/src/worktree/worktree-manager.ts +206 -26
- package/workflows/distill.workflow.md +3 -3
- package/workflows/fast-fix.workflow.md +1 -1
- package/workflows/plan-execute.workflow.md +1 -1
- package/workflows/review.workflow.md +1 -1
- package/workflows/strict-fast-fix.workflow.md +1 -1
- package/docs/migration-v0.4-v0.5.md +0 -208
- package/docs/runtime-flow.md +0 -148
- package/src/extension/crew-vibes/figures.ts +0 -22
- package/src/extension/crew-vibes/font-detect.ts +0 -71
- package/src/ui/dynamic-border.ts +0 -35
- package/src/ui/loaders.ts +0 -6
- package/src/ui/overlay-stack.ts +0 -148
package/docs/README.md
CHANGED
|
@@ -1,56 +1,67 @@
|
|
|
1
|
-
# docs
|
|
1
|
+
# pi-crew docs
|
|
2
2
|
|
|
3
|
-
pi-crew
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
[`
|
|
7
|
-
[`src/state/README.md`](../src/state/README.md).
|
|
3
|
+
Documentation for the pi-crew package (multi-agent team orchestration as a Pi
|
|
4
|
+
extension). The root of `docs/` holds only **living** docs; dated point-in-time
|
|
5
|
+
material (audits, plans, fix specs, roadmaps) is archived under
|
|
6
|
+
[`archive/`](./archive/).
|
|
8
7
|
|
|
9
|
-
##
|
|
8
|
+
## Start here
|
|
10
9
|
|
|
11
10
|
| Doc | Contents |
|
|
12
11
|
|-----|----------|
|
|
13
|
-
| [
|
|
14
|
-
| [`
|
|
15
|
-
| [`
|
|
12
|
+
| [`../README.md`](../README.md) | Package README — what pi-crew is, install, quickstart |
|
|
13
|
+
| [`usage.md`](./usage.md) | Config, run modes, slash commands, management actions |
|
|
14
|
+
| [`architecture.md`](./architecture.md) | Layers, state layout, and the run lifecycle (the former `runtime-flow.md` content lives here) |
|
|
15
|
+
| [`troubleshooting.md`](./troubleshooting.md) | Common errors, recovery procedures, error codes (E001–E013) |
|
|
16
|
+
|
|
17
|
+
## Reference
|
|
18
|
+
|
|
19
|
+
| Doc | Contents |
|
|
20
|
+
|-----|----------|
|
|
21
|
+
| [`actions-reference.md`](./actions-reference.md) | Every `team` tool action with parameters and examples |
|
|
22
|
+
| [`commands-reference.md`](./commands-reference.md) | Slash commands and `/team-api` |
|
|
23
|
+
| [`hooks-reference.md`](./hooks-reference.md) | The three hook/event subsystems and when to use each |
|
|
24
|
+
| [`role-tools.md`](./role-tools.md) | Role → tool permission matrix. **Generated** from `src/config/role-tools.ts` via `scripts/gen-role-tools-docs.mjs` — regenerate, do not hand-edit |
|
|
16
25
|
| [`resource-formats.md`](./resource-formats.md) | Agent/team/workflow file formats |
|
|
17
|
-
| [`
|
|
18
|
-
| [`runtime-flow.md`](./runtime-flow.md) | Runtime execution details |
|
|
19
|
-
| [`dynamic-workflows.md`](./dynamic-workflows.md) | `.dwf.ts` script runtime + trust model |
|
|
26
|
+
| [`trust-model.md`](./trust-model.md) | The authoritative trust model (single source of truth) |
|
|
20
27
|
| [`goals.md`](./goals.md) | Autonomous goal loops (`team action='goal'`) |
|
|
21
|
-
| [`
|
|
22
|
-
| [`
|
|
23
|
-
| [`
|
|
24
|
-
| [`
|
|
25
|
-
| [`
|
|
26
|
-
| [`
|
|
27
|
-
| [`
|
|
28
|
-
| [`
|
|
29
|
-
| [`
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
## Subdirectories
|
|
28
|
+
| [`dynamic-workflows.md`](./dynamic-workflows.md) | `.dwf.ts` script workflows and their trust model |
|
|
29
|
+
| [`live-mailbox-runtime.md`](./live-mailbox-runtime.md) | Mailbox files and the live-session runtime direction |
|
|
30
|
+
| [`UI-DESIGN-SYSTEM.md`](./UI-DESIGN-SYSTEM.md) | RAIL design contract for TUI surfaces (primitive source: `src/ui/rail.ts`) |
|
|
31
|
+
| [`publishing.md`](./publishing.md) | npm release and publish process |
|
|
32
|
+
| [`failure-mode-inventory.md`](./failure-mode-inventory.md) | Failure modes mapped to their handlers; gaps are declared, not hidden |
|
|
33
|
+
| [`TEST_MATRIX.md`](./TEST_MATRIX.md) | Behavior → proof mapping; every row needs real evidence |
|
|
34
|
+
| [`HARNESS.md`](./HARNESS.md) | Development-harness operating model for building pi-crew itself |
|
|
35
|
+
| [`HARNESS_BACKLOG.md`](./HARNESS_BACKLOG.md) | Harness capability backlog (HB-xxx items) |
|
|
36
|
+
| [`FEATURE_INTAKE.md`](./FEATURE_INTAKE.md) | Intake gate every implementation prompt must pass |
|
|
37
|
+
|
|
38
|
+
## Records
|
|
39
|
+
|
|
40
|
+
Historical and supporting material lives in subdirectories. These are records,
|
|
41
|
+
not living specs — verify against code before relying on them.
|
|
37
42
|
|
|
38
43
|
| Subdir | Contents |
|
|
39
44
|
|--------|----------|
|
|
40
|
-
| [`
|
|
41
|
-
| [`
|
|
42
|
-
| [`
|
|
43
|
-
| [`
|
|
44
|
-
| [`
|
|
45
|
-
| [`
|
|
46
|
-
| [`
|
|
47
|
-
| [`
|
|
48
|
-
| [`
|
|
49
|
-
| [`
|
|
50
|
-
| [`
|
|
51
|
-
| [`
|
|
52
|
-
| [`
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
[`
|
|
45
|
+
| [`decisions/`](./decisions/) | Architecture decision records (ADRs); index in its README |
|
|
46
|
+
| [`design/`](./design/) | Design and implementation-plan docs for features in flight (subagent-v2, inline agent panel, work-item splits) |
|
|
47
|
+
| [`bugs/`](./bugs/) | Bug write-ups plus security audits/issues |
|
|
48
|
+
| [`fixes/`](./fixes/) | Per-bug fix reports: root cause, evidence, applied layers |
|
|
49
|
+
| [`perf/`](./perf/) | Performance baselines, bench reports, optimization plans, sprint reports |
|
|
50
|
+
| [`archive/`](./archive/) | Dated point-in-time docs (audits, plans, fix specs, roadmaps) kept for history |
|
|
51
|
+
| [`ui-samples/`](./ui-samples/) | TUI surface catalog: captures rendered by the real render functions, PNGs, and generator scripts |
|
|
52
|
+
| [`real-test/`](./real-test/) | Real-binary test session reports and probe logs |
|
|
53
|
+
| [`evidence/`](./evidence/) | Raw evidence logs captured for work items (e.g., RED demos) |
|
|
54
|
+
| [`migration/`](./migration/) | Migration guides (e.g., atomic-write v2) |
|
|
55
|
+
| [`patterns/`](./patterns/) | Distilled reusable patterns (command → agent → skill tiers) |
|
|
56
|
+
| [`product/`](./product/) | Product-domain docs: team-run lifecycle, team-tool API, state contracts |
|
|
57
|
+
| [`skills/`](./skills/) | Skill chains and effectiveness reference |
|
|
58
|
+
| [`stories/`](./stories/) | Story-sized work packets with status |
|
|
59
|
+
| [`superpowers/`](./superpowers/) | Adopted workflow plans (`plans/`) and specs (`specs/`) |
|
|
60
|
+
| [`templates/`](./templates/) | Templates: `decision.md`, `story.md`, `validation-report.md` |
|
|
61
|
+
| [`distillation/`](./distillation/) | Distillations of external skill libraries into pi-crew patterns |
|
|
62
|
+
|
|
63
|
+
## See also
|
|
64
|
+
|
|
65
|
+
- [Package README](../README.md) and [CHANGELOG](../CHANGELOG.md)
|
|
66
|
+
- Source cluster maps: [`src/runtime/README.md`](../src/runtime/README.md),
|
|
67
|
+
[`src/state/README.md`](../src/state/README.md)
|
package/docs/architecture.md
CHANGED
|
@@ -2,8 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
`pi-crew` is a Pi package for coordinated multi-agent work. It is intentionally durable-first: every run is represented on disk, every task has a state record, and child workers stream progress into JSONL/status files so foreground sessions, background jobs, dashboards, and later restarts all read the same source of truth.
|
|
4
4
|
|
|
5
|
-
**Current version:** v0.10.3 — 100+ rounds of code review hardening (see [CHANGELOG.md](../CHANGELOG.md)).
|
|
6
|
-
|
|
7
5
|
## Layers
|
|
8
6
|
|
|
9
7
|
```text
|
|
@@ -24,39 +22,95 @@ State layer (project root resolves to <crewRoot>:
|
|
|
24
22
|
<crewRoot>/artifacts/{runId}/...
|
|
25
23
|
```
|
|
26
24
|
|
|
27
|
-
##
|
|
25
|
+
## Runtime flow
|
|
26
|
+
|
|
27
|
+
The former `docs/runtime-flow.md` was folded into this section; the standalone
|
|
28
|
+
file is being retired.
|
|
29
|
+
|
|
30
|
+
### Run lifecycle
|
|
31
|
+
|
|
32
|
+
```text
|
|
33
|
+
team tool (action=run) or /team-run
|
|
34
|
+
└─ handleTeamTool → team-tool/run.ts
|
|
35
|
+
├─ discover agents/teams/workflows; validate refs
|
|
36
|
+
├─ create run manifest, tasks.json, goal artifact
|
|
37
|
+
└─ foreground (default, session-bound) or async (background)?
|
|
38
|
+
├─ foreground: startForegroundRun() schedules executeTeamRun()
|
|
39
|
+
└─ async: spawnBackgroundTeamRun()
|
|
40
|
+
├─ node --import jiti-register.mjs background-runner.ts (detached)
|
|
41
|
+
├─ fail-fast when jiti is missing
|
|
42
|
+
└─ background-runner: append async.started, write async.pid
|
|
43
|
+
startup marker, re-discover resources, executeTeamRun()
|
|
44
|
+
|
|
45
|
+
executeTeamRun()
|
|
46
|
+
├─ mark run.running; materialize queued/running agent records lazily
|
|
47
|
+
├─ build task-graph index
|
|
48
|
+
├─ while queued tasks remain:
|
|
49
|
+
│ ├─ snapshot task graph; resolveBatchConcurrency() (hard-capped)
|
|
50
|
+
│ ├─ getReadyTasks() → run the ready batch concurrently
|
|
51
|
+
│ │ └─ runTeamTask():
|
|
52
|
+
│ │ prepare workspace/worktree, render prompt + dependency
|
|
53
|
+
│ │ context, choose model candidates from Pi config, spawn the
|
|
54
|
+
│ │ child pi process, parse its JSONL stdout/stderr, persist
|
|
55
|
+
│ │ agent status/events/output, write result/log/transcript
|
|
56
|
+
│ │ artifacts
|
|
57
|
+
│ ├─ merge task updates monotonically
|
|
58
|
+
│ ├─ optional adaptive plan injection
|
|
59
|
+
│ └─ persist tasks/agents/progress + batch artifact
|
|
60
|
+
└─ policy closeout → run.completed | run.failed | run.blocked | run.cancelled
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
Run/task states: `queued` / `planning` / `running` → `completed` / `failed` /
|
|
64
|
+
`blocked` / `cancelled`; tasks additionally use `skipped`. Terminal states are
|
|
65
|
+
monotonic — parallel merges must not regress them (see
|
|
66
|
+
[Team runner](#team-runner)).
|
|
67
|
+
|
|
68
|
+
Action routing (`status`, `cancel`, `resume`, `forget`, `doctor`, …) is
|
|
69
|
+
documented in [actions-reference.md](actions-reference.md).
|
|
70
|
+
|
|
71
|
+
### Key files in the run path
|
|
28
72
|
|
|
29
73
|
```text
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
├─ node --import jiti-register.mjs background-runner.ts
|
|
44
|
-
├─ background-runner writes async.started + async.pid marker
|
|
45
|
-
└─ executeTeamRun()
|
|
46
|
-
├─ resolve ready task batch
|
|
47
|
-
├─ resolveBatchConcurrency() with hard cap
|
|
48
|
-
├─ runTeamTask() per task
|
|
49
|
-
│ ├─ build prompt + dependency context
|
|
50
|
-
│ ├─ choose configured Pi model candidates
|
|
51
|
-
│ ├─ spawn child `pi` worker
|
|
52
|
-
│ ├─ observe JSONL/stdout progress
|
|
53
|
-
│ ├─ persist agent status/events/output
|
|
54
|
-
│ └─ write result/log/transcript artifacts
|
|
55
|
-
├─ merge task updates monotonically
|
|
56
|
-
├─ write progress artifacts
|
|
57
|
-
└─ synthesize policy closeout
|
|
74
|
+
src/extension/register.ts Pi extension entry/wiring
|
|
75
|
+
src/extension/team-tool/run.ts run creation; foreground/async split
|
|
76
|
+
src/runtime/background-runner.ts detached async entrypoint
|
|
77
|
+
src/runtime/async-runner.ts background spawn command/options
|
|
78
|
+
src/runtime/team-runner.ts workflow/task-graph scheduler
|
|
79
|
+
src/runtime/task-runner.ts single task execution (+ task-runner/)
|
|
80
|
+
src/runtime/child-pi/child-pi.ts child Pi process + output observer
|
|
81
|
+
src/runtime/model/model-fallback.ts configured model candidates/routing
|
|
82
|
+
src/runtime/scheduling/concurrency.ts batch concurrency decisions
|
|
83
|
+
src/runtime/process-status.ts pid/liveness/stale detection
|
|
84
|
+
src/state/stores/state-store.ts manifest/tasks persistence
|
|
85
|
+
src/state/event-log/event-log.ts JSONL run events
|
|
86
|
+
src/runtime/crew-agent-records.ts aggregate + per-agent status files
|
|
58
87
|
```
|
|
59
88
|
|
|
89
|
+
### Runtime env vars
|
|
90
|
+
|
|
91
|
+
The complete registry is `src/config/env-vars.ts` — the CI gate
|
|
92
|
+
(`scripts/check-env-vars.mjs`) fails on any raw `PI_CREW_*` / `PI_TEAMS_*`
|
|
93
|
+
read outside it, and mirror-pair resolution (`PI_CREW_*` ↔ `PI_TEAMS_*`)
|
|
94
|
+
lives there. The ones most likely to be set by hand:
|
|
95
|
+
|
|
96
|
+
| Env | Effect |
|
|
97
|
+
|---|---|
|
|
98
|
+
| `PI_CREW_EXECUTE_WORKERS=0` | Disable real workers; use scaffold behavior (`PI_TEAMS_EXECUTE_WORKERS=0` legacy alias). |
|
|
99
|
+
| `PI_CREW_DEPTH` / `PI_CREW_MAX_DEPTH` | Subagent recursion guard (`PI_TEAMS_*` legacy aliases). |
|
|
100
|
+
| `PI_TEAMS_HOME` | Override user config/state home (tests). |
|
|
101
|
+
| `PI_TEAMS_PI_BIN` | Override the child `pi` executable. |
|
|
102
|
+
| `PI_CREW_ASYNC_EARLY_EXIT_GUARD=0` | Disable the async-run early-exit guard. |
|
|
103
|
+
| `PI_TEAMS_MOCK_CHILD_PI` / `PI_CREW_MOCK_LIVE_SESSION` | Test hooks for mocked worker execution. |
|
|
104
|
+
| `PI_CREW_MAX_WORKERS` | Cap concurrent workers (default `max(2, cpus−2)`). |
|
|
105
|
+
| `PI_TEAMS_CHILD_RESPONSE_TIMEOUT_MS` | Child Pi response timeout. |
|
|
106
|
+
|
|
107
|
+
### Debugging a run
|
|
108
|
+
|
|
109
|
+
- `background.log` — early import/spawn errors of async runs.
|
|
110
|
+
- `events.jsonl` — run event chronology; `agents/{taskId}/status.json` — per-agent model/progress/tool status.
|
|
111
|
+
- `artifacts/{runId}/transcripts/{taskId}.jsonl` — raw child Pi transcript.
|
|
112
|
+
- `team action='status' runId=…` — canonical state + stale async detection; `/team-dashboard` for a UI overview.
|
|
113
|
+
|
|
60
114
|
## Extension layer
|
|
61
115
|
|
|
62
116
|
`src/extension/register.ts` wires the package into Pi:
|
|
@@ -169,7 +223,7 @@ Foreground runs are session-bound and should be interrupted on session shutdown
|
|
|
169
223
|
|
|
170
224
|
Key config sections:
|
|
171
225
|
|
|
172
|
-
- `runtime`: `auto
|
|
226
|
+
- `runtime`: `auto` (default; resolves to `child-process` unless config/env requests otherwise), `child-process`, `scaffold` (explicit dry-run, no child workers), experimental `live-session`.
|
|
173
227
|
- `limits`: concurrency/task/depth safety controls.
|
|
174
228
|
- `ui`: widget/dashboard/powerbar/model-token display settings.
|
|
175
229
|
- `observability`: in-memory metrics, heartbeat watcher interval, metric file retention.
|
|
@@ -179,4 +233,4 @@ Key config sections:
|
|
|
179
233
|
- `agents`: builtin overrides for models/fallbacks/tools.
|
|
180
234
|
- `autonomous`: policy injection/profile for proactive team delegation.
|
|
181
235
|
|
|
182
|
-
See `usage.md`, `resource-formats.md`,
|
|
236
|
+
See `usage.md`, `resource-formats.md`, and `live-mailbox-runtime.md` for operational details.
|
|
@@ -14,26 +14,29 @@ Slash commands are manual actions triggered from the Pi chat. Autonomous tool us
|
|
|
14
14
|
| `/team-resume <runId>` | Resume a stopped run |
|
|
15
15
|
| `/team-retry <runId>` | Retry a failed run |
|
|
16
16
|
| `/team-result <runId>` | Show a task result artifact |
|
|
17
|
-
| `/team-respond <taskId> <message>` | Respond to a waiting worker task |
|
|
18
|
-
| `/team-follow-up
|
|
17
|
+
| `/team-respond <runId> <taskId\|--all> <message>` | Respond to a waiting worker task |
|
|
18
|
+
| `/team-follow-up <runId> <taskId> <prompt>` | Send a follow-up prompt to a task |
|
|
19
19
|
| `/team-events <runId>` | View the event log |
|
|
20
20
|
| `/team-artifacts <runId>` | View artifacts |
|
|
21
21
|
| `/team-transcript <runId>` | Open the transcript viewer |
|
|
22
22
|
| `/team-worktrees <runId>` | View worktree metadata |
|
|
23
|
-
| `/team-cleanup <runId>` | Remove worktrees (interactive menu: `/team-cleanup-menu`) |
|
|
24
23
|
| `/team-forget <runId>` | Fully delete a run |
|
|
25
24
|
| `/team-prune` | Delete multiple old runs |
|
|
26
|
-
| `/team-invalidate
|
|
25
|
+
| `/team-invalidate <runId>` | Invalidate the snapshot cache for a run |
|
|
27
26
|
| `/team-export <runId>` | Export a run bundle |
|
|
28
27
|
| `/team-import <path>` | Import a run bundle |
|
|
29
28
|
| `/team-imports` | List imported bundles |
|
|
30
29
|
| `/team-api <runId> <op>` | State API interop |
|
|
31
30
|
| `/team-metrics [filter]` | View metrics |
|
|
31
|
+
| `/schedules [log <jobId-or-name>]` | List scheduled jobs (`log` tails the latest run output) |
|
|
32
32
|
| `/team-manager` | Interactive helper |
|
|
33
|
+
| `/team-cleanup-menu` | Alias for `/team-manager` (interactive menu) |
|
|
33
34
|
| `/team-dashboard` | Live dashboard overlay |
|
|
34
35
|
| `/team-init [options]` | Initialize the project layout |
|
|
35
36
|
| `/team-config [options]` | View or update config |
|
|
36
37
|
| `/team-settings <subcmd>` | Manage config keys |
|
|
38
|
+
| `/skill-list [--json]` | List builtin skill templates |
|
|
39
|
+
| `/skill-create <template-id> [--var key=value] [--project]` | Create a skill from a builtin template |
|
|
37
40
|
| `/team-autonomy <subcmd>` | Manage delegation |
|
|
38
41
|
| `/team-validate` | Validate resources |
|
|
39
42
|
| `/team-help` | Help text |
|
|
@@ -43,7 +46,8 @@ Slash commands are manual actions triggered from the Pi chat. Autonomous tool us
|
|
|
43
46
|
| **`/workflows`** | **v0.9.0** List static + dynamic workflows (`.dwf.ts`) |
|
|
44
47
|
| `/crew-view <runId> <taskId>` | Open an agent's live full-screen transcript view (thin alias for the inline-panel pane wiring; never switches sessions) |
|
|
45
48
|
| `/crew-back` | Close the agent transcript view and return to the main conversation |
|
|
46
|
-
| `/team-vibes [on\|off
|
|
49
|
+
| `/team-vibes [on\|off]` | Toggle the provider-quota status |
|
|
50
|
+
| `/crew-brief [on\|off\|status]` | Toggle brief mode for crew `team`/`agent` tool output |
|
|
47
51
|
|
|
48
52
|
**Removed (v0.10.1 docs hygiene):** `/team-orchestrate`, `/team-schedule`,
|
|
49
53
|
`/team-scheduled`, `/team-search`, `/team-graph` — phantom entries; none of
|
package/docs/troubleshooting.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Troubleshooting
|
|
2
2
|
|
|
3
|
-
Common problems and their fixes. If you hit an error code (E001–
|
|
3
|
+
Common problems and their fixes. If you hit an error code (E001–E013), see the
|
|
4
4
|
[Error codes](#error-codes) table below.
|
|
5
5
|
|
|
6
6
|
## Quick health check
|
|
@@ -130,7 +130,7 @@ team action='status' details=false # compact: status, progress, goal, issues o
|
|
|
130
130
|
|
|
131
131
|
## Error codes
|
|
132
132
|
|
|
133
|
-
pi-crew uses a structured error taxonomy (E001–
|
|
133
|
+
pi-crew uses a structured error taxonomy (E001–E013). Each error renders its
|
|
134
134
|
code + a help hint inline. Common ones:
|
|
135
135
|
|
|
136
136
|
| Code | Name | Meaning | First check |
|
|
@@ -147,6 +147,7 @@ code + a help hint inline. Common ones:
|
|
|
147
147
|
| E010 | EventLogLockTimeout | event log locked under contention | transient; retry, or lower concurrency |
|
|
148
148
|
| E011 | DepthLimitExceeded | crew nesting too deep | raise `crew.maxDepth` or flatten the call |
|
|
149
149
|
| E012 | RunStale | run reconciled as stale | see "Stale async process" above |
|
|
150
|
+
| E013 | ModelOutOfScope | requested model not in pi's `enabledModels` allowlist | pick a model listed in `enabledModels` (settings.json) or disable `reliability.scopeModels` |
|
|
150
151
|
|
|
151
152
|
## Still stuck
|
|
152
153
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-crew",
|
|
3
|
-
"version": "0.11.
|
|
3
|
+
"version": "0.11.2",
|
|
4
4
|
"description": "Pi extension for coordinated AI teams, workflows, worktrees, and async task orchestration",
|
|
5
5
|
"author": "baphuongna",
|
|
6
6
|
"license": "MIT",
|
|
@@ -53,10 +53,8 @@
|
|
|
53
53
|
"docs/usage.md",
|
|
54
54
|
"docs/architecture.md",
|
|
55
55
|
"docs/dynamic-workflows.md",
|
|
56
|
-
"docs/runtime-flow.md",
|
|
57
56
|
"docs/resource-formats.md",
|
|
58
57
|
"docs/publishing.md",
|
|
59
|
-
"docs/migration-v0.4-v0.5.md",
|
|
60
58
|
"tsconfig.json",
|
|
61
59
|
"schema.json",
|
|
62
60
|
"types/",
|
package/schema.json
CHANGED
|
@@ -344,6 +344,11 @@
|
|
|
344
344
|
"minimum": 1,
|
|
345
345
|
"maximum": 50
|
|
346
346
|
},
|
|
347
|
+
"inlinePanel": {
|
|
348
|
+
"type": "boolean",
|
|
349
|
+
"default": true,
|
|
350
|
+
"description": "Show the inline agent panel above the editor (editor-wrapper agent rows)."
|
|
351
|
+
},
|
|
347
352
|
"powerbar": {
|
|
348
353
|
"type": "boolean"
|
|
349
354
|
},
|
|
@@ -377,6 +382,11 @@
|
|
|
377
382
|
"type": "boolean",
|
|
378
383
|
"default": true
|
|
379
384
|
},
|
|
385
|
+
"autoCloseDashboardMs": {
|
|
386
|
+
"type": "integer",
|
|
387
|
+
"minimum": 0,
|
|
388
|
+
"description": "Auto-close delay for the run dashboard once the run reaches a terminal state (ms)."
|
|
389
|
+
},
|
|
380
390
|
"showModel": {
|
|
381
391
|
"type": "boolean",
|
|
382
392
|
"default": true,
|
|
@@ -509,6 +519,35 @@
|
|
|
509
519
|
"minimum": 1,
|
|
510
520
|
"maximum": 90,
|
|
511
521
|
"default": 7
|
|
522
|
+
},
|
|
523
|
+
"webhook": {
|
|
524
|
+
"type": "object",
|
|
525
|
+
"additionalProperties": false,
|
|
526
|
+
"sensitive": true,
|
|
527
|
+
"description": "US-030: opt-in outbound webhook on run terminal transitions (completed/failed/cancelled). SENSITIVE — user config only; a project-level webhook URL would let an untrusted repo exfiltrate run metadata. Disabled by default (no URL = zero network calls).",
|
|
528
|
+
"properties": {
|
|
529
|
+
"url": {
|
|
530
|
+
"type": "string",
|
|
531
|
+
"minLength": 1,
|
|
532
|
+
"pattern": "^https?://",
|
|
533
|
+
"description": "Target URL. Must be http(s); localhost/127.0.0.0-8/[::1]/169.254.0.0-16/fe80::-10 targets are refused unless allowLocalhost is true."
|
|
534
|
+
},
|
|
535
|
+
"enabled": {
|
|
536
|
+
"type": "boolean",
|
|
537
|
+
"description": "Master switch. Defaults to true when url is set; false disables (zero network)."
|
|
538
|
+
},
|
|
539
|
+
"secret": {
|
|
540
|
+
"type": "string",
|
|
541
|
+
"minLength": 1,
|
|
542
|
+
"description": "Shared secret — sets x-pi-crew-signature: sha256=<hmac-sha256(body, secret)> on every POST."
|
|
543
|
+
},
|
|
544
|
+
"allowLocalhost": {
|
|
545
|
+
"type": "boolean",
|
|
546
|
+
"description": "Explicit SSRF-guard bypass for loopback/link-local targets (e.g. a local test receiver). Default false.",
|
|
547
|
+
"default": false
|
|
548
|
+
}
|
|
549
|
+
},
|
|
550
|
+
"required": ["url"]
|
|
512
551
|
}
|
|
513
552
|
}
|
|
514
553
|
},
|
|
@@ -37,6 +37,8 @@ This artifact exists so past runs are verifiable (see SKILL.md "Output report").
|
|
|
37
37
|
| 10a surface E2E | ✅/❌/⏭️ | tmux 3/3 (spawn+self-close / kill-pane→degrade / doctor orphan) + herdr 3/3 — or skip reason per backend (no `$TMUX`/CI/no socket/in tmux for herdr) |
|
|
38
38
|
| 10b live surface run | ✅/❌/⏭️ | `visibleAgents='<set>'`, pane ids+titles during run, `worker.surface_spawned`/`worker.surface_closed` events (+ no `surface.degraded`), panes auto-closed. NOTE: `manifest.surface.panes` is `{}` at run END even on success (released on pane close) — engage-evidence is the EVENTS + `manifest.surface.provider`/`workerPids` |
|
|
39
39
|
| 10c herdr path | ✅/❌/⏭️ | ran in herdr pane / skipped (not in herdr pane) |
|
|
40
|
+
| 12 resource contracts | ✅/❌/⏭️ | 12a contracts `<pass>/<tests>` · 12b agents `<n>` / bad desc `0` / no routing `0` / strict-YAML fails `0` · 12c rendered agent lines `<n>`, all with `useWhen=` (budget-truncated by design) · 12d `<pass>/<tests>` |
|
|
41
|
+
| 13 real-run UI render | ✅/❌/⏭️ | runId `<id>` (real run, NOT fixtures); surfaces rendered: `<list>`; states: running/done/failed/focused/idle/narrow; invariant sweep `undefined` 0 · retired glyph 0 · `->` 0 · wire-format 0 · invented word 0 · bad plural 0; glyph-vs-state: spinner only while running ✅; hint survives @`<min width>` ✅; formats consistent (duration/usage/runId) ✅; catalog regenerated + 1 PNG inspected ✅ |
|
|
40
42
|
| 11 remediation regression | ✅/❌/⏭️ | sub-checks run + evidence: 11a buffered-site census `<n>` files (full test:unit `<pass>/<tests>` if run) · 11b wc-gate max `<n>`/2000 + in `ci` · 11c validator warn `<key>` → severity · 11d slow tier 3 files disjoint · 11e nightly SMOKE not-set · 11f reject format sites · 11g widgetPlacement bottom · 11h twins 3× green · 11i dead-export 0 + MUST_INCLUDE 5 · 11j committed-hash OK |
|
|
41
43
|
|
|
42
44
|
Legend: ✅ pass with evidence · ❌ fail (root cause below) · ⏭️ skipped (justify why)
|