@femtomc/mu-agent 26.2.106 → 26.2.107

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 (40) hide show
  1. package/README.md +39 -17
  2. package/assets/mu-tui-logo.png +0 -0
  3. package/dist/extensions/index.d.ts +1 -0
  4. package/dist/extensions/index.d.ts.map +1 -1
  5. package/dist/extensions/index.js +1 -0
  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.d.ts.map +1 -1
  10. package/dist/extensions/mu-operator.js +2 -0
  11. package/dist/extensions/mu-serve.d.ts.map +1 -1
  12. package/dist/extensions/mu-serve.js +2 -0
  13. package/dist/extensions/ui.d.ts +4 -0
  14. package/dist/extensions/ui.d.ts.map +1 -0
  15. package/dist/extensions/ui.js +335 -0
  16. package/dist/operator.d.ts +169 -1
  17. package/dist/operator.d.ts.map +1 -1
  18. package/dist/operator.js +77 -7
  19. package/package.json +2 -2
  20. package/prompts/skills/automation/SKILL.md +25 -0
  21. package/prompts/skills/{crons → automation/crons}/SKILL.md +2 -2
  22. package/prompts/skills/{heartbeats → automation/heartbeats}/SKILL.md +2 -2
  23. package/prompts/skills/core/SKILL.md +28 -0
  24. package/prompts/skills/{code-mode → core/code-mode}/SKILL.md +1 -1
  25. package/prompts/skills/{mu → core/mu}/SKILL.md +36 -4
  26. package/prompts/skills/{tmux → core/tmux}/SKILL.md +1 -1
  27. package/prompts/skills/messaging/SKILL.md +27 -0
  28. package/prompts/skills/subagents/SKILL.md +21 -255
  29. package/prompts/skills/{control-flow → subagents/control-flow}/SKILL.md +5 -5
  30. package/prompts/skills/subagents/execution/SKILL.md +315 -0
  31. package/prompts/skills/{model-routing → subagents/model-routing}/SKILL.md +35 -8
  32. package/prompts/skills/{planning → subagents/planning}/SKILL.md +7 -7
  33. package/prompts/skills/{orchestration → subagents/protocol}/SKILL.md +7 -10
  34. package/prompts/skills/writing/SKILL.md +1 -0
  35. /package/prompts/skills/{memory → core/memory}/SKILL.md +0 -0
  36. /package/prompts/skills/{setup-discord → messaging/setup-discord}/SKILL.md +0 -0
  37. /package/prompts/skills/{setup-neovim → messaging/setup-neovim}/SKILL.md +0 -0
  38. /package/prompts/skills/{setup-slack → messaging/setup-slack}/SKILL.md +0 -0
  39. /package/prompts/skills/{setup-telegram → messaging/setup-telegram}/SKILL.md +0 -0
  40. /package/prompts/skills/{hud → subagents/hud}/SKILL.md +0 -0
@@ -1,4 +1,4 @@
1
- import { type HudDoc } from "@femtomc/mu-core";
1
+ import { type HudDoc, type UiDoc } from "@femtomc/mu-core";
2
2
  import { z } from "zod";
3
3
  import { CommandContextResolver } from "./command_context.js";
4
4
  import { type CreateMuSessionOpts, type MuSession } from "./session_factory.js";
@@ -223,6 +223,89 @@ export declare const OperatorBackendTurnResultSchema: z.ZodDiscriminatedUnion<[z
223
223
  updated_at_ms: z.ZodNumber;
224
224
  metadata: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
225
225
  }, z.core.$strict>>>;
