ceulen 0.16.1 → 0.18.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.
Files changed (119) hide show
  1. package/CHANGELOG.md +81 -1
  2. package/extensions/lib/registry.test.ts +5 -2
  3. package/extensions/lib/registry.ts +7 -2
  4. package/extensions/modules/a2a/lib/client.ts +2 -1
  5. package/extensions/modules/advisor/commands/advisor.ts +22 -12
  6. package/extensions/modules/advisor/test/module.test.ts +26 -0
  7. package/extensions/modules/munin/index.ts +93 -6
  8. package/extensions/modules/munin/test/extension.test.ts +124 -0
  9. package/extensions/modules/plan/index.ts +64 -0
  10. package/extensions/modules/plan/test/module.test.ts +112 -0
  11. package/extensions/modules/steering/index.ts +25 -6
  12. package/extensions/modules/steering/test/anchor-regressions.test.ts +38 -0
  13. package/package.json +3 -3
  14. package/scripts/validate-themes.mjs +31 -3
  15. package/skills/munin/SKILL.md +1 -1
  16. package/themes/alabaster.json +2 -17
  17. package/themes/amethyst.json +2 -19
  18. package/themes/anthracite.json +2 -22
  19. package/themes/basalt.json +3 -31
  20. package/themes/birch.json +2 -19
  21. package/themes/catppuccin-mocha.json +1 -7
  22. package/themes/dark-abyss.json +2 -17
  23. package/themes/dark-arctic.json +2 -23
  24. package/themes/dark-aurora.json +2 -18
  25. package/themes/dark-catppuccin.json +2 -25
  26. package/themes/dark-cavern.json +2 -18
  27. package/themes/dark-celestial.json +2 -18
  28. package/themes/dark-copper.json +2 -18
  29. package/themes/dark-cosmos.json +2 -17
  30. package/themes/dark-cyberpunk.json +2 -21
  31. package/themes/dark-dracula.json +2 -20
  32. package/themes/dark-eclipse.json +2 -18
  33. package/themes/dark-ember.json +2 -18
  34. package/themes/dark-equinox.json +2 -17
  35. package/themes/dark-forest.json +2 -21
  36. package/themes/dark-github.json +2 -24
  37. package/themes/dark-gruvbox.json +2 -30
  38. package/themes/dark-lavender.json +2 -18
  39. package/themes/dark-lunar.json +2 -17
  40. package/themes/dark-midnight.json +2 -18
  41. package/themes/dark-monochrome.json +2 -19
  42. package/themes/dark-monokai.json +2 -21
  43. package/themes/dark-nebula.json +2 -18
  44. package/themes/dark-neon-noir.json +2 -21
  45. package/themes/dark-nord.json +2 -21
  46. package/themes/dark-ocean.json +2 -22
  47. package/themes/dark-one.json +2 -21
  48. package/themes/dark-poimandres.json +4 -41
  49. package/themes/dark-rainforest.json +2 -17
  50. package/themes/dark-reef.json +2 -18
  51. package/themes/dark-retro.json +2 -18
  52. package/themes/dark-rose-pine.json +3 -21
  53. package/themes/dark-sakura.json +2 -18
  54. package/themes/dark-slate.json +2 -18
  55. package/themes/dark-solarized.json +2 -23
  56. package/themes/dark-solstice.json +2 -17
  57. package/themes/dark-starfall.json +2 -17
  58. package/themes/dark-sunset.json +2 -23
  59. package/themes/dark-swamp.json +2 -18
  60. package/themes/dark-synthwave.json +2 -25
  61. package/themes/dark-taiga.json +2 -17
  62. package/themes/dark-terminal.json +2 -18
  63. package/themes/dark-tokyo-night.json +2 -23
  64. package/themes/dark-tundra.json +2 -18
  65. package/themes/dark-twilight.json +2 -17
  66. package/themes/dark-volcanic.json +2 -17
  67. package/themes/dark.json +2 -6
  68. package/themes/graphite.json +2 -21
  69. package/themes/light-arctic.json +2 -27
  70. package/themes/light-aurora-day.json +2 -18
  71. package/themes/light-canyon.json +2 -17
  72. package/themes/light-catppuccin.json +3 -24
  73. package/themes/light-cirrus.json +2 -18
  74. package/themes/light-coral.json +2 -18
  75. package/themes/light-cyberpunk.json +2 -19
  76. package/themes/light-dawn.json +2 -17
  77. package/themes/light-dunes.json +2 -17
  78. package/themes/light-eucalyptus.json +2 -18
  79. package/themes/light-forest.json +3 -24
  80. package/themes/light-frost.json +2 -18
  81. package/themes/light-github.json +3 -39
  82. package/themes/light-glacier.json +2 -17
  83. package/themes/light-gruvbox.json +3 -30
  84. package/themes/light-haze.json +2 -18
  85. package/themes/light-honeycomb.json +2 -18
  86. package/themes/light-lagoon.json +2 -17
  87. package/themes/light-lavender.json +2 -18
  88. package/themes/light-meadow.json +2 -17
  89. package/themes/light-mint.json +2 -18
  90. package/themes/light-monochrome.json +2 -21
  91. package/themes/light-ocean.json +2 -20
  92. package/themes/light-one.json +2 -20
  93. package/themes/light-opal.json +2 -18
  94. package/themes/light-orchard.json +2 -18
  95. package/themes/light-paper.json +2 -18
  96. package/themes/light-poimandres.json +4 -41
  97. package/themes/light-prism.json +2 -19
  98. package/themes/light-retro.json +3 -21
  99. package/themes/light-sand.json +2 -18
  100. package/themes/light-savanna.json +2 -17
  101. package/themes/light-solarized.json +2 -22
  102. package/themes/light-soleil.json +2 -18
  103. package/themes/light-sunset.json +2 -22
  104. package/themes/light-synthwave.json +2 -22
  105. package/themes/light-tokyo-night.json +3 -28
  106. package/themes/light-wetland.json +2 -17
  107. package/themes/light-zenith.json +2 -18
  108. package/themes/light.json +2 -6
  109. package/themes/limestone.json +2 -19
  110. package/themes/mahogany.json +2 -19
  111. package/themes/marble.json +2 -19
  112. package/themes/mirage.json +2 -6
  113. package/themes/obsidian.json +2 -19
  114. package/themes/onyx.json +2 -17
  115. package/themes/pearl.json +2 -21
  116. package/themes/porcelain.json +2 -17
  117. package/themes/quartz.json +2 -19
  118. package/themes/sandstone.json +2 -20
  119. package/themes/titanium.json +2 -17
