@femtomc/mu-agent 26.2.88 → 26.2.89

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.
@@ -1 +1 @@
1
- {"version":3,"file":"planning-ui.d.ts","sourceRoot":"","sources":["../../src/extensions/planning-ui.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAoB,MAAM,+BAA+B,CAAC;AAmepF,wBAAgB,mBAAmB,CAAC,EAAE,EAAE,YAAY,QAydnD;AAED,eAAe,mBAAmB,CAAC"}
1
+ {"version":3,"file":"planning-ui.d.ts","sourceRoot":"","sources":["../../src/extensions/planning-ui.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAoB,MAAM,+BAA+B,CAAC;AA2fpF,wBAAgB,mBAAmB,CAAC,EAAE,EAAE,YAAY,QAydnD;AAED,eAAe,mBAAmB,CAAC"}
@@ -6,6 +6,11 @@ const DEFAULT_STEPS = [
6
6
  "Refine with user feedback until approved",
7
7
  ];
8
8
  const BAR_CHARS = ["░", "▏", "▎", "▍", "▌", "▋", "▊", "▉", "█"];
9
+ const WIDGET_STEP_LIMIT = 4;
10
+ const WIDGET_STEP_LABEL_MAX = 60;
11
+ const WIDGET_ROOT_MAX = 20;
12
+ const WIDGET_NEXT_MAX = 56;
13
+ const WIDGET_BLOCKER_MAX = 56;
9
14
  function phaseTone(phase) {
10
15
  switch (phase) {
11
16
  case "investigating":
@@ -259,7 +264,9 @@ function renderPlanningUi(ctx, state) {
259
264
  const meter = progressBar(done, total, 10);
260
265
  const waitingLabel = state.waitingOnUser ? "yes" : "no";
261
266
  const waitingColor = state.waitingOnUser ? "warning" : "dim";
262
- const blockerLabel = shortLabel(state.blocker, "(none)", 56);
267
+ const rootCompact = shortLabel(rootLabel, "(unset)", WIDGET_ROOT_MAX);
268
+ const nextCompact = shortLabel(state.nextAction, "(unset)", WIDGET_NEXT_MAX);
269
+ const blockerCompact = shortLabel(state.blocker, "(none)", WIDGET_BLOCKER_MAX);
263
270
  const blockerColor = state.blocker ? "warning" : "dim";
264
271
  ctx.ui.setStatus("mu-planning", [
265
272
  ctx.ui.theme.fg("dim", "plan"),
@@ -267,31 +274,46 @@ function renderPlanningUi(ctx, state) {
267
274
  ctx.ui.theme.fg("dim", `${done}/${total}`),
268
275
  ctx.ui.theme.fg(phaseColor, meter),
269
276
  ctx.ui.theme.fg(waitingColor, `wait:${waitingLabel}`),
270
- ctx.ui.theme.fg("muted", `root:${rootLabel}`),
277
+ ctx.ui.theme.fg("muted", `root:${rootCompact}`),
271
278
  ].join(` ${ctx.ui.theme.fg("muted", "·")} `));
272
279
  const lines = [
273
- ctx.ui.theme.fg("accent", ctx.ui.theme.bold("Planning board")),
274
- ` ${ctx.ui.theme.fg("muted", "phase:")} ${ctx.ui.theme.fg(phaseColor, phase)}`,
275
- ` ${ctx.ui.theme.fg("muted", "progress:")} ${ctx.ui.theme.fg("dim", `${done}/${total}`)} ${ctx.ui.theme.fg(phaseColor, meter)}`,
276
- ` ${ctx.ui.theme.fg("muted", "root:")} ${ctx.ui.theme.fg("dim", rootLabel)}`,
277
- ` ${ctx.ui.theme.fg("muted", "waiting_on_user:")} ${ctx.ui.theme.fg(waitingColor, waitingLabel)}`,
278
- ` ${ctx.ui.theme.fg("muted", "confidence:")} ${ctx.ui.theme.fg(confidenceColor, state.confidence)}`,
279
- ` ${ctx.ui.theme.fg("muted", "next_action:")} ${ctx.ui.theme.fg("dim", shortLabel(state.nextAction, "(unset)", 72))}`,
280
- ` ${ctx.ui.theme.fg("muted", "blocker:")} ${ctx.ui.theme.fg(blockerColor, blockerLabel)}`,
281
- ` ${ctx.ui.theme.fg("dim", "────────────────────────────")}`,
280
+ [
281
+ ctx.ui.theme.fg("accent", ctx.ui.theme.bold("Planning")),
282
+ ctx.ui.theme.fg("muted", "·"),
283
+ ctx.ui.theme.fg(phaseColor, phase),
284
+ ctx.ui.theme.fg("muted", "·"),
285
+ ctx.ui.theme.fg("dim", `${done}/${total}`),
286
+ ctx.ui.theme.fg(phaseColor, meter),
287
+ ].join(" "),
288
+ [
289
+ ctx.ui.theme.fg("muted", `root:${rootCompact}`),
290
+ ctx.ui.theme.fg("muted", "·"),
291
+ ctx.ui.theme.fg(waitingColor, `wait:${waitingLabel}`),
292
+ ctx.ui.theme.fg("muted", "·"),
293
+ ctx.ui.theme.fg(confidenceColor, `conf:${state.confidence}`),
294
+ ].join(" "),
295
+ `${ctx.ui.theme.fg("muted", "next:")} ${ctx.ui.theme.fg("dim", nextCompact)}`,
282
296
  ];
297
+ if (state.blocker) {
298
+ lines.push(`${ctx.ui.theme.fg("muted", "blocker:")} ${ctx.ui.theme.fg(blockerColor, blockerCompact)}`);
299
+ }
300
+ lines.push(ctx.ui.theme.fg("dim", "────────────────────────────"));
283
301
  if (state.steps.length === 0) {
284
- lines.push(ctx.ui.theme.fg("muted", " (no checklist steps configured)"));
302
+ lines.push(ctx.ui.theme.fg("muted", "(no checklist steps configured)"));
285
303
  }
286
304
  else {
287
- for (let index = 0; index < state.steps.length; index += 1) {
288
- const step = state.steps[index];
305
+ const shownSteps = state.steps.slice(0, WIDGET_STEP_LIMIT);
306
+ for (let index = 0; index < shownSteps.length; index += 1) {
307
+ const step = shownSteps[index];
289
308
  const mark = step.done ? ctx.ui.theme.fg("success", "☑") : ctx.ui.theme.fg("muted", "☐");
290
- const label = step.done ? ctx.ui.theme.fg("dim", step.label) : ctx.ui.theme.fg("text", step.label);
309
+ const labelText = shortLabel(step.label, "(empty)", WIDGET_STEP_LABEL_MAX);
310
+ const label = step.done ? ctx.ui.theme.fg("dim", labelText) : ctx.ui.theme.fg("text", labelText);
291
311
  lines.push(`${mark} ${ctx.ui.theme.fg("muted", `${index + 1}.`)} ${label}`);
292
312
  }
313
+ if (state.steps.length > shownSteps.length) {
314
+ lines.push(ctx.ui.theme.fg("muted", `... +${state.steps.length - shownSteps.length} more steps`));
315
+ }
293
316
  }
294
- lines.push(ctx.ui.theme.fg("muted", " /mu plan status · /mu plan snapshot"));
295
317
  ctx.ui.setWidget("mu-planning", lines, { placement: "belowEditor" });
296
318
  }
297
319
  function planningUsageText() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@femtomc/mu-agent",
3
- "version": "26.2.88",
3
+ "version": "26.2.89",
4
4
  "description": "Shared agent runtime for mu assistant sessions, orchestration roles, and serve extensions.",
5
5
  "keywords": [
6
6
  "mu",
@@ -24,7 +24,7 @@
24
24
  "themes/**"
25
25
  ],
26
26
  "dependencies": {
27
- "@femtomc/mu-core": "26.2.88",
27
+ "@femtomc/mu-core": "26.2.89",
28
28
  "@mariozechner/pi-agent-core": "^0.53.0",
29
29
  "@mariozechner/pi-ai": "^0.53.0",
30
30
  "@mariozechner/pi-coding-agent": "^0.53.0",
@@ -1,12 +1,27 @@
1
1
  ---
2
2
  name: planning
3
- description: Investigate first, then propose a concrete issue plan and refine it with the user until approved.
3
+ description: Investigate first, use the planning HUD as the user-facing status channel, then propose and refine a concrete issue DAG until approved.
4
4
  ---
5
5
 
6
6
  # Planning
7
7
 
8
8
  Use this skill when the user asks for planning, decomposition, or a staged execution roadmap.
9
9
 
10
+ ## Planning HUD is required
11
+
12
+ For this skill, the planning HUD is the primary status/communication surface.
13
+
14
+ - Keep HUD state in sync with real planning progress.
15
+ - Update HUD before and after each major planning turn.
16
+ - Use `waiting_on_user`, `next_action`, and `blocker` to communicate exactly what the user needs to do.
17
+ - Include a HUD snapshot in user-facing planning updates.
18
+
19
+ Default per-turn HUD loop:
20
+
21
+ 1. Apply an atomic `update` with current `phase`, `waiting_on_user`, `next_action`, `blocker`, and `confidence`.
22
+ 2. Synchronize checklist items and `root_issue_id` with the issue DAG.
23
+ 3. Emit `snapshot` (`compact` or `multiline`) and reflect it in your response.
24
+
10
25
  ## Core contract
11
26
 
12
27
  1. **Investigate first**
@@ -18,11 +33,17 @@ Use this skill when the user asks for planning, decomposition, or a staged execu
18
33
  - Encode dependencies so the DAG reflects execution order.
19
34
  - Add clear titles, scope, acceptance criteria, and role tags.
20
35
 
21
- 3. **Present the plan to the user**
36
+ 3. **Drive communication through the planning HUD**
37
+ - Treat HUD state as the canonical short status line for planning.
38
+ - Keep `phase`, `waiting_on_user`, `next_action`, `blocker`, and `confidence` current.
39
+ - Ensure HUD state and your natural-language response never contradict each other.
40
+
41
+ 4. **Present the plan to the user**
22
42
  - Summarize goals, sequencing, risks, and tradeoffs.
23
43
  - Include issue IDs so the user can reference exact nodes.
44
+ - Include a HUD snapshot line.
24
45
 
25
- 4. **Iterate until user approval**
46
+ 5. **Iterate until user approval**
26
47
  - Treat user feedback as first-class constraints.
27
48
  - Update issues/dependencies and re-present deltas.
28
49
  - Do not begin broad execution until the user signals satisfaction.
@@ -38,13 +59,15 @@ mu forum read user:context --limit 50 --pretty
38
59
  mu memory search --query "<topic>" --limit 30
39
60
  ```
40
61
 
41
- Optional planning HUD (interactive operator session):
62
+ Bootstrap HUD immediately (interactive operator session):
42
63
 
43
64
  ```text
44
65
  /mu plan on
45
66
  /mu plan phase investigating
46
67
  /mu plan waiting off
47
68
  /mu plan confidence medium
69
+ /mu plan next "Investigate constraints and gather evidence"
70
+ /mu plan snapshot
48
71
  ```
49
72
 
50
73
  Tool contract (preferred when tools are available):
@@ -65,13 +88,21 @@ Tool contract (preferred when tools are available):
65
88
  - `step_updates`: array of `{index, done?, label?}`
66
89
 
67
90
  Example tool calls:
68
- - Atomic update for user handoff:
91
+ - Atomic status update for an investigation turn:
92
+ - `{"action":"update","phase":"investigating","waiting_on_user":false,"next_action":"Draft root issue and child DAG","blocker":"clear","confidence":"medium"}`
93
+ - Atomic handoff when waiting for approval:
69
94
  - `{"action":"update","phase":"waiting_user","waiting_on_user":true,"next_action":"Confirm scope change","blocker":"Need approval","confidence":"low"}`
95
+ - Clear communication fields after user reply:
96
+ - `{"action":"update","waiting_on_user":false,"blocker":"clear","next_action":"Incorporate feedback and re-draft DAG"}`
70
97
  - Customize checklist:
71
98
  - `{"action":"set_steps","steps":["Investigate","Draft DAG","Review with user","Finalize"]}`
72
99
  - Human-facing status line:
73
100
  - `{"action":"snapshot","snapshot_format":"compact"}`
74
101
 
102
+ If HUD behavior is unclear, inspect implementation/tests before guessing:
103
+ - `packages/agent/src/extensions/planning-ui.ts`
104
+ - `packages/agent/test/planning_ui_tool.test.ts`
105
+
75
106
  Also inspect repo files directly (read/bash) for implementation constraints.
76
107
 
77
108
  ### B) Draft DAG in mu-issue
@@ -98,14 +129,16 @@ mu issues ready --root <root-id> --pretty
98
129
  - Proposed issue DAG (IDs + titles + ordering)
99
130
  - Risks and mitigations
100
131
  - Open questions for user approval
132
+ - HUD snapshot (compact line)
101
133
 
102
134
  ### D) Revision loop
103
135
 
104
136
  - Apply feedback with `mu issues update` / `mu issues dep` / additional issues.
105
137
  - Re-run `mu issues ready --root <root-id> --pretty`.
106
138
  - Present a concise diff of what changed and why.
139
+ - Update HUD each turn so phase/waiting/next/blocker/confidence match the latest state.
107
140
 
108
- Optional HUD updates during the loop:
141
+ Required HUD updates during the loop:
109
142
 
110
143
  ```text
111
144
  /mu plan root <root-id>
@@ -117,9 +150,18 @@ Optional HUD updates during the loop:
117
150
  /mu plan snapshot
118
151
  ```
119
152
 
153
+ ## Effective HUD usage heuristics
154
+
155
+ - Prefer `update` for multi-field changes to avoid inconsistent intermediate state.
156
+ - Reserve `waiting_user` for explicit user input/decision waits; use `blocked` for non-user blockers.
157
+ - Keep `next_action` as one concrete action, not a paragraph.
158
+ - Adjust `confidence` as evidence quality changes (`low` when assumptions are unresolved).
159
+ - Customize checklist steps once scope is understood; check them off as milestones complete.
160
+
120
161
  ## Quality bar
121
162
 
122
163
  - Every issue should be actionable and testable.
123
164
  - Keep tasks small enough to complete in one focused pass.
124
165
  - Explicitly call out uncertain assumptions for user confirmation.
125
166
  - Prefer reversible plans and incremental checkpoints.
167
+ - HUD state must be fresh, accurate, and aligned with user-visible status updates.