226
+ ui_docs: z.ZodOptional<z.ZodArray<z.ZodObject<{
227
+ v: z.ZodDefault<z.ZodLiteral<1>>;
228
+ ui_id: z.ZodString;
229
+ title: z.ZodString;
230
+ summary: z.ZodOptional<z.ZodString>;
231
+ components: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
232
+ kind: z.ZodLiteral<"text">;
233
+ id: z.ZodString;
234
+ text: z.ZodString;
235
+ tone: z.ZodOptional<z.ZodEnum<{
236
+ error: "error";
237
+ info: "info";
238
+ success: "success";
239
+ warning: "warning";
240
+ muted: "muted";
241
+ accent: "accent";
242
+ dim: "dim";
243
+ }>>;
244
+ metadata: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
245
+ }, z.core.$strict>, z.ZodObject<{
246
+ kind: z.ZodLiteral<"list">;
247
+ id: z.ZodString;
248
+ title: z.ZodOptional<z.ZodString>;
249
+ items: z.ZodArray<z.ZodObject<{
250
+ id: z.ZodString;
251
+ label: z.ZodString;
252
+ detail: z.ZodOptional<z.ZodString>;
253
+ tone: z.ZodOptional<z.ZodEnum<{
254
+ error: "error";
255
+ info: "info";
256
+ success: "success";
257
+ warning: "warning";
258
+ muted: "muted";
259
+ accent: "accent";
260
+ dim: "dim";
261
+ }>>;
262
+ }, z.core.$strict>>;
263
+ metadata: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
264
+ }, z.core.$strict>, z.ZodObject<{
265
+ kind: z.ZodLiteral<"key_value">;
266
+ id: z.ZodString;
267
+ title: z.ZodOptional<z.ZodString>;
268
+ rows: z.ZodArray<z.ZodObject<{
269
+ key: z.ZodString;
270
+ value: z.ZodString;
271
+ tone: z.ZodOptional<z.ZodEnum<{
272
+ error: "error";
273
+ info: "info";
274
+ success: "success";
275
+ warning: "warning";
276
+ muted: "muted";
277
+ accent: "accent";
278
+ dim: "dim";
279
+ }>>;
280
+ }, z.core.$strict>>;
281
+ metadata: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
282
+ }, z.core.$strict>, z.ZodObject<{
283
+ kind: z.ZodLiteral<"divider">;
284
+ id: z.ZodString;
285
+ metadata: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
286
+ }, z.core.$strict>], "kind">>;
287
+ actions: z.ZodDefault<z.ZodArray<z.ZodObject<{
288
+ id: z.ZodString;
289
+ label: z.ZodString;
290
+ kind: z.ZodOptional<z.ZodEnum<{
291
+ primary: "primary";
292
+ secondary: "secondary";
293
+ danger: "danger";
294
+ link: "link";
295
+ }>>;
296
+ description: z.ZodOptional<z.ZodString>;
297
+ component_id: z.ZodOptional<z.ZodString>;
298
+ callback_token: z.ZodOptional<z.ZodString>;
299
+ payload: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
300
+ metadata: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
301
+ }, z.core.$strict>>>;
302
+ revision: z.ZodObject<{
303
+ id: z.ZodString;
304
+ version: z.ZodNumber;
305
+ }, z.core.$strict>;
306
+ updated_at_ms: z.ZodNumber;
307
+ metadata: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
308
+ }, z.core.$strict>>>;
226
309
  }, z.core.$strip>, z.ZodObject<{
227
310
  kind: z.ZodLiteral<"command">;
228
311
  command: z.ZodDiscriminatedUnion<[z.ZodObject<{
@@ -424,6 +507,89 @@ export declare const OperatorBackendTurnResultSchema: z.ZodDiscriminatedUnion<[z
424
507
  updated_at_ms: z.ZodNumber;
425
508
  metadata: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
426
509
  }, z.core.$strict>>>;
510
+ ui_docs: z.ZodOptional<z.ZodArray<z.ZodObject<{
511
+ v: z.ZodDefault<z.ZodLiteral<1>>;
512
+ ui_id: z.ZodString;
513
+ title: z.ZodString;
514
+ summary: z.ZodOptional<z.ZodString>;
515
+ components: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
516
+ kind: z.ZodLiteral<"text">;
517
+ id: z.ZodString;
518
+ text: z.ZodString;
519
+ tone: z.ZodOptional<z.ZodEnum<{
520
+ error: "error";
521
+ info: "info";
522
+ success: "success";
523
+ warning: "warning";
524
+ muted: "muted";
525
+ accent: "accent";
526
+ dim: "dim";
527
+ }>>;
528
+ metadata: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
529
+ }, z.core.$strict>, z.ZodObject<{
530
+ kind: z.ZodLiteral<"list">;
531
+ id: z.ZodString;
532
+ title: z.ZodOptional<z.ZodString>;
533
+ items: z.ZodArray<z.ZodObject<{
534
+ id: z.ZodString;
535
+ label: z.ZodString;
536
+ detail: z.ZodOptional<z.ZodString>;
537
+ tone: z.ZodOptional<z.ZodEnum<{
538
+ error: "error";
539
+ info: "info";
540
+ success: "success";
541
+ warning: "warning";
542
+ muted: "muted";
543
+ accent: "accent";
544
+ dim: "dim";
545
+ }>>;
546
+ }, z.core.$strict>>;
547
+ metadata: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
548
+ }, z.core.$strict>, z.ZodObject<{
549
+ kind: z.ZodLiteral<"key_value">;
550
+ id: z.ZodString;
551
+ title: z.ZodOptional<z.ZodString>;
552
+ rows: z.ZodArray<z.ZodObject<{
553
+ key: z.ZodString;
554
+ value: z.ZodString;
555
+ tone: z.ZodOptional<z.ZodEnum<{
556
+ error: "error";
557
+ info: "info";
558
+ success: "success";
559
+ warning: "warning";
560
+ muted: "muted";
561
+ accent: "accent";
562
+ dim: "dim";
563
+ }>>;
564
+ }, z.core.$strict>>;
565
+ metadata: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
566
+ }, z.core.$strict>, z.ZodObject<{
567
+ kind: z.ZodLiteral<"divider">;
568
+ id: z.ZodString;
569
+ metadata: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
570
+ }, z.core.$strict>], "kind">>;
571
+ actions: z.ZodDefault<z.ZodArray<z.ZodObject<{
572
+ id: z.ZodString;
573
+ label: z.ZodString;
574
+ kind: z.ZodOptional<z.ZodEnum<{
575
+ primary: "primary";
576
+ secondary: "secondary";
577
+ danger: "danger";
578
+ link: "link";
579
+ }>>;
580
+ description: z.ZodOptional<z.ZodString>;
581
+ component_id: z.ZodOptional<z.ZodString>;
582
+ callback_token: z.ZodOptional<z.ZodString>;
583
+ payload: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
584
+ metadata: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
585
+ }, z.core.$strict>>>;
586
+ revision: z.ZodObject<{
587
+ id: z.ZodString;
588
+ version: z.ZodNumber;
589
+ }, z.core.$strict>;
590
+ updated_at_ms: z.ZodNumber;
591
+ metadata: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
592
+ }, z.core.$strict>>>;
427
593
  }, z.core.$strip>], "kind">;
