pi-crew 0.10.2 → 0.10.4
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/AGENTS.md +2 -1
- package/CHANGELOG.md +249 -0
- package/README.md +5 -1
- package/dist/index.mjs +10844 -7250
- package/docs/architecture.md +4 -4
- package/docs/commands-reference.md +3 -0
- package/docs/publishing.md +15 -3
- package/install.mjs +90 -39
- package/package.json +9 -3
- package/schema.json +11 -0
- package/scripts/README.md +4 -3
- package/skills/real-test-pi-crew/REPORT-TEMPLATE.md +7 -2
- package/skills/real-test-pi-crew/SKILL.md +428 -82
- package/src/config/config-merge.ts +11 -1
- package/src/config/config-validation.ts +40 -1
- package/src/config/config.ts +28 -6
- package/src/config/defaults.ts +35 -10
- package/src/config/env-vars.ts +27 -2
- package/src/config/migration-validator.ts +113 -0
- package/src/config/types.ts +36 -0
- package/src/extension/cross-extension-rpc.ts +3 -7
- package/src/extension/register.ts +13 -0
- package/src/extension/registration/lifecycle-handlers.ts +40 -9
- package/src/extension/registration/observability.ts +3 -7
- package/src/extension/registration/subagent-tools.ts +3 -7
- package/src/extension/registration/team-tool.ts +56 -12
- package/src/extension/registration/ui.ts +3 -8
- package/src/extension/registration/viewers.ts +3 -10
- package/src/extension/team-manager-command.ts +3 -7
- package/src/extension/team-tool/api/agent-control.ts +17 -10
- package/src/extension/team-tool/api/heartbeat.ts +4 -3
- package/src/extension/team-tool/api/mailbox.ts +33 -20
- package/src/extension/team-tool/api/plan-approval.ts +5 -5
- package/src/extension/team-tool/api/task-claims.ts +8 -7
- package/src/extension/team-tool/cancel.ts +6 -0
- package/src/extension/team-tool/doctor.ts +364 -7
- package/src/extension/team-tool/handle-settings.ts +23 -1
- package/src/extension/team-tool/inspect.ts +10 -2
- package/src/extension/team-tool/run.ts +3 -7
- package/src/extension/team-tool/status.ts +12 -0
- package/src/extension/team-tool.ts +41 -16
- package/src/hooks/registry.ts +62 -56
- package/src/prompt/inbox-poll.ts +90 -0
- package/src/prompt/message-tool.ts +166 -0
- package/src/prompt/prompt-runtime.ts +201 -18
- package/src/prompt/scratchpad-lifecycle.ts +3 -3
- package/src/prompt/surface-worker.ts +720 -0
- package/src/prompt/worker-events-channel.ts +49 -3
- package/src/runtime/async-runner.ts +29 -1
- package/src/runtime/background-runner.ts +43 -42
- package/src/runtime/broker/broker-issuer.ts +27 -2
- package/src/runtime/broker/crew-broker-tokens.ts +56 -4
- package/src/runtime/broker/crew-broker.ts +334 -443
- package/src/runtime/broker/delegate/delegate-event.ts +37 -0
- package/src/runtime/broker/mailbox-observer/mailbox-fanout.ts +59 -0
- package/src/runtime/broker/protocol/connection-state.ts +103 -0
- package/src/runtime/broker/protocol/events-replay.ts +68 -0
- package/src/runtime/broker/protocol/manifest-loader.ts +20 -0
- package/src/runtime/broker/protocol/msg-inbox.ts +69 -0
- package/src/runtime/broker/protocol/request-parsers.ts +175 -0
- package/src/runtime/broker/protocol/wait-auth.ts +46 -0
- package/src/runtime/child-pi/child-pi-spawn.ts +23 -9
- package/src/runtime/child-pi/child-pi-streams.ts +9 -1
- package/src/runtime/child-pi/child-pi.ts +368 -5
- package/src/runtime/crew-agent-records.ts +13 -1
- package/src/runtime/dispatch-batch.ts +12 -1
- package/src/runtime/event-log-tail-source.ts +374 -0
- package/src/runtime/finalize-run.ts +19 -7
- package/src/runtime/foreground-control.ts +19 -6
- package/src/runtime/goal-workflow/dynamic-workflow-context.ts +6 -0
- package/src/runtime/goal-workflow/dynamic-workflow-runner.ts +3 -0
- package/src/runtime/goal-workflow/goal-loop-runner.ts +29 -27
- package/src/runtime/goal-workflow/goal-state-store.ts +3 -0
- package/src/runtime/heartbeat/heartbeat-watcher.ts +3 -3
- package/src/runtime/live-session/live-agent-manager.ts +34 -1
- package/src/runtime/live-session/live-control-realtime.ts +10 -0
- package/src/runtime/live-session/live-session-runtime.ts +47 -27
- package/src/runtime/manifest-cache.ts +128 -17
- package/src/runtime/model/pi-args.ts +59 -65
- package/src/runtime/output/sidechain-output.ts +61 -6
- package/src/runtime/plan-replan.ts +3 -0
- package/src/runtime/process/proc-stat.ts +46 -0
- package/src/runtime/process/zombie-scanner.ts +32 -19
- package/src/runtime/spawn-policy.ts +27 -41
- package/src/runtime/stale-reconciler.ts +28 -3
- package/src/runtime/supervisor-contact.ts +3 -0
- package/src/runtime/surface/degrade.ts +776 -0
- package/src/runtime/surface/herdr-provider.ts +546 -0
- package/src/runtime/surface/launch-script.ts +172 -0
- package/src/runtime/surface/resolve-surface.ts +274 -0
- package/src/runtime/surface/surface-provider.ts +129 -0
- package/src/runtime/surface/surface-spawn.ts +475 -0
- package/src/runtime/surface/tmux-provider.ts +400 -0
- package/src/runtime/task-runner/child-executor.ts +80 -0
- package/src/runtime/task-runner/post-execution.ts +57 -2
- package/src/runtime/task-runner/prompt-builder.ts +1 -0
- package/src/runtime/task-runner/retrieval-orchestrator.ts +191 -56
- package/src/runtime/task-runner/state-helpers.ts +54 -30
- package/src/runtime/task-runner.ts +4 -2
- package/src/runtime/team-runner.ts +104 -3
- package/src/schema/config-schema.ts +24 -0
- package/src/state/atomic-write.ts +219 -40
- package/src/state/coordination/locks.ts +7 -5
- package/src/state/coordination/mailbox.ts +56 -10
- package/src/state/event-log/cursor.ts +413 -23
- package/src/state/event-log/event-log.ts +120 -113
- package/src/state/event-log/sequence-cache.ts +21 -3
- package/src/state/stores/ownership-map.ts +5 -4
- package/src/state/stores/plan-store.ts +12 -0
- package/src/state/stores/state-store.ts +103 -6
- package/src/state/types.ts +51 -0
- package/src/ui/inline-panel/agent-pane.ts +3 -0
- package/src/ui/powerbar-publisher.ts +3 -7
- package/src/ui/render-diff.ts +16 -8
- package/src/ui/run-action-dispatcher.ts +7 -10
- package/src/ui/run-dashboard.ts +87 -42
- package/src/ui/run-event-bus.ts +10 -1
- package/src/ui/run-snapshot-cache.ts +83 -35
- package/src/ui/settings-overlay.ts +4 -1
- package/src/ui/transcript-cache.ts +101 -13
- package/src/ui/transcript-viewer.ts +92 -24
- package/src/ui/widget/index.ts +32 -8
- package/src/utils/visual.ts +43 -0
- package/src/worktree/worktree-manager.ts +65 -4
package/docs/architecture.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
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.
|
|
5
|
+
**Current version:** v0.10.3 — 100+ rounds of code review hardening (see [CHANGELOG.md](../CHANGELOG.md)).
|
|
6
6
|
|
|
7
7
|
## Layers
|
|
8
8
|
|
|
@@ -79,11 +79,11 @@ The extension layer should remain thin: user input is normalized into tool param
|
|
|
79
79
|
|
|
80
80
|
### Task runner
|
|
81
81
|
|
|
82
|
-
`src/runtime/task-runner.ts` executes one task. It prepares workspace/worktree context, renders a task prompt, chooses model candidates from Pi configuration, launches a child Pi process by default, and writes result artifacts. Scaffold mode is explicit dry-run only.
|
|
82
|
+
`src/runtime/task-runner.ts` (thin entry, ~230 lines) executes one task; branch bodies live in `src/runtime/task-runner/` modules (`pre-execution.ts`, `child-executor.ts`, `post-execution.ts`, `live-executor.ts`, `scaffold-executor.ts`, …). It prepares workspace/worktree context, renders a task prompt, chooses model candidates from Pi configuration, launches a child Pi process by default, and writes result artifacts. Scaffold mode is explicit dry-run only.
|
|
83
83
|
|
|
84
84
|
### Child Pi runtime
|
|
85
85
|
|
|
86
|
-
`src/runtime/child-pi.ts` is the default worker runtime. It:
|
|
86
|
+
`src/runtime/child-pi/child-pi.ts` is the default worker runtime (split into the `src/runtime/child-pi/` module — `child-pi-spawn.ts`, `child-pi-streams.ts`, `child-pi-kill.ts`, `child-pi-steering.ts`, `child-pi-timers.ts`, `child-pi-transcript.ts`, `child-pi-constants.ts`). It:
|
|
87
87
|
|
|
88
88
|
- launches real `pi` child processes,
|
|
89
89
|
- hides Windows console windows with `windowsHide: true`,
|
|
@@ -98,7 +98,7 @@ The extension layer should remain thin: user input is normalized into tool param
|
|
|
98
98
|
|
|
99
99
|
### Concurrency and policy
|
|
100
100
|
|
|
101
|
-
`src/runtime/concurrency.ts` picks batch size from explicit limits, team settings, workflow settings, or built-in defaults. User-provided `limits.maxConcurrentWorkers` is hard-capped by default to prevent local DoS; `limits.allowUnboundedConcurrency=true` is an explicit opt-out and emits an observability event.
|
|
101
|
+
`src/runtime/scheduling/concurrency.ts` picks batch size from explicit limits, team settings, workflow settings, or built-in defaults. User-provided `limits.maxConcurrentWorkers` is hard-capped by default to prevent local DoS; `limits.allowUnboundedConcurrency=true` is an explicit opt-out and emits an observability event.
|
|
102
102
|
|
|
103
103
|
`src/runtime/policy-engine.ts` applies closeout and safety policy decisions such as limit exceeded, failed task blocking, stale workers, and green-contract failures.
|
|
104
104
|
|
|
@@ -41,6 +41,9 @@ Slash commands are manual actions triggered from the Pi chat. Autonomous tool us
|
|
|
41
41
|
| `/team-mascot` | Toggle the mascot overlay |
|
|
42
42
|
| **`/team-goal`** | **v0.9.0** Start autonomous goal loop (sub-actions: `start/status/pause/resume/stop/step/clear`) |
|
|
43
43
|
| **`/workflows`** | **v0.9.0** List static + dynamic workflows (`.dwf.ts`) |
|
|
44
|
+
| `/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
|
+
| `/crew-back` | Close the agent transcript view and return to the main conversation |
|
|
46
|
+
| `/team-vibes [on\|off\|speed on\|off\|capacity on\|off]` | Toggle crew-vibes speed + context meters (on/off, speed, capacity) |
|
|
44
47
|
|
|
45
48
|
**Removed (v0.10.1 docs hygiene):** `/team-orchestrate`, `/team-schedule`,
|
|
46
49
|
`/team-scheduled`, `/team-search`, `/team-graph` — phantom entries; none of
|
package/docs/publishing.md
CHANGED
|
@@ -31,7 +31,19 @@ of the full ~6,500-test `npm run check` which takes minutes):
|
|
|
31
31
|
npm run test:critical && npm run typecheck && npm run build:bundle
|
|
32
32
|
```
|
|
33
33
|
|
|
34
|
-
4. Verify
|
|
34
|
+
4. Verify dist is clean and current ("dist clean check", WI-1.3):
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
git status --short dist/ # must print NOTHING (clean)
|
|
38
|
+
node scripts/check-bundle-staleness.mjs --committed-hash # must exit 0
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
A dirty or stale committed dist silently ships old code (the v0.9.x
|
|
42
|
+
stale-bundle incident class). If either check fails: `npm run build:bundle`,
|
|
43
|
+
then commit the bundle — `git add -f dist/ && git commit -- dist`
|
|
44
|
+
(dist/ is gitignored, so `-f` is required).
|
|
45
|
+
|
|
46
|
+
5. Verify package contents:
|
|
35
47
|
|
|
36
48
|
```bash
|
|
37
49
|
npm pack --dry-run
|
|
@@ -44,7 +56,7 @@ Confirm bundled skills ship (the `real-test-pi-crew` skill references
|
|
|
44
56
|
npm pack --dry-run 2>&1 | grep -E 'skills/|pty_probe'
|
|
45
57
|
```
|
|
46
58
|
|
|
47
|
-
|
|
59
|
+
6. Verify local install in Pi:
|
|
48
60
|
|
|
49
61
|
```bash
|
|
50
62
|
pi install ./pi-crew
|
|
@@ -52,7 +64,7 @@ pi install ./pi-crew
|
|
|
52
64
|
/team-validate
|
|
53
65
|
```
|
|
54
66
|
|
|
55
|
-
|
|
67
|
+
7. Publish when ready:
|
|
56
68
|
|
|
57
69
|
```bash
|
|
58
70
|
npm publish --access public
|
package/install.mjs
CHANGED
|
@@ -2,13 +2,32 @@
|
|
|
2
2
|
import * as fs from "node:fs";
|
|
3
3
|
import * as os from "node:os";
|
|
4
4
|
import * as path from "node:path";
|
|
5
|
+
import { pathToFileURL } from "node:url";
|
|
5
6
|
|
|
6
7
|
const home = process.env.PI_TEAMS_HOME?.trim() || os.homedir();
|
|
7
8
|
const agentDir = path.join(home, ".pi", "agent");
|
|
8
9
|
const configPath = path.join(agentDir, "pi-crew.json");
|
|
9
10
|
const legacyConfigPath = path.join(agentDir, "extensions", "pi-crew", "config.json");
|
|
10
|
-
|
|
11
|
-
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Default config written to `~/.pi/agent/pi-crew.json` on fresh installs.
|
|
14
|
+
*
|
|
15
|
+
* WI-1b.2 (G17): this object is intentionally an embedded literal — install.mjs
|
|
16
|
+
* runs under bare `node` as the `pi-crew` bin (engines floor is >=22.0.0; .ts
|
|
17
|
+
* imports would require >=22.18 or `--experimental-strip-types`, which the npm
|
|
18
|
+
* bin shim cannot pass). Runtime jiti/esbuild loading was rejected as a
|
|
19
|
+
* postinstall failure surface; build-time codegen would need package.json /
|
|
20
|
+
* prepack wiring. Instead, drift is enforced by
|
|
21
|
+
* `test/unit/install-defaults-sync.test.ts`, which derives the source of truth
|
|
22
|
+
* from `src/config/defaults.ts` (DEFAULT_UI) and
|
|
23
|
+
* `src/config/config-validation.ts` (effectiveAutonomousConfig) and goes red
|
|
24
|
+
* the moment this literal diverges (mutation-demo verified).
|
|
25
|
+
*
|
|
26
|
+
* Keys mirror the curated subset in `src/extension/project-init.ts`
|
|
27
|
+
* (DEFAULT_PI_CREW_CONFIG) — deliberately non-invasive: runtime/limits use
|
|
28
|
+
* pi-crew internal defaults and are not pinned here.
|
|
29
|
+
*/
|
|
30
|
+
export const defaultConfig = {
|
|
12
31
|
autonomous: {
|
|
13
32
|
enabled: true,
|
|
14
33
|
injectPolicy: true,
|
|
@@ -30,7 +49,9 @@ const defaultConfig = {
|
|
|
30
49
|
}
|
|
31
50
|
},
|
|
32
51
|
ui: {
|
|
33
|
-
|
|
52
|
+
// G17 drift fix (2026-09): was "aboveEditor" while DEFAULT_UI.widgetPlacement
|
|
53
|
+
// is "bottom" — fresh installs were pinning a stale default into user config.
|
|
54
|
+
widgetPlacement: "bottom",
|
|
34
55
|
widgetMaxLines: 8,
|
|
35
56
|
powerbar: true,
|
|
36
57
|
dashboardPlacement: "center",
|
|
@@ -44,44 +65,74 @@ const defaultConfig = {
|
|
|
44
65
|
}
|
|
45
66
|
};
|
|
46
67
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
68
|
+
/**
|
|
69
|
+
* Postinstall / bin behavior: create the agent dir, migrate or write the
|
|
70
|
+
* default global config, and print install + uninstall guidance.
|
|
71
|
+
* Kept side-effect-for-side-effect identical to the pre-refactor top-level
|
|
72
|
+
* script (WI-1b.2 refactor only moved it behind a main-guard).
|
|
73
|
+
*/
|
|
74
|
+
export function main() {
|
|
75
|
+
fs.mkdirSync(agentDir, { recursive: true });
|
|
76
|
+
if (!fs.existsSync(configPath)) {
|
|
77
|
+
if (fs.existsSync(legacyConfigPath)) {
|
|
78
|
+
fs.copyFileSync(legacyConfigPath, configPath);
|
|
79
|
+
console.log(`Migrated pi-crew global config to: ${configPath}`);
|
|
80
|
+
} else {
|
|
81
|
+
fs.writeFileSync(configPath, `${JSON.stringify(defaultConfig, null, 2)}\n`, "utf-8");
|
|
82
|
+
console.log(`Created default pi-crew global config: ${configPath}`);
|
|
83
|
+
}
|
|
52
84
|
} else {
|
|
53
|
-
|
|
54
|
-
console.log(`Created default pi-crew global config: ${configPath}`);
|
|
85
|
+
console.log(`pi-crew global config already exists: ${configPath}`);
|
|
55
86
|
}
|
|
56
|
-
|
|
57
|
-
console.log(
|
|
87
|
+
|
|
88
|
+
console.log("\nInstall the published package in Pi with:");
|
|
89
|
+
console.log(" pi install npm:pi-crew");
|
|
90
|
+
console.log("\nFor local development from a cloned repo:");
|
|
91
|
+
console.log(" pi install .");
|
|
92
|
+
console.log("\nChild workers are enabled by default. For dry runs, set runtime.mode=scaffold or executeWorkers=false.");
|
|
93
|
+
console.log("To force-disable or force-enable workers in a shell, use PI_TEAMS_EXECUTE_WORKERS=0/1.");
|
|
94
|
+
|
|
95
|
+
// Side-effects warning (Issue #35): be upfront about what pi-crew writes and
|
|
96
|
+
// how to fully uninstall it. Nothing runs on install/registration itself; the
|
|
97
|
+
// writes below only happen when you explicitly invoke `team action=init`.
|
|
98
|
+
console.log("\n--- What pi-crew writes (and how to undo it) ---");
|
|
99
|
+
console.log("pi-crew itself writes nothing on install. The following only happens when you");
|
|
100
|
+
console.log("explicitly run `team action=init` in a project:");
|
|
101
|
+
console.log(" - A `.crew/` runtime state dir is created in the project (run history + artifacts).");
|
|
102
|
+
console.log(" - With --copy-builtins: bundled agents/teams/workflows are copied into the project.");
|
|
103
|
+
console.log("This install also created the global config above (`~/.pi/agent/pi-crew.json`).");
|
|
104
|
+
console.log("Note: pi-crew v0.8.14+ no longer injects a guidance block into AGENTS.md on init");
|
|
105
|
+
console.log(" (it was redundant — the `team` tool self-describes via tool registration).");
|
|
106
|
+
console.log(" Versions <0.8.14 did inject one; `team action=cleanup` removes it.");
|
|
107
|
+
console.log("\nFull uninstall (in order):");
|
|
108
|
+
console.log(" team action=cleanup dryRun=true # preview what would be removed (project)");
|
|
109
|
+
console.log(" team action=cleanup # remove the AGENTS.md guidance block");
|
|
110
|
+
console.log(" team action=cleanup force=true # also remove the .crew/ project state dir");
|
|
111
|
+
console.log(" team action=cleanup scope=user # remove pi-crew user-scope junk");
|
|
112
|
+
console.log(" # (~/.pi/agent/extensions/pi-crew/ + test .bak files)");
|
|
113
|
+
console.log(" team action=cleanup scope=user force=true # also remove ~/.pi/agent/pi-crew.json");
|
|
114
|
+
console.log(" pi uninstall npm:pi-crew # remove the package itself");
|
|
115
|
+
console.log("See the README 'Uninstall' section for details.");
|
|
58
116
|
}
|
|
59
117
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
118
|
+
/**
|
|
119
|
+
* Main-guard: run main() only when this file is executed directly
|
|
120
|
+
* (`node install.mjs` or via the npm `pi-crew` bin shim), never when imported
|
|
121
|
+
* as a module (e.g. by test/unit/install-defaults-sync.test.ts).
|
|
122
|
+
* realpathSync both sides: import.meta.url is the realpath (Node resolves
|
|
123
|
+
* symlinks by default), while argv[1] may be a symlinked bin path — e.g. the
|
|
124
|
+
* dev-install layout where node_modules/pi-crew symlinks into a source clone.
|
|
125
|
+
*/
|
|
126
|
+
function invokedDirectly() {
|
|
127
|
+
const invoked = process.argv[1];
|
|
128
|
+
if (!invoked) return false;
|
|
129
|
+
try {
|
|
130
|
+
return import.meta.url === pathToFileURL(fs.realpathSync(invoked)).href;
|
|
131
|
+
} catch {
|
|
132
|
+
return false;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
66
135
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
console.log("\n--- What pi-crew writes (and how to undo it) ---");
|
|
71
|
-
console.log("pi-crew itself writes nothing on install. The following only happens when you");
|
|
72
|
-
console.log("explicitly run `team action=init` in a project:");
|
|
73
|
-
console.log(" - A `.crew/` runtime state dir is created in the project (run history + artifacts).");
|
|
74
|
-
console.log(" - With --copy-builtins: bundled agents/teams/workflows are copied into the project.");
|
|
75
|
-
console.log("This install also created the global config above (`~/.pi/agent/pi-crew.json`).");
|
|
76
|
-
console.log("Note: pi-crew v0.8.14+ no longer injects a guidance block into AGENTS.md on init");
|
|
77
|
-
console.log(" (it was redundant — the `team` tool self-describes via tool registration).");
|
|
78
|
-
console.log(" Versions <0.8.14 did inject one; `team action=cleanup` removes it.");
|
|
79
|
-
console.log("\nFull uninstall (in order):");
|
|
80
|
-
console.log(" team action=cleanup dryRun=true # preview what would be removed (project)");
|
|
81
|
-
console.log(" team action=cleanup # remove the AGENTS.md guidance block");
|
|
82
|
-
console.log(" team action=cleanup force=true # also remove the .crew/ project state dir");
|
|
83
|
-
console.log(" team action=cleanup scope=user # remove pi-crew user-scope junk");
|
|
84
|
-
console.log(" # (~/.pi/agent/extensions/pi-crew/ + test .bak files)");
|
|
85
|
-
console.log(" team action=cleanup scope=user force=true # also remove ~/.pi/agent/pi-crew.json");
|
|
86
|
-
console.log(" pi uninstall npm:pi-crew # remove the package itself");
|
|
87
|
-
console.log("See the README 'Uninstall' section for details.");
|
|
136
|
+
if (invokedDirectly()) {
|
|
137
|
+
main();
|
|
138
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-crew",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.4",
|
|
4
4
|
"description": "Pi extension for coordinated AI teams, workflows, worktrees, and async task orchestration",
|
|
5
5
|
"author": "baphuongna",
|
|
6
6
|
"license": "MIT",
|
|
@@ -68,7 +68,8 @@
|
|
|
68
68
|
],
|
|
69
69
|
"scripts": {
|
|
70
70
|
"check": "npm run ci",
|
|
71
|
-
"ci": "npm run check:lockfile-sync && npm run typecheck && npm run lint && npm run format:check && npm run check:conflict-markers && npm run check:decision-drift && npm run check:env-vars && npm run check:event-types && npm run check:lazy-imports && npm run check:bundle-staleness && npm run build:bundle && npm run check:bundle-size && npm run test:bundle && npm test && npm pack --dry-run",
|
|
71
|
+
"ci": "npm run check:lockfile-sync && npm run typecheck && npm run lint && npm run format:check && npm run check:conflict-markers && npm run check:decision-drift && npm run check:env-vars && npm run check:event-types && npm run check:lazy-imports && npm run check:wc-gate && npm run check:bundle-staleness && npm run build:bundle && npm run check:bundle-size && npm run test:bundle && npm test && npm pack --dry-run",
|
|
72
|
+
"ci:fast": "npm run check:lockfile-sync && npm run typecheck && npm run lint && npm run format:check && npm run check:conflict-markers && npm run check:decision-drift && npm run check:env-vars && npm run check:event-types && npm run check:lazy-imports && npm run check:wc-gate && npm run check:bundle-staleness && npm run build:bundle && npm run check:bundle-size && npm run test:bundle && npm run test:critical && npm pack --dry-run",
|
|
72
73
|
"check:lockfile-sync": "node scripts/check-lockfile-sync.mjs",
|
|
73
74
|
"check:lazy-imports": "node scripts/check-lazy-imports.mjs",
|
|
74
75
|
"check:bundle-staleness": "node scripts/check-bundle-staleness.mjs",
|
|
@@ -81,10 +82,13 @@
|
|
|
81
82
|
"lint": "biome check --linter-enabled=true --formatter-enabled=false --max-diagnostics=50 .",
|
|
82
83
|
"format:check": "biome format .",
|
|
83
84
|
"test": "npm run test:unit && npm run test:integration",
|
|
85
|
+
"test:full": "npm run test:unit && npm run test:integration && npm run test:integration:slow",
|
|
84
86
|
"test:unit": "node scripts/test-runner.mjs --test-concurrency=4 --test-timeout=180000 --test-force-exit 'test/unit/**/*.test.ts'",
|
|
85
87
|
"test:critical": "node scripts/test-runner.mjs --test-concurrency=4 --test-timeout=30000 --test-force-exit test/unit/runtime/broker/crew-broker-handshake.test.ts test/unit/runtime/broker/crew-broker-stale-socket.test.ts test/unit/runtime/broker/crew-broker-feature-flag.test.ts test/unit/runtime/broker/crew-broker-server-gate.test.ts test/unit/runtime/broker/crew-broker-client-fallback.test.ts test/unit/runtime/broker/crew-broker-mailbox-observer.test.ts test/unit/runtime/broker/crew-broker-close-during-reconnect.test.ts test/unit/runtime/broker/crew-broker-steer-dedup.test.ts test/unit/runtime/broker/crew-broker-symlink-steering.test.ts test/unit/ui/keybinding-map.parity.test.ts test/unit/ui/pi-tui-dispatch-probe.test.ts test/unit/utils/session-utils-extract.test.ts test/unit/config/config-schema-sync.test.ts test/unit/runtime/child-pi/child-pi-env-spread.test.ts",
|
|
86
88
|
"test:watch": "node scripts/test-runner.mjs --watch --test-concurrency=4 --test-timeout=30000 'test/unit/**/*.test.ts'",
|
|
87
89
|
"test:integration": "node scripts/test-runner.mjs --test-concurrency=1 --test-timeout=300000 test/integration/*.test.ts",
|
|
90
|
+
"test:integration:slow": "node scripts/test-runner.mjs --test-concurrency=1 --test-timeout=600000 test/integration/slow/*.test.ts",
|
|
91
|
+
"test:system": "node scripts/test-runner.mjs --test-concurrency=1 --test-timeout=180000 --test-force-exit test/system/*.e2e.test.ts",
|
|
88
92
|
"test:smoke": "node scripts/test-runner.mjs --test-concurrency=1 --test-timeout=180000 test/smoke/*.smoke.ts",
|
|
89
93
|
"test:spike": "node scripts/test-runner.mjs --test-concurrency=2 --test-timeout=120000 --test-force-exit test/runtime/scratchpad/*.test.ts",
|
|
90
94
|
"test:functional": "node scripts/test-runner.mjs --test-concurrency=1 --test-timeout=120000 test/functional/pi-crew-functional.test.ts",
|
|
@@ -105,7 +109,9 @@
|
|
|
105
109
|
"profile:startup": "node scripts/profile-startup.mjs",
|
|
106
110
|
"smoke:pi": "pi install .",
|
|
107
111
|
"smoke:release": "node scripts/release-smoke.mjs",
|
|
108
|
-
"prepack": "node scripts/clean-strip-types.mjs"
|
|
112
|
+
"prepack": "node scripts/clean-strip-types.mjs",
|
|
113
|
+
"test:fast": "npm run test:critical && npm run test:bundle",
|
|
114
|
+
"check:wc-gate": "node scripts/wc-gate.mjs"
|
|
109
115
|
},
|
|
110
116
|
"exports": {
|
|
111
117
|
"./schema.json": "./schema.json",
|
package/schema.json
CHANGED
|
@@ -670,6 +670,17 @@
|
|
|
670
670
|
"description": "Max crew depth for delegate-driven nesting. Default 2 (mirrors PI_CREW_MAX_DEPTH clamp)."
|
|
671
671
|
}
|
|
672
672
|
}
|
|
673
|
+
},
|
|
674
|
+
"persistence": {
|
|
675
|
+
"type": "object",
|
|
676
|
+
"additionalProperties": false,
|
|
677
|
+
"description": "State-layer persistence knobs (perf round 2, Task 3). Opt-in only.",
|
|
678
|
+
"properties": {
|
|
679
|
+
"skipTasksFsync": {
|
|
680
|
+
"type": "boolean",
|
|
681
|
+
"description": "Opt-in (default false): write non-terminal tasks checkpoints best-effort (no fsync; the 50ms coalesced write grouping is kept — only durability is skipped, tasks.json stays reconstructible from the fsync'd event log). Terminal transitions stay full-durability. Env PI_CREW_PERSISTENCE_SKIP_TASKS_FSYNC beats this."
|
|
682
|
+
}
|
|
683
|
+
}
|
|
673
684
|
}
|
|
674
685
|
}
|
|
675
686
|
}
|
package/scripts/README.md
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
# Scripts
|
|
2
2
|
|
|
3
|
-
> **Note:**
|
|
4
|
-
>
|
|
5
|
-
>
|
|
3
|
+
> **Note:** Some scripts in this directory are one-off fix/patch scripts
|
|
4
|
+
> (e.g., `patch-*.cjs`) that were used for specific migrations or bugfixes
|
|
5
|
+
> and could be archived. The 14 `fix-*.cjs` one-offs were removed in the
|
|
6
|
+
> 2026-09 M1 hygiene sweep. Only `postinstall.mjs`, `build-bundle.mjs`,
|
|
6
7
|
> and `watch-bundle.mjs` are actively used by the project.
|
|
@@ -27,12 +27,17 @@ This artifact exists so past runs are verifiable (see SKILL.md "Output report").
|
|
|
27
27
|
| 6 pty probe | ✅/❌/⏭️ | `<keys reached handleInput / diag lines>` |
|
|
28
28
|
| 7 smoke team run | ✅/❌/⏭️ | runId `<id>`, `<n>/<n>` tasks, verifier `<dur>` (<300s) |
|
|
29
29
|
| 8 final md5 sync | ✅/❌/⏭️ | disk = session = `<md5>` |
|
|
30
|
-
| 9a read-only battery | ✅/❌/⏭️ | list/recommend/health/doctor/status/events/summary/get/explain/worktrees — `<n>/
|
|
31
|
-
| 9b spawn paths | ✅/❌/⏭️ | sync / async / chain / Agent / crew_agent — `<n>/
|
|
30
|
+
| 9a read-only battery | ✅/❌/⏭️ | list/recommend/health/doctor/status/events/summary/get/explain/worktrees/graph/search/settings — `<n>/13` |
|
|
31
|
+
| 9b spawn paths | ✅/❌/⏭️ | sync / async / chain / orchestrate-plan / Agent / crew_agent / steer_subagent — `<n>/7` |
|
|
32
|
+
| 9b-W worker tools | ✅/❌/⏭️ | ask round-trip / message notify / message DM-group / delegate nesting — which ran + evidence (reply in transcript, wake event, depth-cap reject) |
|
|
32
33
|
| 9c lifecycle | ✅/❌/⏭️ | status-details/cache/checkpoint/steer/retry/resume + live cancel — which ran |
|
|
33
34
|
| 9d destructive | ✅/❌/⏭️ | forget/cleanup/prune — which ran (note data-protection skips) |
|
|
34
35
|
| 9e admin | ✅/❌/⏭️ | team/workflow CRUD round-trip |
|
|
35
36
|
| 9f background | ✅/❌/⏭️ | auto-summarize/anchor/schedule register+remove |
|
|
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
|
+
| 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
|
+
| 10c herdr path | ✅/❌/⏭️ | ran in herdr pane / skipped (not in herdr pane) |
|
|
40
|
+
| 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 |
|
|
36
41
|
|
|
37
42
|
Legend: ✅ pass with evidence · ❌ fail (root cause below) · ⏭️ skipped (justify why)
|
|
38
43
|
|