@@ -410,6 +410,118 @@ describe("plan mode — branch restore", () => {
410
410
  });
411
411
  });
412
412
 
413
+ describe("ask_user_question ask-loop dampener", () => {
414
+ /** ctx whose ui.select answers `answers` in order and counts dialogs shown. */
415
+ function askingCtx(h: ReturnType<typeof createFakePi>, answers: string[]) {
416
+ const shown: string[] = [];
417
+ let i = 0;
418
+ const ctx = h.ctx({
419
+ ui: {
420
+ notify: () => {},
421
+ select: async (question: string) => { shown.push(question); return answers[i++]; },
422
+ editor: async () => undefined,
423
+ setStatus: () => {},
424
+ setEditorText: () => {},
425
+ theme: { fg: (_c: string, t: string) => t },
426
+ },
427
+ });
428
+ return { ctx, shown };
429
+ }
430
+ const ask = (h: ReturnType<typeof createFakePi>, ctx: any, question: string) =>
431
+ h.tools.ask_user_question.execute(`tc-${question}`, { question, options: [{ label: "Send it" }, { label: "Stop" }] }, undefined, undefined, ctx);
432
+ const text = (r: any) => String(r?.content?.[0]?.text ?? "");
433
+
434
+ it("refuses a near-duplicate of an already-answered question", async () => {
435
+ const h = await start();
436
+ const { ctx, shown } = askingCtx(h, ["Send it"]);
437
+ const first = await ask(h, ctx, "Ready to execute the confirmed plan — dispatch the NAK diagnosis to the peer now?");
438
+ assert.equal(text(first), "User selected: Send it", "1st ask shows the dialog");
439
+ // The incident's exact drift: same intent, reworded, shrinking.
440
+ const second = await ask(h, ctx, "Execute: dispatch to peer now?");
441
+ assert.match(text(second), /Loop guard/, "reworded repeat is refused");
442
+ assert.match(text(second), /already asked this and the user answered/, "guard explains why");
443
+ assert.match(text(second), /"Send it"/, "guard hands back the earlier answer");
444
+ assert.equal(shown.length, 1, "the repeat NEVER opened a second dialog");
445
+ assert.equal(second.details.loopGuard, true, "details mark the loop guard");
446
+ });
447
+
448
+ it("genuinely different questions are NOT blocked", async () => {
449
+ const h = await start();
450
+ const { ctx, shown } = askingCtx(h, ["Send it", "Send it", "Send it"]);
451
+ await ask(h, ctx, "Which port profile should the uplink use?");
452
+ await ask(h, ctx, "Which RADIUS secret belongs on the controller?");
453
+ const third = await ask(h, ctx, "How long should the capture run stay armed?");
454
+ assert.equal(text(third), "User selected: Send it", "a distinct question still opens");
455
+ assert.equal(shown.length, 3, "all three dialogs shown");
456
+ });
457
+
458
+ it("same verb, different object is NOT a duplicate (measured at 0.67)", async () => {
459
+ const h = await start();
460
+ const { ctx } = askingCtx(h, ["Go", "Go"]);
461
+ await ask(h, ctx, "Should I restart the radius unit?");
462
+ const second = await ask(h, ctx, "Should I restart the nginx unit?");
463
+ assert.equal(text(second), "User selected: Go", "different target still asks");
464
+ });
465
+
466
+ it("an explicit answer stays reusable while the loop guard holds", async () => {
467
+ const h = await start();
468
+ const { ctx, shown } = askingCtx(h, ["Dispatch now, store memories"]);
469
+ await ask(h, ctx, "Ready to execute — dispatch the NAK diagnosis to the peer now?");
470
+ const again = await ask(h, ctx, "Execute: dispatch to peer now?");
471
+ assert.match(text(again), /Dispatch now, store memories/, "guard hands the exact earlier choice back");
472
+ assert.equal(shown.length, 1, "user is not asked twice");
473
+ });
474
+
475
+ it("the count backstop catches wording drift the similarity arm misses", async () => {
476
+ const h = await start();
477
+ // Four asks that are all DIFFERENT enough to beat the similarity arm, yet a
478
+ // loop by the only wording-independent signal: no tool call in between.
479
+ const { ctx, shown } = askingCtx(h, ["A", "B", "C", "D"]);
480
+ await ask(h, ctx, "Which port profile?");
481
+ await ask(h, ctx, "Which RADIUS secret?");
482
+ await ask(h, ctx, "How long is the capture?");
483
+ assert.equal(shown.length, 3, "three distinct questions are a legitimate flow");
484
+ const fourth = await ask(h, ctx, "Pick a colour for the dashboard?");
485
+ assert.match(text(fourth), /Loop guard/, "4th consecutive ask with no tool call is refused");
486
+ assert.match(text(fourth), /call #4 in a row/, "guard names the run length");
487
+ assert.equal(shown.length, 3, "the 4th ask never opened a dialog");
488
+ });
489
+
490
+ it("any other tool call re-arms the dampener", async () => {
491
+ const h = await start();
492
+ const { ctx, shown } = askingCtx(h, ["Send it", "Send it"]);
493
+ await ask(h, ctx, "Dispatch now?");
494
+ // The model finally does the work instead of asking again.
495
+ await h.fire("tool_call", { toolName: "bash", input: { command: "ls" } }, ctx);
496
+ const after = await ask(h, ctx, "Dispatch now?");
497
+ assert.equal(text(after), "User selected: Send it", "re-armed after another tool call");
498
+ assert.equal(shown.length, 2, "the dialog opened again");
499
+ });
500
+
501
+ it("a fresh session re-arms the dampener", async () => {
502
+ const h = await start();
503
+ const { ctx } = askingCtx(h, ["Send it"]);
504
+ await ask(h, ctx, "Dispatch now?");
505
+ await start(h); // session_start clears the run
506
+ const { ctx: ctx2, shown } = askingCtx(h, ["Send it"]);
507
+ const after = await ask(h, ctx2, "Dispatch now?");
508
+ assert.equal(text(after), "User selected: Send it", "new session asks normally");
509
+ assert.equal(shown.length, 1, "dialog shown in the new session");
510
+ });
511
+
512
+ it("cancelled asks do not count as an answer to reuse", async () => {
513
+ const h = await start();
514
+ // ctx.ui.select returning undefined = user cancelled.
515
+ const cancelledCtx = h.ctx({ ui: { notify: () => {}, select: async () => undefined, editor: async () => undefined, setStatus: () => {}, setEditorText: () => {}, theme: { fg: (_c: string, t: string) => t } } });
516
+ await ask(h, cancelledCtx, "Dispatch now?");
517
+ const { ctx, shown } = askingCtx(h, ["Send it"]);
518
+ const repeat = await ask(h, ctx, "Dispatch now?");
519
+ assert.equal(text(repeat), "User selected: Send it", "no stale answer to hand back — dialog opens");
520
+ assert.equal(shown.length, 1);
521
+ });
522
+ });
523
+
524
+
413
525
  /** Recursively collect file names under dir ([] when missing). */
414
526
  function readSyncRecursive(dir: string, prefix = ""): string[] {
415
527
  if (!existsSync(dir)) return [];
@@ -341,12 +341,28 @@ export default function steeringModule(pi: ExtensionAPI): void {
341
341
  settings = readSteeringSettings(ctx); // read per turn — /config saves apply live
342
342
  activeFamily = family(ctx.model);
343
343
 
344
+ // pi 1.2.0 fires before_agent_start for sendMessage(..., { triggerTurn: true })
345
+ // runs too (cron fires, repair auto-bg follow-ups, subagent receipts) and
346
+ // splits the event on `messageType` — `prompt`/`images` exist only on the
347
+ // "user" variant. Older pi has no messageType and fires ONLY for user
348
+ // prompts, so "not custom" is the correct test on every supported version.
349
+ const messageType = (event as { messageType?: string }).messageType;
350
+ const isCustomRun = messageType === "custom";
351
+
344
352
  // ds-anchor bootstrap: request #1 gets the byte-identical Minimal prompt
345
353
  // and NO guidance (Super Power, selection guidance, hints all suppressed).
346
354
  // This handler is LAST in ceulen's chain, so the returned systemPrompt
347
355
  // REPLACES everything ponytail/subagent/advisor composed — deliberate, and
348
356
  // the only place this module clobbers rather than composes.
349
- if (anchorBootstrapping(ctx.model)) {
357
+ //
358
+ // A machine-initiated run must NOT consume the bootstrap: the minimal prompt
359
+ // plus bash/str_replace_editor-only tools would run a cron/background task
360
+ // under DSH minimal mode. The bootstrap stays pending for the next user turn.
361
+ if (isCustomRun && anchorTarget(ctx.model)) {
362
+ // Machine-initiated: never engage the bootstrap (trace once, then the
363
+ // normal composition path below).
364
+ anchorTracePush(`bootstrap skipped: custom-triggered run (promoted=${anchorPromoted})`);
365
+ } else if (anchorBootstrapping(ctx.model)) {
350
366
  scanAnchorEntries(ctx);
351
367
  if (!anchorPromoted) {
352
368
  anchorRunActive = true;
@@ -389,14 +405,17 @@ export default function steeringModule(pi: ExtensionAPI): void {
389
405
  // byte-identical — a per-turn source switch would invalidate the cache head.
390
406
  const selected = event.systemPromptOptions?.selectedTools;
391
407
  const activeForHint: readonly string[] = Array.isArray(selected) && selected.length > 0 ? selected : pi.getActiveTools();
392
- if (settings.firstToolHints && activeForHint.includes("bash")) {
393
- const runHint = runTaskFirstToolHint(event.prompt || "");
408
+ // Hints heuristically read the USER's task text: a custom-triggered run has
409
+ // no prompt, and hinting off a machine message would be noise.
410
+ const runPrompt = !isCustomRun && "prompt" in event ? event.prompt : "";
411
+ if (settings.firstToolHints && !isCustomRun && activeForHint.includes("bash")) {
412
+ const runHint = runTaskFirstToolHint(runPrompt);
394
413
  if (runHint) dynamicParts.push(runHint);
395
- const ghHint = githubCloneFirstToolHint(event.prompt || "");
414
+ const ghHint = githubCloneFirstToolHint(runPrompt);
396
415
  if (ghHint) dynamicParts.push(ghHint);
397
416
  }
398
- if (settings.firstToolHints && activeForHint.includes("find")) {
399
- const readHint = readUncertainPathHint(event.prompt || "");
417
+ if (settings.firstToolHints && !isCustomRun && activeForHint.includes("find")) {
418
+ const readHint = readUncertainPathHint(runPrompt);
400
419
  if (readHint) dynamicParts.push(readHint);
401
420
  }
402
421
 
@@ -90,4 +90,42 @@ describe("ds-anchor regressions", () => {
90
90
  assert.equal(out.max_completion_tokens, 256000, "budget pinned on the field the payload already carries");
91
91
  assert.equal(out.max_tokens, undefined, "conflicting max_tokens dropped");
92
92
  });
93
+
94
+ // pi 1.2.0: before_agent_start also fires for sendMessage({triggerTurn: true})
95
+ // runs (cron fires, auto-bg receipts) with messageType "custom" and NO prompt.
96
+ it("a custom-triggered run does NOT consume the bootstrap; the next user turn still gets it", () => {
97
+ const h = createFakePi();
98
+ h.setEntries([]);
99
+ h.fire("session_start", {}, h.ctx("deepseek-v4-pro"));
100
+ // cron-style custom run (no `prompt` field — pi's custom variant)
101
+ const custom = h.fire("before_agent_start", {
102
+ messageType: "custom", message: { customType: "ceulen-cron-fire", content: "job fired" },
103
+ systemPrompt: "FULL PI PROMPT", systemPromptOptions: {},
104
+ }, h.ctx("deepseek-v4-pro"));
105
+ assert.notEqual(custom?.systemPrompt, MINIMAL, "custom run must not get the minimal prompt");
106
+ const out = h.fire("before_provider_request", { payload: { tools: [{ name: "bash" }, { name: "str_replace_editor" }, { name: "edit" }] } }, h.ctx("deepseek-v4-pro"));
107
+ assert.equal(out?.tools, undefined, "custom run keeps the full tool catalog");
108
+ assert.equal(out?.max_tokens, undefined, "custom run gets no budget pin");
109
+ // the bootstrap stayed pending for the next user turn
110
+ const user = h.fire("before_agent_start", { messageType: "user", prompt: "do a task", systemPrompt: "FULL PI PROMPT", systemPromptOptions: {} }, h.ctx("deepseek-v4-pro"));
111
+ assert.equal(user?.systemPrompt, MINIMAL, "the next USER turn still bootstraps");
112
+ });
113
+
114
+ it("a custom-triggered run gets no first-tool hints (no prompt to read)", () => {
115
+ const h = createFakePi(["bash", "read", "edit", "grep"]);
116
+ h.setEntries([]);
117
+ h.fire("session_start", {}, h.ctx("deepseek-v4-flash"));
118
+ const custom = h.fire("before_agent_start", {
119
+ messageType: "custom", message: { customType: "ceulen-cron-fire", content: "run the task" },
120
+ systemPrompt: "FULL", systemPromptOptions: {},
121
+ }, h.ctx("deepseek-v4-flash"));
122
+ // The static family guidance still composes; what must NOT appear is the
123
+ // prompt-derived dynamic hint (recognisable by its "Do NOT spawn a task
124
+ // agent" / task-shaped preamble). A user turn with the same text DOES add it.
125
+ const customDynamic = (custom?.systemPrompt ?? "").length;
126
+ const user = h.fire("before_agent_start", { messageType: "user", prompt: "refactor everything in the repo", systemPrompt: "FULL", systemPromptOptions: {} }, h.ctx("deepseek-v4-flash"));
127
+ assert.equal(user?.systemPrompt, custom?.systemPrompt, "a custom run adds no dynamic hint");
128
+ assert.ok(String(custom?.systemPrompt ?? "").startsWith("DeepSeek V4"), "static family guidance still composes on custom runs");
129
+ assert.ok(customDynamic > "FULL".length, "static guidance present");
130
+ });
93
131
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ceulen",
3
- "version": "0.16.1",
3
+ "version": "0.18.0",
4
4
  "description": "Ceulen — the Pi coding agent, fully dressed: one bundle extension carrying the full toolkit with a single /ceulen config command.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -52,8 +52,8 @@
52
52
  ]
53
53
  },
54
54
  "peerDependencies": {
55
- "@earendil-works/pi-coding-agent": ">=0.99.1 <1.2.0",
56
- "@earendil-works/pi-tui": ">=0.99.1 <1.2.0",
55
+ "@earendil-works/pi-coding-agent": ">=0.99.1 <1.3.0",
56
+ "@earendil-works/pi-tui": ">=0.99.1 <1.3.0",
57
57
  "typebox": "*"
58
58
  },
59
59
  "devDependencies": {
@@ -1,7 +1,13 @@
1
1
  // Validates every themes/*.json loads as a pi theme: name present + unique,
2
2
  // not colliding with pi's builtin names (dark/light/system are preloaded and
3
- // win dedupe), full pi-required color token set (from pi's theme-json schema),
4
- // and every value resolving to a var ref, #RRGGBB, 256-color index, or "".
3
+ // win dedupe), full pi-required color token set, every value resolving to a var
4
+ // ref, #RRGGBB, 256-color index, or "", and NO unknown keys anywhere.
5
+ //
6
+ // pi 1.2.0 (dist/modes/interactive/theme/theme-schema.js) validates themes
7
+ // loaded at startup with `additionalProperties: false` at BOTH the root and
8
+ // `colors` — an unknown key throws, the loader swallows it as a diagnostic, and
9
+ // the theme silently vanishes ("Theme not found: <name>" + system fallback).
10
+ // The ALLOWED/ROOT_KEYS gates below mirror that so `npm test` catches it here.
5
11
  // ponytail: adapted from @bacnh85/pi-themes scripts/validate-themes.mjs (MIT).
6
12
  // Usage: node scripts/validate-themes.mjs [dir] (dir defaults to ./themes)
7
13
  import { readFileSync, readdirSync } from "node:fs";
@@ -30,6 +36,21 @@ const REQUIRED = [
30
36
  "syntaxPunctuation", "thinkingOff", "thinkingMinimal", "thinkingLow",
31
37
  "thinkingMedium", "thinkingHigh", "thinkingXhigh", "bashMode",
32
38
  ];
39
+ // pi 1.2.0's full colors token set (THEME_TOKENS): REQUIRED plus the tokens
40
+ // that are optional because they carry a fallback.
41
+ // Source of truth: node_modules/@earendil-works/pi-coding-agent/dist/modes/
42
+ // interactive/theme/theme-tokens.js (not importable — the package `exports` map
43
+ // blocks deep subpaths). Re-derive on every pi minor bump:
44
+ // node -p "Object.keys(require('<pi>/dist/modes/interactive/theme/theme-tokens.js').THEME_TOKENS)"
45
+ // A token pi ADDS is not a break (an unknown key only fails when we SHIP one);
46
+ // a token pi REMOVES is — this file would then allow a key pi rejects.
47
+ const ALLOWED_COLORS = new Set([
48
+ ...REQUIRED,
49
+ "scrollbarTrack", "scrollbarThumb", "searchMatchBg", "searchMatchText", "thinkingMax",
50
+ ]);
51
+ // pi 1.2.0's root object (additionalProperties: false).
52
+ const ROOT_KEYS = new Set(["$schema", "name", "appearance", "vars", "colors", "export"]);
53
+ const EXPORT_KEYS = new Set(["pageBg", "cardBg", "infoBg"]);
33
54
  const BUILTIN = new Set(["dark", "light", "system"]);
34
55
 
35
56
  let failed = false;
@@ -63,9 +84,16 @@ for (const file of files) {
63
84
  const missing = REQUIRED.filter((k) => !(k in colors));
64
85
  if (missing.length) fail(`missing required tokens: ${missing.join(", ")}`);
65
86
 
87
+ const unknownRoot = Object.keys(theme).filter((k) => !ROOT_KEYS.has(k));
88
+ if (unknownRoot.length) fail(`unknown root keys: ${unknownRoot.join(", ")}`);
89
+ const unknownColors = Object.keys(colors).filter((k) => !ALLOWED_COLORS.has(k));
90
+ if (unknownColors.length) fail(`unknown color tokens: ${unknownColors.join(", ")}`);
91
+ const unknownExport = Object.keys(theme.export ?? {}).filter((k) => !EXPORT_KEYS.has(k));
92
+ if (unknownExport.length) fail(`unknown export keys: ${unknownExport.join(", ")}`);
93
+
66
94
  const vars = new Set(Object.keys(theme.vars ?? {}));
67
95
  const bad = [];
68
- for (const [k, v] of Object.entries({ ...vars.entries && theme.vars, ...colors })) {
96
+ for (const [k, v] of Object.entries({ ...theme.vars, ...colors })) {
69
97
  if (!isColorValue(v, vars)) bad.push(`${k}=${JSON.stringify(v)}`);
70
98
  }
71
99
  if (bad.length) fail(`unresolvable values: ${bad.join(", ")}`);
@@ -11,7 +11,7 @@ Use the Munin Pi extension tools to recover and preserve verified project knowle
11
11
 
12
12
  ## How It Works
13
13
 
14
- 1. The ceulen `munin` module provides native tools: `munin_search`, `munin_get`, `munin_store`, `munin_list`, `munin_recent`, `munin_delete`, `munin_capabilities`, `munin_share`.
14
+ 1. The ceulen `munin` module provides native tools: `munin_search`, `munin_get`, `munin_store` (all three always declared), plus `munin_list`, `munin_recent`, `munin_delete`, `munin_capabilities`, `munin_share` (loaded on demand via `tool_search`).
15
15
  2. Config lives at PROJECT level: `/config` → Memory → Munin (saved to `<repo>/.pi/settings.json` under a `munin` section). `MUNIN_API_KEY` / `MUNIN_PROJECT` / `MUNIN_BASE_URL` env vars (incl. trusted `.env.local` / `.env`) override it; a per-call `api_key`/`project`/`base_url` param overrides everything.
16
16
  3. Print readable output by default, or raw JSON via tool details.
17
17
  4. Store only durable knowledge that is verified and useful in a future session.
@@ -1,5 +1,5 @@
1
1
  {
2
- "$schema": "https://raw.githubusercontent.com/earendil-works/pi/main/packages/coding-agent/src/modes/interactive/theme/theme-schema.json",
2
+ "$schema": "https://pi.dev/schemas/theme.schema.json",
3
3
  "name": "alabaster",
4
4
  "vars": {
5
5
  "alabaster": "#fdfcfb",
@@ -68,22 +68,7 @@
68
68
  "thinkingMedium": "#606870",
69
69
  "thinkingHigh": "#505860",
70
70
  "thinkingXhigh": "#303840",
71
- "bashMode": "#405840",
72
- "statusLineBg": "#ececf0",
73
- "statusLineSep": "#a0a0a8",
74
- "statusLineModel": "#505860",
75
- "statusLinePath": "#404850",
76
- "statusLineGitClean": "#305030",
77
- "statusLineGitDirty": "#806030",
78
- "statusLineContext": "#404860",
79
- "statusLineSpend": "#405050",
80
- "statusLineStaged": 28,
81
- "statusLineDirty": 136,
82
- "statusLineUntracked": 31,
83
- "statusLineOutput": 133,
84
- "statusLineCost": 133,
85
- "statusLineSubagents": "shadowGray",
86
- "pythonMode": "#f0c040"
71
+ "bashMode": "#405840"
87
72
  },
88
73
  "export": {
89
74
  "pageBg": "#fdfcfb",
@@ -1,5 +1,5 @@
1
1
  {
2
- "$schema": "https://raw.githubusercontent.com/earendil-works/pi/main/packages/coding-agent/src/modes/interactive/theme/theme-schema.json",
2
+ "$schema": "https://pi.dev/schemas/theme.schema.json",
3
3
  "name": "amethyst",
4
4
  "vars": {
5
5
  "amethyst": "#b48eff",
@@ -11,7 +11,6 @@
11
11
  "lavender": "#c8a8e9",
12
12
  "crystalFacet": "#2a2435",
13
13
  "caveDark": "#140f18",
14
- "caveDeep": "#0f0b13",
15
14
  "selectedBg": "#221b28",
16
15
  "userMsgBg": "#1a1420",
17
16
  "toolPendingBg": "#1b1624",
@@ -55,7 +54,6 @@
55
54
  "toolDiffAdded": "#8eb897",
56
55
  "toolDiffRemoved": "#d96c75",
57
56
  "toolDiffContext": "#8b7a99",
58
- "link": "violet",
59
57
  "syntaxComment": "#7a6b88",
60
58
  "syntaxKeyword": "amethyst",
61
59
  "syntaxFunction": "gold",
@@ -71,22 +69,7 @@
71
69
  "thinkingMedium": "violet",
72
70
  "thinkingHigh": "amethyst",
73
71
  "thinkingXhigh": "lavender",
74
- "bashMode": "amethyst",
75
- "statusLineBg": "caveDeep",
76
- "statusLineSep": 240,
77
- "statusLineModel": "roseQuartz",
78
- "statusLinePath": "violet",
79
- "statusLineGitClean": "#8eb897",
80
- "statusLineGitDirty": "gold",
81
- "statusLineContext": "lavender",
82
- "statusLineSpend": "deepPurple",
83
- "statusLineStaged": 141,
84
- "statusLineDirty": 179,
85
- "statusLineUntracked": 183,
86
- "statusLineOutput": 213,
87
- "statusLineCost": 213,
88
- "statusLineSubagents": "amethyst",
89
- "pythonMode": "gold"
72
+ "bashMode": "amethyst"
90
73
  },
91
74
  "export": {
92
75
  "pageBg": "caveDark",
@@ -1,17 +1,13 @@
1
1
  {
2
- "$schema": "https://raw.githubusercontent.com/earendil-works/pi/main/packages/coding-agent/src/modes/interactive/theme/theme-schema.json",
2
+ "$schema": "https://pi.dev/schemas/theme.schema.json",
3
3
  "name": "anthracite",
4
4
  "vars": {
5
- "coal": "#121419",
6
5
  "steel": "#3d4555",
7
6
  "steelLight": "#4f5566",
8
7
  "ember": "#e8734a",
9
- "emberDim": "#b5583a",
10
- "ash": "#d4d8e4",
11
8
  "ashGray": "#9ca3b5",
12
9
  "soot": "#6b7280",
13
10
  "sootDark": "#4d5561",
14
- "coalLighter": "#1a1e25",
15
11
  "success": "#7fb069",
16
12
  "error": "#d9534f",
17
13
  "warning": "#e89c4a"
@@ -52,7 +48,6 @@
52
48
  "toolDiffAdded": "success",
53
49
  "toolDiffRemoved": "error",
54
50
  "toolDiffContext": "soot",
55
- "link": "#6ba3d4",
56
51
  "syntaxComment": "#6b8099",
57
52
  "syntaxKeyword": "#7ba8d4",
58
53
  "syntaxFunction": "#e8a069",
@@ -68,22 +63,7 @@
68
63
  "thinkingMedium": "#6ba3d4",
69
64
  "thinkingHigh": "#c99a6e",
70
65
  "thinkingXhigh": "#e8b089",
71
- "bashMode": "#6ba3d4",
72
- "statusLineBg": "#0f1114",
73
- "statusLineSep": 240,
74
- "statusLineModel": "#c99a6e",
75
- "statusLinePath": "#6ba3d4",
76
- "statusLineGitClean": "#7fb069",
77
- "statusLineGitDirty": "#e89c4a",
78
- "statusLineContext": "#8791a6",
79
- "statusLineSpend": "#6ba3d4",
80
- "statusLineStaged": 107,
81
- "statusLineDirty": 179,
82
- "statusLineUntracked": 74,
83
- "statusLineOutput": 173,
84
- "statusLineCost": 173,
85
- "statusLineSubagents": "ember",
86
- "pythonMode": "#f0c040"
66
+ "bashMode": "#6ba3d4"
87
67
  },
88
68
  "export": {
89
69
  "pageBg": "#121419",
@@ -1,20 +1,7 @@
1
1
  {
2
- "$schema": "https://raw.githubusercontent.com/earendil-works/pi/main/packages/coding-agent/src/modes/interactive/theme/theme-schema.json",
2
+ "$schema": "https://pi.dev/schemas/theme.schema.json",
3
3
  "name": "basalt",
4
- "vars": {
5
- "charcoal": "#171613",
6
- "coolingLava": "#3a3530",
7
- "warmGray": "#4a433d",
8
- "pumice": "#e4e0d8",
9
- "dustyWhite": "#cac5bd",
10
- "ironOxide": "#c45a3a",
11
- "rustOrange": "#d97651",
12
- "mineralGreen": "#6a9a6a",
13
- "lichtenGreen": "#8bb88b",
14
- "obsidian": "#0f0d0b",
15
- "emberRed": "#b84a2c",
16
- "ashGray": "#5a524b"
17
- },
4
+ "vars": {},
18
5
  "colors": {
19
6
  "accent": "#c45a3a",
20
7
  "border": "#3a3530",
@@ -66,22 +53,7 @@
66
53
  "thinkingMedium": "#6a605a",
67
54
  "thinkingHigh": "#7a706a",
68
55
  "thinkingXhigh": "#8a807a",
69
- "bashMode": "#c45a3a",
70
- "statusLineBg": "#0f0d0b",
71
- "statusLineSep": "#3a3530",
72
- "statusLineModel": "#c45a3a",
73
- "statusLinePath": "#cac5bd",
74
- "statusLineGitClean": "#6a9a6a",
75
- "statusLineGitDirty": "#d97651",
76
- "statusLineContext": "#8bb88b",
77
- "statusLineSpend": "#d97651",
78
- "statusLineStaged": "#6a9a6a",
79
- "statusLineDirty": "#d97651",
80
- "statusLineUntracked": "#5a524b",
81
- "statusLineOutput": "#cac5bd",
82
- "statusLineCost": "#d97651",
83
- "statusLineSubagents": "#c45a3a",
84
- "pythonMode": "#f0c040"
56
+ "bashMode": "#c45a3a"
85
57
  },
86
58
  "export": {
87
59
  "pageBg": "#171613",
package/themes/birch.json CHANGED
@@ -1,8 +1,7 @@
1
1
  {
2
- "$schema": "https://raw.githubusercontent.com/earendil-works/pi/main/packages/coding-agent/src/modes/interactive/theme/theme-schema.json",
2
+ "$schema": "https://pi.dev/schemas/theme.schema.json",
3
3
  "name": "birch",
4
4
  "vars": {
5
- "barkCream": "#f9f7f1",
6
5
  "barkCharcoal": "#505048",
7
6
  "mossSage": "#608058",
8
7
  "barkStriation": "#c8c4b8",
@@ -11,7 +10,6 @@
11
10
  "darkMoss": "#4a603f",
12
11
  "warmGray": "#9a958a",
13
12
  "mutedSage": "#8a9d84",
14
- "deepBark": "#3a3832",
15
13
  "selectedBg": "#ede9df",
16
14
  "userMsgBg": "#f2efe7",
17
15
  "toolPendingBg": "#eef0ed",
@@ -70,22 +68,7 @@
70
68
  "thinkingMedium": "mossSage",
71
69
  "thinkingHigh": "#5a7a60",
72
70
  "thinkingXhigh": "#4a6050",
73
- "bashMode": "lightMoss",
74
- "statusLineBg": "#ebe7dc",
75
- "statusLineSep": "barkStriation",
76
- "statusLineModel": "#5a6a5a",
77
- "statusLinePath": "#4a5a60",
78
- "statusLineGitClean": "darkMoss",
79
- "statusLineGitDirty": "#9a7040",
80
- "statusLineContext": "#6a6a70",
81
- "statusLineSpend": "#4a6a6a",
82
- "statusLineStaged": 28,
83
- "statusLineDirty": 136,
84
- "statusLineUntracked": 31,
85
- "statusLineOutput": 133,
86
- "statusLineCost": 133,
87
- "statusLineSubagents": "mossSage",
88
- "pythonMode": "#f0c040"
71
+ "bashMode": "lightMoss"
89
72
  },
90
73
  "export": {
91
74
  "pageBg": "#f9f7f1",
@@ -1,10 +1,7 @@
1
1
  {
2
- "$schema": "https://raw.githubusercontent.com/earendil-works/pi/main/packages/coding-agent/src/modes/interactive/theme/theme-schema.json",
2
+ "$schema": "https://pi.dev/schemas/theme.schema.json",
3
3
  "name": "pi-catppuccin-mocha",
4
4
  "vars": {
5
- "rosewater": "#F5E0DC",
6
- "flamingo": "#F2CDCD",
7
- "pink": "#F5C2E7",
8
5
  "mauve": "#CBA6F7",
9
6
  "red": "#F38BA8",
10
7
  "maroon": "#EBA0AC",
@@ -15,17 +12,14 @@
15
12
  "sky": "#89DCEB",
16
13
  "sapphire": "#74C7EC",
17
14
  "blue": "#89B4FA",
18
- "lavender": "#B4BEFE",
19
15
  "text": "#CDD6F4",
20
16
  "subtext1": "#BAC2DE",
21
17
  "subtext0": "#A6ADC8",
22
18
  "overlay2": "#9399B2",
23
19
  "overlay1": "#7F849C",
24
20
  "overlay0": "#6C7086",
25
- "surface2": "#585B70",
26
21
  "surface1": "#45475A",
27
22
  "surface0": "#313244",
28
- "base": "#1E1E2E",
29
23
  "mantle": "#181825",
30
24
  "crust": "#11111B",
31
25
  "exportInfoTint": "#242031"
@@ -1,5 +1,5 @@
1
1
  {
2
- "$schema": "https://raw.githubusercontent.com/earendil-works/pi/main/packages/coding-agent/src/modes/interactive/theme/theme-schema.json",
2
+ "$schema": "https://pi.dev/schemas/theme.schema.json",
3
3
  "name": "dark-abyss",
4
4
  "vars": {
5
5
  "abyssBlack": "#05070B",
@@ -66,22 +66,7 @@
66
66
  "thinkingMedium": "abyssCyan",
67
67
  "thinkingHigh": "glowCyan",
68
68
  "thinkingXhigh": "crystalBlue",
69
- "bashMode": "abyssCyan",
70
- "statusLineBg": "#05070B",
71
- "statusLineSep": "slateBlue",
72
- "statusLineModel": "glowCyan",
73
- "statusLinePath": "crystalBlue",
74
- "statusLineGitClean": "kelpGreen",
75
- "statusLineGitDirty": "warningAmber",
76
- "statusLineContext": "mutedSteel",
77
- "statusLineSpend": "abyssCyan",
78
- "statusLineStaged": "kelpGreen",
79
- "statusLineDirty": "warningAmber",
80
- "statusLineUntracked": "glowCyan",
81
- "statusLineOutput": "crystalBlue",
82
- "statusLineCost": "warningAmber",
83
- "statusLineSubagents": "glowCyan",
84
- "pythonMode": "#f0c040"
69
+ "bashMode": "abyssCyan"
85
70
  },
86
71
  "export": {
87
72
  "pageBg": "#05070B",
@@ -1,25 +1,21 @@
1
1
  {
2
- "$schema": "https://raw.githubusercontent.com/earendil-works/pi/main/packages/coding-agent/src/modes/interactive/theme/theme-schema.json",
2
+ "$schema": "https://pi.dev/schemas/theme.schema.json",
3
3
  "name": "dark-arctic",
4
4
  "vars": {
5
- "polarNight0": "#2e3440",
6
5
  "polarNight1": "#3b4252",
7
6
  "polarNight2": "#434c5e",
8
7
  "polarNight3": "#4c566a",
9
8
  "snowStorm0": "#d8dee9",
10
9
  "snowStorm1": "#e5e9f0",
11
- "snowStorm2": "#eceff4",
12
10
  "frost0": "#8fbcbb",
13
11
  "frost1": "#88c0d0",
14
12
  "frost2": "#81a1c1",
15
13
  "frost3": "#5e81ac",
16
14
  "auroraRed": "#bf616a",
17
- "auroraOrange": "#d08770",
18
15
  "auroraYellow": "#ebcb8b",
19
16
  "auroraGreen": "#a3be8c",
20
17
  "auroraPurple": "#b48ead",
21
18
  "iceBlue": "#88c0d0",
22
- "deepPolar": "#242933",
23
19
  "userMsgBg": "#1f2430",
24
20
  "toolPendingBg": "#242933",
25
21
  "toolSuccessBg": "#1f2835",
@@ -47,7 +43,6 @@
47
43
  "toolPendingBg": "toolPendingBg",
48
44
  "toolSuccessBg": "toolSuccessBg",
49
45
  "toolErrorBg": "toolErrorBg",
50
- "toolText": "",
51
46
  "toolTitle": "",
52
47
  "toolOutput": "polarNight3",
53
48
  "mdHeading": "frost1",
@@ -63,7 +58,6 @@
63
58
  "toolDiffAdded": "auroraGreen",
64
59
  "toolDiffRemoved": "auroraRed",
65
60
  "toolDiffContext": "polarNight3",
66
- "link": "frost2",
67
61
  "syntaxComment": "#616e88",
68
62
  "syntaxKeyword": "frost3",
69
63
  "syntaxFunction": "frost1",
@@ -79,22 +73,7 @@
79
73
  "thinkingMedium": "frost2",
80
74
  "thinkingHigh": "auroraPurple",
81
75
  "thinkingXhigh": "#c8a0d1",
82
- "bashMode": "iceBlue",
83
- "statusLineBg": "#1a1f2b",
84
- "statusLineSep": 240,
85
- "statusLineModel": "auroraPurple",
86
- "statusLinePath": "frost0",
87
- "statusLineGitClean": "auroraGreen",
88
- "statusLineGitDirty": "auroraYellow",
89
- "statusLineContext": "frost3",
90
- "statusLineSpend": "frost1",
91
- "statusLineStaged": 108,
92
- "statusLineDirty": 180,
93
- "statusLineUntracked": 109,
94
- "statusLineOutput": 139,
95
- "statusLineCost": 139,
96
- "statusLineSubagents": "iceBlue",
97
- "pythonMode": "#f0c040"
76
+ "bashMode": "iceBlue"
98
77
  },
99
78
  "export": {
100
79
  "pageBg": "#1a1f2b",