428
594
  export type OperatorBackendTurnResult = z.infer<typeof OperatorBackendTurnResultSchema>;
429
595
  export type OperatorBackendTurnInput = {
@@ -441,12 +607,14 @@ export type OperatorDecision = {
441
607
  kind: "response";
442
608
  message: string;
443
609
  hud_docs?: HudDoc[];
610
+ ui_docs?: UiDoc[];
444
611
  operatorSessionId: string;
445
612
  operatorTurnId: string;
446
613
  } | {
447
614
  kind: "command";
448
615
  commandText: string;
449
616
  hud_docs?: HudDoc[];
617
+ ui_docs?: UiDoc[];
450
618
  operatorSessionId: string;
451
619
  operatorTurnId: string;
452
620
  } | {
@@ -1 +1 @@
1
- {"version":3,"file":"operator.d.ts","sourceRoot":"","sources":["../src/operator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,KAAK,MAAM,EAAoB,MAAM,kBAAkB,CAAC;AAI/E,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AAC9D,OAAO,EAAmB,KAAK,mBAAmB,EAAE,KAAK,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjG,OAAO,EAAE,8BAA8B,EAAE,MAAM,sBAAsB,CAAC;AAEtE,MAAM,MAAM,gCAAgC,GAAG;IAC9C,OAAO,EAAE,MAAM,CAAC;IAChB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,uBAAuB,EAAE,MAAM,CAAC;IAChC,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAClC,CAAC;AAEF,MAAM,MAAM,gCAAgC,GAAG;IAC9C,UAAU,EAAE,MAAM,CAAC;IACnB,cAAc,EAAE,MAAM,CAAC;CAC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,0BAA2B,YAAW,wBAAwB;;gBAiBvD,IAAI,GAAE,8BAAmC;IAmK/C,YAAY,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAqBjD,OAAO,CAAC,KAAK,EAAE,wBAAwB,GAAG,OAAO,CAAC,yBAAyB,CAAC;IA8IlF,OAAO,IAAI,IAAI;CAKtB"}
package/dist/operator.js CHANGED
@@ -1,4 +1,4 @@
1
- import { HudDocSchema, normalizeHudDocs } from "@femtomc/mu-core";
1
+ import { HudDocSchema, UiDocSchema, normalizeHudDocs, normalizeUiDocs, } from "@femtomc/mu-core";
2
2
  import { appendJsonl, getStorePaths } from "@femtomc/mu-core/node";
3
3
  import { mkdir, readFile, rename, writeFile } from "node:fs/promises";
4
4
  import { dirname, join } from "node:path";
@@ -8,6 +8,7 @@ import { createMuSession } from "./session_factory.js";
8
8
  import { DEFAULT_OPERATOR_SYSTEM_PROMPT } from "./default_prompts.js";
9
9
  const OPERATOR_RESPONSE_MAX_CHARS = 12_000;
10
10
  const OPERATOR_TURN_HUD_DOCS_MAX = 16;
11
+ const OPERATOR_TURN_UI_DOCS_MAX = 16;
11
12
  const SAFE_RESPONSE_RE = new RegExp(`^[\\s\\S]{1,${OPERATOR_RESPONSE_MAX_CHARS}}$`);
12
13
  const OPERATOR_TIMEOUT_MIN_MS = 1_000;
13
14
  const OPERATOR_TIMEOUT_HARD_CAP_MS = 10 * 60 * 1_000;
@@ -45,16 +46,19 @@ export const OperatorApprovedCommandSchema = z.discriminatedUnion("kind", [
45
46
  }),
46
47
  ]);
47
48
  const OperatorTurnHudDocsSchema = z.array(HudDocSchema).max(OPERATOR_TURN_HUD_DOCS_MAX).optional();
49
+ const OperatorTurnUiDocsSchema = z.array(UiDocSchema).max(OPERATOR_TURN_UI_DOCS_MAX).optional();
48
50
  export const OperatorBackendTurnResultSchema = z.discriminatedUnion("kind", [
49
51
  z.object({
50
52
  kind: z.literal("respond"),
51
53
  message: z.string().trim().min(1).max(OPERATOR_RESPONSE_MAX_CHARS),
52
54
  hud_docs: OperatorTurnHudDocsSchema,
55
+ ui_docs: OperatorTurnUiDocsSchema,
53
56
  }),
54
57
  z.object({
55
58
  kind: z.literal("command"),
56
59
  command: OperatorApprovedCommandSchema,
57
60
  hud_docs: OperatorTurnHudDocsSchema,
61
+ ui_docs: OperatorTurnUiDocsSchema,
58
62
  }),
59
63
  ]);
60
64
  function normalizeArg(arg) {
@@ -259,6 +263,10 @@ function isHudToolName(toolName) {
259
263
  const normalized = toolName.trim().toLowerCase();
260
264
  return normalized === "mu_hud";
261
265
  }
266
+ function isUiToolName(toolName) {
267
+ const normalized = toolName.trim().toLowerCase();
268
+ return normalized === "mu_ui";
269
+ }
262
270
  function extractHudDocsFromToolResult(result) {
263
271
  const rec = asRecord(result);
264
272
  if (!rec) {
@@ -278,6 +286,25 @@ function extractHudDocsFromToolResult(result) {
278
286
  }
279
287
  return normalizeHudDocs(candidates, { maxDocs: OPERATOR_TURN_HUD_DOCS_MAX });
280
288
  }
289
+ function extractUiDocsFromToolResult(result) {
290
+ const rec = asRecord(result);
291
+ if (!rec) {
292
+ return [];
293
+ }
294
+ const details = asRecord(rec.details);
295
+ const candidates = [];
296
+ const topLevelUiDocs = rec.ui_docs;
297
+ if (Array.isArray(topLevelUiDocs)) {
298
+ candidates.push(...topLevelUiDocs);
299
+ }
300
+ if (details) {
301
+ const detailUiDocs = details.ui_docs;
302
+ if (Array.isArray(detailUiDocs)) {
303
+ candidates.push(...detailUiDocs);
304
+ }
305
+ }
306
+ return normalizeUiDocs(candidates, { maxDocs: OPERATOR_TURN_UI_DOCS_MAX });
307
+ }
281
308
  function collectHudDocsFromToolExecutionEvent(event) {
282
309
  const rec = asRecord(event);
283
310
  if (!rec) {
@@ -292,6 +319,20 @@ function collectHudDocsFromToolExecutionEvent(event) {
292
319
  }
293
320
  return extractHudDocsFromToolResult(rec.result);
294
321
  }
322
+ function collectUiDocsFromToolExecutionEvent(event) {
323
+ const rec = asRecord(event);
324
+ if (!rec) {
325
+ return [];
326
+ }
327
+ if (nonEmptyString(rec.type) !== "tool_execution_end") {
328
+ return [];
329
+ }
330
+ const toolName = nonEmptyString(rec.toolName);
331
+ if (!toolName || !isUiToolName(toolName)) {
332
+ return [];
333
+ }
334
+ return extractUiDocsFromToolResult(rec.result);
335
+ }
295
336
  export class JsonFileConversationSessionStore {
296
337
  #path;
297
338
  #loaded = false;
@@ -500,10 +541,17 @@ export class MessagingOperatorRuntime {
500
541
  operatorTurnId: turnId,
501
542
  };
502
543
  }
544
+ const docPayload = {};
545
+ if (backendResult.hud_docs && backendResult.hud_docs.length > 0) {
546
+ docPayload.hud_docs = backendResult.hud_docs;
547
+ }
548
+ if (backendResult.ui_docs && backendResult.ui_docs.length > 0) {
549
+ docPayload.ui_docs = backendResult.ui_docs;
550
+ }
503
551
  return {
504
552
  kind: "response",
505
553
  message,
506
- ...(backendResult.hud_docs && backendResult.hud_docs.length > 0 ? { hud_docs: backendResult.hud_docs } : {}),
554
+ ...docPayload,
507
555
  operatorSessionId: sessionId,
508
556
  operatorTurnId: turnId,
509
557
  };
@@ -521,10 +569,17 @@ export class MessagingOperatorRuntime {
521
569
  operatorTurnId: turnId,
522
570
  };
523
571
  }
572
+ const docPayload = {};
573
+ if (backendResult.hud_docs && backendResult.hud_docs.length > 0) {
574
+ docPayload.hud_docs = backendResult.hud_docs;
575
+ }
576
+ if (backendResult.ui_docs && backendResult.ui_docs.length > 0) {
577
+ docPayload.ui_docs = backendResult.ui_docs;
578
+ }
524
579
  return {
525
580
  kind: "command",
526
581
  commandText: approved.commandText,
527
- ...(backendResult.hud_docs && backendResult.hud_docs.length > 0 ? { hud_docs: backendResult.hud_docs } : {}),
582
+ ...docPayload,
528
583
  operatorSessionId: sessionId,
529
584
  operatorTurnId: turnId,
530
585
  };
@@ -789,6 +844,7 @@ export class PiMessagingOperatorBackend {
789
844
  let assistantText = "";
790
845
  let capturedCommand = null;
791
846
  let capturedHudDocs = [];
847
+ let capturedUiDocs = [];
792
848
  const unsub = session.subscribe((event) => {
793
849
  // Capture assistant text for fallback responses.
794
850
  if (event?.type === "message_end" && event?.message?.role === "assistant") {
@@ -823,6 +879,12 @@ export class PiMessagingOperatorBackend {
823
879
  maxDocs: OPERATOR_TURN_HUD_DOCS_MAX,
824
880
  });
825
881
  }
882
+ const uiDocs = collectUiDocsFromToolExecutionEvent(event);
883
+ if (uiDocs.length > 0) {
884
+ capturedUiDocs = normalizeUiDocs([...capturedUiDocs, ...uiDocs], {
885
+ maxDocs: OPERATOR_TURN_UI_DOCS_MAX,
886
+ });
887
+ }
826
888
  });
827
889
  const promptText = buildOperatorPrompt(input);
828
890
  const promptOnce = async () => {
@@ -884,10 +946,14 @@ export class PiMessagingOperatorBackend {
884
946
  command: capturedCommand,
885
947
  messagePreview: assistantText,
886
948
  });
949
+ const docPayload = {};
887
950
  if (capturedHudDocs.length > 0) {
888
- return { kind: "command", command: capturedCommand, hud_docs: capturedHudDocs };
951
+ docPayload.hud_docs = capturedHudDocs;
889
952
  }
890
- return { kind: "command", command: capturedCommand };
953
+ if (capturedUiDocs.length > 0) {
954
+ docPayload.ui_docs = capturedUiDocs;
955
+ }
956
+ return { kind: "command", command: capturedCommand, ...docPayload };
891
957
  }
892
958
  // Otherwise treat the assistant text as a plain response.
893
959
  const message = assistantText.trim();
@@ -903,10 +969,14 @@ export class PiMessagingOperatorBackend {
903
969
  outcome: "respond",
904
970
  messagePreview: responseMessage,
905
971
  });
972
+ const docPayload = {};
906
973
  if (capturedHudDocs.length > 0) {
907
- return { kind: "respond", message: responseMessage, hud_docs: capturedHudDocs };
974
+ docPayload.hud_docs = capturedHudDocs;
975
+ }
976
+ if (capturedUiDocs.length > 0) {
977
+ docPayload.ui_docs = capturedUiDocs;
908
978
  }
909
- return { kind: "respond", message: responseMessage };
979
+ return { kind: "respond", message: responseMessage, ...docPayload };
910
980
  }
