@mrciphersmith/keryx 0.2.58 → 0.2.59
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 +89 -33
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -53454,7 +53454,7 @@ import { spawnSync as spawnSync2 } from "child_process";
|
|
|
53454
53454
|
// package.json
|
|
53455
53455
|
var package_default = {
|
|
53456
53456
|
name: "@mrciphersmith/keryx",
|
|
53457
|
-
version: "0.2.
|
|
53457
|
+
version: "0.2.59",
|
|
53458
53458
|
description: "Version-controlled project context for AI coding agents: code graph, architecture wiki, project memory, relevant tests, quality signals, and task flows.",
|
|
53459
53459
|
private: false,
|
|
53460
53460
|
publishConfig: {
|
|
@@ -57519,6 +57519,9 @@ var GAME_FOOTER = [
|
|
|
57519
57519
|
{ key: "r", label: "new game" },
|
|
57520
57520
|
{ key: "esc", label: "minimize" }
|
|
57521
57521
|
];
|
|
57522
|
+
var GAME_CELL_WIDTH = 5;
|
|
57523
|
+
var GAME_CELL_HEIGHT = 3;
|
|
57524
|
+
var GAME_CELL_GAP = 1;
|
|
57522
57525
|
function asOtui2(otui) {
|
|
57523
57526
|
if (otui === undefined || otui === null) {
|
|
57524
57527
|
return;
|
|
@@ -57551,31 +57554,34 @@ function presentGame(openModalFn, otui, chrome, options = {}) {
|
|
|
57551
57554
|
const renderer = options.renderer;
|
|
57552
57555
|
const core = asOtui2(otui);
|
|
57553
57556
|
let handle;
|
|
57554
|
-
let
|
|
57557
|
+
let cells = [];
|
|
57555
57558
|
let statusBox;
|
|
57556
|
-
let
|
|
57559
|
+
let noticeBox;
|
|
57557
57560
|
let cursor = 4;
|
|
57561
|
+
let notice;
|
|
57558
57562
|
let unsubscribeKey;
|
|
57559
57563
|
const paint = () => {
|
|
57560
|
-
if (
|
|
57564
|
+
if (statusBox === undefined || noticeBox === undefined || cells.length !== 9) {
|
|
57561
57565
|
return;
|
|
57562
57566
|
}
|
|
57563
57567
|
const theme = getTheme();
|
|
57564
|
-
clearTranscriptChildren(boardBox);
|
|
57565
57568
|
statusBox.content = statusText(currentGame);
|
|
57566
|
-
|
|
57567
|
-
|
|
57568
|
-
|
|
57569
|
-
|
|
57570
|
-
|
|
57571
|
-
|
|
57572
|
-
|
|
57573
|
-
|
|
57574
|
-
|
|
57575
|
-
|
|
57576
|
-
|
|
57577
|
-
|
|
57578
|
-
|
|
57569
|
+
statusBox.fg = theme.text;
|
|
57570
|
+
if (modelBusy) {
|
|
57571
|
+
noticeBox.content = "agent is thinking\u2026";
|
|
57572
|
+
noticeBox.fg = theme.focus;
|
|
57573
|
+
} else {
|
|
57574
|
+
noticeBox.content = notice ?? "";
|
|
57575
|
+
noticeBox.fg = theme.error;
|
|
57576
|
+
}
|
|
57577
|
+
for (const [index, view] of cells.entries()) {
|
|
57578
|
+
const cell = currentGame.board[index] ?? null;
|
|
57579
|
+
const isCursor = index === cursor && !isGameOver(currentGame) && !modelBusy;
|
|
57580
|
+
const won = currentGame.winLine?.includes(index) === true;
|
|
57581
|
+
view.text.content = cell ?? "\xB7";
|
|
57582
|
+
view.text.fg = cell === null ? theme.muted : markColor(cell);
|
|
57583
|
+
view.box.borderColor = won ? markColor(currentGame.winner ?? "X") : isCursor ? theme.focus : theme.border;
|
|
57584
|
+
view.box.backgroundColor = isCursor || won ? theme.highlight : undefined;
|
|
57579
57585
|
}
|
|
57580
57586
|
};
|
|
57581
57587
|
const applyModelMove = async () => {
|
|
@@ -57583,6 +57589,7 @@ function presentGame(openModalFn, otui, chrome, options = {}) {
|
|
|
57583
57589
|
return;
|
|
57584
57590
|
}
|
|
57585
57591
|
modelBusy = true;
|
|
57592
|
+
notice = undefined;
|
|
57586
57593
|
paint();
|
|
57587
57594
|
const result = await modelMove(currentGame.board, {
|
|
57588
57595
|
...options.provider !== undefined ? { provider: options.provider } : {},
|
|
@@ -57600,9 +57607,7 @@ function presentGame(openModalFn, otui, chrome, options = {}) {
|
|
|
57600
57607
|
}
|
|
57601
57608
|
} else {
|
|
57602
57609
|
currentGame = { ...currentGame, turn: "X" };
|
|
57603
|
-
|
|
57604
|
-
statusBox !== undefined && (statusBox.content = `agent: ${result.error}`);
|
|
57605
|
-
}
|
|
57610
|
+
notice = result.error === undefined ? undefined : `agent: ${result.error}`;
|
|
57606
57611
|
}
|
|
57607
57612
|
paint();
|
|
57608
57613
|
};
|
|
@@ -57615,6 +57620,7 @@ function presentGame(openModalFn, otui, chrome, options = {}) {
|
|
|
57615
57620
|
return;
|
|
57616
57621
|
}
|
|
57617
57622
|
currentGame = placed;
|
|
57623
|
+
notice = undefined;
|
|
57618
57624
|
paint();
|
|
57619
57625
|
if (!isGameOver(currentGame) && currentGame.turn === "O") {
|
|
57620
57626
|
applyModelMove();
|
|
@@ -57632,6 +57638,7 @@ function presentGame(openModalFn, otui, chrome, options = {}) {
|
|
|
57632
57638
|
const restart = () => {
|
|
57633
57639
|
resetGame();
|
|
57634
57640
|
cursor = 4;
|
|
57641
|
+
notice = undefined;
|
|
57635
57642
|
paint();
|
|
57636
57643
|
};
|
|
57637
57644
|
handle = openModalFn(otui, chrome, {
|
|
@@ -57647,10 +57654,26 @@ function presentGame(openModalFn, otui, chrome, options = {}) {
|
|
|
57647
57654
|
return;
|
|
57648
57655
|
}
|
|
57649
57656
|
const theme = getTheme();
|
|
57650
|
-
const
|
|
57657
|
+
const r = renderer;
|
|
57658
|
+
const wrap2 = new core.BoxRenderable(r, {
|
|
57659
|
+
id: "game-wrap",
|
|
57660
|
+
width: "100%",
|
|
57661
|
+
flexDirection: "column",
|
|
57662
|
+
alignItems: "center"
|
|
57663
|
+
});
|
|
57664
|
+
const legend = new core.BoxRenderable(r, {
|
|
57665
|
+
id: "game-legend",
|
|
57666
|
+
flexDirection: "row",
|
|
57667
|
+
marginBottom: 1
|
|
57668
|
+
});
|
|
57669
|
+
legend.add(new core.TextRenderable(r, { id: "game-legend-x", content: "X you", fg: theme.ok }));
|
|
57670
|
+
legend.add(new core.TextRenderable(r, { id: "game-legend-sep", content: " \xB7 ", fg: theme.muted }));
|
|
57671
|
+
legend.add(new core.TextRenderable(r, { id: "game-legend-o", content: "O model", fg: theme.error }));
|
|
57672
|
+
wrap2.add(legend);
|
|
57673
|
+
const board = new core.BoxRenderable(r, {
|
|
57651
57674
|
id: "game-board",
|
|
57652
|
-
width: 15,
|
|
57653
57675
|
flexDirection: "column",
|
|
57676
|
+
flexShrink: 0,
|
|
57654
57677
|
border: true,
|
|
57655
57678
|
borderStyle: "rounded",
|
|
57656
57679
|
borderColor: theme.border,
|
|
@@ -57658,22 +57681,55 @@ function presentGame(openModalFn, otui, chrome, options = {}) {
|
|
|
57658
57681
|
paddingLeft: 1,
|
|
57659
57682
|
paddingRight: 1
|
|
57660
57683
|
});
|
|
57661
|
-
|
|
57662
|
-
|
|
57663
|
-
|
|
57684
|
+
cells = [];
|
|
57685
|
+
for (let row = 0;row < 3; row++) {
|
|
57686
|
+
const rowBox = new core.BoxRenderable(r, {
|
|
57687
|
+
id: `game-row-${row}`,
|
|
57688
|
+
flexDirection: "row",
|
|
57689
|
+
flexShrink: 0,
|
|
57690
|
+
gap: GAME_CELL_GAP
|
|
57691
|
+
});
|
|
57692
|
+
for (let col = 0;col < 3; col++) {
|
|
57693
|
+
const index = row * 3 + col;
|
|
57694
|
+
const cellBox = new core.BoxRenderable(r, {
|
|
57695
|
+
id: `game-cell-${index}`,
|
|
57696
|
+
width: GAME_CELL_WIDTH,
|
|
57697
|
+
height: GAME_CELL_HEIGHT,
|
|
57698
|
+
flexShrink: 0,
|
|
57699
|
+
flexGrow: 0,
|
|
57700
|
+
flexDirection: "row",
|
|
57701
|
+
alignItems: "center",
|
|
57702
|
+
justifyContent: "center",
|
|
57703
|
+
border: true,
|
|
57704
|
+
borderStyle: "rounded",
|
|
57705
|
+
borderColor: theme.border
|
|
57706
|
+
});
|
|
57707
|
+
const cellText = new core.TextRenderable(r, {
|
|
57708
|
+
id: `game-cell-text-${index}`,
|
|
57709
|
+
content: "\xB7",
|
|
57710
|
+
fg: theme.muted
|
|
57711
|
+
});
|
|
57712
|
+
cellBox.add(cellText);
|
|
57713
|
+
rowBox.add(cellBox);
|
|
57714
|
+
cells.push({ box: cellBox, text: cellText });
|
|
57715
|
+
}
|
|
57716
|
+
board.add(rowBox);
|
|
57717
|
+
}
|
|
57718
|
+
wrap2.add(board);
|
|
57719
|
+
const status = new core.TextRenderable(r, {
|
|
57664
57720
|
id: "game-status",
|
|
57665
57721
|
content: "",
|
|
57666
57722
|
marginTop: 1
|
|
57667
57723
|
});
|
|
57668
57724
|
statusBox = status;
|
|
57669
|
-
|
|
57670
|
-
const
|
|
57671
|
-
id: "game-
|
|
57672
|
-
content: ""
|
|
57673
|
-
marginTop: 1
|
|
57725
|
+
wrap2.add(status);
|
|
57726
|
+
const noticeText = new core.TextRenderable(r, {
|
|
57727
|
+
id: "game-notice",
|
|
57728
|
+
content: ""
|
|
57674
57729
|
});
|
|
57675
|
-
|
|
57676
|
-
|
|
57730
|
+
noticeBox = noticeText;
|
|
57731
|
+
wrap2.add(noticeText);
|
|
57732
|
+
parent.add(wrap2);
|
|
57677
57733
|
paint();
|
|
57678
57734
|
},
|
|
57679
57735
|
onClose: () => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mrciphersmith/keryx",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.59",
|
|
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": {
|