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