@polterware/polter 0.2.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api.js +1 -1
- package/dist/{chunk-2OZZNSKW.js → chunk-3XNNC5AW.js} +4 -1
- package/dist/index.js +831 -497
- package/dist/mcp.js +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -24,14 +24,14 @@ import {
|
|
|
24
24
|
runSupabaseCommand,
|
|
25
25
|
savePipeline,
|
|
26
26
|
writeProjectConfig
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-3XNNC5AW.js";
|
|
28
28
|
|
|
29
29
|
// src/index.tsx
|
|
30
|
-
import
|
|
30
|
+
import React20 from "react";
|
|
31
31
|
import { render } from "ink";
|
|
32
32
|
|
|
33
33
|
// src/app.tsx
|
|
34
|
-
import { Box as
|
|
34
|
+
import { Box as Box22, Text as Text26, useApp } from "ink";
|
|
35
35
|
|
|
36
36
|
// src/hooks/useNavigation.ts
|
|
37
37
|
import { useState, useCallback } from "react";
|
|
@@ -403,7 +403,8 @@ function SelectList({
|
|
|
403
403
|
boxedSections = false,
|
|
404
404
|
width = 80,
|
|
405
405
|
isInputActive = true,
|
|
406
|
-
arrowNavigation = false
|
|
406
|
+
arrowNavigation = false,
|
|
407
|
+
panelFocused = true
|
|
407
408
|
}) {
|
|
408
409
|
const labelWidth = labelWidthProp ?? Math.max(16, Math.floor(width * 0.45));
|
|
409
410
|
const isNarrow = width < 50;
|
|
@@ -564,7 +565,7 @@ function SelectList({
|
|
|
564
565
|
{
|
|
565
566
|
flexDirection: "column",
|
|
566
567
|
borderStyle: "round",
|
|
567
|
-
borderColor: inkColors.accent,
|
|
568
|
+
borderColor: panelFocused ? inkColors.accent : panel.borderDim,
|
|
568
569
|
borderDimColor: !hasSelectedRow && !isPinnedSection,
|
|
569
570
|
paddingX: 1,
|
|
570
571
|
children: [
|
|
@@ -723,7 +724,8 @@ function buildHomeItems({
|
|
|
723
724
|
activeFeature,
|
|
724
725
|
pinnedCommands,
|
|
725
726
|
pinnedRuns,
|
|
726
|
-
showPinnedSection = true
|
|
727
|
+
showPinnedSection = true,
|
|
728
|
+
showFeatureHeader = true
|
|
727
729
|
}) {
|
|
728
730
|
const items = [];
|
|
729
731
|
if (showPinnedSection && (pinnedRuns.length > 0 || pinnedCommands.length > 0)) {
|
|
@@ -736,13 +738,15 @@ function buildHomeItems({
|
|
|
736
738
|
});
|
|
737
739
|
items.push(...buildPinnedOnlyItems(pinnedCommands, pinnedRuns));
|
|
738
740
|
}
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
741
|
+
if (showFeatureHeader) {
|
|
742
|
+
items.push({
|
|
743
|
+
id: "section-commands",
|
|
744
|
+
value: "__section_commands__",
|
|
745
|
+
label: `\u{1F4C2} ${activeFeature.label} Commands`,
|
|
746
|
+
kind: "header",
|
|
747
|
+
selectable: false
|
|
748
|
+
});
|
|
749
|
+
}
|
|
746
750
|
const toolOrder = { supabase: 0, vercel: 1, gh: 2, git: 3 };
|
|
747
751
|
const toolIcons = { supabase: "\u{1F7E2}", vercel: "\u26AA", gh: "\u{1F535}", git: "\u{1F7E0}" };
|
|
748
752
|
const grouped = /* @__PURE__ */ new Map();
|
|
@@ -931,7 +935,7 @@ function Home({
|
|
|
931
935
|
|
|
932
936
|
// src/screens/CommandArgs.tsx
|
|
933
937
|
import { useEffect as useEffect4, useMemo as useMemo3, useState as useState6 } from "react";
|
|
934
|
-
import { Box as Box7, Text as Text8 } from "ink";
|
|
938
|
+
import { Box as Box7, Text as Text8, useInput as useInput4 } from "ink";
|
|
935
939
|
|
|
936
940
|
// src/components/TextPrompt.tsx
|
|
937
941
|
import { useState as useState5 } from "react";
|
|
@@ -943,7 +947,11 @@ function TextPrompt({
|
|
|
943
947
|
placeholder,
|
|
944
948
|
onSubmit,
|
|
945
949
|
onCancel,
|
|
946
|
-
validate
|
|
950
|
+
validate,
|
|
951
|
+
arrowNavigation = false,
|
|
952
|
+
isInputActive = true,
|
|
953
|
+
boxed = false,
|
|
954
|
+
focused = true
|
|
947
955
|
}) {
|
|
948
956
|
const [value, setValue] = useState5("");
|
|
949
957
|
const [error, setError] = useState5();
|
|
@@ -951,7 +959,10 @@ function TextPrompt({
|
|
|
951
959
|
if (key.escape && onCancel) {
|
|
952
960
|
onCancel();
|
|
953
961
|
}
|
|
954
|
-
|
|
962
|
+
if (arrowNavigation && key.leftArrow && value === "" && onCancel) {
|
|
963
|
+
onCancel();
|
|
964
|
+
}
|
|
965
|
+
}, { isActive: isInputActive });
|
|
955
966
|
const handleSubmit = (val) => {
|
|
956
967
|
if (validate) {
|
|
957
968
|
const err = validate(val);
|
|
@@ -963,7 +974,7 @@ function TextPrompt({
|
|
|
963
974
|
setError(void 0);
|
|
964
975
|
onSubmit(val);
|
|
965
976
|
};
|
|
966
|
-
|
|
977
|
+
const content = /* @__PURE__ */ jsxs6(Box6, { flexDirection: "column", children: [
|
|
967
978
|
/* @__PURE__ */ jsxs6(Box6, { gap: 1, children: [
|
|
968
979
|
/* @__PURE__ */ jsx6(Text6, { color: inkColors.accent, bold: true, children: "?" }),
|
|
969
980
|
/* @__PURE__ */ jsx6(Text6, { children: label })
|
|
@@ -988,6 +999,10 @@ function TextPrompt({
|
|
|
988
999
|
error
|
|
989
1000
|
] }) })
|
|
990
1001
|
] });
|
|
1002
|
+
if (boxed) {
|
|
1003
|
+
return /* @__PURE__ */ jsx6(Box6, { borderStyle: "round", borderColor: focused ? inkColors.accent : panel.borderDim, paddingX: 1, children: content });
|
|
1004
|
+
}
|
|
1005
|
+
return content;
|
|
991
1006
|
}
|
|
992
1007
|
|
|
993
1008
|
// src/components/ToolBadge.tsx
|
|
@@ -1073,11 +1088,6 @@ function buildCommandArgItems({
|
|
|
1073
1088
|
label: "Custom args...",
|
|
1074
1089
|
hint: "Type any arguments manually",
|
|
1075
1090
|
kind: "action"
|
|
1076
|
-
},
|
|
1077
|
-
{
|
|
1078
|
-
value: "__back__",
|
|
1079
|
-
label: "\u2190 Back to menu",
|
|
1080
|
-
kind: "action"
|
|
1081
1091
|
}
|
|
1082
1092
|
];
|
|
1083
1093
|
}
|
|
@@ -1120,25 +1130,20 @@ function CommandArgs({
|
|
|
1120
1130
|
tool: resolvedTool
|
|
1121
1131
|
});
|
|
1122
1132
|
};
|
|
1133
|
+
useInput4((_input, key) => {
|
|
1134
|
+
if (!command && (key.escape || key.leftArrow)) {
|
|
1135
|
+
onBack();
|
|
1136
|
+
}
|
|
1137
|
+
}, { isActive: isInputActive && !command });
|
|
1123
1138
|
if (!command) {
|
|
1124
1139
|
return /* @__PURE__ */ jsxs7(Box7, { flexDirection: "column", children: [
|
|
1125
|
-
/* @__PURE__ */ jsx8(
|
|
1126
|
-
/* @__PURE__ */ jsx8(
|
|
1127
|
-
SelectList,
|
|
1128
|
-
{
|
|
1129
|
-
items: [{ value: "__back__", label: "\u2190 Back to menu" }],
|
|
1130
|
-
onSelect: onBack,
|
|
1131
|
-
onCancel: onBack,
|
|
1132
|
-
width,
|
|
1133
|
-
isInputActive,
|
|
1134
|
-
arrowNavigation: panelMode
|
|
1135
|
-
}
|
|
1136
|
-
)
|
|
1140
|
+
/* @__PURE__ */ jsx8(Text8, { color: "red", children: "Command not provided." }),
|
|
1141
|
+
/* @__PURE__ */ jsx8(Text8, { dimColor: true, children: "Press Esc or \u2190 to go back" })
|
|
1137
1142
|
] });
|
|
1138
1143
|
}
|
|
1139
1144
|
if (phase === "custom") {
|
|
1140
1145
|
const toolLabel = resolvedTool === "supabase" ? "supabase" : resolvedTool;
|
|
1141
|
-
return /* @__PURE__ */ jsxs7(Box7, { flexDirection: "column", children: [
|
|
1146
|
+
return /* @__PURE__ */ jsxs7(Box7, { flexDirection: "column", paddingX: panelMode ? 1 : 0, children: [
|
|
1142
1147
|
/* @__PURE__ */ jsxs7(Box7, { marginBottom: 1, gap: 1, children: [
|
|
1143
1148
|
/* @__PURE__ */ jsx8(Text8, { color: inkColors.accent, bold: true, children: "Command" }),
|
|
1144
1149
|
/* @__PURE__ */ jsx8(Text8, { children: command }),
|
|
@@ -1159,7 +1164,11 @@ function CommandArgs({
|
|
|
1159
1164
|
return;
|
|
1160
1165
|
}
|
|
1161
1166
|
onBack();
|
|
1162
|
-
}
|
|
1167
|
+
},
|
|
1168
|
+
arrowNavigation: panelMode,
|
|
1169
|
+
isInputActive,
|
|
1170
|
+
boxed: panelMode,
|
|
1171
|
+
focused: isInputActive
|
|
1163
1172
|
}
|
|
1164
1173
|
),
|
|
1165
1174
|
!panelMode && /* @__PURE__ */ jsx8(StatusBar, { hint: "Type args \xB7 Enter to continue \xB7 Esc to go back", width })
|
|
@@ -1179,7 +1188,7 @@ function CommandArgs({
|
|
|
1179
1188
|
}),
|
|
1180
1189
|
[command, legacySuggestions, pinnedRuns]
|
|
1181
1190
|
);
|
|
1182
|
-
return /* @__PURE__ */ jsxs7(Box7, { flexDirection: "column", children: [
|
|
1191
|
+
return /* @__PURE__ */ jsxs7(Box7, { flexDirection: "column", paddingX: panelMode ? 1 : 0, children: [
|
|
1183
1192
|
/* @__PURE__ */ jsxs7(Box7, { marginBottom: 1, gap: 1, children: [
|
|
1184
1193
|
/* @__PURE__ */ jsx8(Text8, { color: inkColors.accent, bold: true, children: "Command" }),
|
|
1185
1194
|
/* @__PURE__ */ jsx8(Text8, { children: command }),
|
|
@@ -1238,9 +1247,10 @@ function CommandArgs({
|
|
|
1238
1247
|
},
|
|
1239
1248
|
onCancel: onBack,
|
|
1240
1249
|
boxedSections: true,
|
|
1241
|
-
width,
|
|
1250
|
+
width: panelMode ? Math.max(20, width - 4) : width,
|
|
1242
1251
|
isInputActive,
|
|
1243
|
-
arrowNavigation: panelMode
|
|
1252
|
+
arrowNavigation: panelMode,
|
|
1253
|
+
panelFocused: isInputActive
|
|
1244
1254
|
}
|
|
1245
1255
|
),
|
|
1246
1256
|
!panelMode && /* @__PURE__ */ jsx8(StatusBar, { hint: "\u2191\u2193 navigate \xB7 Enter select \xB7 p pin \xB7 Esc back", width })
|
|
@@ -1271,7 +1281,7 @@ function CustomCommand({
|
|
|
1271
1281
|
...!panelMode ? [{ value: "__back__", label: "\u2190 Back" }] : []
|
|
1272
1282
|
];
|
|
1273
1283
|
return /* @__PURE__ */ jsxs8(Box8, { flexDirection: "column", paddingX: panelMode ? 1 : 0, children: [
|
|
1274
|
-
/* @__PURE__ */ jsx9(Box8, { marginBottom: 1, children: /* @__PURE__ */ jsx9(Text9, { bold: true, color: inkColors.accent, children: "\u270F\uFE0F Custom Command" }) }),
|
|
1284
|
+
!panelMode && /* @__PURE__ */ jsx9(Box8, { marginBottom: 1, children: /* @__PURE__ */ jsx9(Text9, { bold: true, color: inkColors.accent, children: "\u270F\uFE0F Custom Command" }) }),
|
|
1275
1285
|
!panelMode && /* @__PURE__ */ jsx9(Text9, { dimColor: true, children: "Select tool:" }),
|
|
1276
1286
|
/* @__PURE__ */ jsx9(
|
|
1277
1287
|
SelectList,
|
|
@@ -1290,14 +1300,15 @@ function CustomCommand({
|
|
|
1290
1300
|
width: panelMode ? Math.max(20, width - 4) : width,
|
|
1291
1301
|
maxVisible: panelMode ? Math.max(6, height - 6) : void 0,
|
|
1292
1302
|
isInputActive,
|
|
1293
|
-
arrowNavigation: panelMode
|
|
1303
|
+
arrowNavigation: panelMode,
|
|
1304
|
+
panelFocused: isInputActive
|
|
1294
1305
|
}
|
|
1295
1306
|
),
|
|
1296
1307
|
!panelMode && /* @__PURE__ */ jsx9(StatusBar, { hint: "\u2191\u2193 navigate \xB7 Enter select \xB7 Esc back", width })
|
|
1297
1308
|
] });
|
|
1298
1309
|
}
|
|
1299
1310
|
return /* @__PURE__ */ jsxs8(Box8, { flexDirection: "column", paddingX: panelMode ? 1 : 0, children: [
|
|
1300
|
-
/* @__PURE__ */ jsxs8(Box8, { marginBottom: 1, gap: 1, children: [
|
|
1311
|
+
!panelMode && /* @__PURE__ */ jsxs8(Box8, { marginBottom: 1, gap: 1, children: [
|
|
1301
1312
|
/* @__PURE__ */ jsx9(Text9, { bold: true, color: inkColors.accent, children: "\u270F\uFE0F Custom Command" }),
|
|
1302
1313
|
/* @__PURE__ */ jsxs8(Text9, { dimColor: true, children: [
|
|
1303
1314
|
"(",
|
|
@@ -1318,7 +1329,11 @@ function CustomCommand({
|
|
|
1318
1329
|
const args = value.split(" ").filter(Boolean);
|
|
1319
1330
|
onNavigate("flag-selection", { args, tool: selectedTool });
|
|
1320
1331
|
},
|
|
1321
|
-
onCancel: () => setPhase("tool-select")
|
|
1332
|
+
onCancel: () => setPhase("tool-select"),
|
|
1333
|
+
arrowNavigation: panelMode,
|
|
1334
|
+
isInputActive,
|
|
1335
|
+
boxed: panelMode,
|
|
1336
|
+
focused: isInputActive
|
|
1322
1337
|
}
|
|
1323
1338
|
),
|
|
1324
1339
|
!panelMode && /* @__PURE__ */ jsx9(StatusBar, { hint: "Type a command \xB7 Enter to continue \xB7 Esc to go back", width })
|
|
@@ -1326,11 +1341,11 @@ function CustomCommand({
|
|
|
1326
1341
|
}
|
|
1327
1342
|
|
|
1328
1343
|
// src/screens/FlagSelection.tsx
|
|
1329
|
-
import { Box as Box10 } from "ink";
|
|
1344
|
+
import { Box as Box10, Text as Text11 } from "ink";
|
|
1330
1345
|
|
|
1331
1346
|
// src/components/FlagToggle.tsx
|
|
1332
1347
|
import { useState as useState8 } from "react";
|
|
1333
|
-
import { Box as Box9, Text as Text10, useInput as
|
|
1348
|
+
import { Box as Box9, Text as Text10, useInput as useInput5 } from "ink";
|
|
1334
1349
|
import { jsx as jsx10, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
1335
1350
|
function FlagToggle({
|
|
1336
1351
|
flags,
|
|
@@ -1341,7 +1356,7 @@ function FlagToggle({
|
|
|
1341
1356
|
}) {
|
|
1342
1357
|
const [cursor, setCursor] = useState8(0);
|
|
1343
1358
|
const [selected, setSelected] = useState8(/* @__PURE__ */ new Set());
|
|
1344
|
-
|
|
1359
|
+
useInput5((input2, key) => {
|
|
1345
1360
|
if (key.upArrow || input2 === "k") {
|
|
1346
1361
|
setCursor((prev) => prev > 0 ? prev - 1 : flags.length - 1);
|
|
1347
1362
|
}
|
|
@@ -1360,7 +1375,7 @@ function FlagToggle({
|
|
|
1360
1375
|
return next;
|
|
1361
1376
|
});
|
|
1362
1377
|
}
|
|
1363
|
-
if (key.return) {
|
|
1378
|
+
if (key.return || arrowNavigation && key.rightArrow) {
|
|
1364
1379
|
onSubmit(Array.from(selected));
|
|
1365
1380
|
}
|
|
1366
1381
|
if (key.escape && onCancel) {
|
|
@@ -1373,7 +1388,11 @@ function FlagToggle({
|
|
|
1373
1388
|
return /* @__PURE__ */ jsxs9(Box9, { flexDirection: "column", children: [
|
|
1374
1389
|
/* @__PURE__ */ jsxs9(Box9, { marginBottom: 1, children: [
|
|
1375
1390
|
/* @__PURE__ */ jsx10(Text10, { bold: true, color: inkColors.accent, children: "\u2691 Global Flags" }),
|
|
1376
|
-
/* @__PURE__ */
|
|
1391
|
+
/* @__PURE__ */ jsxs9(Text10, { dimColor: true, children: [
|
|
1392
|
+
" (Space to toggle, ",
|
|
1393
|
+
arrowNavigation ? "\u2192" : "Enter",
|
|
1394
|
+
" to confirm)"
|
|
1395
|
+
] })
|
|
1377
1396
|
] }),
|
|
1378
1397
|
flags.map((flag, i) => {
|
|
1379
1398
|
const isActive = cursor === i;
|
|
@@ -1399,7 +1418,7 @@ function FlagToggle({
|
|
|
1399
1418
|
flag.hint && /* @__PURE__ */ jsx10(Text10, { dimColor: true, children: flag.hint })
|
|
1400
1419
|
] }, flag.value);
|
|
1401
1420
|
}),
|
|
1402
|
-
/* @__PURE__ */ jsx10(Box9, { marginTop: 1, children: /* @__PURE__ */ jsx10(Text10, { dimColor: true, children: selected.size > 0 ? `${selected.size} flag${selected.size > 1 ? "s" : ""} selected` :
|
|
1421
|
+
/* @__PURE__ */ jsx10(Box9, { marginTop: 1, children: /* @__PURE__ */ jsx10(Text10, { dimColor: true, children: selected.size > 0 ? `${selected.size} flag${selected.size > 1 ? "s" : ""} selected` : `No flags selected (${arrowNavigation ? "\u2192" : "Enter"} to skip)` }) })
|
|
1403
1422
|
] });
|
|
1404
1423
|
}
|
|
1405
1424
|
|
|
@@ -1411,6 +1430,7 @@ function FlagSelection({
|
|
|
1411
1430
|
onNavigate,
|
|
1412
1431
|
onBack,
|
|
1413
1432
|
width = 80,
|
|
1433
|
+
height = 24,
|
|
1414
1434
|
panelMode = false,
|
|
1415
1435
|
isInputActive = true
|
|
1416
1436
|
}) {
|
|
@@ -1419,8 +1439,36 @@ function FlagSelection({
|
|
|
1419
1439
|
onNavigate("confirm-execute", { args, tool });
|
|
1420
1440
|
return /* @__PURE__ */ jsx11(Box10, {});
|
|
1421
1441
|
}
|
|
1422
|
-
|
|
1423
|
-
|
|
1442
|
+
const cmdDisplay = `${tool} ${args.join(" ")}`;
|
|
1443
|
+
return /* @__PURE__ */ jsxs10(Box10, { flexDirection: "column", paddingX: panelMode ? 1 : 0, children: [
|
|
1444
|
+
panelMode && /* @__PURE__ */ jsx11(Box10, { marginBottom: 1, gap: 1, children: /* @__PURE__ */ jsxs10(Text11, { color: inkColors.accent, bold: true, children: [
|
|
1445
|
+
"\u25B6",
|
|
1446
|
+
" ",
|
|
1447
|
+
cmdDisplay
|
|
1448
|
+
] }) }),
|
|
1449
|
+
panelMode ? /* @__PURE__ */ jsx11(
|
|
1450
|
+
Box10,
|
|
1451
|
+
{
|
|
1452
|
+
flexDirection: "column",
|
|
1453
|
+
borderStyle: "round",
|
|
1454
|
+
borderColor: isInputActive ? inkColors.accent : panel.borderDim,
|
|
1455
|
+
borderDimColor: true,
|
|
1456
|
+
paddingX: 1,
|
|
1457
|
+
children: /* @__PURE__ */ jsx11(
|
|
1458
|
+
FlagToggle,
|
|
1459
|
+
{
|
|
1460
|
+
flags,
|
|
1461
|
+
onSubmit: (selectedFlags) => {
|
|
1462
|
+
const finalArgs = selectedFlags.length > 0 ? [...args, ...selectedFlags] : args;
|
|
1463
|
+
onNavigate("confirm-execute", { args: finalArgs, tool });
|
|
1464
|
+
},
|
|
1465
|
+
onCancel: onBack,
|
|
1466
|
+
isInputActive,
|
|
1467
|
+
arrowNavigation: panelMode
|
|
1468
|
+
}
|
|
1469
|
+
)
|
|
1470
|
+
}
|
|
1471
|
+
) : /* @__PURE__ */ jsx11(
|
|
1424
1472
|
FlagToggle,
|
|
1425
1473
|
{
|
|
1426
1474
|
flags,
|
|
@@ -1438,26 +1486,26 @@ function FlagSelection({
|
|
|
1438
1486
|
}
|
|
1439
1487
|
|
|
1440
1488
|
// src/screens/CommandExecution.tsx
|
|
1441
|
-
import { useState as
|
|
1442
|
-
import { Box as
|
|
1489
|
+
import { useState as useState11, useEffect as useEffect5 } from "react";
|
|
1490
|
+
import { Box as Box13, Text as Text17 } from "ink";
|
|
1443
1491
|
|
|
1444
1492
|
// src/components/Spinner.tsx
|
|
1445
|
-
import { Text as
|
|
1493
|
+
import { Text as Text12 } from "ink";
|
|
1446
1494
|
import InkSpinner from "ink-spinner";
|
|
1447
1495
|
import { jsx as jsx12, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
1448
1496
|
function Spinner({
|
|
1449
1497
|
label = "Running...",
|
|
1450
1498
|
color = inkColors.accent
|
|
1451
1499
|
}) {
|
|
1452
|
-
return /* @__PURE__ */ jsxs11(
|
|
1453
|
-
/* @__PURE__ */ jsx12(
|
|
1500
|
+
return /* @__PURE__ */ jsxs11(Text12, { children: [
|
|
1501
|
+
/* @__PURE__ */ jsx12(Text12, { color, children: /* @__PURE__ */ jsx12(InkSpinner, { type: "dots" }) }),
|
|
1454
1502
|
" ",
|
|
1455
|
-
/* @__PURE__ */ jsx12(
|
|
1503
|
+
/* @__PURE__ */ jsx12(Text12, { children: label })
|
|
1456
1504
|
] });
|
|
1457
1505
|
}
|
|
1458
1506
|
|
|
1459
1507
|
// src/components/ConfirmPrompt.tsx
|
|
1460
|
-
import { Box as Box11, Text as
|
|
1508
|
+
import { Box as Box11, Text as Text13, useInput as useInput6 } from "ink";
|
|
1461
1509
|
import { jsx as jsx13, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
1462
1510
|
function ConfirmPrompt({
|
|
1463
1511
|
message,
|
|
@@ -1467,7 +1515,7 @@ function ConfirmPrompt({
|
|
|
1467
1515
|
isInputActive = true,
|
|
1468
1516
|
arrowNavigation = false
|
|
1469
1517
|
}) {
|
|
1470
|
-
|
|
1518
|
+
useInput6((input2, key) => {
|
|
1471
1519
|
if (key.escape && onCancel) {
|
|
1472
1520
|
onCancel();
|
|
1473
1521
|
return;
|
|
@@ -1485,14 +1533,14 @@ function ConfirmPrompt({
|
|
|
1485
1533
|
}
|
|
1486
1534
|
}, { isActive: isInputActive });
|
|
1487
1535
|
return /* @__PURE__ */ jsxs12(Box11, { gap: 1, children: [
|
|
1488
|
-
/* @__PURE__ */ jsx13(
|
|
1489
|
-
/* @__PURE__ */ jsx13(
|
|
1490
|
-
/* @__PURE__ */ jsx13(
|
|
1536
|
+
/* @__PURE__ */ jsx13(Text13, { color: inkColors.accent, bold: true, children: "?" }),
|
|
1537
|
+
/* @__PURE__ */ jsx13(Text13, { children: message }),
|
|
1538
|
+
/* @__PURE__ */ jsx13(Text13, { dimColor: true, children: defaultValue ? "(Y/n)" : "(y/N)" })
|
|
1491
1539
|
] });
|
|
1492
1540
|
}
|
|
1493
1541
|
|
|
1494
1542
|
// src/components/Divider.tsx
|
|
1495
|
-
import { Text as
|
|
1543
|
+
import { Text as Text14 } from "ink";
|
|
1496
1544
|
import { jsx as jsx14, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
1497
1545
|
function Divider({
|
|
1498
1546
|
label,
|
|
@@ -1504,7 +1552,7 @@ function Divider({
|
|
|
1504
1552
|
const sideLen = Math.max(2, Math.floor((effectiveWidth - labelLen) / 2));
|
|
1505
1553
|
const left = "\u2500".repeat(sideLen);
|
|
1506
1554
|
const right = "\u2500".repeat(sideLen);
|
|
1507
|
-
return /* @__PURE__ */ jsxs13(
|
|
1555
|
+
return /* @__PURE__ */ jsxs13(Text14, { dimColor: true, children: [
|
|
1508
1556
|
left,
|
|
1509
1557
|
" ",
|
|
1510
1558
|
label,
|
|
@@ -1512,14 +1560,82 @@ function Divider({
|
|
|
1512
1560
|
right
|
|
1513
1561
|
] });
|
|
1514
1562
|
}
|
|
1515
|
-
return /* @__PURE__ */ jsx14(
|
|
1563
|
+
return /* @__PURE__ */ jsx14(Text14, { dimColor: true, children: "\u2500".repeat(effectiveWidth) });
|
|
1564
|
+
}
|
|
1565
|
+
|
|
1566
|
+
// src/components/CommandOutput.tsx
|
|
1567
|
+
import { Text as Text16 } from "ink";
|
|
1568
|
+
|
|
1569
|
+
// src/components/ScrollableBox.tsx
|
|
1570
|
+
import { useState as useState9 } from "react";
|
|
1571
|
+
import { Box as Box12, Text as Text15, useInput as useInput7 } from "ink";
|
|
1572
|
+
import { jsx as jsx15, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
1573
|
+
function ScrollableBox({
|
|
1574
|
+
height,
|
|
1575
|
+
isActive = true,
|
|
1576
|
+
children
|
|
1577
|
+
}) {
|
|
1578
|
+
const totalItems = children.length;
|
|
1579
|
+
const [scrollOffset, setScrollOffset] = useState9(0);
|
|
1580
|
+
const visibleCount = Math.max(1, height - 2);
|
|
1581
|
+
useInput7(
|
|
1582
|
+
(input2, key) => {
|
|
1583
|
+
if (key.upArrow || input2 === "k") {
|
|
1584
|
+
setScrollOffset((prev) => Math.max(0, prev - 1));
|
|
1585
|
+
}
|
|
1586
|
+
if (key.downArrow || input2 === "j") {
|
|
1587
|
+
setScrollOffset((prev) => Math.min(Math.max(0, totalItems - visibleCount), prev + 1));
|
|
1588
|
+
}
|
|
1589
|
+
},
|
|
1590
|
+
{ isActive }
|
|
1591
|
+
);
|
|
1592
|
+
const showScrollUp = scrollOffset > 0;
|
|
1593
|
+
const showScrollDown = scrollOffset + visibleCount < totalItems;
|
|
1594
|
+
const visible = children.slice(scrollOffset, scrollOffset + visibleCount);
|
|
1595
|
+
return /* @__PURE__ */ jsxs14(Box12, { flexDirection: "column", height, children: [
|
|
1596
|
+
showScrollUp && /* @__PURE__ */ jsx15(Text15, { dimColor: true, children: " \u2191 more" }),
|
|
1597
|
+
visible,
|
|
1598
|
+
showScrollDown && /* @__PURE__ */ jsx15(Text15, { dimColor: true, children: " \u2193 more" })
|
|
1599
|
+
] });
|
|
1600
|
+
}
|
|
1601
|
+
|
|
1602
|
+
// src/lib/ansi.ts
|
|
1603
|
+
var ANSI_RE = (
|
|
1604
|
+
// biome-ignore lint/suspicious/noControlCharactersInRegex: intentional ANSI stripping
|
|
1605
|
+
/[\u001B\u009B][[\]()#;?]*(?:(?:(?:[a-zA-Z\d]*(?:;[-a-zA-Z\d/#&.:=?%@~_]*)*)?\u0007)|(?:(?:\d{1,4}(?:;\d{0,4})*)?[\dA-PR-TZcf-nq-uy=><~]))/g
|
|
1606
|
+
);
|
|
1607
|
+
function stripAnsi(text) {
|
|
1608
|
+
return text.replace(ANSI_RE, "");
|
|
1609
|
+
}
|
|
1610
|
+
|
|
1611
|
+
// src/components/CommandOutput.tsx
|
|
1612
|
+
import { jsx as jsx16 } from "react/jsx-runtime";
|
|
1613
|
+
function cleanLines(raw) {
|
|
1614
|
+
const stripped = stripAnsi(raw);
|
|
1615
|
+
return stripped.replace(/\r/g, "").split("\n").filter((line) => line.length > 0);
|
|
1616
|
+
}
|
|
1617
|
+
function CommandOutput({
|
|
1618
|
+
stdout,
|
|
1619
|
+
stderr,
|
|
1620
|
+
height,
|
|
1621
|
+
isActive = false
|
|
1622
|
+
}) {
|
|
1623
|
+
const outLines = stdout ? cleanLines(stdout) : [];
|
|
1624
|
+
const errLines = stderr ? cleanLines(stderr) : [];
|
|
1625
|
+
if (outLines.length === 0 && errLines.length === 0) {
|
|
1626
|
+
return null;
|
|
1627
|
+
}
|
|
1628
|
+
return /* @__PURE__ */ jsx16(ScrollableBox, { height: Math.max(3, height), isActive, children: [
|
|
1629
|
+
...outLines.map((line, i) => /* @__PURE__ */ jsx16(Text16, { children: line }, `o-${i}`)),
|
|
1630
|
+
...errLines.map((line, i) => /* @__PURE__ */ jsx16(Text16, { color: "red", children: line }, `e-${i}`))
|
|
1631
|
+
] });
|
|
1516
1632
|
}
|
|
1517
1633
|
|
|
1518
1634
|
// src/hooks/useCommand.ts
|
|
1519
|
-
import { useState as
|
|
1520
|
-
function useCommand(execution = "supabase", cwd = process.cwd()) {
|
|
1521
|
-
const [status, setStatus] =
|
|
1522
|
-
const [result, setResult] =
|
|
1635
|
+
import { useState as useState10, useCallback as useCallback2 } from "react";
|
|
1636
|
+
function useCommand(execution = "supabase", cwd = process.cwd(), options) {
|
|
1637
|
+
const [status, setStatus] = useState10("idle");
|
|
1638
|
+
const [result, setResult] = useState10(null);
|
|
1523
1639
|
const run = useCallback2(async (args) => {
|
|
1524
1640
|
setStatus("running");
|
|
1525
1641
|
setResult(null);
|
|
@@ -1535,7 +1651,8 @@ function useCommand(execution = "supabase", cwd = process.cwd()) {
|
|
|
1535
1651
|
} else {
|
|
1536
1652
|
resolvedExecution = execution;
|
|
1537
1653
|
}
|
|
1538
|
-
const
|
|
1654
|
+
const runOpts = options?.quiet ? { quiet: true } : void 0;
|
|
1655
|
+
const res = await runCommand(resolvedExecution, args, cwd, runOpts);
|
|
1539
1656
|
setResult(res);
|
|
1540
1657
|
if (res.spawnError || res.exitCode !== null && res.exitCode !== 0) {
|
|
1541
1658
|
setStatus("error");
|
|
@@ -1543,7 +1660,7 @@ function useCommand(execution = "supabase", cwd = process.cwd()) {
|
|
|
1543
1660
|
setStatus("success");
|
|
1544
1661
|
}
|
|
1545
1662
|
return res;
|
|
1546
|
-
}, [cwd, execution]);
|
|
1663
|
+
}, [cwd, execution, options?.quiet]);
|
|
1547
1664
|
const reset = useCallback2(() => {
|
|
1548
1665
|
setStatus("idle");
|
|
1549
1666
|
setResult(null);
|
|
@@ -1564,22 +1681,71 @@ async function copyToClipboard(text) {
|
|
|
1564
1681
|
});
|
|
1565
1682
|
}
|
|
1566
1683
|
|
|
1684
|
+
// src/lib/errorSuggestions.ts
|
|
1685
|
+
var KNOWN_TOOLS = ["supabase", "gh", "vercel", "git"];
|
|
1686
|
+
var BACKTICK_CMD = /(?:try\s+)?(?:run(?:ning)?|use|execute)\s+`([^`]+)`/gi;
|
|
1687
|
+
var HAVE_YOU_RUN = /have you (?:run|tried|used)\s+((?:supabase|gh|vercel|git)\s+[\w][\w -]*\w)\??/gi;
|
|
1688
|
+
var DID_YOU_MEAN = /did you mean[:\s]+[`']?([a-z][\w -]*\w)[`']?\??/gi;
|
|
1689
|
+
var INDENTED_TOOL_CMD = /^\s{2,}((?:supabase|gh|vercel|git)\s+[\w][\w -]*\w)$/gm;
|
|
1690
|
+
var ARROW_BULLET = /[→•\-*]\s*(?:run:?\s*)?((?:supabase|gh|vercel|git)\s+[\w][\w -]*\w)/gim;
|
|
1691
|
+
var MAX_SUGGESTIONS = 3;
|
|
1692
|
+
function detectTool(rawCommand, fallback) {
|
|
1693
|
+
const first = rawCommand.trim().split(/\s+/)[0]?.toLowerCase();
|
|
1694
|
+
const match = KNOWN_TOOLS.find((t) => t === first);
|
|
1695
|
+
return match ?? fallback;
|
|
1696
|
+
}
|
|
1697
|
+
function parseRawCommand(raw, currentTool) {
|
|
1698
|
+
const trimmed = raw.trim();
|
|
1699
|
+
const tool = detectTool(trimmed, currentTool);
|
|
1700
|
+
const parts = trimmed.split(/\s+/);
|
|
1701
|
+
const args = parts[0]?.toLowerCase() === tool ? parts.slice(1) : parts;
|
|
1702
|
+
const display = `${tool} ${args.join(" ")}`;
|
|
1703
|
+
return { tool, args, display };
|
|
1704
|
+
}
|
|
1705
|
+
function parseErrorSuggestions(stdout, stderr, currentTool) {
|
|
1706
|
+
const combined = stripAnsi(`${stdout}
|
|
1707
|
+
${stderr}`);
|
|
1708
|
+
const seen = /* @__PURE__ */ new Set();
|
|
1709
|
+
const suggestions = [];
|
|
1710
|
+
const patterns = [BACKTICK_CMD, HAVE_YOU_RUN, DID_YOU_MEAN, INDENTED_TOOL_CMD, ARROW_BULLET];
|
|
1711
|
+
for (const pattern of patterns) {
|
|
1712
|
+
pattern.lastIndex = 0;
|
|
1713
|
+
let match;
|
|
1714
|
+
while ((match = pattern.exec(combined)) !== null) {
|
|
1715
|
+
const raw = match[1];
|
|
1716
|
+
const suggestion = parseRawCommand(raw, currentTool);
|
|
1717
|
+
const key = suggestion.display;
|
|
1718
|
+
if (!seen.has(key)) {
|
|
1719
|
+
seen.add(key);
|
|
1720
|
+
suggestions.push(suggestion);
|
|
1721
|
+
}
|
|
1722
|
+
if (suggestions.length >= MAX_SUGGESTIONS) break;
|
|
1723
|
+
}
|
|
1724
|
+
if (suggestions.length >= MAX_SUGGESTIONS) break;
|
|
1725
|
+
}
|
|
1726
|
+
return suggestions;
|
|
1727
|
+
}
|
|
1728
|
+
|
|
1567
1729
|
// src/screens/CommandExecution.tsx
|
|
1568
|
-
import { jsx as
|
|
1730
|
+
import { jsx as jsx17, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
1569
1731
|
function CommandExecution({
|
|
1570
1732
|
args: initialArgs,
|
|
1571
1733
|
tool = "supabase",
|
|
1572
1734
|
onBack,
|
|
1735
|
+
onHome,
|
|
1573
1736
|
onExit,
|
|
1737
|
+
onRunSuggestion,
|
|
1574
1738
|
width = 80,
|
|
1575
1739
|
height = 24,
|
|
1576
1740
|
panelMode = false,
|
|
1577
1741
|
isInputActive = true
|
|
1578
1742
|
}) {
|
|
1579
|
-
const [phase, setPhase] =
|
|
1580
|
-
const [currentArgs, setCurrentArgs] =
|
|
1581
|
-
const [pinMessage, setPinMessage] =
|
|
1582
|
-
const { status, result, run, reset } = useCommand(tool)
|
|
1743
|
+
const [phase, setPhase] = useState11("confirm");
|
|
1744
|
+
const [currentArgs, setCurrentArgs] = useState11(initialArgs);
|
|
1745
|
+
const [pinMessage, setPinMessage] = useState11();
|
|
1746
|
+
const { status, result, run, reset } = useCommand(tool, process.cwd(), {
|
|
1747
|
+
quiet: panelMode
|
|
1748
|
+
});
|
|
1583
1749
|
const cmdDisplay = `${tool} ${currentArgs.join(" ")}`;
|
|
1584
1750
|
const runCommand2 = currentArgs.join(" ");
|
|
1585
1751
|
useEffect5(() => {
|
|
@@ -1600,45 +1766,67 @@ function CommandExecution({
|
|
|
1600
1766
|
}
|
|
1601
1767
|
}, [phase, runCommand2, status]);
|
|
1602
1768
|
if (phase === "confirm") {
|
|
1603
|
-
|
|
1604
|
-
|
|
1769
|
+
const confirmContent = /* @__PURE__ */ jsxs15(Box13, { flexDirection: "column", children: [
|
|
1770
|
+
/* @__PURE__ */ jsxs15(Box13, { marginBottom: 1, gap: 1, children: [
|
|
1771
|
+
/* @__PURE__ */ jsxs15(Text17, { color: inkColors.accent, bold: true, children: [
|
|
1772
|
+
"\u25B6",
|
|
1773
|
+
" ",
|
|
1774
|
+
cmdDisplay
|
|
1775
|
+
] }),
|
|
1776
|
+
/* @__PURE__ */ jsx17(ToolBadge, { tool })
|
|
1777
|
+
] }),
|
|
1778
|
+
/* @__PURE__ */ jsx17(
|
|
1779
|
+
ConfirmPrompt,
|
|
1780
|
+
{
|
|
1781
|
+
message: `Execute ${cmdDisplay}?`,
|
|
1782
|
+
defaultValue: true,
|
|
1783
|
+
onConfirm: (confirmed) => {
|
|
1784
|
+
if (confirmed) {
|
|
1785
|
+
setPhase("running");
|
|
1786
|
+
} else {
|
|
1787
|
+
onBack();
|
|
1788
|
+
}
|
|
1789
|
+
},
|
|
1790
|
+
onCancel: onBack,
|
|
1791
|
+
isInputActive,
|
|
1792
|
+
arrowNavigation: panelMode
|
|
1793
|
+
}
|
|
1794
|
+
),
|
|
1795
|
+
/* @__PURE__ */ jsx17(Box13, { marginTop: 1, children: /* @__PURE__ */ jsx17(Text17, { dimColor: true, children: "Enter to execute \xB7 n to cancel" }) })
|
|
1796
|
+
] });
|
|
1797
|
+
return /* @__PURE__ */ jsx17(Box13, { flexDirection: "column", paddingX: panelMode ? 1 : 0, children: panelMode ? /* @__PURE__ */ jsx17(
|
|
1798
|
+
Box13,
|
|
1605
1799
|
{
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
onBack();
|
|
1613
|
-
}
|
|
1614
|
-
},
|
|
1615
|
-
onCancel: onBack,
|
|
1616
|
-
isInputActive,
|
|
1617
|
-
arrowNavigation: panelMode
|
|
1800
|
+
flexDirection: "column",
|
|
1801
|
+
borderStyle: "round",
|
|
1802
|
+
borderColor: isInputActive ? inkColors.accent : panel.borderDim,
|
|
1803
|
+
borderDimColor: true,
|
|
1804
|
+
paddingX: 1,
|
|
1805
|
+
children: confirmContent
|
|
1618
1806
|
}
|
|
1619
|
-
) });
|
|
1807
|
+
) : confirmContent });
|
|
1620
1808
|
}
|
|
1621
1809
|
if (phase === "running") {
|
|
1622
|
-
return /* @__PURE__ */
|
|
1623
|
-
/* @__PURE__ */
|
|
1624
|
-
/* @__PURE__ */
|
|
1625
|
-
/* @__PURE__ */
|
|
1626
|
-
/* @__PURE__ */
|
|
1627
|
-
/* @__PURE__ */
|
|
1628
|
-
/* @__PURE__ */
|
|
1810
|
+
return /* @__PURE__ */ jsxs15(Box13, { flexDirection: "column", paddingX: panelMode ? 1 : 0, children: [
|
|
1811
|
+
/* @__PURE__ */ jsx17(Divider, { width: panelMode ? width - 4 : width }),
|
|
1812
|
+
/* @__PURE__ */ jsxs15(Box13, { marginY: 1, gap: 1, children: [
|
|
1813
|
+
/* @__PURE__ */ jsx17(Text17, { color: inkColors.accent, bold: true, children: "\u25B6" }),
|
|
1814
|
+
/* @__PURE__ */ jsx17(Text17, { dimColor: true, children: "Running:" }),
|
|
1815
|
+
/* @__PURE__ */ jsx17(Text17, { children: cmdDisplay }),
|
|
1816
|
+
/* @__PURE__ */ jsx17(ToolBadge, { tool })
|
|
1629
1817
|
] }),
|
|
1630
|
-
/* @__PURE__ */
|
|
1631
|
-
/* @__PURE__ */
|
|
1818
|
+
/* @__PURE__ */ jsx17(Divider, { width: panelMode ? width - 4 : width }),
|
|
1819
|
+
/* @__PURE__ */ jsx17(Box13, { marginTop: 1, children: /* @__PURE__ */ jsx17(Spinner, { label: `Executing ${cmdDisplay}...` }) })
|
|
1632
1820
|
] });
|
|
1633
1821
|
}
|
|
1634
1822
|
if (phase === "success-pin-offer") {
|
|
1635
|
-
return /* @__PURE__ */
|
|
1636
|
-
/* @__PURE__ */
|
|
1637
|
-
/* @__PURE__ */
|
|
1638
|
-
/* @__PURE__ */
|
|
1639
|
-
/* @__PURE__ */
|
|
1823
|
+
return /* @__PURE__ */ jsxs15(Box13, { flexDirection: "column", paddingX: panelMode ? 1 : 0, children: [
|
|
1824
|
+
/* @__PURE__ */ jsx17(Divider, { width: panelMode ? width - 4 : width }),
|
|
1825
|
+
/* @__PURE__ */ jsxs15(Box13, { marginY: 1, gap: 1, children: [
|
|
1826
|
+
/* @__PURE__ */ jsx17(Text17, { color: inkColors.accent, bold: true, children: "\u2713" }),
|
|
1827
|
+
/* @__PURE__ */ jsx17(Text17, { color: inkColors.accent, bold: true, children: "Command completed successfully!" })
|
|
1640
1828
|
] }),
|
|
1641
|
-
/* @__PURE__ */
|
|
1829
|
+
/* @__PURE__ */ jsx17(
|
|
1642
1830
|
ConfirmPrompt,
|
|
1643
1831
|
{
|
|
1644
1832
|
message: "Pin this exact command?",
|
|
@@ -1658,31 +1846,66 @@ function CommandExecution({
|
|
|
1658
1846
|
] });
|
|
1659
1847
|
}
|
|
1660
1848
|
if (phase === "success") {
|
|
1661
|
-
const successItems =
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1849
|
+
const successItems = [
|
|
1850
|
+
{ value: "__back__", label: "\u2190 Back to menu" }
|
|
1851
|
+
];
|
|
1852
|
+
const outputHeight = Math.max(3, height - 12);
|
|
1853
|
+
return /* @__PURE__ */ jsxs15(Box13, { flexDirection: "column", paddingX: panelMode ? 1 : 0, children: [
|
|
1854
|
+
/* @__PURE__ */ jsx17(Divider, { width: panelMode ? width - 4 : width }),
|
|
1855
|
+
/* @__PURE__ */ jsxs15(Box13, { marginY: 1, gap: 1, children: [
|
|
1856
|
+
/* @__PURE__ */ jsx17(Text17, { color: inkColors.accent, bold: true, children: "\u2713" }),
|
|
1857
|
+
/* @__PURE__ */ jsx17(Text17, { color: inkColors.accent, bold: true, children: "Command completed successfully!" })
|
|
1667
1858
|
] }),
|
|
1668
|
-
pinMessage && /* @__PURE__ */
|
|
1669
|
-
|
|
1859
|
+
pinMessage && /* @__PURE__ */ jsx17(Box13, { marginBottom: 1, children: /* @__PURE__ */ jsx17(Text17, { color: inkColors.accent, children: pinMessage }) }),
|
|
1860
|
+
/* @__PURE__ */ jsx17(
|
|
1861
|
+
CommandOutput,
|
|
1862
|
+
{
|
|
1863
|
+
stdout: result?.stdout,
|
|
1864
|
+
stderr: result?.stderr,
|
|
1865
|
+
height: outputHeight,
|
|
1866
|
+
isActive: isInputActive
|
|
1867
|
+
}
|
|
1868
|
+
),
|
|
1869
|
+
/* @__PURE__ */ jsx17(
|
|
1670
1870
|
SelectList,
|
|
1671
1871
|
{
|
|
1672
1872
|
items: successItems,
|
|
1673
|
-
onSelect: onBack,
|
|
1674
|
-
onCancel: onBack,
|
|
1873
|
+
onSelect: onHome ?? onBack,
|
|
1874
|
+
onCancel: onHome ?? onBack,
|
|
1675
1875
|
width: panelMode ? Math.max(20, width - 4) : width,
|
|
1676
1876
|
maxVisible: panelMode ? Math.max(6, height - 6) : void 0,
|
|
1677
1877
|
isInputActive,
|
|
1678
1878
|
arrowNavigation: panelMode,
|
|
1679
|
-
boxedSections: panelMode
|
|
1879
|
+
boxedSections: panelMode,
|
|
1880
|
+
panelFocused: isInputActive
|
|
1680
1881
|
}
|
|
1681
1882
|
)
|
|
1682
1883
|
] });
|
|
1683
1884
|
}
|
|
1684
1885
|
const hasDebug = currentArgs.includes("--debug");
|
|
1886
|
+
const suggestions = result ? parseErrorSuggestions(result.stdout, result.stderr, tool) : [];
|
|
1685
1887
|
const errorItems = [];
|
|
1888
|
+
if (suggestions.length > 0) {
|
|
1889
|
+
errorItems.push({
|
|
1890
|
+
value: "__suggestions_header__",
|
|
1891
|
+
label: "\u{1F4A1} Suggested fixes",
|
|
1892
|
+
kind: "header"
|
|
1893
|
+
});
|
|
1894
|
+
for (const s of suggestions) {
|
|
1895
|
+
errorItems.push({
|
|
1896
|
+
value: `suggest:${s.display}`,
|
|
1897
|
+
label: s.display,
|
|
1898
|
+
hint: "from error output"
|
|
1899
|
+
});
|
|
1900
|
+
}
|
|
1901
|
+
}
|
|
1902
|
+
if (suggestions.length > 0) {
|
|
1903
|
+
errorItems.push({
|
|
1904
|
+
value: "__actions_header__",
|
|
1905
|
+
label: "",
|
|
1906
|
+
kind: "header"
|
|
1907
|
+
});
|
|
1908
|
+
}
|
|
1686
1909
|
if (!result?.spawnError) {
|
|
1687
1910
|
errorItems.push({ value: "retry", label: "\u{1F504} Retry the same command" });
|
|
1688
1911
|
if (!hasDebug) {
|
|
@@ -1697,50 +1920,78 @@ function CommandExecution({
|
|
|
1697
1920
|
value: "copy",
|
|
1698
1921
|
label: "\u{1F4CB} Copy command to clipboard"
|
|
1699
1922
|
});
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
return /* @__PURE__ */
|
|
1705
|
-
/* @__PURE__ */
|
|
1706
|
-
result?.spawnError ? /* @__PURE__ */
|
|
1707
|
-
/* @__PURE__ */
|
|
1708
|
-
/* @__PURE__ */
|
|
1709
|
-
/* @__PURE__ */
|
|
1923
|
+
errorItems.push({
|
|
1924
|
+
value: "menu",
|
|
1925
|
+
label: "\u2190 Back to menu"
|
|
1926
|
+
});
|
|
1927
|
+
return /* @__PURE__ */ jsxs15(Box13, { flexDirection: "column", paddingX: panelMode ? 1 : 0, children: [
|
|
1928
|
+
/* @__PURE__ */ jsx17(Divider, { width: panelMode ? width - 4 : width }),
|
|
1929
|
+
result?.spawnError ? /* @__PURE__ */ jsxs15(Box13, { flexDirection: "column", marginY: 1, children: [
|
|
1930
|
+
/* @__PURE__ */ jsxs15(Box13, { gap: 1, children: [
|
|
1931
|
+
/* @__PURE__ */ jsx17(Text17, { color: "red", bold: true, children: "\u2717" }),
|
|
1932
|
+
/* @__PURE__ */ jsx17(Text17, { color: "red", bold: true, children: "Failed to start command" })
|
|
1710
1933
|
] }),
|
|
1711
|
-
/* @__PURE__ */
|
|
1712
|
-
/* @__PURE__ */
|
|
1713
|
-
/* @__PURE__ */
|
|
1934
|
+
/* @__PURE__ */ jsxs15(Box13, { marginLeft: 2, marginTop: 1, children: [
|
|
1935
|
+
/* @__PURE__ */ jsx17(Text17, { dimColor: true, children: "Error: " }),
|
|
1936
|
+
/* @__PURE__ */ jsx17(Text17, { color: "red", children: result.spawnError })
|
|
1714
1937
|
] }),
|
|
1715
|
-
(result.spawnError.includes("ENOENT") || result.spawnError.includes("not found")) && /* @__PURE__ */
|
|
1716
|
-
"\u{1F4A1}
|
|
1938
|
+
(result.spawnError.includes("ENOENT") || result.spawnError.includes("not found")) && /* @__PURE__ */ jsx17(Box13, { flexDirection: "column", marginLeft: 2, marginTop: 1, children: /* @__PURE__ */ jsxs15(Text17, { color: inkColors.accent, bold: true, children: [
|
|
1939
|
+
"\u{1F4A1}",
|
|
1940
|
+
" ",
|
|
1717
1941
|
tool,
|
|
1718
1942
|
" CLI not found in this repository or PATH"
|
|
1719
1943
|
] }) })
|
|
1720
|
-
] }) : /* @__PURE__ */
|
|
1721
|
-
/* @__PURE__ */
|
|
1722
|
-
/* @__PURE__ */
|
|
1723
|
-
/* @__PURE__ */
|
|
1724
|
-
/* @__PURE__ */
|
|
1725
|
-
/* @__PURE__ */
|
|
1726
|
-
/* @__PURE__ */
|
|
1944
|
+
] }) : /* @__PURE__ */ jsxs15(Box13, { flexDirection: "column", marginY: 1, children: [
|
|
1945
|
+
/* @__PURE__ */ jsxs15(Box13, { gap: 1, children: [
|
|
1946
|
+
/* @__PURE__ */ jsx17(Text17, { color: "red", bold: true, children: "\u2717" }),
|
|
1947
|
+
/* @__PURE__ */ jsx17(Text17, { color: "red", children: "Command failed " }),
|
|
1948
|
+
/* @__PURE__ */ jsx17(Text17, { dimColor: true, children: "(exit code " }),
|
|
1949
|
+
/* @__PURE__ */ jsx17(Text17, { color: "red", bold: true, children: String(result?.exitCode) }),
|
|
1950
|
+
/* @__PURE__ */ jsx17(Text17, { dimColor: true, children: ")" })
|
|
1727
1951
|
] }),
|
|
1728
|
-
/* @__PURE__ */
|
|
1729
|
-
/* @__PURE__ */
|
|
1730
|
-
/* @__PURE__ */
|
|
1952
|
+
/* @__PURE__ */ jsxs15(Box13, { marginLeft: 2, marginTop: 1, children: [
|
|
1953
|
+
/* @__PURE__ */ jsx17(Text17, { dimColor: true, children: "Command: " }),
|
|
1954
|
+
/* @__PURE__ */ jsx17(Text17, { children: cmdDisplay })
|
|
1731
1955
|
] }),
|
|
1732
|
-
!hasDebug && /* @__PURE__ */
|
|
1733
|
-
/* @__PURE__ */
|
|
1734
|
-
|
|
1735
|
-
|
|
1956
|
+
!hasDebug && /* @__PURE__ */ jsxs15(Box13, { marginLeft: 2, marginTop: 1, gap: 1, children: [
|
|
1957
|
+
/* @__PURE__ */ jsxs15(Text17, { dimColor: true, children: [
|
|
1958
|
+
"\u{1F4A1}",
|
|
1959
|
+
" Tip: retry with"
|
|
1960
|
+
] }),
|
|
1961
|
+
/* @__PURE__ */ jsx17(Text17, { color: inkColors.accent, children: "--debug" }),
|
|
1962
|
+
/* @__PURE__ */ jsx17(Text17, { dimColor: true, children: "to see detailed logs" })
|
|
1736
1963
|
] })
|
|
1737
1964
|
] }),
|
|
1738
|
-
/* @__PURE__ */
|
|
1739
|
-
|
|
1965
|
+
/* @__PURE__ */ jsx17(
|
|
1966
|
+
CommandOutput,
|
|
1967
|
+
{
|
|
1968
|
+
stdout: result?.stdout,
|
|
1969
|
+
stderr: result?.stderr,
|
|
1970
|
+
height: Math.max(3, height - 16 - (suggestions.length > 0 ? suggestions.length + 4 : 0)),
|
|
1971
|
+
isActive: false
|
|
1972
|
+
}
|
|
1973
|
+
),
|
|
1974
|
+
/* @__PURE__ */ jsx17(Box13, { marginTop: 1, marginBottom: 1, children: /* @__PURE__ */ jsx17(Text17, { bold: true, children: "What would you like to do?" }) }),
|
|
1975
|
+
/* @__PURE__ */ jsx17(
|
|
1740
1976
|
SelectList,
|
|
1741
1977
|
{
|
|
1742
1978
|
items: errorItems,
|
|
1743
1979
|
onSelect: async (action) => {
|
|
1980
|
+
if (action.startsWith("suggest:")) {
|
|
1981
|
+
const rawCmd = action.slice("suggest:".length);
|
|
1982
|
+
const parts = rawCmd.split(/\s+/);
|
|
1983
|
+
const sugTool = parts[0];
|
|
1984
|
+
const sugArgs = parts.slice(1);
|
|
1985
|
+
if (onRunSuggestion) {
|
|
1986
|
+
onRunSuggestion(sugTool, sugArgs);
|
|
1987
|
+
} else {
|
|
1988
|
+
setCurrentArgs(sugArgs);
|
|
1989
|
+
setPinMessage(void 0);
|
|
1990
|
+
reset();
|
|
1991
|
+
setPhase("confirm");
|
|
1992
|
+
}
|
|
1993
|
+
return;
|
|
1994
|
+
}
|
|
1744
1995
|
switch (action) {
|
|
1745
1996
|
case "retry":
|
|
1746
1997
|
setPinMessage(void 0);
|
|
@@ -1759,7 +2010,7 @@ function CommandExecution({
|
|
|
1759
2010
|
await copyToClipboard(cmdDisplay);
|
|
1760
2011
|
break;
|
|
1761
2012
|
case "menu":
|
|
1762
|
-
onBack();
|
|
2013
|
+
(onHome ?? onBack)();
|
|
1763
2014
|
break;
|
|
1764
2015
|
case "exit":
|
|
1765
2016
|
onExit();
|
|
@@ -1769,19 +2020,20 @@ function CommandExecution({
|
|
|
1769
2020
|
onCancel: onBack,
|
|
1770
2021
|
boxedSections: panelMode,
|
|
1771
2022
|
width: panelMode ? Math.max(20, width - 4) : width,
|
|
1772
|
-
maxVisible: panelMode ? Math.max(
|
|
2023
|
+
maxVisible: panelMode ? Math.max(errorItems.length + (suggestions.length > 0 ? 4 : 0), height - 6) : void 0,
|
|
1773
2024
|
isInputActive,
|
|
1774
|
-
arrowNavigation: panelMode
|
|
2025
|
+
arrowNavigation: panelMode,
|
|
2026
|
+
panelFocused: isInputActive
|
|
1775
2027
|
}
|
|
1776
2028
|
),
|
|
1777
|
-
!panelMode && /* @__PURE__ */
|
|
2029
|
+
!panelMode && /* @__PURE__ */ jsx17(StatusBar, { width })
|
|
1778
2030
|
] });
|
|
1779
2031
|
}
|
|
1780
2032
|
|
|
1781
2033
|
// src/screens/SelfUpdate.tsx
|
|
1782
|
-
import { useEffect as useEffect6, useState as
|
|
1783
|
-
import { Box as
|
|
1784
|
-
import { jsx as
|
|
2034
|
+
import { useEffect as useEffect6, useState as useState12 } from "react";
|
|
2035
|
+
import { Box as Box14, Text as Text18 } from "ink";
|
|
2036
|
+
import { jsx as jsx18, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
1785
2037
|
var packageName = "@polterware/polter";
|
|
1786
2038
|
var globalUpdateArgs = ["install", "-g", `${packageName}@latest`];
|
|
1787
2039
|
var repositoryUpdateArgs = ["install", "-D", `${packageName}@latest`];
|
|
@@ -1797,16 +2049,18 @@ function SelfUpdate({
|
|
|
1797
2049
|
isInputActive = true
|
|
1798
2050
|
}) {
|
|
1799
2051
|
const repositoryRoot = findNearestPackageRoot();
|
|
1800
|
-
const [target, setTarget] =
|
|
2052
|
+
const [target, setTarget] = useState12(
|
|
1801
2053
|
repositoryRoot ? "repository" : "global"
|
|
1802
2054
|
);
|
|
1803
|
-
const [phase, setPhase] =
|
|
2055
|
+
const [phase, setPhase] = useState12(
|
|
1804
2056
|
repositoryRoot ? "target" : "confirm"
|
|
1805
2057
|
);
|
|
1806
2058
|
const updateArgs = getUpdateArgs(target);
|
|
1807
2059
|
const updateDisplay = `npm ${updateArgs.join(" ")}`;
|
|
1808
2060
|
const updateCwd = target === "repository" && repositoryRoot ? repositoryRoot : process.cwd();
|
|
1809
|
-
const { status, result, run, reset } = useCommand("npm", updateCwd
|
|
2061
|
+
const { status, result, run, reset } = useCommand("npm", updateCwd, {
|
|
2062
|
+
quiet: panelMode
|
|
2063
|
+
});
|
|
1810
2064
|
useEffect6(() => {
|
|
1811
2065
|
if (phase === "running" && status === "idle") {
|
|
1812
2066
|
run(updateArgs);
|
|
@@ -1837,9 +2091,9 @@ function SelfUpdate({
|
|
|
1837
2091
|
},
|
|
1838
2092
|
...!panelMode ? [{ value: "back", label: "\u2190 Back to menu" }] : []
|
|
1839
2093
|
];
|
|
1840
|
-
return /* @__PURE__ */
|
|
1841
|
-
/* @__PURE__ */
|
|
1842
|
-
/* @__PURE__ */
|
|
2094
|
+
return /* @__PURE__ */ jsxs16(Box14, { flexDirection: "column", paddingX: panelMode ? 1 : 0, children: [
|
|
2095
|
+
/* @__PURE__ */ jsx18(Box14, { marginBottom: 1, children: /* @__PURE__ */ jsx18(Text18, { bold: true, children: "Choose where to update Polter." }) }),
|
|
2096
|
+
/* @__PURE__ */ jsx18(
|
|
1843
2097
|
SelectList,
|
|
1844
2098
|
{
|
|
1845
2099
|
items: targetItems,
|
|
@@ -1857,18 +2111,19 @@ function SelfUpdate({
|
|
|
1857
2111
|
width: panelMode ? Math.max(20, width - 4) : width,
|
|
1858
2112
|
maxVisible: panelMode ? Math.max(6, height - 6) : void 0,
|
|
1859
2113
|
isInputActive,
|
|
1860
|
-
arrowNavigation: panelMode
|
|
2114
|
+
arrowNavigation: panelMode,
|
|
2115
|
+
panelFocused: isInputActive
|
|
1861
2116
|
}
|
|
1862
2117
|
),
|
|
1863
|
-
repositoryRoot && /* @__PURE__ */
|
|
2118
|
+
repositoryRoot && /* @__PURE__ */ jsx18(Box14, { marginTop: 1, marginLeft: 2, children: /* @__PURE__ */ jsxs16(Text18, { dimColor: true, children: [
|
|
1864
2119
|
"Repository root: ",
|
|
1865
2120
|
repositoryRoot
|
|
1866
2121
|
] }) })
|
|
1867
2122
|
] });
|
|
1868
2123
|
}
|
|
1869
2124
|
if (phase === "confirm") {
|
|
1870
|
-
return /* @__PURE__ */
|
|
1871
|
-
/* @__PURE__ */
|
|
2125
|
+
return /* @__PURE__ */ jsxs16(Box14, { flexDirection: "column", paddingX: panelMode ? 1 : 0, children: [
|
|
2126
|
+
/* @__PURE__ */ jsx18(
|
|
1872
2127
|
ConfirmPrompt,
|
|
1873
2128
|
{
|
|
1874
2129
|
message: `Run ${updateDisplay}?`,
|
|
@@ -1896,9 +2151,9 @@ function SelfUpdate({
|
|
|
1896
2151
|
arrowNavigation: panelMode
|
|
1897
2152
|
}
|
|
1898
2153
|
),
|
|
1899
|
-
/* @__PURE__ */
|
|
1900
|
-
/* @__PURE__ */
|
|
1901
|
-
target === "repository" && repositoryRoot && /* @__PURE__ */
|
|
2154
|
+
/* @__PURE__ */ jsxs16(Box14, { marginTop: 1, marginLeft: 2, flexDirection: "column", children: [
|
|
2155
|
+
/* @__PURE__ */ jsx18(Text18, { dimColor: true, children: target === "repository" ? "This updates the dependency in the current repository." : "This updates the global npm install." }),
|
|
2156
|
+
target === "repository" && repositoryRoot && /* @__PURE__ */ jsxs16(Text18, { dimColor: true, children: [
|
|
1902
2157
|
"Run location: ",
|
|
1903
2158
|
repositoryRoot
|
|
1904
2159
|
] })
|
|
@@ -1906,15 +2161,15 @@ function SelfUpdate({
|
|
|
1906
2161
|
] });
|
|
1907
2162
|
}
|
|
1908
2163
|
if (phase === "running") {
|
|
1909
|
-
return /* @__PURE__ */
|
|
1910
|
-
/* @__PURE__ */
|
|
1911
|
-
/* @__PURE__ */
|
|
1912
|
-
/* @__PURE__ */
|
|
1913
|
-
/* @__PURE__ */
|
|
1914
|
-
/* @__PURE__ */
|
|
2164
|
+
return /* @__PURE__ */ jsxs16(Box14, { flexDirection: "column", paddingX: panelMode ? 1 : 0, children: [
|
|
2165
|
+
/* @__PURE__ */ jsx18(Divider, { width: panelMode ? width - 4 : width }),
|
|
2166
|
+
/* @__PURE__ */ jsxs16(Box14, { marginY: 1, gap: 1, children: [
|
|
2167
|
+
/* @__PURE__ */ jsx18(Text18, { color: inkColors.accent, bold: true, children: "\u25B6" }),
|
|
2168
|
+
/* @__PURE__ */ jsx18(Text18, { dimColor: true, children: "Running:" }),
|
|
2169
|
+
/* @__PURE__ */ jsx18(Text18, { children: updateDisplay })
|
|
1915
2170
|
] }),
|
|
1916
|
-
/* @__PURE__ */
|
|
1917
|
-
/* @__PURE__ */
|
|
2171
|
+
/* @__PURE__ */ jsx18(Divider, { width: panelMode ? width - 4 : width }),
|
|
2172
|
+
/* @__PURE__ */ jsx18(Box14, { marginTop: 1, children: /* @__PURE__ */ jsx18(Spinner, { label: "Updating Polter..." }) })
|
|
1918
2173
|
] });
|
|
1919
2174
|
}
|
|
1920
2175
|
if (phase === "success") {
|
|
@@ -1923,20 +2178,29 @@ function SelfUpdate({
|
|
|
1923
2178
|
...!panelMode ? [{ value: "__back__", label: "\u2190 Back to menu", kind: "action" }] : [],
|
|
1924
2179
|
{ value: "__exit__", label: "\u{1F6AA} Exit Polter", kind: "action" }
|
|
1925
2180
|
];
|
|
1926
|
-
return /* @__PURE__ */
|
|
1927
|
-
/* @__PURE__ */
|
|
1928
|
-
/* @__PURE__ */
|
|
1929
|
-
/* @__PURE__ */
|
|
1930
|
-
/* @__PURE__ */
|
|
2181
|
+
return /* @__PURE__ */ jsxs16(Box14, { flexDirection: "column", paddingX: panelMode ? 1 : 0, children: [
|
|
2182
|
+
/* @__PURE__ */ jsx18(Divider, { width: panelMode ? width - 4 : width }),
|
|
2183
|
+
/* @__PURE__ */ jsxs16(Box14, { marginY: 1, gap: 1, children: [
|
|
2184
|
+
/* @__PURE__ */ jsx18(Text18, { color: inkColors.accent, bold: true, children: "\u2713" }),
|
|
2185
|
+
/* @__PURE__ */ jsx18(Text18, { color: inkColors.accent, bold: true, children: "Update completed successfully!" })
|
|
1931
2186
|
] }),
|
|
1932
|
-
/* @__PURE__ */
|
|
1933
|
-
/* @__PURE__ */
|
|
1934
|
-
target === "repository" && repositoryRoot && /* @__PURE__ */
|
|
2187
|
+
/* @__PURE__ */ jsxs16(Box14, { marginBottom: 1, marginLeft: 2, flexDirection: "column", children: [
|
|
2188
|
+
/* @__PURE__ */ jsx18(Text18, { dimColor: true, children: "Restart Polter to use the latest version." }),
|
|
2189
|
+
target === "repository" && repositoryRoot && /* @__PURE__ */ jsxs16(Text18, { dimColor: true, children: [
|
|
1935
2190
|
"Repository updated in: ",
|
|
1936
2191
|
repositoryRoot
|
|
1937
2192
|
] })
|
|
1938
2193
|
] }),
|
|
1939
|
-
/* @__PURE__ */
|
|
2194
|
+
/* @__PURE__ */ jsx18(
|
|
2195
|
+
CommandOutput,
|
|
2196
|
+
{
|
|
2197
|
+
stdout: result?.stdout,
|
|
2198
|
+
stderr: result?.stderr,
|
|
2199
|
+
height: Math.max(3, height - 12),
|
|
2200
|
+
isActive: isInputActive
|
|
2201
|
+
}
|
|
2202
|
+
),
|
|
2203
|
+
/* @__PURE__ */ jsx18(
|
|
1940
2204
|
SelectList,
|
|
1941
2205
|
{
|
|
1942
2206
|
items: successItems,
|
|
@@ -1952,7 +2216,8 @@ function SelfUpdate({
|
|
|
1952
2216
|
width: panelMode ? Math.max(20, width - 4) : width,
|
|
1953
2217
|
maxVisible: panelMode ? Math.max(6, height - 6) : void 0,
|
|
1954
2218
|
isInputActive,
|
|
1955
|
-
arrowNavigation: panelMode
|
|
2219
|
+
arrowNavigation: panelMode,
|
|
2220
|
+
panelFocused: isInputActive
|
|
1956
2221
|
}
|
|
1957
2222
|
)
|
|
1958
2223
|
] });
|
|
@@ -1964,40 +2229,49 @@ function SelfUpdate({
|
|
|
1964
2229
|
...!panelMode ? [{ value: "menu", label: "\u2190 Return to main menu", kind: "action" }] : [],
|
|
1965
2230
|
{ value: "exit", label: "\u{1F6AA} Exit Polter", kind: "action" }
|
|
1966
2231
|
];
|
|
1967
|
-
return /* @__PURE__ */
|
|
1968
|
-
/* @__PURE__ */
|
|
1969
|
-
result?.spawnError ? /* @__PURE__ */
|
|
1970
|
-
/* @__PURE__ */
|
|
1971
|
-
/* @__PURE__ */
|
|
1972
|
-
/* @__PURE__ */
|
|
2232
|
+
return /* @__PURE__ */ jsxs16(Box14, { flexDirection: "column", paddingX: panelMode ? 1 : 0, children: [
|
|
2233
|
+
/* @__PURE__ */ jsx18(Divider, { width: panelMode ? width - 4 : width }),
|
|
2234
|
+
result?.spawnError ? /* @__PURE__ */ jsxs16(Box14, { flexDirection: "column", marginY: 1, children: [
|
|
2235
|
+
/* @__PURE__ */ jsxs16(Box14, { gap: 1, children: [
|
|
2236
|
+
/* @__PURE__ */ jsx18(Text18, { color: "red", bold: true, children: "\u2717" }),
|
|
2237
|
+
/* @__PURE__ */ jsx18(Text18, { color: "red", bold: true, children: "Failed to start update" })
|
|
1973
2238
|
] }),
|
|
1974
|
-
/* @__PURE__ */
|
|
1975
|
-
/* @__PURE__ */
|
|
1976
|
-
/* @__PURE__ */
|
|
2239
|
+
/* @__PURE__ */ jsxs16(Box14, { marginLeft: 2, marginTop: 1, children: [
|
|
2240
|
+
/* @__PURE__ */ jsx18(Text18, { dimColor: true, children: "Error: " }),
|
|
2241
|
+
/* @__PURE__ */ jsx18(Text18, { color: "red", children: result.spawnError })
|
|
1977
2242
|
] })
|
|
1978
|
-
] }) : /* @__PURE__ */
|
|
1979
|
-
/* @__PURE__ */
|
|
1980
|
-
/* @__PURE__ */
|
|
1981
|
-
/* @__PURE__ */
|
|
1982
|
-
/* @__PURE__ */
|
|
1983
|
-
/* @__PURE__ */
|
|
1984
|
-
/* @__PURE__ */
|
|
2243
|
+
] }) : /* @__PURE__ */ jsxs16(Box14, { flexDirection: "column", marginY: 1, children: [
|
|
2244
|
+
/* @__PURE__ */ jsxs16(Box14, { gap: 1, children: [
|
|
2245
|
+
/* @__PURE__ */ jsx18(Text18, { color: "red", bold: true, children: "\u2717" }),
|
|
2246
|
+
/* @__PURE__ */ jsx18(Text18, { color: "red", children: "Update failed " }),
|
|
2247
|
+
/* @__PURE__ */ jsx18(Text18, { dimColor: true, children: "(exit code " }),
|
|
2248
|
+
/* @__PURE__ */ jsx18(Text18, { color: "red", bold: true, children: String(result?.exitCode) }),
|
|
2249
|
+
/* @__PURE__ */ jsx18(Text18, { dimColor: true, children: ")" })
|
|
1985
2250
|
] }),
|
|
1986
|
-
/* @__PURE__ */
|
|
1987
|
-
/* @__PURE__ */
|
|
1988
|
-
/* @__PURE__ */
|
|
2251
|
+
/* @__PURE__ */ jsxs16(Box14, { marginLeft: 2, marginTop: 1, children: [
|
|
2252
|
+
/* @__PURE__ */ jsx18(Text18, { dimColor: true, children: "Command: " }),
|
|
2253
|
+
/* @__PURE__ */ jsx18(Text18, { children: updateDisplay })
|
|
1989
2254
|
] })
|
|
1990
2255
|
] }),
|
|
1991
|
-
/* @__PURE__ */
|
|
1992
|
-
|
|
1993
|
-
|
|
1994
|
-
|
|
2256
|
+
/* @__PURE__ */ jsx18(
|
|
2257
|
+
CommandOutput,
|
|
2258
|
+
{
|
|
2259
|
+
stdout: result?.stdout,
|
|
2260
|
+
stderr: result?.stderr,
|
|
2261
|
+
height: Math.max(3, height - 16),
|
|
2262
|
+
isActive: false
|
|
2263
|
+
}
|
|
2264
|
+
),
|
|
2265
|
+
/* @__PURE__ */ jsxs16(Box14, { marginBottom: 1, marginLeft: 2, flexDirection: "column", children: [
|
|
2266
|
+
/* @__PURE__ */ jsx18(Text18, { dimColor: true, children: "Manual fallback:" }),
|
|
2267
|
+
/* @__PURE__ */ jsx18(Text18, { color: inkColors.accent, children: updateDisplay }),
|
|
2268
|
+
target === "repository" && repositoryRoot && /* @__PURE__ */ jsxs16(Text18, { dimColor: true, children: [
|
|
1995
2269
|
"Run location: ",
|
|
1996
2270
|
repositoryRoot
|
|
1997
2271
|
] })
|
|
1998
2272
|
] }),
|
|
1999
|
-
!panelMode && /* @__PURE__ */
|
|
2000
|
-
/* @__PURE__ */
|
|
2273
|
+
!panelMode && /* @__PURE__ */ jsx18(Box14, { marginTop: 1, marginBottom: 1, children: /* @__PURE__ */ jsx18(Text18, { bold: true, children: "What would you like to do?" }) }),
|
|
2274
|
+
/* @__PURE__ */ jsx18(
|
|
2001
2275
|
SelectList,
|
|
2002
2276
|
{
|
|
2003
2277
|
items: errorItems,
|
|
@@ -2024,38 +2298,55 @@ function SelfUpdate({
|
|
|
2024
2298
|
width: panelMode ? Math.max(20, width - 4) : width,
|
|
2025
2299
|
maxVisible: panelMode ? Math.max(6, height - 6) : void 0,
|
|
2026
2300
|
isInputActive,
|
|
2027
|
-
arrowNavigation: panelMode
|
|
2301
|
+
arrowNavigation: panelMode,
|
|
2302
|
+
panelFocused: isInputActive
|
|
2028
2303
|
}
|
|
2029
2304
|
),
|
|
2030
|
-
!panelMode && /* @__PURE__ */
|
|
2305
|
+
!panelMode && /* @__PURE__ */ jsx18(StatusBar, { width })
|
|
2031
2306
|
] });
|
|
2032
2307
|
}
|
|
2033
2308
|
|
|
2034
2309
|
// src/screens/ToolStatus.tsx
|
|
2035
2310
|
import { useMemo as useMemo4 } from "react";
|
|
2036
|
-
import { Box as
|
|
2037
|
-
import { jsx as
|
|
2311
|
+
import { Box as Box15, Text as Text19 } from "ink";
|
|
2312
|
+
import { jsx as jsx19, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
2038
2313
|
var toolIds = ["supabase", "gh", "vercel", "git"];
|
|
2039
2314
|
function ToolStatus({ onBack, width = 80, height = 24, panelMode = false, isInputActive = true }) {
|
|
2040
2315
|
const tools = useMemo4(() => toolIds.map(getToolInfo), []);
|
|
2041
2316
|
if (panelMode) {
|
|
2042
|
-
|
|
2043
|
-
|
|
2044
|
-
tools.map((tool) =>
|
|
2045
|
-
|
|
2046
|
-
|
|
2047
|
-
|
|
2048
|
-
|
|
2049
|
-
|
|
2317
|
+
const statusItems = [
|
|
2318
|
+
{ value: "__section__", label: "Installed Tools", kind: "header", selectable: false },
|
|
2319
|
+
...tools.map((tool) => ({
|
|
2320
|
+
value: tool.id,
|
|
2321
|
+
label: `${tool.installed ? "\u2713" : "\u2717"} ${tool.label}`,
|
|
2322
|
+
hint: tool.installed ? tool.version ?? "installed" : "not found",
|
|
2323
|
+
kind: "action"
|
|
2324
|
+
}))
|
|
2325
|
+
];
|
|
2326
|
+
return /* @__PURE__ */ jsx19(Box15, { flexDirection: "column", paddingX: 1, children: /* @__PURE__ */ jsx19(
|
|
2327
|
+
SelectList,
|
|
2328
|
+
{
|
|
2329
|
+
items: statusItems,
|
|
2330
|
+
onSelect: () => {
|
|
2331
|
+
},
|
|
2332
|
+
onCancel: onBack,
|
|
2333
|
+
boxedSections: true,
|
|
2334
|
+
width: Math.max(20, width - 4),
|
|
2335
|
+
maxVisible: Math.max(6, height - 6),
|
|
2336
|
+
isInputActive,
|
|
2337
|
+
arrowNavigation: true,
|
|
2338
|
+
panelFocused: isInputActive
|
|
2339
|
+
}
|
|
2340
|
+
) });
|
|
2050
2341
|
}
|
|
2051
|
-
return /* @__PURE__ */
|
|
2052
|
-
/* @__PURE__ */
|
|
2053
|
-
tools.map((tool) => /* @__PURE__ */
|
|
2054
|
-
/* @__PURE__ */
|
|
2055
|
-
/* @__PURE__ */
|
|
2056
|
-
/* @__PURE__ */
|
|
2342
|
+
return /* @__PURE__ */ jsxs17(Box15, { flexDirection: "column", children: [
|
|
2343
|
+
/* @__PURE__ */ jsx19(Box15, { marginBottom: 1, children: /* @__PURE__ */ jsx19(Text19, { bold: true, color: inkColors.accent, children: "\u{1F527} Tool Status" }) }),
|
|
2344
|
+
tools.map((tool) => /* @__PURE__ */ jsxs17(Box15, { gap: 1, marginLeft: 2, children: [
|
|
2345
|
+
/* @__PURE__ */ jsx19(Text19, { color: tool.installed ? inkColors.accent : "red", children: tool.installed ? "\u2713" : "\u2717" }),
|
|
2346
|
+
/* @__PURE__ */ jsx19(Box15, { width: 16, children: /* @__PURE__ */ jsx19(Text19, { bold: true, children: tool.label }) }),
|
|
2347
|
+
/* @__PURE__ */ jsx19(Text19, { dimColor: true, children: tool.installed ? tool.version ?? "installed" : "not found" })
|
|
2057
2348
|
] }, tool.id)),
|
|
2058
|
-
/* @__PURE__ */
|
|
2349
|
+
/* @__PURE__ */ jsx19(Box15, { marginTop: 1, children: /* @__PURE__ */ jsx19(
|
|
2059
2350
|
SelectList,
|
|
2060
2351
|
{
|
|
2061
2352
|
items: [{ value: "__back__", label: "\u2190 Back" }],
|
|
@@ -2065,16 +2356,16 @@ function ToolStatus({ onBack, width = 80, height = 24, panelMode = false, isInpu
|
|
|
2065
2356
|
isInputActive
|
|
2066
2357
|
}
|
|
2067
2358
|
) }),
|
|
2068
|
-
/* @__PURE__ */
|
|
2359
|
+
/* @__PURE__ */ jsx19(StatusBar, { hint: "Enter to go back", width })
|
|
2069
2360
|
] });
|
|
2070
2361
|
}
|
|
2071
2362
|
|
|
2072
2363
|
// src/screens/ProjectConfig.tsx
|
|
2073
|
-
import { useMemo as useMemo5, useState as
|
|
2074
|
-
import { Box as
|
|
2364
|
+
import { useMemo as useMemo5, useState as useState14 } from "react";
|
|
2365
|
+
import { Box as Box16, Text as Text20 } from "ink";
|
|
2075
2366
|
|
|
2076
2367
|
// src/hooks/useEditor.ts
|
|
2077
|
-
import { useState as
|
|
2368
|
+
import { useState as useState13, useCallback as useCallback3 } from "react";
|
|
2078
2369
|
import { useStdin } from "ink";
|
|
2079
2370
|
|
|
2080
2371
|
// src/lib/editor.ts
|
|
@@ -2125,7 +2416,7 @@ function openInEditor(filePath) {
|
|
|
2125
2416
|
// src/hooks/useEditor.ts
|
|
2126
2417
|
function useEditor() {
|
|
2127
2418
|
const { setRawMode } = useStdin();
|
|
2128
|
-
const [isEditing, setIsEditing] =
|
|
2419
|
+
const [isEditing, setIsEditing] = useState13(false);
|
|
2129
2420
|
const openEditor = useCallback3(async (filePath) => {
|
|
2130
2421
|
const editor = resolveEditor();
|
|
2131
2422
|
const terminal = isTerminalEditor(editor.command);
|
|
@@ -2146,7 +2437,7 @@ function useEditor() {
|
|
|
2146
2437
|
}
|
|
2147
2438
|
|
|
2148
2439
|
// src/screens/ProjectConfig.tsx
|
|
2149
|
-
import { jsx as
|
|
2440
|
+
import { jsx as jsx20, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
2150
2441
|
function ProjectConfig({
|
|
2151
2442
|
onBack,
|
|
2152
2443
|
width = 80,
|
|
@@ -2155,14 +2446,14 @@ function ProjectConfig({
|
|
|
2155
2446
|
isInputActive = true
|
|
2156
2447
|
}) {
|
|
2157
2448
|
const configPath = useMemo5(() => getProjectConfigPath(), []);
|
|
2158
|
-
const [config2, setConfig] =
|
|
2159
|
-
const [phase, setPhase] =
|
|
2160
|
-
const [feedback, setFeedback] =
|
|
2449
|
+
const [config2, setConfig] = useState14(() => getOrCreateProjectConfig());
|
|
2450
|
+
const [phase, setPhase] = useState14("overview");
|
|
2451
|
+
const [feedback, setFeedback] = useState14();
|
|
2161
2452
|
const { openEditor, isEditing } = useEditor();
|
|
2162
2453
|
if (!configPath) {
|
|
2163
|
-
return /* @__PURE__ */
|
|
2164
|
-
/* @__PURE__ */
|
|
2165
|
-
!panelMode && /* @__PURE__ */
|
|
2454
|
+
return /* @__PURE__ */ jsxs18(Box16, { flexDirection: "column", paddingX: panelMode ? 1 : 0, children: [
|
|
2455
|
+
/* @__PURE__ */ jsx20(Text20, { color: "red", children: "No package.json found. Run from a project directory." }),
|
|
2456
|
+
!panelMode && /* @__PURE__ */ jsx20(
|
|
2166
2457
|
SelectList,
|
|
2167
2458
|
{
|
|
2168
2459
|
items: [{ value: "__back__", label: "\u2190 Back" }],
|
|
@@ -2175,7 +2466,7 @@ function ProjectConfig({
|
|
|
2175
2466
|
] });
|
|
2176
2467
|
}
|
|
2177
2468
|
if (phase === "edit-supabase-ref") {
|
|
2178
|
-
return /* @__PURE__ */
|
|
2469
|
+
return /* @__PURE__ */ jsx20(Box16, { flexDirection: "column", paddingX: panelMode ? 1 : 0, children: /* @__PURE__ */ jsx20(
|
|
2179
2470
|
TextPrompt,
|
|
2180
2471
|
{
|
|
2181
2472
|
label: "Supabase project ref:",
|
|
@@ -2193,12 +2484,16 @@ function ProjectConfig({
|
|
|
2193
2484
|
setFeedback("Supabase project ref updated");
|
|
2194
2485
|
setPhase("overview");
|
|
2195
2486
|
},
|
|
2196
|
-
onCancel: () => setPhase("overview")
|
|
2487
|
+
onCancel: () => setPhase("overview"),
|
|
2488
|
+
arrowNavigation: panelMode,
|
|
2489
|
+
isInputActive,
|
|
2490
|
+
boxed: panelMode,
|
|
2491
|
+
focused: isInputActive
|
|
2197
2492
|
}
|
|
2198
2493
|
) });
|
|
2199
2494
|
}
|
|
2200
2495
|
if (phase === "edit-vercel-id") {
|
|
2201
|
-
return /* @__PURE__ */
|
|
2496
|
+
return /* @__PURE__ */ jsx20(Box16, { flexDirection: "column", paddingX: panelMode ? 1 : 0, children: /* @__PURE__ */ jsx20(
|
|
2202
2497
|
TextPrompt,
|
|
2203
2498
|
{
|
|
2204
2499
|
label: "Vercel project ID:",
|
|
@@ -2216,12 +2511,16 @@ function ProjectConfig({
|
|
|
2216
2511
|
setFeedback("Vercel project ID updated");
|
|
2217
2512
|
setPhase("overview");
|
|
2218
2513
|
},
|
|
2219
|
-
onCancel: () => setPhase("overview")
|
|
2514
|
+
onCancel: () => setPhase("overview"),
|
|
2515
|
+
arrowNavigation: panelMode,
|
|
2516
|
+
isInputActive,
|
|
2517
|
+
boxed: panelMode,
|
|
2518
|
+
focused: isInputActive
|
|
2220
2519
|
}
|
|
2221
2520
|
) });
|
|
2222
2521
|
}
|
|
2223
2522
|
if (phase === "edit-gh-repo") {
|
|
2224
|
-
return /* @__PURE__ */
|
|
2523
|
+
return /* @__PURE__ */ jsx20(Box16, { flexDirection: "column", paddingX: panelMode ? 1 : 0, children: /* @__PURE__ */ jsx20(
|
|
2225
2524
|
TextPrompt,
|
|
2226
2525
|
{
|
|
2227
2526
|
label: "GitHub repo (owner/name):",
|
|
@@ -2239,7 +2538,11 @@ function ProjectConfig({
|
|
|
2239
2538
|
setFeedback("GitHub repo updated");
|
|
2240
2539
|
setPhase("overview");
|
|
2241
2540
|
},
|
|
2242
|
-
onCancel: () => setPhase("overview")
|
|
2541
|
+
onCancel: () => setPhase("overview"),
|
|
2542
|
+
arrowNavigation: panelMode,
|
|
2543
|
+
isInputActive,
|
|
2544
|
+
boxed: panelMode,
|
|
2545
|
+
focused: isInputActive
|
|
2243
2546
|
}
|
|
2244
2547
|
) });
|
|
2245
2548
|
}
|
|
@@ -2289,17 +2592,16 @@ function ProjectConfig({
|
|
|
2289
2592
|
}
|
|
2290
2593
|
};
|
|
2291
2594
|
if (panelMode) {
|
|
2292
|
-
return /* @__PURE__ */
|
|
2293
|
-
/* @__PURE__ */
|
|
2294
|
-
/* @__PURE__ */ jsx18(Box15, { marginBottom: 1, marginLeft: 2, children: /* @__PURE__ */ jsxs17(Text17, { dimColor: true, children: [
|
|
2595
|
+
return /* @__PURE__ */ jsxs18(Box16, { flexDirection: "column", paddingX: 1, children: [
|
|
2596
|
+
/* @__PURE__ */ jsx20(Box16, { marginBottom: 1, marginLeft: 2, children: /* @__PURE__ */ jsxs18(Text20, { dimColor: true, children: [
|
|
2295
2597
|
"Path: ",
|
|
2296
2598
|
configPath.file
|
|
2297
2599
|
] }) }),
|
|
2298
|
-
feedback && /* @__PURE__ */
|
|
2600
|
+
feedback && /* @__PURE__ */ jsx20(Box16, { marginBottom: 1, children: /* @__PURE__ */ jsxs18(Text20, { color: inkColors.accent, children: [
|
|
2299
2601
|
"\u2713 ",
|
|
2300
2602
|
feedback
|
|
2301
2603
|
] }) }),
|
|
2302
|
-
/* @__PURE__ */
|
|
2604
|
+
/* @__PURE__ */ jsx20(
|
|
2303
2605
|
SelectList,
|
|
2304
2606
|
{
|
|
2305
2607
|
items: configItems,
|
|
@@ -2309,36 +2611,37 @@ function ProjectConfig({
|
|
|
2309
2611
|
width: Math.max(20, width - 4),
|
|
2310
2612
|
maxVisible: Math.max(6, height - 6),
|
|
2311
2613
|
isInputActive,
|
|
2312
|
-
arrowNavigation: true
|
|
2614
|
+
arrowNavigation: true,
|
|
2615
|
+
panelFocused: isInputActive
|
|
2313
2616
|
}
|
|
2314
2617
|
)
|
|
2315
2618
|
] });
|
|
2316
2619
|
}
|
|
2317
|
-
return /* @__PURE__ */
|
|
2318
|
-
/* @__PURE__ */
|
|
2319
|
-
/* @__PURE__ */
|
|
2320
|
-
/* @__PURE__ */
|
|
2620
|
+
return /* @__PURE__ */ jsxs18(Box16, { flexDirection: "column", children: [
|
|
2621
|
+
/* @__PURE__ */ jsx20(Box16, { marginBottom: 1, children: /* @__PURE__ */ jsx20(Text20, { bold: true, color: inkColors.accent, children: "\u2699\uFE0F Project Config" }) }),
|
|
2622
|
+
/* @__PURE__ */ jsxs18(Box16, { marginBottom: 1, marginLeft: 2, flexDirection: "column", children: [
|
|
2623
|
+
/* @__PURE__ */ jsxs18(Text20, { dimColor: true, children: [
|
|
2321
2624
|
"Path: ",
|
|
2322
2625
|
configPath.file
|
|
2323
2626
|
] }),
|
|
2324
|
-
/* @__PURE__ */
|
|
2627
|
+
/* @__PURE__ */ jsxs18(Text20, { children: [
|
|
2325
2628
|
"Supabase ref: ",
|
|
2326
|
-
config2.tools.supabase?.projectRef ?? /* @__PURE__ */
|
|
2629
|
+
config2.tools.supabase?.projectRef ?? /* @__PURE__ */ jsx20(Text20, { dimColor: true, children: "not set" })
|
|
2327
2630
|
] }),
|
|
2328
|
-
/* @__PURE__ */
|
|
2631
|
+
/* @__PURE__ */ jsxs18(Text20, { children: [
|
|
2329
2632
|
"Vercel ID: ",
|
|
2330
|
-
config2.tools.vercel?.projectId ?? /* @__PURE__ */
|
|
2633
|
+
config2.tools.vercel?.projectId ?? /* @__PURE__ */ jsx20(Text20, { dimColor: true, children: "not set" })
|
|
2331
2634
|
] }),
|
|
2332
|
-
/* @__PURE__ */
|
|
2635
|
+
/* @__PURE__ */ jsxs18(Text20, { children: [
|
|
2333
2636
|
"GitHub repo: ",
|
|
2334
|
-
config2.tools.gh?.repo ?? /* @__PURE__ */
|
|
2637
|
+
config2.tools.gh?.repo ?? /* @__PURE__ */ jsx20(Text20, { dimColor: true, children: "not set" })
|
|
2335
2638
|
] })
|
|
2336
2639
|
] }),
|
|
2337
|
-
feedback && /* @__PURE__ */
|
|
2640
|
+
feedback && /* @__PURE__ */ jsx20(Box16, { marginBottom: 1, children: /* @__PURE__ */ jsxs18(Text20, { color: inkColors.accent, children: [
|
|
2338
2641
|
"\u2713 ",
|
|
2339
2642
|
feedback
|
|
2340
2643
|
] }) }),
|
|
2341
|
-
/* @__PURE__ */
|
|
2644
|
+
/* @__PURE__ */ jsx20(
|
|
2342
2645
|
SelectList,
|
|
2343
2646
|
{
|
|
2344
2647
|
items: flatItems,
|
|
@@ -2349,14 +2652,14 @@ function ProjectConfig({
|
|
|
2349
2652
|
arrowNavigation: panelMode
|
|
2350
2653
|
}
|
|
2351
2654
|
),
|
|
2352
|
-
/* @__PURE__ */
|
|
2655
|
+
/* @__PURE__ */ jsx20(StatusBar, { hint: "\u2191\u2193 navigate \xB7 Enter select \xB7 Esc back", width })
|
|
2353
2656
|
] });
|
|
2354
2657
|
}
|
|
2355
2658
|
|
|
2356
2659
|
// src/screens/PipelineList.tsx
|
|
2357
2660
|
import { useMemo as useMemo6 } from "react";
|
|
2358
|
-
import { Box as
|
|
2359
|
-
import { jsx as
|
|
2661
|
+
import { Box as Box17, Text as Text21 } from "ink";
|
|
2662
|
+
import { jsx as jsx21, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
2360
2663
|
function PipelineList({
|
|
2361
2664
|
onNavigate,
|
|
2362
2665
|
onBack,
|
|
@@ -2419,9 +2722,9 @@ function PipelineList({
|
|
|
2419
2722
|
}
|
|
2420
2723
|
return list;
|
|
2421
2724
|
}, [pipelines, panelMode]);
|
|
2422
|
-
return /* @__PURE__ */
|
|
2423
|
-
/* @__PURE__ */
|
|
2424
|
-
/* @__PURE__ */
|
|
2725
|
+
return /* @__PURE__ */ jsxs19(Box17, { flexDirection: "column", paddingX: panelMode ? 1 : 0, children: [
|
|
2726
|
+
!panelMode && /* @__PURE__ */ jsx21(Box17, { marginBottom: 1, children: /* @__PURE__ */ jsx21(Text21, { bold: true, color: inkColors.accent, children: "\u{1F517} Pipelines" }) }),
|
|
2727
|
+
/* @__PURE__ */ jsx21(
|
|
2425
2728
|
SelectList,
|
|
2426
2729
|
{
|
|
2427
2730
|
items,
|
|
@@ -2441,17 +2744,18 @@ function PipelineList({
|
|
|
2441
2744
|
width: panelMode ? Math.max(20, width - 4) : width,
|
|
2442
2745
|
maxVisible: panelMode ? Math.max(6, height - 6) : void 0,
|
|
2443
2746
|
isInputActive,
|
|
2444
|
-
arrowNavigation: panelMode
|
|
2747
|
+
arrowNavigation: panelMode,
|
|
2748
|
+
panelFocused: isInputActive
|
|
2445
2749
|
}
|
|
2446
2750
|
),
|
|
2447
|
-
!panelMode && /* @__PURE__ */
|
|
2751
|
+
!panelMode && /* @__PURE__ */ jsx21(StatusBar, { hint: "\u2191\u2193 navigate \xB7 Enter select \xB7 Esc back", width })
|
|
2448
2752
|
] });
|
|
2449
2753
|
}
|
|
2450
2754
|
|
|
2451
2755
|
// src/screens/PipelineBuilder.tsx
|
|
2452
|
-
import { useState as
|
|
2453
|
-
import { Box as
|
|
2454
|
-
import { jsx as
|
|
2756
|
+
import { useState as useState15 } from "react";
|
|
2757
|
+
import { Box as Box18, Text as Text22 } from "ink";
|
|
2758
|
+
import { jsx as jsx22, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
2455
2759
|
var stepCounter = 0;
|
|
2456
2760
|
function nextStepId() {
|
|
2457
2761
|
stepCounter += 1;
|
|
@@ -2464,13 +2768,13 @@ function PipelineBuilder({
|
|
|
2464
2768
|
panelMode = false,
|
|
2465
2769
|
isInputActive = true
|
|
2466
2770
|
}) {
|
|
2467
|
-
const [phase, setPhase] =
|
|
2468
|
-
const [name, setName] =
|
|
2469
|
-
const [steps, setSteps] =
|
|
2771
|
+
const [phase, setPhase] = useState15("name");
|
|
2772
|
+
const [name, setName] = useState15("");
|
|
2773
|
+
const [steps, setSteps] = useState15([]);
|
|
2470
2774
|
if (phase === "name") {
|
|
2471
|
-
return /* @__PURE__ */
|
|
2472
|
-
/* @__PURE__ */
|
|
2473
|
-
/* @__PURE__ */
|
|
2775
|
+
return /* @__PURE__ */ jsxs20(Box18, { flexDirection: "column", paddingX: panelMode ? 1 : 0, children: [
|
|
2776
|
+
/* @__PURE__ */ jsx22(Box18, { marginBottom: 1, children: /* @__PURE__ */ jsx22(Text22, { bold: true, color: inkColors.accent, children: "\u{1F517} New Pipeline" }) }),
|
|
2777
|
+
/* @__PURE__ */ jsx22(
|
|
2474
2778
|
TextPrompt,
|
|
2475
2779
|
{
|
|
2476
2780
|
label: "Pipeline name:",
|
|
@@ -2483,10 +2787,14 @@ function PipelineBuilder({
|
|
|
2483
2787
|
setName(val.trim());
|
|
2484
2788
|
setPhase("add-step");
|
|
2485
2789
|
},
|
|
2486
|
-
onCancel: onBack
|
|
2790
|
+
onCancel: onBack,
|
|
2791
|
+
arrowNavigation: panelMode,
|
|
2792
|
+
isInputActive,
|
|
2793
|
+
boxed: panelMode,
|
|
2794
|
+
focused: isInputActive
|
|
2487
2795
|
}
|
|
2488
2796
|
),
|
|
2489
|
-
!panelMode && /* @__PURE__ */
|
|
2797
|
+
!panelMode && /* @__PURE__ */ jsx22(StatusBar, { hint: "Type name \xB7 Enter to continue \xB7 Esc cancel", width })
|
|
2490
2798
|
] });
|
|
2491
2799
|
}
|
|
2492
2800
|
if (phase === "add-step") {
|
|
@@ -2519,26 +2827,26 @@ function PipelineBuilder({
|
|
|
2519
2827
|
kind: "action"
|
|
2520
2828
|
}
|
|
2521
2829
|
];
|
|
2522
|
-
return /* @__PURE__ */
|
|
2523
|
-
/* @__PURE__ */
|
|
2524
|
-
/* @__PURE__ */
|
|
2830
|
+
return /* @__PURE__ */ jsxs20(Box18, { flexDirection: "column", paddingX: panelMode ? 1 : 0, children: [
|
|
2831
|
+
/* @__PURE__ */ jsxs20(Box18, { marginBottom: 1, gap: 1, children: [
|
|
2832
|
+
/* @__PURE__ */ jsxs20(Text22, { bold: true, color: inkColors.accent, children: [
|
|
2525
2833
|
"\u{1F517} ",
|
|
2526
2834
|
name
|
|
2527
2835
|
] }),
|
|
2528
|
-
/* @__PURE__ */
|
|
2836
|
+
/* @__PURE__ */ jsxs20(Text22, { dimColor: true, children: [
|
|
2529
2837
|
"(",
|
|
2530
2838
|
steps.length,
|
|
2531
2839
|
" steps)"
|
|
2532
2840
|
] })
|
|
2533
2841
|
] }),
|
|
2534
|
-
steps.length > 0 && /* @__PURE__ */
|
|
2842
|
+
steps.length > 0 && /* @__PURE__ */ jsx22(Box18, { flexDirection: "column", marginBottom: 1, children: steps.map((step, i) => /* @__PURE__ */ jsxs20(Text22, { dimColor: true, children: [
|
|
2535
2843
|
i + 1,
|
|
2536
2844
|
". ",
|
|
2537
2845
|
step.commandId,
|
|
2538
2846
|
step.args.length > 0 ? ` ${step.args.join(" ")}` : ""
|
|
2539
2847
|
] }, step.id)) }),
|
|
2540
|
-
/* @__PURE__ */
|
|
2541
|
-
/* @__PURE__ */
|
|
2848
|
+
/* @__PURE__ */ jsx22(Text22, { dimColor: true, children: "Select a command to add as step:" }),
|
|
2849
|
+
/* @__PURE__ */ jsx22(
|
|
2542
2850
|
SelectList,
|
|
2543
2851
|
{
|
|
2544
2852
|
items: commandItems,
|
|
@@ -2570,12 +2878,14 @@ function PipelineBuilder({
|
|
|
2570
2878
|
}
|
|
2571
2879
|
},
|
|
2572
2880
|
maxVisible: Math.max(8, height - 14),
|
|
2573
|
-
|
|
2881
|
+
boxedSections: panelMode,
|
|
2882
|
+
width: panelMode ? Math.max(20, width - 4) : width,
|
|
2574
2883
|
isInputActive,
|
|
2575
|
-
arrowNavigation: panelMode
|
|
2884
|
+
arrowNavigation: panelMode,
|
|
2885
|
+
panelFocused: isInputActive
|
|
2576
2886
|
}
|
|
2577
2887
|
),
|
|
2578
|
-
!panelMode && /* @__PURE__ */
|
|
2888
|
+
!panelMode && /* @__PURE__ */ jsx22(StatusBar, { hint: "\u2191\u2193 navigate \xB7 Enter add step \xB7 Esc done", width })
|
|
2579
2889
|
] });
|
|
2580
2890
|
}
|
|
2581
2891
|
const reviewItems = [
|
|
@@ -2598,18 +2908,18 @@ function PipelineBuilder({
|
|
|
2598
2908
|
kind: "action"
|
|
2599
2909
|
}
|
|
2600
2910
|
];
|
|
2601
|
-
return /* @__PURE__ */
|
|
2602
|
-
/* @__PURE__ */
|
|
2911
|
+
return /* @__PURE__ */ jsxs20(Box18, { flexDirection: "column", paddingX: panelMode ? 1 : 0, children: [
|
|
2912
|
+
/* @__PURE__ */ jsx22(Box18, { marginBottom: 1, children: /* @__PURE__ */ jsxs20(Text22, { bold: true, color: inkColors.accent, children: [
|
|
2603
2913
|
"\u{1F517} Review: ",
|
|
2604
2914
|
name
|
|
2605
2915
|
] }) }),
|
|
2606
|
-
/* @__PURE__ */
|
|
2916
|
+
/* @__PURE__ */ jsx22(Box18, { flexDirection: "column", marginBottom: 1, children: steps.map((step, i) => /* @__PURE__ */ jsxs20(Text22, { children: [
|
|
2607
2917
|
i + 1,
|
|
2608
2918
|
". ",
|
|
2609
2919
|
step.commandId,
|
|
2610
2920
|
step.args.length > 0 ? ` ${step.args.join(" ")}` : ""
|
|
2611
2921
|
] }, step.id)) }),
|
|
2612
|
-
/* @__PURE__ */
|
|
2922
|
+
/* @__PURE__ */ jsx22(
|
|
2613
2923
|
SelectList,
|
|
2614
2924
|
{
|
|
2615
2925
|
items: reviewItems,
|
|
@@ -2634,22 +2944,24 @@ function PipelineBuilder({
|
|
|
2634
2944
|
onBack();
|
|
2635
2945
|
},
|
|
2636
2946
|
onCancel: onBack,
|
|
2637
|
-
|
|
2947
|
+
boxedSections: panelMode,
|
|
2948
|
+
width: panelMode ? Math.max(20, width - 4) : width,
|
|
2638
2949
|
isInputActive,
|
|
2639
|
-
arrowNavigation: panelMode
|
|
2950
|
+
arrowNavigation: panelMode,
|
|
2951
|
+
panelFocused: isInputActive
|
|
2640
2952
|
}
|
|
2641
2953
|
),
|
|
2642
|
-
!panelMode && /* @__PURE__ */
|
|
2954
|
+
!panelMode && /* @__PURE__ */ jsx22(StatusBar, { hint: "\u2191\u2193 navigate \xB7 Enter select \xB7 Esc back", width })
|
|
2643
2955
|
] });
|
|
2644
2956
|
}
|
|
2645
2957
|
|
|
2646
2958
|
// src/screens/PipelineExecution.tsx
|
|
2647
|
-
import { useState as
|
|
2648
|
-
import { Box as
|
|
2959
|
+
import { useState as useState16, useEffect as useEffect7, useMemo as useMemo7 } from "react";
|
|
2960
|
+
import { Box as Box21, Text as Text25 } from "ink";
|
|
2649
2961
|
|
|
2650
2962
|
// src/components/StepIndicator.tsx
|
|
2651
|
-
import { Box as
|
|
2652
|
-
import { jsx as
|
|
2963
|
+
import { Box as Box19, Text as Text23 } from "ink";
|
|
2964
|
+
import { jsx as jsx23, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
2653
2965
|
var statusIcons = {
|
|
2654
2966
|
pending: "\u25CB",
|
|
2655
2967
|
running: "",
|
|
@@ -2669,21 +2981,21 @@ function StepIndicator({
|
|
|
2669
2981
|
status,
|
|
2670
2982
|
index
|
|
2671
2983
|
}) {
|
|
2672
|
-
return /* @__PURE__ */
|
|
2673
|
-
/* @__PURE__ */
|
|
2984
|
+
return /* @__PURE__ */ jsxs21(Box19, { gap: 1, children: [
|
|
2985
|
+
/* @__PURE__ */ jsxs21(Text23, { dimColor: true, children: [
|
|
2674
2986
|
String(index + 1).padStart(2, " "),
|
|
2675
2987
|
"."
|
|
2676
2988
|
] }),
|
|
2677
|
-
status === "running" ? /* @__PURE__ */
|
|
2678
|
-
|
|
2989
|
+
status === "running" ? /* @__PURE__ */ jsx23(Spinner, { label: "" }) : /* @__PURE__ */ jsx23(
|
|
2990
|
+
Text23,
|
|
2679
2991
|
{
|
|
2680
2992
|
color: statusColors[status],
|
|
2681
2993
|
dimColor: status === "pending" || status === "skipped",
|
|
2682
2994
|
children: statusIcons[status]
|
|
2683
2995
|
}
|
|
2684
2996
|
),
|
|
2685
|
-
/* @__PURE__ */
|
|
2686
|
-
|
|
2997
|
+
/* @__PURE__ */ jsx23(
|
|
2998
|
+
Text23,
|
|
2687
2999
|
{
|
|
2688
3000
|
color: statusColors[status],
|
|
2689
3001
|
dimColor: status === "pending" || status === "skipped",
|
|
@@ -2695,8 +3007,8 @@ function StepIndicator({
|
|
|
2695
3007
|
}
|
|
2696
3008
|
|
|
2697
3009
|
// src/components/PipelineProgress.tsx
|
|
2698
|
-
import { Box as
|
|
2699
|
-
import { jsxs as
|
|
3010
|
+
import { Box as Box20, Text as Text24 } from "ink";
|
|
3011
|
+
import { jsxs as jsxs22 } from "react/jsx-runtime";
|
|
2700
3012
|
function PipelineProgressBar({
|
|
2701
3013
|
total,
|
|
2702
3014
|
completed,
|
|
@@ -2707,14 +3019,14 @@ function PipelineProgressBar({
|
|
|
2707
3019
|
const filledCount = total > 0 ? Math.round(completed / total * barWidth) : 0;
|
|
2708
3020
|
const filled = "\u2588".repeat(filledCount);
|
|
2709
3021
|
const empty = "\u2591".repeat(barWidth - filledCount);
|
|
2710
|
-
return /* @__PURE__ */
|
|
2711
|
-
/* @__PURE__ */
|
|
3022
|
+
return /* @__PURE__ */ jsxs22(Box20, { gap: 1, children: [
|
|
3023
|
+
/* @__PURE__ */ jsxs22(Text24, { color: errors > 0 ? "red" : inkColors.accent, children: [
|
|
2712
3024
|
"[",
|
|
2713
3025
|
filled,
|
|
2714
3026
|
empty,
|
|
2715
3027
|
"]"
|
|
2716
3028
|
] }),
|
|
2717
|
-
/* @__PURE__ */
|
|
3029
|
+
/* @__PURE__ */ jsxs22(Text24, { dimColor: true, children: [
|
|
2718
3030
|
completed,
|
|
2719
3031
|
"/",
|
|
2720
3032
|
total,
|
|
@@ -2724,7 +3036,7 @@ function PipelineProgressBar({
|
|
|
2724
3036
|
}
|
|
2725
3037
|
|
|
2726
3038
|
// src/screens/PipelineExecution.tsx
|
|
2727
|
-
import { Fragment, jsx as
|
|
3039
|
+
import { Fragment, jsx as jsx24, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
2728
3040
|
function PipelineExecution({
|
|
2729
3041
|
pipelineId,
|
|
2730
3042
|
onBack,
|
|
@@ -2737,9 +3049,9 @@ function PipelineExecution({
|
|
|
2737
3049
|
() => getAllPipelines().find((p) => p.id === pipelineId),
|
|
2738
3050
|
[pipelineId]
|
|
2739
3051
|
);
|
|
2740
|
-
const [phase, setPhase] =
|
|
2741
|
-
const [progress, setProgress] =
|
|
2742
|
-
const [results, setResults] =
|
|
3052
|
+
const [phase, setPhase] = useState16("running");
|
|
3053
|
+
const [progress, setProgress] = useState16(null);
|
|
3054
|
+
const [results, setResults] = useState16([]);
|
|
2743
3055
|
useEffect7(() => {
|
|
2744
3056
|
if (!pipeline) return;
|
|
2745
3057
|
executePipeline(pipeline, (p) => {
|
|
@@ -2753,20 +3065,22 @@ function PipelineExecution({
|
|
|
2753
3065
|
});
|
|
2754
3066
|
}, [pipeline]);
|
|
2755
3067
|
if (!pipeline) {
|
|
2756
|
-
return /* @__PURE__ */
|
|
2757
|
-
/* @__PURE__ */
|
|
3068
|
+
return /* @__PURE__ */ jsxs23(Box21, { flexDirection: "column", paddingX: panelMode ? 1 : 0, children: [
|
|
3069
|
+
/* @__PURE__ */ jsxs23(Text25, { color: "red", children: [
|
|
2758
3070
|
"Pipeline not found: ",
|
|
2759
3071
|
pipelineId
|
|
2760
3072
|
] }),
|
|
2761
|
-
/* @__PURE__ */
|
|
3073
|
+
/* @__PURE__ */ jsx24(
|
|
2762
3074
|
SelectList,
|
|
2763
3075
|
{
|
|
2764
3076
|
items: [{ value: "__back__", label: "\u2190 Back" }],
|
|
2765
3077
|
onSelect: onBack,
|
|
2766
3078
|
onCancel: onBack,
|
|
2767
|
-
|
|
3079
|
+
boxedSections: panelMode,
|
|
3080
|
+
width: panelMode ? Math.max(20, width - 4) : width,
|
|
2768
3081
|
isInputActive,
|
|
2769
|
-
arrowNavigation: panelMode
|
|
3082
|
+
arrowNavigation: panelMode,
|
|
3083
|
+
panelFocused: isInputActive
|
|
2770
3084
|
}
|
|
2771
3085
|
)
|
|
2772
3086
|
] });
|
|
@@ -2781,15 +3095,15 @@ function PipelineExecution({
|
|
|
2781
3095
|
const base = cmdDef ? `${cmdDef.tool}: ${cmdDef.label}` : step.commandId;
|
|
2782
3096
|
return step.args.length > 0 ? `${base} ${step.args.join(" ")}` : base;
|
|
2783
3097
|
}
|
|
2784
|
-
return /* @__PURE__ */
|
|
2785
|
-
/* @__PURE__ */
|
|
2786
|
-
/* @__PURE__ */
|
|
3098
|
+
return /* @__PURE__ */ jsxs23(Box21, { flexDirection: "column", paddingX: panelMode ? 1 : 0, children: [
|
|
3099
|
+
/* @__PURE__ */ jsxs23(Box21, { marginBottom: 1, gap: 1, children: [
|
|
3100
|
+
/* @__PURE__ */ jsxs23(Text25, { bold: true, color: inkColors.accent, children: [
|
|
2787
3101
|
"\u{1F517} ",
|
|
2788
3102
|
pipeline.name
|
|
2789
3103
|
] }),
|
|
2790
|
-
/* @__PURE__ */
|
|
3104
|
+
/* @__PURE__ */ jsx24(Text25, { dimColor: true, children: phase === "running" ? "Running..." : "Complete" })
|
|
2791
3105
|
] }),
|
|
2792
|
-
/* @__PURE__ */
|
|
3106
|
+
/* @__PURE__ */ jsx24(
|
|
2793
3107
|
PipelineProgressBar,
|
|
2794
3108
|
{
|
|
2795
3109
|
total: pipeline.steps.length,
|
|
@@ -2798,8 +3112,8 @@ function PipelineExecution({
|
|
|
2798
3112
|
width
|
|
2799
3113
|
}
|
|
2800
3114
|
),
|
|
2801
|
-
/* @__PURE__ */
|
|
2802
|
-
/* @__PURE__ */
|
|
3115
|
+
/* @__PURE__ */ jsx24(Divider, { width }),
|
|
3116
|
+
/* @__PURE__ */ jsx24(Box21, { flexDirection: "column", marginY: 1, children: pipeline.steps.map((step, i) => /* @__PURE__ */ jsx24(
|
|
2803
3117
|
StepIndicator,
|
|
2804
3118
|
{
|
|
2805
3119
|
label: step.label ?? getStepLabel(step),
|
|
@@ -2808,17 +3122,17 @@ function PipelineExecution({
|
|
|
2808
3122
|
},
|
|
2809
3123
|
step.id
|
|
2810
3124
|
)) }),
|
|
2811
|
-
phase === "done" && /* @__PURE__ */
|
|
2812
|
-
/* @__PURE__ */
|
|
2813
|
-
/* @__PURE__ */
|
|
2814
|
-
|
|
3125
|
+
phase === "done" && /* @__PURE__ */ jsxs23(Fragment, { children: [
|
|
3126
|
+
/* @__PURE__ */ jsx24(Divider, { width }),
|
|
3127
|
+
/* @__PURE__ */ jsx24(Box21, { marginY: 1, children: /* @__PURE__ */ jsx24(
|
|
3128
|
+
Text25,
|
|
2815
3129
|
{
|
|
2816
3130
|
color: errorCount > 0 ? "red" : inkColors.accent,
|
|
2817
3131
|
bold: true,
|
|
2818
3132
|
children: errorCount > 0 ? `Pipeline completed with ${errorCount} error(s)` : "Pipeline completed successfully!"
|
|
2819
3133
|
}
|
|
2820
3134
|
) }),
|
|
2821
|
-
/* @__PURE__ */
|
|
3135
|
+
/* @__PURE__ */ jsx24(
|
|
2822
3136
|
SelectList,
|
|
2823
3137
|
{
|
|
2824
3138
|
items: [
|
|
@@ -2833,13 +3147,15 @@ function PipelineExecution({
|
|
|
2833
3147
|
onBack();
|
|
2834
3148
|
},
|
|
2835
3149
|
onCancel: onBack,
|
|
2836
|
-
|
|
3150
|
+
boxedSections: panelMode,
|
|
3151
|
+
width: panelMode ? Math.max(20, width - 4) : width,
|
|
2837
3152
|
isInputActive,
|
|
2838
|
-
arrowNavigation: panelMode
|
|
3153
|
+
arrowNavigation: panelMode,
|
|
3154
|
+
panelFocused: isInputActive
|
|
2839
3155
|
}
|
|
2840
3156
|
)
|
|
2841
3157
|
] }),
|
|
2842
|
-
!panelMode && /* @__PURE__ */
|
|
3158
|
+
!panelMode && /* @__PURE__ */ jsx24(
|
|
2843
3159
|
StatusBar,
|
|
2844
3160
|
{
|
|
2845
3161
|
hint: phase === "running" ? "Running pipeline..." : "Enter select \xB7 Esc back",
|
|
@@ -2850,7 +3166,7 @@ function PipelineExecution({
|
|
|
2850
3166
|
}
|
|
2851
3167
|
|
|
2852
3168
|
// src/app.tsx
|
|
2853
|
-
import { jsx as
|
|
3169
|
+
import { jsx as jsx25, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
2854
3170
|
function AppClassic() {
|
|
2855
3171
|
const { screen, params, navigate, goBack, goHome } = useNavigation();
|
|
2856
3172
|
const { exit } = useApp();
|
|
@@ -2865,9 +3181,9 @@ function AppClassic() {
|
|
|
2865
3181
|
const renderScreen = () => {
|
|
2866
3182
|
switch (screen) {
|
|
2867
3183
|
case "home":
|
|
2868
|
-
return /* @__PURE__ */
|
|
3184
|
+
return /* @__PURE__ */ jsx25(Home, { onNavigate: navigate, onExit: handleExit, width, height });
|
|
2869
3185
|
case "command-args":
|
|
2870
|
-
return /* @__PURE__ */
|
|
3186
|
+
return /* @__PURE__ */ jsx25(
|
|
2871
3187
|
CommandArgs,
|
|
2872
3188
|
{
|
|
2873
3189
|
command: params.command ?? "",
|
|
@@ -2878,9 +3194,9 @@ function AppClassic() {
|
|
|
2878
3194
|
}
|
|
2879
3195
|
);
|
|
2880
3196
|
case "custom-command":
|
|
2881
|
-
return /* @__PURE__ */
|
|
3197
|
+
return /* @__PURE__ */ jsx25(CustomCommand, { onNavigate: navigate, onBack: goBack, width });
|
|
2882
3198
|
case "flag-selection":
|
|
2883
|
-
return /* @__PURE__ */
|
|
3199
|
+
return /* @__PURE__ */ jsx25(
|
|
2884
3200
|
FlagSelection,
|
|
2885
3201
|
{
|
|
2886
3202
|
args: params.args ?? [],
|
|
@@ -2892,28 +3208,32 @@ function AppClassic() {
|
|
|
2892
3208
|
);
|
|
2893
3209
|
case "confirm-execute":
|
|
2894
3210
|
case "command-execution":
|
|
2895
|
-
return /* @__PURE__ */
|
|
3211
|
+
return /* @__PURE__ */ jsx25(
|
|
2896
3212
|
CommandExecution,
|
|
2897
3213
|
{
|
|
2898
3214
|
args: params.args ?? [],
|
|
2899
3215
|
tool: params.tool,
|
|
2900
3216
|
onBack: goBack,
|
|
2901
3217
|
onExit: handleExit,
|
|
3218
|
+
onRunSuggestion: (sugTool, sugArgs) => {
|
|
3219
|
+
goHome();
|
|
3220
|
+
navigate("confirm-execute", { tool: sugTool, args: sugArgs });
|
|
3221
|
+
},
|
|
2902
3222
|
width
|
|
2903
3223
|
}
|
|
2904
3224
|
);
|
|
2905
3225
|
case "self-update":
|
|
2906
|
-
return /* @__PURE__ */
|
|
3226
|
+
return /* @__PURE__ */ jsx25(SelfUpdate, { onBack: goBack, onExit: handleExit, width });
|
|
2907
3227
|
case "tool-status":
|
|
2908
|
-
return /* @__PURE__ */
|
|
3228
|
+
return /* @__PURE__ */ jsx25(ToolStatus, { onBack: goBack, width });
|
|
2909
3229
|
case "project-config":
|
|
2910
|
-
return /* @__PURE__ */
|
|
3230
|
+
return /* @__PURE__ */ jsx25(ProjectConfig, { onBack: goBack, width });
|
|
2911
3231
|
case "pipeline-list":
|
|
2912
|
-
return /* @__PURE__ */
|
|
3232
|
+
return /* @__PURE__ */ jsx25(PipelineList, { onNavigate: navigate, onBack: goBack, width });
|
|
2913
3233
|
case "pipeline-builder":
|
|
2914
|
-
return /* @__PURE__ */
|
|
3234
|
+
return /* @__PURE__ */ jsx25(PipelineBuilder, { onBack: goBack, width, height });
|
|
2915
3235
|
case "pipeline-execution":
|
|
2916
|
-
return /* @__PURE__ */
|
|
3236
|
+
return /* @__PURE__ */ jsx25(
|
|
2917
3237
|
PipelineExecution,
|
|
2918
3238
|
{
|
|
2919
3239
|
pipelineId: params.pipelineId ?? "",
|
|
@@ -2923,21 +3243,21 @@ function AppClassic() {
|
|
|
2923
3243
|
}
|
|
2924
3244
|
);
|
|
2925
3245
|
default:
|
|
2926
|
-
return /* @__PURE__ */
|
|
3246
|
+
return /* @__PURE__ */ jsx25(Box22, { children: /* @__PURE__ */ jsxs24(Text26, { color: "red", children: [
|
|
2927
3247
|
"Unknown screen: ",
|
|
2928
3248
|
screen
|
|
2929
3249
|
] }) });
|
|
2930
3250
|
}
|
|
2931
3251
|
};
|
|
2932
|
-
return /* @__PURE__ */
|
|
2933
|
-
/* @__PURE__ */
|
|
3252
|
+
return /* @__PURE__ */ jsxs24(Box22, { flexDirection: "column", children: [
|
|
3253
|
+
/* @__PURE__ */ jsx25(GhostBanner, { width }),
|
|
2934
3254
|
renderScreen()
|
|
2935
3255
|
] });
|
|
2936
3256
|
}
|
|
2937
3257
|
|
|
2938
3258
|
// src/appPanel.tsx
|
|
2939
|
-
import
|
|
2940
|
-
import { Box as
|
|
3259
|
+
import React19 from "react";
|
|
3260
|
+
import { Box as Box30, Text as Text33, useApp as useApp2, useInput as useInput9 } from "ink";
|
|
2941
3261
|
|
|
2942
3262
|
// src/hooks/useFullscreen.ts
|
|
2943
3263
|
import { useEffect as useEffect8 } from "react";
|
|
@@ -2955,10 +3275,10 @@ function useFullscreen() {
|
|
|
2955
3275
|
}
|
|
2956
3276
|
|
|
2957
3277
|
// src/hooks/usePanelNavigation.ts
|
|
2958
|
-
import { useState as
|
|
3278
|
+
import { useState as useState17, useCallback as useCallback4 } from "react";
|
|
2959
3279
|
function usePanelNavigation() {
|
|
2960
|
-
const [state, setState] =
|
|
2961
|
-
view: "
|
|
3280
|
+
const [state, setState] = useState17({
|
|
3281
|
+
view: "pipelines",
|
|
2962
3282
|
featureId: "database",
|
|
2963
3283
|
innerScreen: "home",
|
|
2964
3284
|
innerParams: {},
|
|
@@ -3036,19 +3356,32 @@ function usePanelNavigation() {
|
|
|
3036
3356
|
innerStack: []
|
|
3037
3357
|
}));
|
|
3038
3358
|
}, []);
|
|
3359
|
+
const switchViewAndNavigate = useCallback4(
|
|
3360
|
+
(view, screen, params) => {
|
|
3361
|
+
setState((prev) => ({
|
|
3362
|
+
...prev,
|
|
3363
|
+
view,
|
|
3364
|
+
innerScreen: screen,
|
|
3365
|
+
innerParams: params ?? {},
|
|
3366
|
+
innerStack: [{ screen: "home", params: {} }]
|
|
3367
|
+
}));
|
|
3368
|
+
},
|
|
3369
|
+
[]
|
|
3370
|
+
);
|
|
3039
3371
|
return {
|
|
3040
3372
|
...state,
|
|
3041
3373
|
selectSidebarItem,
|
|
3042
3374
|
navigateInner,
|
|
3043
3375
|
goBackInner,
|
|
3044
|
-
goHomeInner
|
|
3376
|
+
goHomeInner,
|
|
3377
|
+
switchViewAndNavigate
|
|
3045
3378
|
};
|
|
3046
3379
|
}
|
|
3047
3380
|
|
|
3048
3381
|
// src/hooks/usePanelFocus.ts
|
|
3049
|
-
import { useState as
|
|
3382
|
+
import { useState as useState18, useCallback as useCallback5 } from "react";
|
|
3050
3383
|
function usePanelFocus() {
|
|
3051
|
-
const [focused, setFocused] =
|
|
3384
|
+
const [focused, setFocused] = useState18("sidebar");
|
|
3052
3385
|
const toggleFocus = useCallback5(() => {
|
|
3053
3386
|
setFocused((prev) => prev === "sidebar" ? "main" : "sidebar");
|
|
3054
3387
|
}, []);
|
|
@@ -3087,15 +3420,14 @@ function useSidebarItems() {
|
|
|
3087
3420
|
items.push({ id: "tool-status", label: "Tool Status", icon: "\u{1F527}", type: "action", section: "system" });
|
|
3088
3421
|
items.push({ id: "config", label: "Config", icon: "\u2699\uFE0F", type: "action", section: "system" });
|
|
3089
3422
|
items.push({ id: "self-update", label: "Update", icon: "\u2B06\uFE0F", type: "action", section: "system" });
|
|
3090
|
-
items.push({ id: "exit", label: "Exit", icon: "\u{1F6AA}", type: "action", section: "system" });
|
|
3091
3423
|
return items;
|
|
3092
3424
|
}, []);
|
|
3093
3425
|
}
|
|
3094
3426
|
|
|
3095
3427
|
// src/hooks/useModal.ts
|
|
3096
|
-
import { useState as
|
|
3428
|
+
import { useState as useState19, useCallback as useCallback6 } from "react";
|
|
3097
3429
|
function useModal() {
|
|
3098
|
-
const [state, setState] =
|
|
3430
|
+
const [state, setState] = useState19(null);
|
|
3099
3431
|
const openModal = useCallback6((content, title) => {
|
|
3100
3432
|
setState({ content, title });
|
|
3101
3433
|
}, []);
|
|
@@ -3112,8 +3444,8 @@ function useModal() {
|
|
|
3112
3444
|
}
|
|
3113
3445
|
|
|
3114
3446
|
// src/components/PanelLayout.tsx
|
|
3115
|
-
import { Box as
|
|
3116
|
-
import { jsx as
|
|
3447
|
+
import { Box as Box23 } from "ink";
|
|
3448
|
+
import { jsx as jsx26, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
3117
3449
|
function PanelLayout({
|
|
3118
3450
|
header,
|
|
3119
3451
|
footer,
|
|
@@ -3128,19 +3460,19 @@ function PanelLayout({
|
|
|
3128
3460
|
const contentHeight = Math.max(5, height - bannerHeight - footerHeight);
|
|
3129
3461
|
const sidebarWidth = singlePanel ? 0 : panel.sidebarWidth(width);
|
|
3130
3462
|
const mainWidth = singlePanel ? width : width - sidebarWidth;
|
|
3131
|
-
return /* @__PURE__ */
|
|
3463
|
+
return /* @__PURE__ */ jsxs25(Box23, { flexDirection: "column", width, height, children: [
|
|
3132
3464
|
header,
|
|
3133
|
-
/* @__PURE__ */
|
|
3134
|
-
!singlePanel && /* @__PURE__ */
|
|
3135
|
-
/* @__PURE__ */
|
|
3465
|
+
/* @__PURE__ */ jsxs25(Box23, { flexDirection: "row", height: contentHeight, children: [
|
|
3466
|
+
!singlePanel && /* @__PURE__ */ jsx26(Box23, { width: sidebarWidth, height: contentHeight, children: sidebar }),
|
|
3467
|
+
/* @__PURE__ */ jsx26(Box23, { width: mainWidth, height: contentHeight, children: main2 })
|
|
3136
3468
|
] }),
|
|
3137
|
-
/* @__PURE__ */
|
|
3469
|
+
/* @__PURE__ */ jsx26(Box23, { height: footerHeight, children: footer })
|
|
3138
3470
|
] });
|
|
3139
3471
|
}
|
|
3140
3472
|
|
|
3141
3473
|
// src/components/Panel.tsx
|
|
3142
|
-
import { Box as
|
|
3143
|
-
import { jsx as
|
|
3474
|
+
import { Box as Box24, Text as Text27 } from "ink";
|
|
3475
|
+
import { jsx as jsx27, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
3144
3476
|
function Panel({
|
|
3145
3477
|
id,
|
|
3146
3478
|
title,
|
|
@@ -3150,8 +3482,8 @@ function Panel({
|
|
|
3150
3482
|
children
|
|
3151
3483
|
}) {
|
|
3152
3484
|
const borderColor = focused ? panel.borderFocused : panel.borderDim;
|
|
3153
|
-
return /* @__PURE__ */
|
|
3154
|
-
|
|
3485
|
+
return /* @__PURE__ */ jsxs26(
|
|
3486
|
+
Box24,
|
|
3155
3487
|
{
|
|
3156
3488
|
flexDirection: "column",
|
|
3157
3489
|
width,
|
|
@@ -3160,21 +3492,21 @@ function Panel({
|
|
|
3160
3492
|
borderColor,
|
|
3161
3493
|
overflow: "hidden",
|
|
3162
3494
|
children: [
|
|
3163
|
-
title && /* @__PURE__ */
|
|
3495
|
+
title && /* @__PURE__ */ jsx27(Box24, { marginBottom: 0, children: /* @__PURE__ */ jsxs26(Text27, { color: focused ? inkColors.accent : void 0, bold: focused, dimColor: !focused, children: [
|
|
3164
3496
|
" ",
|
|
3165
3497
|
title,
|
|
3166
3498
|
" "
|
|
3167
3499
|
] }) }),
|
|
3168
|
-
/* @__PURE__ */
|
|
3500
|
+
/* @__PURE__ */ jsx27(Box24, { flexDirection: "column", flexGrow: 1, overflow: "hidden", children })
|
|
3169
3501
|
]
|
|
3170
3502
|
}
|
|
3171
3503
|
);
|
|
3172
3504
|
}
|
|
3173
3505
|
|
|
3174
3506
|
// src/components/Sidebar.tsx
|
|
3175
|
-
import { useEffect as useEffect9, useMemo as useMemo9, useState as
|
|
3176
|
-
import { Box as
|
|
3177
|
-
import { jsx as
|
|
3507
|
+
import { useEffect as useEffect9, useMemo as useMemo9, useState as useState20 } from "react";
|
|
3508
|
+
import { Box as Box25, Text as Text28, useInput as useInput8 } from "ink";
|
|
3509
|
+
import { jsx as jsx28, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
3178
3510
|
function groupSections(items) {
|
|
3179
3511
|
const groups = [];
|
|
3180
3512
|
let current = null;
|
|
@@ -3201,13 +3533,13 @@ function Sidebar({
|
|
|
3201
3533
|
[items]
|
|
3202
3534
|
);
|
|
3203
3535
|
const selectedIdx = selectableItems.findIndex((item) => item.id === selectedId);
|
|
3204
|
-
const [cursorIdx, setCursorIdx] =
|
|
3536
|
+
const [cursorIdx, setCursorIdx] = useState20(Math.max(0, selectedIdx));
|
|
3205
3537
|
const sections = useMemo9(() => groupSections(items), [items]);
|
|
3206
3538
|
useEffect9(() => {
|
|
3207
3539
|
const idx = selectableItems.findIndex((item) => item.id === selectedId);
|
|
3208
3540
|
if (idx >= 0) setCursorIdx(idx);
|
|
3209
3541
|
}, [selectedId, selectableItems]);
|
|
3210
|
-
|
|
3542
|
+
useInput8(
|
|
3211
3543
|
(input2, key) => {
|
|
3212
3544
|
if (key.upArrow || input2 === "k") {
|
|
3213
3545
|
setCursorIdx((prev) => {
|
|
@@ -3235,28 +3567,28 @@ function Sidebar({
|
|
|
3235
3567
|
{ isActive: isFocused }
|
|
3236
3568
|
);
|
|
3237
3569
|
let flatIdx = 0;
|
|
3238
|
-
return /* @__PURE__ */
|
|
3570
|
+
return /* @__PURE__ */ jsx28(Box25, { flexDirection: "column", gap: 0, children: sections.map((section) => {
|
|
3239
3571
|
const sectionStartIdx = flatIdx;
|
|
3240
3572
|
const sectionEndIdx = sectionStartIdx + section.items.length - 1;
|
|
3241
3573
|
const hasCursorInSection = isFocused && cursorIdx >= sectionStartIdx && cursorIdx <= sectionEndIdx;
|
|
3242
3574
|
const hasActiveInSection = section.items.some((item) => item.id === selectedId);
|
|
3243
3575
|
const borderColor = hasCursorInSection || hasActiveInSection ? inkColors.accent : "#555555";
|
|
3244
|
-
const rendered = /* @__PURE__ */
|
|
3245
|
-
|
|
3576
|
+
const rendered = /* @__PURE__ */ jsxs27(
|
|
3577
|
+
Box25,
|
|
3246
3578
|
{
|
|
3247
3579
|
flexDirection: "column",
|
|
3248
3580
|
borderStyle: "round",
|
|
3249
3581
|
borderColor,
|
|
3250
3582
|
paddingX: 1,
|
|
3251
3583
|
children: [
|
|
3252
|
-
/* @__PURE__ */
|
|
3584
|
+
/* @__PURE__ */ jsx28(Text28, { dimColor: true, bold: true, children: section.title }),
|
|
3253
3585
|
section.items.map((item) => {
|
|
3254
3586
|
const thisIdx = flatIdx;
|
|
3255
3587
|
flatIdx++;
|
|
3256
3588
|
const isCursor = isFocused && thisIdx === cursorIdx;
|
|
3257
3589
|
const isActive = item.id === selectedId;
|
|
3258
|
-
return /* @__PURE__ */
|
|
3259
|
-
|
|
3590
|
+
return /* @__PURE__ */ jsx28(Box25, { gap: 0, children: /* @__PURE__ */ jsxs27(
|
|
3591
|
+
Text28,
|
|
3260
3592
|
{
|
|
3261
3593
|
color: isCursor ? inkColors.accent : isActive ? inkColors.accent : void 0,
|
|
3262
3594
|
bold: isCursor || isActive,
|
|
@@ -3279,12 +3611,12 @@ function Sidebar({
|
|
|
3279
3611
|
}
|
|
3280
3612
|
|
|
3281
3613
|
// src/components/PanelFooter.tsx
|
|
3282
|
-
import { Box as
|
|
3283
|
-
import { jsx as
|
|
3614
|
+
import { Box as Box26, Text as Text29 } from "ink";
|
|
3615
|
+
import { jsx as jsx29, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
3284
3616
|
function PanelFooter({ hints, width }) {
|
|
3285
|
-
return /* @__PURE__ */
|
|
3286
|
-
/* @__PURE__ */
|
|
3287
|
-
/* @__PURE__ */
|
|
3617
|
+
return /* @__PURE__ */ jsx29(Box26, { width, children: /* @__PURE__ */ jsx29(Box26, { gap: 1, children: hints.map((hint) => /* @__PURE__ */ jsxs28(Box26, { gap: 0, children: [
|
|
3618
|
+
/* @__PURE__ */ jsx29(Text29, { color: inkColors.accent, bold: true, children: hint.key }),
|
|
3619
|
+
/* @__PURE__ */ jsxs28(Text29, { dimColor: true, children: [
|
|
3288
3620
|
":",
|
|
3289
3621
|
hint.action
|
|
3290
3622
|
] })
|
|
@@ -3292,8 +3624,8 @@ function PanelFooter({ hints, width }) {
|
|
|
3292
3624
|
}
|
|
3293
3625
|
|
|
3294
3626
|
// src/components/Modal.tsx
|
|
3295
|
-
import { Box as
|
|
3296
|
-
import { jsx as
|
|
3627
|
+
import { Box as Box27, Text as Text30 } from "ink";
|
|
3628
|
+
import { jsx as jsx30, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
3297
3629
|
function Modal({
|
|
3298
3630
|
title,
|
|
3299
3631
|
width,
|
|
@@ -3304,10 +3636,10 @@ function Modal({
|
|
|
3304
3636
|
const modalHeight = Math.min(height - 4, 20);
|
|
3305
3637
|
const padX = Math.max(0, Math.floor((width - modalWidth) / 2));
|
|
3306
3638
|
const padY = Math.max(0, Math.floor((height - modalHeight) / 2));
|
|
3307
|
-
return /* @__PURE__ */
|
|
3308
|
-
padY > 0 && /* @__PURE__ */
|
|
3309
|
-
/* @__PURE__ */
|
|
3310
|
-
|
|
3639
|
+
return /* @__PURE__ */ jsxs29(Box27, { flexDirection: "column", width, height, children: [
|
|
3640
|
+
padY > 0 && /* @__PURE__ */ jsx30(Box27, { height: padY }),
|
|
3641
|
+
/* @__PURE__ */ jsx30(Box27, { marginLeft: padX, children: /* @__PURE__ */ jsxs29(
|
|
3642
|
+
Box27,
|
|
3311
3643
|
{
|
|
3312
3644
|
flexDirection: "column",
|
|
3313
3645
|
width: modalWidth,
|
|
@@ -3316,8 +3648,8 @@ function Modal({
|
|
|
3316
3648
|
borderColor: inkColors.accent,
|
|
3317
3649
|
paddingX: 1,
|
|
3318
3650
|
children: [
|
|
3319
|
-
/* @__PURE__ */
|
|
3320
|
-
/* @__PURE__ */
|
|
3651
|
+
/* @__PURE__ */ jsx30(Box27, { marginBottom: 1, children: /* @__PURE__ */ jsx30(Text30, { color: inkColors.accent, bold: true, children: title }) }),
|
|
3652
|
+
/* @__PURE__ */ jsx30(Box27, { flexDirection: "column", flexGrow: 1, overflow: "hidden", children })
|
|
3321
3653
|
]
|
|
3322
3654
|
}
|
|
3323
3655
|
) })
|
|
@@ -3325,9 +3657,9 @@ function Modal({
|
|
|
3325
3657
|
}
|
|
3326
3658
|
|
|
3327
3659
|
// src/components/FeatureCommands.tsx
|
|
3328
|
-
import { useEffect as useEffect10, useMemo as useMemo10, useState as
|
|
3329
|
-
import { Box as
|
|
3330
|
-
import { jsx as
|
|
3660
|
+
import { useEffect as useEffect10, useMemo as useMemo10, useState as useState21 } from "react";
|
|
3661
|
+
import { Box as Box28, Text as Text31 } from "ink";
|
|
3662
|
+
import { jsx as jsx31, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
3331
3663
|
function FeatureCommands({
|
|
3332
3664
|
feature,
|
|
3333
3665
|
onNavigate,
|
|
@@ -3338,9 +3670,9 @@ function FeatureCommands({
|
|
|
3338
3670
|
height = 24,
|
|
3339
3671
|
isInputActive = true
|
|
3340
3672
|
}) {
|
|
3341
|
-
const [pinnedCommands, setPinnedCommands2] =
|
|
3342
|
-
const [pinnedRuns, setPinnedRuns2] =
|
|
3343
|
-
const [pinFeedback, setPinFeedback] =
|
|
3673
|
+
const [pinnedCommands, setPinnedCommands2] = useState21(() => getPinnedCommands());
|
|
3674
|
+
const [pinnedRuns, setPinnedRuns2] = useState21(() => getPinnedRuns());
|
|
3675
|
+
const [pinFeedback, setPinFeedback] = useState21();
|
|
3344
3676
|
useEffect10(() => {
|
|
3345
3677
|
if (!pinFeedback) return;
|
|
3346
3678
|
const timeout = setTimeout(() => setPinFeedback(void 0), 1400);
|
|
@@ -3351,7 +3683,8 @@ function FeatureCommands({
|
|
|
3351
3683
|
activeFeature: feature,
|
|
3352
3684
|
pinnedCommands,
|
|
3353
3685
|
pinnedRuns,
|
|
3354
|
-
showPinnedSection: false
|
|
3686
|
+
showPinnedSection: false,
|
|
3687
|
+
showFeatureHeader: false
|
|
3355
3688
|
}),
|
|
3356
3689
|
[feature, pinnedCommands, pinnedRuns]
|
|
3357
3690
|
);
|
|
@@ -3408,17 +3741,12 @@ function FeatureCommands({
|
|
|
3408
3741
|
);
|
|
3409
3742
|
}
|
|
3410
3743
|
};
|
|
3411
|
-
return /* @__PURE__ */
|
|
3412
|
-
/* @__PURE__ */
|
|
3413
|
-
feature.icon,
|
|
3414
|
-
" ",
|
|
3415
|
-
feature.label
|
|
3416
|
-
] }) }),
|
|
3417
|
-
pinFeedback && /* @__PURE__ */ jsx29(Box27, { marginBottom: 1, children: /* @__PURE__ */ jsxs29(Text28, { color: inkColors.accent, children: [
|
|
3744
|
+
return /* @__PURE__ */ jsxs30(Box28, { flexDirection: "column", paddingX: 1, children: [
|
|
3745
|
+
pinFeedback && /* @__PURE__ */ jsx31(Box28, { marginBottom: 1, children: /* @__PURE__ */ jsxs30(Text31, { color: inkColors.accent, children: [
|
|
3418
3746
|
"\u2713 ",
|
|
3419
3747
|
pinFeedback
|
|
3420
3748
|
] }) }),
|
|
3421
|
-
/* @__PURE__ */
|
|
3749
|
+
/* @__PURE__ */ jsx31(
|
|
3422
3750
|
SelectList,
|
|
3423
3751
|
{
|
|
3424
3752
|
items,
|
|
@@ -3429,16 +3757,17 @@ function FeatureCommands({
|
|
|
3429
3757
|
maxVisible: Math.max(6, height - 6),
|
|
3430
3758
|
onCancel: onBack,
|
|
3431
3759
|
isInputActive,
|
|
3432
|
-
arrowNavigation: true
|
|
3760
|
+
arrowNavigation: true,
|
|
3761
|
+
panelFocused: isInputActive
|
|
3433
3762
|
}
|
|
3434
3763
|
)
|
|
3435
3764
|
] });
|
|
3436
3765
|
}
|
|
3437
3766
|
|
|
3438
3767
|
// src/components/PinnedCommands.tsx
|
|
3439
|
-
import { useEffect as useEffect11, useMemo as useMemo11, useState as
|
|
3440
|
-
import { Box as
|
|
3441
|
-
import { jsx as
|
|
3768
|
+
import { useEffect as useEffect11, useMemo as useMemo11, useState as useState22 } from "react";
|
|
3769
|
+
import { Box as Box29, Text as Text32 } from "ink";
|
|
3770
|
+
import { jsx as jsx32, jsxs as jsxs31 } from "react/jsx-runtime";
|
|
3442
3771
|
function PinnedCommands({
|
|
3443
3772
|
onNavigate,
|
|
3444
3773
|
onBack,
|
|
@@ -3447,9 +3776,9 @@ function PinnedCommands({
|
|
|
3447
3776
|
height = 24,
|
|
3448
3777
|
isInputActive = true
|
|
3449
3778
|
}) {
|
|
3450
|
-
const [pinnedCommands, setPinnedCommands2] =
|
|
3451
|
-
const [pinnedRuns, setPinnedRuns2] =
|
|
3452
|
-
const [pinFeedback, setPinFeedback] =
|
|
3779
|
+
const [pinnedCommands, setPinnedCommands2] = useState22(() => getPinnedCommands());
|
|
3780
|
+
const [pinnedRuns, setPinnedRuns2] = useState22(() => getPinnedRuns());
|
|
3781
|
+
const [pinFeedback, setPinFeedback] = useState22();
|
|
3453
3782
|
useEffect11(() => {
|
|
3454
3783
|
if (!pinFeedback) return;
|
|
3455
3784
|
const timeout = setTimeout(() => setPinFeedback(void 0), 1400);
|
|
@@ -3512,18 +3841,14 @@ function PinnedCommands({
|
|
|
3512
3841
|
}
|
|
3513
3842
|
};
|
|
3514
3843
|
if (items.length === 0) {
|
|
3515
|
-
return /* @__PURE__ */
|
|
3516
|
-
/* @__PURE__ */ jsx30(Box28, { marginBottom: 1, children: /* @__PURE__ */ jsx30(Text29, { color: inkColors.accent, bold: true, children: "\u{1F4CC} Pinned" }) }),
|
|
3517
|
-
/* @__PURE__ */ jsx30(Text29, { color: "gray", children: "No pinned items. Press p on any command to pin it." })
|
|
3518
|
-
] });
|
|
3844
|
+
return /* @__PURE__ */ jsx32(Box29, { flexDirection: "column", paddingX: 1, children: /* @__PURE__ */ jsx32(Text32, { color: "gray", children: "No pinned items. Press p on any command to pin it." }) });
|
|
3519
3845
|
}
|
|
3520
|
-
return /* @__PURE__ */
|
|
3521
|
-
/* @__PURE__ */
|
|
3522
|
-
pinFeedback && /* @__PURE__ */ jsx30(Box28, { marginBottom: 1, children: /* @__PURE__ */ jsxs30(Text29, { color: inkColors.accent, children: [
|
|
3846
|
+
return /* @__PURE__ */ jsxs31(Box29, { flexDirection: "column", paddingX: 1, children: [
|
|
3847
|
+
pinFeedback && /* @__PURE__ */ jsx32(Box29, { marginBottom: 1, children: /* @__PURE__ */ jsxs31(Text32, { color: inkColors.accent, children: [
|
|
3523
3848
|
"\u2713 ",
|
|
3524
3849
|
pinFeedback
|
|
3525
3850
|
] }) }),
|
|
3526
|
-
/* @__PURE__ */
|
|
3851
|
+
/* @__PURE__ */ jsx32(
|
|
3527
3852
|
SelectList,
|
|
3528
3853
|
{
|
|
3529
3854
|
items,
|
|
@@ -3534,14 +3859,15 @@ function PinnedCommands({
|
|
|
3534
3859
|
maxVisible: Math.max(6, height - 6),
|
|
3535
3860
|
onCancel: onBack,
|
|
3536
3861
|
isInputActive,
|
|
3537
|
-
arrowNavigation: true
|
|
3862
|
+
arrowNavigation: true,
|
|
3863
|
+
panelFocused: isInputActive
|
|
3538
3864
|
}
|
|
3539
3865
|
)
|
|
3540
3866
|
] });
|
|
3541
3867
|
}
|
|
3542
3868
|
|
|
3543
3869
|
// src/appPanel.tsx
|
|
3544
|
-
import { jsx as
|
|
3870
|
+
import { jsx as jsx33, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
3545
3871
|
var screenLabels = {
|
|
3546
3872
|
"command-args": "Args",
|
|
3547
3873
|
"flag-selection": "Flags",
|
|
@@ -3558,26 +3884,28 @@ var screenLabels = {
|
|
|
3558
3884
|
function buildBreadcrumb(nav) {
|
|
3559
3885
|
let base;
|
|
3560
3886
|
switch (nav.view) {
|
|
3561
|
-
case "feature":
|
|
3562
|
-
|
|
3887
|
+
case "feature": {
|
|
3888
|
+
const feat = getFeatureById(nav.featureId);
|
|
3889
|
+
base = feat ? `${feat.icon} ${feat.label}` : nav.featureId;
|
|
3563
3890
|
break;
|
|
3891
|
+
}
|
|
3564
3892
|
case "pinned":
|
|
3565
|
-
base = "Pinned";
|
|
3893
|
+
base = "\u{1F4CC} Pinned";
|
|
3566
3894
|
break;
|
|
3567
3895
|
case "custom-command":
|
|
3568
|
-
base = "Custom Cmd";
|
|
3896
|
+
base = "\u270F\uFE0F Custom Cmd";
|
|
3569
3897
|
break;
|
|
3570
3898
|
case "pipelines":
|
|
3571
|
-
base = "Pipelines";
|
|
3899
|
+
base = "\u{1F517} Pipelines";
|
|
3572
3900
|
break;
|
|
3573
3901
|
case "tool-status":
|
|
3574
|
-
base = "Status";
|
|
3902
|
+
base = "\u{1F527} Status";
|
|
3575
3903
|
break;
|
|
3576
3904
|
case "config":
|
|
3577
|
-
base = "Config";
|
|
3905
|
+
base = "\u2699\uFE0F Config";
|
|
3578
3906
|
break;
|
|
3579
3907
|
case "self-update":
|
|
3580
|
-
base = "Update";
|
|
3908
|
+
base = "\u2B06\uFE0F Update";
|
|
3581
3909
|
break;
|
|
3582
3910
|
default:
|
|
3583
3911
|
base = nav.view;
|
|
@@ -3595,12 +3923,12 @@ function buildBreadcrumb(nav) {
|
|
|
3595
3923
|
return parts.join(" \u203A ");
|
|
3596
3924
|
}
|
|
3597
3925
|
var FOOTER_HINTS = [
|
|
3598
|
-
{ key: "
|
|
3926
|
+
{ key: "Tab", action: "focus" },
|
|
3927
|
+
{ key: "\u2190/Esc", action: "back" },
|
|
3928
|
+
{ key: "\u2192/Enter", action: "select" },
|
|
3599
3929
|
{ key: "j/k", action: "nav" },
|
|
3600
|
-
{ key: "Enter", action: "select" },
|
|
3601
|
-
{ key: "Esc", action: "back" },
|
|
3602
|
-
{ key: "q", action: "quit" },
|
|
3603
3930
|
{ key: "p", action: "pin" },
|
|
3931
|
+
{ key: "q", action: "quit" },
|
|
3604
3932
|
{ key: "?", action: "help" }
|
|
3605
3933
|
];
|
|
3606
3934
|
function AppPanel() {
|
|
@@ -3611,7 +3939,7 @@ function AppPanel() {
|
|
|
3611
3939
|
const focus = usePanelFocus();
|
|
3612
3940
|
const sidebarItems = useSidebarItems();
|
|
3613
3941
|
const modal = useModal();
|
|
3614
|
-
const refreshPins =
|
|
3942
|
+
const refreshPins = React19.useCallback(() => {
|
|
3615
3943
|
}, []);
|
|
3616
3944
|
const singlePanel = width < 60 || height < 15;
|
|
3617
3945
|
const handleExit = () => {
|
|
@@ -3620,7 +3948,7 @@ function AppPanel() {
|
|
|
3620
3948
|
);
|
|
3621
3949
|
exit();
|
|
3622
3950
|
};
|
|
3623
|
-
|
|
3951
|
+
useInput9((input2, key) => {
|
|
3624
3952
|
if (modal.isOpen) {
|
|
3625
3953
|
if (key.escape || input2 === "q") {
|
|
3626
3954
|
modal.closeModal();
|
|
@@ -3645,37 +3973,37 @@ function AppPanel() {
|
|
|
3645
3973
|
}
|
|
3646
3974
|
if (input2 === "?") {
|
|
3647
3975
|
modal.openModal(
|
|
3648
|
-
/* @__PURE__ */
|
|
3649
|
-
/* @__PURE__ */
|
|
3650
|
-
/* @__PURE__ */
|
|
3976
|
+
/* @__PURE__ */ jsxs32(Box30, { flexDirection: "column", children: [
|
|
3977
|
+
/* @__PURE__ */ jsxs32(Text33, { children: [
|
|
3978
|
+
/* @__PURE__ */ jsx33(Text33, { bold: true, children: "\u2190/\u2192" }),
|
|
3651
3979
|
" Move between sidebar and main panel"
|
|
3652
3980
|
] }),
|
|
3653
|
-
/* @__PURE__ */
|
|
3654
|
-
/* @__PURE__ */
|
|
3981
|
+
/* @__PURE__ */ jsxs32(Text33, { children: [
|
|
3982
|
+
/* @__PURE__ */ jsx33(Text33, { bold: true, children: "Tab" }),
|
|
3655
3983
|
" Toggle sidebar / main panel"
|
|
3656
3984
|
] }),
|
|
3657
|
-
/* @__PURE__ */
|
|
3658
|
-
/* @__PURE__ */
|
|
3985
|
+
/* @__PURE__ */ jsxs32(Text33, { children: [
|
|
3986
|
+
/* @__PURE__ */ jsx33(Text33, { bold: true, children: "j/k" }),
|
|
3659
3987
|
" Navigate up/down"
|
|
3660
3988
|
] }),
|
|
3661
|
-
/* @__PURE__ */
|
|
3662
|
-
/* @__PURE__ */
|
|
3989
|
+
/* @__PURE__ */ jsxs32(Text33, { children: [
|
|
3990
|
+
/* @__PURE__ */ jsx33(Text33, { bold: true, children: "Enter" }),
|
|
3663
3991
|
" Select item"
|
|
3664
3992
|
] }),
|
|
3665
|
-
/* @__PURE__ */
|
|
3666
|
-
/* @__PURE__ */
|
|
3993
|
+
/* @__PURE__ */ jsxs32(Text33, { children: [
|
|
3994
|
+
/* @__PURE__ */ jsx33(Text33, { bold: true, children: "Esc" }),
|
|
3667
3995
|
" Go back (or return to sidebar)"
|
|
3668
3996
|
] }),
|
|
3669
|
-
/* @__PURE__ */
|
|
3670
|
-
/* @__PURE__ */
|
|
3997
|
+
/* @__PURE__ */ jsxs32(Text33, { children: [
|
|
3998
|
+
/* @__PURE__ */ jsx33(Text33, { bold: true, children: "q" }),
|
|
3671
3999
|
" Quit Polter"
|
|
3672
4000
|
] }),
|
|
3673
|
-
/* @__PURE__ */
|
|
3674
|
-
/* @__PURE__ */
|
|
4001
|
+
/* @__PURE__ */ jsxs32(Text33, { children: [
|
|
4002
|
+
/* @__PURE__ */ jsx33(Text33, { bold: true, children: "?" }),
|
|
3675
4003
|
" Show this help"
|
|
3676
4004
|
] }),
|
|
3677
|
-
/* @__PURE__ */
|
|
3678
|
-
/* @__PURE__ */
|
|
4005
|
+
/* @__PURE__ */ jsxs32(Text33, { children: [
|
|
4006
|
+
/* @__PURE__ */ jsx33(Text33, { bold: true, children: "p" }),
|
|
3679
4007
|
" Pin/unpin command"
|
|
3680
4008
|
] })
|
|
3681
4009
|
] }),
|
|
@@ -3725,7 +4053,7 @@ function AppPanel() {
|
|
|
3725
4053
|
}
|
|
3726
4054
|
switch (nav.view) {
|
|
3727
4055
|
case "pinned":
|
|
3728
|
-
return /* @__PURE__ */
|
|
4056
|
+
return /* @__PURE__ */ jsx33(
|
|
3729
4057
|
PinnedCommands,
|
|
3730
4058
|
{
|
|
3731
4059
|
onNavigate: nav.navigateInner,
|
|
@@ -3739,12 +4067,12 @@ function AppPanel() {
|
|
|
3739
4067
|
case "feature": {
|
|
3740
4068
|
const feature = getFeatureById(nav.featureId);
|
|
3741
4069
|
if (!feature) {
|
|
3742
|
-
return /* @__PURE__ */
|
|
4070
|
+
return /* @__PURE__ */ jsxs32(Text33, { color: "red", children: [
|
|
3743
4071
|
"Feature not found: ",
|
|
3744
4072
|
nav.featureId
|
|
3745
4073
|
] });
|
|
3746
4074
|
}
|
|
3747
|
-
return /* @__PURE__ */
|
|
4075
|
+
return /* @__PURE__ */ jsx33(
|
|
3748
4076
|
FeatureCommands,
|
|
3749
4077
|
{
|
|
3750
4078
|
feature,
|
|
@@ -3759,7 +4087,7 @@ function AppPanel() {
|
|
|
3759
4087
|
);
|
|
3760
4088
|
}
|
|
3761
4089
|
case "custom-command":
|
|
3762
|
-
return /* @__PURE__ */
|
|
4090
|
+
return /* @__PURE__ */ jsx33(
|
|
3763
4091
|
CustomCommand,
|
|
3764
4092
|
{
|
|
3765
4093
|
onNavigate: nav.navigateInner,
|
|
@@ -3771,7 +4099,7 @@ function AppPanel() {
|
|
|
3771
4099
|
}
|
|
3772
4100
|
);
|
|
3773
4101
|
case "pipelines":
|
|
3774
|
-
return /* @__PURE__ */
|
|
4102
|
+
return /* @__PURE__ */ jsx33(
|
|
3775
4103
|
PipelineList,
|
|
3776
4104
|
{
|
|
3777
4105
|
onNavigate: nav.navigateInner,
|
|
@@ -3783,7 +4111,7 @@ function AppPanel() {
|
|
|
3783
4111
|
}
|
|
3784
4112
|
);
|
|
3785
4113
|
case "tool-status":
|
|
3786
|
-
return /* @__PURE__ */
|
|
4114
|
+
return /* @__PURE__ */ jsx33(
|
|
3787
4115
|
ToolStatus,
|
|
3788
4116
|
{
|
|
3789
4117
|
onBack: focus.focusSidebar,
|
|
@@ -3794,7 +4122,7 @@ function AppPanel() {
|
|
|
3794
4122
|
}
|
|
3795
4123
|
);
|
|
3796
4124
|
case "config":
|
|
3797
|
-
return /* @__PURE__ */
|
|
4125
|
+
return /* @__PURE__ */ jsx33(
|
|
3798
4126
|
ProjectConfig,
|
|
3799
4127
|
{
|
|
3800
4128
|
onBack: focus.focusSidebar,
|
|
@@ -3805,7 +4133,7 @@ function AppPanel() {
|
|
|
3805
4133
|
}
|
|
3806
4134
|
);
|
|
3807
4135
|
case "self-update":
|
|
3808
|
-
return /* @__PURE__ */
|
|
4136
|
+
return /* @__PURE__ */ jsx33(
|
|
3809
4137
|
SelfUpdate,
|
|
3810
4138
|
{
|
|
3811
4139
|
onBack: focus.focusSidebar,
|
|
@@ -3817,7 +4145,7 @@ function AppPanel() {
|
|
|
3817
4145
|
}
|
|
3818
4146
|
);
|
|
3819
4147
|
default:
|
|
3820
|
-
return /* @__PURE__ */
|
|
4148
|
+
return /* @__PURE__ */ jsx33(Text33, { children: "Select an item from the sidebar" });
|
|
3821
4149
|
}
|
|
3822
4150
|
};
|
|
3823
4151
|
const renderInnerScreen = () => {
|
|
@@ -3825,7 +4153,7 @@ function AppPanel() {
|
|
|
3825
4153
|
const w = mainContentWidth - 2;
|
|
3826
4154
|
switch (nav.innerScreen) {
|
|
3827
4155
|
case "command-args":
|
|
3828
|
-
return /* @__PURE__ */
|
|
4156
|
+
return /* @__PURE__ */ jsx33(
|
|
3829
4157
|
CommandArgs,
|
|
3830
4158
|
{
|
|
3831
4159
|
command: nav.innerParams.command ?? "",
|
|
@@ -3838,7 +4166,7 @@ function AppPanel() {
|
|
|
3838
4166
|
}
|
|
3839
4167
|
);
|
|
3840
4168
|
case "custom-command":
|
|
3841
|
-
return /* @__PURE__ */
|
|
4169
|
+
return /* @__PURE__ */ jsx33(
|
|
3842
4170
|
CustomCommand,
|
|
3843
4171
|
{
|
|
3844
4172
|
onNavigate: nav.navigateInner,
|
|
@@ -3850,7 +4178,7 @@ function AppPanel() {
|
|
|
3850
4178
|
}
|
|
3851
4179
|
);
|
|
3852
4180
|
case "flag-selection":
|
|
3853
|
-
return /* @__PURE__ */
|
|
4181
|
+
return /* @__PURE__ */ jsx33(
|
|
3854
4182
|
FlagSelection,
|
|
3855
4183
|
{
|
|
3856
4184
|
args: nav.innerParams.args ?? [],
|
|
@@ -3858,27 +4186,33 @@ function AppPanel() {
|
|
|
3858
4186
|
onNavigate: nav.navigateInner,
|
|
3859
4187
|
onBack: nav.goBackInner,
|
|
3860
4188
|
width: w,
|
|
4189
|
+
height: mainContentHeight,
|
|
3861
4190
|
panelMode: true,
|
|
3862
4191
|
isInputActive: isActive
|
|
3863
4192
|
}
|
|
3864
4193
|
);
|
|
3865
4194
|
case "confirm-execute":
|
|
3866
4195
|
case "command-execution":
|
|
3867
|
-
return /* @__PURE__ */
|
|
4196
|
+
return /* @__PURE__ */ jsx33(
|
|
3868
4197
|
CommandExecution,
|
|
3869
4198
|
{
|
|
3870
4199
|
args: nav.innerParams.args ?? [],
|
|
3871
4200
|
tool: nav.innerParams.tool,
|
|
3872
4201
|
onBack: nav.goBackInner,
|
|
4202
|
+
onHome: nav.goHomeInner,
|
|
3873
4203
|
onExit: handleExit,
|
|
4204
|
+
onRunSuggestion: (sugTool, sugArgs) => {
|
|
4205
|
+
nav.switchViewAndNavigate("custom-command", "confirm-execute", { tool: sugTool, args: sugArgs });
|
|
4206
|
+
},
|
|
3874
4207
|
width: w,
|
|
3875
4208
|
height: mainContentHeight,
|
|
3876
4209
|
panelMode: true,
|
|
3877
4210
|
isInputActive: isActive
|
|
3878
|
-
}
|
|
4211
|
+
},
|
|
4212
|
+
`${nav.view}-${nav.innerParams.tool}-${(nav.innerParams.args ?? []).join("-")}`
|
|
3879
4213
|
);
|
|
3880
4214
|
case "pipeline-list":
|
|
3881
|
-
return /* @__PURE__ */
|
|
4215
|
+
return /* @__PURE__ */ jsx33(
|
|
3882
4216
|
PipelineList,
|
|
3883
4217
|
{
|
|
3884
4218
|
onNavigate: nav.navigateInner,
|
|
@@ -3890,7 +4224,7 @@ function AppPanel() {
|
|
|
3890
4224
|
}
|
|
3891
4225
|
);
|
|
3892
4226
|
case "pipeline-builder":
|
|
3893
|
-
return /* @__PURE__ */
|
|
4227
|
+
return /* @__PURE__ */ jsx33(
|
|
3894
4228
|
PipelineBuilder,
|
|
3895
4229
|
{
|
|
3896
4230
|
onBack: nav.goBackInner,
|
|
@@ -3901,7 +4235,7 @@ function AppPanel() {
|
|
|
3901
4235
|
}
|
|
3902
4236
|
);
|
|
3903
4237
|
case "pipeline-execution":
|
|
3904
|
-
return /* @__PURE__ */
|
|
4238
|
+
return /* @__PURE__ */ jsx33(
|
|
3905
4239
|
PipelineExecution,
|
|
3906
4240
|
{
|
|
3907
4241
|
pipelineId: nav.innerParams.pipelineId ?? "",
|
|
@@ -3913,7 +4247,7 @@ function AppPanel() {
|
|
|
3913
4247
|
}
|
|
3914
4248
|
);
|
|
3915
4249
|
case "self-update":
|
|
3916
|
-
return /* @__PURE__ */
|
|
4250
|
+
return /* @__PURE__ */ jsx33(
|
|
3917
4251
|
SelfUpdate,
|
|
3918
4252
|
{
|
|
3919
4253
|
onBack: nav.goBackInner,
|
|
@@ -3925,7 +4259,7 @@ function AppPanel() {
|
|
|
3925
4259
|
}
|
|
3926
4260
|
);
|
|
3927
4261
|
case "tool-status":
|
|
3928
|
-
return /* @__PURE__ */
|
|
4262
|
+
return /* @__PURE__ */ jsx33(
|
|
3929
4263
|
ToolStatus,
|
|
3930
4264
|
{
|
|
3931
4265
|
onBack: nav.goBackInner,
|
|
@@ -3936,7 +4270,7 @@ function AppPanel() {
|
|
|
3936
4270
|
}
|
|
3937
4271
|
);
|
|
3938
4272
|
case "project-config":
|
|
3939
|
-
return /* @__PURE__ */
|
|
4273
|
+
return /* @__PURE__ */ jsx33(
|
|
3940
4274
|
ProjectConfig,
|
|
3941
4275
|
{
|
|
3942
4276
|
onBack: nav.goBackInner,
|
|
@@ -3947,17 +4281,17 @@ function AppPanel() {
|
|
|
3947
4281
|
}
|
|
3948
4282
|
);
|
|
3949
4283
|
default:
|
|
3950
|
-
return /* @__PURE__ */
|
|
4284
|
+
return /* @__PURE__ */ jsxs32(Text33, { color: "red", children: [
|
|
3951
4285
|
"Unknown screen: ",
|
|
3952
4286
|
nav.innerScreen
|
|
3953
4287
|
] });
|
|
3954
4288
|
}
|
|
3955
4289
|
};
|
|
3956
4290
|
if (modal.isOpen) {
|
|
3957
|
-
return /* @__PURE__ */
|
|
4291
|
+
return /* @__PURE__ */ jsx33(Box30, { flexDirection: "column", width, height, children: /* @__PURE__ */ jsx33(Modal, { title: modal.modalTitle, width, height, children: modal.modalContent }) });
|
|
3958
4292
|
}
|
|
3959
|
-
const header = /* @__PURE__ */
|
|
3960
|
-
const sidebar = /* @__PURE__ */
|
|
4293
|
+
const header = /* @__PURE__ */ jsx33(GhostBanner, { width, compact: true });
|
|
4294
|
+
const sidebar = /* @__PURE__ */ jsx33(
|
|
3961
4295
|
Panel,
|
|
3962
4296
|
{
|
|
3963
4297
|
id: "sidebar",
|
|
@@ -3965,7 +4299,7 @@ function AppPanel() {
|
|
|
3965
4299
|
width: Math.max(20, Math.min(35, Math.floor(width * 0.3))),
|
|
3966
4300
|
height: Math.max(5, height - bannerHeight - 1),
|
|
3967
4301
|
focused: focus.isSidebarFocused,
|
|
3968
|
-
children: /* @__PURE__ */
|
|
4302
|
+
children: /* @__PURE__ */ jsx33(
|
|
3969
4303
|
Sidebar,
|
|
3970
4304
|
{
|
|
3971
4305
|
items: sidebarItems,
|
|
@@ -3978,7 +4312,7 @@ function AppPanel() {
|
|
|
3978
4312
|
)
|
|
3979
4313
|
}
|
|
3980
4314
|
);
|
|
3981
|
-
const main2 = /* @__PURE__ */
|
|
4315
|
+
const main2 = /* @__PURE__ */ jsx33(
|
|
3982
4316
|
Panel,
|
|
3983
4317
|
{
|
|
3984
4318
|
id: "main",
|
|
@@ -3989,8 +4323,8 @@ function AppPanel() {
|
|
|
3989
4323
|
children: renderMainContent()
|
|
3990
4324
|
}
|
|
3991
4325
|
);
|
|
3992
|
-
const footer = /* @__PURE__ */
|
|
3993
|
-
return /* @__PURE__ */
|
|
4326
|
+
const footer = /* @__PURE__ */ jsx33(PanelFooter, { hints: footerHints, width });
|
|
4327
|
+
return /* @__PURE__ */ jsx33(
|
|
3994
4328
|
PanelLayout,
|
|
3995
4329
|
{
|
|
3996
4330
|
header,
|
|
@@ -5264,11 +5598,11 @@ Apply completed with ${errors.length} error(s).
|
|
|
5264
5598
|
process.exit(result.exitCode ?? 0);
|
|
5265
5599
|
}
|
|
5266
5600
|
const AppComponent2 = parsed.classic ? AppClassic : AppPanel;
|
|
5267
|
-
render(
|
|
5601
|
+
render(React20.createElement(AppComponent2));
|
|
5268
5602
|
return;
|
|
5269
5603
|
}
|
|
5270
5604
|
const AppComponent = parsed.classic ? AppClassic : AppPanel;
|
|
5271
|
-
render(
|
|
5605
|
+
render(React20.createElement(AppComponent));
|
|
5272
5606
|
}
|
|
5273
5607
|
main().catch((error) => {
|
|
5274
5608
|
const message = error instanceof Error ? error.message : String(error);
|