@mrciphersmith/keryx 0.2.64 → 0.2.65
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 +77 -49
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -53556,7 +53556,7 @@ import { spawnSync as spawnSync2 } from "child_process";
|
|
|
53556
53556
|
// package.json
|
|
53557
53557
|
var package_default = {
|
|
53558
53558
|
name: "@mrciphersmith/keryx",
|
|
53559
|
-
version: "0.2.
|
|
53559
|
+
version: "0.2.65",
|
|
53560
53560
|
description: "Version-controlled project context for AI coding agents: code graph, architecture wiki, project memory, relevant tests, quality signals, and task flows.",
|
|
53561
53561
|
private: false,
|
|
53562
53562
|
publishConfig: {
|
|
@@ -54542,7 +54542,11 @@ function mountTab(state, input2, tabId) {
|
|
|
54542
54542
|
unmountActiveTab(state);
|
|
54543
54543
|
state.active = tabId;
|
|
54544
54544
|
paintTabs(state);
|
|
54545
|
-
const
|
|
54545
|
+
const size = resolveModalPanelSize(state.chrome.renderer.width, state.chrome.renderer.height);
|
|
54546
|
+
const cleanup = input2.renderTab(tabId, state.body, {
|
|
54547
|
+
width: resolveModalInnerWidth(size.width),
|
|
54548
|
+
height: modalBodyRows(size.height)
|
|
54549
|
+
});
|
|
54546
54550
|
state.tabCleanup = typeof cleanup === "function" ? cleanup : undefined;
|
|
54547
54551
|
}
|
|
54548
54552
|
function closeHost(state, opts) {
|
|
@@ -57575,6 +57579,10 @@ function formatTokens(n) {
|
|
|
57575
57579
|
|
|
57576
57580
|
// src/tui/games/constants.ts
|
|
57577
57581
|
var GAME_MODEL_TIMEOUT_MS = 60000;
|
|
57582
|
+
var PROMPT_MIN_ROWS = 5;
|
|
57583
|
+
var PROMPT_MAX_ROWS = 14;
|
|
57584
|
+
var PANEL_FIXED_ROWS = 7;
|
|
57585
|
+
var PANEL_MIN_ROWS = PANEL_FIXED_ROWS + PROMPT_MIN_ROWS;
|
|
57578
57586
|
var GAMES_FOOTER = [
|
|
57579
57587
|
{ key: "arrows", label: "move" },
|
|
57580
57588
|
{ key: "enter", label: "place" },
|
|
@@ -57736,14 +57744,39 @@ var GAME_CELL_GAP = 1;
|
|
|
57736
57744
|
var GAME_BOARD_CHROME_X = 4;
|
|
57737
57745
|
var GAME_CELL_SIZES = {
|
|
57738
57746
|
large: { width: 9, height: 5 },
|
|
57739
|
-
|
|
57747
|
+
medium: { width: 7, height: 4 },
|
|
57748
|
+
small: { width: 5, height: 3 },
|
|
57749
|
+
tiny: { width: 3, height: 2 }
|
|
57740
57750
|
};
|
|
57741
57751
|
function gameBoardWidth(cellWidth) {
|
|
57742
57752
|
return cellWidth * 3 + GAME_CELL_GAP * 2 + GAME_BOARD_CHROME_X;
|
|
57743
57753
|
}
|
|
57744
|
-
function
|
|
57745
|
-
|
|
57746
|
-
|
|
57754
|
+
function boardRows(cellHeight) {
|
|
57755
|
+
return cellHeight * 3 + 2;
|
|
57756
|
+
}
|
|
57757
|
+
function boardRegionRows(cellHeight) {
|
|
57758
|
+
return boardRows(cellHeight) + 4;
|
|
57759
|
+
}
|
|
57760
|
+
function resolveCellSize(availableWidth, availableHeight) {
|
|
57761
|
+
const candidates = [
|
|
57762
|
+
GAME_CELL_SIZES.large,
|
|
57763
|
+
GAME_CELL_SIZES.medium,
|
|
57764
|
+
GAME_CELL_SIZES.small,
|
|
57765
|
+
GAME_CELL_SIZES.tiny
|
|
57766
|
+
];
|
|
57767
|
+
for (const size of candidates) {
|
|
57768
|
+
if (gameBoardWidth(size.width) <= availableWidth && boardRegionRows(size.height) <= availableHeight) {
|
|
57769
|
+
return size;
|
|
57770
|
+
}
|
|
57771
|
+
}
|
|
57772
|
+
return GAME_CELL_SIZES.tiny;
|
|
57773
|
+
}
|
|
57774
|
+
function resolveGameBudget(availableWidth, bodyRows) {
|
|
57775
|
+
const boardBudgetRows = Math.max(1, bodyRows - PANEL_MIN_ROWS);
|
|
57776
|
+
const cellSize = resolveCellSize(availableWidth, boardBudgetRows);
|
|
57777
|
+
const boardUsedRows = boardRegionRows(cellSize.height);
|
|
57778
|
+
const promptRows = Math.max(PROMPT_MIN_ROWS, Math.min(PROMPT_MAX_ROWS, bodyRows - PANEL_FIXED_ROWS - boardUsedRows));
|
|
57779
|
+
return { cellSize, boardUsedRows, promptRows, boardBudgetRows };
|
|
57747
57780
|
}
|
|
57748
57781
|
|
|
57749
57782
|
// src/tui/games/tic-tac-toe/render.ts
|
|
@@ -57763,7 +57796,7 @@ function render2(state, ctx) {
|
|
|
57763
57796
|
const core = ctx.core;
|
|
57764
57797
|
const r = ctx.renderer;
|
|
57765
57798
|
const theme = ctx.theme;
|
|
57766
|
-
const cellSize = resolveCellSize(ctx.width);
|
|
57799
|
+
const cellSize = resolveCellSize(ctx.width, ctx.height);
|
|
57767
57800
|
const wrap2 = new core.BoxRenderable(r, {
|
|
57768
57801
|
id: "game-wrap",
|
|
57769
57802
|
width: "100%",
|
|
@@ -57925,12 +57958,6 @@ function renderAgentPanel(game, parent, core, renderer, args2) {
|
|
|
57925
57958
|
paddingRight: 1,
|
|
57926
57959
|
...extra
|
|
57927
57960
|
});
|
|
57928
|
-
const statRow = (owner, label, value, id, valueFg = theme.text) => {
|
|
57929
|
-
const rowBox = box({ flexDirection: "row", gap: 1 });
|
|
57930
|
-
rowBox.add(text({ content: label, fg: theme.muted }));
|
|
57931
|
-
rowBox.add(text({ id, content: value, fg: valueFg }));
|
|
57932
|
-
owner.add(rowBox);
|
|
57933
|
-
};
|
|
57934
57961
|
const idle = args2.notice === undefined || args2.notice === "";
|
|
57935
57962
|
const statusCard = card("game-status-card", { width: "100%", marginTop: 1 });
|
|
57936
57963
|
statusCard.add(text({
|
|
@@ -57938,12 +57965,35 @@ function renderAgentPanel(game, parent, core, renderer, args2) {
|
|
|
57938
57965
|
content: args2.modelBusy ? "agent is thinking\u2026" : idle ? "waiting for your move" : args2.notice,
|
|
57939
57966
|
fg: args2.modelBusy ? theme.focus : idle ? theme.text : theme.error
|
|
57940
57967
|
}));
|
|
57968
|
+
const lt = args2.lastTurn;
|
|
57969
|
+
const tot = args2.totals;
|
|
57970
|
+
const shownModel = lt !== undefined && lt.provider !== "\u2013" ? truncate4(`${lt.provider}/${lt.model}`, MODEL_MAX) : args2.modelParam;
|
|
57971
|
+
statusCard.add(text({ id: "game-stats-model", content: `model: ${shownModel}`, fg: theme.muted }));
|
|
57972
|
+
const lastCore = lt === undefined ? "no turns yet" : `${formatMs(lt.totalMs)} \xB7 in ${formatTokens(lt.inputTokens)}/out ${formatTokens(lt.outputTokens)}`;
|
|
57973
|
+
const flags = [];
|
|
57974
|
+
if (lt?.reasoning) {
|
|
57975
|
+
flags.push("reasoning");
|
|
57976
|
+
}
|
|
57977
|
+
if (lt?.localFallback) {
|
|
57978
|
+
flags.push("fallback");
|
|
57979
|
+
}
|
|
57980
|
+
if (lt?.error) {
|
|
57981
|
+
flags.push("error");
|
|
57982
|
+
}
|
|
57983
|
+
statusCard.add(text({
|
|
57984
|
+
id: "game-stats-line",
|
|
57985
|
+
content: `last: ${lastCore}${flags.length > 0 ? ` \xB7 ${flags.join(", ")}` : ""} \xB7 session: ${tot.turns} turn${tot.turns === 1 ? "" : "s"} \xB7 ${tot.localFallbacks} fb \xB7 ${tot.errors} err \xB7 in ${formatTokens(tot.inputTokens)}/out ${formatTokens(tot.outputTokens)}`,
|
|
57986
|
+
fg: theme.muted
|
|
57987
|
+
}));
|
|
57941
57988
|
parent.add(statusCard);
|
|
57942
57989
|
const sysCard = new core.ScrollBoxRenderable(renderer, {
|
|
57943
57990
|
id: "game-system-card",
|
|
57944
57991
|
width: "100%",
|
|
57945
|
-
|
|
57946
|
-
minHeight:
|
|
57992
|
+
height: args2.promptRows,
|
|
57993
|
+
minHeight: args2.promptRows,
|
|
57994
|
+
maxHeight: args2.promptRows,
|
|
57995
|
+
flexShrink: 0,
|
|
57996
|
+
flexGrow: 0,
|
|
57947
57997
|
marginTop: 1,
|
|
57948
57998
|
border: true,
|
|
57949
57999
|
borderStyle: "rounded",
|
|
@@ -57954,41 +58004,11 @@ function renderAgentPanel(game, parent, core, renderer, args2) {
|
|
|
57954
58004
|
scrollY: true,
|
|
57955
58005
|
contentOptions: { flexDirection: "column" }
|
|
57956
58006
|
});
|
|
58007
|
+
sysCard.add(text({ id: "game-user-title", content: "your turn prompt (board)", fg: theme.muted }));
|
|
58008
|
+
sysCard.add(text({ id: "game-user-prompt", content: args2.userPrompt, fg: theme.muted }));
|
|
57957
58009
|
sysCard.add(text({ id: "game-system-title", content: "system prompt", fg: theme.muted }));
|
|
57958
58010
|
sysCard.add(text({ id: "game-system", content: game.systemPrompt(), fg: theme.muted }));
|
|
57959
58011
|
parent.add(sysCard);
|
|
57960
|
-
const lt = args2.lastTurn;
|
|
57961
|
-
const tot = args2.totals;
|
|
57962
|
-
const statsRow = box({ id: "game-stats-row", width: "100%", flexDirection: "row", gap: 1, marginTop: 1 });
|
|
57963
|
-
const lastTurnCard = card("game-last-turn", { flexGrow: 1, flexShrink: 0 });
|
|
57964
|
-
lastTurnCard.add(text({ id: "game-last-turn-title", content: "last turn", fg: theme.muted }));
|
|
57965
|
-
if (lt === undefined) {
|
|
57966
|
-
lastTurnCard.add(text({ id: "game-stats-empty", content: "no turns yet", fg: theme.muted }));
|
|
57967
|
-
} else {
|
|
57968
|
-
const model = lt.provider === "\u2013" ? "\u2013" : truncate4(`${lt.provider}/${lt.model}`, MODEL_MAX);
|
|
57969
|
-
statRow(lastTurnCard, "model", model, "game-stats-model");
|
|
57970
|
-
statRow(lastTurnCard, "first byte", formatMs(lt.latencyMs), "game-stats-latency");
|
|
57971
|
-
statRow(lastTurnCard, "total", formatMs(lt.totalMs), "game-stats-total");
|
|
57972
|
-
statRow(lastTurnCard, "tokens", `in ${formatTokens(lt.inputTokens)} \xB7 out ${formatTokens(lt.outputTokens)}`, "game-stats-tokens");
|
|
57973
|
-
if (lt.reasoning) {
|
|
57974
|
-
statRow(lastTurnCard, "reasoning", "yes", "game-stats-reasoning", theme.focus);
|
|
57975
|
-
}
|
|
57976
|
-
if (lt.localFallback) {
|
|
57977
|
-
statRow(lastTurnCard, "fallback", "local", "game-stats-fallback", theme.error);
|
|
57978
|
-
}
|
|
57979
|
-
if (lt.error) {
|
|
57980
|
-
statRow(lastTurnCard, "error", "yes", "game-stats-error", theme.error);
|
|
57981
|
-
}
|
|
57982
|
-
}
|
|
57983
|
-
const sessionCard = card("game-session", { flexGrow: 1, flexShrink: 0 });
|
|
57984
|
-
sessionCard.add(text({ id: "game-session-title", content: "session", fg: theme.muted }));
|
|
57985
|
-
statRow(sessionCard, "turns", String(tot.turns), "game-session-turns");
|
|
57986
|
-
statRow(sessionCard, "fallbacks", String(tot.localFallbacks), "game-session-fallbacks");
|
|
57987
|
-
statRow(sessionCard, "errors", String(tot.errors), "game-session-errors");
|
|
57988
|
-
statRow(sessionCard, "tokens", `in ${formatTokens(tot.inputTokens)} \xB7 out ${formatTokens(tot.outputTokens)}`, "game-session-tokens");
|
|
57989
|
-
statsRow.add(lastTurnCard);
|
|
57990
|
-
statsRow.add(sessionCard);
|
|
57991
|
-
parent.add(statsRow);
|
|
57992
58012
|
}
|
|
57993
58013
|
|
|
57994
58014
|
// src/tui/games/otui.ts
|
|
@@ -58023,6 +58043,8 @@ function presentGamesModal(openModalFn, otui, chrome, options = {}, registry = c
|
|
|
58023
58043
|
let unsubscribeKey;
|
|
58024
58044
|
let bodyRef;
|
|
58025
58045
|
let bodyWidth = 0;
|
|
58046
|
+
let bodyHeight = 0;
|
|
58047
|
+
const modelParam = `${options.provider ?? "auto"}/${options.model ?? "auto"}`;
|
|
58026
58048
|
const stateOf = (id) => {
|
|
58027
58049
|
const game = registry.get(id);
|
|
58028
58050
|
if (game === undefined) {
|
|
@@ -58053,19 +58075,24 @@ function presentGamesModal(openModalFn, otui, chrome, options = {}, registry = c
|
|
|
58053
58075
|
return;
|
|
58054
58076
|
}
|
|
58055
58077
|
const state = stateOf(activeId);
|
|
58078
|
+
const budget = resolveGameBudget(bodyWidth, Math.max(1, bodyHeight));
|
|
58056
58079
|
const ctx = {
|
|
58057
58080
|
core,
|
|
58058
58081
|
renderer,
|
|
58059
58082
|
theme: getTheme(),
|
|
58060
58083
|
parent: bodyRef,
|
|
58061
|
-
width: bodyWidth
|
|
58084
|
+
width: bodyWidth,
|
|
58085
|
+
height: budget.boardBudgetRows
|
|
58062
58086
|
};
|
|
58063
58087
|
game.render(state, ctx);
|
|
58064
58088
|
renderAgentPanel(game, bodyRef, core, renderer, {
|
|
58065
58089
|
notice,
|
|
58066
58090
|
modelBusy,
|
|
58067
58091
|
lastTurn: lastTurn.get(activeId),
|
|
58068
|
-
totals: totalsOf(activeId)
|
|
58092
|
+
totals: totalsOf(activeId),
|
|
58093
|
+
userPrompt: game.stateForModel(state),
|
|
58094
|
+
promptRows: budget.promptRows,
|
|
58095
|
+
modelParam
|
|
58069
58096
|
});
|
|
58070
58097
|
};
|
|
58071
58098
|
const restart = () => {
|
|
@@ -58172,6 +58199,7 @@ function presentGamesModal(openModalFn, otui, chrome, options = {}, registry = c
|
|
|
58172
58199
|
}
|
|
58173
58200
|
bodyRef = body;
|
|
58174
58201
|
bodyWidth = ctx.width;
|
|
58202
|
+
bodyHeight = ctx.height;
|
|
58175
58203
|
paint();
|
|
58176
58204
|
},
|
|
58177
58205
|
onClose: () => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mrciphersmith/keryx",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.65",
|
|
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": {
|