ceulen 0.26.1 → 0.26.2

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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,40 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.26.2 — 2026-11-15
4
+
5
+ Pi 1.5.2 support (pi 1.5.0 → 1.5.2 diffed surface by surface; the peer
6
+ range `>=0.99.1 <1.6.0` from 0.26.0 already covered it, so no range change).
7
+ **No breaking changes for ceulen.** Everything below the fold is stock-parity
8
+ plus one deferred feature finally landed.
9
+
10
+ - **`/config` Cache warming row no longer warns on a pristine config.** Pi
11
+ 1.5.1 flipped the setting's default from `streaming` to `idle`; ceulen's
12
+ row still carried the old default and rendered warning-styled (the
13
+ pi.tuiMode-1.0.0 failure mode). `CACHE_WARMING`'s option list and the
14
+ setter are unchanged.
15
+ - **Subagent expand hints follow the user's keybinding.** The six
16
+ `(Ctrl+O to expand)` hints were hardcoded; they now read
17
+ `keyText("app.tools.expand")` from the render context (pi's
18
+ `KeybindingHints`, added in 1.5.0), so a rebind shows up. `expandKeyLabel()`
19
+ in `subagent/lib/render.ts` falls back to the literal `Ctrl+O` when the
20
+ context has no hints (the above-editor widget and `/agent` thread viewer
21
+ receive none) or a hint lookup throws — older pi keeps today's text.
22
+
23
+ Audited and left alone: tool argument validation (`prepareArguments` still
24
+ runs before `validateToolArguments` — repair's hook position is unchanged),
25
+ the new `MarkdownTransformerOptions` (ceulen registers no markdown
26
+ transformer), and `createReadStream` / the deprecated
27
+ `GrepOperations.readFile` (repair wraps read/grep by name through the host
28
+ factory with no custom `operations`, so 1.5.2's streaming read and
29
+ ripgrep-sourced context lines flow into the wrapped tools for free).
30
+ `settings-manager`, `settings-selector`, `theme-schema`, `jiti-loader`,
31
+ `trust-manager`, `custom-editor` and the root export map are byte-identical
32
+ across 1.5.0 → 1.5.2.
33
+
34
+ Verified: `tsc --noEmit` clean against 1.5.2 types; 2962 tests / 2959 pass /
35
+ 0 fail / 3 known env-gated skips (a2a mDNS, web a11y Chrome); live rpc smoke
36
+ on 1.5.2 registers all 60 commands, runs `/ceulen`, zero stderr.
37
+
3
38
  ## 0.26.1 — 2026-11-04
4
39
 
5
40
  **Fix: inbound A2A dispatches blanked the host TUI's status band (model ·
@@ -422,7 +422,7 @@ function piRowSpecs(m: SettingsManager, lookup?: PiMenuLookup): PiRowSpec[] {
422
422
  },
423
423
  {
424
424
  key: "pi.cacheWarming", tab: "Model", section: "Efficiency", label: "Cache warming",
425
- kind: "string", value: m.getCacheWarmingMode(), values: CACHE_WARMING, defaultValue: "streaming",
425
+ kind: "string", value: m.getCacheWarmingMode(), values: CACHE_WARMING, defaultValue: "idle",
426
426
  description: "off: never; streaming: while the agent runs; idle: also between runs while continuation stays profitable.",
427
427
  set: (v) => m.setCacheWarmingMode(str(v) as never),
428
428
  },
@@ -21,6 +21,19 @@ describe("pi settings contribution", () => {
21
21
  }
22
22
  });
23
23
 
24
+ it("cache warming row tracks pi's idle default and round-trips all modes", () => {
25
+ const m = SettingsManager.inMemory();
26
+ const row = rowAt(m, "pi.cacheWarming");
27
+ // pi 1.5.1 flipped the default from "streaming" to "idle" — a stale
28
+ // defaultValue would render the row warning-styled on a pristine config.
29
+ assert.equal(row.defaultValue, "idle");
30
+ assert.equal(row.value, "idle");
31
+ for (const v of ["streaming", "off", "idle"] as const) {
32
+ row.set(v);
33
+ assert.equal(m.getCacheWarmingMode(), v);
34
+ }
35
+ });
36
+
24
37
  it("builds OMP-taxonomy tabs with unique keys and sections", () => {
25
38
  const groups = buildPiSettingsGroups(SettingsManager.inMemory());
26
39
  const keys = groups.flatMap((g) => g.rows.map((r) => r.key));
@@ -67,6 +67,7 @@ import {
67
67
  } from "./lib/security.ts";
68
68
  import {
69
69
  aggregateUsage,
70
+ expandKeyLabel,
70
71
  formatUsageStats,
71
72
  renderSingleResult,
72
73
  } from "./lib/render.ts";
@@ -1777,6 +1778,7 @@ ${lines.join("\n")}`;
1777
1778
  const scope: AgentScope = args.agentScope ?? "user";
1778
1779
  const fg = theme.fg.bind(theme);
1779
1780
  const now = Date.now();
1781
+ const expandKey = expandKeyLabel(context);
1780
1782
 
1781
1783
  // Live-render driver: while the tool executes, re-render every second
1782
1784
  // (bash.js pattern) so elapsed + tool-call count stay fresh in the TUI.
@@ -1840,7 +1842,7 @@ ${lines.join("\n")}`;
1840
1842
  live;
1841
1843
  }
1842
1844
  if (args.chain.length > cap)
1843
- text += `\n ${fg("muted", `... +${args.chain.length - cap} more${context.expanded ? "" : " (Ctrl+O to expand)"}`)}`;
1845
+ text += `\n ${fg("muted", `... +${args.chain.length - cap} more${context.expanded ? "" : ` (${expandKey} to expand)`}`)}`;
1844
1846
  return new Text(text, 0, 0);
1845
1847
  }
