@femtomc/mu-agent 26.2.106 → 26.2.108

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 (42) hide show
  1. package/README.md +41 -21
  2. package/assets/mu-tui-logo.png +0 -0
  3. package/dist/extensions/index.d.ts +1 -1
  4. package/dist/extensions/index.d.ts.map +1 -1
  5. package/dist/extensions/index.js +1 -1
  6. package/dist/extensions/mu-command-dispatcher.d.ts +0 -1
  7. package/dist/extensions/mu-command-dispatcher.d.ts.map +1 -1
  8. package/dist/extensions/mu-command-dispatcher.js +5 -42
  9. package/dist/extensions/mu-operator.js +2 -2
  10. package/dist/extensions/mu-serve.js +2 -2
  11. package/dist/extensions/ui.d.ts +4 -0
  12. package/dist/extensions/ui.d.ts.map +1 -0
  13. package/dist/extensions/ui.js +1055 -0
  14. package/dist/operator.d.ts +93 -255
  15. package/dist/operator.d.ts.map +1 -1
  16. package/dist/operator.js +41 -32
  17. package/package.json +33 -33
  18. package/prompts/skills/automation/SKILL.md +25 -0
  19. package/prompts/skills/{crons → automation/crons}/SKILL.md +2 -2
  20. package/prompts/skills/{heartbeats → automation/heartbeats}/SKILL.md +2 -2
  21. package/prompts/skills/core/SKILL.md +28 -0
  22. package/prompts/skills/{code-mode → core/code-mode}/SKILL.md +1 -1
  23. package/prompts/skills/{memory → core/memory}/SKILL.md +2 -2
  24. package/prompts/skills/{mu → core/mu}/SKILL.md +52 -9
  25. package/prompts/skills/{tmux → core/tmux}/SKILL.md +1 -1
  26. package/prompts/skills/messaging/SKILL.md +27 -0
  27. package/prompts/skills/subagents/SKILL.md +93 -243
  28. package/prompts/skills/{control-flow → subagents/control-flow}/SKILL.md +122 -17
  29. package/prompts/skills/subagents/execution/SKILL.md +428 -0
  30. package/prompts/skills/{model-routing → subagents/model-routing}/SKILL.md +179 -19
  31. package/prompts/skills/subagents/planning/SKILL.md +393 -0
  32. package/prompts/skills/{orchestration → subagents/protocol}/SKILL.md +7 -10
  33. package/prompts/skills/writing/SKILL.md +3 -2
  34. package/dist/extensions/hud.d.ts +0 -4
  35. package/dist/extensions/hud.d.ts.map +0 -1
  36. package/dist/extensions/hud.js +0 -483
  37. package/prompts/skills/hud/SKILL.md +0 -205
  38. package/prompts/skills/planning/SKILL.md +0 -244
  39. /package/prompts/skills/{setup-discord → messaging/setup-discord}/SKILL.md +0 -0
  40. /package/prompts/skills/{setup-neovim → messaging/setup-neovim}/SKILL.md +0 -0
  41. /package/prompts/skills/{setup-slack → messaging/setup-slack}/SKILL.md +0 -0
  42. /package/prompts/skills/{setup-telegram → messaging/setup-telegram}/SKILL.md +0 -0
package/README.md CHANGED
@@ -22,24 +22,28 @@ These are loaded by runtime code and are the single source of truth for default
22
22
  ## Bundled starter skills
23
23
 
24
24
  Bundled starter skills live under `packages/agent/prompts/skills/` and are bootstrapped
25
- into `~/.mu/skills/` (or `$MU_HOME/skills/`) by the CLI store-initialization path:
26
-
27
- - `mu`
28
- - `memory`
29
- - `planning`
30
- - `hud`
31
- - `orchestration`
32
- - `control-flow`
33
- - `model-routing`
34
- - `code-mode`
35
- - `tmux`
25
+ into `~/.mu/skills/` (or `$MU_HOME/skills/`) by the CLI store-initialization path.
26
+ They are organized as category meta-skills plus subskills:
27
+
28
+ - `core`
29
+ - `mu`
30
+ - `memory`
31
+ - `tmux`
32
+ - `code-mode`
36
33
  - `subagents`
