@ganakailabs/cloudeval-cli 0.21.1 → 0.22.0
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/README.md +5 -0
- package/dist/{App-77Q76GI5.js → App-7ZEWM5DC.js} +914 -621
- package/dist/{Banner-43UE3WHI.js → Banner-Z2XN5FGK.js} +2 -2
- package/dist/{chunk-74TONCUI.js → chunk-AF6Z5VZD.js} +1 -1
- package/dist/{chunk-6AHSCVTF.js → chunk-TTE5NEMA.js} +19 -4
- package/dist/cli.js +4 -4
- package/package.json +2 -2
- package/sbom.spdx.json +1 -1
|
@@ -38,10 +38,10 @@ import {
|
|
|
38
38
|
} from "./chunk-LDDHLUZH.js";
|
|
39
39
|
import {
|
|
40
40
|
Banner
|
|
41
|
-
} from "./chunk-
|
|
41
|
+
} from "./chunk-TTE5NEMA.js";
|
|
42
42
|
import {
|
|
43
43
|
CLI_VERSION
|
|
44
|
-
} from "./chunk-
|
|
44
|
+
} from "./chunk-AF6Z5VZD.js";
|
|
45
45
|
import {
|
|
46
46
|
raisedButtonStyle,
|
|
47
47
|
terminalTheme
|
|
@@ -49,7 +49,7 @@ import {
|
|
|
49
49
|
|
|
50
50
|
// src/ui/App.tsx
|
|
51
51
|
import React8, { useEffect as useEffect4, useMemo, useState as useState4, startTransition } from "react";
|
|
52
|
-
import { Box as Box9, Text as
|
|
52
|
+
import { Box as Box9, Text as Text12, useApp, useInput as useInput4 } from "ink";
|
|
53
53
|
import { ScrollView } from "ink-scroll-view";
|
|
54
54
|
import { randomUUID as randomUUID2 } from "crypto";
|
|
55
55
|
import { spawn } from "child_process";
|
|
@@ -325,11 +325,13 @@ var TitledBox = ({
|
|
|
325
325
|
...boxProps
|
|
326
326
|
}) => {
|
|
327
327
|
const labelColor = titleColor ?? (typeof borderColor === "string" ? borderColor : void 0);
|
|
328
|
+
const clipContent = boxProps.height !== void 0;
|
|
328
329
|
return /* @__PURE__ */ jsxs2(
|
|
329
330
|
Box2,
|
|
330
331
|
{
|
|
331
332
|
...boxProps,
|
|
332
333
|
flexDirection: "column",
|
|
334
|
+
overflow: clipContent ? "hidden" : void 0,
|
|
333
335
|
borderStyle,
|
|
334
336
|
borderColor,
|
|
335
337
|
padding,
|
|
@@ -355,6 +357,8 @@ var TitledBox = ({
|
|
|
355
357
|
alignItems,
|
|
356
358
|
justifyContent,
|
|
357
359
|
flexWrap,
|
|
360
|
+
overflow: clipContent ? "hidden" : void 0,
|
|
361
|
+
height: clipContent ? "100%" : void 0,
|
|
358
362
|
children
|
|
359
363
|
}
|
|
360
364
|
)
|
|
@@ -768,7 +772,7 @@ var Transcript = ({
|
|
|
768
772
|
|
|
769
773
|
// src/ui/components/InputBox.tsx
|
|
770
774
|
import { useEffect as useEffect2, useState as useState2 } from "react";
|
|
771
|
-
import { Box as Box4, Text as
|
|
775
|
+
import { Box as Box4, Text as Text6, useInput } from "ink";
|
|
772
776
|
|
|
773
777
|
// src/ui/inputSanitizer.ts
|
|
774
778
|
var SGR_MOUSE_SEQUENCE = /\x1b?\[<\d+;\d+;\d+[mM]/g;
|
|
@@ -942,8 +946,26 @@ var workspaceTabFromPosition = (column, row, areas) => areas.find(
|
|
|
942
946
|
(area) => column >= area.startColumn && column <= area.endColumn && row >= area.startRow && row <= area.endRow
|
|
943
947
|
)?.tab;
|
|
944
948
|
|
|
949
|
+
// src/ui/components/InputHelpText.tsx
|
|
950
|
+
import { Text as Text5 } from "ink";
|
|
951
|
+
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
952
|
+
var SLASH_COMMAND_PATTERN = /(\/[a-z][a-z0-9_-]*)/gi;
|
|
953
|
+
var InputHelpText = ({ text }) => {
|
|
954
|
+
const parts = text.split(SLASH_COMMAND_PATTERN);
|
|
955
|
+
if (parts.length === 1) {
|
|
956
|
+
return /* @__PURE__ */ jsx5(Text5, { dimColor: true, wrap: "truncate", children: text });
|
|
957
|
+
}
|
|
958
|
+
return /* @__PURE__ */ jsx5(Text5, { wrap: "truncate", children: parts.map((part, index) => {
|
|
959
|
+
if (part.startsWith("/")) {
|
|
960
|
+
return /* @__PURE__ */ jsx5(Text5, { color: terminalTheme.accent, bold: true, children: part }, `${part}-${index}`);
|
|
961
|
+
}
|
|
962
|
+
return /* @__PURE__ */ jsx5(Text5, { dimColor: true, children: part }, `${part}-${index}`);
|
|
963
|
+
}) });
|
|
964
|
+
};
|
|
965
|
+
|
|
945
966
|
// src/ui/components/InputBox.tsx
|
|
946
|
-
import { Fragment, jsx as
|
|
967
|
+
import { Fragment, jsx as jsx6, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
968
|
+
var COMMAND_MENU_VISIBLE_ROWS = 5;
|
|
947
969
|
var shouldAnimateInputCursor = ({
|
|
948
970
|
disabled,
|
|
949
971
|
inputActive = true,
|
|
@@ -1002,7 +1024,7 @@ var Scrollbar = ({
|
|
|
1002
1024
|
visibleRows - 1,
|
|
1003
1025
|
Math.max(0, Math.round(startRow / maxStart * (visibleRows - 1)))
|
|
1004
1026
|
);
|
|
1005
|
-
return /* @__PURE__ */
|
|
1027
|
+
return /* @__PURE__ */ jsx6(Box4, { flexDirection: "column", marginLeft: 1, children: Array.from({ length: visibleRows }, (_, index) => /* @__PURE__ */ jsx6(Text6, { color: index === thumbIndex ? terminalTheme.focus : terminalTheme.muted, children: index === thumbIndex ? "\u2503" : "\u2502" }, index)) });
|
|
1006
1028
|
};
|
|
1007
1029
|
var truncateInline = (value, maxLength) => {
|
|
1008
1030
|
if (value.length <= maxLength) {
|
|
@@ -1090,20 +1112,65 @@ var getFollowUpRowViewport = ({
|
|
|
1090
1112
|
rowCount: 1
|
|
1091
1113
|
};
|
|
1092
1114
|
};
|
|
1093
|
-
var
|
|
1115
|
+
var estimateCommandCompletionRows = (commandCount, terminalColumns) => {
|
|
1116
|
+
if (!commandCount) {
|
|
1117
|
+
return 0;
|
|
1118
|
+
}
|
|
1119
|
+
const layout = getCommandCompletionLayout({
|
|
1120
|
+
commands: Array.from({ length: commandCount }, (_, index) => ({
|
|
1121
|
+
name: `/cmd-${index}`,
|
|
1122
|
+
description: ""
|
|
1123
|
+
})),
|
|
1124
|
+
focusedIndex: 0,
|
|
1125
|
+
terminalColumns
|
|
1126
|
+
});
|
|
1127
|
+
return layout.rowCount;
|
|
1128
|
+
};
|
|
1129
|
+
var getCommandCompletionLayout = ({
|
|
1094
1130
|
commands,
|
|
1095
1131
|
focusedIndex = 0,
|
|
1096
1132
|
terminalColumns
|
|
1097
1133
|
}) => {
|
|
1098
|
-
const availableWidth = Math.max(24, terminalColumns - 28);
|
|
1099
1134
|
const activeIndex = commands.length ? Math.min(Math.max(0, focusedIndex), commands.length - 1) : 0;
|
|
1135
|
+
const activeCommand = commands[activeIndex];
|
|
1136
|
+
const useVertical = commands.length >= 5 || terminalColumns < 100 || commands.some((command) => command.name.length > 14);
|
|
1137
|
+
if (!commands.length) {
|
|
1138
|
+
return {
|
|
1139
|
+
mode: "vertical",
|
|
1140
|
+
activeIndex: 0,
|
|
1141
|
+
items: [],
|
|
1142
|
+
clippedStart: false,
|
|
1143
|
+
clippedEnd: false,
|
|
1144
|
+
rowCount: 0
|
|
1145
|
+
};
|
|
1146
|
+
}
|
|
1147
|
+
if (useVertical) {
|
|
1148
|
+
const visibleCount = Math.min(COMMAND_MENU_VISIBLE_ROWS, commands.length);
|
|
1149
|
+
let start2 = Math.max(0, activeIndex - Math.floor(visibleCount / 2));
|
|
1150
|
+
if (start2 + visibleCount > commands.length) {
|
|
1151
|
+
start2 = Math.max(0, commands.length - visibleCount);
|
|
1152
|
+
}
|
|
1153
|
+
const end2 = Math.min(commands.length, start2 + visibleCount);
|
|
1154
|
+
const items2 = commands.slice(start2, end2).map((command, offset) => {
|
|
1155
|
+
const index = start2 + offset;
|
|
1156
|
+
const label = `${index === activeIndex ? raisedButtonStyle.activeMarker : raisedButtonStyle.inactiveMarker} ${command.name}`;
|
|
1157
|
+
return { command, index, label, width: label.length };
|
|
1158
|
+
});
|
|
1159
|
+
return {
|
|
1160
|
+
mode: "vertical",
|
|
1161
|
+
activeIndex,
|
|
1162
|
+
activeCommand,
|
|
1163
|
+
items: items2,
|
|
1164
|
+
clippedStart: start2 > 0,
|
|
1165
|
+
clippedEnd: end2 < commands.length,
|
|
1166
|
+
rowCount: 1 + items2.length + 1 + 1
|
|
1167
|
+
};
|
|
1168
|
+
}
|
|
1169
|
+
const availableWidth = Math.max(24, terminalColumns - 28);
|
|
1100
1170
|
const items = commands.map((command, index) => {
|
|
1101
1171
|
const label = `${index === activeIndex ? raisedButtonStyle.activeMarker : raisedButtonStyle.inactiveMarker} ${command.name}`;
|
|
1102
1172
|
return { command, index, label, width: label.length };
|
|
1103
1173
|
});
|
|
1104
|
-
if (!items.length) {
|
|
1105
|
-
return { items: [], clippedStart: false, clippedEnd: false, rowCount: 0 };
|
|
1106
|
-
}
|
|
1107
1174
|
let start = activeIndex;
|
|
1108
1175
|
let usedWidth = items[start]?.width ?? 0;
|
|
1109
1176
|
while (start > 0) {
|
|
@@ -1124,10 +1191,13 @@ var getCommandCompletionViewport = ({
|
|
|
1124
1191
|
end++;
|
|
1125
1192
|
}
|
|
1126
1193
|
return {
|
|
1194
|
+
mode: "horizontal",
|
|
1195
|
+
activeIndex,
|
|
1196
|
+
activeCommand,
|
|
1127
1197
|
items: items.slice(start, end),
|
|
1128
1198
|
clippedStart: start > 0,
|
|
1129
1199
|
clippedEnd: end < items.length,
|
|
1130
|
-
rowCount:
|
|
1200
|
+
rowCount: 2
|
|
1131
1201
|
};
|
|
1132
1202
|
};
|
|
1133
1203
|
var InputBox = ({
|
|
@@ -1171,20 +1241,18 @@ var InputBox = ({
|
|
|
1171
1241
|
focusedFollowUpIndex,
|
|
1172
1242
|
terminalColumns
|
|
1173
1243
|
});
|
|
1174
|
-
const
|
|
1244
|
+
const commandCompletionLayout = getCommandCompletionLayout({
|
|
1175
1245
|
commands: commandCompletions,
|
|
1176
1246
|
focusedIndex: focusedCommandCompletionIndex,
|
|
1177
1247
|
terminalColumns
|
|
1178
1248
|
});
|
|
1179
|
-
const
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
Math.max(0, commandCompletions.length - 1)
|
|
1187
|
-
)];
|
|
1249
|
+
const activeCommand = commandCompletionLayout.activeCommand;
|
|
1250
|
+
const commandCompletionNavigationHint = [
|
|
1251
|
+
commandCompletionLayout.clippedStart ? "\u2191 more" : void 0,
|
|
1252
|
+
"Tab/\u2191\u2193 move",
|
|
1253
|
+
"Enter choose",
|
|
1254
|
+
commandCompletionLayout.clippedEnd ? "\u2193 more" : void 0
|
|
1255
|
+
].filter(Boolean).join(" \xB7 ");
|
|
1188
1256
|
const promptPrefix = ">";
|
|
1189
1257
|
const inputWidth = Math.max(20, terminalColumns - 10);
|
|
1190
1258
|
const inputViewport = getInputViewport({
|
|
@@ -1279,13 +1347,13 @@ var InputBox = ({
|
|
|
1279
1347
|
const cursorColor = getInputCursorColor({ disabled, inputActive, cursorVisible });
|
|
1280
1348
|
const inputBorderColor = disabled ? terminalTheme.muted : followUpsActive || inputActive ? terminalTheme.focus : terminalTheme.muted;
|
|
1281
1349
|
const content = /* @__PURE__ */ jsxs4(Fragment, { children: [
|
|
1282
|
-
followUps.length ? /* @__PURE__ */ jsxs4(
|
|
1283
|
-
/* @__PURE__ */
|
|
1284
|
-
followUpViewport.clippedStart ? /* @__PURE__ */
|
|
1350
|
+
followUps.length ? /* @__PURE__ */ jsxs4(Text6, { wrap: "truncate", children: [
|
|
1351
|
+
/* @__PURE__ */ jsx6(Text6, { dimColor: true, children: `${followUpsLabel}: ` }),
|
|
1352
|
+
followUpViewport.clippedStart ? /* @__PURE__ */ jsx6(Text6, { dimColor: true, children: "<-- " }) : null,
|
|
1285
1353
|
followUpViewport.items.map(({ question, index, label }) => {
|
|
1286
1354
|
const focused = followUpsActive && focusedFollowUpIndex === index;
|
|
1287
1355
|
return /* @__PURE__ */ jsxs4(
|
|
1288
|
-
|
|
1356
|
+
Text6,
|
|
1289
1357
|
{
|
|
1290
1358
|
color: focused ? terminalTheme.focus : void 0,
|
|
1291
1359
|
bold: focused,
|
|
@@ -1299,30 +1367,30 @@ var InputBox = ({
|
|
|
1299
1367
|
`${index}-${question}`
|
|
1300
1368
|
);
|
|
1301
1369
|
}),
|
|
1302
|
-
followUpViewport.clippedEnd ? /* @__PURE__ */
|
|
1370
|
+
followUpViewport.clippedEnd ? /* @__PURE__ */ jsx6(Text6, { dimColor: true, children: "-->" }) : null
|
|
1303
1371
|
] }) : null,
|
|
1304
1372
|
/* @__PURE__ */ jsxs4(
|
|
1305
1373
|
Box4,
|
|
1306
1374
|
{
|
|
1307
1375
|
flexDirection: compact ? "column" : "row",
|
|
1308
1376
|
children: [
|
|
1309
|
-
/* @__PURE__ */
|
|
1310
|
-
/* @__PURE__ */ jsxs4(
|
|
1377
|
+
/* @__PURE__ */ jsx6(Box4, { flexDirection: "column", flexGrow: 1, children: !value ? /* @__PURE__ */ jsxs4(Text6, { wrap: "truncate", children: [
|
|
1378
|
+
/* @__PURE__ */ jsxs4(Text6, { color: inputActive ? terminalTheme.brand : terminalTheme.muted, children: [
|
|
1311
1379
|
promptPrefix,
|
|
1312
1380
|
" "
|
|
1313
1381
|
] }),
|
|
1314
|
-
/* @__PURE__ */
|
|
1315
|
-
/* @__PURE__ */
|
|
1382
|
+
/* @__PURE__ */ jsx6(Text6, { color: cursorColor, children: cursorGlyph }),
|
|
1383
|
+
/* @__PURE__ */ jsx6(Text6, { dimColor: true, children: ` ${placeholder}` })
|
|
1316
1384
|
] }) : promptRows.map((row, index) => {
|
|
1317
|
-
return /* @__PURE__ */ jsxs4(
|
|
1318
|
-
row.showPromptPrefix ? /* @__PURE__ */ jsxs4(
|
|
1385
|
+
return /* @__PURE__ */ jsxs4(Text6, { wrap: "truncate", children: [
|
|
1386
|
+
row.showPromptPrefix ? /* @__PURE__ */ jsxs4(Text6, { color: inputActive ? terminalTheme.brand : terminalTheme.muted, children: [
|
|
1319
1387
|
promptPrefix,
|
|
1320
1388
|
" "
|
|
1321
|
-
] }) : /* @__PURE__ */
|
|
1389
|
+
] }) : /* @__PURE__ */ jsx6(Text6, { children: " " }),
|
|
1322
1390
|
row.line,
|
|
1323
1391
|
row.showCursor ? /* @__PURE__ */ jsxs4(Fragment, { children: [
|
|
1324
|
-
/* @__PURE__ */
|
|
1325
|
-
|
|
1392
|
+
/* @__PURE__ */ jsx6(
|
|
1393
|
+
Text6,
|
|
1326
1394
|
{
|
|
1327
1395
|
dimColor: true,
|
|
1328
1396
|
italic: true,
|
|
@@ -1330,11 +1398,11 @@ var InputBox = ({
|
|
|
1330
1398
|
children: ghostText ?? ""
|
|
1331
1399
|
}
|
|
1332
1400
|
),
|
|
1333
|
-
/* @__PURE__ */
|
|
1401
|
+
/* @__PURE__ */ jsx6(Text6, { color: cursorColor, children: cursorGlyph })
|
|
1334
1402
|
] }) : null
|
|
1335
1403
|
] }, `${startRow}-${index}`);
|
|
1336
1404
|
}) }),
|
|
1337
|
-
/* @__PURE__ */
|
|
1405
|
+
/* @__PURE__ */ jsx6(
|
|
1338
1406
|
Scrollbar,
|
|
1339
1407
|
{
|
|
1340
1408
|
totalRows: inputRows.length,
|
|
@@ -1345,20 +1413,42 @@ var InputBox = ({
|
|
|
1345
1413
|
]
|
|
1346
1414
|
}
|
|
1347
1415
|
),
|
|
1348
|
-
actionHint ? /* @__PURE__ */
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
{
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1416
|
+
actionHint ? /* @__PURE__ */ jsx6(Text6, { dimColor: true, wrap: "truncate", children: actionHint }) : resolvedHelpText ? /* @__PURE__ */ jsx6(InputHelpText, { text: resolvedHelpText }) : null,
|
|
1417
|
+
commandCompletionLayout.items.length ? /* @__PURE__ */ jsxs4(Box4, { flexDirection: "column", children: [
|
|
1418
|
+
/* @__PURE__ */ jsx6(Text6, { color: terminalTheme.muted, bold: commandCompletionsActive, children: "Slash commands" }),
|
|
1419
|
+
commandCompletionLayout.mode === "vertical" ? commandCompletionLayout.items.map((item) => {
|
|
1420
|
+
const active = item.index === commandCompletionLayout.activeIndex;
|
|
1421
|
+
return /* @__PURE__ */ jsx6(
|
|
1422
|
+
Text6,
|
|
1423
|
+
{
|
|
1424
|
+
backgroundColor: active ? terminalTheme.selectedBackground : void 0,
|
|
1425
|
+
color: active ? terminalTheme.selected : terminalTheme.muted,
|
|
1426
|
+
bold: active,
|
|
1427
|
+
wrap: "truncate",
|
|
1428
|
+
children: item.label
|
|
1429
|
+
},
|
|
1430
|
+
item.command.name
|
|
1431
|
+
);
|
|
1432
|
+
}) : /* @__PURE__ */ jsx6(
|
|
1433
|
+
Text6,
|
|
1434
|
+
{
|
|
1435
|
+
color: commandCompletionsActive ? terminalTheme.focus : terminalTheme.muted,
|
|
1436
|
+
bold: commandCompletionsActive,
|
|
1437
|
+
wrap: "truncate",
|
|
1438
|
+
children: [
|
|
1439
|
+
commandCompletionLayout.clippedStart ? "\u2026" : void 0,
|
|
1440
|
+
...commandCompletionLayout.items.map((item) => item.label),
|
|
1441
|
+
commandCompletionLayout.clippedEnd ? "\u2026" : void 0
|
|
1442
|
+
].filter(Boolean).join(" ")
|
|
1443
|
+
}
|
|
1444
|
+
),
|
|
1445
|
+
activeCommand?.description ? /* @__PURE__ */ jsx6(Text6, { color: terminalTheme.secondary, wrap: "truncate", children: activeCommand.description }) : null,
|
|
1446
|
+
/* @__PURE__ */ jsx6(Text6, { dimColor: true, wrap: "truncate", children: commandCompletionNavigationHint })
|
|
1447
|
+
] }) : null,
|
|
1448
|
+
footerControls ? /* @__PURE__ */ jsx6(Box4, { flexDirection: "column", marginTop: 1, children: footerControls }) : null
|
|
1359
1449
|
] });
|
|
1360
1450
|
if (variant === "dock") {
|
|
1361
|
-
return /* @__PURE__ */
|
|
1451
|
+
return /* @__PURE__ */ jsx6(
|
|
1362
1452
|
Box4,
|
|
1363
1453
|
{
|
|
1364
1454
|
flexDirection: "column",
|
|
@@ -1369,7 +1459,7 @@ var InputBox = ({
|
|
|
1369
1459
|
}
|
|
1370
1460
|
);
|
|
1371
1461
|
}
|
|
1372
|
-
return /* @__PURE__ */
|
|
1462
|
+
return /* @__PURE__ */ jsx6(
|
|
1373
1463
|
TitledBox,
|
|
1374
1464
|
{
|
|
1375
1465
|
title,
|
|
@@ -1382,9 +1472,276 @@ var InputBox = ({
|
|
|
1382
1472
|
);
|
|
1383
1473
|
};
|
|
1384
1474
|
|
|
1475
|
+
// src/ui/components/NoticeLine.tsx
|
|
1476
|
+
import { Text as Text7 } from "ink";
|
|
1477
|
+
|
|
1478
|
+
// src/ui/noticeTone.ts
|
|
1479
|
+
var matchesAny = (message, patterns) => patterns.some((pattern) => pattern.test(message));
|
|
1480
|
+
var classifyNoticeTone = (message) => {
|
|
1481
|
+
const normalized = message.trim();
|
|
1482
|
+
if (!normalized) {
|
|
1483
|
+
return "neutral";
|
|
1484
|
+
}
|
|
1485
|
+
if (matchesAny(normalized, [
|
|
1486
|
+
/^failed\b/i,
|
|
1487
|
+
/\bfailed:/i,
|
|
1488
|
+
/^error\b/i,
|
|
1489
|
+
/\bunavailable\b/i,
|
|
1490
|
+
/^cannot\b/i,
|
|
1491
|
+
/^could not\b/i,
|
|
1492
|
+
/^copy failed\b/i,
|
|
1493
|
+
/^no assistant response\b/i,
|
|
1494
|
+
/^no chat transcript\b/i,
|
|
1495
|
+
/^sign in before\b/i
|
|
1496
|
+
])) {
|
|
1497
|
+
return "danger";
|
|
1498
|
+
}
|
|
1499
|
+
if (matchesAny(normalized, [
|
|
1500
|
+
/^loading\b/i,
|
|
1501
|
+
/^submitting\b/i,
|
|
1502
|
+
/\.\.\.$/,
|
|
1503
|
+
/^stop the running\b/i,
|
|
1504
|
+
/^starter selections shown\b/i,
|
|
1505
|
+
/^type to edit\b/i
|
|
1506
|
+
])) {
|
|
1507
|
+
return "warning";
|
|
1508
|
+
}
|
|
1509
|
+
if (matchesAny(normalized, [
|
|
1510
|
+
/^downloaded\b/i,
|
|
1511
|
+
/^copied\b/i,
|
|
1512
|
+
/^loaded\b/i,
|
|
1513
|
+
/^started\b/i,
|
|
1514
|
+
/^project selected\b/i,
|
|
1515
|
+
/^model selected\b/i,
|
|
1516
|
+
/^profile selected\b/i,
|
|
1517
|
+
/^thread\b/i,
|
|
1518
|
+
/^report run submitted\b/i,
|
|
1519
|
+
/^agent profile cleared\b/i
|
|
1520
|
+
])) {
|
|
1521
|
+
return "success";
|
|
1522
|
+
}
|
|
1523
|
+
if (matchesAny(normalized, [
|
|
1524
|
+
/^frontend link:/i,
|
|
1525
|
+
/^open frontend manually:/i,
|
|
1526
|
+
/^open session was not found\b/i,
|
|
1527
|
+
/^cannot resume\b/i,
|
|
1528
|
+
/^local threads unavailable\b/i,
|
|
1529
|
+
/^cloud threads unavailable\b/i,
|
|
1530
|
+
/queued:/i
|
|
1531
|
+
])) {
|
|
1532
|
+
return "info";
|
|
1533
|
+
}
|
|
1534
|
+
return "neutral";
|
|
1535
|
+
};
|
|
1536
|
+
|
|
1537
|
+
// src/ui/components/NoticeLine.tsx
|
|
1538
|
+
import { jsx as jsx7 } from "react/jsx-runtime";
|
|
1539
|
+
var toneColor = (tone) => {
|
|
1540
|
+
switch (tone) {
|
|
1541
|
+
case "success":
|
|
1542
|
+
return terminalTheme.success;
|
|
1543
|
+
case "warning":
|
|
1544
|
+
return terminalTheme.warning;
|
|
1545
|
+
case "danger":
|
|
1546
|
+
return terminalTheme.danger;
|
|
1547
|
+
case "info":
|
|
1548
|
+
return terminalTheme.secondary;
|
|
1549
|
+
default:
|
|
1550
|
+
return terminalTheme.muted;
|
|
1551
|
+
}
|
|
1552
|
+
};
|
|
1553
|
+
var NoticeLine = ({ message }) => {
|
|
1554
|
+
const tone = classifyNoticeTone(message);
|
|
1555
|
+
const color = toneColor(tone);
|
|
1556
|
+
const bold = tone === "success" || tone === "danger";
|
|
1557
|
+
return /* @__PURE__ */ jsx7(Text7, { wrap: "wrap", color, bold, children: message });
|
|
1558
|
+
};
|
|
1559
|
+
|
|
1560
|
+
// src/ui/layout.ts
|
|
1561
|
+
var clamp2 = (value, min, max) => Math.min(max, Math.max(min, value));
|
|
1562
|
+
var normalizeDimension = (value, fallback) => Number.isFinite(value) && value && value > 0 ? value : fallback;
|
|
1563
|
+
var BANNER_ART_WIDTH = 84;
|
|
1564
|
+
var BANNER_ART_ROWS = 6;
|
|
1565
|
+
var BANNER_WELCOME_ROWS = 1;
|
|
1566
|
+
var BANNER_VERSION_ROWS = 1;
|
|
1567
|
+
var BANNER_MARGIN_BOTTOM_ROWS = 1;
|
|
1568
|
+
var BANNER_SIDE_DETAILS_MIN_WIDTH = 42;
|
|
1569
|
+
var estimateBannerRows = ({
|
|
1570
|
+
columns,
|
|
1571
|
+
detailsCount = 3
|
|
1572
|
+
}) => {
|
|
1573
|
+
const showArt = columns >= BANNER_ART_WIDTH;
|
|
1574
|
+
const detailsBesideArt = showArt && detailsCount > 0 && columns >= BANNER_ART_WIDTH + BANNER_SIDE_DETAILS_MIN_WIDTH;
|
|
1575
|
+
const detailRows = BANNER_VERSION_ROWS + detailsCount;
|
|
1576
|
+
if (!showArt) {
|
|
1577
|
+
return detailRows + BANNER_MARGIN_BOTTOM_ROWS;
|
|
1578
|
+
}
|
|
1579
|
+
if (detailsBesideArt) {
|
|
1580
|
+
return BANNER_WELCOME_ROWS + Math.max(BANNER_ART_ROWS, detailRows) + BANNER_MARGIN_BOTTOM_ROWS;
|
|
1581
|
+
}
|
|
1582
|
+
return BANNER_WELCOME_ROWS + BANNER_ART_ROWS + detailRows + BANNER_MARGIN_BOTTOM_ROWS;
|
|
1583
|
+
};
|
|
1584
|
+
var getResponsiveTuiLayout = (size, options = {}) => {
|
|
1585
|
+
const columns = normalizeDimension(size.columns, 100);
|
|
1586
|
+
const rows = normalizeDimension(size.rows, 32);
|
|
1587
|
+
const compact = columns < 96 || rows < 30;
|
|
1588
|
+
const showBanner = !options.disableBanner;
|
|
1589
|
+
let reservedRows = 25 + Math.max(0, Math.ceil(options.promptInputRows ?? 2) - 2) + Math.max(0, Math.ceil(options.promptSuggestionRows ?? 0));
|
|
1590
|
+
if (showBanner) reservedRows += estimateBannerRows({ columns });
|
|
1591
|
+
if (options.hasQueue) reservedRows += 4;
|
|
1592
|
+
if (options.hasError) reservedRows += 4;
|
|
1593
|
+
if (options.hasHitl) reservedRows += 7;
|
|
1594
|
+
if (options.hasSelector) reservedRows += 8;
|
|
1595
|
+
if (options.isSearching) reservedRows += 3;
|
|
1596
|
+
const maxThreadHeight = compact ? 14 : 24;
|
|
1597
|
+
const availableRows = rows - reservedRows;
|
|
1598
|
+
return {
|
|
1599
|
+
compact,
|
|
1600
|
+
paddingX: compact ? 0 : 1,
|
|
1601
|
+
selectorLimit: compact ? 6 : 8,
|
|
1602
|
+
showBanner,
|
|
1603
|
+
threadHeight: clamp2(availableRows, 1, maxThreadHeight)
|
|
1604
|
+
};
|
|
1605
|
+
};
|
|
1606
|
+
var getMiddleViewportRows = (size, options = {}) => {
|
|
1607
|
+
const rows = normalizeDimension(size.rows, 32);
|
|
1608
|
+
const headerRows = Math.max(0, Math.ceil(options.headerRows ?? 0));
|
|
1609
|
+
const footerRows = Math.max(0, Math.ceil(options.footerRows ?? 0));
|
|
1610
|
+
const safetyRows = Math.max(0, Math.ceil(options.safetyRows ?? 2));
|
|
1611
|
+
return Math.max(1, Math.floor(rows) - headerRows - footerRows - safetyRows);
|
|
1612
|
+
};
|
|
1613
|
+
var getFramedBodyRows = (frameRows, chromeRows = 4) => Math.max(1, Math.floor(frameRows) - Math.max(0, Math.ceil(chromeRows)));
|
|
1614
|
+
var estimateWorkspaceTabBarRows = () => 2;
|
|
1615
|
+
var estimateSelectPanelRows = (visibleLimit) => 4 + Math.max(1, Math.ceil(visibleLimit));
|
|
1616
|
+
var getPromptInputRowBudget = (size) => {
|
|
1617
|
+
const rows = normalizeDimension(size.rows, 32);
|
|
1618
|
+
return clamp2(Math.floor(rows * 0.13), 4, 8);
|
|
1619
|
+
};
|
|
1620
|
+
var getChatResponsiveMode = (size) => {
|
|
1621
|
+
const columns = normalizeDimension(size.columns, 100);
|
|
1622
|
+
const rows = normalizeDimension(size.rows, 32);
|
|
1623
|
+
if (columns >= 132 && rows >= 40) {
|
|
1624
|
+
return "wide";
|
|
1625
|
+
}
|
|
1626
|
+
if (columns >= 112 && rows >= 34) {
|
|
1627
|
+
return "medium";
|
|
1628
|
+
}
|
|
1629
|
+
return "narrow";
|
|
1630
|
+
};
|
|
1631
|
+
var shouldUseSplitChatLayout = (size) => getChatResponsiveMode(size) !== "narrow";
|
|
1632
|
+
var getContextRailWidth = (size) => {
|
|
1633
|
+
const mode = getChatResponsiveMode(size);
|
|
1634
|
+
const columns = normalizeDimension(size.columns, 100);
|
|
1635
|
+
if (mode === "wide") {
|
|
1636
|
+
return Math.min(40, Math.max(34, Math.ceil(columns * 0.25)));
|
|
1637
|
+
}
|
|
1638
|
+
if (mode === "medium") {
|
|
1639
|
+
return Math.min(30, Math.max(28, Math.ceil(columns * 0.25)));
|
|
1640
|
+
}
|
|
1641
|
+
return 0;
|
|
1642
|
+
};
|
|
1643
|
+
var estimateComposerRows = ({
|
|
1644
|
+
inputRows,
|
|
1645
|
+
suggestionRows,
|
|
1646
|
+
includeControls = true,
|
|
1647
|
+
controlRows = 0,
|
|
1648
|
+
variant = "panel"
|
|
1649
|
+
}) => {
|
|
1650
|
+
const chromeRows = variant === "dock" ? 1 : 2;
|
|
1651
|
+
const inputRowsWithHint = inputRows + 1;
|
|
1652
|
+
const footerRows = includeControls ? controlRows : 0;
|
|
1653
|
+
return chromeRows + Math.max(0, suggestionRows) + inputRowsWithHint + footerRows;
|
|
1654
|
+
};
|
|
1655
|
+
var truncateForTerminal = (value, maxLength) => {
|
|
1656
|
+
if (maxLength <= 0) {
|
|
1657
|
+
return "";
|
|
1658
|
+
}
|
|
1659
|
+
if (value.length <= maxLength) {
|
|
1660
|
+
return value;
|
|
1661
|
+
}
|
|
1662
|
+
if (maxLength <= 3) {
|
|
1663
|
+
return ".".repeat(maxLength);
|
|
1664
|
+
}
|
|
1665
|
+
return `${value.slice(0, maxLength - 3)}...`;
|
|
1666
|
+
};
|
|
1667
|
+
|
|
1668
|
+
// src/ui/bannerDetails.ts
|
|
1669
|
+
var labelSegment = (label) => ({
|
|
1670
|
+
text: label,
|
|
1671
|
+
dimColor: true
|
|
1672
|
+
});
|
|
1673
|
+
var valueSegment = (value, color) => ({
|
|
1674
|
+
text: value,
|
|
1675
|
+
color
|
|
1676
|
+
});
|
|
1677
|
+
var creditToneColor = (tone) => {
|
|
1678
|
+
if (tone === "warning" || tone === "low") {
|
|
1679
|
+
return terminalTheme.warning;
|
|
1680
|
+
}
|
|
1681
|
+
if (tone === "exhausted" || tone === "danger") {
|
|
1682
|
+
return terminalTheme.danger;
|
|
1683
|
+
}
|
|
1684
|
+
if (tone === "success" || tone === "normal") {
|
|
1685
|
+
return terminalTheme.success;
|
|
1686
|
+
}
|
|
1687
|
+
return terminalTheme.brand;
|
|
1688
|
+
};
|
|
1689
|
+
var buildBannerDetailLines = ({
|
|
1690
|
+
apiBase,
|
|
1691
|
+
frontendBaseUrl,
|
|
1692
|
+
billingSummary,
|
|
1693
|
+
billingTone,
|
|
1694
|
+
userName,
|
|
1695
|
+
userEmail
|
|
1696
|
+
}) => {
|
|
1697
|
+
const displayName = truncateForTerminal(userName.trim() || "You", 48);
|
|
1698
|
+
const email = userEmail?.trim();
|
|
1699
|
+
const userSegments = [
|
|
1700
|
+
labelSegment("User: "),
|
|
1701
|
+
valueSegment(displayName, terminalTheme.userName)
|
|
1702
|
+
];
|
|
1703
|
+
if (email) {
|
|
1704
|
+
userSegments.push({
|
|
1705
|
+
text: ` (${truncateForTerminal(email, 56)})`,
|
|
1706
|
+
dimColor: true
|
|
1707
|
+
});
|
|
1708
|
+
}
|
|
1709
|
+
const billingUnavailable = billingSummary.includes("unavailable");
|
|
1710
|
+
return [
|
|
1711
|
+
{ key: "user", segments: userSegments },
|
|
1712
|
+
{
|
|
1713
|
+
key: "api",
|
|
1714
|
+
segments: [
|
|
1715
|
+
labelSegment("API: "),
|
|
1716
|
+
valueSegment(truncateForTerminal(apiBase, 72), terminalTheme.secondary)
|
|
1717
|
+
]
|
|
1718
|
+
},
|
|
1719
|
+
{
|
|
1720
|
+
key: "frontend",
|
|
1721
|
+
segments: [
|
|
1722
|
+
labelSegment("Frontend: "),
|
|
1723
|
+
valueSegment(truncateForTerminal(frontendBaseUrl, 72), terminalTheme.secondary)
|
|
1724
|
+
]
|
|
1725
|
+
},
|
|
1726
|
+
{
|
|
1727
|
+
key: "billing",
|
|
1728
|
+
segments: [
|
|
1729
|
+
{
|
|
1730
|
+
text: billingSummary,
|
|
1731
|
+
color: billingUnavailable ? terminalTheme.warning : creditToneColor(billingTone),
|
|
1732
|
+
bold: !billingUnavailable
|
|
1733
|
+
}
|
|
1734
|
+
]
|
|
1735
|
+
}
|
|
1736
|
+
];
|
|
1737
|
+
};
|
|
1738
|
+
var buildTuiHeaderDetails = (options) => buildBannerDetailLines(options).map(
|
|
1739
|
+
(line) => line.segments.map((segment) => segment.text).join("")
|
|
1740
|
+
);
|
|
1741
|
+
|
|
1385
1742
|
// src/ui/components/Scrollbar.tsx
|
|
1386
|
-
import { Box as Box5, Text as
|
|
1387
|
-
import { jsx as
|
|
1743
|
+
import { Box as Box5, Text as Text8 } from "ink";
|
|
1744
|
+
import { jsx as jsx8 } from "react/jsx-runtime";
|
|
1388
1745
|
var Scrollbar2 = ({
|
|
1389
1746
|
scrollOffset,
|
|
1390
1747
|
contentHeight,
|
|
@@ -1406,8 +1763,8 @@ var Scrollbar2 = ({
|
|
|
1406
1763
|
scrollbarLines.push("\u2502");
|
|
1407
1764
|
}
|
|
1408
1765
|
}
|
|
1409
|
-
return /* @__PURE__ */
|
|
1410
|
-
|
|
1766
|
+
return /* @__PURE__ */ jsx8(Box5, { flexDirection: "column", marginLeft: 1, flexShrink: 0, width: 1, children: scrollbarLines.map((line, idx) => /* @__PURE__ */ jsx8(
|
|
1767
|
+
Text8,
|
|
1411
1768
|
{
|
|
1412
1769
|
color: line === "\u2588" ? terminalTheme.focus : terminalTheme.muted,
|
|
1413
1770
|
children: line
|
|
@@ -1418,8 +1775,8 @@ var Scrollbar2 = ({
|
|
|
1418
1775
|
|
|
1419
1776
|
// src/ui/components/ProjectSelector.tsx
|
|
1420
1777
|
import { useState as useState3, useEffect as useEffect3 } from "react";
|
|
1421
|
-
import { Box as Box6, Text as
|
|
1422
|
-
import { jsx as
|
|
1778
|
+
import { Box as Box6, Text as Text9, useInput as useInput2 } from "ink";
|
|
1779
|
+
import { jsx as jsx9, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
1423
1780
|
function ProjectSelector({
|
|
1424
1781
|
items,
|
|
1425
1782
|
onSubmit,
|
|
@@ -1479,7 +1836,7 @@ function ProjectSelector({
|
|
|
1479
1836
|
);
|
|
1480
1837
|
const visibleItems = items.slice(windowStart, windowStart + visibleCount);
|
|
1481
1838
|
if (items.length === 0) {
|
|
1482
|
-
return /* @__PURE__ */
|
|
1839
|
+
return /* @__PURE__ */ jsx9(Text9, { dimColor: true, children: "No projects available." });
|
|
1483
1840
|
}
|
|
1484
1841
|
return /* @__PURE__ */ jsxs5(Box6, { flexDirection: "column", gap: 0, children: [
|
|
1485
1842
|
visibleItems.map((item, idx) => {
|
|
@@ -1488,7 +1845,7 @@ function ProjectSelector({
|
|
|
1488
1845
|
const isHighlighted = highlighted === actualIndex;
|
|
1489
1846
|
const marker = isHighlighted ? ">" : isSelected ? "*" : " ";
|
|
1490
1847
|
return /* @__PURE__ */ jsxs5(
|
|
1491
|
-
|
|
1848
|
+
Text9,
|
|
1492
1849
|
{
|
|
1493
1850
|
bold: isHighlighted || isSelected,
|
|
1494
1851
|
color: isSelected ? terminalTheme.selected : isHighlighted ? terminalTheme.focus : void 0,
|
|
@@ -1502,8 +1859,8 @@ function ProjectSelector({
|
|
|
1502
1859
|
`${actualIndex}-${item.label}`
|
|
1503
1860
|
);
|
|
1504
1861
|
}),
|
|
1505
|
-
/* @__PURE__ */
|
|
1506
|
-
items.length > visibleItems.length ? /* @__PURE__ */ jsxs5(
|
|
1862
|
+
/* @__PURE__ */ jsx9(Text9, { dimColor: true, children: multiple ? "Use arrows to navigate, Space to toggle, Enter to confirm" : "Use arrows to navigate and Enter to select" }),
|
|
1863
|
+
items.length > visibleItems.length ? /* @__PURE__ */ jsxs5(Text9, { dimColor: true, children: [
|
|
1507
1864
|
"Showing ",
|
|
1508
1865
|
windowStart + 1,
|
|
1509
1866
|
"-",
|
|
@@ -1516,8 +1873,8 @@ function ProjectSelector({
|
|
|
1516
1873
|
|
|
1517
1874
|
// src/ui/components/SelectPanel.tsx
|
|
1518
1875
|
import React6 from "react";
|
|
1519
|
-
import { Box as Box7, Text as
|
|
1520
|
-
import { jsx as
|
|
1876
|
+
import { Box as Box7, Text as Text10, useInput as useInput3 } from "ink";
|
|
1877
|
+
import { jsx as jsx10, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
1521
1878
|
function SelectPanel({
|
|
1522
1879
|
title,
|
|
1523
1880
|
items,
|
|
@@ -1563,14 +1920,14 @@ function SelectPanel({
|
|
|
1563
1920
|
);
|
|
1564
1921
|
const visibleItems = items.slice(windowStart, windowStart + visibleCount);
|
|
1565
1922
|
return /* @__PURE__ */ jsxs6(TitledBox, { title, borderStyle: "round", borderColor: terminalTheme.focus, padding: 1, children: [
|
|
1566
|
-
items.length === 0 ? /* @__PURE__ */
|
|
1923
|
+
items.length === 0 ? /* @__PURE__ */ jsx10(Text10, { dimColor: true, children: "No options available." }) : visibleItems.map((item, offset) => {
|
|
1567
1924
|
const index = windowStart + offset;
|
|
1568
1925
|
const isHighlighted = index === highlighted;
|
|
1569
1926
|
const isSelected = index === normalizedSelectedIndex;
|
|
1570
1927
|
const marker = isHighlighted ? "\u25B8" : isSelected ? "\u2022" : " ";
|
|
1571
1928
|
return /* @__PURE__ */ jsxs6(Box7, { flexDirection: "column", children: [
|
|
1572
1929
|
/* @__PURE__ */ jsxs6(
|
|
1573
|
-
|
|
1930
|
+
Text10,
|
|
1574
1931
|
{
|
|
1575
1932
|
bold: isHighlighted || isSelected,
|
|
1576
1933
|
color: isSelected ? terminalTheme.selected : isHighlighted ? terminalTheme.focus : void 0,
|
|
@@ -1582,13 +1939,13 @@ function SelectPanel({
|
|
|
1582
1939
|
]
|
|
1583
1940
|
}
|
|
1584
1941
|
),
|
|
1585
|
-
isHighlighted && item.description ? /* @__PURE__ */ jsxs6(
|
|
1942
|
+
isHighlighted && item.description ? /* @__PURE__ */ jsxs6(Text10, { dimColor: true, children: [
|
|
1586
1943
|
" ",
|
|
1587
1944
|
item.description
|
|
1588
1945
|
] }) : null
|
|
1589
1946
|
] }, `${index}-${item.label}`);
|
|
1590
1947
|
}),
|
|
1591
|
-
/* @__PURE__ */
|
|
1948
|
+
/* @__PURE__ */ jsx10(Text10, { dimColor: true, children: "Use Up/Down, Enter to select, Esc to cancel." })
|
|
1592
1949
|
] });
|
|
1593
1950
|
}
|
|
1594
1951
|
|
|
@@ -2034,112 +2391,6 @@ var isPromptTextInput = (input, key) => {
|
|
|
2034
2391
|
return input.length > 0;
|
|
2035
2392
|
};
|
|
2036
2393
|
|
|
2037
|
-
// src/ui/layout.ts
|
|
2038
|
-
var clamp2 = (value, min, max) => Math.min(max, Math.max(min, value));
|
|
2039
|
-
var normalizeDimension = (value, fallback) => Number.isFinite(value) && value && value > 0 ? value : fallback;
|
|
2040
|
-
var BANNER_ART_WIDTH = 84;
|
|
2041
|
-
var BANNER_ART_ROWS = 6;
|
|
2042
|
-
var BANNER_WELCOME_ROWS = 1;
|
|
2043
|
-
var BANNER_VERSION_ROWS = 1;
|
|
2044
|
-
var BANNER_MARGIN_BOTTOM_ROWS = 1;
|
|
2045
|
-
var BANNER_SIDE_DETAILS_MIN_WIDTH = 42;
|
|
2046
|
-
var estimateBannerRows = ({
|
|
2047
|
-
columns,
|
|
2048
|
-
detailsCount = 3
|
|
2049
|
-
}) => {
|
|
2050
|
-
const showArt = columns >= BANNER_ART_WIDTH;
|
|
2051
|
-
const detailsBesideArt = showArt && detailsCount > 0 && columns >= BANNER_ART_WIDTH + BANNER_SIDE_DETAILS_MIN_WIDTH;
|
|
2052
|
-
const detailRows = BANNER_VERSION_ROWS + detailsCount;
|
|
2053
|
-
if (!showArt) {
|
|
2054
|
-
return detailRows + BANNER_MARGIN_BOTTOM_ROWS;
|
|
2055
|
-
}
|
|
2056
|
-
if (detailsBesideArt) {
|
|
2057
|
-
return BANNER_WELCOME_ROWS + Math.max(BANNER_ART_ROWS, detailRows) + BANNER_MARGIN_BOTTOM_ROWS;
|
|
2058
|
-
}
|
|
2059
|
-
return BANNER_WELCOME_ROWS + BANNER_ART_ROWS + detailRows + BANNER_MARGIN_BOTTOM_ROWS;
|
|
2060
|
-
};
|
|
2061
|
-
var getResponsiveTuiLayout = (size, options = {}) => {
|
|
2062
|
-
const columns = normalizeDimension(size.columns, 100);
|
|
2063
|
-
const rows = normalizeDimension(size.rows, 32);
|
|
2064
|
-
const compact = columns < 96 || rows < 30;
|
|
2065
|
-
const showBanner = !options.disableBanner;
|
|
2066
|
-
let reservedRows = 25 + Math.max(0, Math.ceil(options.promptInputRows ?? 2) - 2) + Math.max(0, Math.ceil(options.promptSuggestionRows ?? 0));
|
|
2067
|
-
if (showBanner) reservedRows += estimateBannerRows({ columns });
|
|
2068
|
-
if (options.hasQueue) reservedRows += 4;
|
|
2069
|
-
if (options.hasError) reservedRows += 4;
|
|
2070
|
-
if (options.hasHitl) reservedRows += 7;
|
|
2071
|
-
if (options.hasSelector) reservedRows += 8;
|
|
2072
|
-
if (options.isSearching) reservedRows += 3;
|
|
2073
|
-
const maxThreadHeight = compact ? 14 : 24;
|
|
2074
|
-
const availableRows = rows - reservedRows;
|
|
2075
|
-
return {
|
|
2076
|
-
compact,
|
|
2077
|
-
paddingX: compact ? 0 : 1,
|
|
2078
|
-
selectorLimit: compact ? 6 : 8,
|
|
2079
|
-
showBanner,
|
|
2080
|
-
threadHeight: clamp2(availableRows, 1, maxThreadHeight)
|
|
2081
|
-
};
|
|
2082
|
-
};
|
|
2083
|
-
var getMiddleViewportRows = (size, options = {}) => {
|
|
2084
|
-
const rows = normalizeDimension(size.rows, 32);
|
|
2085
|
-
const headerRows = Math.max(0, Math.ceil(options.headerRows ?? 0));
|
|
2086
|
-
const footerRows = Math.max(0, Math.ceil(options.footerRows ?? 0));
|
|
2087
|
-
const safetyRows = Math.max(0, Math.ceil(options.safetyRows ?? 2));
|
|
2088
|
-
return Math.max(1, Math.floor(rows) - headerRows - footerRows - safetyRows);
|
|
2089
|
-
};
|
|
2090
|
-
var getFramedBodyRows = (frameRows, chromeRows = 4) => Math.max(1, Math.floor(frameRows) - Math.max(0, Math.ceil(chromeRows)));
|
|
2091
|
-
var getPromptInputRowBudget = (size) => {
|
|
2092
|
-
const rows = normalizeDimension(size.rows, 32);
|
|
2093
|
-
return clamp2(Math.floor(rows * 0.13), 4, 8);
|
|
2094
|
-
};
|
|
2095
|
-
var getChatResponsiveMode = (size) => {
|
|
2096
|
-
const columns = normalizeDimension(size.columns, 100);
|
|
2097
|
-
const rows = normalizeDimension(size.rows, 32);
|
|
2098
|
-
if (columns >= 132 && rows >= 40) {
|
|
2099
|
-
return "wide";
|
|
2100
|
-
}
|
|
2101
|
-
if (columns >= 112 && rows >= 34) {
|
|
2102
|
-
return "medium";
|
|
2103
|
-
}
|
|
2104
|
-
return "narrow";
|
|
2105
|
-
};
|
|
2106
|
-
var shouldUseSplitChatLayout = (size) => getChatResponsiveMode(size) !== "narrow";
|
|
2107
|
-
var getContextRailWidth = (size) => {
|
|
2108
|
-
const mode = getChatResponsiveMode(size);
|
|
2109
|
-
const columns = normalizeDimension(size.columns, 100);
|
|
2110
|
-
if (mode === "wide") {
|
|
2111
|
-
return Math.min(40, Math.max(34, Math.ceil(columns * 0.25)));
|
|
2112
|
-
}
|
|
2113
|
-
if (mode === "medium") {
|
|
2114
|
-
return Math.min(30, Math.max(28, Math.ceil(columns * 0.25)));
|
|
2115
|
-
}
|
|
2116
|
-
return 0;
|
|
2117
|
-
};
|
|
2118
|
-
var estimateComposerRows = ({
|
|
2119
|
-
inputRows,
|
|
2120
|
-
suggestionRows,
|
|
2121
|
-
includeControls = true,
|
|
2122
|
-
controlRows = 0,
|
|
2123
|
-
variant = "panel"
|
|
2124
|
-
}) => {
|
|
2125
|
-
const chromeRows = variant === "dock" ? 1 : 2;
|
|
2126
|
-
const inputRowsWithHint = inputRows + 1;
|
|
2127
|
-
const footerRows = includeControls ? controlRows : 0;
|
|
2128
|
-
return chromeRows + Math.max(0, suggestionRows) + inputRowsWithHint + footerRows;
|
|
2129
|
-
};
|
|
2130
|
-
var truncateForTerminal = (value, maxLength) => {
|
|
2131
|
-
if (maxLength <= 0) {
|
|
2132
|
-
return "";
|
|
2133
|
-
}
|
|
2134
|
-
if (value.length <= maxLength) {
|
|
2135
|
-
return value;
|
|
2136
|
-
}
|
|
2137
|
-
if (maxLength <= 3) {
|
|
2138
|
-
return ".".repeat(maxLength);
|
|
2139
|
-
}
|
|
2140
|
-
return `${value.slice(0, maxLength - 3)}...`;
|
|
2141
|
-
};
|
|
2142
|
-
|
|
2143
2394
|
// src/ui/artifactChips.ts
|
|
2144
2395
|
var buildChatArtifactChips = ({
|
|
2145
2396
|
projectName: projectName2,
|
|
@@ -3804,7 +4055,7 @@ var loadWorkspacePanelData = async ({
|
|
|
3804
4055
|
|
|
3805
4056
|
// src/ui/workspacePanel.tsx
|
|
3806
4057
|
import React7 from "react";
|
|
3807
|
-
import { Box as Box8, Text as
|
|
4058
|
+
import { Box as Box8, Text as Text11 } from "ink";
|
|
3808
4059
|
import { plot as plotAsciiChart } from "asciichart";
|
|
3809
4060
|
|
|
3810
4061
|
// src/ui/workspaceEntityDetails.ts
|
|
@@ -4000,7 +4251,7 @@ var buildConnectionDetailModel = ({
|
|
|
4000
4251
|
};
|
|
4001
4252
|
|
|
4002
4253
|
// src/ui/workspacePanel.tsx
|
|
4003
|
-
import { Fragment as Fragment2, jsx as
|
|
4254
|
+
import { Fragment as Fragment2, jsx as jsx11, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
4004
4255
|
var toRecord5 = (value) => value && typeof value === "object" && !Array.isArray(value) ? value : void 0;
|
|
4005
4256
|
var directArray3 = (value) => {
|
|
4006
4257
|
if (Array.isArray(value)) {
|
|
@@ -4150,12 +4401,12 @@ var sparkBlocks = ["\u2581", "\u2582", "\u2583", "\u2584", "\u2585", "\u2586", "
|
|
|
4150
4401
|
var InlineSparkline = ({ values, width, tone }) => {
|
|
4151
4402
|
const sampled = sampleValues(values, Math.max(4, width));
|
|
4152
4403
|
if (!sampled.length) {
|
|
4153
|
-
return /* @__PURE__ */
|
|
4404
|
+
return /* @__PURE__ */ jsx11(Text11, { dimColor: true, children: "no trend data" });
|
|
4154
4405
|
}
|
|
4155
4406
|
const max = Math.max(...sampled);
|
|
4156
4407
|
const min = Math.min(...sampled);
|
|
4157
4408
|
const span = max - min || 1;
|
|
4158
|
-
return /* @__PURE__ */
|
|
4409
|
+
return /* @__PURE__ */ jsx11(Text11, { color: metricColor(tone) ?? terminalTheme.brand, children: sampled.map((value) => {
|
|
4159
4410
|
const index = Math.min(
|
|
4160
4411
|
sparkBlocks.length - 1,
|
|
4161
4412
|
Math.max(
|
|
@@ -4170,7 +4421,7 @@ var AsciiLineChart = ({ values, width, height = 4, tone }) => {
|
|
|
4170
4421
|
const sampled = sampleValues(values, Math.max(8, width - 8));
|
|
4171
4422
|
if (sampled.length < 2) {
|
|
4172
4423
|
return /* @__PURE__ */ jsxs7(Box8, { flexDirection: "row", children: [
|
|
4173
|
-
/* @__PURE__ */
|
|
4424
|
+
/* @__PURE__ */ jsx11(
|
|
4174
4425
|
InlineSparkline,
|
|
4175
4426
|
{
|
|
4176
4427
|
values: sampled,
|
|
@@ -4178,7 +4429,7 @@ var AsciiLineChart = ({ values, width, height = 4, tone }) => {
|
|
|
4178
4429
|
tone
|
|
4179
4430
|
}
|
|
4180
4431
|
),
|
|
4181
|
-
/* @__PURE__ */
|
|
4432
|
+
/* @__PURE__ */ jsx11(Text11, { dimColor: true, children: " current only" })
|
|
4182
4433
|
] });
|
|
4183
4434
|
}
|
|
4184
4435
|
const chart = plotAsciiChart(sampled, {
|
|
@@ -4187,8 +4438,8 @@ var AsciiLineChart = ({ values, width, height = 4, tone }) => {
|
|
|
4187
4438
|
padding: " ",
|
|
4188
4439
|
format: (value) => String(Math.round(value)).padStart(3, " ").slice(-3)
|
|
4189
4440
|
});
|
|
4190
|
-
return /* @__PURE__ */
|
|
4191
|
-
|
|
4441
|
+
return /* @__PURE__ */ jsx11(Box8, { flexDirection: "column", children: chart.split("\n").map((line, index) => /* @__PURE__ */ jsx11(
|
|
4442
|
+
Text11,
|
|
4192
4443
|
{
|
|
4193
4444
|
color: metricColor(tone) ?? terminalTheme.brand,
|
|
4194
4445
|
wrap: "truncate",
|
|
@@ -4250,28 +4501,28 @@ var rowDetail = (value) => {
|
|
|
4250
4501
|
};
|
|
4251
4502
|
var Bar = ({ value, width = 28, tone }) => {
|
|
4252
4503
|
if (value === void 0) {
|
|
4253
|
-
return /* @__PURE__ */
|
|
4504
|
+
return /* @__PURE__ */ jsx11(Text11, { dimColor: true, children: "-".repeat(Math.min(width, 28)) });
|
|
4254
4505
|
}
|
|
4255
4506
|
const ratio = Math.max(0, Math.min(1, value));
|
|
4256
4507
|
const filled = Math.round(ratio * width);
|
|
4257
4508
|
if (filled <= 0) {
|
|
4258
|
-
return /* @__PURE__ */
|
|
4509
|
+
return /* @__PURE__ */ jsx11(Text11, { children: " ".repeat(width) });
|
|
4259
4510
|
}
|
|
4260
|
-
return /* @__PURE__ */ jsxs7(
|
|
4511
|
+
return /* @__PURE__ */ jsxs7(Text11, { color: metricColor(tone) ?? terminalTheme.brand, children: [
|
|
4261
4512
|
"\u2588".repeat(filled),
|
|
4262
4513
|
" ".repeat(width - filled)
|
|
4263
4514
|
] });
|
|
4264
4515
|
};
|
|
4265
4516
|
var BarList = ({ bars, width, emptyLabel, labelWidth = 18 }) => {
|
|
4266
4517
|
const barWidth = Math.max(12, Math.min(32, width));
|
|
4267
|
-
return /* @__PURE__ */
|
|
4268
|
-
/* @__PURE__ */
|
|
4269
|
-
/* @__PURE__ */
|
|
4270
|
-
/* @__PURE__ */ jsxs7(
|
|
4518
|
+
return /* @__PURE__ */ jsx11(Box8, { flexDirection: "column", children: bars.length ? bars.slice(0, 6).map((bar) => /* @__PURE__ */ jsxs7(Box8, { flexDirection: "row", children: [
|
|
4519
|
+
/* @__PURE__ */ jsx11(Box8, { width: labelWidth, children: /* @__PURE__ */ jsx11(Text11, { wrap: "truncate", children: truncateForTerminal(normalizeLabel(bar.label), labelWidth - 2) }) }),
|
|
4520
|
+
/* @__PURE__ */ jsx11(Bar, { value: bar.ratio, width: barWidth, tone: bar.tone }),
|
|
4521
|
+
/* @__PURE__ */ jsxs7(Text11, { color: metricColor(bar.tone), children: [
|
|
4271
4522
|
" ",
|
|
4272
4523
|
chartValue(bar.value)
|
|
4273
4524
|
] })
|
|
4274
|
-
] }, bar.label)) : /* @__PURE__ */
|
|
4525
|
+
] }, bar.label)) : /* @__PURE__ */ jsx11(Text11, { dimColor: true, children: emptyLabel }) });
|
|
4275
4526
|
};
|
|
4276
4527
|
var TrendSummary = ({
|
|
4277
4528
|
trend,
|
|
@@ -4282,14 +4533,14 @@ var TrendSummary = ({
|
|
|
4282
4533
|
const icon = trend.delta === void 0 ? "\u2022" : trend.delta > 0 ? "\u2191" : trend.delta < 0 ? "\u2193" : "\u2192";
|
|
4283
4534
|
return /* @__PURE__ */ jsxs7(Box8, { flexDirection: "column", children: [
|
|
4284
4535
|
/* @__PURE__ */ jsxs7(Box8, { flexDirection: "row", children: [
|
|
4285
|
-
/* @__PURE__ */
|
|
4286
|
-
/* @__PURE__ */ jsxs7(
|
|
4536
|
+
/* @__PURE__ */ jsx11(Box8, { width: labelWidth, children: /* @__PURE__ */ jsx11(Text11, { bold: true, wrap: "truncate", children: truncateForTerminal(trend.label, labelWidth - 1) }) }),
|
|
4537
|
+
/* @__PURE__ */ jsxs7(Text11, { color: metricColor(trend.tone), children: [
|
|
4287
4538
|
icon,
|
|
4288
4539
|
" ",
|
|
4289
4540
|
trend.summary
|
|
4290
4541
|
] })
|
|
4291
4542
|
] }),
|
|
4292
|
-
/* @__PURE__ */
|
|
4543
|
+
/* @__PURE__ */ jsx11(
|
|
4293
4544
|
AsciiLineChart,
|
|
4294
4545
|
{
|
|
4295
4546
|
values: trend.values,
|
|
@@ -4300,7 +4551,7 @@ var TrendSummary = ({
|
|
|
4300
4551
|
)
|
|
4301
4552
|
] });
|
|
4302
4553
|
};
|
|
4303
|
-
var SectionCard = ({ title, children, borderColor }) => /* @__PURE__ */
|
|
4554
|
+
var SectionCard = ({ title, children, borderColor }) => /* @__PURE__ */ jsx11(
|
|
4304
4555
|
TitledBox,
|
|
4305
4556
|
{
|
|
4306
4557
|
title,
|
|
@@ -4308,16 +4559,16 @@ var SectionCard = ({ title, children, borderColor }) => /* @__PURE__ */ jsx9(
|
|
|
4308
4559
|
borderColor: borderColor ?? terminalTheme.muted,
|
|
4309
4560
|
padding: 0,
|
|
4310
4561
|
paddingX: 1,
|
|
4311
|
-
children: /* @__PURE__ */
|
|
4562
|
+
children: /* @__PURE__ */ jsx11(Box8, { flexDirection: "column", marginTop: 1, children })
|
|
4312
4563
|
}
|
|
4313
4564
|
);
|
|
4314
4565
|
var CreditProgress = ({ remaining, total, width = 12, tone }) => {
|
|
4315
4566
|
const ratio = total > 0 ? Math.min(1, Math.max(0, remaining / total)) : 0;
|
|
4316
4567
|
const safeWidth = Math.max(6, width);
|
|
4317
4568
|
const filled = Math.round(ratio * safeWidth);
|
|
4318
|
-
return /* @__PURE__ */ jsxs7(
|
|
4569
|
+
return /* @__PURE__ */ jsxs7(Text11, { children: [
|
|
4319
4570
|
"[",
|
|
4320
|
-
/* @__PURE__ */
|
|
4571
|
+
/* @__PURE__ */ jsx11(Text11, { color: billingToneColor(tone), children: "\u2588".repeat(filled) }),
|
|
4321
4572
|
" ".repeat(safeWidth - filled),
|
|
4322
4573
|
"] ",
|
|
4323
4574
|
Math.round(ratio * 100),
|
|
@@ -4327,18 +4578,18 @@ var CreditProgress = ({ remaining, total, width = 12, tone }) => {
|
|
|
4327
4578
|
var BillingSummaryLine = ({
|
|
4328
4579
|
billing
|
|
4329
4580
|
}) => /* @__PURE__ */ jsxs7(Box8, { flexDirection: "row", flexWrap: "wrap", columnGap: 1, children: [
|
|
4330
|
-
/* @__PURE__ */ jsxs7(
|
|
4581
|
+
/* @__PURE__ */ jsxs7(Text11, { dimColor: true, children: [
|
|
4331
4582
|
"Plan: ",
|
|
4332
|
-
/* @__PURE__ */
|
|
4583
|
+
/* @__PURE__ */ jsx11(Text11, { children: billing.plan })
|
|
4333
4584
|
] }),
|
|
4334
|
-
/* @__PURE__ */ jsxs7(
|
|
4585
|
+
/* @__PURE__ */ jsxs7(Text11, { dimColor: true, children: [
|
|
4335
4586
|
"Credits:",
|
|
4336
4587
|
" ",
|
|
4337
|
-
/* @__PURE__ */
|
|
4588
|
+
/* @__PURE__ */ jsx11(Text11, { color: billingToneColor(billing.tone), children: Math.max(Number(billing.reportedUsed ?? billing.used ?? 0), 0) > 0 ? `${formatCredits(billing.remaining)} left | Used ${formatCredits(
|
|
4338
4589
|
Math.max(Number(billing.reportedUsed ?? billing.used ?? 0), 0)
|
|
4339
4590
|
)}` : `${formatCredits(billing.remaining)}/${formatCredits(billing.total)}` })
|
|
4340
4591
|
] }),
|
|
4341
|
-
/* @__PURE__ */
|
|
4592
|
+
/* @__PURE__ */ jsx11(
|
|
4342
4593
|
CreditProgress,
|
|
4343
4594
|
{
|
|
4344
4595
|
remaining: billing.remaining,
|
|
@@ -4347,18 +4598,18 @@ var BillingSummaryLine = ({
|
|
|
4347
4598
|
tone: billing.tone
|
|
4348
4599
|
}
|
|
4349
4600
|
),
|
|
4350
|
-
/* @__PURE__ */
|
|
4601
|
+
/* @__PURE__ */ jsx11(Text11, { dimColor: true, children: "O opens billing" })
|
|
4351
4602
|
] });
|
|
4352
4603
|
var MetricStrip = ({
|
|
4353
4604
|
metrics,
|
|
4354
4605
|
compact
|
|
4355
|
-
}) => /* @__PURE__ */
|
|
4606
|
+
}) => /* @__PURE__ */ jsx11(Box8, { flexDirection: compact ? "column" : "row", gap: 1, flexWrap: "wrap", children: metrics.map((metric) => {
|
|
4356
4607
|
const width = Math.max(
|
|
4357
4608
|
metric.label.length + 8,
|
|
4358
4609
|
metric.value.length + 6,
|
|
4359
4610
|
compact ? 0 : 17
|
|
4360
4611
|
);
|
|
4361
|
-
return /* @__PURE__ */
|
|
4612
|
+
return /* @__PURE__ */ jsx11(
|
|
4362
4613
|
TitledBox,
|
|
4363
4614
|
{
|
|
4364
4615
|
title: metric.label,
|
|
@@ -4369,7 +4620,7 @@ var MetricStrip = ({
|
|
|
4369
4620
|
paddingX: 1,
|
|
4370
4621
|
width,
|
|
4371
4622
|
flexShrink: 0,
|
|
4372
|
-
children: /* @__PURE__ */
|
|
4623
|
+
children: /* @__PURE__ */ jsx11(Text11, { bold: true, color: metricColor(metric.tone), wrap: "truncate", children: metric.value })
|
|
4373
4624
|
},
|
|
4374
4625
|
metric.label
|
|
4375
4626
|
);
|
|
@@ -4387,15 +4638,15 @@ var ResponsiveTable = ({ rows, columns, terminalColumns, maxRows = 12, page = 0
|
|
|
4387
4638
|
const narrow = terminalColumns < 76;
|
|
4388
4639
|
if (narrow) {
|
|
4389
4640
|
return /* @__PURE__ */ jsxs7(Box8, { flexDirection: "column", children: [
|
|
4390
|
-
visibleRows.map((row, index) => /* @__PURE__ */
|
|
4391
|
-
/* @__PURE__ */ jsxs7(
|
|
4641
|
+
visibleRows.map((row, index) => /* @__PURE__ */ jsx11(Box8, { flexDirection: "column", marginBottom: 1, children: columns.map((column) => /* @__PURE__ */ jsxs7(Text11, { wrap: "truncate", children: [
|
|
4642
|
+
/* @__PURE__ */ jsxs7(Text11, { color: terminalTheme.muted, children: [
|
|
4392
4643
|
column,
|
|
4393
4644
|
": "
|
|
4394
4645
|
] }),
|
|
4395
4646
|
String(row[column] ?? "")
|
|
4396
4647
|
] }, column)) }, index)),
|
|
4397
4648
|
/* @__PURE__ */ jsxs7(Box8, { flexDirection: "row", justifyContent: "space-between", children: [
|
|
4398
|
-
/* @__PURE__ */ jsxs7(
|
|
4649
|
+
/* @__PURE__ */ jsxs7(Text11, { dimColor: true, children: [
|
|
4399
4650
|
"rows ",
|
|
4400
4651
|
startIndex + 1,
|
|
4401
4652
|
"-",
|
|
@@ -4404,7 +4655,7 @@ var ResponsiveTable = ({ rows, columns, terminalColumns, maxRows = 12, page = 0
|
|
|
4404
4655
|
" ",
|
|
4405
4656
|
rows.length
|
|
4406
4657
|
] }),
|
|
4407
|
-
/* @__PURE__ */
|
|
4658
|
+
/* @__PURE__ */ jsx11(Text11, { dimColor: true, children: "[ prev | ] next | D download" })
|
|
4408
4659
|
] })
|
|
4409
4660
|
] });
|
|
4410
4661
|
}
|
|
@@ -4428,11 +4679,11 @@ var ResponsiveTable = ({ rows, columns, terminalColumns, maxRows = 12, page = 0
|
|
|
4428
4679
|
return Math.max(min, scaled);
|
|
4429
4680
|
});
|
|
4430
4681
|
const columnWidth = (column) => widths[columns.indexOf(column)] ?? 10;
|
|
4431
|
-
const renderRow = (row, key, heading = false) => /* @__PURE__ */
|
|
4682
|
+
const renderRow = (row, key, heading = false) => /* @__PURE__ */ jsx11(Box8, { flexDirection: "row", children: columns.map((column) => {
|
|
4432
4683
|
const width = columnWidth(column);
|
|
4433
4684
|
const value = heading ? column : String(row[column] ?? "");
|
|
4434
|
-
return /* @__PURE__ */
|
|
4435
|
-
|
|
4685
|
+
return /* @__PURE__ */ jsx11(Box8, { width, marginRight: 1, children: /* @__PURE__ */ jsx11(
|
|
4686
|
+
Text11,
|
|
4436
4687
|
{
|
|
4437
4688
|
bold: heading,
|
|
4438
4689
|
color: heading ? terminalTheme.brand : void 0,
|
|
@@ -4443,20 +4694,20 @@ var ResponsiveTable = ({ rows, columns, terminalColumns, maxRows = 12, page = 0
|
|
|
4443
4694
|
}) }, key);
|
|
4444
4695
|
return /* @__PURE__ */ jsxs7(Box8, { flexDirection: "column", children: [
|
|
4445
4696
|
renderRow({}, "header", true),
|
|
4446
|
-
/* @__PURE__ */
|
|
4697
|
+
/* @__PURE__ */ jsx11(Text11, { dimColor: true, children: truncateForTerminal("\u2500".repeat(availableWidth), availableWidth) }),
|
|
4447
4698
|
/* @__PURE__ */ jsxs7(Box8, { flexDirection: "row", children: [
|
|
4448
|
-
/* @__PURE__ */
|
|
4699
|
+
/* @__PURE__ */ jsx11(Box8, { flexDirection: "column", flexGrow: 1, children: visibleRows.map((row, index) => renderRow(row, String(index))) }),
|
|
4449
4700
|
hiddenCount > 0 ? /* @__PURE__ */ jsxs7(Box8, { flexDirection: "column", marginLeft: 1, children: [
|
|
4450
|
-
/* @__PURE__ */
|
|
4701
|
+
/* @__PURE__ */ jsx11(Text11, { color: terminalTheme.brand, children: "\u2503" }),
|
|
4451
4702
|
Array.from(
|
|
4452
4703
|
{ length: Math.max(1, visibleRows.length - 2) },
|
|
4453
|
-
(_, index) => /* @__PURE__ */
|
|
4704
|
+
(_, index) => /* @__PURE__ */ jsx11(Text11, { dimColor: true, children: "\u2502" }, index)
|
|
4454
4705
|
),
|
|
4455
|
-
/* @__PURE__ */
|
|
4706
|
+
/* @__PURE__ */ jsx11(Text11, { dimColor: true, children: "\u2575" })
|
|
4456
4707
|
] }) : null
|
|
4457
4708
|
] }),
|
|
4458
4709
|
/* @__PURE__ */ jsxs7(Box8, { flexDirection: "row", justifyContent: "space-between", children: [
|
|
4459
|
-
/* @__PURE__ */ jsxs7(
|
|
4710
|
+
/* @__PURE__ */ jsxs7(Text11, { dimColor: true, children: [
|
|
4460
4711
|
"rows ",
|
|
4461
4712
|
startIndex + 1,
|
|
4462
4713
|
"-",
|
|
@@ -4465,7 +4716,7 @@ var ResponsiveTable = ({ rows, columns, terminalColumns, maxRows = 12, page = 0
|
|
|
4465
4716
|
" ",
|
|
4466
4717
|
rows.length
|
|
4467
4718
|
] }),
|
|
4468
|
-
/* @__PURE__ */ jsxs7(
|
|
4719
|
+
/* @__PURE__ */ jsxs7(Text11, { dimColor: true, children: [
|
|
4469
4720
|
"page ",
|
|
4470
4721
|
safePage + 1,
|
|
4471
4722
|
"/",
|
|
@@ -4491,10 +4742,10 @@ var HelpLegend = ({
|
|
|
4491
4742
|
{ key: "D", label: "download", color: terminalTheme.success },
|
|
4492
4743
|
...includeQuit ? [{ key: "Ctrl+Q", label: "quit", color: terminalTheme.danger }] : []
|
|
4493
4744
|
];
|
|
4494
|
-
return /* @__PURE__ */
|
|
4495
|
-
index > 0 ? /* @__PURE__ */
|
|
4496
|
-
/* @__PURE__ */
|
|
4497
|
-
/* @__PURE__ */ jsxs7(
|
|
4745
|
+
return /* @__PURE__ */ jsx11(Box8, { flexDirection: "row", flexWrap: wrap ? "wrap" : "nowrap", columnGap: 1, children: segments.map((segment, index) => /* @__PURE__ */ jsxs7(Box8, { flexDirection: "row", children: [
|
|
4746
|
+
index > 0 ? /* @__PURE__ */ jsx11(Text11, { dimColor: true, children: "| " }) : null,
|
|
4747
|
+
/* @__PURE__ */ jsx11(Text11, { bold: true, color: segment.color, children: segment.key }),
|
|
4748
|
+
/* @__PURE__ */ jsxs7(Text11, { dimColor: true, children: [
|
|
4498
4749
|
" ",
|
|
4499
4750
|
segment.label
|
|
4500
4751
|
] })
|
|
@@ -4503,16 +4754,16 @@ var HelpLegend = ({
|
|
|
4503
4754
|
var ResourceSummary = ({ label, value, terminalColumns }) => {
|
|
4504
4755
|
const rows = directArray3(value);
|
|
4505
4756
|
return /* @__PURE__ */ jsxs7(Box8, { flexDirection: "column", children: [
|
|
4506
|
-
/* @__PURE__ */
|
|
4507
|
-
/* @__PURE__ */
|
|
4508
|
-
rows.slice(0, 5).map((row, index) => /* @__PURE__ */ jsxs7(
|
|
4757
|
+
/* @__PURE__ */ jsx11(Text11, { bold: true, children: label }),
|
|
4758
|
+
/* @__PURE__ */ jsx11(Text11, { dimColor: true, wrap: "wrap", children: rows.length ? `${rows.length} row(s) returned` : `keys: ${truncateForTerminal(keySummary(value), Math.max(32, terminalColumns - 14))}` }),
|
|
4759
|
+
rows.slice(0, 5).map((row, index) => /* @__PURE__ */ jsxs7(Text11, { wrap: "truncate", children: [
|
|
4509
4760
|
index + 1,
|
|
4510
4761
|
".",
|
|
4511
4762
|
" ",
|
|
4512
4763
|
truncateForTerminal(rowLabel(row, `row ${index + 1}`), 36),
|
|
4513
4764
|
rowDetail(row) ? ` - ${truncateForTerminal(rowDetail(row), 64)}` : ""
|
|
4514
4765
|
] }, `${label}-${index}`)),
|
|
4515
|
-
!rows.length && !toRecord5(value) ? /* @__PURE__ */
|
|
4766
|
+
!rows.length && !toRecord5(value) ? /* @__PURE__ */ jsx11(Text11, { dimColor: true, children: "No data returned." }) : null
|
|
4516
4767
|
] });
|
|
4517
4768
|
};
|
|
4518
4769
|
var cleanBackendWarning = (warning, terminalColumns) => {
|
|
@@ -4534,29 +4785,29 @@ var entityToneColor = (tone) => {
|
|
|
4534
4785
|
};
|
|
4535
4786
|
var EntityDetailPanel = ({ model, emptyLabel, compact, terminalColumns }) => {
|
|
4536
4787
|
if (!model) {
|
|
4537
|
-
return /* @__PURE__ */
|
|
4788
|
+
return /* @__PURE__ */ jsx11(Text11, { dimColor: true, children: emptyLabel });
|
|
4538
4789
|
}
|
|
4539
|
-
return /* @__PURE__ */
|
|
4790
|
+
return /* @__PURE__ */ jsx11(SectionCard, { title: "Selected detail", borderColor: terminalTheme.focus, children: /* @__PURE__ */ jsxs7(Box8, { flexDirection: "column", gap: 1, children: [
|
|
4540
4791
|
/* @__PURE__ */ jsxs7(Box8, { flexDirection: compact ? "column" : "row", justifyContent: "space-between", gap: 1, children: [
|
|
4541
4792
|
/* @__PURE__ */ jsxs7(Box8, { flexDirection: "column", flexShrink: 1, children: [
|
|
4542
|
-
/* @__PURE__ */
|
|
4543
|
-
model.subtitle ? /* @__PURE__ */
|
|
4793
|
+
/* @__PURE__ */ jsx11(Text11, { color: terminalTheme.focus, bold: true, wrap: "truncate", children: truncateForTerminal(model.title, Math.max(24, terminalColumns - 32)) }),
|
|
4794
|
+
model.subtitle ? /* @__PURE__ */ jsx11(Text11, { dimColor: true, wrap: "truncate", children: model.subtitle }) : null
|
|
4544
4795
|
] }),
|
|
4545
|
-
/* @__PURE__ */
|
|
4796
|
+
/* @__PURE__ */ jsx11(MetricStrip, { metrics: model.metrics, compact })
|
|
4546
4797
|
] }),
|
|
4547
|
-
/* @__PURE__ */
|
|
4548
|
-
/* @__PURE__ */ jsxs7(
|
|
4798
|
+
/* @__PURE__ */ jsx11(Box8, { flexDirection: "column", children: model.detailRows.map((row) => /* @__PURE__ */ jsxs7(Text11, { wrap: "truncate", children: [
|
|
4799
|
+
/* @__PURE__ */ jsxs7(Text11, { dimColor: true, children: [
|
|
4549
4800
|
row.label.padEnd(16),
|
|
4550
4801
|
" "
|
|
4551
4802
|
] }),
|
|
4552
|
-
/* @__PURE__ */
|
|
4803
|
+
/* @__PURE__ */ jsx11(Text11, { color: entityToneColor(row.tone), children: truncateForTerminal(row.value || "-", Math.max(20, terminalColumns - 24)) })
|
|
4553
4804
|
] }, `${row.label}-${row.value}`)) }),
|
|
4554
4805
|
model.relatedItems.length ? /* @__PURE__ */ jsxs7(Box8, { flexDirection: "column", children: [
|
|
4555
|
-
/* @__PURE__ */
|
|
4556
|
-
model.relatedItems.slice(0, 5).map((item, index) => /* @__PURE__ */ jsxs7(
|
|
4557
|
-
/* @__PURE__ */
|
|
4806
|
+
/* @__PURE__ */ jsx11(Text11, { color: terminalTheme.brand, children: "Linked" }),
|
|
4807
|
+
model.relatedItems.slice(0, 5).map((item, index) => /* @__PURE__ */ jsxs7(Text11, { wrap: "truncate", children: [
|
|
4808
|
+
/* @__PURE__ */ jsx11(Text11, { color: entityToneColor(item.tone), children: "\u25CF " }),
|
|
4558
4809
|
truncateForTerminal(item.label, 36),
|
|
4559
|
-
item.detail ? /* @__PURE__ */ jsxs7(
|
|
4810
|
+
item.detail ? /* @__PURE__ */ jsxs7(Text11, { dimColor: true, children: [
|
|
4560
4811
|
" - ",
|
|
4561
4812
|
truncateForTerminal(item.detail, 36)
|
|
4562
4813
|
] }) : null
|
|
@@ -4571,7 +4822,7 @@ var ProjectsView = ({ projects, selectedProject, connections, reportsSummary, co
|
|
|
4571
4822
|
reportsSummary
|
|
4572
4823
|
});
|
|
4573
4824
|
return /* @__PURE__ */ jsxs7(Box8, { flexDirection: "column", gap: 1, children: [
|
|
4574
|
-
/* @__PURE__ */
|
|
4825
|
+
/* @__PURE__ */ jsx11(
|
|
4575
4826
|
MetricStrip,
|
|
4576
4827
|
{
|
|
4577
4828
|
compact,
|
|
@@ -4581,14 +4832,14 @@ var ProjectsView = ({ projects, selectedProject, connections, reportsSummary, co
|
|
|
4581
4832
|
]
|
|
4582
4833
|
}
|
|
4583
4834
|
),
|
|
4584
|
-
/* @__PURE__ */
|
|
4835
|
+
/* @__PURE__ */ jsx11(Text11, { dimColor: true, children: "J/K or Up/Down selects project | Enter confirms | O opens frontend" }),
|
|
4585
4836
|
/* @__PURE__ */ jsxs7(Box8, { flexDirection: compact ? "column" : "row", gap: 2, children: [
|
|
4586
4837
|
/* @__PURE__ */ jsxs7(Box8, { flexDirection: "column", flexBasis: compact ? void 0 : 52, flexShrink: 0, children: [
|
|
4587
|
-
/* @__PURE__ */
|
|
4838
|
+
/* @__PURE__ */ jsx11(Text11, { color: terminalTheme.brand, children: "Project list" }),
|
|
4588
4839
|
projects.length ? projects.slice(0, 12).map((project, index) => {
|
|
4589
4840
|
const active = project.id === (selectedProject ?? projects[0])?.id;
|
|
4590
4841
|
return /* @__PURE__ */ jsxs7(
|
|
4591
|
-
|
|
4842
|
+
Text11,
|
|
4592
4843
|
{
|
|
4593
4844
|
color: active ? terminalTheme.focus : void 0,
|
|
4594
4845
|
backgroundColor: active ? terminalTheme.selectedBackground : void 0,
|
|
@@ -4599,16 +4850,16 @@ var ProjectsView = ({ projects, selectedProject, connections, reportsSummary, co
|
|
|
4599
4850
|
" ",
|
|
4600
4851
|
truncateForTerminal(project.name, 30),
|
|
4601
4852
|
" ",
|
|
4602
|
-
/* @__PURE__ */
|
|
4853
|
+
/* @__PURE__ */ jsx11(Text11, { color: terminalTheme.brand, children: project.cloud_provider ?? "cloud" }),
|
|
4603
4854
|
" ",
|
|
4604
|
-
/* @__PURE__ */
|
|
4855
|
+
/* @__PURE__ */ jsx11(Text11, { dimColor: true, children: project.id })
|
|
4605
4856
|
]
|
|
4606
4857
|
},
|
|
4607
4858
|
project.id ?? index
|
|
4608
4859
|
);
|
|
4609
|
-
}) : /* @__PURE__ */
|
|
4860
|
+
}) : /* @__PURE__ */ jsx11(Text11, { dimColor: true, children: "No projects returned by the backend." })
|
|
4610
4861
|
] }),
|
|
4611
|
-
/* @__PURE__ */
|
|
4862
|
+
/* @__PURE__ */ jsx11(Box8, { flexGrow: 1, children: /* @__PURE__ */ jsx11(
|
|
4612
4863
|
EntityDetailPanel,
|
|
4613
4864
|
{
|
|
4614
4865
|
model: selectedModel,
|
|
@@ -4628,21 +4879,21 @@ var ConnectionsView = ({ connections, projects, selectedIndex, compact, terminal
|
|
|
4628
4879
|
projects
|
|
4629
4880
|
});
|
|
4630
4881
|
return /* @__PURE__ */ jsxs7(Box8, { flexDirection: "column", gap: 1, children: [
|
|
4631
|
-
/* @__PURE__ */
|
|
4882
|
+
/* @__PURE__ */ jsx11(
|
|
4632
4883
|
MetricStrip,
|
|
4633
4884
|
{
|
|
4634
4885
|
compact,
|
|
4635
4886
|
metrics: [{ label: "Connections", value: String(connections.length) }]
|
|
4636
4887
|
}
|
|
4637
4888
|
),
|
|
4638
|
-
/* @__PURE__ */
|
|
4889
|
+
/* @__PURE__ */ jsx11(Text11, { dimColor: true, children: "J/K or Up/Down selects connection | Enter confirms | O opens frontend | D downloads table data" }),
|
|
4639
4890
|
/* @__PURE__ */ jsxs7(Box8, { flexDirection: compact ? "column" : "row", gap: 2, children: [
|
|
4640
4891
|
/* @__PURE__ */ jsxs7(Box8, { flexDirection: "column", flexBasis: compact ? void 0 : 58, flexShrink: 0, children: [
|
|
4641
|
-
/* @__PURE__ */
|
|
4892
|
+
/* @__PURE__ */ jsx11(Text11, { color: terminalTheme.brand, children: "Connection list" }),
|
|
4642
4893
|
connections.length ? connections.slice(0, 12).map((connection, index) => {
|
|
4643
4894
|
const active = index === safeIndex;
|
|
4644
4895
|
return /* @__PURE__ */ jsxs7(
|
|
4645
|
-
|
|
4896
|
+
Text11,
|
|
4646
4897
|
{
|
|
4647
4898
|
color: active ? terminalTheme.focus : void 0,
|
|
4648
4899
|
backgroundColor: active ? terminalTheme.selectedBackground : void 0,
|
|
@@ -4654,7 +4905,7 @@ var ConnectionsView = ({ connections, projects, selectedIndex, compact, terminal
|
|
|
4654
4905
|
String(index + 1).padStart(2),
|
|
4655
4906
|
" ",
|
|
4656
4907
|
truncateForTerminal(rowLabel(connection, "connection"), 34),
|
|
4657
|
-
rowDetail(connection) ? /* @__PURE__ */ jsxs7(
|
|
4908
|
+
rowDetail(connection) ? /* @__PURE__ */ jsxs7(Text11, { dimColor: true, children: [
|
|
4658
4909
|
" - ",
|
|
4659
4910
|
truncateForTerminal(rowDetail(connection), 28)
|
|
4660
4911
|
] }) : ""
|
|
@@ -4662,9 +4913,9 @@ var ConnectionsView = ({ connections, projects, selectedIndex, compact, terminal
|
|
|
4662
4913
|
},
|
|
4663
4914
|
String(firstString5(connection, ["id"], String(index)))
|
|
4664
4915
|
);
|
|
4665
|
-
}) : /* @__PURE__ */
|
|
4916
|
+
}) : /* @__PURE__ */ jsx11(Text11, { dimColor: true, children: "No connections returned by the backend." })
|
|
4666
4917
|
] }),
|
|
4667
|
-
/* @__PURE__ */
|
|
4918
|
+
/* @__PURE__ */ jsx11(Box8, { flexGrow: 1, children: /* @__PURE__ */ jsx11(
|
|
4668
4919
|
EntityDetailPanel,
|
|
4669
4920
|
{
|
|
4670
4921
|
model: selectedModel,
|
|
@@ -4719,10 +4970,10 @@ var BillingView = ({ state, compact, terminalColumns, frontendUrl }) => {
|
|
|
4719
4970
|
}
|
|
4720
4971
|
];
|
|
4721
4972
|
return /* @__PURE__ */ jsxs7(Box8, { flexDirection: "column", gap: 1, children: [
|
|
4722
|
-
/* @__PURE__ */
|
|
4973
|
+
/* @__PURE__ */ jsx11(MetricStrip, { metrics, compact }),
|
|
4723
4974
|
/* @__PURE__ */ jsxs7(Box8, { flexDirection: "row", gap: 1, children: [
|
|
4724
|
-
/* @__PURE__ */
|
|
4725
|
-
remaining !== void 0 && total !== void 0 ? /* @__PURE__ */
|
|
4975
|
+
/* @__PURE__ */ jsx11(Text11, { dimColor: true, children: "Credit balance" }),
|
|
4976
|
+
remaining !== void 0 && total !== void 0 ? /* @__PURE__ */ jsx11(
|
|
4726
4977
|
CreditProgress,
|
|
4727
4978
|
{
|
|
4728
4979
|
remaining,
|
|
@@ -4731,17 +4982,17 @@ var BillingView = ({ state, compact, terminalColumns, frontendUrl }) => {
|
|
|
4731
4982
|
tone: creditTone
|
|
4732
4983
|
}
|
|
4733
4984
|
) : /* @__PURE__ */ jsxs7(Fragment2, { children: [
|
|
4734
|
-
/* @__PURE__ */
|
|
4735
|
-
/* @__PURE__ */
|
|
4985
|
+
/* @__PURE__ */ jsx11(Bar, { value: remainingRatio, tone }),
|
|
4986
|
+
/* @__PURE__ */ jsx11(Text11, { children: formatPercent(remainingRatio) })
|
|
4736
4987
|
] })
|
|
4737
4988
|
] }),
|
|
4738
|
-
/* @__PURE__ */ jsxs7(
|
|
4989
|
+
/* @__PURE__ */ jsxs7(Text11, { dimColor: true, wrap: "wrap", children: [
|
|
4739
4990
|
"Subscribe: ",
|
|
4740
4991
|
plansUrl,
|
|
4741
4992
|
" | Top up: ",
|
|
4742
4993
|
topUpUrl
|
|
4743
4994
|
] }),
|
|
4744
|
-
/* @__PURE__ */
|
|
4995
|
+
/* @__PURE__ */ jsx11(SectionCard, { title: "Usage trend", borderColor: terminalTheme.brand, children: /* @__PURE__ */ jsx11(
|
|
4745
4996
|
AsciiLineChart,
|
|
4746
4997
|
{
|
|
4747
4998
|
values: usageValues,
|
|
@@ -4750,7 +5001,7 @@ var BillingView = ({ state, compact, terminalColumns, frontendUrl }) => {
|
|
|
4750
5001
|
tone: "normal"
|
|
4751
5002
|
}
|
|
4752
5003
|
) }),
|
|
4753
|
-
/* @__PURE__ */
|
|
5004
|
+
/* @__PURE__ */ jsx11(
|
|
4754
5005
|
ResourceSummary,
|
|
4755
5006
|
{
|
|
4756
5007
|
label: "Recent ledger",
|
|
@@ -4758,7 +5009,7 @@ var BillingView = ({ state, compact, terminalColumns, frontendUrl }) => {
|
|
|
4758
5009
|
terminalColumns
|
|
4759
5010
|
}
|
|
4760
5011
|
),
|
|
4761
|
-
/* @__PURE__ */
|
|
5012
|
+
/* @__PURE__ */ jsx11(
|
|
4762
5013
|
ResourceSummary,
|
|
4763
5014
|
{
|
|
4764
5015
|
label: "Invoices",
|
|
@@ -4766,7 +5017,7 @@ var BillingView = ({ state, compact, terminalColumns, frontendUrl }) => {
|
|
|
4766
5017
|
terminalColumns
|
|
4767
5018
|
}
|
|
4768
5019
|
),
|
|
4769
|
-
/* @__PURE__ */
|
|
5020
|
+
/* @__PURE__ */ jsx11(
|
|
4770
5021
|
ResourceSummary,
|
|
4771
5022
|
{
|
|
4772
5023
|
label: "Top-ups",
|
|
@@ -4774,7 +5025,7 @@ var BillingView = ({ state, compact, terminalColumns, frontendUrl }) => {
|
|
|
4774
5025
|
terminalColumns
|
|
4775
5026
|
}
|
|
4776
5027
|
),
|
|
4777
|
-
/* @__PURE__ */
|
|
5028
|
+
/* @__PURE__ */ jsx11(
|
|
4778
5029
|
ResourceSummary,
|
|
4779
5030
|
{
|
|
4780
5031
|
label: "Notifications",
|
|
@@ -4819,13 +5070,13 @@ var ReportsHeatmap = ({ rows, terminalColumns, page = 0 }) => {
|
|
|
4819
5070
|
const startIndex = safePage * maxRows;
|
|
4820
5071
|
const visibleRows = rows.slice(startIndex, startIndex + maxRows);
|
|
4821
5072
|
if (!visibleRows.length) {
|
|
4822
|
-
return /* @__PURE__ */
|
|
5073
|
+
return /* @__PURE__ */ jsx11(Text11, { dimColor: true, children: "No project report status data returned." });
|
|
4823
5074
|
}
|
|
4824
5075
|
const statusCell = (status, width) => {
|
|
4825
5076
|
const label = compactStatusLabel(status);
|
|
4826
5077
|
return /* @__PURE__ */ jsxs7(Box8, { width, children: [
|
|
4827
|
-
/* @__PURE__ */
|
|
4828
|
-
/* @__PURE__ */
|
|
5078
|
+
/* @__PURE__ */ jsx11(Text11, { color: statusHeatColor(status), children: "\u25CF " }),
|
|
5079
|
+
/* @__PURE__ */ jsx11(Text11, { wrap: "truncate", children: truncateForTerminal(label, Math.max(4, width - 2)) })
|
|
4829
5080
|
] });
|
|
4830
5081
|
};
|
|
4831
5082
|
const nameWidth = Math.max(
|
|
@@ -4840,27 +5091,27 @@ var ReportsHeatmap = ({ rows, terminalColumns, page = 0 }) => {
|
|
|
4840
5091
|
{ key: "freshness", label: "Freshness" }
|
|
4841
5092
|
];
|
|
4842
5093
|
return /* @__PURE__ */ jsxs7(Box8, { flexDirection: "column", gap: 1, children: [
|
|
4843
|
-
/* @__PURE__ */
|
|
4844
|
-
/* @__PURE__ */ jsxs7(
|
|
4845
|
-
/* @__PURE__ */
|
|
4846
|
-
/* @__PURE__ */
|
|
4847
|
-
/* @__PURE__ */
|
|
4848
|
-
/* @__PURE__ */
|
|
4849
|
-
/* @__PURE__ */
|
|
5094
|
+
/* @__PURE__ */ jsx11(Text11, { dimColor: true, wrap: "wrap", children: "Each row shows whether the selected project has generated report artifacts and whether they are current." }),
|
|
5095
|
+
/* @__PURE__ */ jsxs7(Text11, { dimColor: true, children: [
|
|
5096
|
+
/* @__PURE__ */ jsx11(Text11, { color: terminalTheme.success, children: "\u25CF ready" }),
|
|
5097
|
+
/* @__PURE__ */ jsx11(Text11, { children: " " }),
|
|
5098
|
+
/* @__PURE__ */ jsx11(Text11, { color: terminalTheme.warning, children: "\u25CF running/partial/stale" }),
|
|
5099
|
+
/* @__PURE__ */ jsx11(Text11, { children: " " }),
|
|
5100
|
+
/* @__PURE__ */ jsx11(Text11, { color: terminalTheme.danger, children: "\u25CF failed/missing/outdated" })
|
|
4850
5101
|
] }),
|
|
4851
5102
|
/* @__PURE__ */ jsxs7(Box8, { flexDirection: "row", children: [
|
|
4852
|
-
/* @__PURE__ */
|
|
4853
|
-
columns.map((column) => /* @__PURE__ */
|
|
4854
|
-
/* @__PURE__ */
|
|
5103
|
+
/* @__PURE__ */ jsx11(Box8, { width: nameWidth, children: /* @__PURE__ */ jsx11(Text11, { color: terminalTheme.brand, bold: true, children: "Project" }) }),
|
|
5104
|
+
columns.map((column) => /* @__PURE__ */ jsx11(Box8, { width: statusWidth, children: /* @__PURE__ */ jsx11(Text11, { color: terminalTheme.brand, bold: true, children: column.label }) }, column.key)),
|
|
5105
|
+
/* @__PURE__ */ jsx11(Text11, { color: terminalTheme.brand, bold: true, children: "Critical issues" })
|
|
4855
5106
|
] }),
|
|
4856
5107
|
visibleRows.map((row) => /* @__PURE__ */ jsxs7(Box8, { flexDirection: "row", children: [
|
|
4857
|
-
/* @__PURE__ */
|
|
5108
|
+
/* @__PURE__ */ jsx11(Box8, { width: nameWidth, children: /* @__PURE__ */ jsx11(Text11, { wrap: "truncate", children: row.projectName }) }),
|
|
4858
5109
|
columns.map((column) => {
|
|
4859
5110
|
const status = row[column.key];
|
|
4860
|
-
return /* @__PURE__ */
|
|
5111
|
+
return /* @__PURE__ */ jsx11(React7.Fragment, { children: statusCell(status, statusWidth) }, column.key);
|
|
4861
5112
|
}),
|
|
4862
|
-
/* @__PURE__ */
|
|
4863
|
-
|
|
5113
|
+
/* @__PURE__ */ jsx11(
|
|
5114
|
+
Text11,
|
|
4864
5115
|
{
|
|
4865
5116
|
color: row.criticalIssues ? terminalTheme.danger : terminalTheme.success,
|
|
4866
5117
|
children: row.criticalIssues
|
|
@@ -4868,7 +5119,7 @@ var ReportsHeatmap = ({ rows, terminalColumns, page = 0 }) => {
|
|
|
4868
5119
|
)
|
|
4869
5120
|
] }, row.projectId)),
|
|
4870
5121
|
/* @__PURE__ */ jsxs7(Box8, { flexDirection: "row", justifyContent: "space-between", children: [
|
|
4871
|
-
/* @__PURE__ */ jsxs7(
|
|
5122
|
+
/* @__PURE__ */ jsxs7(Text11, { dimColor: true, children: [
|
|
4872
5123
|
"rows ",
|
|
4873
5124
|
startIndex + 1,
|
|
4874
5125
|
"-",
|
|
@@ -4877,7 +5128,7 @@ var ReportsHeatmap = ({ rows, terminalColumns, page = 0 }) => {
|
|
|
4877
5128
|
" ",
|
|
4878
5129
|
rows.length
|
|
4879
5130
|
] }),
|
|
4880
|
-
/* @__PURE__ */ jsxs7(
|
|
5131
|
+
/* @__PURE__ */ jsxs7(Text11, { dimColor: true, children: [
|
|
4881
5132
|
"page ",
|
|
4882
5133
|
safePage + 1,
|
|
4883
5134
|
"/",
|
|
@@ -4888,23 +5139,23 @@ var ReportsHeatmap = ({ rows, terminalColumns, page = 0 }) => {
|
|
|
4888
5139
|
] });
|
|
4889
5140
|
};
|
|
4890
5141
|
var ReportRunActions = ({ compact }) => /* @__PURE__ */ jsxs7(Box8, { flexDirection: "column", gap: 1, children: [
|
|
4891
|
-
/* @__PURE__ */
|
|
4892
|
-
/* @__PURE__ */
|
|
5142
|
+
/* @__PURE__ */ jsx11(Text11, { dimColor: true, wrap: "wrap", children: "Run report generation directly through backend report APIs using the selected project context." }),
|
|
5143
|
+
/* @__PURE__ */ jsx11(Box8, { flexDirection: "row", gap: 1, flexWrap: "wrap", children: [
|
|
4893
5144
|
["W", "Well-Architected"],
|
|
4894
5145
|
["K", "Cost"],
|
|
4895
5146
|
["U", "Unit tests"],
|
|
4896
5147
|
["A", "All reports"],
|
|
4897
5148
|
["O", "Open frontend"]
|
|
4898
|
-
].map(([keyName, label]) => /* @__PURE__ */
|
|
5149
|
+
].map(([keyName, label]) => /* @__PURE__ */ jsx11(
|
|
4899
5150
|
Box8,
|
|
4900
5151
|
{
|
|
4901
5152
|
borderStyle: raisedButtonStyle.border,
|
|
4902
5153
|
borderColor: terminalTheme.muted,
|
|
4903
5154
|
paddingX: 1,
|
|
4904
5155
|
minWidth: compact ? void 0 : 18,
|
|
4905
|
-
children: /* @__PURE__ */ jsxs7(
|
|
4906
|
-
/* @__PURE__ */
|
|
4907
|
-
/* @__PURE__ */ jsxs7(
|
|
5156
|
+
children: /* @__PURE__ */ jsxs7(Text11, { children: [
|
|
5157
|
+
/* @__PURE__ */ jsx11(Text11, { color: terminalTheme.brand, bold: true, children: keyName }),
|
|
5158
|
+
/* @__PURE__ */ jsxs7(Text11, { children: [
|
|
4908
5159
|
" ",
|
|
4909
5160
|
label
|
|
4910
5161
|
] })
|
|
@@ -4913,14 +5164,14 @@ var ReportRunActions = ({ compact }) => /* @__PURE__ */ jsxs7(Box8, { flexDirect
|
|
|
4913
5164
|
keyName
|
|
4914
5165
|
)) })
|
|
4915
5166
|
] });
|
|
4916
|
-
var ProjectDropdownButton = ({ projectName: projectName2, compact }) => /* @__PURE__ */
|
|
5167
|
+
var ProjectDropdownButton = ({ projectName: projectName2, compact }) => /* @__PURE__ */ jsx11(
|
|
4917
5168
|
Box8,
|
|
4918
5169
|
{
|
|
4919
5170
|
borderStyle: raisedButtonStyle.border,
|
|
4920
5171
|
borderColor: terminalTheme.brand,
|
|
4921
5172
|
paddingX: 1,
|
|
4922
5173
|
minWidth: compact ? void 0 : 28,
|
|
4923
|
-
children: /* @__PURE__ */ jsxs7(
|
|
5174
|
+
children: /* @__PURE__ */ jsxs7(Text11, { color: terminalTheme.brand, bold: true, wrap: "truncate", children: [
|
|
4924
5175
|
raisedButtonStyle.activeMarker,
|
|
4925
5176
|
" Project [",
|
|
4926
5177
|
truncateForTerminal(projectName2, compact ? 28 : 36),
|
|
@@ -4957,31 +5208,31 @@ var ReportsView = ({
|
|
|
4957
5208
|
gap: 1,
|
|
4958
5209
|
children: [
|
|
4959
5210
|
/* @__PURE__ */ jsxs7(Box8, { flexDirection: "column", flexShrink: 1, children: [
|
|
4960
|
-
/* @__PURE__ */
|
|
4961
|
-
/* @__PURE__ */
|
|
5211
|
+
/* @__PURE__ */ jsx11(Text11, { bold: true, children: "Reports home" }),
|
|
5212
|
+
/* @__PURE__ */ jsx11(Text11, { dimColor: true, wrap: "wrap", children: "Portfolio summary, score signals, report health, and selected project drilldown." })
|
|
4962
5213
|
] }),
|
|
4963
5214
|
/* @__PURE__ */ jsxs7(Box8, { flexDirection: "column", children: [
|
|
4964
|
-
/* @__PURE__ */
|
|
5215
|
+
/* @__PURE__ */ jsx11(
|
|
4965
5216
|
ProjectDropdownButton,
|
|
4966
5217
|
{
|
|
4967
5218
|
projectName: selectedProject?.name ?? selectedSummary.projectName,
|
|
4968
5219
|
compact
|
|
4969
5220
|
}
|
|
4970
5221
|
),
|
|
4971
|
-
/* @__PURE__ */
|
|
5222
|
+
/* @__PURE__ */ jsx11(Text11, { dimColor: true, children: "Press P or Enter to choose project" })
|
|
4972
5223
|
] })
|
|
4973
5224
|
]
|
|
4974
5225
|
}
|
|
4975
5226
|
),
|
|
4976
|
-
!hasReportData ? /* @__PURE__ */
|
|
4977
|
-
/* @__PURE__ */
|
|
4978
|
-
/* @__PURE__ */
|
|
4979
|
-
/* @__PURE__ */
|
|
5227
|
+
!hasReportData ? /* @__PURE__ */ jsx11(Text11, { dimColor: true, children: "No report summary returned yet. Generate a report or refresh this tab." }) : null,
|
|
5228
|
+
/* @__PURE__ */ jsx11(MetricStrip, { metrics: model.metrics, compact }),
|
|
5229
|
+
/* @__PURE__ */ jsx11(SectionCard, { title: "Report sections", children: /* @__PURE__ */ jsxs7(Box8, { flexDirection: "column", gap: 1, children: [
|
|
5230
|
+
/* @__PURE__ */ jsx11(Box8, { flexDirection: compact ? "column" : "row", gap: 1, children: model.reportTabs.map((tab) => /* @__PURE__ */ jsxs7(Text11, { color: tab.selected ? "cyan" : void 0, children: [
|
|
4980
5231
|
tab.selected ? ">" : "-",
|
|
4981
5232
|
" ",
|
|
4982
5233
|
tab.label
|
|
4983
5234
|
] }, tab.id)) }),
|
|
4984
|
-
/* @__PURE__ */
|
|
5235
|
+
/* @__PURE__ */ jsx11(
|
|
4985
5236
|
ResponsiveTable,
|
|
4986
5237
|
{
|
|
4987
5238
|
terminalColumns,
|
|
@@ -4995,8 +5246,8 @@ var ReportsView = ({
|
|
|
4995
5246
|
}
|
|
4996
5247
|
)
|
|
4997
5248
|
] }) }),
|
|
4998
|
-
/* @__PURE__ */
|
|
4999
|
-
/* @__PURE__ */
|
|
5249
|
+
/* @__PURE__ */ jsx11(SectionCard, { title: "Run reports", children: /* @__PURE__ */ jsx11(ReportRunActions, { compact }) }),
|
|
5250
|
+
/* @__PURE__ */ jsx11(SectionCard, { title: "Project report status", children: /* @__PURE__ */ jsx11(
|
|
5000
5251
|
ReportsHeatmap,
|
|
5001
5252
|
{
|
|
5002
5253
|
rows: model.projectRows,
|
|
@@ -5008,8 +5259,8 @@ var ReportsView = ({
|
|
|
5008
5259
|
/* @__PURE__ */ jsxs7(Box8, { flexDirection: "column", gap: 1, flexGrow: 1, children: [
|
|
5009
5260
|
/* @__PURE__ */ jsxs7(SectionCard, { title: "Portfolio coverage", children: [
|
|
5010
5261
|
/* @__PURE__ */ jsxs7(Box8, { flexDirection: "row", gap: 1, children: [
|
|
5011
|
-
/* @__PURE__ */
|
|
5012
|
-
/* @__PURE__ */
|
|
5262
|
+
/* @__PURE__ */ jsx11(Text11, { wrap: "truncate", children: model.coverageLabel }),
|
|
5263
|
+
/* @__PURE__ */ jsx11(
|
|
5013
5264
|
Bar,
|
|
5014
5265
|
{
|
|
5015
5266
|
value: model.coverageRatio,
|
|
@@ -5017,11 +5268,11 @@ var ReportsView = ({
|
|
|
5017
5268
|
tone: "success"
|
|
5018
5269
|
}
|
|
5019
5270
|
),
|
|
5020
|
-
/* @__PURE__ */
|
|
5271
|
+
/* @__PURE__ */ jsx11(Text11, { children: formatPercent(model.coverageRatio) })
|
|
5021
5272
|
] }),
|
|
5022
|
-
/* @__PURE__ */
|
|
5273
|
+
/* @__PURE__ */ jsx11(Box8, { marginTop: 1, children: /* @__PURE__ */ jsx11(TrendSummary, { trend: model.activityTrend, width: chartWidth }) })
|
|
5023
5274
|
] }),
|
|
5024
|
-
/* @__PURE__ */
|
|
5275
|
+
/* @__PURE__ */ jsx11(SectionCard, { title: "Report types", children: /* @__PURE__ */ jsx11(
|
|
5025
5276
|
BarList,
|
|
5026
5277
|
{
|
|
5027
5278
|
bars: model.reportTypeBars,
|
|
@@ -5031,7 +5282,7 @@ var ReportsView = ({
|
|
|
5031
5282
|
) })
|
|
5032
5283
|
] }),
|
|
5033
5284
|
/* @__PURE__ */ jsxs7(Box8, { flexDirection: "column", gap: 1, flexGrow: 1, children: [
|
|
5034
|
-
/* @__PURE__ */
|
|
5285
|
+
/* @__PURE__ */ jsx11(SectionCard, { title: "Report pipeline", children: /* @__PURE__ */ jsx11(
|
|
5035
5286
|
BarList,
|
|
5036
5287
|
{
|
|
5037
5288
|
bars: model.statusBars,
|
|
@@ -5039,7 +5290,7 @@ var ReportsView = ({
|
|
|
5039
5290
|
emptyLabel: "No report status breakdown returned."
|
|
5040
5291
|
}
|
|
5041
5292
|
) }),
|
|
5042
|
-
/* @__PURE__ */
|
|
5293
|
+
/* @__PURE__ */ jsx11(SectionCard, { title: "Freshness", children: /* @__PURE__ */ jsx11(
|
|
5043
5294
|
BarList,
|
|
5044
5295
|
{
|
|
5045
5296
|
bars: model.freshnessBars,
|
|
@@ -5058,26 +5309,26 @@ var ReportsView = ({
|
|
|
5058
5309
|
gap: 1,
|
|
5059
5310
|
children: [
|
|
5060
5311
|
/* @__PURE__ */ jsxs7(Box8, { flexDirection: "column", flexShrink: 1, children: [
|
|
5061
|
-
/* @__PURE__ */
|
|
5062
|
-
selectedSummary.projectId ? /* @__PURE__ */
|
|
5312
|
+
/* @__PURE__ */ jsx11(Text11, { bold: true, wrap: "truncate", children: selectedSummary.projectName }),
|
|
5313
|
+
selectedSummary.projectId ? /* @__PURE__ */ jsx11(Text11, { dimColor: true, wrap: "truncate", children: selectedSummary.projectId }) : /* @__PURE__ */ jsx11(Text11, { dimColor: true, children: "Select a project to load cost and architecture report details." })
|
|
5063
5314
|
] }),
|
|
5064
|
-
selectedSummary.lastReportAt ? /* @__PURE__ */ jsxs7(
|
|
5315
|
+
selectedSummary.lastReportAt ? /* @__PURE__ */ jsxs7(Text11, { dimColor: true, children: [
|
|
5065
5316
|
"last report ",
|
|
5066
5317
|
selectedSummary.lastReportAt
|
|
5067
5318
|
] }) : null
|
|
5068
5319
|
]
|
|
5069
5320
|
}
|
|
5070
5321
|
),
|
|
5071
|
-
/* @__PURE__ */
|
|
5322
|
+
/* @__PURE__ */ jsx11(Box8, { marginTop: 1, children: /* @__PURE__ */ jsx11(MetricStrip, { metrics: selectedSummary.metrics, compact }) }),
|
|
5072
5323
|
selectedStatuses ? /* @__PURE__ */ jsxs7(Box8, { flexDirection: compact ? "column" : "row", gap: 1, marginTop: 1, children: [
|
|
5073
|
-
/* @__PURE__ */ jsxs7(
|
|
5074
|
-
/* @__PURE__ */
|
|
5075
|
-
/* @__PURE__ */
|
|
5324
|
+
/* @__PURE__ */ jsxs7(Text11, { children: [
|
|
5325
|
+
/* @__PURE__ */ jsx11(Text11, { dimColor: true, children: "Cost " }),
|
|
5326
|
+
/* @__PURE__ */ jsx11(Text11, { color: statusTextColor(selectedStatuses.cost ?? ""), children: compactStatusLabel(selectedStatuses.cost ?? "not_started") })
|
|
5076
5327
|
] }),
|
|
5077
|
-
/* @__PURE__ */ jsxs7(
|
|
5078
|
-
/* @__PURE__ */
|
|
5079
|
-
/* @__PURE__ */
|
|
5080
|
-
|
|
5328
|
+
/* @__PURE__ */ jsxs7(Text11, { children: [
|
|
5329
|
+
/* @__PURE__ */ jsx11(Text11, { dimColor: true, children: "Architecture " }),
|
|
5330
|
+
/* @__PURE__ */ jsx11(
|
|
5331
|
+
Text11,
|
|
5081
5332
|
{
|
|
5082
5333
|
color: statusTextColor(selectedStatuses.architecture ?? ""),
|
|
5083
5334
|
children: compactStatusLabel(
|
|
@@ -5086,14 +5337,14 @@ var ReportsView = ({
|
|
|
5086
5337
|
}
|
|
5087
5338
|
)
|
|
5088
5339
|
] }),
|
|
5089
|
-
/* @__PURE__ */ jsxs7(
|
|
5090
|
-
/* @__PURE__ */
|
|
5091
|
-
/* @__PURE__ */
|
|
5340
|
+
/* @__PURE__ */ jsxs7(Text11, { children: [
|
|
5341
|
+
/* @__PURE__ */ jsx11(Text11, { dimColor: true, children: "Unit tests " }),
|
|
5342
|
+
/* @__PURE__ */ jsx11(Text11, { color: statusTextColor(selectedStatuses.unitTests ?? ""), children: compactStatusLabel(
|
|
5092
5343
|
selectedStatuses.unitTests ?? "not_started"
|
|
5093
5344
|
) })
|
|
5094
5345
|
] })
|
|
5095
5346
|
] }) : null,
|
|
5096
|
-
/* @__PURE__ */
|
|
5347
|
+
/* @__PURE__ */ jsx11(Box8, { marginTop: 1, children: /* @__PURE__ */ jsx11(
|
|
5097
5348
|
BarList,
|
|
5098
5349
|
{
|
|
5099
5350
|
bars: selectedSummary.pillarScores,
|
|
@@ -5102,7 +5353,7 @@ var ReportsView = ({
|
|
|
5102
5353
|
}
|
|
5103
5354
|
) })
|
|
5104
5355
|
] }),
|
|
5105
|
-
model.projectRows.length ? /* @__PURE__ */
|
|
5356
|
+
model.projectRows.length ? /* @__PURE__ */ jsx11(SectionCard, { title: "Project health", children: /* @__PURE__ */ jsx11(
|
|
5106
5357
|
ResponsiveTable,
|
|
5107
5358
|
{
|
|
5108
5359
|
terminalColumns,
|
|
@@ -5127,7 +5378,7 @@ var ReportsView = ({
|
|
|
5127
5378
|
page: tablePage
|
|
5128
5379
|
}
|
|
5129
5380
|
) }) : null,
|
|
5130
|
-
model.topActions.length ? /* @__PURE__ */
|
|
5381
|
+
model.topActions.length ? /* @__PURE__ */ jsx11(SectionCard, { title: "Top actions", children: /* @__PURE__ */ jsx11(
|
|
5131
5382
|
ResponsiveTable,
|
|
5132
5383
|
{
|
|
5133
5384
|
terminalColumns,
|
|
@@ -5142,7 +5393,7 @@ var ReportsView = ({
|
|
|
5142
5393
|
page: tablePage
|
|
5143
5394
|
}
|
|
5144
5395
|
) }) : null,
|
|
5145
|
-
model.topInsights.length ? /* @__PURE__ */
|
|
5396
|
+
model.topInsights.length ? /* @__PURE__ */ jsx11(SectionCard, { title: "Key insights", children: /* @__PURE__ */ jsx11(
|
|
5146
5397
|
ResponsiveTable,
|
|
5147
5398
|
{
|
|
5148
5399
|
terminalColumns,
|
|
@@ -5154,7 +5405,7 @@ var ReportsView = ({
|
|
|
5154
5405
|
page: tablePage
|
|
5155
5406
|
}
|
|
5156
5407
|
) }) : null,
|
|
5157
|
-
projects.length && !model.projectRows.length ? /* @__PURE__ */ jsxs7(
|
|
5408
|
+
projects.length && !model.projectRows.length ? /* @__PURE__ */ jsxs7(Text11, { dimColor: true, children: [
|
|
5158
5409
|
projects.length,
|
|
5159
5410
|
" project(s) available. Pick a project from the dropdown to inspect specific reports."
|
|
5160
5411
|
] }) : null
|
|
@@ -5178,20 +5429,20 @@ var OverviewView = ({
|
|
|
5178
5429
|
const chartWidth = compact ? Math.max(24, terminalColumns - 28) : 42;
|
|
5179
5430
|
const barWidth = compact ? Math.max(14, terminalColumns - 42) : 24;
|
|
5180
5431
|
return /* @__PURE__ */ jsxs7(Box8, { flexDirection: "column", gap: 1, children: [
|
|
5181
|
-
/* @__PURE__ */
|
|
5182
|
-
/* @__PURE__ */ jsxs7(
|
|
5432
|
+
/* @__PURE__ */ jsx11(MetricStrip, { metrics: model.metrics, compact }),
|
|
5433
|
+
/* @__PURE__ */ jsxs7(Text11, { wrap: "wrap", children: [
|
|
5183
5434
|
"Project: ",
|
|
5184
5435
|
selectedProject?.name ?? "none",
|
|
5185
5436
|
" ",
|
|
5186
|
-
/* @__PURE__ */
|
|
5437
|
+
/* @__PURE__ */ jsx11(Text11, { dimColor: true, children: selectedProject?.id ? `(${selectedProject.id})` : "" })
|
|
5187
5438
|
] }),
|
|
5188
5439
|
/* @__PURE__ */ jsxs7(Box8, { flexDirection: compact ? "column" : "row", gap: 2, children: [
|
|
5189
|
-
/* @__PURE__ */
|
|
5190
|
-
/* @__PURE__ */
|
|
5191
|
-
/* @__PURE__ */
|
|
5192
|
-
/* @__PURE__ */
|
|
5440
|
+
/* @__PURE__ */ jsx11(Box8, { flexDirection: "column", gap: 1, flexGrow: 1, children: /* @__PURE__ */ jsxs7(SectionCard, { title: "Trends", children: [
|
|
5441
|
+
/* @__PURE__ */ jsx11(TrendSummary, { trend: model.trends.score, width: chartWidth }),
|
|
5442
|
+
/* @__PURE__ */ jsx11(Box8, { marginTop: 1, children: /* @__PURE__ */ jsx11(TrendSummary, { trend: model.trends.cost, width: chartWidth }) }),
|
|
5443
|
+
/* @__PURE__ */ jsx11(Box8, { marginTop: 1, children: /* @__PURE__ */ jsx11(TrendSummary, { trend: model.trends.reports, width: chartWidth }) })
|
|
5193
5444
|
] }) }),
|
|
5194
|
-
/* @__PURE__ */
|
|
5445
|
+
/* @__PURE__ */ jsx11(Box8, { flexDirection: "column", gap: 1, flexGrow: 1, children: /* @__PURE__ */ jsx11(SectionCard, { title: "Architecture scores", children: /* @__PURE__ */ jsx11(
|
|
5195
5446
|
BarList,
|
|
5196
5447
|
{
|
|
5197
5448
|
bars: model.pillarScores,
|
|
@@ -5202,7 +5453,7 @@ var OverviewView = ({
|
|
|
5202
5453
|
] }),
|
|
5203
5454
|
/* @__PURE__ */ jsxs7(Box8, { flexDirection: compact ? "column" : "row", gap: 2, children: [
|
|
5204
5455
|
/* @__PURE__ */ jsxs7(Box8, { flexDirection: "column", gap: 1, flexGrow: 1, children: [
|
|
5205
|
-
/* @__PURE__ */
|
|
5456
|
+
/* @__PURE__ */ jsx11(SectionCard, { title: "Issues by pillar", children: /* @__PURE__ */ jsx11(
|
|
5206
5457
|
BarList,
|
|
5207
5458
|
{
|
|
5208
5459
|
bars: model.issuesByPillar,
|
|
@@ -5210,7 +5461,7 @@ var OverviewView = ({
|
|
|
5210
5461
|
emptyLabel: "No issue breakdown returned by /dashboard/user."
|
|
5211
5462
|
}
|
|
5212
5463
|
) }),
|
|
5213
|
-
/* @__PURE__ */
|
|
5464
|
+
/* @__PURE__ */ jsx11(SectionCard, { title: "Project health", children: /* @__PURE__ */ jsx11(
|
|
5214
5465
|
BarList,
|
|
5215
5466
|
{
|
|
5216
5467
|
bars: model.projectHealth,
|
|
@@ -5220,7 +5471,7 @@ var OverviewView = ({
|
|
|
5220
5471
|
) })
|
|
5221
5472
|
] }),
|
|
5222
5473
|
/* @__PURE__ */ jsxs7(Box8, { flexDirection: "column", gap: 1, flexGrow: 1, children: [
|
|
5223
|
-
/* @__PURE__ */
|
|
5474
|
+
/* @__PURE__ */ jsx11(SectionCard, { title: "Monthly cost by service", children: /* @__PURE__ */ jsx11(
|
|
5224
5475
|
BarList,
|
|
5225
5476
|
{
|
|
5226
5477
|
bars: model.serviceCosts,
|
|
@@ -5228,7 +5479,7 @@ var OverviewView = ({
|
|
|
5228
5479
|
emptyLabel: "No service cost breakdown returned."
|
|
5229
5480
|
}
|
|
5230
5481
|
) }),
|
|
5231
|
-
/* @__PURE__ */
|
|
5482
|
+
/* @__PURE__ */ jsx11(SectionCard, { title: "Report pipeline", children: /* @__PURE__ */ jsx11(
|
|
5232
5483
|
BarList,
|
|
5233
5484
|
{
|
|
5234
5485
|
bars: model.reportStatus,
|
|
@@ -5238,7 +5489,7 @@ var OverviewView = ({
|
|
|
5238
5489
|
) })
|
|
5239
5490
|
] })
|
|
5240
5491
|
] }),
|
|
5241
|
-
/* @__PURE__ */
|
|
5492
|
+
/* @__PURE__ */ jsx11(SectionCard, { title: "Report freshness", children: /* @__PURE__ */ jsx11(
|
|
5242
5493
|
BarList,
|
|
5243
5494
|
{
|
|
5244
5495
|
bars: model.reportFreshness,
|
|
@@ -5246,7 +5497,7 @@ var OverviewView = ({
|
|
|
5246
5497
|
emptyLabel: "No report freshness breakdown returned."
|
|
5247
5498
|
}
|
|
5248
5499
|
) }),
|
|
5249
|
-
model.topActions.length ? /* @__PURE__ */
|
|
5500
|
+
model.topActions.length ? /* @__PURE__ */ jsx11(SectionCard, { title: "Top actions", children: /* @__PURE__ */ jsx11(
|
|
5250
5501
|
ResponsiveTable,
|
|
5251
5502
|
{
|
|
5252
5503
|
terminalColumns,
|
|
@@ -5261,7 +5512,7 @@ var OverviewView = ({
|
|
|
5261
5512
|
page: tablePage
|
|
5262
5513
|
}
|
|
5263
5514
|
) }) : null,
|
|
5264
|
-
model.topRecommendations.length ? /* @__PURE__ */
|
|
5515
|
+
model.topRecommendations.length ? /* @__PURE__ */ jsx11(SectionCard, { title: "Recommendations", children: /* @__PURE__ */ jsx11(
|
|
5265
5516
|
ResponsiveTable,
|
|
5266
5517
|
{
|
|
5267
5518
|
terminalColumns,
|
|
@@ -5275,7 +5526,7 @@ var OverviewView = ({
|
|
|
5275
5526
|
page: tablePage
|
|
5276
5527
|
}
|
|
5277
5528
|
) }) : null,
|
|
5278
|
-
model.topInsights.length ? /* @__PURE__ */
|
|
5529
|
+
model.topInsights.length ? /* @__PURE__ */ jsx11(SectionCard, { title: "Key insights", children: /* @__PURE__ */ jsx11(
|
|
5279
5530
|
ResponsiveTable,
|
|
5280
5531
|
{
|
|
5281
5532
|
terminalColumns,
|
|
@@ -5299,7 +5550,7 @@ var OptionsView = ({
|
|
|
5299
5550
|
}) => {
|
|
5300
5551
|
const keys = getTuiKeyBindings();
|
|
5301
5552
|
return /* @__PURE__ */ jsxs7(Box8, { flexDirection: "column", gap: 1, children: [
|
|
5302
|
-
/* @__PURE__ */
|
|
5553
|
+
/* @__PURE__ */ jsx11(
|
|
5303
5554
|
MetricStrip,
|
|
5304
5555
|
{
|
|
5305
5556
|
compact: false,
|
|
@@ -5310,19 +5561,19 @@ var OptionsView = ({
|
|
|
5310
5561
|
]
|
|
5311
5562
|
}
|
|
5312
5563
|
),
|
|
5313
|
-
/* @__PURE__ */ jsxs7(
|
|
5564
|
+
/* @__PURE__ */ jsxs7(Text11, { wrap: "wrap", children: [
|
|
5314
5565
|
"User: ",
|
|
5315
5566
|
currentUserId ?? "unknown"
|
|
5316
5567
|
] }),
|
|
5317
|
-
/* @__PURE__ */ jsxs7(
|
|
5568
|
+
/* @__PURE__ */ jsxs7(Text11, { wrap: "wrap", children: [
|
|
5318
5569
|
"API: ",
|
|
5319
5570
|
apiBase
|
|
5320
5571
|
] }),
|
|
5321
|
-
/* @__PURE__ */ jsxs7(
|
|
5572
|
+
/* @__PURE__ */ jsxs7(Text11, { wrap: "wrap", children: [
|
|
5322
5573
|
"Frontend: ",
|
|
5323
5574
|
frontendUrl
|
|
5324
5575
|
] }),
|
|
5325
|
-
/* @__PURE__ */ jsxs7(
|
|
5576
|
+
/* @__PURE__ */ jsxs7(Text11, { dimColor: true, wrap: "wrap", children: [
|
|
5326
5577
|
"Keys: 1-",
|
|
5327
5578
|
workspaceTabs.length,
|
|
5328
5579
|
" jump tabs | ",
|
|
@@ -5355,14 +5606,14 @@ var HelpView = () => {
|
|
|
5355
5606
|
];
|
|
5356
5607
|
return /* @__PURE__ */ jsxs7(Box8, { flexDirection: "column", gap: 1, children: [
|
|
5357
5608
|
/* @__PURE__ */ jsxs7(SectionCard, { title: "Navigation", borderColor: terminalTheme.brand, children: [
|
|
5358
|
-
/* @__PURE__ */
|
|
5359
|
-
/* @__PURE__ */ jsxs7(
|
|
5609
|
+
/* @__PURE__ */ jsx11(HelpLegend, { includeQuit: true, wrap: true }),
|
|
5610
|
+
/* @__PURE__ */ jsxs7(Text11, { wrap: "wrap", children: [
|
|
5360
5611
|
keys.mouse,
|
|
5361
5612
|
" | ",
|
|
5362
5613
|
keys.scroll
|
|
5363
5614
|
] })
|
|
5364
5615
|
] }),
|
|
5365
|
-
/* @__PURE__ */
|
|
5616
|
+
/* @__PURE__ */ jsx11(SectionCard, { title: "Prompt Input", borderColor: terminalTheme.brand, children: /* @__PURE__ */ jsxs7(Text11, { wrap: "wrap", children: [
|
|
5366
5617
|
keys.submit,
|
|
5367
5618
|
" | ",
|
|
5368
5619
|
keys.newline,
|
|
@@ -5376,20 +5627,20 @@ var HelpView = () => {
|
|
|
5376
5627
|
" | ",
|
|
5377
5628
|
keys.quit
|
|
5378
5629
|
] }) }),
|
|
5379
|
-
/* @__PURE__ */
|
|
5630
|
+
/* @__PURE__ */ jsx11(SectionCard, { title: "Slash Commands", borderColor: terminalTheme.brand, children: slashCommands.map((command) => /* @__PURE__ */ jsxs7(Text11, { wrap: "wrap", children: [
|
|
5380
5631
|
command.name.padEnd(10),
|
|
5381
5632
|
" ",
|
|
5382
5633
|
command.description
|
|
5383
5634
|
] }, command.name)) }),
|
|
5384
5635
|
/* @__PURE__ */ jsxs7(SectionCard, { title: "CLI Commands", borderColor: terminalTheme.muted, children: [
|
|
5385
|
-
cliCommands.map((command) => /* @__PURE__ */
|
|
5386
|
-
/* @__PURE__ */
|
|
5636
|
+
cliCommands.map((command) => /* @__PURE__ */ jsx11(Text11, { wrap: "wrap", children: command }, command)),
|
|
5637
|
+
/* @__PURE__ */ jsx11(Text11, { dimColor: true, wrap: "wrap", children: "Common flags: --base-url, --access-key, --access-key-stdin, --frontend-url, --format, --json, --verbose, --help" })
|
|
5387
5638
|
] })
|
|
5388
5639
|
] });
|
|
5389
5640
|
};
|
|
5390
5641
|
var WorkspaceTabBar = ({ activeTab, showBrand = false, billingSummary }) => {
|
|
5391
5642
|
return /* @__PURE__ */ jsxs7(Box8, { flexDirection: "column", gap: 0, children: [
|
|
5392
|
-
showBrand ? /* @__PURE__ */
|
|
5643
|
+
showBrand ? /* @__PURE__ */ jsx11(
|
|
5393
5644
|
TitledBox,
|
|
5394
5645
|
{
|
|
5395
5646
|
title: "Console",
|
|
@@ -5400,22 +5651,22 @@ var WorkspaceTabBar = ({ activeTab, showBrand = false, billingSummary }) => {
|
|
|
5400
5651
|
padding: 0,
|
|
5401
5652
|
paddingX: 1,
|
|
5402
5653
|
children: /* @__PURE__ */ jsxs7(Box8, { flexDirection: "row", gap: 1, children: [
|
|
5403
|
-
/* @__PURE__ */
|
|
5404
|
-
/* @__PURE__ */
|
|
5654
|
+
/* @__PURE__ */ jsx11(Text11, { bold: true, color: terminalTheme.brand, children: "CloudEval" }),
|
|
5655
|
+
/* @__PURE__ */ jsx11(Text11, { dimColor: true, children: "agent console" })
|
|
5405
5656
|
] })
|
|
5406
5657
|
}
|
|
5407
5658
|
) : null,
|
|
5408
|
-
/* @__PURE__ */
|
|
5659
|
+
/* @__PURE__ */ jsx11(Box8, { flexDirection: "row", gap: 0, flexWrap: "wrap", children: workspaceTabs.map((tab) => {
|
|
5409
5660
|
const active = tab === activeTab;
|
|
5410
5661
|
const style = workspaceTabButtonStyle(active);
|
|
5411
|
-
return /* @__PURE__ */
|
|
5662
|
+
return /* @__PURE__ */ jsx11(
|
|
5412
5663
|
Box8,
|
|
5413
5664
|
{
|
|
5414
5665
|
borderStyle: style.borderStyle,
|
|
5415
5666
|
borderColor: style.borderColor,
|
|
5416
5667
|
marginRight: 1,
|
|
5417
|
-
children: /* @__PURE__ */
|
|
5418
|
-
|
|
5668
|
+
children: /* @__PURE__ */ jsx11(
|
|
5669
|
+
Text11,
|
|
5419
5670
|
{
|
|
5420
5671
|
bold: style.bold,
|
|
5421
5672
|
color: style.color,
|
|
@@ -5428,8 +5679,8 @@ var WorkspaceTabBar = ({ activeTab, showBrand = false, billingSummary }) => {
|
|
|
5428
5679
|
tab
|
|
5429
5680
|
);
|
|
5430
5681
|
}) }),
|
|
5431
|
-
/* @__PURE__ */
|
|
5432
|
-
billingSummary ? /* @__PURE__ */
|
|
5682
|
+
/* @__PURE__ */ jsx11(HelpLegend, {}),
|
|
5683
|
+
billingSummary ? /* @__PURE__ */ jsx11(BillingSummaryLine, { billing: billingSummary }) : null
|
|
5433
5684
|
] });
|
|
5434
5685
|
};
|
|
5435
5686
|
var WorkspacePanel = (props) => {
|
|
@@ -5443,19 +5694,19 @@ var WorkspacePanel = (props) => {
|
|
|
5443
5694
|
state.isRefreshing && !isInitialLoading
|
|
5444
5695
|
);
|
|
5445
5696
|
const content = /* @__PURE__ */ jsxs7(Fragment2, { children: [
|
|
5446
|
-
state.loadedAt && !isInitialLoading && !isBackgroundRefreshing ? /* @__PURE__ */
|
|
5697
|
+
state.loadedAt && !isInitialLoading && !isBackgroundRefreshing ? /* @__PURE__ */ jsx11(Box8, { flexDirection: "row", justifyContent: "flex-end", children: /* @__PURE__ */ jsxs7(Text11, { dimColor: true, children: [
|
|
5447
5698
|
"loaded ",
|
|
5448
5699
|
new Date(state.loadedAt).toLocaleTimeString()
|
|
5449
5700
|
] }) }) : null,
|
|
5450
5701
|
isInitialLoading ? /* @__PURE__ */ jsxs7(Box8, { flexDirection: "row", gap: 1, children: [
|
|
5451
|
-
/* @__PURE__ */
|
|
5452
|
-
/* @__PURE__ */
|
|
5702
|
+
/* @__PURE__ */ jsx11(Spinner, { type: "dots", animate }),
|
|
5703
|
+
/* @__PURE__ */ jsx11(Text11, { color: terminalTheme.brand, children: "Loading workspace data..." })
|
|
5453
5704
|
] }) : null,
|
|
5454
5705
|
isBackgroundRefreshing ? /* @__PURE__ */ jsxs7(Box8, { flexDirection: "row", gap: 1, children: [
|
|
5455
|
-
/* @__PURE__ */
|
|
5456
|
-
/* @__PURE__ */
|
|
5706
|
+
/* @__PURE__ */ jsx11(Spinner, { type: "dots", animate }),
|
|
5707
|
+
/* @__PURE__ */ jsx11(Text11, { color: terminalTheme.brand, children: "Refreshing in background, showing cached data..." })
|
|
5457
5708
|
] }) : null,
|
|
5458
|
-
state.status === "error" ? /* @__PURE__ */
|
|
5709
|
+
state.status === "error" ? /* @__PURE__ */ jsx11(
|
|
5459
5710
|
TitledBox,
|
|
5460
5711
|
{
|
|
5461
5712
|
title: "Backend Data Unavailable",
|
|
@@ -5463,7 +5714,7 @@ var WorkspacePanel = (props) => {
|
|
|
5463
5714
|
borderColor: terminalTheme.danger,
|
|
5464
5715
|
padding: 0,
|
|
5465
5716
|
paddingX: 1,
|
|
5466
|
-
children: /* @__PURE__ */ jsxs7(
|
|
5717
|
+
children: /* @__PURE__ */ jsxs7(Text11, { color: terminalTheme.danger, wrap: "wrap", children: [
|
|
5467
5718
|
" ",
|
|
5468
5719
|
state.error ?? "Unable to load this tab."
|
|
5469
5720
|
] })
|
|
@@ -5478,8 +5729,8 @@ var WorkspacePanel = (props) => {
|
|
|
5478
5729
|
padding: 0,
|
|
5479
5730
|
paddingX: 1,
|
|
5480
5731
|
children: [
|
|
5481
|
-
state.warnings.slice(0, 4).map((warning) => /* @__PURE__ */
|
|
5482
|
-
state.warnings.length > 4 ? /* @__PURE__ */ jsxs7(
|
|
5732
|
+
state.warnings.slice(0, 4).map((warning) => /* @__PURE__ */ jsx11(Text11, { color: terminalTheme.warning, wrap: "truncate", children: cleanBackendWarning(warning, props.terminalColumns) }, warning)),
|
|
5733
|
+
state.warnings.length > 4 ? /* @__PURE__ */ jsxs7(Text11, { dimColor: true, children: [
|
|
5483
5734
|
"+",
|
|
5484
5735
|
state.warnings.length - 4,
|
|
5485
5736
|
" more warning(s)"
|
|
@@ -5487,7 +5738,7 @@ var WorkspacePanel = (props) => {
|
|
|
5487
5738
|
]
|
|
5488
5739
|
}
|
|
5489
5740
|
) : null,
|
|
5490
|
-
props.tab === "overview" ? /* @__PURE__ */
|
|
5741
|
+
props.tab === "overview" ? /* @__PURE__ */ jsx11(
|
|
5491
5742
|
OverviewView,
|
|
5492
5743
|
{
|
|
5493
5744
|
state,
|
|
@@ -5498,7 +5749,7 @@ var WorkspacePanel = (props) => {
|
|
|
5498
5749
|
tablePage: props.tablePage
|
|
5499
5750
|
}
|
|
5500
5751
|
) : null,
|
|
5501
|
-
props.tab === "reports" ? /* @__PURE__ */
|
|
5752
|
+
props.tab === "reports" ? /* @__PURE__ */ jsx11(
|
|
5502
5753
|
ReportsView,
|
|
5503
5754
|
{
|
|
5504
5755
|
state,
|
|
@@ -5509,7 +5760,7 @@ var WorkspacePanel = (props) => {
|
|
|
5509
5760
|
tablePage: props.tablePage
|
|
5510
5761
|
}
|
|
5511
5762
|
) : null,
|
|
5512
|
-
props.tab === "projects" ? /* @__PURE__ */
|
|
5763
|
+
props.tab === "projects" ? /* @__PURE__ */ jsx11(
|
|
5513
5764
|
ProjectsView,
|
|
5514
5765
|
{
|
|
5515
5766
|
projects: props.projects,
|
|
@@ -5520,7 +5771,7 @@ var WorkspacePanel = (props) => {
|
|
|
5520
5771
|
terminalColumns: props.terminalColumns
|
|
5521
5772
|
}
|
|
5522
5773
|
) : null,
|
|
5523
|
-
props.tab === "connections" ? /* @__PURE__ */
|
|
5774
|
+
props.tab === "connections" ? /* @__PURE__ */ jsx11(
|
|
5524
5775
|
ConnectionsView,
|
|
5525
5776
|
{
|
|
5526
5777
|
connections,
|
|
@@ -5530,7 +5781,7 @@ var WorkspacePanel = (props) => {
|
|
|
5530
5781
|
terminalColumns: props.terminalColumns
|
|
5531
5782
|
}
|
|
5532
5783
|
) : null,
|
|
5533
|
-
props.tab === "billing" ? /* @__PURE__ */
|
|
5784
|
+
props.tab === "billing" ? /* @__PURE__ */ jsx11(
|
|
5534
5785
|
BillingView,
|
|
5535
5786
|
{
|
|
5536
5787
|
state,
|
|
@@ -5539,13 +5790,13 @@ var WorkspacePanel = (props) => {
|
|
|
5539
5790
|
frontendUrl: props.frontendUrl
|
|
5540
5791
|
}
|
|
5541
5792
|
) : null,
|
|
5542
|
-
props.tab === "options" ? /* @__PURE__ */
|
|
5543
|
-
props.tab === "help" ? /* @__PURE__ */
|
|
5793
|
+
props.tab === "options" ? /* @__PURE__ */ jsx11(OptionsView, { ...props }) : null,
|
|
5794
|
+
props.tab === "help" ? /* @__PURE__ */ jsx11(HelpView, {}) : null
|
|
5544
5795
|
] });
|
|
5545
5796
|
if (!framed) {
|
|
5546
|
-
return /* @__PURE__ */
|
|
5797
|
+
return /* @__PURE__ */ jsx11(Box8, { flexDirection: "column", gap: 1, children: content });
|
|
5547
5798
|
}
|
|
5548
|
-
return /* @__PURE__ */
|
|
5799
|
+
return /* @__PURE__ */ jsx11(
|
|
5549
5800
|
TitledBox,
|
|
5550
5801
|
{
|
|
5551
5802
|
title: workspaceTabLabels[props.tab],
|
|
@@ -5585,7 +5836,7 @@ var shouldEnableTuiAnimations = ({
|
|
|
5585
5836
|
};
|
|
5586
5837
|
|
|
5587
5838
|
// src/ui/App.tsx
|
|
5588
|
-
import { Fragment as Fragment3, jsx as
|
|
5839
|
+
import { Fragment as Fragment3, jsx as jsx12, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
5589
5840
|
var bootSteps = [
|
|
5590
5841
|
"Loading config",
|
|
5591
5842
|
"Validating auth",
|
|
@@ -5594,14 +5845,19 @@ var bootSteps = [
|
|
|
5594
5845
|
];
|
|
5595
5846
|
var defaultUser = { id: "cli-user", name: "CLI User" };
|
|
5596
5847
|
var newDraftChatSessionKey = () => `draft-${randomUUID2()}`;
|
|
5597
|
-
var
|
|
5598
|
-
if (!token)
|
|
5848
|
+
var getUserIdentityFromToken = async (token) => {
|
|
5849
|
+
if (!token) {
|
|
5850
|
+
return { name: "You" };
|
|
5851
|
+
}
|
|
5599
5852
|
try {
|
|
5600
5853
|
const { extractEmailFromToken } = await import("./dist-AGQQPJUD.js");
|
|
5601
|
-
const email = extractEmailFromToken(token);
|
|
5602
|
-
return
|
|
5854
|
+
const email = extractEmailFromToken(token) ?? void 0;
|
|
5855
|
+
return {
|
|
5856
|
+
name: getFirstNameForDisplay({ email }),
|
|
5857
|
+
email
|
|
5858
|
+
};
|
|
5603
5859
|
} catch {
|
|
5604
|
-
return "You";
|
|
5860
|
+
return { name: "You" };
|
|
5605
5861
|
}
|
|
5606
5862
|
};
|
|
5607
5863
|
var defaultProject = {
|
|
@@ -5712,20 +5968,6 @@ var billingHeaderFromEntitlement = (entitlement, usageSummary) => {
|
|
|
5712
5968
|
};
|
|
5713
5969
|
};
|
|
5714
5970
|
var isBusyStatus = (status) => status === "connecting" || status === "thinking" || status === "streaming" || status === "tool_running" || status === "hitl_waiting";
|
|
5715
|
-
var buildTuiHeaderDetails = ({
|
|
5716
|
-
apiBase,
|
|
5717
|
-
frontendBaseUrl,
|
|
5718
|
-
billingSummary,
|
|
5719
|
-
userName
|
|
5720
|
-
}) => {
|
|
5721
|
-
const displayName = truncateForTerminal(userName.trim() || "You", 64);
|
|
5722
|
-
return [
|
|
5723
|
-
`User: ${displayName}`,
|
|
5724
|
-
`API: ${apiBase}`,
|
|
5725
|
-
`Frontend: ${frontendBaseUrl}`,
|
|
5726
|
-
billingSummary
|
|
5727
|
-
];
|
|
5728
|
-
};
|
|
5729
5971
|
var isTerminalThinkingStatus = (status) => status === "completed" || status === "error" || status === "aborted" || status === "cancelled";
|
|
5730
5972
|
var hasCancellableAssistantWork = (messages) => messages.some(
|
|
5731
5973
|
(message) => message.role === "assistant" && (message.pending || message.thinkingSteps?.some((step) => !isTerminalThinkingStatus(step.status ?? "streaming")))
|
|
@@ -6055,7 +6297,7 @@ var QueuePanel = ({ messages, compact, terminalColumns }) => {
|
|
|
6055
6297
|
marginTop: 1,
|
|
6056
6298
|
children: [
|
|
6057
6299
|
visibleMessages.map((message, index) => /* @__PURE__ */ jsxs8(
|
|
6058
|
-
|
|
6300
|
+
Text12,
|
|
6059
6301
|
{
|
|
6060
6302
|
color: index === 0 ? terminalTheme.warning : void 0,
|
|
6061
6303
|
dimColor: index > 0,
|
|
@@ -6069,7 +6311,7 @@ var QueuePanel = ({ messages, compact, terminalColumns }) => {
|
|
|
6069
6311
|
},
|
|
6070
6312
|
message.id
|
|
6071
6313
|
)),
|
|
6072
|
-
messages.length > visibleMessages.length ? /* @__PURE__ */ jsxs8(
|
|
6314
|
+
messages.length > visibleMessages.length ? /* @__PURE__ */ jsxs8(Text12, { dimColor: true, children: [
|
|
6073
6315
|
"+",
|
|
6074
6316
|
messages.length - visibleMessages.length,
|
|
6075
6317
|
" more queued"
|
|
@@ -6090,10 +6332,10 @@ var ArtifactStrip = ({ chips, compact = false, terminalColumns }) => {
|
|
|
6090
6332
|
return null;
|
|
6091
6333
|
}
|
|
6092
6334
|
const valueLimit = compact ? Math.max(10, terminalColumns - 15) : 24;
|
|
6093
|
-
return /* @__PURE__ */
|
|
6094
|
-
/* @__PURE__ */
|
|
6095
|
-
/* @__PURE__ */
|
|
6096
|
-
/* @__PURE__ */
|
|
6335
|
+
return /* @__PURE__ */ jsx12(Box9, { flexDirection: compact ? "column" : "row", gap: compact ? 0 : 1, flexWrap: "wrap", children: chips.map((chip) => /* @__PURE__ */ jsxs8(Text12, { children: [
|
|
6336
|
+
/* @__PURE__ */ jsx12(Text12, { color: artifactToneColor(chip.tone), bold: true, children: chip.label }),
|
|
6337
|
+
/* @__PURE__ */ jsx12(Text12, { dimColor: true, children: " " }),
|
|
6338
|
+
/* @__PURE__ */ jsx12(Text12, { color: artifactToneColor(chip.tone), children: truncateForTerminal(chip.value, valueLimit) })
|
|
6097
6339
|
] }, `${chip.label}-${chip.value}`)) });
|
|
6098
6340
|
};
|
|
6099
6341
|
var PromptControlBar = ({
|
|
@@ -6128,7 +6370,7 @@ var PromptControlBar = ({
|
|
|
6128
6370
|
gap: 0,
|
|
6129
6371
|
marginTop: index === 0 ? 0 : 1,
|
|
6130
6372
|
children: [
|
|
6131
|
-
/* @__PURE__ */
|
|
6373
|
+
/* @__PURE__ */ jsx12(Text12, { dimColor: true, children: group.label }),
|
|
6132
6374
|
group.controls.map((kind) => {
|
|
6133
6375
|
const isFocused = focused === kind;
|
|
6134
6376
|
const label = kind.charAt(0).toUpperCase() + kind.slice(1);
|
|
@@ -6143,7 +6385,7 @@ var PromptControlBar = ({
|
|
|
6143
6385
|
const valueLimit = Math.max(14, terminalColumns - label.length - 8);
|
|
6144
6386
|
const value = truncateForTerminal(rawValue, valueLimit);
|
|
6145
6387
|
return /* @__PURE__ */ jsxs8(
|
|
6146
|
-
|
|
6388
|
+
Text12,
|
|
6147
6389
|
{
|
|
6148
6390
|
color: isFocused ? "white" : void 0,
|
|
6149
6391
|
backgroundColor: isFocused ? terminalTheme.selectedBackground : void 0,
|
|
@@ -6167,9 +6409,9 @@ var PromptControlBar = ({
|
|
|
6167
6409
|
group.label
|
|
6168
6410
|
)),
|
|
6169
6411
|
showActivity ? /* @__PURE__ */ jsxs8(Box9, { flexDirection: "column", gap: 0, marginTop: 1, children: [
|
|
6170
|
-
/* @__PURE__ */
|
|
6412
|
+
/* @__PURE__ */ jsx12(Text12, { dimColor: true, children: "Activity" }),
|
|
6171
6413
|
hasThinkingSteps ? /* @__PURE__ */ jsxs8(
|
|
6172
|
-
|
|
6414
|
+
Text12,
|
|
6173
6415
|
{
|
|
6174
6416
|
color: focused === "thinking" ? "white" : void 0,
|
|
6175
6417
|
backgroundColor: focused === "thinking" ? terminalTheme.selectedBackground : void 0,
|
|
@@ -6184,14 +6426,14 @@ var PromptControlBar = ({
|
|
|
6184
6426
|
}
|
|
6185
6427
|
) : null,
|
|
6186
6428
|
/* @__PURE__ */ jsxs8(Box9, { flexDirection: "row", gap: 1, children: [
|
|
6187
|
-
busy ? /* @__PURE__ */
|
|
6188
|
-
/* @__PURE__ */
|
|
6429
|
+
busy ? /* @__PURE__ */ jsx12(Spinner, { type: "line", animate }) : null,
|
|
6430
|
+
/* @__PURE__ */ jsx12(Text12, { color: statusColor, children: statusText })
|
|
6189
6431
|
] })
|
|
6190
6432
|
] }) : null
|
|
6191
6433
|
] });
|
|
6192
6434
|
}
|
|
6193
6435
|
return /* @__PURE__ */ jsxs8(Box9, { flexDirection: "column", gap: 0, children: [
|
|
6194
|
-
/* @__PURE__ */
|
|
6436
|
+
/* @__PURE__ */ jsx12(Text12, { dimColor: true, children: "Command context" }),
|
|
6195
6437
|
/* @__PURE__ */ jsxs8(Box9, { flexDirection: compact ? "column" : "row", gap: controlGap, flexWrap: "wrap", children: [
|
|
6196
6438
|
selectorOrder.map((kind) => {
|
|
6197
6439
|
const isFocused = focused === kind;
|
|
@@ -6206,14 +6448,14 @@ var PromptControlBar = ({
|
|
|
6206
6448
|
});
|
|
6207
6449
|
const valueLimit = compact ? Math.max(18, terminalColumns - label.length - 8) : kind === "project" ? 30 : 20;
|
|
6208
6450
|
const value = truncateForTerminal(rawValue, valueLimit);
|
|
6209
|
-
return /* @__PURE__ */
|
|
6451
|
+
return /* @__PURE__ */ jsx12(
|
|
6210
6452
|
Box9,
|
|
6211
6453
|
{
|
|
6212
6454
|
borderStyle: raisedButtonStyle.border,
|
|
6213
6455
|
borderColor: isFocused ? terminalTheme.focus : terminalTheme.muted,
|
|
6214
6456
|
paddingX: 1,
|
|
6215
6457
|
children: /* @__PURE__ */ jsxs8(
|
|
6216
|
-
|
|
6458
|
+
Text12,
|
|
6217
6459
|
{
|
|
6218
6460
|
color: isFocused ? "white" : void 0,
|
|
6219
6461
|
backgroundColor: isFocused ? terminalTheme.selectedBackground : void 0,
|
|
@@ -6233,14 +6475,14 @@ var PromptControlBar = ({
|
|
|
6233
6475
|
kind
|
|
6234
6476
|
);
|
|
6235
6477
|
}),
|
|
6236
|
-
hasThinkingSteps ? /* @__PURE__ */
|
|
6478
|
+
hasThinkingSteps ? /* @__PURE__ */ jsx12(
|
|
6237
6479
|
Box9,
|
|
6238
6480
|
{
|
|
6239
6481
|
borderStyle: raisedButtonStyle.border,
|
|
6240
6482
|
borderColor: focused === "thinking" ? terminalTheme.focus : terminalTheme.muted,
|
|
6241
6483
|
paddingX: 1,
|
|
6242
6484
|
children: /* @__PURE__ */ jsxs8(
|
|
6243
|
-
|
|
6485
|
+
Text12,
|
|
6244
6486
|
{
|
|
6245
6487
|
color: focused === "thinking" ? "white" : void 0,
|
|
6246
6488
|
backgroundColor: focused === "thinking" ? terminalTheme.selectedBackground : void 0,
|
|
@@ -6255,9 +6497,9 @@ var PromptControlBar = ({
|
|
|
6255
6497
|
)
|
|
6256
6498
|
}
|
|
6257
6499
|
) : null,
|
|
6258
|
-
/* @__PURE__ */
|
|
6259
|
-
busy ? /* @__PURE__ */
|
|
6260
|
-
/* @__PURE__ */
|
|
6500
|
+
/* @__PURE__ */ jsx12(Box9, { flexGrow: 1, justifyContent: "flex-end", children: /* @__PURE__ */ jsxs8(Box9, { flexDirection: "row", gap: 1, children: [
|
|
6501
|
+
busy ? /* @__PURE__ */ jsx12(Spinner, { type: "line", animate }) : null,
|
|
6502
|
+
/* @__PURE__ */ jsx12(Text12, { color: statusColor, children: statusText })
|
|
6261
6503
|
] }) })
|
|
6262
6504
|
] })
|
|
6263
6505
|
] });
|
|
@@ -6294,8 +6536,8 @@ var ChatContextPanel = ({
|
|
|
6294
6536
|
height,
|
|
6295
6537
|
children: [
|
|
6296
6538
|
artifactChips.length ? /* @__PURE__ */ jsxs8(Box9, { flexDirection: "column", marginBottom: 1, children: [
|
|
6297
|
-
/* @__PURE__ */
|
|
6298
|
-
/* @__PURE__ */
|
|
6539
|
+
/* @__PURE__ */ jsx12(Text12, { color: terminalTheme.brand, children: "Artifacts" }),
|
|
6540
|
+
/* @__PURE__ */ jsx12(
|
|
6299
6541
|
ArtifactStrip,
|
|
6300
6542
|
{
|
|
6301
6543
|
chips: artifactChips,
|
|
@@ -6304,7 +6546,7 @@ var ChatContextPanel = ({
|
|
|
6304
6546
|
}
|
|
6305
6547
|
)
|
|
6306
6548
|
] }) : null,
|
|
6307
|
-
/* @__PURE__ */
|
|
6549
|
+
/* @__PURE__ */ jsx12(
|
|
6308
6550
|
PromptControlBar,
|
|
6309
6551
|
{
|
|
6310
6552
|
focused,
|
|
@@ -6329,39 +6571,39 @@ var ChatContextPanel = ({
|
|
|
6329
6571
|
);
|
|
6330
6572
|
};
|
|
6331
6573
|
var BottomControls = ({ tab }) => /* @__PURE__ */ jsxs8(Box9, { flexDirection: "row", justifyContent: "space-between", children: [
|
|
6332
|
-
/* @__PURE__ */ jsxs8(
|
|
6333
|
-
/* @__PURE__ */
|
|
6334
|
-
/* @__PURE__ */
|
|
6335
|
-
/* @__PURE__ */
|
|
6336
|
-
/* @__PURE__ */
|
|
6574
|
+
/* @__PURE__ */ jsxs8(Text12, { dimColor: true, children: [
|
|
6575
|
+
/* @__PURE__ */ jsx12(Text12, { color: terminalTheme.accent, bold: true, children: "\u2303Q" }),
|
|
6576
|
+
/* @__PURE__ */ jsx12(Text12, { children: " Quit " }),
|
|
6577
|
+
/* @__PURE__ */ jsx12(Text12, { color: terminalTheme.accent, bold: true, children: "\u2303T" }),
|
|
6578
|
+
/* @__PURE__ */ jsx12(Text12, { children: " Tabs " }),
|
|
6337
6579
|
tab === "chat" ? /* @__PURE__ */ jsxs8(Fragment3, { children: [
|
|
6338
|
-
/* @__PURE__ */
|
|
6339
|
-
/* @__PURE__ */
|
|
6340
|
-
/* @__PURE__ */
|
|
6341
|
-
/* @__PURE__ */
|
|
6342
|
-
/* @__PURE__ */
|
|
6343
|
-
/* @__PURE__ */
|
|
6344
|
-
/* @__PURE__ */
|
|
6580
|
+
/* @__PURE__ */ jsx12(Text12, { color: terminalTheme.accent, bold: true, children: "Y" }),
|
|
6581
|
+
/* @__PURE__ */ jsx12(Text12, { children: " Copy " }),
|
|
6582
|
+
/* @__PURE__ */ jsx12(Text12, { color: terminalTheme.accent, bold: true, children: "D" }),
|
|
6583
|
+
/* @__PURE__ */ jsx12(Text12, { children: " Download " }),
|
|
6584
|
+
/* @__PURE__ */ jsx12(Text12, { color: terminalTheme.accent, bold: true, children: "O" }),
|
|
6585
|
+
/* @__PURE__ */ jsx12(Text12, { children: " Open " }),
|
|
6586
|
+
/* @__PURE__ */ jsx12(Text12, { color: terminalTheme.brand, children: "/ Commands" })
|
|
6345
6587
|
] }) : /* @__PURE__ */ jsxs8(Fragment3, { children: [
|
|
6346
|
-
/* @__PURE__ */
|
|
6347
|
-
/* @__PURE__ */
|
|
6348
|
-
/* @__PURE__ */
|
|
6349
|
-
/* @__PURE__ */
|
|
6350
|
-
/* @__PURE__ */
|
|
6351
|
-
/* @__PURE__ */
|
|
6588
|
+
/* @__PURE__ */ jsx12(Text12, { color: terminalTheme.accent, bold: true, children: "R" }),
|
|
6589
|
+
/* @__PURE__ */ jsx12(Text12, { children: " Refresh " }),
|
|
6590
|
+
/* @__PURE__ */ jsx12(Text12, { color: terminalTheme.accent, bold: true, children: "O" }),
|
|
6591
|
+
/* @__PURE__ */ jsx12(Text12, { children: " Open " }),
|
|
6592
|
+
/* @__PURE__ */ jsx12(Text12, { color: terminalTheme.accent, bold: true, children: "D" }),
|
|
6593
|
+
/* @__PURE__ */ jsx12(Text12, { children: " Download " }),
|
|
6352
6594
|
tab === "projects" || tab === "connections" ? /* @__PURE__ */ jsxs8(Fragment3, { children: [
|
|
6353
|
-
/* @__PURE__ */
|
|
6354
|
-
/* @__PURE__ */
|
|
6355
|
-
/* @__PURE__ */
|
|
6356
|
-
/* @__PURE__ */
|
|
6595
|
+
/* @__PURE__ */ jsx12(Text12, { color: terminalTheme.accent, bold: true, children: "\u2191\u2193/J/K" }),
|
|
6596
|
+
/* @__PURE__ */ jsx12(Text12, { children: " Select " }),
|
|
6597
|
+
/* @__PURE__ */ jsx12(Text12, { color: terminalTheme.accent, bold: true, children: "Enter" }),
|
|
6598
|
+
/* @__PURE__ */ jsx12(Text12, { children: " Confirm " })
|
|
6357
6599
|
] }) : null,
|
|
6358
|
-
/* @__PURE__ */
|
|
6359
|
-
/* @__PURE__ */
|
|
6600
|
+
/* @__PURE__ */ jsx12(Text12, { color: terminalTheme.accent, bold: true, children: "[/]" }),
|
|
6601
|
+
/* @__PURE__ */ jsx12(Text12, { children: " Page" })
|
|
6360
6602
|
] })
|
|
6361
6603
|
] }),
|
|
6362
|
-
tab === "reports" ? /* @__PURE__ */ jsxs8(
|
|
6363
|
-
/* @__PURE__ */
|
|
6364
|
-
/* @__PURE__ */
|
|
6604
|
+
tab === "reports" ? /* @__PURE__ */ jsxs8(Text12, { dimColor: true, children: [
|
|
6605
|
+
/* @__PURE__ */ jsx12(Text12, { color: terminalTheme.brand, bold: true, children: "Reports" }),
|
|
6606
|
+
/* @__PURE__ */ jsx12(Text12, { children: " W WAF | K cost | U tests | A all | P project" })
|
|
6365
6607
|
] }) : null
|
|
6366
6608
|
] });
|
|
6367
6609
|
var recommendedOptionIndex = (question) => {
|
|
@@ -6384,18 +6626,18 @@ var HitlPanel = ({ hitl, questionIndex, optionIndex, answers, frontendUrl }) =>
|
|
|
6384
6626
|
borderColor: terminalTheme.warning,
|
|
6385
6627
|
padding: 1,
|
|
6386
6628
|
children: [
|
|
6387
|
-
/* @__PURE__ */ jsxs8(
|
|
6629
|
+
/* @__PURE__ */ jsxs8(Text12, { wrap: "wrap", children: [
|
|
6388
6630
|
questionIndex + 1,
|
|
6389
6631
|
"/",
|
|
6390
6632
|
hitl.questions.length,
|
|
6391
6633
|
": ",
|
|
6392
6634
|
question?.text ?? "Action required"
|
|
6393
6635
|
] }),
|
|
6394
|
-
options.length ? /* @__PURE__ */
|
|
6636
|
+
options.length ? /* @__PURE__ */ jsx12(Box9, { flexDirection: "column", marginTop: 1, children: options.map((option, index) => {
|
|
6395
6637
|
const highlighted = index === optionIndex;
|
|
6396
6638
|
const selected = answers[question.id] === option.id;
|
|
6397
6639
|
return /* @__PURE__ */ jsxs8(
|
|
6398
|
-
|
|
6640
|
+
Text12,
|
|
6399
6641
|
{
|
|
6400
6642
|
color: highlighted ? terminalTheme.focus : selected ? terminalTheme.selected : void 0,
|
|
6401
6643
|
dimColor: !highlighted && !selected,
|
|
@@ -6413,9 +6655,9 @@ var HitlPanel = ({ hitl, questionIndex, optionIndex, answers, frontendUrl }) =>
|
|
|
6413
6655
|
},
|
|
6414
6656
|
option.id
|
|
6415
6657
|
);
|
|
6416
|
-
}) }) : /* @__PURE__ */
|
|
6417
|
-
/* @__PURE__ */
|
|
6418
|
-
/* @__PURE__ */ jsxs8(
|
|
6658
|
+
}) }) : /* @__PURE__ */ jsx12(Text12, { dimColor: true, children: "Type the answer in the prompt and press Enter, or open the frontend." }),
|
|
6659
|
+
/* @__PURE__ */ jsx12(Text12, { dimColor: true, children: "Up/Down choose | Enter answer | Left/Right switch question | O or /open opens frontend" }),
|
|
6660
|
+
/* @__PURE__ */ jsxs8(Text12, { dimColor: true, wrap: "wrap", children: [
|
|
6419
6661
|
"Frontend: ",
|
|
6420
6662
|
frontendUrl
|
|
6421
6663
|
] })
|
|
@@ -6491,6 +6733,7 @@ var App = ({
|
|
|
6491
6733
|
const [checkingOnboarding, setCheckingOnboarding] = useState4(false);
|
|
6492
6734
|
const [currentUserId, setCurrentUserId] = useState4();
|
|
6493
6735
|
const [userName, setUserName] = useState4("You");
|
|
6736
|
+
const [userEmail, setUserEmail] = useState4();
|
|
6494
6737
|
const [billingHeader, setBillingHeader] = useState4(null);
|
|
6495
6738
|
const [billingHeaderError, setBillingHeaderError] = useState4();
|
|
6496
6739
|
const [focusedControl, setFocusedControl] = useState4("project");
|
|
@@ -6891,6 +7134,7 @@ var App = ({
|
|
|
6891
7134
|
const userStatus = await checkUserStatus(baseUrl, token);
|
|
6892
7135
|
if (userStatus.user) {
|
|
6893
7136
|
setUserName(getFirstNameForDisplay(userStatus.user));
|
|
7137
|
+
setUserEmail(userStatus.user.email?.trim() || void 0);
|
|
6894
7138
|
}
|
|
6895
7139
|
if (userStatus.user?.id) {
|
|
6896
7140
|
setCurrentUserId(userStatus.user.id);
|
|
@@ -7066,8 +7310,12 @@ var App = ({
|
|
|
7066
7310
|
setAuthToken(token);
|
|
7067
7311
|
}
|
|
7068
7312
|
if (token && !accessKey) {
|
|
7069
|
-
|
|
7313
|
+
getUserIdentityFromToken(token).then((identity) => {
|
|
7314
|
+
setUserName(identity.name);
|
|
7315
|
+
setUserEmail(identity.email);
|
|
7316
|
+
}).catch(() => {
|
|
7070
7317
|
setUserName("You");
|
|
7318
|
+
setUserEmail(void 0);
|
|
7071
7319
|
});
|
|
7072
7320
|
}
|
|
7073
7321
|
if (token && shouldHydrateAuthenticatedWorkspace({
|
|
@@ -7996,7 +8244,10 @@ var App = ({
|
|
|
7996
8244
|
scrollOffset: promptInputScrollOffset
|
|
7997
8245
|
});
|
|
7998
8246
|
const promptInputRows = promptInputViewport.visibleRowCount;
|
|
7999
|
-
const promptCommandCompletionRows =
|
|
8247
|
+
const promptCommandCompletionRows = estimateCommandCompletionRows(
|
|
8248
|
+
slashCommandCompletions.length,
|
|
8249
|
+
terminalSize.columns
|
|
8250
|
+
);
|
|
8000
8251
|
const promptSuggestionRows = estimatePromptSuggestionRows(visiblePromptSuggestions.length) + promptCommandCompletionRows;
|
|
8001
8252
|
const chatResponsiveMode = getChatResponsiveMode(terminalSize);
|
|
8002
8253
|
const splitChatLayout = shouldUseSplitChatLayout(terminalSize);
|
|
@@ -8025,12 +8276,17 @@ var App = ({
|
|
|
8025
8276
|
const bannerDisabled = bannerDisabledByConfig || !tuiLayout.showBanner;
|
|
8026
8277
|
const bannerContentColumns = Math.max(1, terminalSize.columns - tuiLayout.paddingX * 2);
|
|
8027
8278
|
const billingSummary = billingHeaderError ? `Plan: unavailable | Credits: unavailable` : billingSummaryText(billingHeader);
|
|
8028
|
-
const
|
|
8279
|
+
const bannerDetailLines = buildBannerDetailLines({
|
|
8029
8280
|
apiBase,
|
|
8030
8281
|
frontendBaseUrl,
|
|
8031
8282
|
billingSummary,
|
|
8032
|
-
|
|
8283
|
+
billingTone: billingHeader?.tone,
|
|
8284
|
+
userName,
|
|
8285
|
+
userEmail
|
|
8033
8286
|
});
|
|
8287
|
+
const headerDetails = bannerDetailLines.map(
|
|
8288
|
+
(line) => line.segments.map((segment) => segment.text).join("")
|
|
8289
|
+
);
|
|
8034
8290
|
const keyBindings = getTuiKeyBindings();
|
|
8035
8291
|
const scrollHelp = mouseTrackingEnabled ? `${keyBindings.mouse} | wheel scroll` : keyBindings.scroll;
|
|
8036
8292
|
const chatAvailableWidth = Math.max(
|
|
@@ -8166,7 +8422,7 @@ var App = ({
|
|
|
8166
8422
|
const lastRow = Math.max(...workspaceTabHitAreas.map((area) => area.endRow));
|
|
8167
8423
|
return Math.max(0, lastRow - firstRow + 1);
|
|
8168
8424
|
}, [workspaceTabHitAreas]);
|
|
8169
|
-
const workspaceTabBarRows = (bannerDisabled ?
|
|
8425
|
+
const workspaceTabBarRows = (bannerDisabled ? 4 : 0) + Math.max(estimateWorkspaceTabBarRows(), workspaceTabButtonRows);
|
|
8170
8426
|
const promptPanelRows = estimatePromptPanelRows({
|
|
8171
8427
|
inputRows: promptInputRows,
|
|
8172
8428
|
suggestionRows: promptSuggestionRows,
|
|
@@ -8194,15 +8450,23 @@ var App = ({
|
|
|
8194
8450
|
24,
|
|
8195
8451
|
workspaceContentWidth - (workspacePanelOverflowing ? 7 : 5)
|
|
8196
8452
|
);
|
|
8197
|
-
const
|
|
8198
|
-
const
|
|
8453
|
+
const chatTabDescriptionRows = 1;
|
|
8454
|
+
const chatMiddleMarginRows = 1;
|
|
8455
|
+
const chatHeaderRows = bannerRenderedRows + workspaceTabBarRows + chatTabDescriptionRows + chatMiddleMarginRows;
|
|
8456
|
+
const chatSelectorRows = activeSelector ? estimateSelectPanelRows(tuiLayout.selectorLimit) : 0;
|
|
8457
|
+
const chatFooterRows = bottomControlsRows + chatSelectorRows + (isSearching ? searchPromptPanelRows : activeSelector ? 0 : promptPanelRows);
|
|
8199
8458
|
const chatMiddleViewportRows = getMiddleViewportRows(terminalSize, {
|
|
8200
8459
|
headerRows: chatHeaderRows,
|
|
8201
|
-
footerRows: chatFooterRows
|
|
8460
|
+
footerRows: chatFooterRows,
|
|
8461
|
+
safetyRows: 3
|
|
8202
8462
|
});
|
|
8203
|
-
const chatMiddleAuxiliaryRows = (isSearching ? 3 : 0) + (queuedMessages.length > 0 ? 4 : 0) + (notice ? 1 : 0) + (errorText ? 5 : 0) + (chatState.status === "hitl_waiting" && chatState.hitl?.waiting ? 7 : 0)
|
|
8463
|
+
const chatMiddleAuxiliaryRows = (isSearching ? 3 : 0) + (queuedMessages.length > 0 ? 4 : 0) + (notice ? 1 : 0) + (errorText ? 5 : 0) + (chatState.status === "hitl_waiting" && chatState.hitl?.waiting ? 7 : 0);
|
|
8204
8464
|
const contextRailArtifactRows = splitChatLayout && chatArtifactChips.length ? chatArtifactChips.length + 2 : 0;
|
|
8205
|
-
const chatMainPanelRows = Math.max(
|
|
8465
|
+
const chatMainPanelRows = Math.max(
|
|
8466
|
+
4,
|
|
8467
|
+
chatMiddleViewportRows - chatMiddleAuxiliaryRows
|
|
8468
|
+
);
|
|
8469
|
+
const showChatThreadPanel = !activeSelector;
|
|
8206
8470
|
const chatThreadHeight = getFramedBodyRows(chatMainPanelRows);
|
|
8207
8471
|
const chatMiddleOverflowing = chatMiddleContentHeight > chatMiddleViewportHeight;
|
|
8208
8472
|
const selectorControlStartRow = useMemo(
|
|
@@ -8839,15 +9103,22 @@ var App = ({
|
|
|
8839
9103
|
);
|
|
8840
9104
|
if (phase === "boot") {
|
|
8841
9105
|
return /* @__PURE__ */ jsxs8(Box9, { flexDirection: "column", paddingX: tuiLayout.paddingX, paddingY: 0, height: terminalSize.rows, children: [
|
|
8842
|
-
/* @__PURE__ */
|
|
9106
|
+
/* @__PURE__ */ jsx12(
|
|
9107
|
+
Banner,
|
|
9108
|
+
{
|
|
9109
|
+
disable: bannerDisabled,
|
|
9110
|
+
detailLines: bannerDetailLines,
|
|
9111
|
+
terminalColumns: bannerContentColumns
|
|
9112
|
+
}
|
|
9113
|
+
),
|
|
8843
9114
|
isLoggingIn ? /* @__PURE__ */ jsxs8(Box9, { flexDirection: "column", gap: 1, padding: 1, children: [
|
|
8844
|
-
/* @__PURE__ */
|
|
8845
|
-
/* @__PURE__ */
|
|
8846
|
-
] }) : /* @__PURE__ */
|
|
9115
|
+
/* @__PURE__ */ jsx12(Text12, { color: terminalTheme.brand, bold: true, children: "Signing in..." }),
|
|
9116
|
+
/* @__PURE__ */ jsx12(Text12, { dimColor: true, children: "Please complete authentication in your browser." })
|
|
9117
|
+
] }) : /* @__PURE__ */ jsx12(Loader, { step: loaderStep, steps: bootSteps, animate: animationsEnabled })
|
|
8847
9118
|
] });
|
|
8848
9119
|
}
|
|
8849
9120
|
if (needsOnboarding && phase === "ready" && authToken) {
|
|
8850
|
-
return /* @__PURE__ */
|
|
9121
|
+
return /* @__PURE__ */ jsx12(
|
|
8851
9122
|
Onboarding,
|
|
8852
9123
|
{
|
|
8853
9124
|
baseUrl,
|
|
@@ -8868,14 +9139,14 @@ var App = ({
|
|
|
8868
9139
|
}
|
|
8869
9140
|
if (phase === "error") {
|
|
8870
9141
|
return /* @__PURE__ */ jsxs8(Box9, { flexDirection: "column", padding: 1, height: terminalSize.rows, children: [
|
|
8871
|
-
/* @__PURE__ */
|
|
8872
|
-
/* @__PURE__ */
|
|
8873
|
-
/* @__PURE__ */ jsxs8(
|
|
9142
|
+
/* @__PURE__ */ jsx12(Text12, { color: terminalTheme.danger, children: "Failed to start CLI." }),
|
|
9143
|
+
/* @__PURE__ */ jsx12(Text12, { children: bootError ?? "Unknown error" }),
|
|
9144
|
+
/* @__PURE__ */ jsxs8(Text12, { children: [
|
|
8874
9145
|
"Base URL: ",
|
|
8875
9146
|
apiBase,
|
|
8876
9147
|
" (set via CLOUDEVAL_BASE_URL or --base-url)"
|
|
8877
9148
|
] }),
|
|
8878
|
-
/* @__PURE__ */
|
|
9149
|
+
/* @__PURE__ */ jsx12(Text12, { children: "Press Ctrl+C to quit." })
|
|
8879
9150
|
] });
|
|
8880
9151
|
}
|
|
8881
9152
|
const chatStatusText = (() => {
|
|
@@ -8892,7 +9163,7 @@ var App = ({
|
|
|
8892
9163
|
const chatStatusColor = chatState.status === "error" ? terminalTheme.danger : chatState.status === "complete" ? terminalTheme.success : chatState.status === "canceled" ? terminalTheme.warning : isBusyStatus(chatState.status) ? terminalTheme.brand : void 0;
|
|
8893
9164
|
const chatBusy = chatState.status === "connecting" || chatState.status === "thinking" || chatState.status === "streaming" || chatState.status === "tool_running";
|
|
8894
9165
|
const promptActionIsCancel = isBusyStatus(chatState.status) || Boolean(controllerRef.current) || hasCancellableReasoning;
|
|
8895
|
-
const threadPanel = /* @__PURE__ */
|
|
9166
|
+
const threadPanel = /* @__PURE__ */ jsx12(
|
|
8896
9167
|
TitledBox,
|
|
8897
9168
|
{
|
|
8898
9169
|
title: selectedThreadTitle,
|
|
@@ -8902,7 +9173,7 @@ var App = ({
|
|
|
8902
9173
|
width: chatThreadPanelWidth,
|
|
8903
9174
|
height: chatMainPanelRows,
|
|
8904
9175
|
children: /* @__PURE__ */ jsxs8(Box9, { flexDirection: "row", children: [
|
|
8905
|
-
/* @__PURE__ */
|
|
9176
|
+
/* @__PURE__ */ jsx12(Box9, { flexShrink: 1, width: threadContentWidth, children: /* @__PURE__ */ jsx12(
|
|
8906
9177
|
ScrollView,
|
|
8907
9178
|
{
|
|
8908
9179
|
ref: scrollViewRef,
|
|
@@ -8925,7 +9196,7 @@ var App = ({
|
|
|
8925
9196
|
});
|
|
8926
9197
|
},
|
|
8927
9198
|
onViewportSizeChange: (size) => setViewportHeight(size.height),
|
|
8928
|
-
children: /* @__PURE__ */
|
|
9199
|
+
children: /* @__PURE__ */ jsx12(
|
|
8929
9200
|
Transcript,
|
|
8930
9201
|
{
|
|
8931
9202
|
messages: displayedMessages,
|
|
@@ -8938,7 +9209,7 @@ var App = ({
|
|
|
8938
9209
|
)
|
|
8939
9210
|
}
|
|
8940
9211
|
) }),
|
|
8941
|
-
/* @__PURE__ */
|
|
9212
|
+
/* @__PURE__ */ jsx12(
|
|
8942
9213
|
Scrollbar2,
|
|
8943
9214
|
{
|
|
8944
9215
|
scrollOffset,
|
|
@@ -8949,7 +9220,7 @@ var App = ({
|
|
|
8949
9220
|
] })
|
|
8950
9221
|
}
|
|
8951
9222
|
);
|
|
8952
|
-
const promptFooterControls = splitChatLayout ? void 0 : /* @__PURE__ */
|
|
9223
|
+
const promptFooterControls = splitChatLayout ? void 0 : /* @__PURE__ */ jsx12(
|
|
8953
9224
|
PromptControlBar,
|
|
8954
9225
|
{
|
|
8955
9226
|
focused: focusedControl,
|
|
@@ -8975,12 +9246,19 @@ var App = ({
|
|
|
8975
9246
|
value: p
|
|
8976
9247
|
}));
|
|
8977
9248
|
return /* @__PURE__ */ jsxs8(Box9, { flexDirection: "column", paddingX: tuiLayout.paddingX, paddingY: 0, gap: 0, height: terminalSize.rows, children: [
|
|
8978
|
-
/* @__PURE__ */
|
|
8979
|
-
|
|
9249
|
+
/* @__PURE__ */ jsx12(
|
|
9250
|
+
Banner,
|
|
9251
|
+
{
|
|
9252
|
+
disable: bannerDisabled,
|
|
9253
|
+
detailLines: bannerDetailLines,
|
|
9254
|
+
terminalColumns: bannerContentColumns
|
|
9255
|
+
}
|
|
9256
|
+
),
|
|
9257
|
+
/* @__PURE__ */ jsx12(Text12, { children: "Select a project to chat with:" }),
|
|
8980
9258
|
loadingProjects ? /* @__PURE__ */ jsxs8(Box9, { flexDirection: "row", gap: 1, children: [
|
|
8981
|
-
/* @__PURE__ */
|
|
8982
|
-
/* @__PURE__ */
|
|
8983
|
-
] }) : /* @__PURE__ */
|
|
9259
|
+
/* @__PURE__ */ jsx12(Spinner, { type: "line", animate: animationsEnabled }),
|
|
9260
|
+
/* @__PURE__ */ jsx12(Text12, { color: terminalTheme.brand, children: "Loading projects..." })
|
|
9261
|
+
] }) : /* @__PURE__ */ jsx12(
|
|
8984
9262
|
ProjectSelector,
|
|
8985
9263
|
{
|
|
8986
9264
|
items,
|
|
@@ -8997,8 +9275,15 @@ var App = ({
|
|
|
8997
9275
|
}
|
|
8998
9276
|
if (activeWorkspaceTab !== "chat") {
|
|
8999
9277
|
return /* @__PURE__ */ jsxs8(Box9, { flexDirection: "column", paddingX: tuiLayout.paddingX, paddingY: 0, gap: 0, height: terminalSize.rows, children: [
|
|
9000
|
-
/* @__PURE__ */
|
|
9001
|
-
|
|
9278
|
+
/* @__PURE__ */ jsx12(
|
|
9279
|
+
Banner,
|
|
9280
|
+
{
|
|
9281
|
+
disable: bannerDisabled,
|
|
9282
|
+
detailLines: bannerDetailLines,
|
|
9283
|
+
terminalColumns: bannerContentColumns
|
|
9284
|
+
}
|
|
9285
|
+
),
|
|
9286
|
+
/* @__PURE__ */ jsx12(
|
|
9002
9287
|
WorkspaceTabBar,
|
|
9003
9288
|
{
|
|
9004
9289
|
activeTab: activeWorkspaceTab,
|
|
@@ -9006,9 +9291,9 @@ var App = ({
|
|
|
9006
9291
|
billingSummary: bannerDisabled ? billingHeader : void 0
|
|
9007
9292
|
}
|
|
9008
9293
|
),
|
|
9009
|
-
/* @__PURE__ */
|
|
9010
|
-
notice ? /* @__PURE__ */
|
|
9011
|
-
/* @__PURE__ */
|
|
9294
|
+
/* @__PURE__ */ jsx12(Text12, { dimColor: true, wrap: "wrap", children: workspaceTabDescriptions[activeWorkspaceTab] }),
|
|
9295
|
+
notice ? /* @__PURE__ */ jsx12(NoticeLine, { message: notice }) : null,
|
|
9296
|
+
/* @__PURE__ */ jsx12(
|
|
9012
9297
|
TitledBox,
|
|
9013
9298
|
{
|
|
9014
9299
|
title: workspaceTabLabels[activeWorkspaceTab],
|
|
@@ -9019,7 +9304,7 @@ var App = ({
|
|
|
9019
9304
|
height: workspacePanelViewportRows,
|
|
9020
9305
|
width: workspaceContentWidth,
|
|
9021
9306
|
children: /* @__PURE__ */ jsxs8(Box9, { flexDirection: "row", children: [
|
|
9022
|
-
/* @__PURE__ */
|
|
9307
|
+
/* @__PURE__ */ jsx12(Box9, { flexShrink: 1, width: workspacePanelBodyWidth, children: /* @__PURE__ */ jsx12(
|
|
9023
9308
|
ScrollView,
|
|
9024
9309
|
{
|
|
9025
9310
|
ref: workspaceScrollViewRef,
|
|
@@ -9027,7 +9312,7 @@ var App = ({
|
|
|
9027
9312
|
onScroll: (offset) => setWorkspaceScrollOffset(offset),
|
|
9028
9313
|
onContentHeightChange: (height) => setWorkspaceContentHeight(height),
|
|
9029
9314
|
onViewportSizeChange: (size) => setWorkspaceViewportHeight(size.height),
|
|
9030
|
-
children: /* @__PURE__ */
|
|
9315
|
+
children: /* @__PURE__ */ jsx12(
|
|
9031
9316
|
WorkspacePanel,
|
|
9032
9317
|
{
|
|
9033
9318
|
tab: activeWorkspaceTab,
|
|
@@ -9048,7 +9333,7 @@ var App = ({
|
|
|
9048
9333
|
)
|
|
9049
9334
|
}
|
|
9050
9335
|
) }),
|
|
9051
|
-
workspacePanelOverflowing ? /* @__PURE__ */
|
|
9336
|
+
workspacePanelOverflowing ? /* @__PURE__ */ jsx12(
|
|
9052
9337
|
Scrollbar2,
|
|
9053
9338
|
{
|
|
9054
9339
|
scrollOffset: workspaceScrollOffset,
|
|
@@ -9059,8 +9344,8 @@ var App = ({
|
|
|
9059
9344
|
] })
|
|
9060
9345
|
}
|
|
9061
9346
|
),
|
|
9062
|
-
/* @__PURE__ */
|
|
9063
|
-
activeSelector === "project" ? /* @__PURE__ */
|
|
9347
|
+
/* @__PURE__ */ jsx12(BottomControls, { tab: activeWorkspaceTab }),
|
|
9348
|
+
activeSelector === "project" ? /* @__PURE__ */ jsx12(
|
|
9064
9349
|
SelectPanel,
|
|
9065
9350
|
{
|
|
9066
9351
|
title: "Select Project",
|
|
@@ -9087,23 +9372,30 @@ var App = ({
|
|
|
9087
9372
|
] });
|
|
9088
9373
|
}
|
|
9089
9374
|
return /* @__PURE__ */ jsxs8(Box9, { flexDirection: "column", paddingX: tuiLayout.paddingX, paddingY: 0, gap: 0, height: terminalSize.rows, children: [
|
|
9090
|
-
/* @__PURE__ */
|
|
9091
|
-
|
|
9375
|
+
/* @__PURE__ */ jsx12(Box9, { flexShrink: 0, children: /* @__PURE__ */ jsx12(
|
|
9376
|
+
Banner,
|
|
9377
|
+
{
|
|
9378
|
+
disable: bannerDisabled,
|
|
9379
|
+
detailLines: bannerDetailLines,
|
|
9380
|
+
terminalColumns: bannerContentColumns
|
|
9381
|
+
}
|
|
9382
|
+
) }),
|
|
9383
|
+
/* @__PURE__ */ jsx12(Box9, { flexShrink: 0, children: /* @__PURE__ */ jsx12(
|
|
9092
9384
|
WorkspaceTabBar,
|
|
9093
9385
|
{
|
|
9094
9386
|
activeTab: activeWorkspaceTab,
|
|
9095
9387
|
showBrand: bannerDisabled,
|
|
9096
9388
|
billingSummary: bannerDisabled ? billingHeader : void 0
|
|
9097
9389
|
}
|
|
9098
|
-
),
|
|
9099
|
-
/* @__PURE__ */
|
|
9390
|
+
) }),
|
|
9391
|
+
/* @__PURE__ */ jsx12(Box9, { flexShrink: 0, children: /* @__PURE__ */ jsx12(Text12, { dimColor: true, wrap: "wrap", children: workspaceTabDescriptions.chat }) }),
|
|
9100
9392
|
/* @__PURE__ */ jsxs8(Box9, { flexDirection: "row", marginTop: 1, children: [
|
|
9101
|
-
/* @__PURE__ */
|
|
9393
|
+
/* @__PURE__ */ jsx12(
|
|
9102
9394
|
Box9,
|
|
9103
9395
|
{
|
|
9104
9396
|
flexShrink: 1,
|
|
9105
9397
|
width: Math.max(24, chatAvailableWidth - (chatMiddleOverflowing ? 2 : 0)),
|
|
9106
|
-
children: /* @__PURE__ */
|
|
9398
|
+
children: /* @__PURE__ */ jsx12(
|
|
9107
9399
|
ScrollView,
|
|
9108
9400
|
{
|
|
9109
9401
|
ref: chatMiddleScrollViewRef,
|
|
@@ -9112,7 +9404,7 @@ var App = ({
|
|
|
9112
9404
|
onContentHeightChange: (height) => setChatMiddleContentHeight(height),
|
|
9113
9405
|
onViewportSizeChange: (size) => setChatMiddleViewportHeight(size.height),
|
|
9114
9406
|
children: /* @__PURE__ */ jsxs8(Box9, { flexDirection: "column", children: [
|
|
9115
|
-
isSearching ? /* @__PURE__ */
|
|
9407
|
+
isSearching ? /* @__PURE__ */ jsx12(
|
|
9116
9408
|
TitledBox,
|
|
9117
9409
|
{
|
|
9118
9410
|
title: "Search",
|
|
@@ -9120,14 +9412,14 @@ var App = ({
|
|
|
9120
9412
|
borderColor: terminalTheme.warning,
|
|
9121
9413
|
padding: 0,
|
|
9122
9414
|
paddingX: 1,
|
|
9123
|
-
children: /* @__PURE__ */ jsxs8(
|
|
9415
|
+
children: /* @__PURE__ */ jsxs8(Text12, { children: [
|
|
9124
9416
|
"Found: ",
|
|
9125
9417
|
displayedMessages.length,
|
|
9126
9418
|
" matches"
|
|
9127
9419
|
] })
|
|
9128
9420
|
}
|
|
9129
9421
|
) : null,
|
|
9130
|
-
queuedMessages.length > 0 ? /* @__PURE__ */
|
|
9422
|
+
queuedMessages.length > 0 ? /* @__PURE__ */ jsx12(
|
|
9131
9423
|
QueuePanel,
|
|
9132
9424
|
{
|
|
9133
9425
|
messages: queuedMessages,
|
|
@@ -9135,7 +9427,7 @@ var App = ({
|
|
|
9135
9427
|
terminalColumns: terminalSize.columns
|
|
9136
9428
|
}
|
|
9137
9429
|
) : null,
|
|
9138
|
-
notice ? /* @__PURE__ */
|
|
9430
|
+
notice ? /* @__PURE__ */ jsx12(NoticeLine, { message: notice }) : null,
|
|
9139
9431
|
errorText ? /* @__PURE__ */ jsxs8(
|
|
9140
9432
|
TitledBox,
|
|
9141
9433
|
{
|
|
@@ -9146,20 +9438,20 @@ var App = ({
|
|
|
9146
9438
|
paddingX: 1,
|
|
9147
9439
|
marginTop: 1,
|
|
9148
9440
|
children: [
|
|
9149
|
-
/* @__PURE__ */
|
|
9150
|
-
!hasThinkingSteps ? /* @__PURE__ */
|
|
9441
|
+
/* @__PURE__ */ jsx12(Text12, { color: terminalTheme.danger, wrap: "wrap", children: errorText }),
|
|
9442
|
+
!hasThinkingSteps ? /* @__PURE__ */ jsx12(Text12, { dimColor: true, wrap: "wrap", children: "No thinking steps were received before the backend returned this error." }) : null
|
|
9151
9443
|
]
|
|
9152
9444
|
}
|
|
9153
9445
|
) : null,
|
|
9154
|
-
!splitChatLayout && chatArtifactChips.length ? /* @__PURE__ */
|
|
9446
|
+
!splitChatLayout && chatArtifactChips.length ? /* @__PURE__ */ jsx12(Box9, { marginTop: 1, children: /* @__PURE__ */ jsx12(
|
|
9155
9447
|
ArtifactStrip,
|
|
9156
9448
|
{
|
|
9157
9449
|
chips: chatArtifactChips,
|
|
9158
9450
|
terminalColumns: chatAvailableWidth
|
|
9159
9451
|
}
|
|
9160
9452
|
) }) : null,
|
|
9161
|
-
splitChatLayout ? /* @__PURE__ */ jsxs8(Box9, { flexDirection: "row", columnGap: chatSplitGap, children: [
|
|
9162
|
-
/* @__PURE__ */
|
|
9453
|
+
showChatThreadPanel ? splitChatLayout ? /* @__PURE__ */ jsxs8(Box9, { flexDirection: "row", columnGap: chatSplitGap, children: [
|
|
9454
|
+
/* @__PURE__ */ jsx12(
|
|
9163
9455
|
ChatContextPanel,
|
|
9164
9456
|
{
|
|
9165
9457
|
width: chatContextPanelWidth,
|
|
@@ -9183,8 +9475,8 @@ var App = ({
|
|
|
9183
9475
|
}
|
|
9184
9476
|
),
|
|
9185
9477
|
threadPanel
|
|
9186
|
-
] }) : threadPanel,
|
|
9187
|
-
chatState.status === "hitl_waiting" && chatState.hitl?.waiting ? /* @__PURE__ */
|
|
9478
|
+
] }) : threadPanel : null,
|
|
9479
|
+
chatState.status === "hitl_waiting" && chatState.hitl?.waiting ? /* @__PURE__ */ jsx12(
|
|
9188
9480
|
HitlPanel,
|
|
9189
9481
|
{
|
|
9190
9482
|
hitl: chatState.hitl,
|
|
@@ -9193,115 +9485,13 @@ var App = ({
|
|
|
9193
9485
|
answers: hitlAnswers,
|
|
9194
9486
|
frontendUrl: frontendThreadUrl
|
|
9195
9487
|
}
|
|
9196
|
-
) : null,
|
|
9197
|
-
activeSelector === "thread" ? /* @__PURE__ */ jsx10(
|
|
9198
|
-
SelectPanel,
|
|
9199
|
-
{
|
|
9200
|
-
title: "Select Thread",
|
|
9201
|
-
items: loadingSessions || loadingRemoteThreads ? [
|
|
9202
|
-
{
|
|
9203
|
-
label: "Loading threads...",
|
|
9204
|
-
value: { kind: "new" },
|
|
9205
|
-
description: "Reading CloudEval threads and local CLI history."
|
|
9206
|
-
}
|
|
9207
|
-
] : threadSelectItems,
|
|
9208
|
-
selectedIndex: Math.max(
|
|
9209
|
-
0,
|
|
9210
|
-
threadSelectItems.findIndex(
|
|
9211
|
-
(item) => item.value.kind === "remote" && item.value.thread.thread_id === chatState.threadId || item.value.kind === "session" && item.value.session.threadId === chatState.threadId || item.value.kind === "draft" && item.value.draft.key === activeDraftSessionKey
|
|
9212
|
-
)
|
|
9213
|
-
),
|
|
9214
|
-
onSubmit: (item) => selectThread(item.value),
|
|
9215
|
-
onCancel: () => setActiveSelector(null),
|
|
9216
|
-
limit: tuiLayout.selectorLimit
|
|
9217
|
-
}
|
|
9218
|
-
) : null,
|
|
9219
|
-
activeSelector === "project" ? /* @__PURE__ */ jsx10(
|
|
9220
|
-
SelectPanel,
|
|
9221
|
-
{
|
|
9222
|
-
title: "Select Project",
|
|
9223
|
-
items: (projects.length ? projects : [defaultProject]).map((project) => ({
|
|
9224
|
-
label: `${project.name} (${project.cloud_provider ?? "cloud"})`,
|
|
9225
|
-
value: project,
|
|
9226
|
-
description: project.id
|
|
9227
|
-
})),
|
|
9228
|
-
selectedIndex: Math.max(
|
|
9229
|
-
0,
|
|
9230
|
-
(projects.length ? projects : [defaultProject]).findIndex(
|
|
9231
|
-
(project) => project.id === (selectedProject ?? defaultProject).id
|
|
9232
|
-
)
|
|
9233
|
-
),
|
|
9234
|
-
onSubmit: (item) => {
|
|
9235
|
-
setSelectedProject(item.value);
|
|
9236
|
-
setActiveSelector(null);
|
|
9237
|
-
},
|
|
9238
|
-
onCancel: () => setActiveSelector(null),
|
|
9239
|
-
limit: tuiLayout.selectorLimit
|
|
9240
|
-
}
|
|
9241
|
-
) : null,
|
|
9242
|
-
activeSelector === "model" ? /* @__PURE__ */ jsx10(
|
|
9243
|
-
SelectPanel,
|
|
9244
|
-
{
|
|
9245
|
-
title: "Select Model",
|
|
9246
|
-
items: modelItems,
|
|
9247
|
-
selectedIndex: Math.max(
|
|
9248
|
-
0,
|
|
9249
|
-
modelItems.findIndex((item) => item.value === selectedModel)
|
|
9250
|
-
),
|
|
9251
|
-
onSubmit: (item) => {
|
|
9252
|
-
setSelectedModel(item.value);
|
|
9253
|
-
setActiveSelector(null);
|
|
9254
|
-
},
|
|
9255
|
-
onCancel: () => setActiveSelector(null),
|
|
9256
|
-
limit: tuiLayout.selectorLimit
|
|
9257
|
-
}
|
|
9258
|
-
) : null,
|
|
9259
|
-
activeSelector === "mode" ? /* @__PURE__ */ jsx10(
|
|
9260
|
-
SelectPanel,
|
|
9261
|
-
{
|
|
9262
|
-
title: "Select Mode",
|
|
9263
|
-
items: modeItems,
|
|
9264
|
-
selectedIndex: Math.max(
|
|
9265
|
-
0,
|
|
9266
|
-
modeItems.findIndex((item) => item.value === selectedMode)
|
|
9267
|
-
),
|
|
9268
|
-
onSubmit: (item) => {
|
|
9269
|
-
setSelectedMode(item.value);
|
|
9270
|
-
if (item.value === "ask") {
|
|
9271
|
-
setSelectedAgentProfileId("");
|
|
9272
|
-
}
|
|
9273
|
-
setNotice(
|
|
9274
|
-
item.value === "ask" ? "Mode selected: Ask. Agent Profile cleared." : `Mode selected: ${item.label}`
|
|
9275
|
-
);
|
|
9276
|
-
setActiveSelector(null);
|
|
9277
|
-
},
|
|
9278
|
-
onCancel: () => setActiveSelector(null),
|
|
9279
|
-
limit: tuiLayout.selectorLimit
|
|
9280
|
-
}
|
|
9281
|
-
) : null,
|
|
9282
|
-
activeSelector === "profile" ? /* @__PURE__ */ jsx10(
|
|
9283
|
-
SelectPanel,
|
|
9284
|
-
{
|
|
9285
|
-
title: "Select Agent Profile",
|
|
9286
|
-
items: agentProfileItems,
|
|
9287
|
-
selectedIndex: Math.max(
|
|
9288
|
-
0,
|
|
9289
|
-
agentProfileItems.findIndex((item) => item.value === selectedAgentProfileId)
|
|
9290
|
-
),
|
|
9291
|
-
onSubmit: (item) => {
|
|
9292
|
-
selectAgentProfileById(item.value, item.label);
|
|
9293
|
-
setActiveSelector(null);
|
|
9294
|
-
},
|
|
9295
|
-
onCancel: () => setActiveSelector(null),
|
|
9296
|
-
limit: tuiLayout.selectorLimit
|
|
9297
|
-
}
|
|
9298
9488
|
) : null
|
|
9299
9489
|
] })
|
|
9300
9490
|
}
|
|
9301
9491
|
)
|
|
9302
9492
|
}
|
|
9303
9493
|
),
|
|
9304
|
-
chatMiddleOverflowing ? /* @__PURE__ */
|
|
9494
|
+
chatMiddleOverflowing ? /* @__PURE__ */ jsx12(
|
|
9305
9495
|
Scrollbar2,
|
|
9306
9496
|
{
|
|
9307
9497
|
scrollOffset: chatMiddleScrollOffset,
|
|
@@ -9310,7 +9500,109 @@ var App = ({
|
|
|
9310
9500
|
}
|
|
9311
9501
|
) : null
|
|
9312
9502
|
] }),
|
|
9313
|
-
|
|
9503
|
+
activeSelector === "thread" ? /* @__PURE__ */ jsx12(
|
|
9504
|
+
SelectPanel,
|
|
9505
|
+
{
|
|
9506
|
+
title: "Select Thread",
|
|
9507
|
+
items: loadingSessions || loadingRemoteThreads ? [
|
|
9508
|
+
{
|
|
9509
|
+
label: "Loading threads...",
|
|
9510
|
+
value: { kind: "new" },
|
|
9511
|
+
description: "Reading CloudEval threads and local CLI history."
|
|
9512
|
+
}
|
|
9513
|
+
] : threadSelectItems,
|
|
9514
|
+
selectedIndex: Math.max(
|
|
9515
|
+
0,
|
|
9516
|
+
threadSelectItems.findIndex(
|
|
9517
|
+
(item) => item.value.kind === "remote" && item.value.thread.thread_id === chatState.threadId || item.value.kind === "session" && item.value.session.threadId === chatState.threadId || item.value.kind === "draft" && item.value.draft.key === activeDraftSessionKey
|
|
9518
|
+
)
|
|
9519
|
+
),
|
|
9520
|
+
onSubmit: (item) => selectThread(item.value),
|
|
9521
|
+
onCancel: () => setActiveSelector(null),
|
|
9522
|
+
limit: tuiLayout.selectorLimit
|
|
9523
|
+
}
|
|
9524
|
+
) : null,
|
|
9525
|
+
activeSelector === "project" ? /* @__PURE__ */ jsx12(
|
|
9526
|
+
SelectPanel,
|
|
9527
|
+
{
|
|
9528
|
+
title: "Select Project",
|
|
9529
|
+
items: (projects.length ? projects : [defaultProject]).map((project) => ({
|
|
9530
|
+
label: `${project.name} (${project.cloud_provider ?? "cloud"})`,
|
|
9531
|
+
value: project,
|
|
9532
|
+
description: project.id
|
|
9533
|
+
})),
|
|
9534
|
+
selectedIndex: Math.max(
|
|
9535
|
+
0,
|
|
9536
|
+
(projects.length ? projects : [defaultProject]).findIndex(
|
|
9537
|
+
(project) => project.id === (selectedProject ?? defaultProject).id
|
|
9538
|
+
)
|
|
9539
|
+
),
|
|
9540
|
+
onSubmit: (item) => {
|
|
9541
|
+
setSelectedProject(item.value);
|
|
9542
|
+
setActiveSelector(null);
|
|
9543
|
+
},
|
|
9544
|
+
onCancel: () => setActiveSelector(null),
|
|
9545
|
+
limit: tuiLayout.selectorLimit
|
|
9546
|
+
}
|
|
9547
|
+
) : null,
|
|
9548
|
+
activeSelector === "model" ? /* @__PURE__ */ jsx12(
|
|
9549
|
+
SelectPanel,
|
|
9550
|
+
{
|
|
9551
|
+
title: "Select Model",
|
|
9552
|
+
items: modelItems,
|
|
9553
|
+
selectedIndex: Math.max(
|
|
9554
|
+
0,
|
|
9555
|
+
modelItems.findIndex((item) => item.value === selectedModel)
|
|
9556
|
+
),
|
|
9557
|
+
onSubmit: (item) => {
|
|
9558
|
+
setSelectedModel(item.value);
|
|
9559
|
+
setActiveSelector(null);
|
|
9560
|
+
},
|
|
9561
|
+
onCancel: () => setActiveSelector(null),
|
|
9562
|
+
limit: tuiLayout.selectorLimit
|
|
9563
|
+
}
|
|
9564
|
+
) : null,
|
|
9565
|
+
activeSelector === "mode" ? /* @__PURE__ */ jsx12(
|
|
9566
|
+
SelectPanel,
|
|
9567
|
+
{
|
|
9568
|
+
title: "Select Mode",
|
|
9569
|
+
items: modeItems,
|
|
9570
|
+
selectedIndex: Math.max(
|
|
9571
|
+
0,
|
|
9572
|
+
modeItems.findIndex((item) => item.value === selectedMode)
|
|
9573
|
+
),
|
|
9574
|
+
onSubmit: (item) => {
|
|
9575
|
+
setSelectedMode(item.value);
|
|
9576
|
+
if (item.value === "ask") {
|
|
9577
|
+
setSelectedAgentProfileId("");
|
|
9578
|
+
}
|
|
9579
|
+
setNotice(
|
|
9580
|
+
item.value === "ask" ? "Mode selected: Ask. Agent Profile cleared." : `Mode selected: ${item.label}`
|
|
9581
|
+
);
|
|
9582
|
+
setActiveSelector(null);
|
|
9583
|
+
},
|
|
9584
|
+
onCancel: () => setActiveSelector(null),
|
|
9585
|
+
limit: tuiLayout.selectorLimit
|
|
9586
|
+
}
|
|
9587
|
+
) : null,
|
|
9588
|
+
activeSelector === "profile" ? /* @__PURE__ */ jsx12(
|
|
9589
|
+
SelectPanel,
|
|
9590
|
+
{
|
|
9591
|
+
title: "Select Agent Profile",
|
|
9592
|
+
items: agentProfileItems,
|
|
9593
|
+
selectedIndex: Math.max(
|
|
9594
|
+
0,
|
|
9595
|
+
agentProfileItems.findIndex((item) => item.value === selectedAgentProfileId)
|
|
9596
|
+
),
|
|
9597
|
+
onSubmit: (item) => {
|
|
9598
|
+
selectAgentProfileById(item.value, item.label);
|
|
9599
|
+
setActiveSelector(null);
|
|
9600
|
+
},
|
|
9601
|
+
onCancel: () => setActiveSelector(null),
|
|
9602
|
+
limit: tuiLayout.selectorLimit
|
|
9603
|
+
}
|
|
9604
|
+
) : null,
|
|
9605
|
+
isSearching ? /* @__PURE__ */ jsx12(
|
|
9314
9606
|
InputBox,
|
|
9315
9607
|
{
|
|
9316
9608
|
title: "Search History",
|
|
@@ -9324,7 +9616,7 @@ var App = ({
|
|
|
9324
9616
|
setSearchQuery("");
|
|
9325
9617
|
}
|
|
9326
9618
|
}
|
|
9327
|
-
) : activeSelector ? null : /* @__PURE__ */
|
|
9619
|
+
) : activeSelector ? null : /* @__PURE__ */ jsx12(
|
|
9328
9620
|
InputBox,
|
|
9329
9621
|
{
|
|
9330
9622
|
variant: "dock",
|
|
@@ -9382,10 +9674,11 @@ var App = ({
|
|
|
9382
9674
|
placeholder: chatState.status === "hitl_waiting" ? "Answer HITL prompt, or /open for frontend..." : isBusyStatus(chatState.status) ? "Response in progress. Enter queues next message..." : "Ask Cloudeval..."
|
|
9383
9675
|
}
|
|
9384
9676
|
),
|
|
9385
|
-
/* @__PURE__ */
|
|
9677
|
+
/* @__PURE__ */ jsx12(BottomControls, { tab: activeWorkspaceTab })
|
|
9386
9678
|
] });
|
|
9387
9679
|
};
|
|
9388
9680
|
export {
|
|
9389
9681
|
App,
|
|
9682
|
+
buildBannerDetailLines,
|
|
9390
9683
|
buildTuiHeaderDetails
|
|
9391
9684
|
};
|