@mrciphersmith/keryx 0.4.34 → 0.4.35
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 +305 -31
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -34715,7 +34715,7 @@ var package_default;
|
|
|
34715
34715
|
var init_package = __esm(() => {
|
|
34716
34716
|
package_default = {
|
|
34717
34717
|
name: "@mrciphersmith/keryx",
|
|
34718
|
-
version: "0.4.
|
|
34718
|
+
version: "0.4.35",
|
|
34719
34719
|
description: "Version-controlled project context for AI coding agents: code graph, architecture wiki, project memory, relevant tests, quality signals, and task flows.",
|
|
34720
34720
|
private: false,
|
|
34721
34721
|
publishConfig: {
|
|
@@ -182325,6 +182325,28 @@ var init_transcript_blocks = __esm(() => {
|
|
|
182325
182325
|
init_transcript_history();
|
|
182326
182326
|
});
|
|
182327
182327
|
|
|
182328
|
+
// src/tui/shell-frame.ts
|
|
182329
|
+
function shellFrameFits(terminalColumns, terminalRows) {
|
|
182330
|
+
return terminalColumns >= SHELL_FRAME_MIN_COLUMNS && terminalRows >= SHELL_FRAME_MIN_ROWS;
|
|
182331
|
+
}
|
|
182332
|
+
function shellInnerColumns(terminalColumns, terminalRows = SHELL_FRAME_MIN_ROWS) {
|
|
182333
|
+
if (!shellFrameFits(terminalColumns, terminalRows))
|
|
182334
|
+
return terminalColumns;
|
|
182335
|
+
return Math.max(1, terminalColumns - SHELL_FRAME_COLUMNS);
|
|
182336
|
+
}
|
|
182337
|
+
function shellInnerRows(terminalRows, terminalColumns = SHELL_FRAME_MIN_COLUMNS) {
|
|
182338
|
+
if (!shellFrameFits(terminalColumns, terminalRows))
|
|
182339
|
+
return terminalRows;
|
|
182340
|
+
return Math.max(1, terminalRows - SHELL_FRAME_ROWS);
|
|
182341
|
+
}
|
|
182342
|
+
var SHELL_FRAME_GUTTER_X = 1, SHELL_FRAME_GUTTER_Y = 0, SHELL_FRAME_BORDER = 1, SHELL_FRAME_COLUMNS, SHELL_FRAME_ROWS, SHELL_MIN_COLUMNS = 80, SHELL_MIN_ROWS = 24, SHELL_FRAME_MIN_COLUMNS, SHELL_FRAME_MIN_ROWS;
|
|
182343
|
+
var init_shell_frame = __esm(() => {
|
|
182344
|
+
SHELL_FRAME_COLUMNS = 2 * (SHELL_FRAME_GUTTER_X + SHELL_FRAME_BORDER);
|
|
182345
|
+
SHELL_FRAME_ROWS = 2 * (SHELL_FRAME_GUTTER_Y + SHELL_FRAME_BORDER);
|
|
182346
|
+
SHELL_FRAME_MIN_COLUMNS = SHELL_MIN_COLUMNS + SHELL_FRAME_COLUMNS;
|
|
182347
|
+
SHELL_FRAME_MIN_ROWS = SHELL_MIN_ROWS + SHELL_FRAME_ROWS;
|
|
182348
|
+
});
|
|
182349
|
+
|
|
182328
182350
|
// src/tui/modal-host.ts
|
|
182329
182351
|
function onKeypress(r, handler) {
|
|
182330
182352
|
r._internalKeyInput.onInternal("keypress", handler);
|
|
@@ -182377,6 +182399,9 @@ function modalSpansTerminal(chrome) {
|
|
|
182377
182399
|
const mainWidth = chrome.main?.width && chrome.main.width > 0 ? chrome.main.width : rWidth - sidebar.width;
|
|
182378
182400
|
return mainWidth < MODAL_PANEL_MIN_WIDTH && rWidth >= MODAL_PANEL_MIN_WIDTH;
|
|
182379
182401
|
}
|
|
182402
|
+
function modalAvailableRows(chrome) {
|
|
182403
|
+
return shellInnerRows(chrome.renderer.height, chrome.renderer.width);
|
|
182404
|
+
}
|
|
182380
182405
|
function resolveModalInnerWidth(availableWidth) {
|
|
182381
182406
|
return Math.max(20, availableWidth - MODAL_PANEL_CHROME_X);
|
|
182382
182407
|
}
|
|
@@ -182498,7 +182523,7 @@ function mountTab(state, input, tabId) {
|
|
|
182498
182523
|
paintFooter(state, input.footerFor(tabId) ?? input.footer);
|
|
182499
182524
|
}
|
|
182500
182525
|
const availWidth = resolveModalAvailableWidth(state.chrome);
|
|
182501
|
-
const size = resolveModalPanelSize(availWidth, state.chrome
|
|
182526
|
+
const size = resolveModalPanelSize(availWidth, modalAvailableRows(state.chrome), input.contentRows);
|
|
182502
182527
|
const panelWidth = Math.min(availWidth, size.width);
|
|
182503
182528
|
const cleanup = (target.renderTab ?? input.renderTab)(tabId, state.body, {
|
|
182504
182529
|
width: resolveModalInnerWidth(panelWidth) - MODAL_BODY_SCROLLBAR_COLS,
|
|
@@ -182826,7 +182851,7 @@ function openModal(otui, chrome, input) {
|
|
|
182826
182851
|
}
|
|
182827
182852
|
const state = ensureHost(otui, chrome);
|
|
182828
182853
|
const availWidth = resolveModalAvailableWidth(chrome);
|
|
182829
|
-
const size = resolveModalPanelSize(availWidth, chrome
|
|
182854
|
+
const size = resolveModalPanelSize(availWidth, modalAvailableRows(chrome), input.contentRows);
|
|
182830
182855
|
state.panel.width = Math.min(availWidth, size.width);
|
|
182831
182856
|
state.panel.height = size.height;
|
|
182832
182857
|
mountBackdrop(state, modalSpansTerminal(chrome) ? chrome.renderer.root : chrome.main ?? chrome.renderer.root);
|
|
@@ -182870,6 +182895,7 @@ var init_modal_host = __esm(() => {
|
|
|
182870
182895
|
init_theme();
|
|
182871
182896
|
init_theme_text();
|
|
182872
182897
|
init_transcript_blocks();
|
|
182898
|
+
init_shell_frame();
|
|
182873
182899
|
MODAL_PANEL_WIDTH = MODAL_PANEL_MIN_WIDTH;
|
|
182874
182900
|
MODAL_PANEL_HEIGHT = MODAL_PANEL_MIN_HEIGHT;
|
|
182875
182901
|
MODAL_PANEL_INNER_WIDTH = MODAL_PANEL_MIN_WIDTH - MODAL_PANEL_CHROME_X;
|
|
@@ -200048,6 +200074,32 @@ async function createShellRenderer(otui, opts = {}) {
|
|
|
200048
200074
|
paintRendererBackground(renderer, getTheme());
|
|
200049
200075
|
return renderer;
|
|
200050
200076
|
}
|
|
200077
|
+
function isClickTarget(node, stopAt) {
|
|
200078
|
+
let current = node;
|
|
200079
|
+
for (let depth = 0;depth <= CLICK_TARGET_DEPTH && current !== undefined && current !== null; depth += 1) {
|
|
200080
|
+
if (stopAt.has(current))
|
|
200081
|
+
return false;
|
|
200082
|
+
const listeners = current._mouseListeners;
|
|
200083
|
+
if (listeners !== undefined && (listeners["down"] !== undefined || listeners["up"] !== undefined))
|
|
200084
|
+
return true;
|
|
200085
|
+
current = current.parent;
|
|
200086
|
+
}
|
|
200087
|
+
return false;
|
|
200088
|
+
}
|
|
200089
|
+
function guardSelectionStart(renderer, stopAt) {
|
|
200090
|
+
const host = renderer;
|
|
200091
|
+
const original = host.startSelection;
|
|
200092
|
+
if (typeof original !== "function")
|
|
200093
|
+
return () => {};
|
|
200094
|
+
host.startSelection = function guardedStartSelection(target, x, y) {
|
|
200095
|
+
if (isClickTarget(target, stopAt()))
|
|
200096
|
+
return;
|
|
200097
|
+
original.call(this, target, x, y);
|
|
200098
|
+
};
|
|
200099
|
+
return () => {
|
|
200100
|
+
host.startSelection = original;
|
|
200101
|
+
};
|
|
200102
|
+
}
|
|
200051
200103
|
async function createShellChrome(otui, renderer, opts) {
|
|
200052
200104
|
const r = renderer;
|
|
200053
200105
|
const toastMs = opts.toastMs ?? TOAST_MS;
|
|
@@ -200055,8 +200107,27 @@ async function createShellChrome(otui, renderer, opts) {
|
|
|
200055
200107
|
let uid = 0;
|
|
200056
200108
|
let alive = true;
|
|
200057
200109
|
let appliedTheme = getTheme();
|
|
200110
|
+
const frame = new otui.BoxRenderable(r, {
|
|
200111
|
+
id: "shell-frame",
|
|
200112
|
+
flexGrow: 1,
|
|
200113
|
+
flexDirection: "row",
|
|
200114
|
+
borderStyle: "rounded",
|
|
200115
|
+
borderColor: getTheme().border
|
|
200116
|
+
});
|
|
200117
|
+
r.root.add(frame);
|
|
200118
|
+
const innerColumns = () => shellInnerColumns(r.width, r.height);
|
|
200119
|
+
const fitFrame = () => {
|
|
200120
|
+
const on = typeof r.width === "number" && typeof r.height === "number" && shellFrameFits(r.width, r.height);
|
|
200121
|
+
frame.border = on;
|
|
200122
|
+
frame.marginLeft = on ? SHELL_FRAME_GUTTER_X : 0;
|
|
200123
|
+
frame.marginRight = on ? SHELL_FRAME_GUTTER_X : 0;
|
|
200124
|
+
frame.marginTop = on ? SHELL_FRAME_GUTTER_Y : 0;
|
|
200125
|
+
frame.marginBottom = on ? SHELL_FRAME_GUTTER_Y : 0;
|
|
200126
|
+
};
|
|
200127
|
+
fitFrame();
|
|
200128
|
+
r.on(otui.CliRenderEvents.RESIZE, fitFrame);
|
|
200058
200129
|
const rootRow = new otui.BoxRenderable(r, { id: "root-row", flexGrow: 1, flexDirection: "row" });
|
|
200059
|
-
|
|
200130
|
+
frame.add(rootRow);
|
|
200060
200131
|
const main = new otui.BoxRenderable(r, {
|
|
200061
200132
|
id: "main",
|
|
200062
200133
|
flexGrow: 1,
|
|
@@ -200069,7 +200140,7 @@ async function createShellChrome(otui, renderer, opts) {
|
|
|
200069
200140
|
rootRow.add(main);
|
|
200070
200141
|
const geometry = opts.sidebar?.geometry;
|
|
200071
200142
|
if (geometry !== undefined && typeof r.width === "number" && r.width > 0)
|
|
200072
|
-
geometry.resize(
|
|
200143
|
+
geometry.resize(innerColumns());
|
|
200073
200144
|
const sidebarWidth = () => geometry?.state().width ?? SIDEBAR_WIDTH;
|
|
200074
200145
|
const sidebar = new otui.BoxRenderable(r, {
|
|
200075
200146
|
id: "sidebar",
|
|
@@ -200188,6 +200259,7 @@ async function createShellChrome(otui, renderer, opts) {
|
|
|
200188
200259
|
} catch {}
|
|
200189
200260
|
};
|
|
200190
200261
|
r.on(otui.CliRenderEvents.SELECTION, onSelection);
|
|
200262
|
+
const restoreSelectionStart = guardSelectionStart(r, () => new Set([scroll, sidebar, main, rootRow]));
|
|
200191
200263
|
const header = new otui.BoxRenderable(r, {
|
|
200192
200264
|
id: "header",
|
|
200193
200265
|
flexShrink: 0,
|
|
@@ -200538,7 +200610,7 @@ async function createShellChrome(otui, renderer, opts) {
|
|
|
200538
200610
|
let busyFooterInfo;
|
|
200539
200611
|
const footerLeftBudget = (rightText) => {
|
|
200540
200612
|
const laidOut = typeof footer.width === "number" && footer.width > 0 ? footer.width : Number.POSITIVE_INFINITY;
|
|
200541
|
-
const termWidth = typeof r.width === "number" && r.width > 0 ?
|
|
200613
|
+
const termWidth = typeof r.width === "number" && r.width > 0 ? innerColumns() : Number.POSITIVE_INFINITY;
|
|
200542
200614
|
const rowWidth = Math.min(laidOut, termWidth - sidebarWidth() - 2 * WORKSPACE_GUTTER_X);
|
|
200543
200615
|
if (!Number.isFinite(rowWidth))
|
|
200544
200616
|
return Number.POSITIVE_INFINITY;
|
|
@@ -200779,7 +200851,7 @@ async function createShellChrome(otui, renderer, opts) {
|
|
|
200779
200851
|
let offSidebarKeys;
|
|
200780
200852
|
const onGeometryResize = () => {
|
|
200781
200853
|
if (geometry !== undefined && typeof r.width === "number" && r.width > 0)
|
|
200782
|
-
geometry.resize(
|
|
200854
|
+
geometry.resize(innerColumns());
|
|
200783
200855
|
};
|
|
200784
200856
|
if (geometry !== undefined) {
|
|
200785
200857
|
unsubscribeGeometry = geometry.subscribe((state) => {
|
|
@@ -200807,6 +200879,7 @@ async function createShellChrome(otui, renderer, opts) {
|
|
|
200807
200879
|
}
|
|
200808
200880
|
const applyTheme = (theme = getTheme()) => {
|
|
200809
200881
|
paintRendererBackground(r, theme);
|
|
200882
|
+
frame.borderColor = theme.border;
|
|
200810
200883
|
sidebar.borderColor = theme.border;
|
|
200811
200884
|
sidebar.backgroundColor = theme.panel;
|
|
200812
200885
|
textarea.textColor = theme.text;
|
|
@@ -200954,11 +201027,13 @@ async function createShellChrome(otui, renderer, opts) {
|
|
|
200954
201027
|
try {
|
|
200955
201028
|
textarea.off(otui.LayoutEvents.RESIZED, onComposerResized);
|
|
200956
201029
|
footer.off(otui.LayoutEvents.RESIZED, onFooterResized);
|
|
201030
|
+
r.off(otui.CliRenderEvents.RESIZE, fitFrame);
|
|
200957
201031
|
r.off(otui.CliRenderEvents.RESIZE, onFooterResized);
|
|
200958
201032
|
r.off(otui.CliRenderEvents.RESIZE, onGeometryResize);
|
|
200959
201033
|
} catch {}
|
|
200960
201034
|
try {
|
|
200961
201035
|
r.off(otui.CliRenderEvents.SELECTION, onSelection);
|
|
201036
|
+
restoreSelectionStart();
|
|
200962
201037
|
} catch {}
|
|
200963
201038
|
try {
|
|
200964
201039
|
r.off(otui.CliRenderEvents.FRAME, syncPromptPin);
|
|
@@ -200967,7 +201042,7 @@ async function createShellChrome(otui, renderer, opts) {
|
|
|
200967
201042
|
}
|
|
200968
201043
|
};
|
|
200969
201044
|
}
|
|
200970
|
-
var COMPOSER_MIN_ROWS = 1, COMPOSER_MAX_ROWS = 6, COMPOSER_BORDER_ROWS = 2, MENU_HEIGHT = 10, SIDEBAR_BORDER_LEFT = 1, SIDEBAR_PADDING_LEFT = 2, SIDEBAR_PADDING_RIGHT = 1, SIDEBAR_RAIL_PADDING_LEFT = 1, WORKSPACE_GUTTER_X = 1, TRANSCRIPT_PADDING_X = 1, SIDEBAR_TEXT_WIDTH, SPINNER, SPINNER_MS = 120, TOAST_MS = 5000;
|
|
201045
|
+
var COMPOSER_MIN_ROWS = 1, COMPOSER_MAX_ROWS = 6, COMPOSER_BORDER_ROWS = 2, MENU_HEIGHT = 10, SIDEBAR_BORDER_LEFT = 1, SIDEBAR_PADDING_LEFT = 2, SIDEBAR_PADDING_RIGHT = 1, SIDEBAR_RAIL_PADDING_LEFT = 1, WORKSPACE_GUTTER_X = 1, TRANSCRIPT_PADDING_X = 1, SIDEBAR_TEXT_WIDTH, SPINNER, SPINNER_MS = 120, TOAST_MS = 5000, CLICK_TARGET_DEPTH = 3;
|
|
200971
201046
|
var init_shell_chrome = __esm(() => {
|
|
200972
201047
|
init_version_check();
|
|
200973
201048
|
init_theme();
|
|
@@ -200975,6 +201050,7 @@ var init_shell_chrome = __esm(() => {
|
|
|
200975
201050
|
init_modal_host();
|
|
200976
201051
|
init_debug_log();
|
|
200977
201052
|
init_renderer_debug();
|
|
201053
|
+
init_shell_frame();
|
|
200978
201054
|
init_sidebar_geometry();
|
|
200979
201055
|
init_duration_format();
|
|
200980
201056
|
init_transcript_history();
|
|
@@ -201119,7 +201195,7 @@ function centerWrappedLines(text, width) {
|
|
|
201119
201195
|
}
|
|
201120
201196
|
function mountEmptyTranscriptSplash(otui, r, transcript) {
|
|
201121
201197
|
const rows = WORDMARK.length + 2;
|
|
201122
|
-
const paneRows = Math.max(0, r.height - SHELL_CHROME_ROWS);
|
|
201198
|
+
const paneRows = Math.max(0, shellInnerRows(r.height, r.width) - SHELL_CHROME_ROWS);
|
|
201123
201199
|
const box = new otui.BoxRenderable(r, {
|
|
201124
201200
|
id: "transcript-splash",
|
|
201125
201201
|
width: "100%",
|
|
@@ -201136,7 +201212,7 @@ function mountEmptyTranscriptSplash(otui, r, transcript) {
|
|
|
201136
201212
|
if (removed) {
|
|
201137
201213
|
return;
|
|
201138
201214
|
}
|
|
201139
|
-
const width = box.width > 0 ? box.width : Math.max(SPLASH_MIN_COLS, (r.width > 0 ? r.width : 80) - SIDEBAR_WIDTH - 2);
|
|
201215
|
+
const width = box.width > 0 ? box.width : Math.max(SPLASH_MIN_COLS, shellInnerColumns(r.width > 0 ? r.width : 80, r.height) - SIDEBAR_WIDTH - 2);
|
|
201140
201216
|
for (const child of painted) {
|
|
201141
201217
|
box.remove(child);
|
|
201142
201218
|
}
|
|
@@ -201222,6 +201298,7 @@ var init_boot_animation = __esm(() => {
|
|
|
201222
201298
|
init_theme();
|
|
201223
201299
|
init_theme_text();
|
|
201224
201300
|
init_shell_chrome();
|
|
201301
|
+
init_shell_frame();
|
|
201225
201302
|
WORDMARK = ["========================", " K E R Y X ", "========================"];
|
|
201226
201303
|
SPINNER_FRAMES = ["\u25D0", "\u25D3", "\u25D1", "\u25D2"];
|
|
201227
201304
|
});
|
|
@@ -215480,6 +215557,38 @@ function mountSidebarCards(otui, renderer, parent, options) {
|
|
|
215480
215557
|
}
|
|
215481
215558
|
};
|
|
215482
215559
|
}
|
|
215560
|
+
function itemStatusStyle(status) {
|
|
215561
|
+
switch (status) {
|
|
215562
|
+
case "running":
|
|
215563
|
+
return { glyph: "\u25CF", role: "accent" };
|
|
215564
|
+
case "completed":
|
|
215565
|
+
case "done":
|
|
215566
|
+
return { glyph: "\u2713", role: "ok" };
|
|
215567
|
+
case "failed":
|
|
215568
|
+
return { glyph: "\u2717", role: "error" };
|
|
215569
|
+
case "killed":
|
|
215570
|
+
return { glyph: "\u2298", role: "error" };
|
|
215571
|
+
case "blocked":
|
|
215572
|
+
case "queued":
|
|
215573
|
+
return { glyph: "\u25CC", role: "attention" };
|
|
215574
|
+
default:
|
|
215575
|
+
return { glyph: "\xB7", role: "muted" };
|
|
215576
|
+
}
|
|
215577
|
+
}
|
|
215578
|
+
function fitLine(text, width) {
|
|
215579
|
+
const line = text.replace(/\s+/g, " ").trim();
|
|
215580
|
+
if (width <= 0)
|
|
215581
|
+
return "";
|
|
215582
|
+
if (displayWidth(line) <= width)
|
|
215583
|
+
return line;
|
|
215584
|
+
let out = "";
|
|
215585
|
+
for (const ch of line) {
|
|
215586
|
+
if (displayWidth(out + ch) > width - 1)
|
|
215587
|
+
break;
|
|
215588
|
+
out += ch;
|
|
215589
|
+
}
|
|
215590
|
+
return `${out}\u2026`;
|
|
215591
|
+
}
|
|
215483
215592
|
function openSidebarCard(otui, chrome, cardId, options) {
|
|
215484
215593
|
if (otui === undefined || chrome === undefined)
|
|
215485
215594
|
return;
|
|
@@ -215488,11 +215597,30 @@ function openSidebarCard(otui, chrome, cardId, options) {
|
|
|
215488
215597
|
if (first === undefined)
|
|
215489
215598
|
return;
|
|
215490
215599
|
const tabOf = (tabId) => find()?.tabs.find((tab) => tab.id === tabId);
|
|
215600
|
+
const listStates = new Map;
|
|
215601
|
+
const listState = (tabId) => {
|
|
215602
|
+
let state = listStates.get(tabId);
|
|
215603
|
+
if (state === undefined) {
|
|
215604
|
+
state = { selected: 0 };
|
|
215605
|
+
listStates.set(tabId, state);
|
|
215606
|
+
}
|
|
215607
|
+
return state;
|
|
215608
|
+
};
|
|
215609
|
+
const listControls = new Map;
|
|
215610
|
+
const isDetail = (tabId) => tabId.startsWith("detail:");
|
|
215611
|
+
const parentOf = (tabId) => tabId.split(":")[1] ?? "";
|
|
215491
215612
|
const handle = openModal(otui, chrome, {
|
|
215492
215613
|
title: first.title,
|
|
215493
215614
|
tabs: first.tabs.map((tab) => ({ id: tab.id, label: tab.label })),
|
|
215494
215615
|
...options.initialTab !== undefined ? { initialTab: options.initialTab } : {},
|
|
215495
215616
|
footer: SIDEBAR_CARD_FOOTER,
|
|
215617
|
+
footerFor: (tabId) => {
|
|
215618
|
+
if (isDetail(tabId))
|
|
215619
|
+
return SIDEBAR_CARD_DETAIL_FOOTER;
|
|
215620
|
+
if (options.snapshot().items?.[tabId] !== undefined)
|
|
215621
|
+
return SIDEBAR_CARD_LIST_FOOTER;
|
|
215622
|
+
return tabOf(tabId)?.command !== undefined ? SIDEBAR_CARD_FOOTER : SIDEBAR_CARD_FOOTER_PLAIN;
|
|
215623
|
+
},
|
|
215496
215624
|
renderTab: (tabId, body, ctx) => {
|
|
215497
215625
|
const work = cardId === "work";
|
|
215498
215626
|
const flags = { subagents: tabId === "subagents", jobs: tabId === "jobs", plan: tabId === "plan" };
|
|
@@ -215512,33 +215640,90 @@ function openSidebarCard(otui, chrome, cardId, options) {
|
|
|
215512
215640
|
callDiagnostics.observe("work.layout", { ...flags, width: rows.width, height: rows.height, visible: rows.visible });
|
|
215513
215641
|
};
|
|
215514
215642
|
body.add(rows);
|
|
215643
|
+
const items = () => options.snapshot().items?.[tabId] ?? [];
|
|
215644
|
+
const openItem = (item) => {
|
|
215645
|
+
if (options.renderItem === undefined)
|
|
215646
|
+
return;
|
|
215647
|
+
handle?.addTab({
|
|
215648
|
+
id: `detail:${tabId}:${item.id}`,
|
|
215649
|
+
label: item.label,
|
|
215650
|
+
temporary: true,
|
|
215651
|
+
renderTab: (_id, target, context) => {
|
|
215652
|
+
target.add(new otui.TextRenderable(chrome.renderer, {
|
|
215653
|
+
id: `sb-card-detail-back-${tabId}`,
|
|
215654
|
+
content: `\u2190 back to ${tab.label}`,
|
|
215655
|
+
fg: roleColor("muted"),
|
|
215656
|
+
onMouseDown: () => handle?.setTab(tabId)
|
|
215657
|
+
}));
|
|
215658
|
+
if (item.title !== undefined) {
|
|
215659
|
+
target.add(new otui.TextRenderable(chrome.renderer, {
|
|
215660
|
+
id: `sb-card-detail-title-${tabId}`,
|
|
215661
|
+
content: item.title,
|
|
215662
|
+
fg: roleColor("text"),
|
|
215663
|
+
marginBottom: 1
|
|
215664
|
+
}));
|
|
215665
|
+
}
|
|
215666
|
+
return options.renderItem?.(tabId, item, target, context);
|
|
215667
|
+
}
|
|
215668
|
+
}, tabId);
|
|
215669
|
+
};
|
|
215515
215670
|
const paintContent = () => {
|
|
215516
215671
|
for (const child of [...rows.getChildren()]) {
|
|
215517
215672
|
rows.remove(child);
|
|
215518
215673
|
child.destroy();
|
|
215519
215674
|
}
|
|
215520
215675
|
const snapshot = options.snapshot();
|
|
215676
|
+
const list = snapshot.items?.[tabId] ?? [];
|
|
215677
|
+
const state = listState(tabId);
|
|
215678
|
+
state.selected = list.length === 0 ? 0 : Math.min(Math.max(0, state.selected), list.length - 1);
|
|
215521
215679
|
rows.add(new otui.TextRenderable(chrome.renderer, {
|
|
215522
215680
|
id: `sb-card-items-${tabId}-header`,
|
|
215523
215681
|
content: snapshot.sections?.[tabId] ?? "Nothing to show yet.",
|
|
215524
|
-
fg: roleColor("
|
|
215682
|
+
fg: roleColor("muted"),
|
|
215683
|
+
marginBottom: list.length > 0 ? 1 : 0
|
|
215525
215684
|
}));
|
|
215526
|
-
|
|
215527
|
-
|
|
215685
|
+
const width = Math.max(20, (rows.width > 0 ? rows.width : ctx.width) - 1);
|
|
215686
|
+
const metaWidth = Math.max(0, ...list.map((entry) => displayWidth(entry.meta ?? "")));
|
|
215687
|
+
for (const [index, item] of list.entries()) {
|
|
215688
|
+
const style = itemStatusStyle(item.status);
|
|
215689
|
+
const selected = index === state.selected;
|
|
215690
|
+
const meta = metaWidth > 0 ? (item.meta ?? "").padStart(metaWidth) : "";
|
|
215691
|
+
const titleWidth = width - ITEM_STATUS_COLUMNS - (metaWidth > 0 ? metaWidth + 2 : 0);
|
|
215692
|
+
const row = new otui.BoxRenderable(chrome.renderer, {
|
|
215528
215693
|
id: `sb-card-item-${tabId}-${item.id}`,
|
|
215529
|
-
|
|
215530
|
-
|
|
215694
|
+
flexDirection: "row",
|
|
215695
|
+
flexShrink: 0,
|
|
215696
|
+
...selected ? { backgroundColor: getTheme().highlight } : {},
|
|
215531
215697
|
onMouseDown: () => {
|
|
215532
|
-
|
|
215533
|
-
|
|
215534
|
-
handle?.addTab({
|
|
215535
|
-
id: `detail:${tabId}:${item.id}`,
|
|
215536
|
-
label: item.label,
|
|
215537
|
-
temporary: true,
|
|
215538
|
-
renderTab: (_id, target, context) => options.renderItem?.(tabId, item, target, context)
|
|
215539
|
-
}, tabId);
|
|
215698
|
+
state.selected = index;
|
|
215699
|
+
openItem(item);
|
|
215540
215700
|
}
|
|
215701
|
+
});
|
|
215702
|
+
const status = `${style.glyph} ${item.status ?? ""}`;
|
|
215703
|
+
row.add(new otui.TextRenderable(chrome.renderer, {
|
|
215704
|
+
id: `sb-card-item-${tabId}-${item.id}-status`,
|
|
215705
|
+
content: status.padEnd(ITEM_STATUS_COLUMNS).slice(0, ITEM_STATUS_COLUMNS),
|
|
215706
|
+
fg: roleColor(style.role),
|
|
215707
|
+
flexShrink: 0
|
|
215541
215708
|
}));
|
|
215709
|
+
row.add(new otui.TextRenderable(chrome.renderer, {
|
|
215710
|
+
id: `sb-card-item-${tabId}-${item.id}-title`,
|
|
215711
|
+
content: fitLine(item.title ?? item.text, titleWidth).padEnd(Math.max(0, titleWidth)),
|
|
215712
|
+
fg: roleColor(selected ? "text" : item.status === "running" ? "text" : "muted"),
|
|
215713
|
+
flexGrow: 1,
|
|
215714
|
+
flexShrink: 1,
|
|
215715
|
+
minWidth: 0,
|
|
215716
|
+
wrapMode: "none"
|
|
215717
|
+
}));
|
|
215718
|
+
if (meta.length > 0) {
|
|
215719
|
+
row.add(new otui.TextRenderable(chrome.renderer, {
|
|
215720
|
+
id: `sb-card-item-${tabId}-${item.id}-meta`,
|
|
215721
|
+
content: ` ${meta}`,
|
|
215722
|
+
fg: roleColor("muted"),
|
|
215723
|
+
flexShrink: 0
|
|
215724
|
+
}));
|
|
215725
|
+
}
|
|
215726
|
+
rows.add(row);
|
|
215542
215727
|
}
|
|
215543
215728
|
chrome.renderer.requestRender();
|
|
215544
215729
|
if (work) {
|
|
@@ -215555,8 +215740,24 @@ function openSidebarCard(otui, chrome, cardId, options) {
|
|
|
215555
215740
|
}
|
|
215556
215741
|
};
|
|
215557
215742
|
paint();
|
|
215743
|
+
listControls.set(tabId, {
|
|
215744
|
+
move: (delta) => {
|
|
215745
|
+
const count = items().length;
|
|
215746
|
+
if (count === 0)
|
|
215747
|
+
return;
|
|
215748
|
+
const state = listState(tabId);
|
|
215749
|
+
state.selected = (state.selected + delta + count) % count;
|
|
215750
|
+
paint();
|
|
215751
|
+
},
|
|
215752
|
+
open: () => {
|
|
215753
|
+
const item = items()[listState(tabId).selected];
|
|
215754
|
+
if (item !== undefined)
|
|
215755
|
+
openItem(item);
|
|
215756
|
+
}
|
|
215757
|
+
});
|
|
215558
215758
|
const unsubscribe = options.subscribe?.(paint);
|
|
215559
215759
|
return () => {
|
|
215760
|
+
listControls.delete(tabId);
|
|
215560
215761
|
rows.onSizeChange = undefined;
|
|
215561
215762
|
unsubscribe?.();
|
|
215562
215763
|
if (work)
|
|
@@ -215577,6 +215778,26 @@ Enter opens ${tab.command}`,
|
|
|
215577
215778
|
}
|
|
215578
215779
|
},
|
|
215579
215780
|
claimKey: (key) => {
|
|
215781
|
+
const active = handle?.activeTab() ?? "";
|
|
215782
|
+
if (isDetail(active) && key.name === "backspace") {
|
|
215783
|
+
handle?.setTab(parentOf(active));
|
|
215784
|
+
return true;
|
|
215785
|
+
}
|
|
215786
|
+
const list = listControls.get(active);
|
|
215787
|
+
if (list !== undefined) {
|
|
215788
|
+
if (key.name === "up" || key.name === "k") {
|
|
215789
|
+
list.move(-1);
|
|
215790
|
+
return true;
|
|
215791
|
+
}
|
|
215792
|
+
if (key.name === "down" || key.name === "j") {
|
|
215793
|
+
list.move(1);
|
|
215794
|
+
return true;
|
|
215795
|
+
}
|
|
215796
|
+
if (key.name === "return" || key.name === "enter") {
|
|
215797
|
+
list.open();
|
|
215798
|
+
return true;
|
|
215799
|
+
}
|
|
215800
|
+
}
|
|
215580
215801
|
if (key.name !== "return" && key.name !== "enter")
|
|
215581
215802
|
return false;
|
|
215582
215803
|
const command = tabOf(handle?.activeTab() ?? "")?.command;
|
|
@@ -215592,7 +215813,7 @@ Enter opens ${tab.command}`,
|
|
|
215592
215813
|
const opened = handle;
|
|
215593
215814
|
return { close: () => opened.close(), activeTab: () => opened.activeTab() };
|
|
215594
215815
|
}
|
|
215595
|
-
var RAIL_CELLS = 3, SUPERSCRIPT_DIGITS, MAX_VALUE_ROWS = 3, MIN_CARD_LINES = 3, NOTHING_TO_SHOW = "Nothing to show yet.", CARD_DEFS, SIDEBAR_CARD_IDS, SIDEBAR_SECTION_IDS, SIDEBAR_SECTION_CARD, SIDEBAR_CARD_FOOTER;
|
|
215816
|
+
var RAIL_CELLS = 3, SUPERSCRIPT_DIGITS, MAX_VALUE_ROWS = 3, MIN_CARD_LINES = 3, NOTHING_TO_SHOW = "Nothing to show yet.", CARD_DEFS, SIDEBAR_CARD_IDS, SIDEBAR_SECTION_IDS, SIDEBAR_SECTION_CARD, SIDEBAR_CARD_FOOTER, SIDEBAR_CARD_FOOTER_PLAIN, SIDEBAR_CARD_LIST_FOOTER, SIDEBAR_CARD_DETAIL_FOOTER, ITEM_STATUS_COLUMNS = 12;
|
|
215596
215817
|
var init_sidebar_cards = __esm(() => {
|
|
215597
215818
|
init_live_render();
|
|
215598
215819
|
init_call_diagnostics();
|
|
@@ -215742,6 +215963,20 @@ var init_sidebar_cards = __esm(() => {
|
|
|
215742
215963
|
{ key: "enter", label: "open the full view" },
|
|
215743
215964
|
{ key: "esc", label: "close" }
|
|
215744
215965
|
];
|
|
215966
|
+
SIDEBAR_CARD_FOOTER_PLAIN = [
|
|
215967
|
+
{ key: "\u2190/\u2192", label: "tab" },
|
|
215968
|
+
{ key: "esc", label: "close" }
|
|
215969
|
+
];
|
|
215970
|
+
SIDEBAR_CARD_LIST_FOOTER = [
|
|
215971
|
+
{ key: "\u2191/\u2193", label: "select" },
|
|
215972
|
+
{ key: "enter", label: "open" },
|
|
215973
|
+
{ key: "\u2190/\u2192", label: "tab" },
|
|
215974
|
+
{ key: "esc", label: "close" }
|
|
215975
|
+
];
|
|
215976
|
+
SIDEBAR_CARD_DETAIL_FOOTER = [
|
|
215977
|
+
{ key: "esc", label: "back" },
|
|
215978
|
+
{ key: "\u2190/\u2192", label: "tab" }
|
|
215979
|
+
];
|
|
215745
215980
|
});
|
|
215746
215981
|
|
|
215747
215982
|
// src/tui/worker-fleet.ts
|
|
@@ -216667,6 +216902,26 @@ var init_background_job_inspector = __esm(() => {
|
|
|
216667
216902
|
});
|
|
216668
216903
|
|
|
216669
216904
|
// src/tui/sidebar-work.ts
|
|
216905
|
+
function oneLine8(text) {
|
|
216906
|
+
return text.replace(/\s+/g, " ").trim();
|
|
216907
|
+
}
|
|
216908
|
+
function shortLabel(text, max = DETAIL_LABEL_CHARS) {
|
|
216909
|
+
const line = oneLine8(text);
|
|
216910
|
+
return line.length <= max ? line : `${line.slice(0, Math.max(1, max - 1))}\u2026`;
|
|
216911
|
+
}
|
|
216912
|
+
function jobMeta(job) {
|
|
216913
|
+
if (job.status === "running")
|
|
216914
|
+
return;
|
|
216915
|
+
const parts = [];
|
|
216916
|
+
if (job.exitCode !== undefined)
|
|
216917
|
+
parts.push(`exit ${job.exitCode}`);
|
|
216918
|
+
if (job.startedAt !== undefined && job.endedAt !== undefined) {
|
|
216919
|
+
const ms = Date.parse(job.endedAt) - Date.parse(job.startedAt);
|
|
216920
|
+
if (Number.isFinite(ms) && ms >= 0)
|
|
216921
|
+
parts.push(formatDuration(ms));
|
|
216922
|
+
}
|
|
216923
|
+
return parts.length > 0 ? parts.join(" \xB7 ") : undefined;
|
|
216924
|
+
}
|
|
216670
216925
|
function counts2(label, statuses, done) {
|
|
216671
216926
|
const n = (status) => statuses.filter((value) => value === status).length;
|
|
216672
216927
|
const failures = n("failed") + n("killed");
|
|
@@ -216679,8 +216934,24 @@ function workSidebarSnapshot(agents, jobs) {
|
|
|
216679
216934
|
...jobs.length > 0 ? { jobs: counts2("Jobs", jobs.map((j) => j.status), "completed") } : {}
|
|
216680
216935
|
},
|
|
216681
216936
|
items: {
|
|
216682
|
-
subagents: agents.map((a) => ({
|
|
216683
|
-
|
|
216937
|
+
subagents: agents.map((a) => ({
|
|
216938
|
+
id: a.id,
|
|
216939
|
+
label: shortLabel(a.label),
|
|
216940
|
+
text: `${a.status} \xB7 ${a.label}`,
|
|
216941
|
+
status: a.status,
|
|
216942
|
+
title: a.label
|
|
216943
|
+
})),
|
|
216944
|
+
jobs: jobs.map((j) => {
|
|
216945
|
+
const meta = jobMeta(j);
|
|
216946
|
+
return {
|
|
216947
|
+
id: j.jobId,
|
|
216948
|
+
label: shortLabel(j.command),
|
|
216949
|
+
text: `${j.status} \xB7 ${j.command}`,
|
|
216950
|
+
status: j.status,
|
|
216951
|
+
title: j.command,
|
|
216952
|
+
...meta !== undefined ? { meta } : {}
|
|
216953
|
+
};
|
|
216954
|
+
})
|
|
216684
216955
|
}
|
|
216685
216956
|
};
|
|
216686
216957
|
}
|
|
@@ -216746,10 +217017,12 @@ function renderWorkInspector(otui, chrome, body, section, id, options) {
|
|
|
216746
217017
|
}
|
|
216747
217018
|
return embedded.dispose;
|
|
216748
217019
|
}
|
|
217020
|
+
var DETAIL_LABEL_CHARS = 28;
|
|
216749
217021
|
var init_sidebar_work = __esm(() => {
|
|
216750
217022
|
init_subagent_inspector();
|
|
216751
217023
|
init_background_job_inspector();
|
|
216752
217024
|
init_theme();
|
|
217025
|
+
init_duration_format();
|
|
216753
217026
|
});
|
|
216754
217027
|
|
|
216755
217028
|
// src/tui/side-worker.ts
|
|
@@ -217710,7 +217983,7 @@ class ExternalOperator {
|
|
|
217710
217983
|
};
|
|
217711
217984
|
}
|
|
217712
217985
|
const runId = `ext:${this.idSeq()}`;
|
|
217713
|
-
const label =
|
|
217986
|
+
const label = shortLabel2(input.label ?? entry.label);
|
|
217714
217987
|
this.operatorInitiated.add(runId);
|
|
217715
217988
|
emitSubagentFleet({
|
|
217716
217989
|
kind: "upsert",
|
|
@@ -217814,7 +218087,7 @@ class ExternalOperator {
|
|
|
217814
218087
|
}
|
|
217815
218088
|
}
|
|
217816
218089
|
}
|
|
217817
|
-
function
|
|
218090
|
+
function shortLabel2(raw) {
|
|
217818
218091
|
const trimmed = raw.trim();
|
|
217819
218092
|
if (trimmed.length === 0)
|
|
217820
218093
|
return "external";
|
|
@@ -283359,7 +283632,7 @@ async function launchTuiAgentShell(opts) {
|
|
|
283359
283632
|
}).catch(() => {});
|
|
283360
283633
|
}
|
|
283361
283634
|
startupTrace.mark("session-start-dispatch");
|
|
283362
|
-
sidebarGeometry = createSidebarGeometry({ columns: r.width > 0 ? r.width : 80 });
|
|
283635
|
+
sidebarGeometry = createSidebarGeometry({ columns: shellInnerColumns(r.width > 0 ? r.width : 80, r.height > 0 ? r.height : 24) });
|
|
283363
283636
|
chrome = await createShellChrome(otui, r, {
|
|
283364
283637
|
title: `keryx \xB7 agent \xB7 ${sel.provider}/${sel.model}`,
|
|
283365
283638
|
sidebar: { geometry: sidebarGeometry, version: package_default.version },
|
|
@@ -288966,6 +289239,7 @@ var init_tui_shell = __esm(() => {
|
|
|
288966
289239
|
init_filter_list();
|
|
288967
289240
|
init_shell_chrome();
|
|
288968
289241
|
init_sidebar_geometry();
|
|
289242
|
+
init_shell_frame();
|
|
288969
289243
|
init_sidebar_cards();
|
|
288970
289244
|
init_sidebar_work();
|
|
288971
289245
|
init_main_queue();
|
|
@@ -305246,7 +305520,7 @@ var init_native_coverage_generated = __esm(() => {
|
|
|
305246
305520
|
registryDigest: "96f6ac176ce1847bcc637495a22b7e217d5f472d7a97651ea1614cfe26bfc27e",
|
|
305247
305521
|
contractDigest: "95fd86252f56e1ddca9e5acc8f3817e1dba30c7a576e7a7130ded3424d23b018",
|
|
305248
305522
|
subjectCatalogueDigest: "f6ed92a8b7d057c867dfe4836a6c385496bd184abc670653d5adf6515277ef3a",
|
|
305249
|
-
inventoryDigest: "
|
|
305523
|
+
inventoryDigest: "8cfc53ce4c148ec3cf7764ee20cce32eddd009623eb092da339c5d4fe6a431f8",
|
|
305250
305524
|
releaseReady: true,
|
|
305251
305525
|
counts: {
|
|
305252
305526
|
registeredCommands: 76,
|
|
@@ -305526,7 +305800,7 @@ var init_native_coverage_generated = __esm(() => {
|
|
|
305526
305800
|
"workspace.navigate"
|
|
305527
305801
|
],
|
|
305528
305802
|
otherBlockers: [],
|
|
305529
|
-
descriptorDigest: "
|
|
305803
|
+
descriptorDigest: "20958d7bd79f3b5e0a068f05e54aa76efe0ee95442b06834452bfb8726901f6c"
|
|
305530
305804
|
};
|
|
305531
305805
|
});
|
|
305532
305806
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mrciphersmith/keryx",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.35",
|
|
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": {
|