pi-mission-control 0.0.0-dev

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.
Files changed (110) hide show
  1. package/README.md +205 -0
  2. package/agents/auditor.md +45 -0
  3. package/agents/worker.md +44 -0
  4. package/dist/index.d.ts +9 -0
  5. package/dist/index.d.ts.map +1 -0
  6. package/dist/index.js +526 -0
  7. package/dist/index.js.map +1 -0
  8. package/dist/state.d.ts +265 -0
  9. package/dist/state.d.ts.map +1 -0
  10. package/dist/state.js +474 -0
  11. package/dist/state.js.map +1 -0
  12. package/dist/tools/add-phase.d.ts +28 -0
  13. package/dist/tools/add-phase.d.ts.map +1 -0
  14. package/dist/tools/add-phase.js +69 -0
  15. package/dist/tools/add-phase.js.map +1 -0
  16. package/dist/tools/add-task.d.ts +30 -0
  17. package/dist/tools/add-task.d.ts.map +1 -0
  18. package/dist/tools/add-task.js +85 -0
  19. package/dist/tools/add-task.js.map +1 -0
  20. package/dist/tools/index.d.ts +13 -0
  21. package/dist/tools/index.d.ts.map +1 -0
  22. package/dist/tools/index.js +16 -0
  23. package/dist/tools/index.js.map +1 -0
  24. package/dist/tools/init.d.ts +34 -0
  25. package/dist/tools/init.d.ts.map +1 -0
  26. package/dist/tools/init.js +75 -0
  27. package/dist/tools/init.js.map +1 -0
  28. package/dist/tools/mission-complete.d.ts +30 -0
  29. package/dist/tools/mission-complete.d.ts.map +1 -0
  30. package/dist/tools/mission-complete.js +85 -0
  31. package/dist/tools/mission-complete.js.map +1 -0
  32. package/dist/tools/mission-resume.d.ts +35 -0
  33. package/dist/tools/mission-resume.d.ts.map +1 -0
  34. package/dist/tools/mission-resume.js +87 -0
  35. package/dist/tools/mission-resume.js.map +1 -0
  36. package/dist/tools/scaffold.d.ts +24 -0
  37. package/dist/tools/scaffold.d.ts.map +1 -0
  38. package/dist/tools/scaffold.js +129 -0
  39. package/dist/tools/scaffold.js.map +1 -0
  40. package/dist/tools/update-phase.d.ts +33 -0
  41. package/dist/tools/update-phase.d.ts.map +1 -0
  42. package/dist/tools/update-phase.js +101 -0
  43. package/dist/tools/update-phase.js.map +1 -0
  44. package/dist/tools/update-task.d.ts +34 -0
  45. package/dist/tools/update-task.d.ts.map +1 -0
  46. package/dist/tools/update-task.js +104 -0
  47. package/dist/tools/update-task.js.map +1 -0
  48. package/dist/tui/dashboard.d.ts +146 -0
  49. package/dist/tui/dashboard.d.ts.map +1 -0
  50. package/dist/tui/dashboard.js +381 -0
  51. package/dist/tui/dashboard.js.map +1 -0
  52. package/dist/tui/header.d.ts +39 -0
  53. package/dist/tui/header.d.ts.map +1 -0
  54. package/dist/tui/header.js +62 -0
  55. package/dist/tui/header.js.map +1 -0
  56. package/dist/tui/idle-view.d.ts +44 -0
  57. package/dist/tui/idle-view.d.ts.map +1 -0
  58. package/dist/tui/idle-view.js +87 -0
  59. package/dist/tui/idle-view.js.map +1 -0
  60. package/dist/tui/index.d.ts +13 -0
  61. package/dist/tui/index.d.ts.map +1 -0
  62. package/dist/tui/index.js +15 -0
  63. package/dist/tui/index.js.map +1 -0
  64. package/dist/tui/past-runs.d.ts +49 -0
  65. package/dist/tui/past-runs.d.ts.map +1 -0
  66. package/dist/tui/past-runs.js +207 -0
  67. package/dist/tui/past-runs.js.map +1 -0
  68. package/dist/tui/phases-panel.d.ts +46 -0
  69. package/dist/tui/phases-panel.d.ts.map +1 -0
  70. package/dist/tui/phases-panel.js +161 -0
  71. package/dist/tui/phases-panel.js.map +1 -0
  72. package/dist/tui/progress-bar.d.ts +37 -0
  73. package/dist/tui/progress-bar.d.ts.map +1 -0
  74. package/dist/tui/progress-bar.js +123 -0
  75. package/dist/tui/progress-bar.js.map +1 -0
  76. package/dist/tui/styles.d.ts +8 -0
  77. package/dist/tui/styles.d.ts.map +1 -0
  78. package/dist/tui/styles.js +22 -0
  79. package/dist/tui/styles.js.map +1 -0
  80. package/dist/tui/tasks-panel.d.ts +48 -0
  81. package/dist/tui/tasks-panel.d.ts.map +1 -0
  82. package/dist/tui/tasks-panel.js +191 -0
  83. package/dist/tui/tasks-panel.js.map +1 -0
  84. package/package.json +42 -0
  85. package/skills/mission-memory/SKILL.md +88 -0
  86. package/skills/mission-orchestrator/SKILL.md +167 -0
  87. package/skills/mission-pm/SKILL.md +83 -0
  88. package/skills/mission-research/SKILL.md +66 -0
  89. package/skills/mission-tech-lead/SKILL.md +68 -0
  90. package/src/index.ts +659 -0
  91. package/src/state.ts +623 -0
  92. package/src/tools/add-phase.ts +98 -0
  93. package/src/tools/add-task.ts +121 -0
  94. package/src/tools/index.ts +18 -0
  95. package/src/tools/init.ts +109 -0
  96. package/src/tools/mission-complete.ts +118 -0
  97. package/src/tools/mission-resume.ts +119 -0
  98. package/src/tools/scaffold.ts +167 -0
  99. package/src/tools/update-phase.ts +140 -0
  100. package/src/tools/update-task.ts +145 -0
  101. package/src/tui/dashboard.ts +441 -0
  102. package/src/tui/header.ts +85 -0
  103. package/src/tui/idle-view.ts +114 -0
  104. package/src/tui/index.ts +20 -0
  105. package/src/tui/past-runs.ts +261 -0
  106. package/src/tui/phases-panel.ts +199 -0
  107. package/src/tui/progress-bar.ts +152 -0
  108. package/src/tui/styles.ts +27 -0
  109. package/src/tui/tasks-panel.ts +228 -0
  110. package/templates/state.json +5 -0