1846
1848
 
@@ -1859,7 +1861,7 @@ ${lines.join("\n")}`;
1859
1861
  text += `\n ${fg(resolveAgentColor(t.agent), t.agent)}${fg("dim", ` ${preview}`)}${live}`;
1860
1862
  }
1861
1863
  if (args.tasks.length > cap)
1862
- text += `\n ${fg("muted", `... +${args.tasks.length - cap} more${context.expanded ? "" : " (Ctrl+O to expand)"}`)}`;
1864
+ text += `\n ${fg("muted", `... +${args.tasks.length - cap} more${context.expanded ? "" : ` (${expandKey} to expand)`}`)}`;
1863
1865
  return new Text(text, 0, 0);
1864
1866
  }
1865
1867
 
@@ -1898,11 +1900,13 @@ ${lines.join("\n")}`;
1898
1900
 
1899
1901
  const fg = theme.fg.bind(theme);
1900
1902
  const mdTheme = getMarkdownTheme();
1903
+ // Host-configured expand key (pi 1.5.x KeybindingHints); literal on older pi.
1904
+ const expandKey = expandKeyLabel(_context);
1901
1905
 
1902
1906
  // --- Single ---
1903
1907
  if (details.mode === "single" && details.results.length === 1) {
1904
1908
  const r = details.results[0];
1905
- return renderSingleResult(r, expanded, theme, resolveAgentColor(r.agent));
1909
+ return renderSingleResult(r, expanded, theme, resolveAgentColor(r.agent), expandKey);
1906
1910
  }
1907
1911
 
1908
1912
  // --- Chain ---
@@ -1971,7 +1975,7 @@ ${lines.join("\n")}`;
1971
1975
  }
1972
1976
  const totalUsage = formatUsageStats(aggregateUsage(details.results));
1973
1977
  if (totalUsage) text += `\n${fg("dim", totalUsage)}`;
1974
- text += `\n${fg("muted", "(Ctrl+O to expand)")}`;
1978
+ text += `\n${fg("muted", `(${expandKey} to expand)`)}`;
1975
1979
  return new Text(text, 0, 0);
1976
1980
  }
1977
1981
 
@@ -2056,7 +2060,7 @@ ${lines.join("\n")}`;
2056
2060
  const totalUsage = formatUsageStats(aggregateUsage(details.results));
2057
2061
  if (totalUsage) text += `\n${fg("dim", totalUsage)}`;
2058
2062
  }
2059
- if (!expanded) text += `\n${fg("muted", "(Ctrl+O to expand)")}`;
2063
+ if (!expanded) text += `\n${fg("muted", `(${expandKey} to expand)`)}`;
2060
2064
  return new Text(text, 0, 0);
2061
2065
  }
2062
2066
 
@@ -31,6 +31,21 @@ export function asRecord(value: unknown): Record<string, unknown> {
31
31
  : {};
32
32
  }
33
33
 
34
+ /**
35
+ * The configured key(s) that toggle tool output, for `(… to expand)` hints.
36
+ * pi 1.5.x hands every tool render context a `keyText`/`keyHint` pair that
37
+ * resolves the HOST's keybindings (`app.tools.expand`, ctrl+o by default), so
38
+ * a user rebind is reflected instead of a hardcoded "Ctrl+O". Contexts without
39
+ * it (pi <1.5, widget/thread renderers) keep the literal.
40
+ */
41
+ export function expandKeyLabel(context?: { keyText?: (k: "app.tools.expand") => string }): string {
42
+ try {
43
+ return context?.keyText?.("app.tools.expand") || "Ctrl+O";
44
+ } catch {
45
+ return "Ctrl+O";
46
+ }
47
+ }
48
+
34
49
  // ---------------------------------------------------------------------------
35
50
  // Display helpers
36
51
  // ---------------------------------------------------------------------------
