@mrciphersmith/keryx 0.2.149 → 0.2.151

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 (2) hide show
  1. package/dist/cli.js +211 -171
  2. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -51497,7 +51497,7 @@ import path47 from "path";
51497
51497
  // package.json
51498
51498
  var package_default = {
51499
51499
  name: "@mrciphersmith/keryx",
51500
- version: "0.2.149",
51500
+ version: "0.2.151",
51501
51501
  description: "Version-controlled project context for AI coding agents: code graph, architecture wiki, project memory, relevant tests, quality signals, and task flows.",
51502
51502
  private: false,
51503
51503
  publishConfig: {
@@ -91834,6 +91834,24 @@ function deriveTranscriptPalette(theme) {
91834
91834
  diffDeleteBackground: mixHex(theme.panel, theme.error, 0.12)
91835
91835
  };
91836
91836
  }
91837
+ function roleColor(role, theme = getTheme()) {
91838
+ switch (role) {
91839
+ case "text":
91840
+ return theme.text;
91841
+ case "muted":
91842
+ return theme.muted;
91843
+ case "accent":
91844
+ return theme.tool;
91845
+ case "attention":
91846
+ return theme.focus;
91847
+ case "ok":
91848
+ return theme.ok;
91849
+ case "error":
91850
+ return theme.error;
91851
+ case "side":
91852
+ return theme.side;
91853
+ }
91854
+ }
91837
91855
  var THEME_NAMES = [
91838
91856
  "groknight",
91839
91857
  "tokyonight",
@@ -91851,6 +91869,9 @@ var THEME_NAMES = [
91851
91869
  var THEME_IDS = ["auto", ...THEME_NAMES];
91852
91870
  var DEFAULT_THEME_ID = "groknight";
91853
91871
  var LIGHT_THEME_NAMES = new Set(["grokday", "paper", "frost", "sand", "mint"]);
91872
+ function isLightTheme(name) {
91873
+ return LIGHT_THEME_NAMES.has(name);
91874
+ }
91854
91875
  var THEMES = {
91855
91876
  groknight: {
91856
91877
  name: "groknight",
@@ -91911,7 +91932,7 @@ var THEMES = {
91911
91932
  user: "#c8d0d0",
91912
91933
  assistant: "#5ec8c8",
91913
91934
  tool: "#5ec8c8",
91914
- side: "#5a3a6a",
91935
+ side: "#b39ddb",
91915
91936
  focus: "#ffd166",
91916
91937
  error: "#e05a5a",
91917
91938
  ok: "#6bcf6b"
@@ -92615,6 +92636,20 @@ async function runGoalCommand(params) {
92615
92636
  init_metaproject_adapter();
92616
92637
  import { spawnSync as spawnSync3 } from "child_process";
92617
92638
 
92639
+ // src/tui/sidebar-metrics.ts
92640
+ var SIDEBAR_WIDTH = 34;
92641
+
92642
+ // src/tui/theme-text.ts
92643
+ function roleChunk(otui, role, text) {
92644
+ return otui.fg(roleColor(role))(text);
92645
+ }
92646
+ function dimChunk(otui, text) {
92647
+ return isLightTheme(getTheme().name) ? roleChunk(otui, "muted", text) : otui.dim(roleChunk(otui, "text", text));
92648
+ }
92649
+ function boldChunk(otui, text) {
92650
+ return otui.bold(roleChunk(otui, "text", text));
92651
+ }
92652
+
92618
92653
  // src/tui/transcript-blocks.ts
92619
92654
  var EVICTED_BLOCK_TEXT = "(output no longer retained)";
92620
92655
  var UNKNOWN_BLOCK_TEXT = "(no such block)";
@@ -93176,7 +93211,7 @@ function createBlockView(otui, renderer, parent, block, options = {}) {
93176
93211
  const line = state.summary.length > 0 ? `${label} ${state.summary}` : label;
93177
93212
  if (focused) {
93178
93213
  header.fg = undefined;
93179
- header.content = otui.t`${otui.yellow(`\u276F ${line}`)}`;
93214
+ header.content = otui.t`${roleChunk(otui, "attention", `\u276F ${line}`)}`;
93180
93215
  return;
93181
93216
  }
93182
93217
  if (tone === "red" || tone === "cyan") {
@@ -93185,7 +93220,7 @@ function createBlockView(otui, renderer, parent, block, options = {}) {
93185
93220
  return;
93186
93221
  }
93187
93222
  header.fg = undefined;
93188
- header.content = otui.t`${otui.dim(line)}`;
93223
+ header.content = otui.t`${dimChunk(otui, line)}`;
93189
93224
  };
93190
93225
  const dropBody = () => {
93191
93226
  if (body === undefined) {
@@ -93269,7 +93304,7 @@ function appendUserEcho(otui, renderer, parent, options) {
93269
93304
  });
93270
93305
  box.add(new otui.TextRenderable(renderer, {
93271
93306
  id: `${options.id}-t`,
93272
- content: fullWidth ? text : otui.t`${otui.dim(text)}`,
93307
+ content: fullWidth ? text : otui.t`${dimChunk(otui, text)}`,
93273
93308
  ...fullWidth ? { fg: getTheme().user, wrapMode: "word" } : {}
93274
93309
  }));
93275
93310
  parent.add(box);
@@ -93549,7 +93584,6 @@ function modalBodyRows(panelHeight) {
93549
93584
  return Math.max(1, panelHeight - MODAL_CHROME_ROWS);
93550
93585
  }
93551
93586
  var CLOSE_HINT = "[x] esc";
93552
- var UNMEASURED_SIDEBAR_WIDTH = 30;
93553
93587
  function resolveModalAvailableWidth(chrome) {
93554
93588
  const rWidth = chrome.renderer.width;
93555
93589
  const mainWidth = chrome.main?.width ?? 0;
@@ -93557,7 +93591,7 @@ function resolveModalAvailableWidth(chrome) {
93557
93591
  return Math.min(rWidth, mainWidth);
93558
93592
  }
93559
93593
  if (chrome.sidebar !== undefined) {
93560
- const sidebarWidth = chrome.sidebar.width > 0 ? chrome.sidebar.width : UNMEASURED_SIDEBAR_WIDTH;
93594
+ const sidebarWidth = chrome.sidebar.width > 0 ? chrome.sidebar.width : SIDEBAR_WIDTH;
93561
93595
  return Math.max(20, rWidth - sidebarWidth);
93562
93596
  }
93563
93597
  return rWidth;
@@ -93614,7 +93648,7 @@ function paintTabs(state) {
93614
93648
  const prefix = index === 0 ? "" : " ";
93615
93649
  state.tabStrip.add(new state.otui.TextRenderable(state.chrome.renderer, {
93616
93650
  id: `modal-tab-${tab.id}`,
93617
- content: active ? state.otui.t`${prefix}${state.otui.bold(label)}` : state.otui.t`${prefix}${state.otui.dim(label)}`,
93651
+ content: active ? state.otui.t`${prefix}${boldChunk(state.otui, label)}` : state.otui.t`${prefix}${dimChunk(state.otui, label)}`,
93618
93652
  fg: active ? theme.focus : theme.muted,
93619
93653
  onMouseDown: () => {
93620
93654
  if (!state.open || state.input === undefined || tab.id === state.active) {
@@ -93628,12 +93662,12 @@ function paintTabs(state) {
93628
93662
  function paintHeader(state, title) {
93629
93663
  const maxTitle = Math.max(8, innerWidthOf(state) - CLOSE_HINT.length - 1);
93630
93664
  const shown = title.length > maxTitle ? `${title.slice(0, Math.max(1, maxTitle - 1))}\u2026` : title;
93631
- state.titleText.content = state.otui.t`${state.otui.bold(shown)}`;
93632
- state.closeText.content = state.otui.t`${state.otui.dim(CLOSE_HINT)}`;
93665
+ state.titleText.content = state.otui.t`${boldChunk(state.otui, shown)}`;
93666
+ state.closeText.content = state.otui.t`${dimChunk(state.otui, CLOSE_HINT)}`;
93633
93667
  }
93634
93668
  function paintFooter(state, actions) {
93635
93669
  const items = actions !== undefined && actions.length > 0 ? actions : DEFAULT_FOOTER;
93636
- state.footerText.content = state.otui.t`${state.otui.dim(formatModalFooter(items))}`;
93670
+ state.footerText.content = state.otui.t`${dimChunk(state.otui, formatModalFooter(items))}`;
93637
93671
  }
93638
93672
  function unmountActiveTab(state) {
93639
93673
  const cleanup = state.tabCleanup;
@@ -95622,7 +95656,6 @@ var COMPOSER_MIN_ROWS = 1;
95622
95656
  var COMPOSER_MAX_ROWS = 6;
95623
95657
  var COMPOSER_BORDER_ROWS = 2;
95624
95658
  var MENU_HEIGHT = 10;
95625
- var SIDEBAR_WIDTH = 30;
95626
95659
  var SIDEBAR_BORDER_LEFT = 1;
95627
95660
  var SIDEBAR_PADDING_LEFT = 2;
95628
95661
  var SIDEBAR_PADDING_RIGHT = 1;
@@ -95847,7 +95880,7 @@ async function createShellChrome(otui, renderer, opts) {
95847
95880
  if (!alive || advisory === undefined)
95848
95881
  return;
95849
95882
  try {
95850
- versionNotice.content = otui.t`${otui.yellow(advisory)}`;
95883
+ versionNotice.content = otui.t`${roleChunk(otui, "attention", advisory)}`;
95851
95884
  } catch {}
95852
95885
  }, () => {});
95853
95886
  }
@@ -95863,7 +95896,7 @@ async function createShellChrome(otui, renderer, opts) {
95863
95896
  }
95864
95897
  };
95865
95898
  const showToast = (message) => {
95866
- toastText.content = otui.t`${otui.green(`\u2713 ${message}`)}`;
95899
+ toastText.content = otui.t`${roleChunk(otui, "ok", `\u2713 ${message}`)}`;
95867
95900
  clearToastTimer();
95868
95901
  toastTimer = setTimeout(() => {
95869
95902
  toastText.content = "";
@@ -95891,14 +95924,14 @@ async function createShellChrome(otui, renderer, opts) {
95891
95924
  });
95892
95925
  const headerLeft = new otui.TextRenderable(r, {
95893
95926
  id: "header-left",
95894
- content: otui.t`${otui.bold(`\u25C6 ${opts.title}`)}`
95927
+ content: otui.t`${boldChunk(otui, `\u25C6 ${opts.title}`)}`
95895
95928
  });
95896
95929
  header.add(headerLeft);
95897
95930
  const headerRight = new otui.TextRenderable(r, { id: "header-right", content: "" });
95898
95931
  header.add(headerRight);
95899
95932
  main.add(header);
95900
95933
  const paintDim = (target, text) => {
95901
- target.content = text.length === 0 ? "" : otui.t`${otui.dim(text)}`;
95934
+ target.content = text.length === 0 ? "" : otui.t`${dimChunk(otui, text)}`;
95902
95935
  };
95903
95936
  paintDim(headerRight, opts.headerMeta ?? "");
95904
95937
  const promptPin = new otui.BoxRenderable(r, {
@@ -96156,9 +96189,9 @@ async function createShellChrome(otui, renderer, opts) {
96156
96189
  paddingLeft: 1,
96157
96190
  paddingRight: 1
96158
96191
  });
96159
- const footerLeft = new otui.TextRenderable(r, { id: "footer-left", content: otui.t`${otui.dim(opts.footerHint)}` });
96192
+ const footerLeft = new otui.TextRenderable(r, { id: "footer-left", content: otui.t`${dimChunk(otui, opts.footerHint)}` });
96160
96193
  footer.add(footerLeft);
96161
- const footerRight = new otui.TextRenderable(r, { id: "footer-right", content: otui.t`${otui.dim(opts.status)}` });
96194
+ const footerRight = new otui.TextRenderable(r, { id: "footer-right", content: otui.t`${dimChunk(otui, opts.status)}` });
96162
96195
  footer.add(footerRight);
96163
96196
  main.add(footer);
96164
96197
  let busyPhase = "waiting for model";
@@ -96175,18 +96208,18 @@ async function createShellChrome(otui, renderer, opts) {
96175
96208
  return;
96176
96209
  }
96177
96210
  if (!busy) {
96178
- footerLeft.content = otui.t`${otui.dim(opts.footerHint)}`;
96179
- footerRight.content = otui.t`${otui.dim(status)}`;
96211
+ footerLeft.content = otui.t`${dimChunk(otui, opts.footerHint)}`;
96212
+ footerRight.content = otui.t`${dimChunk(otui, status)}`;
96180
96213
  return;
96181
96214
  }
96182
96215
  const frame = SPINNER[spinIdx % SPINNER.length] ?? "\u280B";
96183
96216
  const secs = ((Date.now() - busyStartedAt) / 1000).toFixed(1);
96184
96217
  const line = `${frame} ${busyPhase} \xB7 ${secs}s`;
96185
- footerLeft.content = otui.t`${otui.yellow(line)}`;
96218
+ footerLeft.content = otui.t`${roleChunk(otui, "attention", line)}`;
96186
96219
  const perm = opts.permissionMode?.();
96187
- footerRight.content = otui.t`${otui.dim(perm !== undefined && perm.length > 0 ? `mode ${perm}` : status)}`;
96220
+ footerRight.content = otui.t`${dimChunk(otui, perm !== undefined && perm.length > 0 ? `mode ${perm}` : status)}`;
96188
96221
  if (liveStatus !== undefined) {
96189
- liveStatus.content = otui.t`${otui.dim(line)}`;
96222
+ liveStatus.content = otui.t`${dimChunk(otui, line)}`;
96190
96223
  }
96191
96224
  };
96192
96225
  const clearBusyTimer = () => {
@@ -96206,7 +96239,7 @@ async function createShellChrome(otui, renderer, opts) {
96206
96239
  spinIdx = 0;
96207
96240
  liveStatus = new otui.TextRenderable(r, {
96208
96241
  id: `ls${uid++}`,
96209
- content: otui.t`${otui.dim(`\u280B ${phase} \xB7 0.0s`)}`,
96242
+ content: otui.t`${dimChunk(otui, `\u280B ${phase} \xB7 0.0s`)}`,
96210
96243
  marginTop: 1
96211
96244
  });
96212
96245
  transcript.add(liveStatus);
@@ -96536,9 +96569,9 @@ async function playBootAnimation(otui, r, opts) {
96536
96569
  const logoBox = new otui.BoxRenderable(r, { id: "boot-logo-box", flexDirection: "column", alignItems: "center" });
96537
96570
  box.add(logoBox);
96538
96571
  for (const [index, line] of WORDMARK.entries()) {
96539
- logoBox.add(new otui.TextRenderable(r, { id: `boot-logo-${index}`, content: otui.t`${otui.bold(line)}` }));
96572
+ logoBox.add(new otui.TextRenderable(r, { id: `boot-logo-${index}`, content: otui.t`${boldChunk(otui, line)}` }));
96540
96573
  }
96541
- box.add(new otui.TextRenderable(r, { id: "boot-hint", content: otui.t`${otui.dim("any key to skip")}`, marginTop: 1 }));
96574
+ box.add(new otui.TextRenderable(r, { id: "boot-hint", content: otui.t`${dimChunk(otui, "any key to skip")}`, marginTop: 1 }));
96542
96575
  await new Promise((resolve) => {
96543
96576
  let settled = false;
96544
96577
  const finish = () => {
@@ -96629,7 +96662,7 @@ function mountEmptyTranscriptSplash(otui, r, transcript) {
96629
96662
  const node = new otui.TextRenderable(r, {
96630
96663
  id: `splash-${kind}-${index}`,
96631
96664
  wrapMode: "none",
96632
- content: otui.t`${kind === "logo" ? otui.bold(line) : otui.dim(line)}`,
96665
+ content: otui.t`${kind === "logo" ? boldChunk(otui, line) : dimChunk(otui, line)}`,
96633
96666
  ...index === 0 && kind !== "logo" ? { marginTop: 1 } : {}
96634
96667
  });
96635
96668
  box.add(node);
@@ -98518,13 +98551,13 @@ function mountBalancePanel(sidebarTop, otui, renderer, options) {
98518
98551
  }
98519
98552
  const label = new core.TextRenderable(r, {
98520
98553
  id: "sb-balance-k",
98521
- content: core.t`${core.dim("Balance")}`,
98554
+ content: core.t`${dimChunk(core, "Balance")}`,
98522
98555
  marginTop: 1
98523
98556
  });
98524
98557
  box.add(label);
98525
98558
  const value = new core.TextRenderable(r, {
98526
98559
  id: "sb-balance-v",
98527
- content: core.t`${core.dim("\u2026")}`,
98560
+ content: core.t`${dimChunk(core, "\u2026")}`,
98528
98561
  onMouseDown: () => {
98529
98562
  refresh();
98530
98563
  }
@@ -98535,7 +98568,7 @@ function mountBalancePanel(sidebarTop, otui, renderer, options) {
98535
98568
  const paint = (balance) => {
98536
98569
  current = balance;
98537
98570
  if (textNode !== undefined) {
98538
- textNode.content = core.t`${core.dim(formatBalance(balance))}`;
98571
+ textNode.content = core.t`${dimChunk(core, formatBalance(balance))}`;
98539
98572
  }
98540
98573
  };
98541
98574
  const refresh = async () => {
@@ -100736,7 +100769,7 @@ function presentComposerChoice(otui, r, dock, request) {
100736
100769
  const subtitleRows = Math.min(Math.max(subtitleLines.length, 1), MAX_SUBTITLE_ROWS);
100737
100770
  const title = new otui.TextRenderable(r, {
100738
100771
  id: `ch-title-${Date.now()}`,
100739
- content: otui.t`${otui.bold(request.title)} ${otui.dim(hasScrollableSubtitle ? "\u2191/\u2193 Enter \xB7 Esc \xB7 ctrl+o scroll cmd" : "\u2191/\u2193 Enter \xB7 Esc")}`
100772
+ content: otui.t`${boldChunk(otui, request.title)} ${dimChunk(otui, hasScrollableSubtitle ? "\u2191/\u2193 Enter \xB7 Esc \xB7 ctrl+o scroll cmd" : "\u2191/\u2193 Enter \xB7 Esc")}`
100740
100773
  });
100741
100774
  dock.add(title);
100742
100775
  let subtitleScroll;
@@ -100752,14 +100785,14 @@ function presentComposerChoice(otui, r, dock, request) {
100752
100785
  for (const [i, line] of subtitleLines.entries()) {
100753
100786
  subtitleScroll.content.add(new otui.TextRenderable(r, {
100754
100787
  id: `ch-sub-line-${i}-${Date.now()}`,
100755
- content: otui.t`${otui.yellow(line)}`
100788
+ content: otui.t`${roleChunk(otui, "attention", line)}`
100756
100789
  }));
100757
100790
  }
100758
100791
  dock.add(subtitleScroll);
100759
100792
  } else if (subtitleLines.length > 0) {
100760
100793
  subtitleLine = new otui.TextRenderable(r, {
100761
100794
  id: `ch-sub-${Date.now()}`,
100762
- content: otui.t`${otui.yellow(subtitleLines[0] ?? "")}`
100795
+ content: otui.t`${roleChunk(otui, "attention", subtitleLines[0] ?? "")}`
100763
100796
  });
100764
100797
  dock.add(subtitleLine);
100765
100798
  }
@@ -100783,8 +100816,8 @@ function presentComposerChoice(otui, r, dock, request) {
100783
100816
  const active = i === selected;
100784
100817
  row.box.backgroundColor = active ? theme.highlight : undefined;
100785
100818
  row.label.fg = active ? theme.focus : theme.text;
100786
- row.label.content = active ? otui.t`${otui.bold(o.displayLabel)}` : o.displayLabel;
100787
- row.desc.content = otui.t`${otui.dim(o.description.length > 0 ? o.description : " ")}`;
100819
+ row.label.content = active ? otui.t`${boldChunk(otui, o.displayLabel)}` : o.displayLabel;
100820
+ row.desc.content = otui.t`${dimChunk(otui, o.description.length > 0 ? o.description : " ")}`;
100788
100821
  if (active) {
100789
100822
  optionsScroll.scrollChildIntoView(row.id);
100790
100823
  }
@@ -100816,7 +100849,7 @@ function presentComposerChoice(otui, r, dock, request) {
100816
100849
  const label = new otui.TextRenderable(r, { id: `ch-opt-l-${i}-${Date.now()}`, content: o.displayLabel });
100817
100850
  const desc = new otui.TextRenderable(r, {
100818
100851
  id: `ch-opt-d-${i}-${Date.now()}`,
100819
- content: otui.t`${otui.dim(o.description.length > 0 ? o.description : " ")}`
100852
+ content: otui.t`${dimChunk(otui, o.description.length > 0 ? o.description : " ")}`
100820
100853
  });
100821
100854
  box.add(label);
100822
100855
  box.add(desc);
@@ -100835,7 +100868,7 @@ function presentComposerChoice(otui, r, dock, request) {
100835
100868
  for (const [i, line] of lines.entries()) {
100836
100869
  const renderable = new otui.TextRenderable(r, {
100837
100870
  id: `ch-ctx-${i}-${Date.now()}`,
100838
- content: otui.t`${otui.dim(line)}`
100871
+ content: otui.t`${dimChunk(otui, line)}`
100839
100872
  });
100840
100873
  contextLines.push(renderable);
100841
100874
  try {
@@ -103246,14 +103279,14 @@ function formatPlanMeta(plan, dir) {
103246
103279
  function toneFor(status) {
103247
103280
  switch (status) {
103248
103281
  case "proposed":
103249
- return "yellow";
103282
+ return "attention";
103250
103283
  case "in_progress":
103251
- return "cyan";
103284
+ return "accent";
103252
103285
  case "blocked":
103253
- return "red";
103286
+ return "error";
103254
103287
  case "completed":
103255
103288
  case "skipped":
103256
- return "dim";
103289
+ return "muted";
103257
103290
  case "pending":
103258
103291
  return "plain";
103259
103292
  }
@@ -103261,11 +103294,18 @@ function toneFor(status) {
103261
103294
  function stylePlanText(otui, text, tone) {
103262
103295
  const helpers = otui ?? {};
103263
103296
  const tag = helpers.t;
103264
- const styler = tone === "plain" ? undefined : helpers[tone];
103265
- if (typeof tag !== "function" || typeof styler !== "function") {
103297
+ if (typeof tag !== "function" || typeof helpers.fg !== "function" || tone === "plain") {
103266
103298
  return text;
103267
103299
  }
103268
- return tag`${styler(text)}`;
103300
+ const core = otui;
103301
+ switch (tone) {
103302
+ case "strong":
103303
+ return tag`${boldChunk(core, text)}`;
103304
+ case "muted":
103305
+ return tag`${dimChunk(core, text)}`;
103306
+ default:
103307
+ return tag`${roleChunk(core, tone, text)}`;
103308
+ }
103269
103309
  }
103270
103310
  function presentExecutionPlanInspector(openModalFn, otui, chrome, options) {
103271
103311
  let plan = options.initial;
@@ -103293,13 +103333,13 @@ function presentExecutionPlanInspector(openModalFn, otui, chrome, options) {
103293
103333
  add("plan-meta", formatPlanMeta(plan, dir));
103294
103334
  return;
103295
103335
  }
103296
- add("plan-summary", stylePlanText(otui, formatPlanSummary(plan), "bold"));
103336
+ add("plan-summary", stylePlanText(otui, formatPlanSummary(plan), "strong"));
103297
103337
  if (plan === undefined || plan.items.length === 0) {
103298
- add("plan-empty", stylePlanText(otui, PLAN_EMPTY_TEXT, "dim"), 1);
103338
+ add("plan-empty", stylePlanText(otui, PLAN_EMPTY_TEXT, "muted"), 1);
103299
103339
  return;
103300
103340
  }
103301
- add("plan-bar", stylePlanText(otui, `${planProgressBar(plan)} ${planCounts(plan).completed}/${plan.items.length}`, "cyan"), 1);
103302
- add("plan-legend", stylePlanText(otui, formatPlanLegend(), "dim"), 1);
103341
+ add("plan-bar", stylePlanText(otui, `${planProgressBar(plan)} ${planCounts(plan).completed}/${plan.items.length}`, "accent"), 1);
103342
+ add("plan-legend", stylePlanText(otui, formatPlanLegend(), "muted"), 1);
103303
103343
  plan.items.forEach((item, index) => {
103304
103344
  add(`plan-item-${item.id}`, stylePlanText(otui, formatPlanRow(item), toneFor(item.status)), index === 0 ? 1 : undefined);
103305
103345
  });
@@ -103824,7 +103864,7 @@ function promptCustomFieldStep(otui, target, opts) {
103824
103864
  }
103825
103865
  });
103826
103866
  if (opts.note !== undefined) {
103827
- surface.body.add(new otui.TextRenderable(r, { id: "cf-note", content: otui.t`${otui.dim(opts.note)}`, marginTop: 1 }));
103867
+ surface.body.add(new otui.TextRenderable(r, { id: "cf-note", content: otui.t`${dimChunk(otui, opts.note)}`, marginTop: 1 }));
103828
103868
  }
103829
103869
  const input = new otui.InputRenderable(r, { id: "cf-input", value: opts.value ?? "", marginTop: 1 });
103830
103870
  surface.body.add(input);
@@ -103956,7 +103996,7 @@ function createTuiAgentIo(otui, renderer, transcript) {
103956
103996
  onReasoningEnd: (info) => {
103957
103997
  const lineCount = info.text.trim().split(`
103958
103998
  `).filter((l) => l.trim().length > 0).length;
103959
- append(otui.t`${otui.dim(formatReasoningOneLiner({
103999
+ append(otui.t`${dimChunk(otui, formatReasoningOneLiner({
103960
104000
  lineCount,
103961
104001
  redacted: info.redacted,
103962
104002
  hasText: info.text.length > 0,
@@ -103972,21 +104012,21 @@ function createTuiAgentIo(otui, renderer, transcript) {
103972
104012
  parts.push(`\u2193${usage.outputTokens}`);
103973
104013
  }
103974
104014
  if (parts.length > 0) {
103975
- append(otui.t`${otui.dim(`${parts.join(" ")} tokens`)}`);
104015
+ append(otui.t`${dimChunk(otui, `${parts.join(" ")} tokens`)}`);
103976
104016
  }
103977
104017
  },
103978
104018
  onToolCall: (name, input) => {
103979
104019
  const args = summarizeToolArgs(input);
103980
104020
  const call = args.length > 0 ? `${name}(${args})` : `${name}()`;
103981
- append(otui.t`${otui.cyan(`\u2699 ${call}`)}`);
104021
+ append(otui.t`${roleChunk(otui, "accent", `\u2699 ${call}`)}`);
103982
104022
  },
103983
104023
  onToolResult: (_name, result) => {
103984
104024
  const { summary, hidden } = collapseToolOutput(result.output);
103985
104025
  const more = hidden > 0 ? ` \xB7 +${hidden} more` : "";
103986
104026
  const line = `${result.isError ? "\u2717" : "\u21B3"} ${summary}${more}`;
103987
- append(result.isError ? otui.t`${otui.red(line)}` : otui.t`${otui.dim(line)}`);
104027
+ append(result.isError ? otui.t`${roleChunk(otui, "error", line)}` : otui.t`${dimChunk(otui, line)}`);
103988
104028
  },
103989
- onSystem: (text) => append(text.includes("[error]") ? otui.t`${otui.red(text)}` : otui.t`${otui.dim(text)}`),
104029
+ onSystem: (text) => append(text.includes("[error]") ? otui.t`${roleChunk(otui, "error", text)}` : otui.t`${dimChunk(otui, text)}`),
103990
104030
  resetStream: () => {
103991
104031
  messages.reset();
103992
104032
  },
@@ -104081,27 +104121,27 @@ function attachBlockIo(io, addBlock, chrome = {}, thinkDisplay = () => "auto") {
104081
104121
  function mountTitlePanel(otui, r, sidebarTop) {
104082
104122
  sidebarTop.add(new otui.TextRenderable(r, {
104083
104123
  id: "sb-title",
104084
- content: otui.t`${otui.bold("keryx")} ${otui.dim(`v${package_default.version}`)}`
104124
+ content: otui.t`${boldChunk(otui, "keryx")} ${dimChunk(otui, `v${package_default.version}`)}`
104085
104125
  }));
104086
104126
  }
104087
104127
  function mountCwdPanel(otui, r, sidebarTop, cwd, metadata = resolveSidebarMetadata(cwd)) {
104088
- sidebarTop.add(new otui.TextRenderable(r, { id: "sb-cwd-k", content: otui.t`${otui.dim("Directory")}`, marginTop: 1 }));
104128
+ sidebarTop.add(new otui.TextRenderable(r, { id: "sb-cwd-k", content: otui.t`${dimChunk(otui, "Directory")}`, marginTop: 1 }));
104089
104129
  sidebarTop.add(new otui.TextRenderable(r, {
104090
104130
  id: "sb-cwd-v",
104091
- content: otui.t`${otui.dim(shortenCwd(cwd, SIDEBAR_TEXT_WIDTH))}`
104131
+ content: otui.t`${dimChunk(otui, shortenCwd(cwd, SIDEBAR_TEXT_WIDTH))}`
104092
104132
  }));
104093
104133
  if (metadata.branch !== undefined) {
104094
- sidebarTop.add(new otui.TextRenderable(r, { id: "sb-branch-k", content: otui.t`${otui.dim("Branch")}`, marginTop: 1 }));
104134
+ sidebarTop.add(new otui.TextRenderable(r, { id: "sb-branch-k", content: otui.t`${dimChunk(otui, "Branch")}`, marginTop: 1 }));
104095
104135
  sidebarTop.add(new otui.TextRenderable(r, {
104096
104136
  id: "sb-branch-v",
104097
- content: otui.t`${otui.dim(shortenCwd(metadata.branch, SIDEBAR_TEXT_WIDTH))}`
104137
+ content: otui.t`${dimChunk(otui, shortenCwd(metadata.branch, SIDEBAR_TEXT_WIDTH))}`
104098
104138
  }));
104099
104139
  }
104100
104140
  if (metadata.prUrl !== undefined) {
104101
- sidebarTop.add(new otui.TextRenderable(r, { id: "sb-pr-k", content: otui.t`${otui.dim("PR")}`, marginTop: 1 }));
104141
+ sidebarTop.add(new otui.TextRenderable(r, { id: "sb-pr-k", content: otui.t`${dimChunk(otui, "PR")}`, marginTop: 1 }));
104102
104142
  sidebarTop.add(new otui.TextRenderable(r, {
104103
104143
  id: "sb-pr-v",
104104
- content: otui.t`${otui.dim(shortenCwd(metadata.prUrl, SIDEBAR_TEXT_WIDTH))}`
104144
+ content: otui.t`${dimChunk(otui, shortenCwd(metadata.prUrl, SIDEBAR_TEXT_WIDTH))}`
104105
104145
  }));
104106
104146
  }
104107
104147
  }
@@ -104296,7 +104336,7 @@ function openStepSurface(otui, target, opts) {
104296
104336
  if (!isModalChrome(target)) {
104297
104337
  const box = overlayBox(otui, r, opts.id);
104298
104338
  r.root.add(box);
104299
- box.add(new otui.TextRenderable(r, { id: `${opts.id}-title`, content: otui.t`${otui.bold(opts.title)} ${otui.dim(opts.hint)}` }));
104339
+ box.add(new otui.TextRenderable(r, { id: `${opts.id}-title`, content: otui.t`${boldChunk(otui, opts.title)} ${dimChunk(otui, opts.hint)}` }));
104300
104340
  let closed = false;
104301
104341
  const close = () => {
104302
104342
  if (closed)
@@ -104449,7 +104489,7 @@ function promptSearchCredentialStep(otui, target, opts) {
104449
104489
  });
104450
104490
  surface.body.add(new otui.TextRenderable(r, {
104451
104491
  id: "sc-note",
104452
- content: otui.t`${otui.dim("Saved to your keryx config dir (owner-only, 0600)")}`,
104492
+ content: otui.t`${dimChunk(otui, "Saved to your keryx config dir (owner-only, 0600)")}`,
104453
104493
  marginTop: 1
104454
104494
  }));
104455
104495
  const keyInput = new otui.InputRenderable(r, { id: "sc-input", placeholder: "...", marginTop: 1 });
@@ -104621,7 +104661,7 @@ function runSearchProviderTestStep(otui, target, controller, provider, fields, c
104621
104661
  const box = surface?.body ?? overlayBox(otui, r, "search-test-picker");
104622
104662
  if (surface === undefined)
104623
104663
  r.root.add(box);
104624
- const status = new otui.TextRenderable(r, { id: "st-title", content: otui.t`${otui.bold(`Testing '${provider.id}'`)} ${otui.dim("...")}` });
104664
+ const status = new otui.TextRenderable(r, { id: "st-title", content: otui.t`${boldChunk(otui, `Testing '${provider.id}'`)} ${dimChunk(otui, "...")}` });
104625
104665
  box.add(status);
104626
104666
  const cleanup = () => {
104627
104667
  left = true;
@@ -104653,19 +104693,19 @@ function runSearchProviderTestStep(otui, target, controller, provider, fields, c
104653
104693
  if (!tested.ok) {
104654
104694
  settled = "failure";
104655
104695
  const reason = describeConnectionFailure(tested.reason);
104656
- status.content = otui.t`${otui.red("\u2717")} ${otui.bold(`'${provider.id}' test failed: ${reason}`)} ${otui.dim("(Esc to go back and retry)")}`;
104696
+ status.content = otui.t`${roleChunk(otui, "error", "\u2717")} ${boldChunk(otui, `'${provider.id}' test failed: ${reason}`)} ${dimChunk(otui, "(Esc to go back and retry)")}`;
104657
104697
  return;
104658
104698
  }
104659
104699
  settled = "success";
104660
104700
  if (!setActive) {
104661
- status.content = otui.t`${otui.green("\u2713")} ${otui.bold(`'${provider.id}' configured and tested successfully`)} ${otui.dim("(Enter to close)")}`;
104701
+ status.content = otui.t`${roleChunk(otui, "ok", "\u2713")} ${boldChunk(otui, `'${provider.id}' configured and tested successfully`)} ${dimChunk(otui, "(Enter to close)")}`;
104662
104702
  return;
104663
104703
  }
104664
104704
  const selected = await controller.select(provider.id);
104665
104705
  if (left) {
104666
104706
  return;
104667
104707
  }
104668
- status.content = selected.ok ? otui.t`${otui.green("\u2713")} ${otui.bold(`'${provider.id}' configured, tested, and set as active`)} ${otui.dim("(Enter to close)")}` : otui.t`${otui.green("\u2713")} ${otui.bold(`'${provider.id}' configured and tested`)} ${otui.dim(`but could not be set active (${selected.reason ?? "unknown"})`)} ${otui.dim("(Enter to close)")}`;
104708
+ status.content = selected.ok ? otui.t`${roleChunk(otui, "ok", "\u2713")} ${boldChunk(otui, `'${provider.id}' configured, tested, and set as active`)} ${dimChunk(otui, "(Enter to close)")}` : otui.t`${roleChunk(otui, "ok", "\u2713")} ${boldChunk(otui, `'${provider.id}' configured and tested`)} ${dimChunk(otui, `but could not be set active (${selected.reason ?? "unknown"})`)} ${dimChunk(otui, "(Enter to close)")}`;
104669
104709
  })();
104670
104710
  });
104671
104711
  }
@@ -104708,9 +104748,9 @@ function promptBaseUrlStep(otui, target, label, baseUrl, notice) {
104708
104748
  });
104709
104749
  const box = surface.body;
104710
104750
  if (notice !== undefined) {
104711
- box.add(new otui.TextRenderable(r, { id: "bp-notice", content: otui.t`${otui.red("\u2717")} ${notice}`, marginTop: 1 }));
104751
+ box.add(new otui.TextRenderable(r, { id: "bp-notice", content: otui.t`${roleChunk(otui, "error", "\u2717")} ${notice}`, marginTop: 1 }));
104712
104752
  }
104713
- box.add(new otui.TextRenderable(r, { id: "bp-note", content: otui.t`${otui.dim("Edit host and port before discovering models")}`, marginTop: 1 }));
104753
+ box.add(new otui.TextRenderable(r, { id: "bp-note", content: otui.t`${dimChunk(otui, "Edit host and port before discovering models")}`, marginTop: 1 }));
104714
104754
  const input = new otui.InputRenderable(r, { id: "bp-input", value: baseUrl, marginTop: 1 });
104715
104755
  box.add(input);
104716
104756
  input.focus();
@@ -104745,11 +104785,11 @@ function promptApiKeyStep(otui, target, opts) {
104745
104785
  });
104746
104786
  const box = surface.body;
104747
104787
  if (opts.notice !== undefined) {
104748
- box.add(new otui.TextRenderable(r, { id: "kp-notice", content: otui.t`${otui.red("\u2717")} ${opts.notice}`, marginTop: 1 }));
104788
+ box.add(new otui.TextRenderable(r, { id: "kp-notice", content: otui.t`${roleChunk(otui, "error", "\u2717")} ${opts.notice}`, marginTop: 1 }));
104749
104789
  }
104750
104790
  box.add(new otui.TextRenderable(r, {
104751
104791
  id: "kp-note",
104752
- content: otui.t`${otui.dim(`Set as ${opts.envKey} \xB7 saved to your keryx config dir (owner-only, 0600)`)}`,
104792
+ content: otui.t`${dimChunk(otui, `Set as ${opts.envKey} \xB7 saved to your keryx config dir (owner-only, 0600)`)}`,
104753
104793
  marginTop: 1
104754
104794
  }));
104755
104795
  const keyInput = new otui.InputRenderable(r, { id: "kp-input", placeholder: opts.placeholder ?? "sk-...", marginTop: 1 });
@@ -104822,7 +104862,7 @@ function runDeviceLoginInTui(otui, target, provider, dir) {
104822
104862
  resolve(false);
104823
104863
  }
104824
104864
  });
104825
- const status = new otui.TextRenderable(r, { id: "dl-status", content: otui.t`${otui.dim("Requesting a device code\u2026")}`, marginTop: 1 });
104865
+ const status = new otui.TextRenderable(r, { id: "dl-status", content: otui.t`${dimChunk(otui, "Requesting a device code\u2026")}`, marginTop: 1 });
104826
104866
  surface.body.add(status);
104827
104867
  const cleanup = () => {
104828
104868
  surface.close();
@@ -104833,7 +104873,7 @@ function runDeviceLoginInTui(otui, target, provider, dir) {
104833
104873
  signal: controller.signal,
104834
104874
  ...dir !== undefined ? { dir } : {},
104835
104875
  onChallenge: (challenge) => {
104836
- status.content = otui.t`${otui.bold(challenge.userCode)}\n${otui.dim(challenge.verificationUri)}\n${otui.dim("Open that URL on any device and enter the code. Waiting for authorization\u2026")}`;
104876
+ status.content = otui.t`${boldChunk(otui, challenge.userCode)}\n${dimChunk(otui, challenge.verificationUri)}\n${dimChunk(otui, "Open that URL on any device and enter the code. Waiting for authorization\u2026")}`;
104837
104877
  openVerificationUrl(challenge.verificationUriComplete ?? challenge.verificationUri);
104838
104878
  }
104839
104879
  }).then((result) => {
@@ -104846,13 +104886,13 @@ function runDeviceLoginInTui(otui, target, provider, dir) {
104846
104886
  resolve(true);
104847
104887
  return;
104848
104888
  }
104849
- status.content = otui.t`${otui.red("\u2717")} ${otui.bold(result.error)} ${otui.dim("(Esc to go back)")}`;
104889
+ status.content = otui.t`${roleChunk(otui, "error", "\u2717")} ${boldChunk(otui, result.error)} ${dimChunk(otui, "(Esc to go back)")}`;
104850
104890
  }).catch((err) => {
104851
104891
  if (controller.signal.aborted) {
104852
104892
  return;
104853
104893
  }
104854
104894
  const message = err instanceof Error ? err.message : "device authorization failed";
104855
- status.content = otui.t`${otui.red("\u2717")} ${otui.bold(message)} ${otui.dim("(Esc to go back)")}`;
104895
+ status.content = otui.t`${roleChunk(otui, "error", "\u2717")} ${boldChunk(otui, message)} ${dimChunk(otui, "(Esc to go back)")}`;
104856
104896
  });
104857
104897
  });
104858
104898
  }
@@ -105059,7 +105099,7 @@ function pickModelInTui(otui, rOrChrome, models, notice, options = {}) {
105059
105099
  const chrome = isModalChrome(rOrChrome) ? rOrChrome : undefined;
105060
105100
  const r = chrome !== undefined ? chrome.renderer : rOrChrome;
105061
105101
  const showNotice = models.length === 0 && notice !== undefined;
105062
- const noticeText = () => new otui.TextRenderable(r, { id: "mp-notice", content: otui.t`${otui.red("\u2717")} ${notice ?? ""}` });
105102
+ const noticeText = () => new otui.TextRenderable(r, { id: "mp-notice", content: otui.t`${roleChunk(otui, "error", "\u2717")} ${notice ?? ""}` });
105063
105103
  const listSpec = {
105064
105104
  idPrefix: "mp",
105065
105105
  items: models,
@@ -105109,7 +105149,7 @@ function pickModelInTui(otui, rOrChrome, models, notice, options = {}) {
105109
105149
  return new Promise((resolve) => {
105110
105150
  const box = overlayBox(otui, r, "model-picker");
105111
105151
  r.root.add(box);
105112
- box.add(new otui.TextRenderable(r, { id: "mp-title", content: otui.t`${otui.bold("Select a model")}` }));
105152
+ box.add(new otui.TextRenderable(r, { id: "mp-title", content: otui.t`${boldChunk(otui, "Select a model")}` }));
105113
105153
  if (showNotice) {
105114
105154
  box.add(noticeText());
105115
105155
  }
@@ -105161,7 +105201,7 @@ function mountFilterList(otui, r, parent, spec) {
105161
105201
  shown = q.length > 0 ? spec.items.filter((item) => spec.matches(item, q)) : spec.items;
105162
105202
  sel.options = shown.length > 0 ? shown.map(spec.toOption) : [{ name: spec.items.length === 0 ? spec.emptyLabel : "(no match)", description: "" }];
105163
105203
  sel.selectedIndex = 0;
105164
- filterLine.content = otui.t`${otui.dim(q.length > 0 ? spec.filterHint(filter, shown.length, spec.items.length) : spec.idleHint)}`;
105204
+ filterLine.content = otui.t`${dimChunk(otui, q.length > 0 ? spec.filterHint(filter, shown.length, spec.items.length) : spec.idleHint)}`;
105165
105205
  };
105166
105206
  apply();
105167
105207
  sel.on(otui.SelectRenderableEvents.ITEM_SELECTED, () => {
@@ -105270,7 +105310,7 @@ function pickSessionInTui(otui, rOrChrome, sessions, leaseState) {
105270
105310
  return new Promise((resolve) => {
105271
105311
  const box = overlayBox(otui, r, "session-picker");
105272
105312
  r.root.add(box);
105273
- box.add(new otui.TextRenderable(r, { id: "sp-title", content: otui.t`${otui.bold("Open session")} ${otui.dim("\u2191/\u2193 Enter \xB7 Esc to cancel")}` }));
105313
+ box.add(new otui.TextRenderable(r, { id: "sp-title", content: otui.t`${boldChunk(otui, "Open session")} ${dimChunk(otui, "\u2191/\u2193 Enter \xB7 Esc to cancel")}` }));
105274
105314
  let unsub = () => {};
105275
105315
  const finish = (row) => {
105276
105316
  unsub();
@@ -105433,8 +105473,8 @@ async function launchTuiAgentShell(opts) {
105433
105473
  };
105434
105474
  const sidebar = chrome.sidebarTop;
105435
105475
  mountTitlePanel(otui, r, sidebar);
105436
- sidebar.add(new otui.TextRenderable(r, { id: "sb-model-k", content: otui.t`${otui.dim("Model")}`, marginTop: 1 }));
105437
- const sbModelV = new otui.TextRenderable(r, { id: "sb-model-v", content: otui.t`${otui.dim(`${sel.provider}/${sel.model}`)}` });
105476
+ sidebar.add(new otui.TextRenderable(r, { id: "sb-model-k", content: otui.t`${dimChunk(otui, "Model")}`, marginTop: 1 }));
105477
+ const sbModelV = new otui.TextRenderable(r, { id: "sb-model-v", content: otui.t`${dimChunk(otui, `${sel.provider}/${sel.model}`)}` });
105438
105478
  sidebar.add(sbModelV);
105439
105479
  const sbModeV = new otui.TextRenderable(r, { id: "sb-mode-v", content: "" });
105440
105480
  sidebar.add(sbModeV);
@@ -105442,10 +105482,10 @@ async function launchTuiAgentShell(opts) {
105442
105482
  sidebar.add(sbHoldV);
105443
105483
  const paintHoldBanner = () => {
105444
105484
  const banner = leaseView()?.banner();
105445
- sbHoldV.content = banner === undefined ? "" : otui.t`${otui.yellow(banner)}`;
105485
+ sbHoldV.content = banner === undefined ? "" : otui.t`${roleChunk(otui, "attention", banner)}`;
105446
105486
  };
105447
- sidebar.add(new otui.TextRenderable(r, { id: "sb-usage-k", content: otui.t`${otui.dim("Usage")}`, marginTop: 1 }));
105448
- const sbUsageV = new otui.TextRenderable(r, { id: "sb-usage-v", content: otui.t`${otui.dim("\u21910 \u21930")}` });
105487
+ sidebar.add(new otui.TextRenderable(r, { id: "sb-usage-k", content: otui.t`${dimChunk(otui, "Usage")}`, marginTop: 1 }));
105488
+ const sbUsageV = new otui.TextRenderable(r, { id: "sb-usage-v", content: otui.t`${dimChunk(otui, "\u21910 \u21930")}` });
105449
105489
  sidebar.add(sbUsageV);
105450
105490
  const balancePanel = mountBalancePanel(sidebar, otui, r, {
105451
105491
  provider: sel.provider
@@ -105463,10 +105503,10 @@ async function launchTuiAgentShell(opts) {
105463
105503
  if (workspace === undefined) {
105464
105504
  return;
105465
105505
  }
105466
- sbWorkspace.add(new otui.TextRenderable(r, { id: "sb-workspace-k", content: otui.t`${otui.dim("Workspace")}`, marginTop: 1 }));
105506
+ sbWorkspace.add(new otui.TextRenderable(r, { id: "sb-workspace-k", content: otui.t`${dimChunk(otui, "Workspace")}`, marginTop: 1 }));
105467
105507
  sbWorkspace.add(new otui.TextRenderable(r, {
105468
105508
  id: "sb-workspace-v",
105469
- content: otui.t`${otui.dim(`${shortenCwd(workspace.title, SIDEBAR_TEXT_WIDTH)} \xB7 ${workspace.status} \xB7 ${slates.length} slate${slates.length === 1 ? "" : "s"}`)}`,
105509
+ content: otui.t`${dimChunk(otui, `${shortenCwd(workspace.title, SIDEBAR_TEXT_WIDTH)} \xB7 ${workspace.status} \xB7 ${slates.length} slate${slates.length === 1 ? "" : "s"}`)}`,
105470
105510
  onMouseDown: () => {
105471
105511
  showWorkspace();
105472
105512
  }
@@ -105503,30 +105543,30 @@ async function launchTuiAgentShell(opts) {
105503
105543
  if (count === 0) {
105504
105544
  return;
105505
105545
  }
105506
- sbReview.add(new otui.TextRenderable(r, { id: "sb-review-k", content: otui.t`${otui.dim("Review")}`, marginTop: 1 }));
105546
+ sbReview.add(new otui.TextRenderable(r, { id: "sb-review-k", content: otui.t`${dimChunk(otui, "Review")}`, marginTop: 1 }));
105507
105547
  sbReview.add(new otui.TextRenderable(r, {
105508
105548
  id: "sb-review-v",
105509
- content: otui.t`${otui.yellow(`${count} item${count === 1 ? "" : "s"} need review`)}`,
105549
+ content: otui.t`${roleChunk(otui, "attention", `${count} item${count === 1 ? "" : "s"} need review`)}`,
105510
105550
  onMouseDown: () => {
105511
105551
  showReview();
105512
105552
  }
105513
105553
  }));
105514
105554
  };
105515
- sidebar.add(new otui.TextRenderable(r, { id: "sb-ctx-k", content: otui.t`${otui.dim("Context")}`, marginTop: 1 }));
105516
- const sbContext = new otui.TextRenderable(r, { id: "sb-ctx-v", content: otui.t`${otui.dim("0 tokens")}` });
105555
+ sidebar.add(new otui.TextRenderable(r, { id: "sb-ctx-k", content: otui.t`${dimChunk(otui, "Context")}`, marginTop: 1 }));
105556
+ const sbContext = new otui.TextRenderable(r, { id: "sb-ctx-v", content: otui.t`${dimChunk(otui, "0 tokens")}` });
105517
105557
  sidebar.add(sbContext);
105518
- sidebar.add(new otui.TextRenderable(r, { id: "sb-tools-k", content: otui.t`${otui.dim("Tools")}`, marginTop: 1 }));
105558
+ sidebar.add(new otui.TextRenderable(r, { id: "sb-tools-k", content: otui.t`${dimChunk(otui, "Tools")}`, marginTop: 1 }));
105519
105559
  sidebar.add(new otui.TextRenderable(r, {
105520
105560
  id: "sb-tools-v",
105521
- content: otui.t`${otui.dim(`${deps.tools.length} available`)}`,
105561
+ content: otui.t`${dimChunk(otui, `${deps.tools.length} available`)}`,
105522
105562
  onMouseDown: () => {
105523
105563
  showTools();
105524
105564
  }
105525
105565
  }));
105526
- sidebar.add(new otui.TextRenderable(r, { id: "sb-status-k", content: otui.t`${otui.dim("Status")}`, marginTop: 1 }));
105566
+ sidebar.add(new otui.TextRenderable(r, { id: "sb-status-k", content: otui.t`${dimChunk(otui, "Status")}`, marginTop: 1 }));
105527
105567
  const sbWorkers = new otui.TextRenderable(r, {
105528
105568
  id: "sb-status-v",
105529
- content: otui.t`${otui.dim("\u25CB Ready")}`
105569
+ content: otui.t`${dimChunk(otui, "\u25CB Ready")}`
105530
105570
  });
105531
105571
  sidebar.add(sbWorkers);
105532
105572
  const sbSubagents = new otui.BoxRenderable(r, {
@@ -105572,11 +105612,11 @@ async function launchTuiAgentShell(opts) {
105572
105612
  const text = formatFleetSidebarWithPeers(list, busFleetPeers, 12);
105573
105613
  const main = list.find((w) => w.id === MAIN_AGENT_ID);
105574
105614
  if (main?.status === "blocked") {
105575
- sbWorkers.content = otui.t`${otui.yellow(text)}`;
105615
+ sbWorkers.content = otui.t`${roleChunk(otui, "attention", text)}`;
105576
105616
  } else if (main?.status === "failed") {
105577
- sbWorkers.content = otui.t`${otui.red(text)}`;
105617
+ sbWorkers.content = otui.t`${roleChunk(otui, "error", text)}`;
105578
105618
  } else {
105579
- sbWorkers.content = otui.t`${otui.dim(text)}`;
105619
+ sbWorkers.content = otui.t`${dimChunk(otui, text)}`;
105580
105620
  }
105581
105621
  };
105582
105622
  const paintSubagents = (hint) => {
@@ -105711,7 +105751,7 @@ async function launchTuiAgentShell(opts) {
105711
105751
  toast: (message) => chrome.showToast(message),
105712
105752
  onChange: () => chrome.repaintStatus()
105713
105753
  });
105714
- chrome.setFooterOverride(() => nav.active() ? otui.t`${otui.yellow(FOOTER_NAV)}` : undefined);
105754
+ chrome.setFooterOverride(() => nav.active() ? otui.t`${roleChunk(otui, "attention", FOOTER_NAV)}` : undefined);
105715
105755
  const focusComposer = () => nav.restoreComposerFocus();
105716
105756
  const newestBlock = (kind) => nav.newest(kind);
105717
105757
  const toggleNewestBlock = (kind) => nav.toggleNewest(kind);
@@ -105748,13 +105788,13 @@ async function launchTuiAgentShell(opts) {
105748
105788
  const usage = attachUsageIo(io, {
105749
105789
  setHeaderMeta: (text) => chrome.setHeaderMeta(text),
105750
105790
  setContextTotal: (total) => {
105751
- sbContext.content = otui.t`${otui.dim(`${total.toLocaleString()} tokens`)}`;
105791
+ sbContext.content = otui.t`${dimChunk(otui, `${total.toLocaleString()} tokens`)}`;
105752
105792
  },
105753
105793
  onExactUsage: () => {
105754
105794
  hasExactUsage = true;
105755
105795
  },
105756
105796
  setUsage: (input, output) => {
105757
- sbUsageV.content = otui.t`${otui.dim(`\u2191${fmtTokens(input)} \u2193${fmtTokens(output)}`)}`;
105797
+ sbUsageV.content = otui.t`${dimChunk(otui, `\u2191${fmtTokens(input)} \u2193${fmtTokens(output)}`)}`;
105758
105798
  }
105759
105799
  });
105760
105800
  let lastUsage;
@@ -105799,7 +105839,7 @@ async function launchTuiAgentShell(opts) {
105799
105839
  if (meta?.untrustedOrigin === true) {
105800
105840
  transcript.add(new otui.TextRenderable(r, {
105801
105841
  id: `ap${uid++}`,
105802
- content: otui.t`${otui.yellow("\u26A0 follows untrusted external content \u2014 it cannot authorize this call; your answer does")}`
105842
+ content: otui.t`${roleChunk(otui, "attention", "\u26A0 follows untrusted external content \u2014 it cannot authorize this call; your answer does")}`
105803
105843
  }));
105804
105844
  }
105805
105845
  if (tool === "spawn_subagent") {
@@ -105820,7 +105860,7 @@ async function launchTuiAgentShell(opts) {
105820
105860
  if (mode === "read_only") {
105821
105861
  transcript.add(new otui.TextRenderable(r, {
105822
105862
  id: `ap${uid++}`,
105823
- content: otui.t`${otui.cyan("\u25C7 subagent auto-approved")} ${otui.dim(`mode=read_only (no shell) \xB7 ${taskPreview}`)}`
105863
+ content: otui.t`${roleChunk(otui, "accent", "\u25C7 subagent auto-approved")} ${dimChunk(otui, `mode=read_only (no shell) \xB7 ${taskPreview}`)}`
105824
105864
  }));
105825
105865
  return true;
105826
105866
  }
@@ -105846,26 +105886,26 @@ async function launchTuiAgentShell(opts) {
105846
105886
  setMainAgent("running", id === "allow" ? "subagent" : "denied");
105847
105887
  transcript.add(new otui.TextRenderable(r, {
105848
105888
  id: `ap${uid++}`,
105849
- content: id === "allow" ? otui.t`${otui.green("\u25C7 subagent approved")}` : otui.t`${otui.red("\u25C7 subagent denied")}`
105889
+ content: id === "allow" ? otui.t`${roleChunk(otui, "ok", "\u25C7 subagent approved")}` : otui.t`${roleChunk(otui, "error", "\u25C7 subagent denied")}`
105850
105890
  }));
105851
105891
  return id === "allow";
105852
105892
  }
105853
105893
  if (tool === "apply_patch") {
105854
105894
  for (const line of extractPatchText(inputJson).split(/\r?\n/)) {
105855
105895
  const kind = classifyDiffLine(line);
105856
- const rendered = kind === "add" ? otui.green(line) : kind === "del" ? otui.red(line) : kind === "hunk" ? otui.cyan(line) : kind === "meta" ? otui.dim(line) : line;
105896
+ const rendered = kind === "add" ? roleChunk(otui, "ok", line) : kind === "del" ? roleChunk(otui, "error", line) : kind === "hunk" ? roleChunk(otui, "accent", line) : kind === "meta" ? dimChunk(otui, line) : line;
105857
105897
  transcript.add(new otui.TextRenderable(r, { id: `ap${uid++}`, content: otui.t`${rendered}` }));
105858
105898
  }
105859
105899
  if (meta?.destructive === true) {
105860
105900
  transcript.add(new otui.TextRenderable(r, {
105861
105901
  id: `ap${uid++}`,
105862
- content: otui.t`${otui.yellow("deletes a file, touches .git/, or touches many files in one call")}`
105902
+ content: otui.t`${roleChunk(otui, "attention", "deletes a file, touches .git/, or touches many files in one call")}`
105863
105903
  }));
105864
105904
  }
105865
105905
  if (meta?.credentials === true) {
105866
105906
  transcript.add(new otui.TextRenderable(r, {
105867
105907
  id: `ap${uid++}`,
105868
- content: otui.t`${otui.yellow("touches the agent's own permission/credential files")}`
105908
+ content: otui.t`${roleChunk(otui, "attention", "touches the agent's own permission/credential files")}`
105869
105909
  }));
105870
105910
  }
105871
105911
  chrome.hideMenu();
@@ -105885,7 +105925,7 @@ async function launchTuiAgentShell(opts) {
105885
105925
  setMainAgent("running", id === "allow" ? "write" : "denied");
105886
105926
  transcript.add(new otui.TextRenderable(r, {
105887
105927
  id: `ap${uid++}`,
105888
- content: id === "allow" ? otui.t`${otui.green("\u25C7 apply_patch approved")}` : otui.t`${otui.red("\u25C7 apply_patch denied")}`
105928
+ content: id === "allow" ? otui.t`${roleChunk(otui, "ok", "\u25C7 apply_patch approved")}` : otui.t`${roleChunk(otui, "error", "\u25C7 apply_patch denied")}`
105889
105929
  }));
105890
105930
  return id === "allow";
105891
105931
  }
@@ -105893,15 +105933,15 @@ async function launchTuiAgentShell(opts) {
105893
105933
  const described = describeUseToolApproval(inputJson, catalogResolver(deps.mcpRuntime?.()?.catalog()));
105894
105934
  transcript.add(new otui.TextRenderable(r, {
105895
105935
  id: `ap${uid++}`,
105896
- content: otui.t`${otui.yellow(`\u2699 ${described.server} wants to run ${described.tool}`)}`
105936
+ content: otui.t`${roleChunk(otui, "attention", `\u2699 ${described.server} wants to run ${described.tool}`)}`
105897
105937
  }));
105898
105938
  for (const line of described.argumentLines) {
105899
- transcript.add(new otui.TextRenderable(r, { id: `ap${uid++}`, content: otui.t`${otui.dim(` ${line}`)}` }));
105939
+ transcript.add(new otui.TextRenderable(r, { id: `ap${uid++}`, content: otui.t`${dimChunk(otui, ` ${line}`)}` }));
105900
105940
  }
105901
105941
  if (described.argumentsTruncated) {
105902
105942
  transcript.add(new otui.TextRenderable(r, {
105903
105943
  id: `ap${uid++}`,
105904
- content: otui.t`${otui.dim(` \u2026 arguments truncated at ${MAX_ARGUMENT_CHARS} characters`)}`
105944
+ content: otui.t`${dimChunk(otui, ` \u2026 arguments truncated at ${MAX_ARGUMENT_CHARS} characters`)}`
105905
105945
  }));
105906
105946
  }
105907
105947
  chrome.hideMenu();
@@ -105922,7 +105962,7 @@ async function launchTuiAgentShell(opts) {
105922
105962
  setMainAgent("running", allowed ? "write" : "denied");
105923
105963
  transcript.add(new otui.TextRenderable(r, {
105924
105964
  id: `ap${uid++}`,
105925
- content: allowed ? otui.t`${otui.green(`\u25C7 ${described.fqn} approved`)}` : otui.t`${otui.red(`\u25C7 ${described.fqn} denied`)}`
105965
+ content: allowed ? otui.t`${roleChunk(otui, "ok", `\u25C7 ${described.fqn} approved`)}` : otui.t`${roleChunk(otui, "error", `\u25C7 ${described.fqn} denied`)}`
105926
105966
  }));
105927
105967
  return allowed;
105928
105968
  }
@@ -105930,25 +105970,25 @@ async function launchTuiAgentShell(opts) {
105930
105970
  const described = describeElicitationPrompt(tool, inputJson) ?? { message: inputJson, command: undefined };
105931
105971
  transcript.add(new otui.TextRenderable(r, {
105932
105972
  id: `ap${uid++}`,
105933
- content: otui.t`${otui.yellow("\u2699 codex is requesting approval")}`
105973
+ content: otui.t`${roleChunk(otui, "attention", "\u2699 codex is requesting approval")}`
105934
105974
  }));
105935
- transcript.add(new otui.TextRenderable(r, { id: `ap${uid++}`, content: otui.t`${otui.dim(described.message)}` }));
105975
+ transcript.add(new otui.TextRenderable(r, { id: `ap${uid++}`, content: otui.t`${dimChunk(otui, described.message)}` }));
105936
105976
  if (described.command !== undefined) {
105937
105977
  transcript.add(new otui.TextRenderable(r, {
105938
105978
  id: `ap${uid++}`,
105939
- content: otui.t`${otui.dim(`command: ${described.command}`)}`
105979
+ content: otui.t`${dimChunk(otui, `command: ${described.command}`)}`
105940
105980
  }));
105941
105981
  }
105942
105982
  if (meta?.destructive === true) {
105943
105983
  transcript.add(new otui.TextRenderable(r, {
105944
105984
  id: `ap${uid++}`,
105945
- content: otui.t`${otui.yellow("deletes a file, touches .git/, or touches many files in one call")}`
105985
+ content: otui.t`${roleChunk(otui, "attention", "deletes a file, touches .git/, or touches many files in one call")}`
105946
105986
  }));
105947
105987
  }
105948
105988
  if (meta?.credentials === true) {
105949
105989
  transcript.add(new otui.TextRenderable(r, {
105950
105990
  id: `ap${uid++}`,
105951
- content: otui.t`${otui.yellow("touches the agent's own permission/credential files")}`
105991
+ content: otui.t`${roleChunk(otui, "attention", "touches the agent's own permission/credential files")}`
105952
105992
  }));
105953
105993
  }
105954
105994
  chrome.hideMenu();
@@ -105969,7 +106009,7 @@ async function launchTuiAgentShell(opts) {
105969
106009
  setMainAgent("running", id === "allow" ? "write" : "denied");
105970
106010
  transcript.add(new otui.TextRenderable(r, {
105971
106011
  id: `ap${uid++}`,
105972
- content: id === "allow" ? otui.t`${otui.green("\u25C7 codex elicitation approved")}` : otui.t`${otui.red("\u25C7 codex elicitation denied")}`
106012
+ content: id === "allow" ? otui.t`${roleChunk(otui, "ok", "\u25C7 codex elicitation approved")}` : otui.t`${roleChunk(otui, "error", "\u25C7 codex elicitation denied")}`
105973
106013
  }));
105974
106014
  return id === "allow";
105975
106015
  }
@@ -105985,36 +106025,36 @@ async function launchTuiAgentShell(opts) {
105985
106025
  permissionMigrationShown = true;
105986
106026
  transcript.add(new otui.TextRenderable(r, {
105987
106027
  id: `ap${uid++}`,
105988
- content: otui.t`${otui.yellow(`\u26A0 ${ev.rejected.length} saved shell permission(s) are no longer honoured \u2014 they granted arbitrary execution:`)}`
106028
+ content: otui.t`${roleChunk(otui, "attention", `\u26A0 ${ev.rejected.length} saved shell permission(s) are no longer honoured \u2014 they granted arbitrary execution:`)}`
105989
106029
  }));
105990
106030
  for (const rej of ev.rejected) {
105991
106031
  transcript.add(new otui.TextRenderable(r, {
105992
106032
  id: `ap${uid++}`,
105993
- content: otui.t`${otui.dim(` \u201C${rej.pattern}\u201D \u2014 ${rej.reason}`)}`
106033
+ content: otui.t`${dimChunk(otui, ` \u201C${rej.pattern}\u201D \u2014 ${rej.reason}`)}`
105994
106034
  }));
105995
106035
  }
105996
106036
  transcript.add(new otui.TextRenderable(r, {
105997
106037
  id: `ap${uid++}`,
105998
- content: otui.t`${otui.dim(` They are still in ${shellPermissionsPath()} \u2014 edit or remove them there.`)}`
106038
+ content: otui.t`${dimChunk(otui, ` They are still in ${shellPermissionsPath()} \u2014 edit or remove them there.`)}`
105999
106039
  }));
106000
106040
  }
106001
106041
  if (!permissionTamperShown && ev.tampered) {
106002
106042
  permissionTamperShown = true;
106003
106043
  transcript.add(new otui.TextRenderable(r, {
106004
106044
  id: `ap${uid++}`,
106005
- content: otui.t`${otui.red("\u26A0 the saved shell permissions changed outside this approval UI \u2014 review them before trusting an auto-approve")}`
106045
+ content: otui.t`${roleChunk(otui, "error", "\u26A0 the saved shell permissions changed outside this approval UI \u2014 review them before trusting an auto-approve")}`
106006
106046
  }));
106007
106047
  }
106008
106048
  if (ev.autoApprove) {
106009
106049
  transcript.add(new otui.TextRenderable(r, {
106010
106050
  id: `ap${uid++}`,
106011
- content: otui.t`${otui.dim(`\u2713 auto-approved shell: ${cmd}`)}`
106051
+ content: otui.t`${dimChunk(otui, `\u2713 auto-approved shell: ${cmd}`)}`
106012
106052
  }));
106013
106053
  return true;
106014
106054
  }
106015
106055
  transcript.add(new otui.TextRenderable(r, {
106016
106056
  id: `ap${uid++}`,
106017
- content: otui.t`${otui.yellow(`\u2699 shell_exec needs approval`)} ${otui.dim("(menu above input)")}`
106057
+ content: otui.t`${roleChunk(otui, "attention", `\u2699 shell_exec needs approval`)} ${dimChunk(otui, "(menu above input)")}`
106018
106058
  }));
106019
106059
  setMainAgent("blocked", "approval");
106020
106060
  setBusyPhase("waiting for your approval (menu above input)");
@@ -106027,7 +106067,7 @@ async function launchTuiAgentShell(opts) {
106027
106067
  if (choice === "deny") {
106028
106068
  transcript.add(new otui.TextRenderable(r, {
106029
106069
  id: `av${uid++}`,
106030
- content: otui.t`${otui.red("denied")}`
106070
+ content: otui.t`${roleChunk(otui, "error", "denied")}`
106031
106071
  }));
106032
106072
  setMainAgent("running", "denied");
106033
106073
  setBusyPhase("shell denied \xB7 continuing");
@@ -106043,7 +106083,7 @@ async function launchTuiAgentShell(opts) {
106043
106083
  }
106044
106084
  transcript.add(new otui.TextRenderable(r, {
106045
106085
  id: `av${uid++}`,
106046
- content: stored.length > 0 ? otui.t`${otui.green(`approved \xB7 remembered \u201C${stored}\u201D`)}` : otui.t`${otui.yellow(`approved once \xB7 \u201C${pattern}\u201D cannot be remembered`)}`
106086
+ content: stored.length > 0 ? otui.t`${roleChunk(otui, "ok", `approved \xB7 remembered \u201C${stored}\u201D`)}` : otui.t`${roleChunk(otui, "attention", `approved once \xB7 \u201C${pattern}\u201D cannot be remembered`)}`
106047
106087
  }));
106048
106088
  setMainAgent("running", "shell");
106049
106089
  setBusyPhase("running approved shell");
@@ -106051,7 +106091,7 @@ async function launchTuiAgentShell(opts) {
106051
106091
  }
106052
106092
  transcript.add(new otui.TextRenderable(r, {
106053
106093
  id: `av${uid++}`,
106054
- content: otui.t`${otui.green("approved (once)")}`
106094
+ content: otui.t`${roleChunk(otui, "ok", "approved (once)")}`
106055
106095
  }));
106056
106096
  setMainAgent("running", "shell");
106057
106097
  setBusyPhase("running approved shell");
@@ -106064,7 +106104,7 @@ async function launchTuiAgentShell(opts) {
106064
106104
  const qShort = req.question.length > 100 ? `${req.question.slice(0, 97)}\u2026` : req.question;
106065
106105
  transcript.add(new otui.TextRenderable(r, {
106066
106106
  id: `ask${uid++}`,
106067
- content: otui.t`${otui.yellow("? ")} ${otui.dim(qShort)}`
106107
+ content: otui.t`${roleChunk(otui, "attention", "? ")} ${dimChunk(otui, qShort)}`
106068
106108
  }));
106069
106109
  const chosen = await chrome.withOverlay(() => showComposerChoice(otui, r, chrome.dock, {
106070
106110
  title: req.question.length > 72 ? `${req.question.slice(0, 69)}\u2026` : req.question,
@@ -106084,12 +106124,12 @@ async function launchTuiAgentShell(opts) {
106084
106124
  const picked = req.options.find((o) => o.id === chosen);
106085
106125
  transcript.add(new otui.TextRenderable(r, {
106086
106126
  id: `aska${uid++}`,
106087
- content: otui.t`${otui.green("\u2192")} ${otui.dim(picked?.label ?? chosen)}`
106127
+ content: otui.t`${roleChunk(otui, "ok", "\u2192")} ${dimChunk(otui, picked?.label ?? chosen)}`
106088
106128
  }));
106089
106129
  } else {
106090
106130
  transcript.add(new otui.TextRenderable(r, {
106091
106131
  id: `askc${uid++}`,
106092
- content: otui.t`${otui.dim("\u2192 cancelled")}`
106132
+ content: otui.t`${dimChunk(otui, "\u2192 cancelled")}`
106093
106133
  }));
106094
106134
  }
106095
106135
  setMainAgent("running", "waiting");
@@ -106129,7 +106169,7 @@ async function launchTuiAgentShell(opts) {
106129
106169
  io.readOnly = () => readOnly;
106130
106170
  const paintModeRow = () => {
106131
106171
  const row = describeModeRow(permissionMode, readOnly);
106132
- sbModeV.content = row.readOnly === undefined ? otui.t`${otui.dim(`mode ${row.mode}`)}` : otui.t`${otui.dim(`mode ${row.mode}`)} ${otui.yellow(row.readOnly)}`;
106172
+ sbModeV.content = row.readOnly === undefined ? otui.t`${dimChunk(otui, `mode ${row.mode}`)}` : otui.t`${dimChunk(otui, `mode ${row.mode}`)} ${roleChunk(otui, "attention", row.readOnly)}`;
106133
106173
  };
106134
106174
  paintModeRow();
106135
106175
  io.onAutoApproved = (tool, input, meta) => {
@@ -106137,7 +106177,7 @@ async function launchTuiAgentShell(opts) {
106137
106177
  const label = meta.destructive ? `\u25C7 auto-approved (${permissionMode}) [destructive]` : `\u25C7 auto-approved (${permissionMode})`;
106138
106178
  transcript.add(new otui.TextRenderable(r, {
106139
106179
  id: `ap${uid++}`,
106140
- content: otui.t`${otui.yellow(label)} ${otui.dim(preview)}`
106180
+ content: otui.t`${roleChunk(otui, "attention", label)} ${dimChunk(otui, preview)}`
106141
106181
  }));
106142
106182
  };
106143
106183
  let liveSession;
@@ -106208,28 +106248,28 @@ async function launchTuiAgentShell(opts) {
106208
106248
  if (opened.skipped !== undefined) {
106209
106249
  transcript.add(new otui.TextRenderable(r, {
106210
106250
  id: `sessskip${uid++}`,
106211
- content: otui.t`${otui.yellow(describeSkippedSession(opened.skipped).replace(/\n+$/, ""))}`,
106251
+ content: otui.t`${roleChunk(otui, "attention", describeSkippedSession(opened.skipped).replace(/\n+$/, ""))}`,
106212
106252
  marginTop: 1
106213
106253
  }));
106214
106254
  }
106215
106255
  if (opened.archiveDegraded !== undefined) {
106216
106256
  transcript.add(new otui.TextRenderable(r, {
106217
106257
  id: `sessdeg${uid++}`,
106218
- content: otui.t`${otui.yellow(`archive unavailable \u2014 resumed from the active context (${opened.archiveDegraded})`)}`,
106258
+ content: otui.t`${roleChunk(otui, "attention", `archive unavailable \u2014 resumed from the active context (${opened.archiveDegraded})`)}`,
106219
106259
  marginTop: 1
106220
106260
  }));
106221
106261
  }
106222
106262
  if (opened.resumed) {
106223
106263
  transcript.add(new otui.TextRenderable(r, {
106224
106264
  id: `sess${uid++}`,
106225
- content: otui.t`${otui.dim(`session ${shortSessionId(liveSession.summary.id)} \xB7 ${liveSession.summary.title} \xB7 ctx ${history.length} \xB7 archive ${archive.length}`)}`,
106265
+ content: otui.t`${dimChunk(otui, `session ${shortSessionId(liveSession.summary.id)} \xB7 ${liveSession.summary.title} \xB7 ctx ${history.length} \xB7 archive ${archive.length}`)}`,
106226
106266
  marginTop: 1
106227
106267
  }));
106228
106268
  for (const m of history.filter((x) => x.role === "user").slice(-5)) {
106229
106269
  const t = m.content.length > 100 ? `${m.content.slice(0, 97)}\u2026` : m.content;
106230
106270
  transcript.add(new otui.TextRenderable(r, {
106231
106271
  id: `sessu${uid++}`,
106232
- content: otui.t`${otui.dim(` \u276F ${t}`)}`
106272
+ content: otui.t`${dimChunk(otui, ` \u276F ${t}`)}`
106233
106273
  }));
106234
106274
  }
106235
106275
  }
@@ -106285,7 +106325,7 @@ async function launchTuiAgentShell(opts) {
106285
106325
  viewedReadOnly = true;
106286
106326
  transcript.add(new otui.TextRenderable(r, {
106287
106327
  id: `sessview${uid++}`,
106288
- content: otui.t`${otui.dim(`${markdown.replace(/\n+$/, "")}
106328
+ content: otui.t`${dimChunk(otui, `${markdown.replace(/\n+$/, "")}
106289
106329
 
106290
106330
  \u2014 read-only view; a new session starts below \u2014`)}`,
106291
106331
  marginTop: 1
@@ -106294,7 +106334,7 @@ async function launchTuiAgentShell(opts) {
106294
106334
  notice: (text) => {
106295
106335
  transcript.add(new otui.TextRenderable(r, {
106296
106336
  id: `sesslease${uid++}`,
106297
- content: otui.t`${otui.yellow(text)}`,
106337
+ content: otui.t`${roleChunk(otui, "attention", text)}`,
106298
106338
  marginTop: 1
106299
106339
  }));
106300
106340
  }
@@ -106313,7 +106353,7 @@ async function launchTuiAgentShell(opts) {
106313
106353
  if (failure !== undefined) {
106314
106354
  transcript.add(new otui.TextRenderable(r, {
106315
106355
  id: `sesserr${uid++}`,
106316
- content: otui.t`${otui.red(failure instanceof Error ? failure.message : String(failure))}`,
106356
+ content: otui.t`${roleChunk(otui, "error", failure instanceof Error ? failure.message : String(failure))}`,
106317
106357
  marginTop: 1
106318
106358
  }));
106319
106359
  applyOpened(leasedOpen());
@@ -106900,7 +106940,7 @@ Staying in the current session.
106900
106940
  const updateModelLabels = () => {
106901
106941
  paintSessionHeader();
106902
106942
  const label = `${currentSel.provider}/${currentSel.model}`;
106903
- sbModelV.content = otui.t`${otui.dim(label)}`;
106943
+ sbModelV.content = otui.t`${dimChunk(otui, label)}`;
106904
106944
  chrome.setStatus(label);
106905
106945
  };
106906
106946
  const switchTo = async (ns) => {
@@ -106965,7 +107005,7 @@ Staying in the current session.
106965
107005
  box.add(text);
106966
107006
  const setActive = (active) => {
106967
107007
  box.backgroundColor = active ? getTheme().highlight : undefined;
106968
- text.content = active ? otui.t`${otui.bold(`[${label}]`)}` : `[${label}]`;
107008
+ text.content = active ? otui.t`${boldChunk(otui, `[${label}]`)}` : `[${label}]`;
106969
107009
  text.fg = color;
106970
107010
  };
106971
107011
  return { box, setActive };
@@ -107026,7 +107066,7 @@ Staying in the current session.
107026
107066
  id: `mq-${item.id}-t`,
107027
107067
  flexGrow: 1,
107028
107068
  minWidth: 0,
107029
- content: otui.t`${otui.dim(`${formatMainQueueMarker(index)} ${item.displayQuestion}`)}`
107069
+ content: otui.t`${dimChunk(otui, `${formatMainQueueMarker(index)} ${item.displayQuestion}`)}`
107030
107070
  });
107031
107071
  row.add(label);
107032
107072
  const force = mainQueueButton("Force", `mq-force-${item.id}`, theme.focus, () => forceMainQueue(index));
@@ -107161,7 +107201,7 @@ Staying in the current session.
107161
107201
  if (sideQueue.length > 1 || sideWorkerRunning) {
107162
107202
  transcript.add(new otui.TextRenderable(r, {
107163
107203
  id: `side-max${uid++}`,
107164
- content: otui.t`${otui.yellow(`\u25E6 side-1 queued (${sideQueue.length - 1} pending)`)} ${otui.dim(`\xB7 while main: ${busyPhase}`)}`,
107204
+ content: otui.t`${roleChunk(otui, "attention", `\u25E6 side-1 queued (${sideQueue.length - 1} pending)`)} ${dimChunk(otui, `\xB7 while main: ${busyPhase}`)}`,
107165
107205
  marginTop: 1
107166
107206
  }));
107167
107207
  showSideQueueStatus();
@@ -107190,7 +107230,7 @@ Staying in the current session.
107190
107230
  });
107191
107231
  transcript.add(new otui.TextRenderable(r, {
107192
107232
  id: `side-h${uid++}`,
107193
- content: otui.t`${otui.magenta("\u2500\u2500")} ${otui.bold(sideWorkerLabelText)} ${otui.magenta("\u2500\u2500")} ${otui.dim(`while main: ${busyPhase}`)}`,
107233
+ content: otui.t`${roleChunk(otui, "side", "\u2500\u2500")} ${boldChunk(otui, sideWorkerLabelText)} ${roleChunk(otui, "side", "\u2500\u2500")} ${dimChunk(otui, `while main: ${busyPhase}`)}`,
107194
107234
  marginTop: 1
107195
107235
  }));
107196
107236
  const prompt = buildSideWorkerPrompt({
@@ -107235,7 +107275,7 @@ Staying in the current session.
107235
107275
  onSystem: (text) => {
107236
107276
  transcript.add(new otui.TextRenderable(r, {
107237
107277
  id: `side-sys${uid++}`,
107238
- content: otui.t`${otui.dim(text.trimEnd())}`
107278
+ content: otui.t`${dimChunk(otui, text.trimEnd())}`
107239
107279
  }));
107240
107280
  },
107241
107281
  requestApproval: async () => false
@@ -107259,7 +107299,7 @@ Staying in the current session.
107259
107299
  const msg = cause instanceof Error ? cause.message : String(cause);
107260
107300
  transcript.add(new otui.TextRenderable(r, {
107261
107301
  id: `side-err${uid++}`,
107262
- content: otui.t`${otui.red(`\u25C7 ${sideWorkerLabelText} failed: ${msg}`)}`
107302
+ content: otui.t`${roleChunk(otui, "error", `\u25C7 ${sideWorkerLabelText} failed: ${msg}`)}`
107263
107303
  }));
107264
107304
  fleet.upsert({ id: SIDE_WORKER_ID, label: sideWorkerLabelText, status: "failed", detail: "error" });
107265
107305
  } finally {
@@ -107334,7 +107374,7 @@ Staying in the current session.
107334
107374
  case "help": {
107335
107375
  transcript.add(new otui.TextRenderable(r, {
107336
107376
  id: `c${uid++}`,
107337
- content: otui.t`${otui.cyan(`\u276F ${line}`)}`,
107377
+ content: otui.t`${roleChunk(otui, "accent", `\u276F ${line}`)}`,
107338
107378
  marginTop: 1
107339
107379
  }));
107340
107380
  io.onSystem?.("Main agent is busy. Type a normal question to spawn a side worker " + `(sees main status + recent context; read-only). /status \u0438 /flows still open info panels. /exit still works.
@@ -107448,7 +107488,7 @@ Staying in the current session.
107448
107488
  case "deferred": {
107449
107489
  transcript.add(new otui.TextRenderable(r, {
107450
107490
  id: `c${uid++}`,
107451
- content: otui.t`${otui.yellow(`\u25C7 main is busy \u2014 command deferred. Ask a normal question for a side worker, or wait.`)}`,
107491
+ content: otui.t`${roleChunk(otui, "attention", `\u25C7 main is busy \u2014 command deferred. Ask a normal question for a side worker, or wait.`)}`,
107452
107492
  marginTop: 1
107453
107493
  }));
107454
107494
  return;
@@ -107515,7 +107555,7 @@ Staying in the current session.
107515
107555
  if (line.startsWith("/")) {
107516
107556
  transcript.add(new otui.TextRenderable(r, {
107517
107557
  id: `c${uid++}`,
107518
- content: otui.t`${otui.cyan(`\u276F ${line}`)}`,
107558
+ content: otui.t`${roleChunk(otui, "accent", `\u276F ${line}`)}`,
107519
107559
  marginTop: 1
107520
107560
  }));
107521
107561
  }
@@ -107882,7 +107922,7 @@ Usage: /reasoning <${REASONING_EFFORT_LEVELS.join("|")}>
107882
107922
  chrome.registerUserPrompt(userEcho, displayLine);
107883
107923
  transcript.add(new otui.TextRenderable(r, {
107884
107924
  id: `h${uid++}`,
107885
- content: otui.t`${otui.cyan("\u25CF")} ${otui.bold("keryx")} ${otui.dim(hhmm())}`,
107925
+ content: otui.t`${roleChunk(otui, "accent", "\u25CF")} ${boldChunk(otui, "keryx")} ${dimChunk(otui, hhmm())}`,
107886
107926
  marginTop: 1
107887
107927
  }));
107888
107928
  if (isWikiEnrichIntent(line)) {
@@ -107900,7 +107940,7 @@ Usage: /reasoning <${REASONING_EFFORT_LEVELS.join("|")}>
107900
107940
  const moreDrafts = plan.drafts.length > maxList ? ` \xB7 \u2026 +${plan.drafts.length - maxList} more drafts` : "";
107901
107941
  transcript.add(new otui.TextRenderable(r, {
107902
107942
  id: `we-list${uid++}`,
107903
- content: otui.t`${otui.dim([
107943
+ content: otui.t`${dimChunk(otui, [
107904
107944
  `Wiki enrich plan: ${plan.drafts.length} draft \xB7 ${plan.accepted.length} accepted \xB7 ${plan.forceTargets.length} total`,
107905
107945
  ...plan.drafts.length > 0 ? ["Drafts:", ...draftLines, ...moreDrafts ? [moreDrafts] : []] : ["Drafts: (none)"],
107906
107946
  plan.accepted.length > 0 ? `Accepted (need --force): ${plan.accepted.length} page(s)` : "Accepted: (none)"
@@ -107911,7 +107951,7 @@ Usage: /reasoning <${REASONING_EFFORT_LEVELS.join("|")}>
107911
107951
  if (plan.forceTargets.length === 0) {
107912
107952
  transcript.add(new otui.TextRenderable(r, {
107913
107953
  id: `we-empty${uid++}`,
107914
- content: otui.t`${otui.yellow("No wiki pages found. Run `keryx wiki collect` first.")}`
107954
+ content: otui.t`${roleChunk(otui, "attention", "No wiki pages found. Run `keryx wiki collect` first.")}`
107915
107955
  }));
107916
107956
  return;
107917
107957
  }
@@ -107926,14 +107966,14 @@ Usage: /reasoning <${REASONING_EFFORT_LEVELS.join("|")}>
107926
107966
  if (choice === "cancel") {
107927
107967
  transcript.add(new otui.TextRenderable(r, {
107928
107968
  id: `we-cancel${uid++}`,
107929
- content: otui.t`${otui.dim("Wiki enrich cancelled.")}`
107969
+ content: otui.t`${dimChunk(otui, "Wiki enrich cancelled.")}`
107930
107970
  }));
107931
107971
  return;
107932
107972
  }
107933
107973
  if (choice === "drafts" && plan.drafts.length === 0) {
107934
107974
  transcript.add(new otui.TextRenderable(r, {
107935
107975
  id: `we-nodraft${uid++}`,
107936
- content: otui.t`${otui.yellow("No draft pages. Choose force enrich all, or collect new drafts.")}`
107976
+ content: otui.t`${roleChunk(otui, "attention", "No draft pages. Choose force enrich all, or collect new drafts.")}`
107937
107977
  }));
107938
107978
  return;
107939
107979
  }
@@ -107993,7 +108033,7 @@ Usage: /reasoning <${REASONING_EFFORT_LEVELS.join("|")}>
107993
108033
  }
107994
108034
  transcript.add(new otui.TextRenderable(r, {
107995
108035
  id: `we-res${uid++}`,
107996
- content: otui.t`${otui.dim(lines.join(`
108036
+ content: otui.t`${dimChunk(otui, lines.join(`
107997
108037
  `))}`,
107998
108038
  marginTop: 1
107999
108039
  }));
@@ -108013,7 +108053,7 @@ Usage: /reasoning <${REASONING_EFFORT_LEVELS.join("|")}>
108013
108053
  stopBusy();
108014
108054
  transcript.add(new otui.TextRenderable(r, {
108015
108055
  id: `we-err${uid++}`,
108016
- content: otui.t`${otui.red(`wiki enrich failed: ${cause instanceof Error ? cause.message : String(cause)}`)}`
108056
+ content: otui.t`${roleChunk(otui, "error", `wiki enrich failed: ${cause instanceof Error ? cause.message : String(cause)}`)}`
108017
108057
  }));
108018
108058
  } finally {
108019
108059
  const operationAborted = foregroundOperation.signal.aborted;
@@ -108024,7 +108064,7 @@ Usage: /reasoning <${REASONING_EFFORT_LEVELS.join("|")}>
108024
108064
  const secs = ((Date.now() - startedAt) / 1000).toFixed(1);
108025
108065
  transcript.add(new otui.TextRenderable(r, {
108026
108066
  id: `w${uid++}`,
108027
- content: otui.t`${otui.dim(`worked for ${secs}s`)}`,
108067
+ content: otui.t`${dimChunk(otui, `worked for ${secs}s`)}`,
108028
108068
  marginTop: 1
108029
108069
  }));
108030
108070
  focusComposer();
@@ -108095,11 +108135,11 @@ Usage: /reasoning <${REASONING_EFFORT_LEVELS.join("|")}>
108095
108135
  try {
108096
108136
  flushSessionCheckpoint();
108097
108137
  } catch {}
108098
- transcript.add(new otui.TextRenderable(r, { id: `w${uid++}`, content: otui.t`${otui.dim(`worked for ${secs}s`)}`, marginTop: 1 }));
108138
+ transcript.add(new otui.TextRenderable(r, { id: `w${uid++}`, content: otui.t`${dimChunk(otui, `worked for ${secs}s`)}`, marginTop: 1 }));
108099
108139
  if (!hasExactUsage) {
108100
108140
  const est = estimateContextTokens(history);
108101
108141
  chrome.setHeaderMeta(`~${fmtTokens(est)}`);
108102
- sbContext.content = otui.t`${otui.dim(`~${est.toLocaleString()} tokens (est)`)}`;
108142
+ sbContext.content = otui.t`${dimChunk(otui, `~${est.toLocaleString()} tokens (est)`)}`;
108103
108143
  }
108104
108144
  focusComposer();
108105
108145
  if (!forceHandoff.hasPending && mainQueue.length === 0 && !turnFailed) {
@@ -108329,16 +108369,16 @@ async function mountChatShell(otui, renderer, opts) {
108329
108369
  transcript.add(new otui.TextRenderable(r, { id: `c${uid++}`, content }));
108330
108370
  };
108331
108371
  const sidebar = chrome.sidebarTop;
108332
- sidebar.add(new otui.TextRenderable(r, { id: "sb-title", content: otui.t`${otui.bold("keryx")}` }));
108333
- sidebar.add(new otui.TextRenderable(r, { id: "sb-mode", content: otui.t`${otui.dim("chat \xB7 no tools")}` }));
108334
- sidebar.add(new otui.TextRenderable(r, { id: "sb-model-k", content: otui.t`${otui.dim("Model")}`, marginTop: 1 }));
108335
- const sbModel = new otui.TextRenderable(r, { id: "sb-model-v", content: otui.t`${otui.dim(label())}` });
108372
+ sidebar.add(new otui.TextRenderable(r, { id: "sb-title", content: otui.t`${boldChunk(otui, "keryx")}` }));
108373
+ sidebar.add(new otui.TextRenderable(r, { id: "sb-mode", content: otui.t`${dimChunk(otui, "chat \xB7 no tools")}` }));
108374
+ sidebar.add(new otui.TextRenderable(r, { id: "sb-model-k", content: otui.t`${dimChunk(otui, "Model")}`, marginTop: 1 }));
108375
+ const sbModel = new otui.TextRenderable(r, { id: "sb-model-v", content: otui.t`${dimChunk(otui, label())}` });
108336
108376
  sidebar.add(sbModel);
108337
108377
  const balancePanel = mountBalancePanel(sidebar, otui, r, {
108338
108378
  provider: selection.provider
108339
108379
  });
108340
- sidebar.add(new otui.TextRenderable(r, { id: "sb-ctx-k", content: otui.t`${otui.dim("Context")}`, marginTop: 1 }));
108341
- const sbContext = new otui.TextRenderable(r, { id: "sb-ctx-v", content: otui.t`${otui.dim("~0 tokens (est)")}` });
108380
+ sidebar.add(new otui.TextRenderable(r, { id: "sb-ctx-k", content: otui.t`${dimChunk(otui, "Context")}`, marginTop: 1 }));
108381
+ const sbContext = new otui.TextRenderable(r, { id: "sb-ctx-v", content: otui.t`${dimChunk(otui, "~0 tokens (est)")}` });
108342
108382
  sidebar.add(sbContext);
108343
108383
  const messages = createAssistantMessageStream(otui, r, transcript);
108344
108384
  const seen = [];
@@ -108346,12 +108386,12 @@ async function mountChatShell(otui, renderer, opts) {
108346
108386
  const paintContext = () => {
108347
108387
  const est = estimateContextTokens(seen);
108348
108388
  chrome.setHeaderMeta(`~${fmtTokens(est)}`);
108349
- sbContext.content = otui.t`${otui.dim(`~${est.toLocaleString()} tokens (est)`)}`;
108389
+ sbContext.content = otui.t`${dimChunk(otui, `~${est.toLocaleString()} tokens (est)`)}`;
108350
108390
  };
108351
108391
  const paintLabels = () => {
108352
108392
  chrome.setTitle(`keryx \xB7 chat \xB7 ${label()}`);
108353
108393
  chrome.setStatus(label());
108354
- sbModel.content = otui.t`${otui.dim(label())}`;
108394
+ sbModel.content = otui.t`${dimChunk(otui, label())}`;
108355
108395
  balancePanel.setProvider(selection.provider);
108356
108396
  };
108357
108397
  const bridge = createChatBridge({
@@ -108379,7 +108419,7 @@ async function mountChatShell(otui, renderer, opts) {
108379
108419
  }
108380
108420
  },
108381
108421
  onTurnStart: () => {
108382
- append(otui.t`${otui.cyan("\u25CF")} ${otui.bold("keryx")}`);
108422
+ append(otui.t`${roleChunk(otui, "accent", "\u25CF")} ${boldChunk(otui, "keryx")}`);
108383
108423
  chrome.startBusy("waiting for model");
108384
108424
  },
108385
108425
  onText: (chunk) => {
@@ -108402,7 +108442,7 @@ async function mountChatShell(otui, renderer, opts) {
108402
108442
  if (body.length === 0) {
108403
108443
  return;
108404
108444
  }
108405
- append(body.includes("[error]") ? otui.t`${otui.red(body)}` : otui.t`${otui.dim(body)}`);
108445
+ append(body.includes("[error]") ? otui.t`${roleChunk(otui, "error", body)}` : otui.t`${dimChunk(otui, body)}`);
108406
108446
  }
108407
108447
  });
108408
108448
  const selectProviderModel = async (_io, pickOpts) => {
@@ -108434,7 +108474,7 @@ async function mountChatShell(otui, renderer, opts) {
108434
108474
  if (arg.length > 0) {
108435
108475
  const next = parseThemeId(arg);
108436
108476
  if (next === undefined) {
108437
- append(otui.t`${otui.dim(`Unknown theme '${arg}'.
108477
+ append(otui.t`${dimChunk(otui, `Unknown theme '${arg}'.
108438
108478
  ${formatThemeList(getThemeId())}`)}`);
108439
108479
  return;
108440
108480
  }
@@ -108490,11 +108530,11 @@ ${formatThemeList(getThemeId())}`)}`);
108490
108530
  return;
108491
108531
  }
108492
108532
  if (result === "deferred") {
108493
- append(otui.t`${otui.yellow("\u25C7 a reply is still streaming \u2014 command deferred. Wait for it to finish.")}`);
108533
+ append(otui.t`${roleChunk(otui, "attention", "\u25C7 a reply is still streaming \u2014 command deferred. Wait for it to finish.")}`);
108494
108534
  }
108495
108535
  });
108496
108536
  const done = opts.runShell(bridge.io, deps).catch((cause) => {
108497
- append(otui.t`${otui.red(`[error] ${cause instanceof Error ? cause.message : String(cause)}`)}`);
108537
+ append(otui.t`${roleChunk(otui, "error", `[error] ${cause instanceof Error ? cause.message : String(cause)}`)}`);
108498
108538
  });
108499
108539
  return {
108500
108540
  chrome,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mrciphersmith/keryx",
3
- "version": "0.2.149",
3
+ "version": "0.2.151",
4
4
  "description": "Version-controlled project context for AI coding agents: code graph, architecture wiki, project memory, relevant tests, quality signals, and task flows.",
5
5
  "private": false,
6
6
  "publishConfig": {