37
- - `heartbeats`
38
- - `crons`
39
- - `setup-slack`
40
- - `setup-discord`
41
- - `setup-telegram`
42
- - `setup-neovim`
34
+ - `planning`
35
+ - `protocol`
36
+ - `execution`
37
+ - `control-flow`
38
+ - `model-routing`
39
+ - `automation`
40
+ - `heartbeats`
41
+ - `crons`
42
+ - `messaging`
43
+ - `setup-slack`
44
+ - `setup-discord`
45
+ - `setup-telegram`
46
+ - `setup-neovim`
43
47
  - `writing`
44
48
 
45
49
  Starter skills are version-synced by CLI bootstrap. Initial bootstrap seeds missing
@@ -71,9 +75,7 @@ Current stack:
71
75
 
72
76
  - `brandingExtension` — mu compact header/footer branding + default theme
73
77
  - `eventLogExtension` — event tail + watch widget
74
- - `hudExtension` — HUD surface for skill-directed planning/subagents communication (`/mu hud ...`, `mu_hud`) with tone/style-aware TUI widget rows, including `metadata.style_preset` support for `planning|subagents` (plain deterministic snapshots remain available via `/mu hud snapshot`)
75
-
76
- Extensions emit contract-valid `hud_docs` (`HudDoc`) so control-plane/server renderers can provide a consistent cross-surface HUD experience.
78
+ - `uiExtension` — programmable `UiDoc` surface (`/mu ui ...`, `mu_ui`) with terminal auto-prompt/awaiting behavior and deterministic action fallbacks
77
79
 
78
80
  Default operator UI theme is `mu-gruvbox-dark`.
79
81
 
@@ -82,8 +84,26 @@ Default operator UI theme is `mu-gruvbox-dark`.
82
84
  - `/mu events [n]` / `/mu events tail [n]` — event log tail
83
85
  - `/mu events watch on|off` — toggle event watch widget
84
86
  - `/mu brand on|off|toggle` — enable/disable UI branding
85
- - `/mu hud ...` — HUD command for enabling/inspecting/clearing HUD docs; does not inject HUD metadata into branding footer
87
+ - `/mu ui ...` — inspect interactive `UiDoc`s (`status`/`snapshot`)
86
88
  - `/mu help` — dispatcher catalog of registered `/mu` subcommands
89
+ - `ctrl+shift+u` — reopen local programmable-UI interaction flow (in-TUI doc/action picker, auto-fill payload-backed template values, prompt unresolved values, submit composed prompt)
90
+
91
+ ## Programmable UI documents
92
+
93
+ Skills can publish interactive UI state via the `mu_ui` tool. Rendered `UiDoc`s survive session reconnects
94
+ (30 minute retention per session ID), respect revision/version bumps, and route action clicks/taps back to
95
+ plain command text via `metadata.command_text` (the `/answer` flow is the reference pattern).
96
+
97
+ Actions without `metadata.command_text` are treated as non-interactive and rendered as deterministic fallback rows.
98
+
99
+ Current runtime behavior is channel-specific:
100
+
101
+ - Slack renders rich blocks + interactive action buttons.
102
+ - Discord/Telegram/Neovim render text-first docs; interactive actions are tokenized, while status-profile actions deterministically degrade to command-text fallback.
103
+ - Terminal operator UI (`mu serve`) renders docs in-widget, auto-prompts when agent publishes new runnable actions, shows `awaiting` UI status/widget state until resolved, and supports manual reopen via `ctrl+shift+u` (in-TUI picker overlay + prompt composition).
104
+ - When interactive controls cannot be rendered, adapters append deterministic text fallback.
105
+
106
+ See the [Programmable UI substrate guide](../../docs/mu-ui.md) for the full support matrix and workflow.
87
107
 
88
108
  ## Tooling model (CLI-first)
89
109
 
Binary file
@@ -1,8 +1,8 @@
1
1
  export { brandingExtension } from "./branding.js";
2
2
  export { eventLogExtension } from "./event-log.js";
3
- export { hudExtension } from "./hud.js";
4
3
  export { muOperatorExtension } from "./mu-operator.js";
5
4
  export { muServeExtension } from "./mu-serve.js";
5
+ export { uiExtension } from "./ui.js";
6
6
  /**
7
7
  * Serve-mode extension — single facade that bundles all serve extensions.
8
8
  */
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/extensions/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAClD,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AACxC,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAQjD;;GAEG;AACH,eAAO,MAAM,mBAAmB,UAA4C,CAAC;AAE7E;;GAEG;AACH,eAAO,MAAM,sBAAsB,UAA+C,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/extensions/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAClD,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAQtC;;GAEG;AACH,eAAO,MAAM,mBAAmB,UAA4C,CAAC;AAE7E;;GAEG;AACH,eAAO,MAAM,sBAAsB,UAA+C,CAAC"}
@@ -1,8 +1,8 @@
1
1
  export { brandingExtension } from "./branding.js";