@@ -214,6 +229,8 @@ export function renderSingleResult(
214
229
  expanded: boolean,
215
230
  theme: { fg: (c: any, t: string) => string; bold: (t: string) => string },
216
231
  agentColor?: string,
232
+ /** Configured expand key label — see expandKeyLabel(). */
233
+ expandKey = "Ctrl+O",
217
234
  ): Container | Text {
218
235
  const isError = isFailedResult(result);
219
236
  const icon = isError ? theme.fg("error", "✗") : theme.fg("success", "✓");
@@ -299,7 +316,7 @@ export function renderSingleResult(
299
316
  text += `\n${theme.fg("muted", "(no output)")}`;
300
317
  } else if (rawOutput.trim() !== "") {
301
318
  // All-structural output (headings/bullets/fences only) — still say so.
302
- text += `\n${theme.fg("dim", "⎿ (markdown answer — Ctrl+O to view)")}`;
319
+ text += `\n${theme.fg("dim", `⎿ (markdown answer — ${expandKey} to view)`)}`;
303
320
  }
304
321
  } else if (!result.errorMessage && rawOutput.trim() === "" && !result.stderr) {
305
322
  // Error with no message, no stderr, no assistant output — say so.
@@ -312,7 +329,7 @@ export function renderSingleResult(
312
329
  // Hint: getResultOutput always returns at least "(no output)", so finalOutput
313
330
  // is always truthy — show the hint whenever there's any trace to expand.
314
331
  if (displayItems.length > 0 || (finalOutput && finalOutput !== "(no output)") || result.messages.length > 0) {
315
- text += `\n${theme.fg("muted", "(Ctrl+O to expand · /agent for full thread)")}`;
332
+ text += `\n${theme.fg("muted", `(${expandKey} to expand · /agent for full thread)`)}`;
316
333
  }
317
334
  return new Text(text, 0, 0);
318
335
  }
@@ -0,0 +1,50 @@
1
+ // Expand-hint rendering: the "(… to expand)" hint follows the HOST's
2
+ // configured keybinding (pi 1.5.x `KeybindingHints.keyText`) and falls back to
3
+ // the literal "Ctrl+O" when no render context supplies one (pi <1.5, widget and
4
+ // thread renderers). A null theme renders plain text, so assertions read the
5
+ // raw strings — same convention as widget.test.ts.
6
+
7
+ import assert from "node:assert/strict";
8
+ import { test } from "node:test";
9
+ import { expandKeyLabel, renderSingleResult } from "../lib/render.ts";
10
+ import type { SubAgentResult } from "../lib/runner.ts";
11
+ import type { Text } from "@earendil-works/pi-tui";
12
+
13
+ const plainTheme = {
14
+ fg: (_c: string, text: string) => text,
15
+ bold: (text: string) => text,
16
+ };
17
+
18
+ function result(overrides: Partial<SubAgentResult> = {}): SubAgentResult {
19
+ return {
20
+ agent: "scout",
21
+ task: "Recon the registry module",
22
+ exitCode: 0,
23
+ messages: [],
24
+ stderr: "",
25
+ usage: { input: 1, output: 2, cacheRead: 0, cacheWrite: 0, cost: 0.01, contextTokens: 3, turns: 1 },
26
+ ...overrides,
27
+ };
28
+ }
29
+
30
+ const renderText = (component: unknown): string => (component as Text).render(100).join("\n");
31
+
32
+ test("expandKeyLabel: host keybinding wins, literal is the fallback", () => {
33
+ assert.equal(expandKeyLabel({ keyText: () => "ctrl+o" }), "ctrl+o");
34
+ assert.equal(expandKeyLabel({ keyText: () => "" }), "Ctrl+O", "empty key list falls back");
35
+ assert.equal(expandKeyLabel({ keyText: () => { throw new Error("boom"); } }), "Ctrl+O", "throwing context falls back");
36
+ assert.equal(expandKeyLabel(undefined), "Ctrl+O", "no context (widget/thread renderers, older pi)");
37
+ });
38
+
39
+ test("renderSingleResult: collapsed hint uses the configured expand key", () => {
40
+ const r = result({
41
+ messages: [{ role: "assistant", content: [{ type: "text", text: "## Heading only" }] } as never],
42
+ });
43
+ // Host-configured key (a rebind) replaces the hardcoded literal.
44
+ const rebinded = renderText(renderSingleResult(r, false, plainTheme, undefined, "ctrl+shift+e"));
45
+ assert.match(rebinded, /ctrl\+shift\+e to expand/);
46
+ assert.doesNotMatch(rebinded, /Ctrl\+O/);
47
+ // Default parameter keeps today's behavior for callers without a context.
48
+ const fallback = renderText(renderSingleResult(r, false, plainTheme));
49
+ assert.match(fallback, /Ctrl\+O to expand/);
50
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ceulen",
3
- "version": "0.26.1",
3
+ "version": "0.26.2",
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",