911
981
  dispose() {
912
982
  for (const sessionId of [...this.#sessions.keys()]) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@femtomc/mu-agent",
3
- "version": "26.2.106",
3
+ "version": "26.2.107",
4
4
  "description": "Shared operator runtime for mu assistant sessions and serve extensions.",
5
5
  "keywords": [
6
6
  "mu",
@@ -25,7 +25,7 @@
25
25
  "themes/**"
26
26
  ],
27
27
  "dependencies": {
28
- "@femtomc/mu-core": "26.2.106",
28
+ "@femtomc/mu-core": "26.2.107",
29
29
  "@mariozechner/pi-agent-core": "^0.54.2",
30
30
  "@mariozechner/pi-ai": "^0.54.2",
31
31
  "@mariozechner/pi-coding-agent": "^0.54.2",
@@ -0,0 +1,25 @@
1
+ ---
2
+ name: automation
3
+ description: "Meta-skill for durable and wall-clock automation. Routes to heartbeats and crons for recurring execution control."
4
+ ---
5
+
6
+ # automation
7
+
8
+ Use this meta-skill when the user wants recurring automation, scheduled execution, or scheduler diagnostics.
9
+
10
+ ## Subskills
11
+
12
+ - `heartbeats` — durable wake-loop programs that run one bounded pass per tick.
13
+ - `crons` — wall-clock scheduling (`at`, `every`, cron expressions) and lifecycle control.
14
+
15
+ ## Selection guide
16
+
17
+ 1. Use `heartbeats` for state-driven wake loops and short recurring supervision.
18
+ 2. Use `crons` for explicit wall-clock schedules and calendar-style timing.
19
+ 3. Pair automation with `subagents` stack skills (`protocol`, `execution`, etc.) when the workload is issue-DAG driven.
20
+
21
+ ## Common patterns
22
+
23
+ - **Durable Orchestration**: Create a heartbeat (`heartbeats`) that runs one bounded `execution` pass per tick to supervise a `subagents` DAG over time, keeping the main chat clear.
24
+ - **Scheduled Maintenance / Memory Update**: Set up a cron job (`crons`) to periodically invoke `memory` to rebuild indexes, fetch new docs, or clean up obsolete logs on a schedule.
25
+ - **Continuous Diagnostics**: A heartbeat that periodically tails application logs or runs bounded check scripts locally. If a failure condition is met, the wake loop exits cleanly and notifies the user via the active channel.
@@ -152,10 +152,10 @@ post concise summary, then exit.
152
152
 
153
153
  For DAG execution workloads, combine with:
154
154
  - `planning`
155
- - `orchestration`
155
+ - `protocol`
156
156
  - `control-flow` (when explicit loop/termination policy is required)
157
157
  - `model-routing` (when per-issue model/provider/thinking policy is required)
158
- - `subagents`
158
+ - `execution`
159
159
  - `heartbeats` (for short-cadence wake loops)
160
160
 
161
161
  ## Diagnostics and recovery
@@ -145,10 +145,10 @@ packet mechanics, raw issue-ID lists). Include them only when diagnosing a block
145
145
 
146
146
  For hierarchical DAG execution, pair this skill with:
147
147
  - `planning`
148
- - `orchestration`
148
+ - `protocol`
149
149
  - `control-flow` (when explicit loop/termination policy is required)
150
150
  - `model-routing` (when per-issue model/provider/thinking policy is required)
151
- - `subagents`
151
+ - `execution`
152
152
 
153
153
  For wall-clock scheduling semantics (`at`, `every`, `cron`), use `crons`.
154
154
 
@@ -0,0 +1,28 @@
1
+ ---
2
+ name: core
3
+ description: "Meta-skill for core mu operating primitives. Routes to mu, memory, tmux, and code-mode based on task shape."
4
+ ---
5
+
6
+ # core
7
+
8
+ Use this meta-skill when the user asks for general `mu` operation guidance and you need to pick the correct foundational skill.
9
+
10
+ ## Subskills
11
+
12
+ - `mu` — default CLI-first operating workflow (inspect, mutate, verify, handoff).
13
+ - `memory` — historical context retrieval, timeline reconstruction, and memory-index maintenance.
14
+ - `tmux` — persistent terminal/session substrate for bounded command execution and fan-out.
15
+ - `code-mode` — tmux-backed REPL loops for iterative execution and context compression.
16
+
17
+ ## Selection guide
18
+
19
+ 1. Start with `mu` for most day-to-day operator work.
20
+ 2. Add `memory` when historical context or timeline anchors are required.
21
+ 3. Add `tmux` when durable shell state or parallel worker shells are needed.
22
+ 4. Add `code-mode` when solving by live execution is cheaper than chat-only reasoning.
23
+
24
+ ## Common patterns
25
+
26
+ - **Bounded investigation**: Use `mu` commands (`get`, `read`, `health`) to inspect current state, then use `memory` to find "when did this last work?" before attempting a fix.
27
+ - **Context compression**: If a user asks for complex debugging that involves running code and printing huge errors, route to `code-mode`. The agent can spin up a REPL, iterate on a fix offline, and return only the root cause to the chat.
28
+ - **Parallel fan-out**: If a command takes a long time, or needs to run across multiple directories, route to `tmux` to spawn parallel worker shells, keep them running in the background, and periodically read their output.
@@ -112,7 +112,7 @@ tmux new-session -d -s mu-code-sh "bash --noprofile --norc -i"
112
112
  ## Integration with other mu skills
113
113
 
114
114
  - Use with `planning` when a plan step needs exploratory coding.
115
- - Use with `orchestration`/`subagents` by assigning one tmux session per worker.
115
+ - Use with `protocol`/`execution` by assigning one tmux session per worker.
116
116
  - Use with `control-flow` for explicit retry/termination policy around code passes.
117
117
  - Use with `heartbeats`/`crons` when bounded code passes should run on schedule.
118
118
 
@@ -14,6 +14,7 @@ run focused execution loops, and hand off to specialized skills when needed.
14
14
  - [CLI capability map](#cli-capability-map)
15
15
  - [Default bounded investigation loop](#default-bounded-investigation-loop)
16
16
  - [Common mutation and diagnostics patterns](#common-mutation-and-diagnostics-patterns)
17
+ - [Reference `/answer` flow (mu_ui-only)](#reference-answer-flow-mu_ui-only)
17
18
  - [Session, serve, and one-shot surfaces](#session-serve-and-one-shot-surfaces)
18
19
  - [Durable automation handoff](#durable-automation-handoff)
19
20
  - [Evaluation scenarios](#evaluation-scenarios)
@@ -141,6 +142,37 @@ mu store tail cp_operator_turns --limit 20 --pretty
141
142
  mu replay <issue-id-or-log-path>
142
143
  ```
143
144
 
145
+ ## Reference `/answer` flow (mu_ui-only)
146
+
147
+ Use this as the canonical interactive-skill pattern. Keep all behavior in skill logic and
148
+ `mu_ui` documents/events; do not add adapter- or extension-specific branches.
149
+
150
+ 1. Publish the answer prompt as a `UiDoc` via `mu_ui`:
151
+
152
+ ```json
153
+ {
154
+ "action": "set",
155
+ "doc": {
156
+ "v": 1,
157
+ "ui_id": "ui:answer",
158
+ "title": "Answer",
159
+ "components": [{ "kind": "text", "id": "prompt", "text": "Choose an answer", "metadata": {} }],
160
+ "actions": [
161
+ { "id": "answer_yes", "label": "Answer yes", "payload": { "choice": "yes" }, "metadata": { "command_text": "/answer yes" } },
162
+ { "id": "answer_no", "label": "Answer no", "payload": { "choice": "no" }, "metadata": { "command_text": "/answer no" } }
163
+ ],
164
+ "revision": { "id": "rev:answer:1", "version": 1 },
165
+ "updated_at_ms": 1
166
+ }
167
+ }
168
+ ```
169
+
170
+ 2. On `/answer <choice>` input, validate choice, clear/remove `ui:answer` via `mu_ui`, then emit a
171
+ normal response.
172
+ 3. Keep revisions monotonic (`revision.version`) so reconnect/replay keeps the highest revision.
173
+ 4. Rely on `metadata.command_text` for cross-surface parity: TUI + messaging channels should route
174
+ the same `/answer ...` command text.
175
+
144
176
  ## Session, serve, and one-shot surfaces
145
177
 
146
178
  Primary interactive surface:
@@ -177,10 +209,10 @@ mu cron --help
177
209
  ```
178
210
 
179
211
  When work is multi-step and issue-graph driven, use `planning` to shape the DAG,
180
- then `hud` for canonical HUD behavior, then `orchestration` to keep DAG
212
+ then `hud` for canonical HUD behavior, then `protocol` to keep DAG
181
213
  semantics consistent, then `control-flow` for explicit loop/termination policy,
182
214
  then `model-routing` for per-issue provider/model/thinking selection overlays,
183
- then `subagents` for durable execution.
215
+ then `execution` for durable execution supervision.
184
216
  For REPL-driven exploration and context compression, use `code-mode`.
185
217
  For persistent terminal sessions and worker fan-out mechanics, use `tmux`.
186
218
  For recurring bounded automation loops, use `heartbeats`.
@@ -205,12 +237,12 @@ For wall-clock schedules (one-shot, interval, cron-expression), use `crons`.
205
237
  - Historical context retrieval and index maintenance: **`memory`**
206
238
  - Planning/decomposition and DAG review: **`planning`**
207
239
  - HUD contract/state updates across surfaces: **`hud`**
208
- - Shared DAG semantics for planning + execution: **`orchestration`**
240
+ - Shared DAG semantics for planning + execution: **`protocol`**
209
241
  - Loop/termination policy overlays (review gates, retries, escalation): **`control-flow`**
210
242
  - Per-issue model/provider/thinking selection overlays: **`model-routing`**
211
243
  - Live REPL execution and context engineering via tmux: **`code-mode`**
212
244
  - Persistent tmux session management + worker fan-out primitives: **`tmux`**
213
- - Durable multi-agent orchestration: **`subagents`**
245
+ - Durable multi-agent orchestration: **`execution`**
214
246
  - Recurring bounded automation scheduling: **`heartbeats`**
215
247
  - Wall-clock scheduling workflows: **`crons`**
216
248
  - Messaging adapter onboarding:
@@ -131,7 +131,7 @@ Quick diagnostics checklist:
131
131
  ## Integration map
132
132
 
133
133
  - `code-mode`: tmux-backed REPL persistence and context engineering loops
134
- - `subagents`: tmux fan-out for parallel worker execution
134
+ - `execution`: tmux fan-out for parallel worker execution
135
135
  - `heartbeats` / `crons`: schedule bounded passes that dispatch into tmux workers
136
136
 
137
137
  ## Evaluation scenarios
@@ -0,0 +1,27 @@
1
+ ---
2
+ name: messaging
3
+ description: "Meta-skill for messaging/channel onboarding. Routes to setup-slack, setup-discord, setup-telegram, and setup-neovim."
4
+ ---
5
+
6
+ # messaging
7
+
8
+ Use this meta-skill when the user asks to onboard, repair, or verify channel messaging integration.
9
+
10
+ ## Subskills
11
+
12
+ - `setup-slack` — Slack adapter setup, verification, and identity linking.
13
+ - `setup-discord` — Discord adapter setup, verification, and identity linking.
14
+ - `setup-telegram` — Telegram adapter setup, webhook flow, and identity linking.
15
+ - `setup-neovim` — Neovim (`mu.nvim`) channel setup and identity linking.
16
+
17
+ ## Selection guide
18
+
19
+ 1. Pick the channel-specific setup skill that matches the target adapter.
20
+ 2. Run setup in an inspect -> patch config -> reload -> verify loop.
21
+ 3. Confirm identities and delivery behavior before declaring completion.
22
+
23
+ ## Common patterns
24
+
25
+ - **Agent-First Bootstrap**: Rather than asking the user for all details upfront, start the correct `setup-*` skill to investigate the current `mu` config, generate generic adapter secrets locally (if possible), and only ask the user for web-portal-specific secrets (e.g. Discord bot tokens or Slack bot tokens).
26
+ - **Verification Loop**: After rewriting the channel configuration dict, use the `setup-*` pattern to reload the mu controller (`mu cron ...`) and explicitly check the latest service logs or remote test (`/mu health`) to ensure connectivity works before ending the run.
27
+ - **Identity Context Tying**: During adapter onboarding, link the local OS user identity with their remote Slack/Discord/Telegram IDs so that subsequent `mu exec` jobs running offline can accurately ping the user back.