pi-crew 0.10.5 → 0.11.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 +292 -0
- package/agents/analyst.md +37 -2
- package/agents/cold-verifier.md +10 -1
- package/agents/councillor-critic.md +39 -0
- package/agents/councillor-pragmatist.md +39 -0
- package/agents/councillor-skeptic.md +41 -0
- package/agents/critic.md +40 -2
- package/agents/designer.md +58 -0
- package/agents/executor.md +39 -2
- package/agents/explorer.md +38 -2
- package/agents/librarian.md +49 -0
- package/agents/oracle.md +54 -0
- package/agents/orchestrator.md +48 -0
- package/agents/planner.md +41 -2
- package/agents/reviewer.md +39 -2
- package/agents/security-reviewer.md +43 -2
- package/agents/test-engineer.md +48 -2
- package/agents/verifier.md +14 -1
- package/agents/writer.md +32 -2
- package/dist/index.mjs +35196 -34789
- package/package.json +170 -169
- package/scripts/watch-agent-transcript.mjs +120 -0
- package/skills/async-worker-recovery/SKILL.md +4 -1
- package/skills/child-pi-spawning/SKILL.md +4 -1
- package/skills/context-artifact-hygiene/SKILL.md +4 -1
- package/skills/council/SKILL.md +24 -45
- package/skills/delegation-patterns/SKILL.md +18 -1
- package/skills/distill-persona/SKILL.md +4 -1
- package/skills/distill-software/SKILL.md +4 -1
- package/skills/event-log-tracing/SKILL.md +4 -1
- package/skills/git-master/SKILL.md +4 -1
- package/skills/iterative-audit/SKILL.md +4 -1
- package/skills/live-agent-lifecycle/SKILL.md +4 -1
- package/skills/mailbox-interactive/SKILL.md +4 -1
- package/skills/model-routing-context/SKILL.md +10 -1
- package/skills/multi-perspective-review/SKILL.md +18 -1
- package/skills/observability-reliability/SKILL.md +4 -1
- package/skills/orchestration/SKILL.md +18 -1
- package/skills/ownership-session-security/SKILL.md +4 -1
- package/skills/pi-extension-lifecycle/SKILL.md +4 -1
- package/skills/post-mortem/SKILL.md +4 -1
- package/skills/read-only-explorer/SKILL.md +4 -1
- package/skills/real-test-pi-crew/SKILL.md +165 -12
- package/skills/requirements-to-task-packet/SKILL.md +10 -1
- package/skills/research/SKILL.md +4 -1
- package/skills/resource-discovery-config/SKILL.md +10 -1
- package/skills/runtime-state-reader/SKILL.md +4 -1
- package/skills/safe-bash/SKILL.md +4 -1
- package/skills/scrutinize/SKILL.md +24 -1
- package/skills/secure-agent-orchestration-review/SKILL.md +4 -1
- package/skills/state-mutation-locking/SKILL.md +4 -1
- package/skills/systematic-debugging/SKILL.md +4 -1
- package/skills/verification-before-done/SKILL.md +18 -1
- package/skills/widget-rendering/SKILL.md +4 -1
- package/skills/workspace-isolation/SKILL.md +4 -1
- package/skills/worktree-isolation/SKILL.md +4 -1
- package/src/config/config-validation.ts +1 -0
- package/src/config/types.ts +8 -0
- package/src/errors.ts +1 -1
- package/src/extension/context-status-injection.ts +2 -2
- package/src/extension/crew-input-router.ts +2 -0
- package/src/extension/crew-vibes/config.ts +1 -56
- package/src/extension/crew-vibes/figures.ts +5 -84
- package/src/extension/crew-vibes/font-detect.ts +1 -1
- package/src/extension/crew-vibes/index.ts +36 -328
- package/src/extension/crew-vibes/render.ts +2 -58
- package/src/extension/help.ts +1 -0
- package/src/extension/knowledge-injection.ts +19 -7
- package/src/extension/post-init-skill-check.ts +32 -0
- package/src/extension/register.ts +9 -1
- package/src/extension/registration/command-registration.ts +5 -1
- package/src/extension/registration/commands/schedules.ts +212 -0
- package/src/extension/registration/commands/shared.ts +56 -1
- package/src/extension/registration/hook-registration.ts +20 -3
- package/src/extension/registration/lifecycle-handlers.ts +16 -2
- package/src/extension/registration/schedule-toast-bridge.ts +109 -0
- package/src/extension/registration/tool-loop-guard.ts +243 -0
- package/src/extension/registration/viewers.ts +66 -1
- package/src/extension/team-tool/handle-schedule.ts +120 -1
- package/src/extension/team-tool/handle-settings.ts +10 -0
- package/src/extension/team-tool/run.ts +42 -1
- package/src/extension/team-tool-types.ts +6 -0
- package/src/prompt/prompt-runtime.ts +25 -6
- package/src/runtime/async-runner.ts +75 -11
- package/src/runtime/background-runner.ts +41 -0
- package/src/runtime/broker/crew-broker-client.ts +45 -2
- package/src/runtime/broker/crew-broker.ts +22 -27
- package/src/runtime/broker/protocol/request-parsers.ts +10 -2
- package/src/runtime/broker/stdin-handshake.ts +87 -0
- package/src/runtime/broker/wait-push.ts +45 -0
- package/src/runtime/detached-run-results.ts +25 -1
- package/src/runtime/foreground-watchdog.ts +24 -5
- package/src/runtime/live-session/live-session-runtime.ts +1 -1
- package/src/runtime/model/model-scope.ts +2 -2
- package/src/runtime/run-tracker.ts +65 -11
- package/src/runtime/scheduling/scheduler.ts +120 -6
- package/src/runtime/settings-store.ts +28 -2
- package/src/runtime/skill-instructions.ts +20 -4
- package/src/runtime/task-runner/child-executor.ts +1 -1
- package/src/runtime/task-runner/prompt-builder.ts +22 -9
- package/src/schema/config-schema.ts +1 -0
- package/src/skills/discover-skills.ts +2 -2
- package/src/state/coordination/locks.ts +17 -2
- package/src/ui/agents-jobs-browser.ts +785 -0
- package/src/ui/dashboard-panes/agents-pane.ts +7 -4
- package/src/ui/dashboard-panes/schedules-pane.ts +154 -0
- package/src/ui/inline-panel/crew-editor.ts +19 -6
- package/src/ui/inline-panel/index.ts +6 -0
- package/src/ui/key-utils.ts +3 -0
- package/src/ui/keybinding-map.ts +56 -2
- package/src/ui/mascot.ts +2 -1
- package/src/ui/overlays/agent-picker-overlay.ts +3 -3
- package/src/ui/overlays/confirm-overlay.ts +3 -2
- package/src/ui/overlays/mailbox-compose-overlay.ts +4 -3
- package/src/ui/overlays/mailbox-detail-overlay.ts +3 -3
- package/src/ui/run-dashboard.ts +257 -6
- package/src/ui/settings-overlay.ts +43 -3
- package/src/ui/transcript-viewer.ts +3 -2
- package/src/ui/widget/index.ts +61 -88
- package/src/ui/widget/widget-formatters.ts +7 -4
- package/src/ui/widget/widget-renderer.ts +134 -174
- package/src/ui/widget/widget-types.ts +0 -7
- package/src/utils/frontmatter.ts +7 -1
- package/src/utils/ndjson.ts +9 -1
- package/src/utils/relative-time.ts +33 -0
- package/src/extension/crew-vibes/footer.ts +0 -313
- package/src/extension/crew-vibes/speed.ts +0 -286
- package/src/ui/dock-footer.ts +0 -49
package/package.json
CHANGED
|
@@ -1,171 +1,172 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
2
|
+
"name": "pi-crew",
|
|
3
|
+
"version": "0.11.0",
|
|
4
|
+
"description": "Pi extension for coordinated AI teams, workflows, worktrees, and async task orchestration",
|
|
5
|
+
"author": "baphuongna",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"engines": {
|
|
8
|
+
"node": ">=22.0.0"
|
|
9
|
+
},
|
|
10
|
+
"repository": {
|
|
11
|
+
"type": "git",
|
|
12
|
+
"url": "git+https://github.com/baphuongna/pi-crew.git"
|
|
13
|
+
},
|
|
14
|
+
"homepage": "https://github.com/baphuongna/pi-crew#readme",
|
|
15
|
+
"bugs": {
|
|
16
|
+
"url": "https://github.com/baphuongna/pi-crew/issues"
|
|
17
|
+
},
|
|
18
|
+
"type": "module",
|
|
19
|
+
"bin": {
|
|
20
|
+
"pi-crew": "install.mjs"
|
|
21
|
+
},
|
|
22
|
+
"keywords": [
|
|
23
|
+
"pi-package",
|
|
24
|
+
"pi",
|
|
25
|
+
"pi-coding-agent",
|
|
26
|
+
"teams",
|
|
27
|
+
"agents",
|
|
28
|
+
"multi-agent",
|
|
29
|
+
"orchestration"
|
|
30
|
+
],
|
|
31
|
+
"files": [
|
|
32
|
+
"src/",
|
|
33
|
+
"!src/benchmark",
|
|
34
|
+
"dist/index.mjs",
|
|
35
|
+
"index.ts",
|
|
36
|
+
"install.mjs",
|
|
37
|
+
"agents/",
|
|
38
|
+
"teams/",
|
|
39
|
+
"workflows/",
|
|
40
|
+
"skills/**",
|
|
41
|
+
"themes/",
|
|
42
|
+
"assets/crew-vibes.ttf",
|
|
43
|
+
"scripts/clean-strip-types.mjs",
|
|
44
|
+
"scripts/postinstall.mjs",
|
|
45
|
+
"scripts/install-crew-vibes-font.mjs",
|
|
46
|
+
"scripts/build-crew-vibes-font.py",
|
|
47
|
+
"scripts/pty_probe.py",
|
|
48
|
+
"README.md",
|
|
49
|
+
"AGENTS.md",
|
|
50
|
+
"docs/actions-reference.md",
|
|
51
|
+
"docs/commands-reference.md",
|
|
52
|
+
"docs/troubleshooting.md",
|
|
53
|
+
"docs/usage.md",
|
|
54
|
+
"docs/architecture.md",
|
|
55
|
+
"docs/dynamic-workflows.md",
|
|
56
|
+
"docs/runtime-flow.md",
|
|
57
|
+
"docs/resource-formats.md",
|
|
58
|
+
"docs/publishing.md",
|
|
59
|
+
"docs/migration-v0.4-v0.5.md",
|
|
60
|
+
"tsconfig.json",
|
|
61
|
+
"schema.json",
|
|
62
|
+
"types/",
|
|
63
|
+
"CHANGELOG.md",
|
|
64
|
+
"LICENSE",
|
|
65
|
+
"NOTICE.md",
|
|
66
|
+
"scripts/resource-sampler.mjs",
|
|
67
|
+
"scripts/analyze-run.mjs",
|
|
68
|
+
"scripts/watch-agent-transcript.mjs"
|
|
69
|
+
],
|
|
70
|
+
"scripts": {
|
|
71
|
+
"check": "npm run ci",
|
|
72
|
+
"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",
|
|
73
|
+
"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",
|
|
74
|
+
"check:lockfile-sync": "node scripts/check-lockfile-sync.mjs",
|
|
75
|
+
"check:lazy-imports": "node scripts/check-lazy-imports.mjs",
|
|
76
|
+
"check:bundle-staleness": "node scripts/check-bundle-staleness.mjs",
|
|
77
|
+
"check:bundle-size": "node scripts/check-bundle-size.mjs",
|
|
78
|
+
"check:conflict-markers": "node scripts/check-conflict-markers.mjs",
|
|
79
|
+
"check:decision-drift": "node scripts/check-decision-drift.mjs",
|
|
80
|
+
"check:env-vars": "node scripts/check-env-vars.mjs",
|
|
81
|
+
"check:event-types": "node scripts/check-event-types-registry.mjs",
|
|
82
|
+
"typecheck": "tsc --noEmit && node --experimental-strip-types -e \"await import('./index.ts'); console.log('strip-types import ok')\"",
|
|
83
|
+
"lint": "biome check --linter-enabled=true --formatter-enabled=false --max-diagnostics=50 .",
|
|
84
|
+
"format:check": "biome format .",
|
|
85
|
+
"test": "npm run test:unit && npm run test:integration",
|
|
86
|
+
"test:full": "npm run test:unit && npm run test:integration && npm run test:integration:slow",
|
|
87
|
+
"test:unit": "node scripts/test-runner.mjs --test-concurrency=4 --test-timeout=180000 --test-force-exit 'test/unit/**/*.test.ts'",
|
|
88
|
+
"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",
|
|
89
|
+
"test:watch": "node scripts/test-runner.mjs --watch --test-concurrency=4 --test-timeout=30000 'test/unit/**/*.test.ts'",
|
|
90
|
+
"test:integration": "node scripts/test-runner.mjs --test-concurrency=1 --test-timeout=300000 test/integration/*.test.ts",
|
|
91
|
+
"test:integration:slow": "node scripts/test-runner.mjs --test-concurrency=1 --test-timeout=600000 test/integration/slow/*.test.ts",
|
|
92
|
+
"test:system": "node scripts/test-runner.mjs --test-concurrency=1 --test-timeout=180000 --test-force-exit test/system/*.e2e.test.ts",
|
|
93
|
+
"test:smoke": "node scripts/test-runner.mjs --test-concurrency=1 --test-timeout=180000 test/smoke/*.smoke.ts",
|
|
94
|
+
"test:spike": "node scripts/test-runner.mjs --test-concurrency=2 --test-timeout=120000 --test-force-exit test/runtime/scratchpad/*.test.ts",
|
|
95
|
+
"test:functional": "node scripts/test-runner.mjs --test-concurrency=1 --test-timeout=120000 test/functional/pi-crew-functional.test.ts",
|
|
96
|
+
"test:platform": "node scripts/test-runner.mjs --test-concurrency=1 --test-timeout=60000 test/platform/*.test.ts",
|
|
97
|
+
"build:bundle": "node scripts/build-bundle.mjs",
|
|
98
|
+
"test:bundle": "node --experimental-strip-types --test --test-force-exit test/unit/bundle-load.test.ts",
|
|
99
|
+
"watch:bundle": "node scripts/watch-bundle.mjs",
|
|
100
|
+
"build:bundle:once": "node scripts/watch-bundle.mjs --once",
|
|
101
|
+
"dev": "node scripts/dev-runner.mjs",
|
|
102
|
+
"postinstall": "node scripts/postinstall.mjs",
|
|
103
|
+
"install:crew-font": "node scripts/install-crew-vibes-font.mjs",
|
|
104
|
+
"build:crew-font": "python scripts/build-crew-vibes-font.py",
|
|
105
|
+
"bench": "node scripts/run-bench.mjs",
|
|
106
|
+
"bench:check": "node scripts/bench-check.mjs",
|
|
107
|
+
"test:new": "node scripts/test-runner.mjs --test-concurrency=4 --test-timeout=30000 'test/unit/**/*.test.ts'",
|
|
108
|
+
"test:changed": "node scripts/test-changed.mjs",
|
|
109
|
+
"bench:capture": "node scripts/run-bench.mjs && node -e \"require('node:fs').copyFileSync('test/bench/results.json','test/bench/baseline.json')\"",
|
|
110
|
+
"profile:startup": "node scripts/profile-startup.mjs",
|
|
111
|
+
"smoke:pi": "pi install .",
|
|
112
|
+
"smoke:release": "node scripts/release-smoke.mjs",
|
|
113
|
+
"prepack": "node scripts/clean-strip-types.mjs",
|
|
114
|
+
"test:fast": "npm run test:critical && npm run test:bundle",
|
|
115
|
+
"check:wc-gate": "node scripts/wc-gate.mjs"
|
|
116
|
+
},
|
|
117
|
+
"exports": {
|
|
118
|
+
"./schema.json": "./schema.json",
|
|
119
|
+
"./workflow": {
|
|
120
|
+
"types": "./types/dwf.d.ts"
|
|
121
|
+
}
|
|
122
|
+
},
|
|
123
|
+
"pi": {
|
|
124
|
+
"extensions": [
|
|
125
|
+
"./index.ts"
|
|
126
|
+
],
|
|
127
|
+
"skills": [
|
|
128
|
+
"./skills"
|
|
129
|
+
]
|
|
130
|
+
},
|
|
131
|
+
"peerDependencies": {
|
|
132
|
+
"@earendil-works/pi-agent-core": "*",
|
|
133
|
+
"@earendil-works/pi-ai": "*",
|
|
134
|
+
"@earendil-works/pi-coding-agent": "*",
|
|
135
|
+
"@earendil-works/pi-tui": "*"
|
|
136
|
+
},
|
|
137
|
+
"dependencies": {
|
|
138
|
+
"@sinclair/typebox": "^0.34.50",
|
|
139
|
+
"acorn": "^8.17.0",
|
|
140
|
+
"ajv": "^8.20.0",
|
|
141
|
+
"cli-highlight": "^2.1.11",
|
|
142
|
+
"diff": "^5.2.0",
|
|
143
|
+
"esbuild": "^0.28.1",
|
|
144
|
+
"jiti": "^2.7.0",
|
|
145
|
+
"yaml": "^2.9.0"
|
|
146
|
+
},
|
|
147
|
+
"devDependencies": {
|
|
148
|
+
"@biomejs/biome": "^2.5.3",
|
|
149
|
+
"@earendil-works/pi-agent-core": "^0.84.0",
|
|
150
|
+
"@earendil-works/pi-ai": "^0.84.0",
|
|
151
|
+
"@earendil-works/pi-coding-agent": "^0.84.0",
|
|
152
|
+
"@earendil-works/pi-tui": "^0.84.0",
|
|
153
|
+
"@types/node": "^25.9.5",
|
|
154
|
+
"tsx": "^4.23.0",
|
|
155
|
+
"typescript": "^7.0.2"
|
|
156
|
+
},
|
|
157
|
+
"peerDependenciesMeta": {
|
|
158
|
+
"@earendil-works/pi-agent-core": {
|
|
159
|
+
"optional": true
|
|
160
|
+
},
|
|
161
|
+
"@earendil-works/pi-ai": {
|
|
162
|
+
"optional": true
|
|
163
|
+
},
|
|
164
|
+
"@earendil-works/pi-coding-agent": {
|
|
165
|
+
"optional": true
|
|
166
|
+
},
|
|
167
|
+
"@earendil-works/pi-tui": {
|
|
168
|
+
"optional": true
|
|
169
|
+
}
|
|
170
|
+
},
|
|
171
|
+
"readmeFilename": "README.md"
|
|
171
172
|
}
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// Watch a pi session transcript (JSONL stream events) and print one readable
|
|
3
|
+
// line per message — the "session subagent" pane companion for the Agents &
|
|
4
|
+
// Jobs browser (`p` key). Unlike `tail -F` on the raw file, every line here is
|
|
5
|
+
// a formatted summary (role badge + preview), so a tmux/herdr pane shows WHAT
|
|
6
|
+
// the agent is doing, not walls of JSON.
|
|
7
|
+
//
|
|
8
|
+
// Usage: node watch-agent-transcript.mjs <transcript.jsonl>
|
|
9
|
+
import { open as openFile } from "node:fs/promises";
|
|
10
|
+
import { basename } from "node:path";
|
|
11
|
+
|
|
12
|
+
const path = process.argv[2];
|
|
13
|
+
if (!path) {
|
|
14
|
+
console.error("usage: node watch-agent-transcript.mjs <transcript.jsonl>");
|
|
15
|
+
process.exit(1);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
const WIDTH = Math.min(200, Number(process.env.COLUMNS || 160) || 160);
|
|
19
|
+
|
|
20
|
+
function oneLine(text) {
|
|
21
|
+
return String(text ?? "")
|
|
22
|
+
.replace(/\s+/g, " ")
|
|
23
|
+
.trim();
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
function clip(text, max = WIDTH - 10) {
|
|
27
|
+
const s = oneLine(text);
|
|
28
|
+
return s.length > max ? `${s.slice(0, max - 1)}…` : s;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
function stamp(iso) {
|
|
32
|
+
const m = /^(\d{4}-\d{2}-\d{2})T(\d{2}:\d{2}:\d{2})/.exec(iso ?? "");
|
|
33
|
+
return m ? `${m[2]}` : "";
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
function renderEvent(evt) {
|
|
37
|
+
if (evt.type === "session") return "── session start ──";
|
|
38
|
+
if (evt.type === "agent_start") return "── agent start ──";
|
|
39
|
+
if (evt.type !== "message_end" || !evt.message) return null;
|
|
40
|
+
const msg = evt.message;
|
|
41
|
+
const who =
|
|
42
|
+
msg.role === "assistant" ? "🤖" : msg.role === "user" ? "👤" : msg.role === "toolResult" ? "📤" : (msg.role ?? "?");
|
|
43
|
+
const parts = Array.isArray(msg.content) ? msg.content : [{ type: "text", text: String(msg.content ?? "") }];
|
|
44
|
+
const out = [];
|
|
45
|
+
for (const part of parts) {
|
|
46
|
+
if (part.type === "thinking") out.push(`💭 ${clip(part.thinking, 120)}`);
|
|
47
|
+
else if (part.type === "text") out.push(`💬 ${clip(part.text)}`);
|
|
48
|
+
else if (part.type === "tool_use") {
|
|
49
|
+
const input = typeof part.input === "object" ? JSON.stringify(part.input) : String(part.input ?? "");
|
|
50
|
+
out.push(`🔧 ${part.name ?? "tool"} ${clip(input, 100)}`);
|
|
51
|
+
} else if (part.type === "tool_result") {
|
|
52
|
+
const content = typeof part.content === "string" ? part.content : JSON.stringify(part.content ?? "");
|
|
53
|
+
out.push(`📤 ${clip(content, 120)}`);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
if (out.length === 0) return null;
|
|
57
|
+
return `${stamp(evt.timestamp ?? msg.timestamp) || " "} ${who} ${out.join(" │ ")}`;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
// Clear the pane first — herdr/tmux panes boot via the shell, so the echoed
|
|
61
|
+
// prompt + full node command would otherwise sit above the watcher output.
|
|
62
|
+
process.stdout.write("\x1b[2J\x1b[H");
|
|
63
|
+
console.log(`── watching ${basename(path)} ──`);
|
|
64
|
+
|
|
65
|
+
let offset = 0;
|
|
66
|
+
let buffer = "";
|
|
67
|
+
const POLL_MS = 400;
|
|
68
|
+
let waitingSince = 0;
|
|
69
|
+
let lastWaitingLog = 0;
|
|
70
|
+
|
|
71
|
+
function logWaiting(now) {
|
|
72
|
+
if (!waitingSince) waitingSince = now;
|
|
73
|
+
if (now - lastWaitingLog >= 2500) {
|
|
74
|
+
const waitedS = Math.round((now - waitingSince) / 1000);
|
|
75
|
+
console.log(`… waiting for ${basename(path)} to appear (${waitedS}s)`);
|
|
76
|
+
lastWaitingLog = now;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
async function pump() {
|
|
81
|
+
try {
|
|
82
|
+
const fh = await openFile(path, "r");
|
|
83
|
+
try {
|
|
84
|
+
const stat = await fh.stat();
|
|
85
|
+
if (waitingSince) {
|
|
86
|
+
console.log(`✓ transcript appeared (waited ${Math.round((Date.now() - waitingSince) / 1000)}s)`);
|
|
87
|
+
waitingSince = 0;
|
|
88
|
+
}
|
|
89
|
+
if (stat.size < offset) offset = 0; // truncated/rotated
|
|
90
|
+
if (stat.size > offset) {
|
|
91
|
+
const len = stat.size - offset;
|
|
92
|
+
const buf = Buffer.alloc(len);
|
|
93
|
+
await fh.read(buf, 0, len, offset);
|
|
94
|
+
offset += len;
|
|
95
|
+
buffer += buf.toString("utf8");
|
|
96
|
+
const lines = buffer.split("\n");
|
|
97
|
+
buffer = lines.pop() ?? "";
|
|
98
|
+
for (const line of lines) {
|
|
99
|
+
const trimmed = line.trim();
|
|
100
|
+
if (!trimmed) continue;
|
|
101
|
+
try {
|
|
102
|
+
const rendered = renderEvent(JSON.parse(trimmed));
|
|
103
|
+
if (rendered) console.log(rendered);
|
|
104
|
+
} catch {
|
|
105
|
+
console.log(`· ${clip(trimmed)}`);
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
} finally {
|
|
110
|
+
await fh.close();
|
|
111
|
+
}
|
|
112
|
+
} catch {
|
|
113
|
+
// File not there yet (cold-start window): visible waiting state so the
|
|
114
|
+
// pane explains itself instead of looking dead.
|
|
115
|
+
logWaiting(Date.now());
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
setInterval(pump, POLL_MS);
|
|
120
|
+
await pump();
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: async-worker-recovery
|
|
3
|
-
description:
|
|
3
|
+
description: >
|
|
4
|
+
Background worker, heartbeat, stale-run, crash-recovery, and deadletter workflow. Use when debugging stuck/dead workers or changing async run reliability.
|
|
5
|
+
When NOT to use: pure investigation without async context (use read-only-explorer); one-shot fixes that don't need recovery infrastructure.
|
|
6
|
+
|
|
4
7
|
origin: pi-crew
|
|
5
8
|
triggers:
|
|
6
9
|
- "worker crashed"
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: child-pi-spawning
|
|
3
|
-
description:
|
|
3
|
+
description: >
|
|
4
|
+
Child Pi worker spawning, lifecycle callbacks, and failure modes.
|
|
5
|
+
When NOT to use: non-Pi subprocess execution (use safe-bash); for general async reliability (use async-worker-recovery).
|
|
6
|
+
|
|
4
7
|
origin: pi-crew
|
|
5
8
|
triggers:
|
|
6
9
|
- "worker crashed"
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: context-artifact-hygiene
|
|
3
|
-
description:
|
|
3
|
+
description: >
|
|
4
|
+
Use when constructing worker prompts, reading artifacts/logs, summarizing runs, compacting context, or handing work between agents.
|
|
5
|
+
When NOT to use: tasks without artifact/context concerns; pure code questions (use read-only-explorer).
|
|
6
|
+
|
|
4
7
|
origin: pi-crew
|
|
5
8
|
triggers:
|
|
6
9
|
- "construct prompt"
|
package/skills/council/SKILL.md
CHANGED
|
@@ -5,7 +5,7 @@ description: >
|
|
|
5
5
|
architecture choice, or plan. Anti-anchoring: each role receives ONLY the question,
|
|
6
6
|
not conversation history. Aggregates votes into consensus recommendation with dissent tracking.
|
|
7
7
|
Use when facing critical decisions, architecture choices, security tradeoffs, or plan reviews
|
|
8
|
-
where single-perspective analysis is insufficient.
|
|
8
|
+
where single-perspective analysis is insufficient. When NOT to use: trivial choices where consensus adds no value; time-critical decisions that can't afford 3 parallel reviews.
|
|
9
9
|
origin: ECC/skills/council
|
|
10
10
|
---
|
|
11
11
|
|
|
@@ -46,58 +46,23 @@ DO NOT bias the question toward any particular answer.
|
|
|
46
46
|
|
|
47
47
|
### Step 2: Spawn 3 Council Members
|
|
48
48
|
|
|
49
|
-
Launch 3 parallel subagents
|
|
49
|
+
Launch 3 parallel subagents, one per seat, using the councillor agents:
|
|
50
50
|
|
|
51
|
-
**Skeptic** (
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
Your role: Find every possible flaw, risk, and failure mode.
|
|
56
|
-
- Challenge assumptions
|
|
57
|
-
- Identify edge cases that break the proposed approach
|
|
58
|
-
- Focus on what could go WRONG
|
|
59
|
-
- Rate your confidence (0.0-1.0) and give a PRO/CON/ABSTAIN position
|
|
60
|
-
- Provide your top 3 risks
|
|
61
|
-
|
|
62
|
-
Output format:
|
|
63
|
-
Position: PRO | CON | ABSTAIN
|
|
64
|
-
Confidence: 0.0-1.0
|
|
65
|
-
Reasoning: [your analysis]
|
|
66
|
-
Top 3 Risks: [list]
|
|
67
|
-
```
|
|
51
|
+
- **Skeptic** (finds flaws) → `subagent_type='councillor-skeptic'`
|
|
52
|
+
- **Pragmatist** (weighs tradeoffs) → `subagent_type='councillor-pragmatist'`
|
|
53
|
+
- **Critic** (stress-tests reasoning) → `subagent_type='councillor-critic'`
|
|
68
54
|
|
|
69
|
-
|
|
70
|
-
```
|
|
71
|
-
You are the Pragmatist on a council evaluating: [QUESTION]
|
|
55
|
+
Each subagent's prompt is EXACTLY the question text from Step 1 — nothing else, no context preamble, no your-opinion-matters framing.
|
|
72
56
|
|
|
73
|
-
|
|
74
|
-
- Consider implementation cost, maintenance burden, team impact
|
|
75
|
-
- Evaluate time-to-value and opportunity cost
|
|
76
|
-
- Compare against realistic alternatives
|
|
77
|
-
- Rate your confidence (0.0-1.0) and give a PRO/CON/ABSTAIN position
|
|
57
|
+
The seat perspective, output contract (Position/Confidence/Reasoning + seat-specific field), and anti-anchoring are baked into the agent files. The councillor agents carry `inheritProjectContext: false`, so isolation is STRUCTURAL (enforced at spawn), not merely instructed — do not wrap the question with your own framing or history.
|
|
78
58
|
|
|
79
|
-
|
|
80
|
-
Position: PRO | CON | ABSTAIN
|
|
81
|
-
Confidence: 0.0-1.0
|
|
82
|
-
Reasoning: [your analysis]
|
|
83
|
-
Alternatives Considered: [list]
|
|
84
|
-
```
|
|
59
|
+
All three seats return the shared vote block:
|
|
85
60
|
|
|
86
|
-
**Critic** (Goal: Stress-test reasoning):
|
|
87
61
|
```
|
|
88
|
-
You are the Critic on a council evaluating: [QUESTION]
|
|
89
|
-
|
|
90
|
-
Your role: Stress-test the logical foundations of each possible answer.
|
|
91
|
-
- Identify logical fallacies in common arguments for/against
|
|
92
|
-
- Check if the question itself contains hidden assumptions
|
|
93
|
-
- Evaluate whether the stated constraints are real or assumed
|
|
94
|
-
- Rate your confidence (0.0-1.0) and give a PRO/CON/ABSTAIN position
|
|
95
|
-
|
|
96
|
-
Output format:
|
|
97
62
|
Position: PRO | CON | ABSTAIN
|
|
98
63
|
Confidence: 0.0-1.0
|
|
99
|
-
Reasoning:
|
|
100
|
-
Hidden Assumptions
|
|
64
|
+
Reasoning: <analysis>
|
|
65
|
+
<Seat-specific field: Top 3 Risks | Alternatives Considered | Hidden Assumptions>
|
|
101
66
|
```
|
|
102
67
|
|
|
103
68
|
### Step 3: Aggregate Votes
|
|
@@ -161,3 +126,17 @@ Before finalizing a council result, verify:
|
|
|
161
126
|
- [ ] Consensus level computed from vote pattern
|
|
162
127
|
- [ ] Dissent explicitly documented (not hidden)
|
|
163
128
|
- [ ] Recommendation includes actionable next steps
|
|
129
|
+
|
|
130
|
+
## Budget
|
|
131
|
+
|
|
132
|
+
This skill applies a 3-attempt budget: 1 initial + max 2 re-attempts.
|
|
133
|
+
|
|
134
|
+
Stamp every invocation:
|
|
135
|
+
|
|
136
|
+
```
|
|
137
|
+
attempt X of 3 (Y attempts remaining)
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
An attempt is one full council round (3 adversarial agents → aggregate → consensus). Re-attempt when votes deadlock or dissent reveals information the first round missed.
|
|
141
|
+
|
|
142
|
+
Re-attempts only when the previous attempt materially changes the decision or risk. Do NOT spend a re-attempt on mechanical changes or already-resolved findings. When exhausted, escalate to the user with options (accept risk / change scope / exceptional budget).
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: delegation-patterns
|
|
3
|
-
description:
|
|
3
|
+
description: >
|
|
4
|
+
Subagent/team delegation workflow.
|
|
5
|
+
When NOT to use: pure read-only investigation (use read-only-explorer); pre-planning analysis (use scrutinize).
|
|
6
|
+
|
|
4
7
|
origin: pi-crew
|
|
5
8
|
triggers:
|
|
6
9
|
- "delegate this"
|
|
@@ -118,3 +121,17 @@ npx tsc --noEmit
|
|
|
118
121
|
node --experimental-strip-types --test test/unit/team-recommendation.test.ts test/unit/task-output-context-security.test.ts test/integration/phase3-runtime.test.ts
|
|
119
122
|
npm test
|
|
120
123
|
```
|
|
124
|
+
|
|
125
|
+
## Budget
|
|
126
|
+
|
|
127
|
+
This skill applies a 3-attempt budget: 1 initial + max 2 re-attempts.
|
|
128
|
+
|
|
129
|
+
Stamp every invocation:
|
|
130
|
+
|
|
131
|
+
```
|
|
132
|
+
attempt X of 3 (Y attempts remaining)
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
An attempt is one delegation decision (choose agent/team → dispatch → collect). Re-attempt when the delegation target fails or returns unusable output.
|
|
136
|
+
|
|
137
|
+
Re-attempts only when the previous attempt materially changes the decision or risk. Do NOT spend a re-attempt on mechanical changes or already-resolved findings. When exhausted, escalate to the user with options (accept risk / change scope / exceptional budget).
|