package/README.md ADDED
@@ -0,0 +1,205 @@
1
+ # pi-mission-control
2
+
3
+ Visual mission orchestration extension for pi with agent hierarchy and durable state.
4
+
5
+ ## Overview
6
+
7
+ Mission Control provides a structured, visual approach to complex software development tasks. It orchestrates a hierarchy via the `mission-orchestrator` skill loaded into the main pi agent — the Orchestrator (Tech Lead/PM) delegates to Workers (Implementers) and Auditors (QA Reviewers) — to break down, execute, and verify work through durable file-based state.
8
+
9
+ **Architecture Note**: The Orchestrator is a skill representing the main user-facing pi agent behavior, not a standalone subagent. Only Worker and Auditor are spawned as subagents.
10
+
11
+ ## Features
12
+
13
+ - **Agent Hierarchy**: Heavy-model Orchestrator delegates to light-model Workers and Auditors
14
+ - **Durable State**: File-based state survives restarts and enables resume
15
+ - **Visual TUI**: Real-time progress tracking with phases, tasks, and status
16
+ - **Quality Gates**: Every task verified through Worker → Auditor PASS/FAIL cycle
17
+ - **Memory**: Short-term per-run learnings distilled into long-term cross-run knowledge
18
+
19
+ ## Installation
20
+
21
+ ### Prerequisites
22
+
23
+ 1. Install `pi-subagents` (required):
24
+ ```bash
25
+ pi install npm:pi-subagents
26
+ ```
27
+
28
+ 2. Install `pi-ask-user` (required for structured approvals and guided interviews):
29
+ ```bash
30
+ pi install npm:pi-ask-user
31
+ ```
32
+
33
+ ### From npm (when published)
34
+
35
+ ```bash
36
+ pi install npm:pi-mission-control
37
+ ```
38
+
39
+
40
+ ## Usage
41
+
42
+ ### Starting a Mission
43
+
44
+ Once the extension is loaded, use the `/mission` command:
45
+
46
+ ```
47
+ /mission
48
+ ```
49
+
50
+ This will:
51
+ 1. Scaffold worker/auditor agents and skills into `.pi/` if first use
52
+ 2. Show the Mission Control TUI (idle state with "Init new mission" button)
53
+ 3. When initiated, the Orchestrator interviews you and produces requirements
54
+
55
+ ### Mission Lifecycle
56
+
57
+ ```
58
+ /mission
59
+ ├─ Scaffolds worker/auditor agents + skills (first run)
60
+ ├─ Shows idle TUI with "Init new mission" button
61
+ └─ When initiated:
62
+ 1. mission-orchestrator → Interview user, produce 00-requirements.md
63
+ 2. mission-tech-lead → Design system → 01-architecture.md + 02-validation.md
64
+ 3. mission-pm → Break work into phases/tasks via add_phase/add_task tools
65
+ 4. mission-orchestrator → Execute via Worker → Auditor cycle
66
+ 5. mission-memory → Distill learnings to long_term.md
67
+ ```
68
+
69
+ ### Resuming a Mission
70
+
71
+ To resume a previous mission:
72
+
73
+ ```
74
+ resume mission run-20260411-143022
75
+ ```
76
+
77
+ The Orchestrator will load the previous state from `run.json` and continue.
78
+
79
+ ## Architecture
80
+
81
+ ### Agents
82
+
83
+ | Agent | Model | Role |
84
+ |-------|-------|------|
85
+ | **orchestrator** | heavy (skill) | Tech Lead, PM, Interviewer. Main pi agent behavior via `mission-orchestrator` skill. Manages workflow and spawns subagents. |
86
+ | **worker** | light (subagent) | Implementer. Executes tasks in isolated git worktrees. Spawned by orchestrator. |
87
+ | **auditor** | light (subagent) | QA Reviewer. Verifies work against contracts with PASS/FAIL. Spawned by orchestrator. |
88
+
89
+ ### Skills
90
+
91
+ | Skill | Purpose |
92
+ |-------|---------|
93
+ | **mission-orchestrator** | Primary orchestration skill representing the main pi agent behavior. Loaded first, routes between requirements, architecture, planning, execution, and closeout. |
94
+ | **mission-research** | Detailed requirements/interview workflow used by the orchestrator when requirements are missing or unclear. |
95
+ | **mission-tech-lead** | Detailed architecture and validation workflow used by the orchestrator after requirements are approved. |
96
+ | **mission-pm** | Detailed planning workflow used by the orchestrator to register phases/tasks. |
97
+ | **mission-memory** | Closeout and long-term memory distillation workflow. |
98
+
99
+ ### Runtime Files
100
+
101
+ ```
102
+ .pi/
103
+ ├── agents/ # Scaffolded subagent definitions
104
+ │ ├── worker.md
105
+ │ └── auditor.md
106
+ ├── skills/ # Scaffolded skill definitions
107
+ │ ├── mission-research/
108
+ │ ├── mission-tech-lead/
109
+ │ ├── mission-pm/
110
+ │ ├── mission-orchestrator/
111
+ │ └── mission-memory/
112
+ └── mission-control/
113
+ ├── state.json # Volatile: active_run_id, phase, status
114
+ ├── memory/
115
+ │ └── long_term.md # Cross-run distilled knowledge
116
+ └── runs/
117
+ └── run-<timestamp>/
118
+ ├── run.json # Source of truth: phases, tasks, timestamps
119
+ ├── 00-requirements.md
120
+ ├── 01-architecture.md
121
+ ├── 02-validation.md
122
+ ├── short_term_memory.md
123
+ └── tasks/
124
+ └── <task-id>/
125
+ ├── contract.md
126
+ ├── worker-output.md
127
+ └── auditor-report.md
128
+ ```
129
+
130
+ ## Development
131
+
132
+ ### Project Structure
133
+
134
+ ```
135
+ pi-mission-control/
136
+ ├── package.json # Package manifest with pi configuration
137
+ ├── tsconfig.json # TypeScript configuration
138
+ ├── src/
139
+ │ ├── index.ts # Extension entry point
140
+ │ ├── state.ts # State types and file helpers
141
+ │ ├── tools/ # Mission control tools
142
+ │ │ ├── scaffold.ts # mission_scaffold (command-only)
143
+ │ │ ├── init.ts # mission_init (command-only)
144
+ │ │ ├── add-phase.ts # add_phase (agent tool)
145
+ │ │ ├── add-task.ts # add_task (agent tool)
146
+ │ │ ├── update-phase.ts # update_phase (agent tool)
147
+ │ │ ├── update-task.ts # update_task (agent tool)
148
+ │ │ ├── mission-complete.ts
149
+ │ │ └── mission-resume.ts
150
+ │ └── tui/ # TUI components (read-only observer)
151
+ │ ├── dashboard.ts
152
+ │ ├── header.ts
153
+ │ ├── phases-panel.ts
154
+ │ ├── tasks-panel.ts
155
+ │ ├── progress-bar.ts
156
+ │ ├── past-runs.ts
157
+ │ └── idle-view.ts
158
+ ├── agents/ # Worker/auditor templates (copied on scaffold)
159
+ ├── skills/ # Skill templates (copied on scaffold)
160
+ └── templates/
161
+ └── state.json # Initial state template
162
+ ```
163
+
164
+ ### Scripts
165
+
166
+ ```bash
167
+ npm run build # Compile TypeScript to dist/
168
+ npm run dev # Watch mode compilation
169
+ npm run typecheck # Type-check without emitting
170
+ ```
171
+
172
+ ### Testing Workflow
173
+
174
+ 1. Make changes to source files in `src/`
175
+ 2. Run `npm run typecheck` to validate TypeScript
176
+ 3. Test with `pi -e ./src/index.ts`
177
+ 4. Build with `npm run build` for production testing
178
+
179
+ ## Dependencies
180
+
181
+ ### Required Extensions
182
+
183
+ | Extension | Required | Purpose |
184
+ |-----------|----------|---------|
185
+ | `pi-subagents` | **Required** | Spawns Worker and Auditor subagents in isolated git worktrees |
186
+ | `pi-ask-user` | **Required** | Structured Q&A for user approvals, interviews, and ambiguity resolution |
187
+
188
+ ### Peer Dependencies
189
+
190
+ These are provided by pi and should not be bundled:
191
+
192
+ - `@mariozechner/pi-agent-core`
193
+ - `@mariozechner/pi-ai`
194
+ - `@mariozechner/pi-coding-agent`
195
+ - `@mariozechner/pi-tui`
196
+ - `@sinclair/typebox`
197
+
198
+ ### Dev Dependencies
199
+
200
+ - `typescript` — TypeScript compiler
201
+ - `@types/node` — Node.js type definitions
202
+
203
+ ## License
204
+
205
+ MIT
@@ -0,0 +1,45 @@
1
+ ---
2
+ name: auditor
3
+ model: light
4
+ description: |
5
+ QA / Reviewer. Starts with a clean context. Reads the task contract,
6
+ reads the worker's output, inspects the git diff, and empirically runs tests
7
+ to verify the Validation Contract. Outputs a PASS or FAIL verdict.
8
+ ---
9
+
10
+ # Auditor Agent
11
+
12
+ You are an Auditor — a QA Reviewer with a clean, objective context.
13
+
14
+ ## Responsibilities
15
+ - Read the task contract from `tasks/<task_id>/contract.md`
16
+ - Read the worker's output from `tasks/<task_id>/worker-output.md`
17
+ - Inspect the git diff to verify actual code changes
18
+ - Empirically run tests to verify the Validation Contract
19
+ - Output a PASS or FAIL verdict to `tasks/<task_id>/auditor-report.md`
20
+
21
+ ## Context
22
+ Narrow and objective. Your only goal is to verify against the contract and
23
+ output a verdict. You do not fix code — you only verify it.
24
+
25
+ ## Inputs
26
+ - `contract.md` — original task contract with validation criteria
27
+ - `worker-output.md` — worker's implementation summary and evidence
28
+ - Worktree path — location of code to audit (from contract metadata)
29
+
30
+ ## Outputs
31
+ - `auditor-report.md` — audit report containing:
32
+ - **Verification Steps Taken**: what you checked (diffs, tests run)
33
+ - **Findings**: any discrepancies between contract and implementation
34
+ - **Verdict**: exactly `VERDICT: PASS` or `VERDICT: FAIL`
35
+ - **Feedback**: actionable instructions if FAIL
36
+
37
+ ## Verdict Rules
38
+ - **PASS**: Contract is fully satisfied, all tests pass, code quality acceptable
39
+ - **FAIL**: Any deviation from contract, test failures, or quality issues
40
+
41
+ ## Rules
42
+ - Be strict — if the contract says X and the worker did Y, that's a FAIL
43
+ - Run tests empirically — don't trust the worker's word
44
+ - Provide specific, actionable feedback on failure
45
+ - Do not fix code — report only
@@ -0,0 +1,44 @@
1
+ ---
2
+ name: worker
3
+ model: light
4
+ description: |
5
+ Implementer. Reads a specific task contract, navigates to an isolated git
6
+ worktree, writes code, writes tests, runs linters/tests, and outputs an
7
+ evidence report to worker-output.md.
8
+ ---
9
+
10
+ # Worker Agent
11
+
12
+ You are a Worker — a focused Implementer with narrow context.
13
+
14
+ ## Responsibilities
15
+ - Read the specific task contract from `tasks/<task_id>/contract.md`
16
+ - Work in an isolated git worktree (already prepared by the orchestrator)
17
+ - Write code and tests according to the contract directives
18
+ - Run linters and tests to verify your work
19
+ - Output an evidence report to `tasks/<task_id>/worker-output.md`
20
+
21
+ ## Context
22
+ Extremely narrow. Only know about the specific task assigned and the provided
23
+ architectural context. Do not deviate from the contract. Do not communicate
24
+ directly with the user or orchestrator — only through the output file.
25
+
26
+ ## Inputs
27
+ - `contract.md` — task contract with:
28
+ - **Metadata**: task ID, phase name, worktree path
29
+ - **Context**: summarized architecture relevant to this task
30
+ - **Directives**: step-by-step implementation instructions
31
+ - **Validation criteria**: explicit conditions to meet
32
+ - **Output instructions**: mandate to write worker-output.md
33
+
34
+ ## Outputs
35
+ - `worker-output.md` — implementation summary containing:
36
+ - **Summary of Changes**: what files were created or modified
37
+ - **Execution Log**: exact commands run and their raw output
38
+ - **Deviations**: notes if you had to deviate from the contract and why
39
+
40
+ ## Rules
41
+ - Follow the contract exactly — do not add unrequested features
42
+ - Run all validation commands specified in the contract
43
+ - Document any deviations transparently
44
+ - Do not communicate with the user — the orchestrator handles that
@@ -0,0 +1,9 @@
1
+ /**
2
+ * pi-mission-control Extension Entry Point
3
+ *
4
+ * Visual mission orchestration with agent hierarchy and durable state.
5
+ * Provides /mission command and tools for mission management.
6
+ */
7
+ import type { ExtensionAPI } from "@mariozechner/pi-coding-agent";
8
+ export default function missionControlExtension(pi: ExtensionAPI): void;
9
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAMH,OAAO,KAAK,EACV,YAAY,EAIb,MAAM,+BAA+B,CAAC;AAuZvC,MAAM,CAAC,OAAO,UAAU,uBAAuB,CAAC,EAAE,EAAE,YAAY,QA2O/D"}