2
2
  export { eventLogExtension } from "./event-log.js";
3
- export { hudExtension } from "./hud.js";
4
3
  export { muOperatorExtension } from "./mu-operator.js";
5
4
  export { muServeExtension } from "./mu-serve.js";
5
+ export { uiExtension } from "./ui.js";
6
6
  const RUNTIME_EXTENSION = import.meta.url.endsWith(".ts") ? "ts" : "js";
7
7
  function resolveBundledExtensionPath(moduleBasename) {
8
8
  return new URL(`./${moduleBasename}.${RUNTIME_EXTENSION}`, import.meta.url).pathname;
@@ -4,7 +4,6 @@ export type MuSubcommandRegistration = {
4
4
  subcommand: string;
5
5
  summary: string;
6
6
  usage: string;
7
- aliases?: string[];
8
7
  handler: MuSubcommandHandler;
9
8
  };
10
9
  export declare function resetMuCommandDispatcher(): void;
@@ -1 +1 @@
1
- {"version":3,"file":"mu-command-dispatcher.d.ts","sourceRoot":"","sources":["../../src/extensions/mu-command-dispatcher.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,uBAAuB,EAAE,MAAM,+BAA+B,CAAC;AAE3F,MAAM,MAAM,mBAAmB,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,uBAAuB,KAAK,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;AAEvG,MAAM,MAAM,wBAAwB,GAAG;IACtC,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,OAAO,EAAE,mBAAmB,CAAC;CAC7B,CAAC;AAcF,wBAAgB,wBAAwB,IAAI,IAAI,CAE/C;AAoHD,wBAAgB,oBAAoB,CAAC,EAAE,EAAE,YAAY,EAAE,YAAY,EAAE,wBAAwB,GAAG,IAAI,CAsDnG"}
1
+ {"version":3,"file":"mu-command-dispatcher.d.ts","sourceRoot":"","sources":["../../src/extensions/mu-command-dispatcher.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,uBAAuB,EAAE,MAAM,+BAA+B,CAAC;AAE3F,MAAM,MAAM,mBAAmB,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,uBAAuB,KAAK,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;AAEvG,MAAM,MAAM,wBAAwB,GAAG;IACtC,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,mBAAmB,CAAC;CAC7B,CAAC;AAYF,wBAAgB,wBAAwB,IAAI,IAAI,CAE/C;AA+GD,wBAAgB,oBAAoB,CAAC,EAAE,EAAE,YAAY,EAAE,YAAY,EAAE,wBAAwB,GAAG,IAAI,CAmBnG"}
@@ -10,8 +10,7 @@ function isValidSubcommandToken(value) {
10
10
  return /^[a-z][a-z0-9_-]*$/.test(value);
11
11
  }
12
12
  function subcommandUsageSummary(entry) {
13
- const aliasSuffix = entry.aliases && entry.aliases.length > 0 ? ` (aliases: ${entry.aliases.join(", ")})` : "";
14
- return `- ${entry.usage} — ${entry.summary}${aliasSuffix}`;
13
+ return `- ${entry.usage} ${entry.summary}`;
15
14
  }
16
15
  function renderSubcommandCatalog(state) {
17
16
  if (state.entries.size === 0) {
@@ -26,11 +25,7 @@ function renderSubcommandCatalog(state) {
26
25
  return lines.join("\n");
27
26
  }
28
27
  function renderSubcommandHelp(entry) {
29
- const lines = [entry.summary, "", `Usage: ${entry.usage}`];
30
- if (entry.aliases && entry.aliases.length > 0) {
31
- lines.push(`Aliases: ${entry.aliases.map((alias) => `/mu ${alias}`).join(", ")}`);
32
- }
33
- return lines.join("\n");
28
+ return [entry.summary, "", `Usage: ${entry.usage}`].join("\n");
34
29
  }
35
30
  function parseInvocation(args) {
36
31
  const trimmed = args.trim();
@@ -48,10 +43,10 @@ function parseInvocation(args) {
48
43
  }
49
44
  function resolveEntry(state, token) {
50
45
  const normalized = normalizeSubcommand(token);
51
- if (!normalized)
46
+ if (!normalized) {
52
47
  return null;
53
- const canonical = state.aliases.get(normalized) ?? normalized;
54
- return state.entries.get(canonical) ?? null;
48
+ }
49
+ return state.entries.get(normalized) ?? null;
55
50
  }
56
51
  function ensureDispatcher(pi) {
57
52
  if (singletonState) {
@@ -59,7 +54,6 @@ function ensureDispatcher(pi) {
59
54
  }
60
55
  const state = {
61
56
  entries: new Map(),
62
- aliases: new Map(),
63
57
  };
64
58
  singletonState = state;
65
59
  pi.registerCommand("mu", {
@@ -106,40 +100,9 @@ export function registerMuSubcommand(pi, registration) {
106
100
  if (!registration.usage.startsWith("/mu ")) {
107
101
  throw new Error(`mu subcommand usage must start with '/mu ': ${registration.usage}`);
108
102
  }
109
- const normalizedAliases = (registration.aliases ?? [])
110
- .map((alias) => normalizeSubcommand(alias))
111
- .filter((alias) => alias.length > 0 && alias !== normalizedSubcommand);
112
- for (const alias of normalizedAliases) {
113
- if (!isValidSubcommandToken(alias)) {
114
- throw new Error(`Invalid mu subcommand alias: ${alias}`);
115
- }
116
- if (RESERVED_SUBCOMMANDS.has(alias)) {
117
- throw new Error(`Reserved mu subcommand alias: ${alias}`);
118
- }
119
- }
120
- const existing = state.entries.get(normalizedSubcommand);
121
- if (existing) {
122
- for (const alias of existing.normalizedAliases) {
123
- state.aliases.delete(alias);
124
- }
125
- }
126
- for (const alias of normalizedAliases) {
127
- const occupiedBy = state.aliases.get(alias);
128
- if (occupiedBy && occupiedBy !== normalizedSubcommand) {
129
- throw new Error(`mu subcommand alias '${alias}' is already registered by '${occupiedBy}'`);
130
- }
131
- if (state.entries.has(alias) && alias !== normalizedSubcommand) {
132
- throw new Error(`mu subcommand alias '${alias}' conflicts with existing subcommand`);
133
- }
134
- }
135
103
  const entry = {
136
104
  ...registration,
137
105
  normalizedSubcommand,
138
- normalizedAliases,
139
106
  };
140
107
  state.entries.set(normalizedSubcommand, entry);
141
- state.aliases.set(normalizedSubcommand, normalizedSubcommand);
142
- for (const alias of normalizedAliases) {
143
- state.aliases.set(alias, normalizedSubcommand);
144
- }
145
108
  }
@@ -6,9 +6,9 @@
6
6
  */
7
7
  import { brandingExtension } from "./branding.js";
8
8
  import { eventLogExtension } from "./event-log.js";
9
- import { hudExtension } from "./hud.js";
9
+ import { uiExtension } from "./ui.js";
10
10
  export function muOperatorExtension(pi) {
11
- hudExtension(pi);
11
+ uiExtension(pi);
12
12
  brandingExtension(pi);
13
13
  eventLogExtension(pi);
14
14
  }
@@ -6,9 +6,9 @@
6
6
  */
7
7
  import { brandingExtension } from "./branding.js";
8
8
  import { eventLogExtension } from "./event-log.js";
9
- import { hudExtension } from "./hud.js";
9
+ import { uiExtension } from "./ui.js";
10
10
  export function muServeExtension(pi) {
11
- hudExtension(pi);
11
+ uiExtension(pi);
12
12
  brandingExtension(pi);
13
13
  eventLogExtension(pi);
14
14
  }
@@ -0,0 +1,4 @@
1
+ import type { ExtensionAPI } from "@mariozechner/pi-coding-agent";
2
+ export declare function uiExtension(pi: ExtensionAPI): void;
3
+ export default uiExtension;
4
+ //# sourceMappingURL=ui.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ui.d.ts","sourceRoot":"","sources":["../../src/extensions/ui.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,YAAY,EAAoB,MAAM,+BAA+B,CAAC;AA8+BpF,wBAAgB,WAAW,CAAC,EAAE,EAAE,YAAY,QA2N3C;AAED,eAAe,WAAW,CAAC"}