@triedotdev/mcp 1.0.120 → 1.0.121
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.
|
@@ -288,11 +288,11 @@ var StreamingManager = class {
|
|
|
288
288
|
|
|
289
289
|
// src/cli/dashboard/index.ts
|
|
290
290
|
import { render } from "ink";
|
|
291
|
-
import
|
|
291
|
+
import React10 from "react";
|
|
292
292
|
|
|
293
293
|
// src/cli/dashboard/App.tsx
|
|
294
294
|
import { useState as useState2, useEffect as useEffect3, useCallback as useCallback6, useRef as useRef2 } from "react";
|
|
295
|
-
import { Box as
|
|
295
|
+
import { Box as Box13, useInput as useInput9, useApp } from "ink";
|
|
296
296
|
|
|
297
297
|
// src/cli/dashboard/state.tsx
|
|
298
298
|
import React, { createContext, useContext, useReducer } from "react";
|
|
@@ -879,6 +879,7 @@ function Header() {
|
|
|
879
879
|
}
|
|
880
880
|
|
|
881
881
|
// src/cli/dashboard/components/Footer.tsx
|
|
882
|
+
import React2 from "react";
|
|
882
883
|
import { Box as Box2, Text as Text2, useStdout as useStdout2 } from "ink";
|
|
883
884
|
import { jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
884
885
|
var VIEW_LABELS = {
|
|
@@ -901,20 +902,20 @@ var VIEW_SHORT = {
|
|
|
901
902
|
};
|
|
902
903
|
var TAB_VIEWS = ["overview", "memory", "goals", "hypotheses", "agent", "chat"];
|
|
903
904
|
var CONTEXT_HINTS = {
|
|
904
|
-
goals: "j/k nav \xB7 a add \xB7 r run check \xB7 enter complete \xB7 d delete \xB7 x clear achieved",
|
|
905
|
-
hypotheses: "j/k nav \xB7 a add \xB7 r run check \xB7 v validate \xB7 x invalidate",
|
|
906
|
-
agent: "j/k nav \xB7 enter expand \xB7 d dismiss",
|
|
907
|
-
memory: "j/k nav \xB7 enter expand",
|
|
908
|
-
chat: "type to ask \xB7 enter send \xB7 esc clear",
|
|
909
|
-
rawlog: "n/p pages \xB7 b back"
|
|
905
|
+
goals: "j/k nav \xB7 a add \xB7 r run check \xB7 enter complete \xB7 d delete \xB7 x clear achieved \xB7 / help",
|
|
906
|
+
hypotheses: "j/k nav \xB7 a add \xB7 r run check \xB7 v validate \xB7 x invalidate \xB7 / help",
|
|
907
|
+
agent: "j/k nav \xB7 enter expand \xB7 d dismiss \xB7 / help",
|
|
908
|
+
memory: "j/k nav \xB7 enter expand \xB7 / help",
|
|
909
|
+
chat: "type to ask \xB7 enter send \xB7 esc clear \xB7 / help",
|
|
910
|
+
rawlog: "n/p pages \xB7 b back \xB7 / help"
|
|
910
911
|
};
|
|
911
912
|
var CONTEXT_HINTS_SHORT = {
|
|
912
|
-
goals: "j/k a r d x",
|
|
913
|
-
hypotheses: "j/k a r v x",
|
|
914
|
-
agent: "j/k enter d",
|
|
915
|
-
memory: "j/k enter",
|
|
916
|
-
chat: "enter esc",
|
|
917
|
-
rawlog: "n/p b"
|
|
913
|
+
goals: "j/k a r d x /",
|
|
914
|
+
hypotheses: "j/k a r v x /",
|
|
915
|
+
agent: "j/k enter d /",
|
|
916
|
+
memory: "j/k enter /",
|
|
917
|
+
chat: "enter esc /",
|
|
918
|
+
rawlog: "n/p b /"
|
|
918
919
|
};
|
|
919
920
|
function Footer() {
|
|
920
921
|
const { state } = useDashboard();
|
|
@@ -932,25 +933,23 @@ function Footer() {
|
|
|
932
933
|
hints = narrow ? "enter esc" : "enter save \xB7 esc cancel";
|
|
933
934
|
} else {
|
|
934
935
|
const hintMap = narrow ? CONTEXT_HINTS_SHORT : CONTEXT_HINTS;
|
|
935
|
-
hints = hintMap[view] || (narrow ? "s n/p" : "n/p pages \xB7 s settings");
|
|
936
|
+
hints = hintMap[view] || (narrow ? "s n/p /" : "n/p pages \xB7 s settings \xB7 / help");
|
|
936
937
|
}
|
|
937
938
|
if (veryNarrow) {
|
|
938
939
|
return /* @__PURE__ */ jsxs2(Box2, { flexDirection: "column", paddingX: 1, children: [
|
|
939
|
-
/* @__PURE__ */ jsx3(Box2, { gap:
|
|
940
|
+
/* @__PURE__ */ jsx3(Box2, { gap: 0, children: TAB_VIEWS.map((v, idx) => {
|
|
940
941
|
const isAgent = v === "agent";
|
|
941
942
|
const isCurrent = v === view;
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
return /* @__PURE__ */ jsxs2(Text2, { color: "yellow", bold: true, children: [
|
|
943
|
+
const isLast = idx === TAB_VIEWS.length - 1;
|
|
944
|
+
return /* @__PURE__ */ jsxs2(React2.Fragment, { children: [
|
|
945
|
+
isCurrent ? /* @__PURE__ */ jsx3(Text2, { color: "green", bold: true, children: labels[v] }) : isAgent && hasUnreadNudges ? /* @__PURE__ */ jsxs2(Text2, { color: "yellow", bold: true, children: [
|
|
946
946
|
labels[v],
|
|
947
947
|
" (",
|
|
948
948
|
unreadNudgesCount,
|
|
949
949
|
")"
|
|
950
|
-
] }, v)
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
}
|
|
950
|
+
] }) : /* @__PURE__ */ jsx3(Text2, { dimColor: true, children: labels[v] }),
|
|
951
|
+
!isLast && /* @__PURE__ */ jsx3(Text2, { dimColor: true, children: " \xB7 " })
|
|
952
|
+
] }, v);
|
|
954
953
|
}) }),
|
|
955
954
|
/* @__PURE__ */ jsxs2(Text2, { dimColor: true, children: [
|
|
956
955
|
hints,
|
|
@@ -959,21 +958,19 @@ function Footer() {
|
|
|
959
958
|
] });
|
|
960
959
|
}
|
|
961
960
|
return /* @__PURE__ */ jsxs2(Box2, { paddingX: 1, justifyContent: "space-between", children: [
|
|
962
|
-
/* @__PURE__ */ jsx3(Box2, { gap:
|
|
961
|
+
/* @__PURE__ */ jsx3(Box2, { gap: 0, children: TAB_VIEWS.map((v, idx) => {
|
|
963
962
|
const isAgent = v === "agent";
|
|
964
963
|
const isCurrent = v === view;
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
return /* @__PURE__ */ jsxs2(Text2, { color: "yellow", bold: true, children: [
|
|
964
|
+
const isLast = idx === TAB_VIEWS.length - 1;
|
|
965
|
+
return /* @__PURE__ */ jsxs2(React2.Fragment, { children: [
|
|
966
|
+
isCurrent ? /* @__PURE__ */ jsx3(Text2, { color: "green", bold: true, children: labels[v] }) : isAgent && hasUnreadNudges ? /* @__PURE__ */ jsxs2(Text2, { color: "yellow", bold: true, children: [
|
|
969
967
|
labels[v],
|
|
970
968
|
" (",
|
|
971
969
|
unreadNudgesCount,
|
|
972
970
|
")"
|
|
973
|
-
] }, v)
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
}
|
|
971
|
+
] }) : /* @__PURE__ */ jsx3(Text2, { dimColor: true, children: labels[v] }),
|
|
972
|
+
!isLast && /* @__PURE__ */ jsx3(Text2, { dimColor: true, children: " \xB7 " })
|
|
973
|
+
] }, v);
|
|
977
974
|
}) }),
|
|
978
975
|
/* @__PURE__ */ jsxs2(Text2, { dimColor: true, children: [
|
|
979
976
|
hints,
|
|
@@ -1248,9 +1245,109 @@ function ConfigDialog({ onClose }) {
|
|
|
1248
1245
|
] });
|
|
1249
1246
|
}
|
|
1250
1247
|
|
|
1248
|
+
// src/cli/dashboard/components/HelpDialog.tsx
|
|
1249
|
+
import { Box as Box5, Text as Text5 } from "ink";
|
|
1250
|
+
import { jsx as jsx6, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
1251
|
+
var VIEW_HELP = {
|
|
1252
|
+
overview: [
|
|
1253
|
+
{ key: "tab", description: "Navigate between views" },
|
|
1254
|
+
{ key: "g", description: "Go to Nudges" },
|
|
1255
|
+
{ key: "o", description: "Go to Goals" },
|
|
1256
|
+
{ key: "y", description: "Go to Hypotheses" },
|
|
1257
|
+
{ key: "t", description: "Go to Ledger" },
|
|
1258
|
+
{ key: "c", description: "Go to Chat" },
|
|
1259
|
+
{ key: "l", description: "Go to Raw Log" },
|
|
1260
|
+
{ key: "s", description: "Open Settings" },
|
|
1261
|
+
{ key: "q / esc", description: "Quit" }
|
|
1262
|
+
],
|
|
1263
|
+
agent: [
|
|
1264
|
+
{ key: "j / \u2193", description: "Move down" },
|
|
1265
|
+
{ key: "k / \u2191", description: "Move up" },
|
|
1266
|
+
{ key: "enter", description: "Expand selected nudge" },
|
|
1267
|
+
{ key: "d", description: "Dismiss selected nudge" },
|
|
1268
|
+
{ key: "tab", description: "Navigate between views" },
|
|
1269
|
+
{ key: "s", description: "Open Settings" },
|
|
1270
|
+
{ key: "q / esc", description: "Quit" }
|
|
1271
|
+
],
|
|
1272
|
+
goals: [
|
|
1273
|
+
{ key: "j / \u2193", description: "Move down" },
|
|
1274
|
+
{ key: "k / \u2191", description: "Move up" },
|
|
1275
|
+
{ key: "a", description: "Add new goal" },
|
|
1276
|
+
{ key: "r", description: "Run check on selected goal" },
|
|
1277
|
+
{ key: "enter", description: "Mark goal as complete" },
|
|
1278
|
+
{ key: "d", description: "Delete selected goal" },
|
|
1279
|
+
{ key: "x", description: "Clear all achieved goals" },
|
|
1280
|
+
{ key: "tab", description: "Navigate between views" },
|
|
1281
|
+
{ key: "s", description: "Open Settings" },
|
|
1282
|
+
{ key: "q / esc", description: "Quit" }
|
|
1283
|
+
],
|
|
1284
|
+
hypotheses: [
|
|
1285
|
+
{ key: "j / \u2193", description: "Move down" },
|
|
1286
|
+
{ key: "k / \u2191", description: "Move up" },
|
|
1287
|
+
{ key: "a", description: "Add new hypothesis" },
|
|
1288
|
+
{ key: "r", description: "Run check on selected hypothesis" },
|
|
1289
|
+
{ key: "v", description: "Mark hypothesis as validated" },
|
|
1290
|
+
{ key: "x", description: "Mark hypothesis as invalidated" },
|
|
1291
|
+
{ key: "tab", description: "Navigate between views" },
|
|
1292
|
+
{ key: "s", description: "Open Settings" },
|
|
1293
|
+
{ key: "q / esc", description: "Quit" }
|
|
1294
|
+
],
|
|
1295
|
+
memory: [
|
|
1296
|
+
{ key: "j / \u2193", description: "Move down" },
|
|
1297
|
+
{ key: "k / \u2191", description: "Move up" },
|
|
1298
|
+
{ key: "enter", description: "Expand selected item" },
|
|
1299
|
+
{ key: "tab", description: "Navigate between views" },
|
|
1300
|
+
{ key: "s", description: "Open Settings" },
|
|
1301
|
+
{ key: "q / esc", description: "Quit" }
|
|
1302
|
+
],
|
|
1303
|
+
chat: [
|
|
1304
|
+
{ key: "type", description: "Enter message" },
|
|
1305
|
+
{ key: "enter", description: "Send message" },
|
|
1306
|
+
{ key: "esc", description: "Clear input" },
|
|
1307
|
+
{ key: "tab", description: "Navigate between views" },
|
|
1308
|
+
{ key: "q", description: "Quit (press twice if input active)" }
|
|
1309
|
+
],
|
|
1310
|
+
rawlog: [
|
|
1311
|
+
{ key: "n", description: "Next page" },
|
|
1312
|
+
{ key: "p", description: "Previous page" },
|
|
1313
|
+
{ key: "b", description: "Back to previous view" },
|
|
1314
|
+
{ key: "tab", description: "Navigate between views" },
|
|
1315
|
+
{ key: "s", description: "Open Settings" },
|
|
1316
|
+
{ key: "q / esc", description: "Quit" }
|
|
1317
|
+
]
|
|
1318
|
+
};
|
|
1319
|
+
function HelpDialog({ view, onClose }) {
|
|
1320
|
+
const shortcuts = VIEW_HELP[view] || VIEW_HELP.overview;
|
|
1321
|
+
const viewName = view.charAt(0).toUpperCase() + view.slice(1);
|
|
1322
|
+
return /* @__PURE__ */ jsxs5(
|
|
1323
|
+
Box5,
|
|
1324
|
+
{
|
|
1325
|
+
flexDirection: "column",
|
|
1326
|
+
borderStyle: "round",
|
|
1327
|
+
borderColor: "cyan",
|
|
1328
|
+
paddingX: 2,
|
|
1329
|
+
paddingY: 1,
|
|
1330
|
+
width: "80%",
|
|
1331
|
+
alignSelf: "center",
|
|
1332
|
+
marginTop: 2,
|
|
1333
|
+
children: [
|
|
1334
|
+
/* @__PURE__ */ jsxs5(Text5, { bold: true, color: "cyan", children: [
|
|
1335
|
+
viewName,
|
|
1336
|
+
" View - Keyboard Shortcuts"
|
|
1337
|
+
] }),
|
|
1338
|
+
/* @__PURE__ */ jsx6(Box5, { marginTop: 1, flexDirection: "column", gap: 0, children: shortcuts.map(({ key, description }, idx) => /* @__PURE__ */ jsxs5(Box5, { gap: 2, children: [
|
|
1339
|
+
/* @__PURE__ */ jsx6(Box5, { width: 12, children: /* @__PURE__ */ jsx6(Text5, { color: "yellow", children: key }) }),
|
|
1340
|
+
/* @__PURE__ */ jsx6(Text5, { children: description })
|
|
1341
|
+
] }, idx)) }),
|
|
1342
|
+
/* @__PURE__ */ jsx6(Box5, { marginTop: 1, children: /* @__PURE__ */ jsx6(Text5, { dimColor: true, children: "Press / or ? again to close" }) })
|
|
1343
|
+
]
|
|
1344
|
+
}
|
|
1345
|
+
);
|
|
1346
|
+
}
|
|
1347
|
+
|
|
1251
1348
|
// src/cli/dashboard/views/OverviewView.tsx
|
|
1252
|
-
import { Box as
|
|
1253
|
-
import { Fragment, jsx as
|
|
1349
|
+
import { Box as Box6, Text as Text6, useInput as useInput2, useStdout as useStdout4 } from "ink";
|
|
1350
|
+
import { Fragment, jsx as jsx7, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
1254
1351
|
function truncate(str, max) {
|
|
1255
1352
|
return str.length > max ? str.slice(0, max - 1) + "..." : str;
|
|
1256
1353
|
}
|
|
@@ -1284,18 +1381,18 @@ function OverviewView() {
|
|
|
1284
1381
|
dispatch({ type: "DISMISS_FIX", id: activeFixes[selectedFixIndex].id });
|
|
1285
1382
|
}
|
|
1286
1383
|
});
|
|
1287
|
-
return /* @__PURE__ */
|
|
1288
|
-
/* @__PURE__ */
|
|
1384
|
+
return /* @__PURE__ */ jsxs6(Box6, { flexDirection: "column", paddingX: 1, children: [
|
|
1385
|
+
/* @__PURE__ */ jsxs6(Text6, { dimColor: true, children: [
|
|
1289
1386
|
"Scanned ",
|
|
1290
1387
|
watch.filesScannedSession,
|
|
1291
1388
|
" files ",
|
|
1292
1389
|
elapsed,
|
|
1293
1390
|
"s"
|
|
1294
1391
|
] }),
|
|
1295
|
-
watch.watching && signalExtraction.enabled && /* @__PURE__ */
|
|
1296
|
-
/* @__PURE__ */
|
|
1392
|
+
watch.watching && signalExtraction.enabled && /* @__PURE__ */ jsxs6(Text6, { wrap: "truncate", children: [
|
|
1393
|
+
/* @__PURE__ */ jsx7(Text6, { color: "green", children: "\u25CF" }),
|
|
1297
1394
|
" Signal extraction",
|
|
1298
|
-
!narrow && (signalExtraction.decisionsExtracted > 0 || signalExtraction.factsExtracted > 0 || signalExtraction.blockersExtracted > 0) && /* @__PURE__ */
|
|
1395
|
+
!narrow && (signalExtraction.decisionsExtracted > 0 || signalExtraction.factsExtracted > 0 || signalExtraction.blockersExtracted > 0) && /* @__PURE__ */ jsxs6(Text6, { dimColor: true, children: [
|
|
1299
1396
|
" ",
|
|
1300
1397
|
signalExtraction.decisionsExtracted,
|
|
1301
1398
|
"d \xB7 ",
|
|
@@ -1309,73 +1406,73 @@ function OverviewView() {
|
|
|
1309
1406
|
const filename = issue.file.split("/").pop() || issue.file;
|
|
1310
1407
|
const lineNum = issue.line ? `:${issue.line}` : "";
|
|
1311
1408
|
const issueLen = Math.max(15, contentWidth - filename.length - 6);
|
|
1312
|
-
return /* @__PURE__ */
|
|
1313
|
-
/* @__PURE__ */
|
|
1409
|
+
return /* @__PURE__ */ jsxs6(Text6, { wrap: "truncate", children: [
|
|
1410
|
+
/* @__PURE__ */ jsx7(Text6, { color: "red", children: "\u25CF" }),
|
|
1314
1411
|
" ",
|
|
1315
|
-
/* @__PURE__ */
|
|
1316
|
-
/* @__PURE__ */
|
|
1412
|
+
/* @__PURE__ */ jsx7(Text6, { color: "red", children: truncate(issue.issue, issueLen) }),
|
|
1413
|
+
/* @__PURE__ */ jsxs6(Text6, { dimColor: true, children: [
|
|
1317
1414
|
" ",
|
|
1318
1415
|
filename,
|
|
1319
1416
|
lineNum
|
|
1320
1417
|
] })
|
|
1321
1418
|
] }, i);
|
|
1322
1419
|
}),
|
|
1323
|
-
totalIssues === 0 && criticalIssues.length === 0 && activeFixes.length === 0 && /* @__PURE__ */
|
|
1324
|
-
/* @__PURE__ */
|
|
1420
|
+
totalIssues === 0 && criticalIssues.length === 0 && activeFixes.length === 0 && /* @__PURE__ */ jsxs6(Text6, { children: [
|
|
1421
|
+
/* @__PURE__ */ jsx7(Text6, { color: "green", children: "\u25CF" }),
|
|
1325
1422
|
" No issues"
|
|
1326
1423
|
] }),
|
|
1327
|
-
activeFixes.length > 0 && /* @__PURE__ */
|
|
1328
|
-
/* @__PURE__ */
|
|
1424
|
+
activeFixes.length > 0 && /* @__PURE__ */ jsxs6(Box6, { flexDirection: "column", marginTop: 1, children: [
|
|
1425
|
+
/* @__PURE__ */ jsx7(Text6, { bold: true, children: "Goal Violations" }),
|
|
1329
1426
|
activeFixes.map((fix, i) => {
|
|
1330
1427
|
const isSelected = i === selectedFixIndex;
|
|
1331
1428
|
const confidenceColor = fix.confidence >= 90 ? "green" : fix.confidence >= 70 ? "yellow" : "red";
|
|
1332
1429
|
const shortFile = fix.file.split("/").pop() || fix.file;
|
|
1333
1430
|
const descLen = Math.max(15, contentWidth - shortFile.length - 10);
|
|
1334
|
-
return /* @__PURE__ */
|
|
1335
|
-
/* @__PURE__ */
|
|
1336
|
-
isSelected ? /* @__PURE__ */
|
|
1337
|
-
/* @__PURE__ */
|
|
1431
|
+
return /* @__PURE__ */ jsxs6(Box6, { flexDirection: "column", children: [
|
|
1432
|
+
/* @__PURE__ */ jsxs6(Text6, { wrap: "truncate", children: [
|
|
1433
|
+
isSelected ? /* @__PURE__ */ jsx7(Text6, { bold: true, color: "yellow", children: "> " }) : " ",
|
|
1434
|
+
/* @__PURE__ */ jsx7(Text6, { color: "yellow", children: "\u25CF" }),
|
|
1338
1435
|
" ",
|
|
1339
|
-
/* @__PURE__ */
|
|
1340
|
-
/* @__PURE__ */
|
|
1436
|
+
/* @__PURE__ */ jsx7(Text6, { children: truncate(fix.description, descLen) }),
|
|
1437
|
+
/* @__PURE__ */ jsxs6(Text6, { dimColor: true, children: [
|
|
1341
1438
|
" ",
|
|
1342
1439
|
shortFile
|
|
1343
1440
|
] })
|
|
1344
1441
|
] }),
|
|
1345
|
-
/* @__PURE__ */
|
|
1442
|
+
/* @__PURE__ */ jsxs6(Text6, { wrap: "truncate", children: [
|
|
1346
1443
|
" ",
|
|
1347
|
-
/* @__PURE__ */
|
|
1444
|
+
/* @__PURE__ */ jsxs6(Text6, { color: confidenceColor, bold: true, children: [
|
|
1348
1445
|
fix.confidence,
|
|
1349
1446
|
"%"
|
|
1350
1447
|
] }),
|
|
1351
|
-
narrow ? fix.status === "applying" && /* @__PURE__ */
|
|
1352
|
-
/* @__PURE__ */
|
|
1448
|
+
narrow ? fix.status === "applying" && /* @__PURE__ */ jsx7(Text6, { color: "cyan", children: " applying..." }) : /* @__PURE__ */ jsxs6(Fragment, { children: [
|
|
1449
|
+
/* @__PURE__ */ jsxs6(Text6, { dimColor: true, children: [
|
|
1353
1450
|
" confidence fix: ",
|
|
1354
1451
|
truncate(fix.suggestedFix, contentWidth - 25)
|
|
1355
1452
|
] }),
|
|
1356
|
-
fix.status === "applying" && /* @__PURE__ */
|
|
1453
|
+
fix.status === "applying" && /* @__PURE__ */ jsx7(Text6, { color: "cyan", children: " applying..." })
|
|
1357
1454
|
] })
|
|
1358
1455
|
] })
|
|
1359
1456
|
] }, fix.id);
|
|
1360
1457
|
}),
|
|
1361
|
-
/* @__PURE__ */
|
|
1458
|
+
/* @__PURE__ */ jsx7(Text6, { dimColor: true, children: " f fix \xB7 x dismiss" })
|
|
1362
1459
|
] }),
|
|
1363
|
-
/* @__PURE__ */
|
|
1364
|
-
/* @__PURE__ */
|
|
1365
|
-
pageActivities.map((entry, i) => /* @__PURE__ */
|
|
1460
|
+
/* @__PURE__ */ jsxs6(Box6, { flexDirection: "column", marginTop: 1, children: [
|
|
1461
|
+
/* @__PURE__ */ jsx7(Text6, { bold: true, children: "Activity" }),
|
|
1462
|
+
pageActivities.map((entry, i) => /* @__PURE__ */ jsxs6(Text6, { wrap: "truncate", children: [
|
|
1366
1463
|
" ",
|
|
1367
|
-
/* @__PURE__ */
|
|
1464
|
+
/* @__PURE__ */ jsx7(Text6, { dimColor: true, children: entry.time }),
|
|
1368
1465
|
" ",
|
|
1369
1466
|
truncate(entry.message, contentWidth - 14)
|
|
1370
1467
|
] }, i)),
|
|
1371
|
-
pageActivities.length === 0 && /* @__PURE__ */
|
|
1468
|
+
pageActivities.length === 0 && /* @__PURE__ */ jsx7(Text6, { dimColor: true, children: " No activity yet" })
|
|
1372
1469
|
] })
|
|
1373
1470
|
] });
|
|
1374
1471
|
}
|
|
1375
1472
|
|
|
1376
1473
|
// src/cli/dashboard/views/AgentView.tsx
|
|
1377
1474
|
import { useEffect, useCallback } from "react";
|
|
1378
|
-
import { Box as
|
|
1475
|
+
import { Box as Box7, Text as Text7, useInput as useInput3, useStdout as useStdout5 } from "ink";
|
|
1379
1476
|
|
|
1380
1477
|
// src/cli/dashboard/theme.ts
|
|
1381
1478
|
import pc from "picocolors";
|
|
@@ -1414,7 +1511,7 @@ function progressBar(current, total, width = 10) {
|
|
|
1414
1511
|
}
|
|
1415
1512
|
|
|
1416
1513
|
// src/cli/dashboard/views/AgentView.tsx
|
|
1417
|
-
import { jsx as
|
|
1514
|
+
import { jsx as jsx8, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
1418
1515
|
function timeAgo(iso) {
|
|
1419
1516
|
const ms = Date.now() - new Date(iso).getTime();
|
|
1420
1517
|
const mins = Math.floor(ms / 6e4);
|
|
@@ -1478,21 +1575,21 @@ function AgentView() {
|
|
|
1478
1575
|
const decCount = decisions.length;
|
|
1479
1576
|
const patCount = patterns.length;
|
|
1480
1577
|
if (!loaded) {
|
|
1481
|
-
return /* @__PURE__ */
|
|
1482
|
-
/* @__PURE__ */
|
|
1483
|
-
/* @__PURE__ */
|
|
1578
|
+
return /* @__PURE__ */ jsxs7(Box7, { flexDirection: "column", paddingX: 1, children: [
|
|
1579
|
+
/* @__PURE__ */ jsx8(Text7, { bold: true, children: "Nudges" }),
|
|
1580
|
+
/* @__PURE__ */ jsx8(Text7, { dimColor: true, children: " Loading..." })
|
|
1484
1581
|
] });
|
|
1485
1582
|
}
|
|
1486
1583
|
if (alertCount === 0 && decCount === 0 && patCount === 0) {
|
|
1487
|
-
return /* @__PURE__ */
|
|
1488
|
-
/* @__PURE__ */
|
|
1489
|
-
/* @__PURE__ */
|
|
1584
|
+
return /* @__PURE__ */ jsxs7(Box7, { flexDirection: "column", paddingX: 1, children: [
|
|
1585
|
+
/* @__PURE__ */ jsx8(Text7, { bold: true, children: "Nudges" }),
|
|
1586
|
+
/* @__PURE__ */ jsx8(Text7, { dimColor: true, children: " No nudges yet. Trie will alert you here when it spots issues." })
|
|
1490
1587
|
] });
|
|
1491
1588
|
}
|
|
1492
|
-
return /* @__PURE__ */
|
|
1493
|
-
/* @__PURE__ */
|
|
1494
|
-
/* @__PURE__ */
|
|
1495
|
-
/* @__PURE__ */
|
|
1589
|
+
return /* @__PURE__ */ jsxs7(Box7, { flexDirection: "column", paddingX: 1, children: [
|
|
1590
|
+
/* @__PURE__ */ jsxs7(Text7, { children: [
|
|
1591
|
+
/* @__PURE__ */ jsx8(Text7, { bold: true, children: "Nudges" }),
|
|
1592
|
+
/* @__PURE__ */ jsxs7(Text7, { dimColor: true, children: [
|
|
1496
1593
|
" ",
|
|
1497
1594
|
alertCount,
|
|
1498
1595
|
" alerts \xB7 ",
|
|
@@ -1502,85 +1599,85 @@ function AgentView() {
|
|
|
1502
1599
|
" patterns"
|
|
1503
1600
|
] })
|
|
1504
1601
|
] }),
|
|
1505
|
-
alertCount > 0 && /* @__PURE__ */
|
|
1602
|
+
alertCount > 0 && /* @__PURE__ */ jsx8(Box7, { flexDirection: "column", marginTop: 1, children: alerts.map((insight, idx) => {
|
|
1506
1603
|
const isSelected = idx === selectedInsight;
|
|
1507
1604
|
const isExpanded = idx === expandedInsight;
|
|
1508
1605
|
const ago = formatTimeAgo(insight.timestamp);
|
|
1509
1606
|
const msg = insight.message.slice(0, msgLen) + (insight.message.length > msgLen ? "..." : "");
|
|
1510
1607
|
const riskColor = insight.priority >= 8 ? "red" : insight.priority >= 5 ? "yellow" : void 0;
|
|
1511
|
-
return /* @__PURE__ */
|
|
1512
|
-
/* @__PURE__ */
|
|
1513
|
-
isSelected ? /* @__PURE__ */
|
|
1514
|
-
riskColor ? /* @__PURE__ */
|
|
1608
|
+
return /* @__PURE__ */ jsxs7(Box7, { flexDirection: "column", children: [
|
|
1609
|
+
/* @__PURE__ */ jsxs7(Text7, { wrap: "truncate", children: [
|
|
1610
|
+
isSelected ? /* @__PURE__ */ jsx8(Text7, { bold: true, color: "green", children: "> " }) : " ",
|
|
1611
|
+
riskColor ? /* @__PURE__ */ jsx8(Text7, { color: riskColor, children: "\u25CF" }) : /* @__PURE__ */ jsx8(Text7, { dimColor: true, children: "\u25CB" }),
|
|
1515
1612
|
" ",
|
|
1516
|
-
isSelected ? /* @__PURE__ */
|
|
1517
|
-
/* @__PURE__ */
|
|
1613
|
+
isSelected ? /* @__PURE__ */ jsx8(Text7, { bold: true, children: msg }) : /* @__PURE__ */ jsx8(Text7, { children: msg }),
|
|
1614
|
+
/* @__PURE__ */ jsxs7(Text7, { dimColor: true, children: [
|
|
1518
1615
|
" ",
|
|
1519
1616
|
insight.category,
|
|
1520
1617
|
" \xB7 ",
|
|
1521
1618
|
ago
|
|
1522
1619
|
] })
|
|
1523
1620
|
] }),
|
|
1524
|
-
(isExpanded || isSelected) && insight.suggestedAction && /* @__PURE__ */
|
|
1621
|
+
(isExpanded || isSelected) && insight.suggestedAction && /* @__PURE__ */ jsxs7(Text7, { children: [
|
|
1525
1622
|
" ",
|
|
1526
|
-
/* @__PURE__ */
|
|
1623
|
+
/* @__PURE__ */ jsxs7(Text7, { dimColor: true, children: [
|
|
1527
1624
|
"->",
|
|
1528
1625
|
" "
|
|
1529
1626
|
] }),
|
|
1530
|
-
/* @__PURE__ */
|
|
1627
|
+
/* @__PURE__ */ jsx8(Text7, { children: insight.suggestedAction })
|
|
1531
1628
|
] })
|
|
1532
1629
|
] }, insight.id);
|
|
1533
1630
|
}) }),
|
|
1534
|
-
decCount > 0 && /* @__PURE__ */
|
|
1535
|
-
/* @__PURE__ */
|
|
1631
|
+
decCount > 0 && /* @__PURE__ */ jsxs7(Box7, { flexDirection: "column", marginTop: 1, children: [
|
|
1632
|
+
/* @__PURE__ */ jsx8(Text7, { dimColor: true, children: " Decisions" }),
|
|
1536
1633
|
decisions.slice(0, 10).map((dec) => {
|
|
1537
1634
|
const ago = timeAgo(dec.when);
|
|
1538
1635
|
const active = dec.status === "active";
|
|
1539
|
-
return /* @__PURE__ */
|
|
1636
|
+
return /* @__PURE__ */ jsxs7(Text7, { children: [
|
|
1540
1637
|
" ",
|
|
1541
|
-
active ? /* @__PURE__ */
|
|
1638
|
+
active ? /* @__PURE__ */ jsx8(Text7, { color: "green", children: "\u25CF" }) : /* @__PURE__ */ jsx8(Text7, { dimColor: true, children: "\u25CB" }),
|
|
1542
1639
|
" ",
|
|
1543
1640
|
dec.decision.slice(0, msgLen),
|
|
1544
1641
|
dec.decision.length > msgLen ? "..." : "",
|
|
1545
|
-
/* @__PURE__ */
|
|
1642
|
+
/* @__PURE__ */ jsxs7(Text7, { dimColor: true, children: [
|
|
1546
1643
|
" ",
|
|
1547
1644
|
ago
|
|
1548
1645
|
] })
|
|
1549
1646
|
] }, dec.id);
|
|
1550
1647
|
})
|
|
1551
1648
|
] }),
|
|
1552
|
-
patCount > 0 && /* @__PURE__ */
|
|
1553
|
-
/* @__PURE__ */
|
|
1649
|
+
patCount > 0 && /* @__PURE__ */ jsxs7(Box7, { flexDirection: "column", marginTop: 1, children: [
|
|
1650
|
+
/* @__PURE__ */ jsx8(Text7, { dimColor: true, children: " Patterns" }),
|
|
1554
1651
|
patterns.slice(0, 8).map((pat, idx) => {
|
|
1555
1652
|
const conf = Math.round(pat.confidence * 100);
|
|
1556
1653
|
const confColor = conf > 70 ? "green" : conf > 40 ? "yellow" : void 0;
|
|
1557
|
-
return /* @__PURE__ */
|
|
1654
|
+
return /* @__PURE__ */ jsxs7(Text7, { children: [
|
|
1558
1655
|
" ",
|
|
1559
|
-
pat.isAntiPattern ? /* @__PURE__ */
|
|
1656
|
+
pat.isAntiPattern ? /* @__PURE__ */ jsx8(Text7, { color: "red", children: "\u25CF" }) : /* @__PURE__ */ jsx8(Text7, { dimColor: true, children: "\u25CB" }),
|
|
1560
1657
|
" ",
|
|
1561
1658
|
pat.description.slice(0, msgLen),
|
|
1562
1659
|
pat.description.length > msgLen ? "..." : "",
|
|
1563
1660
|
" ",
|
|
1564
|
-
confColor ? /* @__PURE__ */
|
|
1661
|
+
confColor ? /* @__PURE__ */ jsxs7(Text7, { color: confColor, children: [
|
|
1565
1662
|
conf,
|
|
1566
1663
|
"%"
|
|
1567
|
-
] }) : /* @__PURE__ */
|
|
1664
|
+
] }) : /* @__PURE__ */ jsxs7(Text7, { dimColor: true, children: [
|
|
1568
1665
|
conf,
|
|
1569
1666
|
"%"
|
|
1570
1667
|
] })
|
|
1571
1668
|
] }, idx);
|
|
1572
1669
|
})
|
|
1573
1670
|
] }),
|
|
1574
|
-
/* @__PURE__ */
|
|
1575
|
-
isAIAvailable() ? /* @__PURE__ */
|
|
1576
|
-
/* @__PURE__ */
|
|
1671
|
+
/* @__PURE__ */ jsxs7(Box7, { marginTop: 1, gap: 2, children: [
|
|
1672
|
+
isAIAvailable() ? /* @__PURE__ */ jsxs7(Text7, { children: [
|
|
1673
|
+
/* @__PURE__ */ jsx8(Text7, { color: "green", children: "\u25CF" }),
|
|
1577
1674
|
" ",
|
|
1578
|
-
/* @__PURE__ */
|
|
1579
|
-
] }) : /* @__PURE__ */
|
|
1580
|
-
agentInsights.filter((i) => i.type === "celebration").length > 0 && /* @__PURE__ */
|
|
1581
|
-
/* @__PURE__ */
|
|
1675
|
+
/* @__PURE__ */ jsx8(Text7, { dimColor: true, children: "AI" })
|
|
1676
|
+
] }) : /* @__PURE__ */ jsx8(Text7, { dimColor: true, children: "\u25CB AI off" }),
|
|
1677
|
+
agentInsights.filter((i) => i.type === "celebration").length > 0 && /* @__PURE__ */ jsxs7(Text7, { children: [
|
|
1678
|
+
/* @__PURE__ */ jsx8(Text7, { color: "green", children: "\u25CF" }),
|
|
1582
1679
|
" ",
|
|
1583
|
-
/* @__PURE__ */
|
|
1680
|
+
/* @__PURE__ */ jsxs7(Text7, { dimColor: true, children: [
|
|
1584
1681
|
agentInsights.filter((i) => i.type === "celebration").length,
|
|
1585
1682
|
" wins"
|
|
1586
1683
|
] })
|
|
@@ -1591,8 +1688,8 @@ function AgentView() {
|
|
|
1591
1688
|
|
|
1592
1689
|
// src/cli/dashboard/views/GoalsView.tsx
|
|
1593
1690
|
import { useCallback as useCallback2 } from "react";
|
|
1594
|
-
import { Box as
|
|
1595
|
-
import { Fragment as Fragment2, jsx as
|
|
1691
|
+
import { Box as Box8, Text as Text8, useInput as useInput4 } from "ink";
|
|
1692
|
+
import { Fragment as Fragment2, jsx as jsx9, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
1596
1693
|
function calculateGoalProgress(goal) {
|
|
1597
1694
|
if (goal.target <= 0) return 0;
|
|
1598
1695
|
const startValue = goal.startValue ?? goal.currentValue;
|
|
@@ -1695,15 +1792,19 @@ function GoalsView() {
|
|
|
1695
1792
|
await agentState.load();
|
|
1696
1793
|
const achieved = goalsPanel.goals.filter((g) => g.status === "achieved");
|
|
1697
1794
|
if (achieved.length === 0) {
|
|
1795
|
+
dispatch({ type: "SHOW_NOTIFICATION", message: "No achieved goals to clear", severity: "info", autoHideMs: 3e3 });
|
|
1698
1796
|
dispatch({ type: "ADD_ACTIVITY", message: "No achieved goals to clear" });
|
|
1699
1797
|
return;
|
|
1700
1798
|
}
|
|
1701
1799
|
for (const goal of achieved) {
|
|
1702
1800
|
await agentState.deleteGoal(goal.id);
|
|
1703
1801
|
}
|
|
1802
|
+
dispatch({ type: "SHOW_NOTIFICATION", message: `Cleared ${achieved.length} achieved goal${achieved.length > 1 ? "s" : ""}`, severity: "info", autoHideMs: 3e3 });
|
|
1704
1803
|
dispatch({ type: "ADD_ACTIVITY", message: `Cleared ${achieved.length} achieved goal${achieved.length > 1 ? "s" : ""}` });
|
|
1705
1804
|
await refreshGoals();
|
|
1706
|
-
} catch {
|
|
1805
|
+
} catch (error) {
|
|
1806
|
+
dispatch({ type: "SHOW_NOTIFICATION", message: `Failed to clear goals: ${error instanceof Error ? error.message : "unknown"}`, severity: "warning", autoHideMs: 5e3 });
|
|
1807
|
+
dispatch({ type: "ADD_ACTIVITY", message: `Clear failed: ${error instanceof Error ? error.message : "unknown"}` });
|
|
1707
1808
|
}
|
|
1708
1809
|
}, [dispatch, refreshGoals, goalsPanel.goals]);
|
|
1709
1810
|
const checkGoalNow = useCallback2(async (goalId) => {
|
|
@@ -1775,26 +1876,26 @@ function GoalsView() {
|
|
|
1775
1876
|
if (recent[0]) void reactivateGoal(recent[0].id);
|
|
1776
1877
|
}
|
|
1777
1878
|
});
|
|
1778
|
-
return /* @__PURE__ */
|
|
1779
|
-
/* @__PURE__ */
|
|
1780
|
-
goalsPanel.inputMode === "add" ? /* @__PURE__ */
|
|
1781
|
-
/* @__PURE__ */
|
|
1879
|
+
return /* @__PURE__ */ jsxs8(Box8, { flexDirection: "column", paddingX: 1, children: [
|
|
1880
|
+
/* @__PURE__ */ jsx9(Text8, { bold: true, children: "Goals" }),
|
|
1881
|
+
goalsPanel.inputMode === "add" ? /* @__PURE__ */ jsxs8(Box8, { flexDirection: "column", marginTop: 1, children: [
|
|
1882
|
+
/* @__PURE__ */ jsx9(Box8, { borderStyle: "single", borderColor: "green", paddingX: 1, children: /* @__PURE__ */ jsxs8(Text8, { children: [
|
|
1782
1883
|
goalsPanel.inputBuffer,
|
|
1783
|
-
/* @__PURE__ */
|
|
1884
|
+
/* @__PURE__ */ jsx9(Text8, { bold: true, color: "green", children: "|" })
|
|
1784
1885
|
] }) }),
|
|
1785
|
-
/* @__PURE__ */
|
|
1786
|
-
] }) : /* @__PURE__ */
|
|
1886
|
+
/* @__PURE__ */ jsx9(Text8, { dimColor: true, children: " enter save \xB7 esc cancel" })
|
|
1887
|
+
] }) : /* @__PURE__ */ jsx9(Fragment2, { children: goalsPanel.goals.length === 0 ? /* @__PURE__ */ jsx9(Text8, { dimColor: true, children: " No goals yet. Press a to add one." }) : /* @__PURE__ */ jsxs8(Box8, { flexDirection: "column", children: [
|
|
1787
1888
|
activeGoals.map((goal, idx) => {
|
|
1788
1889
|
const isSelected = goalsPanel.selectedIndex === idx;
|
|
1789
1890
|
const progress = calculateGoalProgress(goal);
|
|
1790
1891
|
const bar = progressBar(progress, 100, 8);
|
|
1791
1892
|
const source = goal.autoGenerated ? "auto" : "";
|
|
1792
|
-
return /* @__PURE__ */
|
|
1793
|
-
isSelected ? /* @__PURE__ */
|
|
1794
|
-
/* @__PURE__ */
|
|
1893
|
+
return /* @__PURE__ */ jsxs8(Text8, { children: [
|
|
1894
|
+
isSelected ? /* @__PURE__ */ jsx9(Text8, { bold: true, color: "green", children: "> " }) : " ",
|
|
1895
|
+
/* @__PURE__ */ jsx9(Text8, { color: "green", children: "\u25CB" }),
|
|
1795
1896
|
" ",
|
|
1796
1897
|
goal.description.slice(0, 45),
|
|
1797
|
-
/* @__PURE__ */
|
|
1898
|
+
/* @__PURE__ */ jsxs8(Text8, { dimColor: true, children: [
|
|
1798
1899
|
" ",
|
|
1799
1900
|
bar,
|
|
1800
1901
|
" ",
|
|
@@ -1804,29 +1905,29 @@ function GoalsView() {
|
|
|
1804
1905
|
] })
|
|
1805
1906
|
] }, goal.id);
|
|
1806
1907
|
}),
|
|
1807
|
-
achievedGoals.length > 0 && /* @__PURE__ */
|
|
1808
|
-
/* @__PURE__ */
|
|
1809
|
-
achievedGoals.slice(0, 5).map((g) => /* @__PURE__ */
|
|
1908
|
+
achievedGoals.length > 0 && /* @__PURE__ */ jsxs8(Box8, { flexDirection: "column", marginTop: 1, children: [
|
|
1909
|
+
/* @__PURE__ */ jsx9(Text8, { dimColor: true, children: " Achieved" }),
|
|
1910
|
+
achievedGoals.slice(0, 5).map((g) => /* @__PURE__ */ jsxs8(Text8, { children: [
|
|
1810
1911
|
" ",
|
|
1811
|
-
/* @__PURE__ */
|
|
1912
|
+
/* @__PURE__ */ jsx9(Text8, { color: "green", children: "\u25CF" }),
|
|
1812
1913
|
" ",
|
|
1813
1914
|
g.description.slice(0, 50)
|
|
1814
1915
|
] }, g.id)),
|
|
1815
|
-
achievedGoals.length > 5 && /* @__PURE__ */
|
|
1916
|
+
achievedGoals.length > 5 && /* @__PURE__ */ jsxs8(Text8, { dimColor: true, children: [
|
|
1816
1917
|
" +",
|
|
1817
1918
|
achievedGoals.length - 5,
|
|
1818
1919
|
" more"
|
|
1819
1920
|
] })
|
|
1820
1921
|
] }),
|
|
1821
|
-
otherGoals.length > 0 && /* @__PURE__ */
|
|
1822
|
-
/* @__PURE__ */
|
|
1823
|
-
otherGoals.slice(0, 2).map((g) => /* @__PURE__ */
|
|
1922
|
+
otherGoals.length > 0 && /* @__PURE__ */ jsxs8(Box8, { flexDirection: "column", marginTop: 1, children: [
|
|
1923
|
+
/* @__PURE__ */ jsx9(Text8, { dimColor: true, children: " Other" }),
|
|
1924
|
+
otherGoals.slice(0, 2).map((g) => /* @__PURE__ */ jsxs8(Text8, { children: [
|
|
1824
1925
|
" ",
|
|
1825
|
-
/* @__PURE__ */
|
|
1926
|
+
/* @__PURE__ */ jsx9(Text8, { dimColor: true, children: "\u25CB" }),
|
|
1826
1927
|
" ",
|
|
1827
1928
|
g.description.slice(0, 50),
|
|
1828
1929
|
" ",
|
|
1829
|
-
/* @__PURE__ */
|
|
1930
|
+
/* @__PURE__ */ jsx9(Text8, { dimColor: true, children: g.status })
|
|
1830
1931
|
] }, g.id))
|
|
1831
1932
|
] })
|
|
1832
1933
|
] }) })
|
|
@@ -1835,8 +1936,8 @@ function GoalsView() {
|
|
|
1835
1936
|
|
|
1836
1937
|
// src/cli/dashboard/views/HypothesesView.tsx
|
|
1837
1938
|
import { useCallback as useCallback3 } from "react";
|
|
1838
|
-
import { Box as
|
|
1839
|
-
import { Fragment as Fragment3, jsx as
|
|
1939
|
+
import { Box as Box9, Text as Text9, useInput as useInput5 } from "ink";
|
|
1940
|
+
import { Fragment as Fragment3, jsx as jsx10, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
1840
1941
|
function HypothesesView() {
|
|
1841
1942
|
const { state, dispatch } = useDashboard();
|
|
1842
1943
|
const { hypothesesPanel } = state;
|
|
@@ -1965,24 +2066,24 @@ function HypothesesView() {
|
|
|
1965
2066
|
if (recent[0]) void reactivateHypothesis(recent[0].id);
|
|
1966
2067
|
}
|
|
1967
2068
|
});
|
|
1968
|
-
return /* @__PURE__ */
|
|
1969
|
-
/* @__PURE__ */
|
|
1970
|
-
hypothesesPanel.inputMode === "add" ? /* @__PURE__ */
|
|
1971
|
-
/* @__PURE__ */
|
|
2069
|
+
return /* @__PURE__ */ jsxs9(Box9, { flexDirection: "column", paddingX: 1, children: [
|
|
2070
|
+
/* @__PURE__ */ jsx10(Text9, { bold: true, children: "Hypotheses" }),
|
|
2071
|
+
hypothesesPanel.inputMode === "add" ? /* @__PURE__ */ jsxs9(Box9, { flexDirection: "column", marginTop: 1, children: [
|
|
2072
|
+
/* @__PURE__ */ jsx10(Box9, { borderStyle: "single", borderColor: "green", paddingX: 1, children: /* @__PURE__ */ jsxs9(Text9, { children: [
|
|
1972
2073
|
hypothesesPanel.inputBuffer,
|
|
1973
|
-
/* @__PURE__ */
|
|
2074
|
+
/* @__PURE__ */ jsx10(Text9, { bold: true, color: "green", children: "|" })
|
|
1974
2075
|
] }) }),
|
|
1975
|
-
/* @__PURE__ */
|
|
1976
|
-
] }) : /* @__PURE__ */
|
|
2076
|
+
/* @__PURE__ */ jsx10(Text9, { dimColor: true, children: " enter save \xB7 esc cancel" })
|
|
2077
|
+
] }) : /* @__PURE__ */ jsx10(Fragment3, { children: hypothesesPanel.hypotheses.length === 0 ? /* @__PURE__ */ jsx10(Text9, { dimColor: true, children: " No hypotheses yet. Press a to add one." }) : /* @__PURE__ */ jsxs9(Box9, { flexDirection: "column", children: [
|
|
1977
2078
|
testing.map((hypo, idx) => {
|
|
1978
2079
|
const isSelected = hypothesesPanel.selectedIndex === idx;
|
|
1979
2080
|
const conf = Math.round(hypo.confidence * 100);
|
|
1980
|
-
return /* @__PURE__ */
|
|
1981
|
-
isSelected ? /* @__PURE__ */
|
|
1982
|
-
/* @__PURE__ */
|
|
2081
|
+
return /* @__PURE__ */ jsxs9(Text9, { children: [
|
|
2082
|
+
isSelected ? /* @__PURE__ */ jsx10(Text9, { bold: true, color: "green", children: "> " }) : " ",
|
|
2083
|
+
/* @__PURE__ */ jsx10(Text9, { color: "yellow", children: "\u25CB" }),
|
|
1983
2084
|
" ",
|
|
1984
2085
|
hypo.statement.slice(0, 50),
|
|
1985
|
-
/* @__PURE__ */
|
|
2086
|
+
/* @__PURE__ */ jsxs9(Text9, { dimColor: true, children: [
|
|
1986
2087
|
" ",
|
|
1987
2088
|
conf,
|
|
1988
2089
|
"% \xB7 ",
|
|
@@ -1991,29 +2092,29 @@ function HypothesesView() {
|
|
|
1991
2092
|
] })
|
|
1992
2093
|
] }, hypo.id);
|
|
1993
2094
|
}),
|
|
1994
|
-
validated.length > 0 && /* @__PURE__ */
|
|
1995
|
-
/* @__PURE__ */
|
|
1996
|
-
validated.slice(0, 3).map((h) => /* @__PURE__ */
|
|
2095
|
+
validated.length > 0 && /* @__PURE__ */ jsxs9(Box9, { flexDirection: "column", marginTop: 1, children: [
|
|
2096
|
+
/* @__PURE__ */ jsx10(Text9, { dimColor: true, children: " Validated" }),
|
|
2097
|
+
validated.slice(0, 3).map((h) => /* @__PURE__ */ jsxs9(Text9, { children: [
|
|
1997
2098
|
" ",
|
|
1998
|
-
/* @__PURE__ */
|
|
2099
|
+
/* @__PURE__ */ jsx10(Text9, { color: "green", children: "\u25CF" }),
|
|
1999
2100
|
" ",
|
|
2000
2101
|
h.statement.slice(0, 50)
|
|
2001
2102
|
] }, h.id)),
|
|
2002
|
-
validated.length > 3 && /* @__PURE__ */
|
|
2103
|
+
validated.length > 3 && /* @__PURE__ */ jsxs9(Text9, { dimColor: true, children: [
|
|
2003
2104
|
" +",
|
|
2004
2105
|
validated.length - 3,
|
|
2005
2106
|
" more"
|
|
2006
2107
|
] })
|
|
2007
2108
|
] }),
|
|
2008
|
-
invalidated.length > 0 && /* @__PURE__ */
|
|
2009
|
-
/* @__PURE__ */
|
|
2010
|
-
invalidated.slice(0, 2).map((h) => /* @__PURE__ */
|
|
2109
|
+
invalidated.length > 0 && /* @__PURE__ */ jsxs9(Box9, { flexDirection: "column", marginTop: 1, children: [
|
|
2110
|
+
/* @__PURE__ */ jsx10(Text9, { dimColor: true, children: " Invalidated" }),
|
|
2111
|
+
invalidated.slice(0, 2).map((h) => /* @__PURE__ */ jsxs9(Text9, { children: [
|
|
2011
2112
|
" ",
|
|
2012
|
-
/* @__PURE__ */
|
|
2113
|
+
/* @__PURE__ */ jsx10(Text9, { color: "red", children: "\u25CF" }),
|
|
2013
2114
|
" ",
|
|
2014
|
-
/* @__PURE__ */
|
|
2115
|
+
/* @__PURE__ */ jsx10(Text9, { dimColor: true, children: h.statement.slice(0, 50) })
|
|
2015
2116
|
] }, h.id)),
|
|
2016
|
-
invalidated.length > 2 && /* @__PURE__ */
|
|
2117
|
+
invalidated.length > 2 && /* @__PURE__ */ jsxs9(Text9, { dimColor: true, children: [
|
|
2017
2118
|
" +",
|
|
2018
2119
|
invalidated.length - 2,
|
|
2019
2120
|
" more"
|
|
@@ -2025,8 +2126,8 @@ function HypothesesView() {
|
|
|
2025
2126
|
|
|
2026
2127
|
// src/cli/dashboard/views/MemoryTreeView.tsx
|
|
2027
2128
|
import { useEffect as useEffect2, useCallback as useCallback4 } from "react";
|
|
2028
|
-
import { Box as
|
|
2029
|
-
import { Fragment as Fragment4, jsx as
|
|
2129
|
+
import { Box as Box10, Text as Text10, useInput as useInput6 } from "ink";
|
|
2130
|
+
import { Fragment as Fragment4, jsx as jsx11, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
2030
2131
|
function timeAgo2(iso) {
|
|
2031
2132
|
const ms = Date.now() - new Date(iso).getTime();
|
|
2032
2133
|
const mins = Math.floor(ms / 6e4);
|
|
@@ -2064,15 +2165,15 @@ function MemoryTreeView() {
|
|
|
2064
2165
|
});
|
|
2065
2166
|
const sel = (nodeId) => selectedNode === nodeId;
|
|
2066
2167
|
if (!loaded) {
|
|
2067
|
-
return /* @__PURE__ */
|
|
2068
|
-
/* @__PURE__ */
|
|
2069
|
-
/* @__PURE__ */
|
|
2168
|
+
return /* @__PURE__ */ jsxs10(Box10, { flexDirection: "column", paddingX: 1, children: [
|
|
2169
|
+
/* @__PURE__ */ jsx11(Text10, { bold: true, children: "Ledger" }),
|
|
2170
|
+
/* @__PURE__ */ jsx11(Text10, { dimColor: true, children: " Loading..." })
|
|
2070
2171
|
] });
|
|
2071
2172
|
}
|
|
2072
2173
|
if (!snapshot || snapshot.nodes.length === 0 && globalPatterns.length === 0) {
|
|
2073
|
-
return /* @__PURE__ */
|
|
2074
|
-
/* @__PURE__ */
|
|
2075
|
-
/* @__PURE__ */
|
|
2174
|
+
return /* @__PURE__ */ jsxs10(Box10, { flexDirection: "column", paddingX: 1, children: [
|
|
2175
|
+
/* @__PURE__ */ jsx11(Text10, { bold: true, children: "Ledger" }),
|
|
2176
|
+
/* @__PURE__ */ jsx11(Text10, { dimColor: true, children: " No entries yet. Use trie tell or trie watch to build memory." })
|
|
2076
2177
|
] });
|
|
2077
2178
|
}
|
|
2078
2179
|
const decisionNodes = snapshot.nodes.filter((n) => n.type === "decision") ?? [];
|
|
@@ -2087,47 +2188,47 @@ function MemoryTreeView() {
|
|
|
2087
2188
|
function renderHeader(id, label, count, emptyHint) {
|
|
2088
2189
|
const expanded = expandedNodes.has(id);
|
|
2089
2190
|
const isEmpty = count === 0;
|
|
2090
|
-
return /* @__PURE__ */
|
|
2091
|
-
sel(id) ? /* @__PURE__ */
|
|
2092
|
-
expanded && !isEmpty ? /* @__PURE__ */
|
|
2191
|
+
return /* @__PURE__ */ jsxs10(Text10, { children: [
|
|
2192
|
+
sel(id) ? /* @__PURE__ */ jsx11(Text10, { bold: true, color: "green", children: "> " }) : " ",
|
|
2193
|
+
expanded && !isEmpty ? /* @__PURE__ */ jsx11(Text10, { color: "green", children: "\u25CF" }) : /* @__PURE__ */ jsx11(Text10, { dimColor: true, children: "\u25CB" }),
|
|
2093
2194
|
" ",
|
|
2094
|
-
sel(id) ? /* @__PURE__ */
|
|
2095
|
-
count > 0 ? /* @__PURE__ */
|
|
2195
|
+
sel(id) ? /* @__PURE__ */ jsx11(Text10, { bold: true, color: "green", children: label }) : /* @__PURE__ */ jsx11(Text10, { bold: true, children: label }),
|
|
2196
|
+
count > 0 ? /* @__PURE__ */ jsxs10(Text10, { dimColor: true, children: [
|
|
2096
2197
|
" (",
|
|
2097
2198
|
count,
|
|
2098
2199
|
")"
|
|
2099
|
-
] }) : isEmpty && emptyHint ? /* @__PURE__ */
|
|
2200
|
+
] }) : isEmpty && emptyHint ? /* @__PURE__ */ jsxs10(Text10, { dimColor: true, children: [
|
|
2100
2201
|
" ",
|
|
2101
2202
|
emptyHint
|
|
2102
2203
|
] }) : null
|
|
2103
2204
|
] });
|
|
2104
2205
|
}
|
|
2105
|
-
return /* @__PURE__ */
|
|
2106
|
-
/* @__PURE__ */
|
|
2107
|
-
/* @__PURE__ */
|
|
2108
|
-
/* @__PURE__ */
|
|
2206
|
+
return /* @__PURE__ */ jsxs10(Box10, { flexDirection: "column", paddingX: 1, children: [
|
|
2207
|
+
/* @__PURE__ */ jsxs10(Text10, { children: [
|
|
2208
|
+
/* @__PURE__ */ jsx11(Text10, { bold: true, children: "Ledger" }),
|
|
2209
|
+
/* @__PURE__ */ jsxs10(Text10, { dimColor: true, children: [
|
|
2109
2210
|
" ",
|
|
2110
2211
|
totalEntries,
|
|
2111
2212
|
" entries"
|
|
2112
2213
|
] })
|
|
2113
2214
|
] }),
|
|
2114
|
-
/* @__PURE__ */
|
|
2215
|
+
/* @__PURE__ */ jsxs10(Box10, { flexDirection: "column", marginTop: 1, children: [
|
|
2115
2216
|
renderHeader("decisions", "Decisions", decisionNodes.length, "-- use trie tell or chat"),
|
|
2116
2217
|
expandedNodes.has("decisions") && decisionNodes.slice(0, 10).map((n) => {
|
|
2117
2218
|
const nodeId = `decision-${n.id}`;
|
|
2118
2219
|
const dec = n.data.decision.length > 55 ? n.data.decision.slice(0, 52) + "..." : n.data.decision;
|
|
2119
2220
|
const outcomeColor = n.data.outcome === "good" ? "green" : n.data.outcome === "bad" ? "red" : void 0;
|
|
2120
|
-
return /* @__PURE__ */
|
|
2121
|
-
sel(nodeId) ? /* @__PURE__ */
|
|
2221
|
+
return /* @__PURE__ */ jsxs10(Text10, { children: [
|
|
2222
|
+
sel(nodeId) ? /* @__PURE__ */ jsx11(Text10, { bold: true, color: "green", children: "> " }) : " ",
|
|
2122
2223
|
" ",
|
|
2123
|
-
outcomeColor ? /* @__PURE__ */
|
|
2224
|
+
outcomeColor ? /* @__PURE__ */ jsx11(Text10, { color: outcomeColor, children: "\u25CF" }) : /* @__PURE__ */ jsx11(Text10, { dimColor: true, children: "\u25CB" }),
|
|
2124
2225
|
" ",
|
|
2125
|
-
sel(nodeId) ? /* @__PURE__ */
|
|
2126
|
-
/* @__PURE__ */
|
|
2226
|
+
sel(nodeId) ? /* @__PURE__ */ jsx11(Text10, { bold: true, color: "green", children: dec }) : /* @__PURE__ */ jsx11(Text10, { children: dec }),
|
|
2227
|
+
/* @__PURE__ */ jsxs10(Text10, { dimColor: true, children: [
|
|
2127
2228
|
" ",
|
|
2128
2229
|
timeAgo2(n.data.timestamp)
|
|
2129
2230
|
] }),
|
|
2130
|
-
outcomeColor ? /* @__PURE__ */
|
|
2231
|
+
outcomeColor ? /* @__PURE__ */ jsxs10(Text10, { color: outcomeColor, children: [
|
|
2131
2232
|
" ",
|
|
2132
2233
|
n.data.outcome
|
|
2133
2234
|
] }) : null
|
|
@@ -2139,18 +2240,18 @@ function MemoryTreeView() {
|
|
|
2139
2240
|
const nodeId = `incident-${n.id}`;
|
|
2140
2241
|
const sevColor = n.data.severity === "critical" ? "red" : n.data.severity === "major" ? "yellow" : void 0;
|
|
2141
2242
|
const desc = n.data.description.length > 55 ? n.data.description.slice(0, 52) + "..." : n.data.description;
|
|
2142
|
-
return /* @__PURE__ */
|
|
2143
|
-
sel(nodeId) ? /* @__PURE__ */
|
|
2243
|
+
return /* @__PURE__ */ jsxs10(Text10, { children: [
|
|
2244
|
+
sel(nodeId) ? /* @__PURE__ */ jsx11(Text10, { bold: true, color: "green", children: "> " }) : " ",
|
|
2144
2245
|
" ",
|
|
2145
|
-
sevColor ? /* @__PURE__ */
|
|
2246
|
+
sevColor ? /* @__PURE__ */ jsx11(Text10, { color: sevColor, children: "\u25CF" }) : /* @__PURE__ */ jsx11(Text10, { dimColor: true, children: "\u25CB" }),
|
|
2146
2247
|
" ",
|
|
2147
|
-
sel(nodeId) ? /* @__PURE__ */
|
|
2148
|
-
/* @__PURE__ */
|
|
2248
|
+
sel(nodeId) ? /* @__PURE__ */ jsx11(Text10, { bold: true, color: "green", children: desc }) : /* @__PURE__ */ jsx11(Text10, { children: desc }),
|
|
2249
|
+
/* @__PURE__ */ jsxs10(Text10, { dimColor: true, children: [
|
|
2149
2250
|
" ",
|
|
2150
2251
|
timeAgo2(n.data.timestamp)
|
|
2151
2252
|
] }),
|
|
2152
2253
|
" ",
|
|
2153
|
-
n.data.resolved ? /* @__PURE__ */
|
|
2254
|
+
n.data.resolved ? /* @__PURE__ */ jsx11(Text10, { color: "green", children: "resolved" }) : /* @__PURE__ */ jsx11(Text10, { color: "yellow", children: "open" })
|
|
2154
2255
|
] }, n.id);
|
|
2155
2256
|
}),
|
|
2156
2257
|
renderHeader("patterns", "Learned Patterns", patternNodes.length, "-- Trie learns as you work"),
|
|
@@ -2159,17 +2260,17 @@ function MemoryTreeView() {
|
|
|
2159
2260
|
const conf = Math.round(n.data.confidence * 100);
|
|
2160
2261
|
const confColor = conf > 70 ? "green" : conf > 40 ? "yellow" : void 0;
|
|
2161
2262
|
const desc = n.data.description.length > 50 ? n.data.description.slice(0, 47) + "..." : n.data.description;
|
|
2162
|
-
return /* @__PURE__ */
|
|
2163
|
-
sel(nodeId) ? /* @__PURE__ */
|
|
2263
|
+
return /* @__PURE__ */ jsxs10(Text10, { children: [
|
|
2264
|
+
sel(nodeId) ? /* @__PURE__ */ jsx11(Text10, { bold: true, color: "green", children: "> " }) : " ",
|
|
2164
2265
|
" ",
|
|
2165
|
-
n.data.isAntiPattern ? /* @__PURE__ */
|
|
2266
|
+
n.data.isAntiPattern ? /* @__PURE__ */ jsx11(Text10, { color: "red", children: "!" }) : /* @__PURE__ */ jsx11(Text10, { dimColor: true, children: "\u25CB" }),
|
|
2166
2267
|
" ",
|
|
2167
|
-
sel(nodeId) ? /* @__PURE__ */
|
|
2268
|
+
sel(nodeId) ? /* @__PURE__ */ jsx11(Text10, { bold: true, color: "green", children: desc }) : /* @__PURE__ */ jsx11(Text10, { children: desc }),
|
|
2168
2269
|
" ",
|
|
2169
|
-
confColor ? /* @__PURE__ */
|
|
2270
|
+
confColor ? /* @__PURE__ */ jsxs10(Text10, { color: confColor, children: [
|
|
2170
2271
|
conf,
|
|
2171
2272
|
"%"
|
|
2172
|
-
] }) : /* @__PURE__ */
|
|
2273
|
+
] }) : /* @__PURE__ */ jsxs10(Text10, { dimColor: true, children: [
|
|
2173
2274
|
conf,
|
|
2174
2275
|
"%"
|
|
2175
2276
|
] })
|
|
@@ -2179,13 +2280,13 @@ function MemoryTreeView() {
|
|
|
2179
2280
|
expandedNodes.has("cross-project") && globalPatterns.slice(0, 8).map((pattern) => {
|
|
2180
2281
|
const patternId = `global-${pattern.id}`;
|
|
2181
2282
|
const desc = pattern.pattern.length > 45 ? pattern.pattern.slice(0, 42) + "..." : pattern.pattern;
|
|
2182
|
-
return /* @__PURE__ */
|
|
2183
|
-
sel(patternId) ? /* @__PURE__ */
|
|
2283
|
+
return /* @__PURE__ */ jsxs10(Text10, { children: [
|
|
2284
|
+
sel(patternId) ? /* @__PURE__ */ jsx11(Text10, { bold: true, color: "green", children: "> " }) : " ",
|
|
2184
2285
|
" ",
|
|
2185
|
-
/* @__PURE__ */
|
|
2286
|
+
/* @__PURE__ */ jsx11(Text10, { dimColor: true, children: "\u25CB" }),
|
|
2186
2287
|
" ",
|
|
2187
|
-
sel(patternId) ? /* @__PURE__ */
|
|
2188
|
-
/* @__PURE__ */
|
|
2288
|
+
sel(patternId) ? /* @__PURE__ */ jsx11(Text10, { bold: true, color: "green", children: desc }) : /* @__PURE__ */ jsx11(Text10, { children: desc }),
|
|
2289
|
+
/* @__PURE__ */ jsxs10(Text10, { dimColor: true, children: [
|
|
2189
2290
|
" ",
|
|
2190
2291
|
pattern.projects.length,
|
|
2191
2292
|
" projects \xB7 ",
|
|
@@ -2194,21 +2295,21 @@ function MemoryTreeView() {
|
|
|
2194
2295
|
] })
|
|
2195
2296
|
] }, pattern.id);
|
|
2196
2297
|
}),
|
|
2197
|
-
hotspots.length > 0 && /* @__PURE__ */
|
|
2298
|
+
hotspots.length > 0 && /* @__PURE__ */ jsxs10(Fragment4, { children: [
|
|
2198
2299
|
renderHeader("hotspots", "Risk Hotspots", hotspots.length),
|
|
2199
2300
|
expandedNodes.has("hotspots") && hotspots.slice(0, 10).map((n) => {
|
|
2200
2301
|
const nodeId = `file-${n.id}`;
|
|
2201
2302
|
const path2 = n.data.path.split("/").slice(-2).join("/");
|
|
2202
2303
|
const isCritical = n.data.riskLevel === "critical";
|
|
2203
|
-
return /* @__PURE__ */
|
|
2204
|
-
sel(nodeId) ? /* @__PURE__ */
|
|
2304
|
+
return /* @__PURE__ */ jsxs10(Text10, { children: [
|
|
2305
|
+
sel(nodeId) ? /* @__PURE__ */ jsx11(Text10, { bold: true, color: "green", children: "> " }) : " ",
|
|
2205
2306
|
" ",
|
|
2206
|
-
/* @__PURE__ */
|
|
2307
|
+
/* @__PURE__ */ jsx11(Text10, { color: isCritical ? "red" : "yellow", children: "\u25CF" }),
|
|
2207
2308
|
" ",
|
|
2208
|
-
sel(nodeId) ? /* @__PURE__ */
|
|
2309
|
+
sel(nodeId) ? /* @__PURE__ */ jsx11(Text10, { bold: true, color: "green", children: path2 }) : /* @__PURE__ */ jsx11(Text10, { children: path2 }),
|
|
2209
2310
|
" ",
|
|
2210
|
-
/* @__PURE__ */
|
|
2211
|
-
/* @__PURE__ */
|
|
2311
|
+
/* @__PURE__ */ jsx11(Text10, { color: isCritical ? "red" : "yellow", children: n.data.riskLevel }),
|
|
2312
|
+
/* @__PURE__ */ jsxs10(Text10, { dimColor: true, children: [
|
|
2212
2313
|
" ",
|
|
2213
2314
|
n.data.changeCount,
|
|
2214
2315
|
" changes"
|
|
@@ -2220,8 +2321,8 @@ function MemoryTreeView() {
|
|
|
2220
2321
|
}
|
|
2221
2322
|
|
|
2222
2323
|
// src/cli/dashboard/views/RawLogView.tsx
|
|
2223
|
-
import { Box as
|
|
2224
|
-
import { jsx as
|
|
2324
|
+
import { Box as Box11, Text as Text11, useInput as useInput7 } from "ink";
|
|
2325
|
+
import { jsx as jsx12, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
2225
2326
|
function RawLogView() {
|
|
2226
2327
|
const { state, dispatch } = useDashboard();
|
|
2227
2328
|
const { rawLog, rawLogPage } = state;
|
|
@@ -2233,10 +2334,10 @@ function RawLogView() {
|
|
|
2233
2334
|
});
|
|
2234
2335
|
const startIdx = rawLogPage * pageSize;
|
|
2235
2336
|
const logs = rawLog.slice(startIdx, startIdx + pageSize);
|
|
2236
|
-
return /* @__PURE__ */
|
|
2237
|
-
/* @__PURE__ */
|
|
2238
|
-
/* @__PURE__ */
|
|
2239
|
-
/* @__PURE__ */
|
|
2337
|
+
return /* @__PURE__ */ jsxs11(Box11, { flexDirection: "column", paddingX: 1, children: [
|
|
2338
|
+
/* @__PURE__ */ jsxs11(Text11, { children: [
|
|
2339
|
+
/* @__PURE__ */ jsx12(Text11, { bold: true, children: "Log" }),
|
|
2340
|
+
/* @__PURE__ */ jsxs11(Text11, { dimColor: true, children: [
|
|
2240
2341
|
" ",
|
|
2241
2342
|
rawLog.length,
|
|
2242
2343
|
" entries \xB7 page ",
|
|
@@ -2245,11 +2346,11 @@ function RawLogView() {
|
|
|
2245
2346
|
totalPages
|
|
2246
2347
|
] })
|
|
2247
2348
|
] }),
|
|
2248
|
-
rawLog.length === 0 ? /* @__PURE__ */
|
|
2249
|
-
const dot = entry.level === "error" ? /* @__PURE__ */
|
|
2250
|
-
return /* @__PURE__ */
|
|
2349
|
+
rawLog.length === 0 ? /* @__PURE__ */ jsx12(Text11, { dimColor: true, children: " No log entries yet" }) : logs.map((entry, i) => {
|
|
2350
|
+
const dot = entry.level === "error" ? /* @__PURE__ */ jsx12(Text11, { color: "red", children: "\u25CF" }) : entry.level === "warn" ? /* @__PURE__ */ jsx12(Text11, { color: "yellow", children: "\u25CF" }) : entry.level === "info" ? /* @__PURE__ */ jsx12(Text11, { color: "green", children: "\u25CF" }) : /* @__PURE__ */ jsx12(Text11, { dimColor: true, children: "\u25CB" });
|
|
2351
|
+
return /* @__PURE__ */ jsxs11(Text11, { children: [
|
|
2251
2352
|
" ",
|
|
2252
|
-
/* @__PURE__ */
|
|
2353
|
+
/* @__PURE__ */ jsx12(Text11, { dimColor: true, children: entry.time }),
|
|
2253
2354
|
" ",
|
|
2254
2355
|
dot,
|
|
2255
2356
|
" ",
|
|
@@ -2261,7 +2362,7 @@ function RawLogView() {
|
|
|
2261
2362
|
|
|
2262
2363
|
// src/cli/dashboard/views/ChatView.tsx
|
|
2263
2364
|
import { useCallback as useCallback5, useRef } from "react";
|
|
2264
|
-
import { Box as
|
|
2365
|
+
import { Box as Box12, Text as Text12, useInput as useInput8 } from "ink";
|
|
2265
2366
|
|
|
2266
2367
|
// src/tools/tell.ts
|
|
2267
2368
|
import path from "path";
|
|
@@ -5060,7 +5161,7 @@ ${truncated}`;
|
|
|
5060
5161
|
}
|
|
5061
5162
|
|
|
5062
5163
|
// src/cli/dashboard/views/ChatView.tsx
|
|
5063
|
-
import { jsx as
|
|
5164
|
+
import { jsx as jsx13, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
5064
5165
|
async function buildContext(workDir, dashboardState) {
|
|
5065
5166
|
const parts = [];
|
|
5066
5167
|
if (dashboardState?.agentInsights) {
|
|
@@ -5201,22 +5302,22 @@ function ChatView() {
|
|
|
5201
5302
|
dispatch({ type: "SET_CHAT_LOADING", loading: true });
|
|
5202
5303
|
try {
|
|
5203
5304
|
const workDir = getWorkingDirectory(void 0, true);
|
|
5204
|
-
const
|
|
5205
|
-
if (
|
|
5305
|
+
const lastAssistantMessage = messages.filter((m) => m.role === "assistant").pop();
|
|
5306
|
+
if (lastAssistantMessage?.pendingFix) {
|
|
5206
5307
|
const response = question.trim().toLowerCase();
|
|
5207
5308
|
if (response === "yes" || response === "y") {
|
|
5208
5309
|
const { spawnClaudeCodeFix } = await import("./terminal-spawn-2GU5KLPS.js");
|
|
5209
5310
|
try {
|
|
5210
|
-
await spawnClaudeCodeFix(
|
|
5311
|
+
await spawnClaudeCodeFix(lastAssistantMessage.pendingFix);
|
|
5211
5312
|
dispatch({
|
|
5212
5313
|
type: "ADD_CHAT_MESSAGE",
|
|
5213
5314
|
role: "assistant",
|
|
5214
|
-
content: `\u2713 Spawned Claude Code in a new terminal to fix "${
|
|
5315
|
+
content: `\u2713 Spawned Claude Code in a new terminal to fix "${lastAssistantMessage.pendingFix.file}".
|
|
5215
5316
|
|
|
5216
5317
|
Claude Code will:
|
|
5217
5318
|
1. Review the file
|
|
5218
|
-
2. Understand the goal: "${
|
|
5219
|
-
3. Fix the violation: "${
|
|
5319
|
+
2. Understand the goal: "${lastAssistantMessage.pendingFix.goal}"
|
|
5320
|
+
3. Fix the violation: "${lastAssistantMessage.pendingFix.violation}"
|
|
5220
5321
|
4. Preserve all functionality
|
|
5221
5322
|
|
|
5222
5323
|
Check the new terminal window to see the fix in progress.`
|
|
@@ -5340,24 +5441,24 @@ ${contextBlock}`;
|
|
|
5340
5441
|
}
|
|
5341
5442
|
});
|
|
5342
5443
|
if (!isAIAvailable()) {
|
|
5343
|
-
return /* @__PURE__ */
|
|
5344
|
-
/* @__PURE__ */
|
|
5345
|
-
/* @__PURE__ */
|
|
5444
|
+
return /* @__PURE__ */ jsxs12(Box12, { flexDirection: "column", paddingX: 1, children: [
|
|
5445
|
+
/* @__PURE__ */ jsx13(Text12, { bold: true, children: "Chat" }),
|
|
5446
|
+
/* @__PURE__ */ jsx13(Text12, { dimColor: true, children: " AI is not available. Press s to open settings and add your Anthropic API key." })
|
|
5346
5447
|
] });
|
|
5347
5448
|
}
|
|
5348
|
-
return /* @__PURE__ */
|
|
5349
|
-
/* @__PURE__ */
|
|
5350
|
-
/* @__PURE__ */
|
|
5351
|
-
messages.length === 0 && !loading && /* @__PURE__ */
|
|
5352
|
-
messages.map((msg, idx) => /* @__PURE__ */
|
|
5449
|
+
return /* @__PURE__ */ jsxs12(Box12, { flexDirection: "column", paddingX: 1, flexGrow: 1, children: [
|
|
5450
|
+
/* @__PURE__ */ jsx13(Text12, { bold: true, children: "Chat" }),
|
|
5451
|
+
/* @__PURE__ */ jsxs12(Box12, { flexDirection: "column", flexGrow: 1, overflow: "hidden", marginTop: 1, children: [
|
|
5452
|
+
messages.length === 0 && !loading && /* @__PURE__ */ jsx13(Text12, { dimColor: true, children: " Ask about your codebase, decisions, patterns, or risks." }),
|
|
5453
|
+
messages.map((msg, idx) => /* @__PURE__ */ jsx13(Box12, { flexDirection: "column", marginTop: idx === 0 ? 0 : 1, marginBottom: 1, children: msg.role === "user" ? /* @__PURE__ */ jsxs12(Text12, { children: [
|
|
5353
5454
|
" ",
|
|
5354
|
-
/* @__PURE__ */
|
|
5455
|
+
/* @__PURE__ */ jsx13(Text12, { bold: true, color: "green", children: "You:" }),
|
|
5355
5456
|
" ",
|
|
5356
5457
|
msg.content
|
|
5357
|
-
] }) : /* @__PURE__ */
|
|
5358
|
-
msg.toolCalls && msg.toolCalls.length > 0 && msg.toolCalls.map((tc, ti) => /* @__PURE__ */
|
|
5458
|
+
] }) : /* @__PURE__ */ jsxs12(Box12, { flexDirection: "column", children: [
|
|
5459
|
+
msg.toolCalls && msg.toolCalls.length > 0 && msg.toolCalls.map((tc, ti) => /* @__PURE__ */ jsxs12(Text12, { dimColor: true, children: [
|
|
5359
5460
|
" ",
|
|
5360
|
-
/* @__PURE__ */
|
|
5461
|
+
/* @__PURE__ */ jsxs12(Text12, { color: "yellow", children: [
|
|
5361
5462
|
"[",
|
|
5362
5463
|
tc.name,
|
|
5363
5464
|
"]"
|
|
@@ -5365,16 +5466,16 @@ ${contextBlock}`;
|
|
|
5365
5466
|
" ",
|
|
5366
5467
|
formatToolInput(tc.input)
|
|
5367
5468
|
] }, ti)),
|
|
5368
|
-
msg.content.split("\n").map((line, li) => /* @__PURE__ */
|
|
5469
|
+
msg.content.split("\n").map((line, li) => /* @__PURE__ */ jsxs12(Text12, { children: [
|
|
5369
5470
|
li === 0 ? " Trie: " : " ",
|
|
5370
5471
|
line
|
|
5371
5472
|
] }, li))
|
|
5372
5473
|
] }) }, idx)),
|
|
5373
|
-
loading && /* @__PURE__ */
|
|
5474
|
+
loading && /* @__PURE__ */ jsx13(Text12, { dimColor: true, children: " Thinking..." })
|
|
5374
5475
|
] }),
|
|
5375
|
-
/* @__PURE__ */
|
|
5376
|
-
inputBuffer || /* @__PURE__ */
|
|
5377
|
-
/* @__PURE__ */
|
|
5476
|
+
/* @__PURE__ */ jsx13(Box12, { borderStyle: "single", borderColor: "green", paddingX: 1, flexShrink: 0, children: /* @__PURE__ */ jsxs12(Text12, { children: [
|
|
5477
|
+
inputBuffer || /* @__PURE__ */ jsx13(Text12, { dimColor: true, children: "Ask a question..." }),
|
|
5478
|
+
/* @__PURE__ */ jsx13(Text12, { bold: true, color: "green", children: "|" })
|
|
5378
5479
|
] }) })
|
|
5379
5480
|
] });
|
|
5380
5481
|
}
|
|
@@ -5389,7 +5490,7 @@ function formatToolInput(input) {
|
|
|
5389
5490
|
}
|
|
5390
5491
|
|
|
5391
5492
|
// src/cli/dashboard/App.tsx
|
|
5392
|
-
import { jsx as
|
|
5493
|
+
import { jsx as jsx14, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
5393
5494
|
var MAIN_VIEWS = ["overview", "memory", "goals", "hypotheses", "agent", "chat"];
|
|
5394
5495
|
async function applyGoalFix(fix, dispatch) {
|
|
5395
5496
|
try {
|
|
@@ -5445,6 +5546,7 @@ function DashboardApp({ onReady }) {
|
|
|
5445
5546
|
const { state, dispatch } = useDashboard();
|
|
5446
5547
|
const { exit } = useApp();
|
|
5447
5548
|
const [showConfig, setShowConfig] = useState2(false);
|
|
5549
|
+
const [showHelp, setShowHelp] = useState2(false);
|
|
5448
5550
|
const dispatchRef = useRef2(dispatch);
|
|
5449
5551
|
dispatchRef.current = dispatch;
|
|
5450
5552
|
const stateRef = useRef2(state);
|
|
@@ -5604,6 +5706,14 @@ function DashboardApp({ onReady }) {
|
|
|
5604
5706
|
if (showConfig) return;
|
|
5605
5707
|
if (state.view === "goals" && state.goalsPanel.inputMode === "add") return;
|
|
5606
5708
|
if (state.view === "hypotheses" && state.hypothesesPanel.inputMode === "add") return;
|
|
5709
|
+
if ((input === "/" || input === "?") && state.view !== "chat") {
|
|
5710
|
+
setShowHelp(!showHelp);
|
|
5711
|
+
return;
|
|
5712
|
+
}
|
|
5713
|
+
if (showHelp) {
|
|
5714
|
+
setShowHelp(false);
|
|
5715
|
+
return;
|
|
5716
|
+
}
|
|
5607
5717
|
if (state.view === "chat") {
|
|
5608
5718
|
if (key.tab) {
|
|
5609
5719
|
const currentIndex = MAIN_VIEWS.indexOf(state.view);
|
|
@@ -5663,41 +5773,41 @@ function DashboardApp({ onReady }) {
|
|
|
5663
5773
|
let viewComponent;
|
|
5664
5774
|
switch (state.view) {
|
|
5665
5775
|
case "overview":
|
|
5666
|
-
viewComponent = /* @__PURE__ */
|
|
5776
|
+
viewComponent = /* @__PURE__ */ jsx14(OverviewView, {});
|
|
5667
5777
|
break;
|
|
5668
5778
|
case "agent":
|
|
5669
|
-
viewComponent = /* @__PURE__ */
|
|
5779
|
+
viewComponent = /* @__PURE__ */ jsx14(AgentView, {});
|
|
5670
5780
|
break;
|
|
5671
5781
|
case "goals":
|
|
5672
|
-
viewComponent = /* @__PURE__ */
|
|
5782
|
+
viewComponent = /* @__PURE__ */ jsx14(GoalsView, {});
|
|
5673
5783
|
break;
|
|
5674
5784
|
case "hypotheses":
|
|
5675
|
-
viewComponent = /* @__PURE__ */
|
|
5785
|
+
viewComponent = /* @__PURE__ */ jsx14(HypothesesView, {});
|
|
5676
5786
|
break;
|
|
5677
5787
|
case "memory":
|
|
5678
|
-
viewComponent = /* @__PURE__ */
|
|
5788
|
+
viewComponent = /* @__PURE__ */ jsx14(MemoryTreeView, {});
|
|
5679
5789
|
break;
|
|
5680
5790
|
case "rawlog":
|
|
5681
|
-
viewComponent = /* @__PURE__ */
|
|
5791
|
+
viewComponent = /* @__PURE__ */ jsx14(RawLogView, {});
|
|
5682
5792
|
break;
|
|
5683
5793
|
case "chat":
|
|
5684
|
-
viewComponent = /* @__PURE__ */
|
|
5794
|
+
viewComponent = /* @__PURE__ */ jsx14(ChatView, {});
|
|
5685
5795
|
break;
|
|
5686
5796
|
default:
|
|
5687
|
-
viewComponent = /* @__PURE__ */
|
|
5797
|
+
viewComponent = /* @__PURE__ */ jsx14(OverviewView, {});
|
|
5688
5798
|
}
|
|
5689
|
-
return /* @__PURE__ */
|
|
5690
|
-
/* @__PURE__ */
|
|
5691
|
-
!showConfig && /* @__PURE__ */
|
|
5692
|
-
/* @__PURE__ */
|
|
5799
|
+
return /* @__PURE__ */ jsxs13(Box13, { flexDirection: "column", height: process.stdout.rows || 40, children: [
|
|
5800
|
+
/* @__PURE__ */ jsx14(Header, {}),
|
|
5801
|
+
!showConfig && !showHelp && /* @__PURE__ */ jsx14(Notification, {}),
|
|
5802
|
+
/* @__PURE__ */ jsx14(Box13, { flexGrow: 1, flexDirection: "column", overflow: "hidden", children: showConfig ? /* @__PURE__ */ jsx14(ConfigDialog, { onClose: () => {
|
|
5693
5803
|
setShowConfig(false);
|
|
5694
5804
|
void persistConfig();
|
|
5695
|
-
} }) : viewComponent }),
|
|
5696
|
-
/* @__PURE__ */
|
|
5805
|
+
} }) : showHelp ? /* @__PURE__ */ jsx14(HelpDialog, { view: state.view, onClose: () => setShowHelp(false) }) : viewComponent }),
|
|
5806
|
+
/* @__PURE__ */ jsx14(Footer, {})
|
|
5697
5807
|
] });
|
|
5698
5808
|
}
|
|
5699
5809
|
function App({ onReady }) {
|
|
5700
|
-
return /* @__PURE__ */
|
|
5810
|
+
return /* @__PURE__ */ jsx14(DashboardProvider, { children: /* @__PURE__ */ jsx14(DashboardApp, { onReady }) });
|
|
5701
5811
|
}
|
|
5702
5812
|
|
|
5703
5813
|
// src/cli/dashboard/index.ts
|
|
@@ -5707,7 +5817,7 @@ var InteractiveDashboard = class {
|
|
|
5707
5817
|
getConfigFn = null;
|
|
5708
5818
|
async start() {
|
|
5709
5819
|
this.app = render(
|
|
5710
|
-
|
|
5820
|
+
React10.createElement(App, {
|
|
5711
5821
|
onReady: (handler, getConfig) => {
|
|
5712
5822
|
this.updateHandler = handler;
|
|
5713
5823
|
this.getConfigFn = getConfig;
|
|
@@ -5752,4 +5862,4 @@ export {
|
|
|
5752
5862
|
handleCheckpointTool,
|
|
5753
5863
|
InteractiveDashboard
|
|
5754
5864
|
};
|
|
5755
|
-
//# sourceMappingURL=chunk-
|
|
5865
|
+
//# sourceMappingURL=chunk-7BY2KVIN.js.map
|