@polterware/polter 0.2.0 → 0.2.2

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/index.js CHANGED
@@ -21,17 +21,18 @@ import {
21
21
  planChanges,
22
22
  resolveToolCommand,
23
23
  runCommand,
24
+ runInteractiveCommand,
24
25
  runSupabaseCommand,
25
26
  savePipeline,
26
27
  writeProjectConfig
27
- } from "./chunk-2OZZNSKW.js";
28
+ } from "./chunk-2MXXRP4H.js";
28
29
 
29
30
  // src/index.tsx
30
- import React19 from "react";
31
+ import React20 from "react";
31
32
  import { render } from "ink";
32
33
 
33
34
  // src/app.tsx
34
- import { Box as Box21, Text as Text23, useApp } from "ink";
35
+ import { Box as Box22, Text as Text26, useApp } from "ink";
35
36
 
36
37
  // src/hooks/useNavigation.ts
37
38
  import { useState, useCallback } from "react";
@@ -403,7 +404,8 @@ function SelectList({
403
404
  boxedSections = false,
404
405
  width = 80,
405
406
  isInputActive = true,
406
- arrowNavigation = false
407
+ arrowNavigation = false,
408
+ panelFocused = true
407
409
  }) {
408
410
  const labelWidth = labelWidthProp ?? Math.max(16, Math.floor(width * 0.45));
409
411
  const isNarrow = width < 50;
@@ -564,7 +566,7 @@ function SelectList({
564
566
  {
565
567
  flexDirection: "column",
566
568
  borderStyle: "round",
567
- borderColor: inkColors.accent,
569
+ borderColor: panelFocused ? inkColors.accent : panel.borderDim,
568
570
  borderDimColor: !hasSelectedRow && !isPinnedSection,
569
571
  paddingX: 1,
570
572
  children: [
@@ -723,7 +725,8 @@ function buildHomeItems({
723
725
  activeFeature,
724
726
  pinnedCommands,
725
727
  pinnedRuns,
726
- showPinnedSection = true
728
+ showPinnedSection = true,
729
+ showFeatureHeader = true
727
730
  }) {
728
731
  const items = [];
729
732
  if (showPinnedSection && (pinnedRuns.length > 0 || pinnedCommands.length > 0)) {
@@ -736,13 +739,15 @@ function buildHomeItems({
736
739
  });
737
740
  items.push(...buildPinnedOnlyItems(pinnedCommands, pinnedRuns));
738
741
  }
739
- items.push({
740
- id: "section-commands",
741
- value: "__section_commands__",
742
- label: `\u{1F4C2} ${activeFeature.label} Commands`,
743
- kind: "header",
744
- selectable: false
745
- });
742
+ if (showFeatureHeader) {
743
+ items.push({
744
+ id: "section-commands",
745
+ value: "__section_commands__",
746
+ label: `\u{1F4C2} ${activeFeature.label} Commands`,
747
+ kind: "header",
748
+ selectable: false
749
+ });
750
+ }
746
751
  const toolOrder = { supabase: 0, vercel: 1, gh: 2, git: 3 };
747
752
  const toolIcons = { supabase: "\u{1F7E2}", vercel: "\u26AA", gh: "\u{1F535}", git: "\u{1F7E0}" };
748
753
  const grouped = /* @__PURE__ */ new Map();
@@ -931,7 +936,7 @@ function Home({
931
936
 
932
937
  // src/screens/CommandArgs.tsx
933
938
  import { useEffect as useEffect4, useMemo as useMemo3, useState as useState6 } from "react";
934
- import { Box as Box7, Text as Text8 } from "ink";
939
+ import { Box as Box7, Text as Text8, useInput as useInput4 } from "ink";
935
940
 
936
941
  // src/components/TextPrompt.tsx
937
942
  import { useState as useState5 } from "react";
@@ -943,7 +948,11 @@ function TextPrompt({
943
948
  placeholder,
944
949
  onSubmit,
945
950
  onCancel,
946
- validate
951
+ validate,
952
+ arrowNavigation = false,
953
+ isInputActive = true,
954
+ boxed = false,
955
+ focused = true
947
956
  }) {
948
957
  const [value, setValue] = useState5("");
949
958
  const [error, setError] = useState5();
@@ -951,7 +960,10 @@ function TextPrompt({
951
960
  if (key.escape && onCancel) {
952
961
  onCancel();
953
962
  }
954
- });
963
+ if (arrowNavigation && key.leftArrow && value === "" && onCancel) {
964
+ onCancel();
965
+ }
966
+ }, { isActive: isInputActive });
955
967
  const handleSubmit = (val) => {
956
968
  if (validate) {
957
969
  const err = validate(val);
@@ -963,7 +975,7 @@ function TextPrompt({
963
975
  setError(void 0);
964
976
  onSubmit(val);
965
977
  };
966
- return /* @__PURE__ */ jsxs6(Box6, { flexDirection: "column", children: [
978
+ const content = /* @__PURE__ */ jsxs6(Box6, { flexDirection: "column", children: [
967
979
  /* @__PURE__ */ jsxs6(Box6, { gap: 1, children: [
968
980
  /* @__PURE__ */ jsx6(Text6, { color: inkColors.accent, bold: true, children: "?" }),
969
981
  /* @__PURE__ */ jsx6(Text6, { children: label })
@@ -988,6 +1000,10 @@ function TextPrompt({
988
1000
  error
989
1001
  ] }) })
990
1002
  ] });
1003
+ if (boxed) {
1004
+ return /* @__PURE__ */ jsx6(Box6, { borderStyle: "round", borderColor: focused ? inkColors.accent : panel.borderDim, paddingX: 1, children: content });
1005
+ }
1006
+ return content;
991
1007
  }
992
1008
 
993
1009
  // src/components/ToolBadge.tsx
@@ -1073,11 +1089,6 @@ function buildCommandArgItems({
1073
1089
  label: "Custom args...",
1074
1090
  hint: "Type any arguments manually",
1075
1091
  kind: "action"
1076
- },
1077
- {
1078
- value: "__back__",
1079
- label: "\u2190 Back to menu",
1080
- kind: "action"
1081
1092
  }
1082
1093
  ];
1083
1094
  }
@@ -1120,25 +1131,20 @@ function CommandArgs({
1120
1131
  tool: resolvedTool
1121
1132
  });
1122
1133
  };
1134
+ useInput4((_input, key) => {
1135
+ if (!command && (key.escape || key.leftArrow)) {
1136
+ onBack();
1137
+ }
1138
+ }, { isActive: isInputActive && !command });
1123
1139
  if (!command) {
1124
1140
  return /* @__PURE__ */ jsxs7(Box7, { flexDirection: "column", children: [
1125
- /* @__PURE__ */ jsx8(Box7, { marginBottom: 1, children: /* @__PURE__ */ jsx8(Text8, { color: "red", children: "Command not provided." }) }),
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
- )
1141
+ /* @__PURE__ */ jsx8(Text8, { color: "red", children: "Command not provided." }),
1142
+ /* @__PURE__ */ jsx8(Text8, { dimColor: true, children: "Press Esc or \u2190 to go back" })
1137
1143
  ] });
1138
1144
  }
1139
1145
  if (phase === "custom") {
1140
1146
  const toolLabel = resolvedTool === "supabase" ? "supabase" : resolvedTool;
1141
- return /* @__PURE__ */ jsxs7(Box7, { flexDirection: "column", children: [
1147
+ return /* @__PURE__ */ jsxs7(Box7, { flexDirection: "column", paddingX: panelMode ? 1 : 0, children: [
1142
1148
  /* @__PURE__ */ jsxs7(Box7, { marginBottom: 1, gap: 1, children: [
1143
1149
  /* @__PURE__ */ jsx8(Text8, { color: inkColors.accent, bold: true, children: "Command" }),
1144
1150
  /* @__PURE__ */ jsx8(Text8, { children: command }),
@@ -1159,7 +1165,11 @@ function CommandArgs({
1159
1165
  return;
1160
1166
  }
1161
1167
  onBack();
1162
- }
1168
+ },
1169
+ arrowNavigation: panelMode,
1170
+ isInputActive,
1171
+ boxed: panelMode,
1172
+ focused: isInputActive
1163
1173
  }
1164
1174
  ),
1165
1175
  !panelMode && /* @__PURE__ */ jsx8(StatusBar, { hint: "Type args \xB7 Enter to continue \xB7 Esc to go back", width })
@@ -1179,7 +1189,7 @@ function CommandArgs({
1179
1189
  }),
1180
1190
  [command, legacySuggestions, pinnedRuns]
1181
1191
  );
1182
- return /* @__PURE__ */ jsxs7(Box7, { flexDirection: "column", children: [
1192
+ return /* @__PURE__ */ jsxs7(Box7, { flexDirection: "column", paddingX: panelMode ? 1 : 0, children: [
1183
1193
  /* @__PURE__ */ jsxs7(Box7, { marginBottom: 1, gap: 1, children: [
1184
1194
  /* @__PURE__ */ jsx8(Text8, { color: inkColors.accent, bold: true, children: "Command" }),
1185
1195
  /* @__PURE__ */ jsx8(Text8, { children: command }),
@@ -1238,9 +1248,10 @@ function CommandArgs({
1238
1248
  },
1239
1249
  onCancel: onBack,
1240
1250
  boxedSections: true,
1241
- width,
1251
+ width: panelMode ? Math.max(20, width - 4) : width,
1242
1252
  isInputActive,
1243
- arrowNavigation: panelMode
1253
+ arrowNavigation: panelMode,
1254
+ panelFocused: isInputActive
1244
1255
  }
1245
1256
  ),
1246
1257
  !panelMode && /* @__PURE__ */ jsx8(StatusBar, { hint: "\u2191\u2193 navigate \xB7 Enter select \xB7 p pin \xB7 Esc back", width })
@@ -1271,7 +1282,7 @@ function CustomCommand({
1271
1282
  ...!panelMode ? [{ value: "__back__", label: "\u2190 Back" }] : []
1272
1283
  ];
1273
1284
  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" }) }),
1285
+ !panelMode && /* @__PURE__ */ jsx9(Box8, { marginBottom: 1, children: /* @__PURE__ */ jsx9(Text9, { bold: true, color: inkColors.accent, children: "\u270F\uFE0F Custom Command" }) }),
1275
1286
  !panelMode && /* @__PURE__ */ jsx9(Text9, { dimColor: true, children: "Select tool:" }),
1276
1287
  /* @__PURE__ */ jsx9(
1277
1288
  SelectList,
@@ -1290,14 +1301,15 @@ function CustomCommand({
1290
1301
  width: panelMode ? Math.max(20, width - 4) : width,
1291
1302
  maxVisible: panelMode ? Math.max(6, height - 6) : void 0,
1292
1303
  isInputActive,
1293
- arrowNavigation: panelMode
1304
+ arrowNavigation: panelMode,
1305
+ panelFocused: isInputActive
1294
1306
  }
1295
1307
  ),
1296
1308
  !panelMode && /* @__PURE__ */ jsx9(StatusBar, { hint: "\u2191\u2193 navigate \xB7 Enter select \xB7 Esc back", width })
1297
1309
  ] });
1298
1310
  }
1299
1311
  return /* @__PURE__ */ jsxs8(Box8, { flexDirection: "column", paddingX: panelMode ? 1 : 0, children: [
1300
- /* @__PURE__ */ jsxs8(Box8, { marginBottom: 1, gap: 1, children: [
1312
+ !panelMode && /* @__PURE__ */ jsxs8(Box8, { marginBottom: 1, gap: 1, children: [
1301
1313
  /* @__PURE__ */ jsx9(Text9, { bold: true, color: inkColors.accent, children: "\u270F\uFE0F Custom Command" }),
1302
1314
  /* @__PURE__ */ jsxs8(Text9, { dimColor: true, children: [
1303
1315
  "(",
@@ -1318,7 +1330,11 @@ function CustomCommand({
1318
1330
  const args = value.split(" ").filter(Boolean);
1319
1331
  onNavigate("flag-selection", { args, tool: selectedTool });
1320
1332
  },
1321
- onCancel: () => setPhase("tool-select")
1333
+ onCancel: () => setPhase("tool-select"),
1334
+ arrowNavigation: panelMode,
1335
+ isInputActive,
1336
+ boxed: panelMode,
1337
+ focused: isInputActive
1322
1338
  }
1323
1339
  ),
1324
1340
  !panelMode && /* @__PURE__ */ jsx9(StatusBar, { hint: "Type a command \xB7 Enter to continue \xB7 Esc to go back", width })
@@ -1326,11 +1342,11 @@ function CustomCommand({
1326
1342
  }
1327
1343
 
1328
1344
  // src/screens/FlagSelection.tsx
1329
- import { Box as Box10 } from "ink";
1345
+ import { Box as Box10, Text as Text11 } from "ink";
1330
1346
 
1331
1347
  // src/components/FlagToggle.tsx
1332
1348
  import { useState as useState8 } from "react";
1333
- import { Box as Box9, Text as Text10, useInput as useInput4 } from "ink";
1349
+ import { Box as Box9, Text as Text10, useInput as useInput5 } from "ink";
1334
1350
  import { jsx as jsx10, jsxs as jsxs9 } from "react/jsx-runtime";
1335
1351
  function FlagToggle({
1336
1352
  flags,
@@ -1341,7 +1357,7 @@ function FlagToggle({
1341
1357
  }) {
1342
1358
  const [cursor, setCursor] = useState8(0);
1343
1359
  const [selected, setSelected] = useState8(/* @__PURE__ */ new Set());
1344
- useInput4((input2, key) => {
1360
+ useInput5((input2, key) => {
1345
1361
  if (key.upArrow || input2 === "k") {
1346
1362
  setCursor((prev) => prev > 0 ? prev - 1 : flags.length - 1);
1347
1363
  }
@@ -1360,7 +1376,7 @@ function FlagToggle({
1360
1376
  return next;
1361
1377
  });
1362
1378
  }
1363
- if (key.return) {
1379
+ if (key.return || arrowNavigation && key.rightArrow) {
1364
1380
  onSubmit(Array.from(selected));
1365
1381
  }
1366
1382
  if (key.escape && onCancel) {
@@ -1373,7 +1389,11 @@ function FlagToggle({
1373
1389
  return /* @__PURE__ */ jsxs9(Box9, { flexDirection: "column", children: [
1374
1390
  /* @__PURE__ */ jsxs9(Box9, { marginBottom: 1, children: [
1375
1391
  /* @__PURE__ */ jsx10(Text10, { bold: true, color: inkColors.accent, children: "\u2691 Global Flags" }),
1376
- /* @__PURE__ */ jsx10(Text10, { dimColor: true, children: " (Space to toggle, Enter to confirm)" })
1392
+ /* @__PURE__ */ jsxs9(Text10, { dimColor: true, children: [
1393
+ " (Space to toggle, ",
1394
+ arrowNavigation ? "\u2192" : "Enter",
1395
+ " to confirm)"
1396
+ ] })
1377
1397
  ] }),
1378
1398
  flags.map((flag, i) => {
1379
1399
  const isActive = cursor === i;
@@ -1399,7 +1419,7 @@ function FlagToggle({
1399
1419
  flag.hint && /* @__PURE__ */ jsx10(Text10, { dimColor: true, children: flag.hint })
1400
1420
  ] }, flag.value);
1401
1421
  }),
1402
- /* @__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 (Enter to skip)" }) })
1422
+ /* @__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
1423
  ] });
1404
1424
  }
1405
1425
 
@@ -1411,6 +1431,7 @@ function FlagSelection({
1411
1431
  onNavigate,
1412
1432
  onBack,
1413
1433
  width = 80,
1434
+ height = 24,
1414
1435
  panelMode = false,
1415
1436
  isInputActive = true
1416
1437
  }) {
@@ -1419,8 +1440,36 @@ function FlagSelection({
1419
1440
  onNavigate("confirm-execute", { args, tool });
1420
1441
  return /* @__PURE__ */ jsx11(Box10, {});
1421
1442
  }
1422
- return /* @__PURE__ */ jsxs10(Box10, { flexDirection: "column", children: [
1423
- /* @__PURE__ */ jsx11(
1443
+ const cmdDisplay = `${tool} ${args.join(" ")}`;
1444
+ return /* @__PURE__ */ jsxs10(Box10, { flexDirection: "column", paddingX: panelMode ? 1 : 0, children: [
1445
+ panelMode && /* @__PURE__ */ jsx11(Box10, { marginBottom: 1, gap: 1, children: /* @__PURE__ */ jsxs10(Text11, { color: inkColors.accent, bold: true, children: [
1446
+ "\u25B6",
1447
+ " ",
1448
+ cmdDisplay
1449
+ ] }) }),
1450
+ panelMode ? /* @__PURE__ */ jsx11(
1451
+ Box10,
1452
+ {
1453
+ flexDirection: "column",
1454
+ borderStyle: "round",
1455
+ borderColor: isInputActive ? inkColors.accent : panel.borderDim,
1456
+ borderDimColor: true,
1457
+ paddingX: 1,
1458
+ children: /* @__PURE__ */ jsx11(
1459
+ FlagToggle,
1460
+ {
1461
+ flags,
1462
+ onSubmit: (selectedFlags) => {
1463
+ const finalArgs = selectedFlags.length > 0 ? [...args, ...selectedFlags] : args;
1464
+ onNavigate("confirm-execute", { args: finalArgs, tool });
1465
+ },
1466
+ onCancel: onBack,
1467
+ isInputActive,
1468
+ arrowNavigation: panelMode
1469
+ }
1470
+ )
1471
+ }
1472
+ ) : /* @__PURE__ */ jsx11(
1424
1473
  FlagToggle,
1425
1474
  {
1426
1475
  flags,
@@ -1438,26 +1487,26 @@ function FlagSelection({
1438
1487
  }
1439
1488
 
1440
1489
  // src/screens/CommandExecution.tsx
1441
- import { useState as useState10, useEffect as useEffect5 } from "react";
1442
- import { Box as Box12, Text as Text14 } from "ink";
1490
+ import { useState as useState11, useEffect as useEffect6 } from "react";
1491
+ import { Box as Box13, Text as Text17 } from "ink";
1443
1492
 
1444
1493
  // src/components/Spinner.tsx
1445
- import { Text as Text11 } from "ink";
1494
+ import { Text as Text12 } from "ink";
1446
1495
  import InkSpinner from "ink-spinner";
1447
1496
  import { jsx as jsx12, jsxs as jsxs11 } from "react/jsx-runtime";
1448
1497
  function Spinner({
1449
1498
  label = "Running...",
1450
1499
  color = inkColors.accent
1451
1500
  }) {
1452
- return /* @__PURE__ */ jsxs11(Text11, { children: [
1453
- /* @__PURE__ */ jsx12(Text11, { color, children: /* @__PURE__ */ jsx12(InkSpinner, { type: "dots" }) }),
1501
+ return /* @__PURE__ */ jsxs11(Text12, { children: [
1502
+ /* @__PURE__ */ jsx12(Text12, { color, children: /* @__PURE__ */ jsx12(InkSpinner, { type: "dots" }) }),
1454
1503
  " ",
1455
- /* @__PURE__ */ jsx12(Text11, { children: label })
1504
+ /* @__PURE__ */ jsx12(Text12, { children: label })
1456
1505
  ] });
1457
1506
  }
1458
1507
 
1459
1508
  // src/components/ConfirmPrompt.tsx
1460
- import { Box as Box11, Text as Text12, useInput as useInput5 } from "ink";
1509
+ import { Box as Box11, Text as Text13, useInput as useInput6 } from "ink";
1461
1510
  import { jsx as jsx13, jsxs as jsxs12 } from "react/jsx-runtime";
1462
1511
  function ConfirmPrompt({
1463
1512
  message,
@@ -1467,7 +1516,7 @@ function ConfirmPrompt({
1467
1516
  isInputActive = true,
1468
1517
  arrowNavigation = false
1469
1518
  }) {
1470
- useInput5((input2, key) => {
1519
+ useInput6((input2, key) => {
1471
1520
  if (key.escape && onCancel) {
1472
1521
  onCancel();
1473
1522
  return;
@@ -1485,14 +1534,14 @@ function ConfirmPrompt({
1485
1534
  }
1486
1535
  }, { isActive: isInputActive });
1487
1536
  return /* @__PURE__ */ jsxs12(Box11, { gap: 1, children: [
1488
- /* @__PURE__ */ jsx13(Text12, { color: inkColors.accent, bold: true, children: "?" }),
1489
- /* @__PURE__ */ jsx13(Text12, { children: message }),
1490
- /* @__PURE__ */ jsx13(Text12, { dimColor: true, children: defaultValue ? "(Y/n)" : "(y/N)" })
1537
+ /* @__PURE__ */ jsx13(Text13, { color: inkColors.accent, bold: true, children: "?" }),
1538
+ /* @__PURE__ */ jsx13(Text13, { children: message }),
1539
+ /* @__PURE__ */ jsx13(Text13, { dimColor: true, children: defaultValue ? "(Y/n)" : "(y/N)" })
1491
1540
  ] });
1492
1541
  }
1493
1542
 
1494
1543
  // src/components/Divider.tsx
1495
- import { Text as Text13 } from "ink";
1544
+ import { Text as Text14 } from "ink";
1496
1545
  import { jsx as jsx14, jsxs as jsxs13 } from "react/jsx-runtime";
1497
1546
  function Divider({
1498
1547
  label,
@@ -1504,7 +1553,7 @@ function Divider({
1504
1553
  const sideLen = Math.max(2, Math.floor((effectiveWidth - labelLen) / 2));
1505
1554
  const left = "\u2500".repeat(sideLen);
1506
1555
  const right = "\u2500".repeat(sideLen);
1507
- return /* @__PURE__ */ jsxs13(Text13, { dimColor: true, children: [
1556
+ return /* @__PURE__ */ jsxs13(Text14, { dimColor: true, children: [
1508
1557
  left,
1509
1558
  " ",
1510
1559
  label,
@@ -1512,14 +1561,82 @@ function Divider({
1512
1561
  right
1513
1562
  ] });
1514
1563
  }
1515
- return /* @__PURE__ */ jsx14(Text13, { dimColor: true, children: "\u2500".repeat(effectiveWidth) });
1564
+ return /* @__PURE__ */ jsx14(Text14, { dimColor: true, children: "\u2500".repeat(effectiveWidth) });
1565
+ }
1566
+
1567
+ // src/components/CommandOutput.tsx
1568
+ import { Text as Text16 } from "ink";
1569
+
1570
+ // src/components/ScrollableBox.tsx
1571
+ import { useState as useState9 } from "react";
1572
+ import { Box as Box12, Text as Text15, useInput as useInput7 } from "ink";
1573
+ import { jsx as jsx15, jsxs as jsxs14 } from "react/jsx-runtime";
1574
+ function ScrollableBox({
1575
+ height,
1576
+ isActive = true,
1577
+ children
1578
+ }) {
1579
+ const totalItems = children.length;
1580
+ const [scrollOffset, setScrollOffset] = useState9(0);
1581
+ const visibleCount = Math.max(1, height - 2);
1582
+ useInput7(
1583
+ (input2, key) => {
1584
+ if (key.upArrow || input2 === "k") {
1585
+ setScrollOffset((prev) => Math.max(0, prev - 1));
1586
+ }
1587
+ if (key.downArrow || input2 === "j") {
1588
+ setScrollOffset((prev) => Math.min(Math.max(0, totalItems - visibleCount), prev + 1));
1589
+ }
1590
+ },
1591
+ { isActive }
1592
+ );
1593
+ const showScrollUp = scrollOffset > 0;
1594
+ const showScrollDown = scrollOffset + visibleCount < totalItems;
1595
+ const visible = children.slice(scrollOffset, scrollOffset + visibleCount);
1596
+ return /* @__PURE__ */ jsxs14(Box12, { flexDirection: "column", height, children: [
1597
+ showScrollUp && /* @__PURE__ */ jsx15(Text15, { dimColor: true, children: " \u2191 more" }),
1598
+ visible,
1599
+ showScrollDown && /* @__PURE__ */ jsx15(Text15, { dimColor: true, children: " \u2193 more" })
1600
+ ] });
1601
+ }
1602
+
1603
+ // src/lib/ansi.ts
1604
+ var ANSI_RE = (
1605
+ // biome-ignore lint/suspicious/noControlCharactersInRegex: intentional ANSI stripping
1606
+ /[\u001B\u009B][[\]()#;?]*(?:(?:(?:[a-zA-Z\d]*(?:;[-a-zA-Z\d/#&.:=?%@~_]*)*)?\u0007)|(?:(?:\d{1,4}(?:;\d{0,4})*)?[\dA-PR-TZcf-nq-uy=><~]))/g
1607
+ );
1608
+ function stripAnsi(text) {
1609
+ return text.replace(ANSI_RE, "");
1610
+ }
1611
+
1612
+ // src/components/CommandOutput.tsx
1613
+ import { jsx as jsx16 } from "react/jsx-runtime";
1614
+ function cleanLines(raw) {
1615
+ const stripped = stripAnsi(raw);
1616
+ return stripped.replace(/\r/g, "").split("\n").filter((line) => line.length > 0);
1617
+ }
1618
+ function CommandOutput({
1619
+ stdout,
1620
+ stderr,
1621
+ height,
1622
+ isActive = false
1623
+ }) {
1624
+ const outLines = stdout ? cleanLines(stdout) : [];
1625
+ const errLines = stderr ? cleanLines(stderr) : [];
1626
+ if (outLines.length === 0 && errLines.length === 0) {
1627
+ return null;
1628
+ }
1629
+ return /* @__PURE__ */ jsx16(ScrollableBox, { height: Math.max(3, height), isActive, children: [
1630
+ ...outLines.map((line, i) => /* @__PURE__ */ jsx16(Text16, { children: line }, `o-${i}`)),
1631
+ ...errLines.map((line, i) => /* @__PURE__ */ jsx16(Text16, { color: "red", children: line }, `e-${i}`))
1632
+ ] });
1516
1633
  }
1517
1634
 
1518
1635
  // src/hooks/useCommand.ts
1519
- import { useState as useState9, useCallback as useCallback2 } from "react";
1520
- function useCommand(execution = "supabase", cwd = process.cwd()) {
1521
- const [status, setStatus] = useState9("idle");
1522
- const [result, setResult] = useState9(null);
1636
+ import { useState as useState10, useCallback as useCallback2 } from "react";
1637
+ function useCommand(execution = "supabase", cwd = process.cwd(), options) {
1638
+ const [status, setStatus] = useState10("idle");
1639
+ const [result, setResult] = useState10(null);
1523
1640
  const run = useCallback2(async (args) => {
1524
1641
  setStatus("running");
1525
1642
  setResult(null);
@@ -1535,7 +1652,8 @@ function useCommand(execution = "supabase", cwd = process.cwd()) {
1535
1652
  } else {
1536
1653
  resolvedExecution = execution;
1537
1654
  }
1538
- const res = await runCommand(resolvedExecution, args, cwd);
1655
+ const runOpts = options?.quiet ? { quiet: true } : void 0;
1656
+ const res = await runCommand(resolvedExecution, args, cwd, runOpts);
1539
1657
  setResult(res);
1540
1658
  if (res.spawnError || res.exitCode !== null && res.exitCode !== 0) {
1541
1659
  setStatus("error");
@@ -1543,7 +1661,7 @@ function useCommand(execution = "supabase", cwd = process.cwd()) {
1543
1661
  setStatus("success");
1544
1662
  }
1545
1663
  return res;
1546
- }, [cwd, execution]);
1664
+ }, [cwd, execution, options?.quiet]);
1547
1665
  const reset = useCallback2(() => {
1548
1666
  setStatus("idle");
1549
1667
  setResult(null);
@@ -1551,6 +1669,56 @@ function useCommand(execution = "supabase", cwd = process.cwd()) {
1551
1669
  return { status, result, run, reset };
1552
1670
  }
1553
1671
 
1672
+ // src/hooks/useInteractiveRun.ts
1673
+ import { useCallback as useCallback3 } from "react";
1674
+ import { useStdin } from "ink";
1675
+
1676
+ // src/hooks/useFullscreen.ts
1677
+ import { useEffect as useEffect5 } from "react";
1678
+ var ENTER_ALT_SCREEN = "\x1B[?1049h";
1679
+ var LEAVE_ALT_SCREEN = "\x1B[?1049l";
1680
+ var HIDE_CURSOR = "\x1B[?25l";
1681
+ var SHOW_CURSOR = "\x1B[?25h";
1682
+ function useFullscreen() {
1683
+ useEffect5(() => {
1684
+ process.stdout.write(ENTER_ALT_SCREEN + HIDE_CURSOR);
1685
+ return () => {
1686
+ process.stdout.write(SHOW_CURSOR + LEAVE_ALT_SCREEN);
1687
+ };
1688
+ }, []);
1689
+ }
1690
+
1691
+ // src/hooks/useInteractiveRun.ts
1692
+ function useInteractiveRun() {
1693
+ const { setRawMode } = useStdin();
1694
+ const runInteractive = useCallback3(
1695
+ (tool, args, cwd) => {
1696
+ process.stdout.write(SHOW_CURSOR + LEAVE_ALT_SCREEN);
1697
+ setRawMode(false);
1698
+ process.stdout.write(`
1699
+ Running: ${tool} ${args.join(" ")}
1700
+
1701
+ `);
1702
+ const resolved = resolveToolCommand(tool, cwd);
1703
+ const result = runInteractiveCommand(
1704
+ { command: resolved.command, env: resolved.env },
1705
+ args,
1706
+ cwd
1707
+ );
1708
+ process.stdout.write(
1709
+ `
1710
+ Command exited (code ${result.exitCode ?? "?"}). Returning to Polter...
1711
+ `
1712
+ );
1713
+ setRawMode(true);
1714
+ process.stdout.write(ENTER_ALT_SCREEN + HIDE_CURSOR);
1715
+ return result;
1716
+ },
1717
+ [setRawMode]
1718
+ );
1719
+ return { runInteractive };
1720
+ }
1721
+
1554
1722
  // src/lib/clipboard.ts
1555
1723
  import { spawn, exec } from "child_process";
1556
1724
  async function copyToClipboard(text) {
@@ -1564,30 +1732,80 @@ async function copyToClipboard(text) {
1564
1732
  });
1565
1733
  }
1566
1734
 
1735
+ // src/lib/errorSuggestions.ts
1736
+ var KNOWN_TOOLS = ["supabase", "gh", "vercel", "git"];
1737
+ var BACKTICK_CMD = /(?:try\s+)?(?:run(?:ning)?|use|execute)\s+`([^`]+)`/gi;
1738
+ var HAVE_YOU_RUN = /have you (?:run|tried|used)\s+((?:supabase|gh|vercel|git)\s+[\w][\w -]*\w)\??/gi;
1739
+ var DID_YOU_MEAN = /did you mean[:\s]+[`']?([a-z][\w -]*\w)[`']?\??/gi;
1740
+ var INDENTED_TOOL_CMD = /^\s{2,}((?:supabase|gh|vercel|git)\s+[\w][\w -]*\w)$/gm;
1741
+ var ARROW_BULLET = /[→•\-*]\s*(?:run:?\s*)?((?:supabase|gh|vercel|git)\s+[\w][\w -]*\w)/gim;
1742
+ var MAX_SUGGESTIONS = 3;
1743
+ function detectTool(rawCommand, fallback) {
1744
+ const first = rawCommand.trim().split(/\s+/)[0]?.toLowerCase();
1745
+ const match = KNOWN_TOOLS.find((t) => t === first);
1746
+ return match ?? fallback;
1747
+ }
1748
+ function parseRawCommand(raw, currentTool) {
1749
+ const trimmed = raw.trim();
1750
+ const tool = detectTool(trimmed, currentTool);
1751
+ const parts = trimmed.split(/\s+/);
1752
+ const args = parts[0]?.toLowerCase() === tool ? parts.slice(1) : parts;
1753
+ const display = `${tool} ${args.join(" ")}`;
1754
+ return { tool, args, display };
1755
+ }
1756
+ function parseErrorSuggestions(stdout, stderr, currentTool) {
1757
+ const combined = stripAnsi(`${stdout}
1758
+ ${stderr}`);
1759
+ const seen = /* @__PURE__ */ new Set();
1760
+ const suggestions = [];
1761
+ const patterns = [BACKTICK_CMD, HAVE_YOU_RUN, DID_YOU_MEAN, INDENTED_TOOL_CMD, ARROW_BULLET];
1762
+ for (const pattern of patterns) {
1763
+ pattern.lastIndex = 0;
1764
+ let match;
1765
+ while ((match = pattern.exec(combined)) !== null) {
1766
+ const raw = match[1];
1767
+ const suggestion = parseRawCommand(raw, currentTool);
1768
+ const key = suggestion.display;
1769
+ if (!seen.has(key)) {
1770
+ seen.add(key);
1771
+ suggestions.push(suggestion);
1772
+ }
1773
+ if (suggestions.length >= MAX_SUGGESTIONS) break;
1774
+ }
1775
+ if (suggestions.length >= MAX_SUGGESTIONS) break;
1776
+ }
1777
+ return suggestions;
1778
+ }
1779
+
1567
1780
  // src/screens/CommandExecution.tsx
1568
- import { jsx as jsx15, jsxs as jsxs14 } from "react/jsx-runtime";
1781
+ import { jsx as jsx17, jsxs as jsxs15 } from "react/jsx-runtime";
1569
1782
  function CommandExecution({
1570
1783
  args: initialArgs,
1571
1784
  tool = "supabase",
1572
1785
  onBack,
1786
+ onHome,
1573
1787
  onExit,
1788
+ onRunSuggestion,
1574
1789
  width = 80,
1575
1790
  height = 24,
1576
1791
  panelMode = false,
1577
1792
  isInputActive = true
1578
1793
  }) {
1579
- const [phase, setPhase] = useState10("confirm");
1580
- const [currentArgs, setCurrentArgs] = useState10(initialArgs);
1581
- const [pinMessage, setPinMessage] = useState10();
1582
- const { status, result, run, reset } = useCommand(tool);
1794
+ const [phase, setPhase] = useState11("confirm");
1795
+ const [currentArgs, setCurrentArgs] = useState11(initialArgs);
1796
+ const [pinMessage, setPinMessage] = useState11();
1797
+ const { status, result, run, reset } = useCommand(tool, process.cwd(), {
1798
+ quiet: panelMode
1799
+ });
1800
+ const { runInteractive } = useInteractiveRun();
1583
1801
  const cmdDisplay = `${tool} ${currentArgs.join(" ")}`;
1584
1802
  const runCommand2 = currentArgs.join(" ");
1585
- useEffect5(() => {
1803
+ useEffect6(() => {
1586
1804
  if (phase === "running" && status === "idle") {
1587
1805
  run(currentArgs);
1588
1806
  }
1589
1807
  }, [phase, status, run, currentArgs]);
1590
- useEffect5(() => {
1808
+ useEffect6(() => {
1591
1809
  if (phase === "running" && status === "success") {
1592
1810
  if (isPinnedRun(runCommand2)) {
1593
1811
  setPhase("success");
@@ -1600,45 +1818,67 @@ function CommandExecution({
1600
1818
  }
1601
1819
  }, [phase, runCommand2, status]);
1602
1820
  if (phase === "confirm") {
1603
- return /* @__PURE__ */ jsx15(Box12, { flexDirection: "column", paddingX: panelMode ? 1 : 0, children: /* @__PURE__ */ jsx15(
1604
- ConfirmPrompt,
1821
+ const confirmContent = /* @__PURE__ */ jsxs15(Box13, { flexDirection: "column", children: [
1822
+ /* @__PURE__ */ jsxs15(Box13, { marginBottom: 1, gap: 1, children: [
1823
+ /* @__PURE__ */ jsxs15(Text17, { color: inkColors.accent, bold: true, children: [
1824
+ "\u25B6",
1825
+ " ",
1826
+ cmdDisplay
1827
+ ] }),
1828
+ /* @__PURE__ */ jsx17(ToolBadge, { tool })
1829
+ ] }),
1830
+ /* @__PURE__ */ jsx17(
1831
+ ConfirmPrompt,
1832
+ {
1833
+ message: `Execute ${cmdDisplay}?`,
1834
+ defaultValue: true,
1835
+ onConfirm: (confirmed) => {
1836
+ if (confirmed) {
1837
+ setPhase("running");
1838
+ } else {
1839
+ onBack();
1840
+ }
1841
+ },
1842
+ onCancel: onBack,
1843
+ isInputActive,
1844
+ arrowNavigation: panelMode
1845
+ }
1846
+ ),
1847
+ /* @__PURE__ */ jsx17(Box13, { marginTop: 1, children: /* @__PURE__ */ jsx17(Text17, { dimColor: true, children: "Enter to execute \xB7 n to cancel" }) })
1848
+ ] });
1849
+ return /* @__PURE__ */ jsx17(Box13, { flexDirection: "column", paddingX: panelMode ? 1 : 0, children: panelMode ? /* @__PURE__ */ jsx17(
1850
+ Box13,
1605
1851
  {
1606
- message: `Execute ${cmdDisplay}?`,
1607
- defaultValue: true,
1608
- onConfirm: (confirmed) => {
1609
- if (confirmed) {
1610
- setPhase("running");
1611
- } else {
1612
- onBack();
1613
- }
1614
- },
1615
- onCancel: onBack,
1616
- isInputActive,
1617
- arrowNavigation: panelMode
1852
+ flexDirection: "column",
1853
+ borderStyle: "round",
1854
+ borderColor: isInputActive ? inkColors.accent : panel.borderDim,
1855
+ borderDimColor: true,
1856
+ paddingX: 1,
1857
+ children: confirmContent
1618
1858
  }
1619
- ) });
1859
+ ) : confirmContent });
1620
1860
  }
1621
1861
  if (phase === "running") {
1622
- return /* @__PURE__ */ jsxs14(Box12, { flexDirection: "column", paddingX: panelMode ? 1 : 0, children: [
1623
- /* @__PURE__ */ jsx15(Divider, { width: panelMode ? width - 4 : width }),
1624
- /* @__PURE__ */ jsxs14(Box12, { marginY: 1, gap: 1, children: [
1625
- /* @__PURE__ */ jsx15(Text14, { color: inkColors.accent, bold: true, children: "\u25B6" }),
1626
- /* @__PURE__ */ jsx15(Text14, { dimColor: true, children: "Running:" }),
1627
- /* @__PURE__ */ jsx15(Text14, { children: cmdDisplay }),
1628
- /* @__PURE__ */ jsx15(ToolBadge, { tool })
1862
+ return /* @__PURE__ */ jsxs15(Box13, { flexDirection: "column", paddingX: panelMode ? 1 : 0, children: [
1863
+ /* @__PURE__ */ jsx17(Divider, { width: panelMode ? width - 4 : width }),
1864
+ /* @__PURE__ */ jsxs15(Box13, { marginY: 1, gap: 1, children: [
1865
+ /* @__PURE__ */ jsx17(Text17, { color: inkColors.accent, bold: true, children: "\u25B6" }),
1866
+ /* @__PURE__ */ jsx17(Text17, { dimColor: true, children: "Running:" }),
1867
+ /* @__PURE__ */ jsx17(Text17, { children: cmdDisplay }),
1868
+ /* @__PURE__ */ jsx17(ToolBadge, { tool })
1629
1869
  ] }),
1630
- /* @__PURE__ */ jsx15(Divider, { width: panelMode ? width - 4 : width }),
1631
- /* @__PURE__ */ jsx15(Box12, { marginTop: 1, children: /* @__PURE__ */ jsx15(Spinner, { label: `Executing ${cmdDisplay}...` }) })
1870
+ /* @__PURE__ */ jsx17(Divider, { width: panelMode ? width - 4 : width }),
1871
+ /* @__PURE__ */ jsx17(Box13, { marginTop: 1, children: /* @__PURE__ */ jsx17(Spinner, { label: `Executing ${cmdDisplay}...` }) })
1632
1872
  ] });
1633
1873
  }
1634
1874
  if (phase === "success-pin-offer") {
1635
- return /* @__PURE__ */ jsxs14(Box12, { flexDirection: "column", paddingX: panelMode ? 1 : 0, children: [
1636
- /* @__PURE__ */ jsx15(Divider, { width: panelMode ? width - 4 : width }),
1637
- /* @__PURE__ */ jsxs14(Box12, { marginY: 1, gap: 1, children: [
1638
- /* @__PURE__ */ jsx15(Text14, { color: inkColors.accent, bold: true, children: "\u2713" }),
1639
- /* @__PURE__ */ jsx15(Text14, { color: inkColors.accent, bold: true, children: "Command completed successfully!" })
1875
+ return /* @__PURE__ */ jsxs15(Box13, { flexDirection: "column", paddingX: panelMode ? 1 : 0, children: [
1876
+ /* @__PURE__ */ jsx17(Divider, { width: panelMode ? width - 4 : width }),
1877
+ /* @__PURE__ */ jsxs15(Box13, { marginY: 1, gap: 1, children: [
1878
+ /* @__PURE__ */ jsx17(Text17, { color: inkColors.accent, bold: true, children: "\u2713" }),
1879
+ /* @__PURE__ */ jsx17(Text17, { color: inkColors.accent, bold: true, children: "Command completed successfully!" })
1640
1880
  ] }),
1641
- /* @__PURE__ */ jsx15(
1881
+ /* @__PURE__ */ jsx17(
1642
1882
  ConfirmPrompt,
1643
1883
  {
1644
1884
  message: "Pin this exact command?",
@@ -1658,31 +1898,66 @@ function CommandExecution({
1658
1898
  ] });
1659
1899
  }
1660
1900
  if (phase === "success") {
1661
- const successItems = panelMode ? [] : [{ value: "__back__", label: "\u2190 Back to menu" }];
1662
- return /* @__PURE__ */ jsxs14(Box12, { flexDirection: "column", paddingX: panelMode ? 1 : 0, children: [
1663
- /* @__PURE__ */ jsx15(Divider, { width: panelMode ? width - 4 : width }),
1664
- /* @__PURE__ */ jsxs14(Box12, { marginY: 1, gap: 1, children: [
1665
- /* @__PURE__ */ jsx15(Text14, { color: inkColors.accent, bold: true, children: "\u2713" }),
1666
- /* @__PURE__ */ jsx15(Text14, { color: inkColors.accent, bold: true, children: "Command completed successfully!" })
1901
+ const successItems = [
1902
+ { value: "__back__", label: "\u2190 Back to menu" }
1903
+ ];
1904
+ const outputHeight = Math.max(3, height - 12);
1905
+ return /* @__PURE__ */ jsxs15(Box13, { flexDirection: "column", paddingX: panelMode ? 1 : 0, children: [
1906
+ /* @__PURE__ */ jsx17(Divider, { width: panelMode ? width - 4 : width }),
1907
+ /* @__PURE__ */ jsxs15(Box13, { marginY: 1, gap: 1, children: [
1908
+ /* @__PURE__ */ jsx17(Text17, { color: inkColors.accent, bold: true, children: "\u2713" }),
1909
+ /* @__PURE__ */ jsx17(Text17, { color: inkColors.accent, bold: true, children: "Command completed successfully!" })
1667
1910
  ] }),
1668
- pinMessage && /* @__PURE__ */ jsx15(Box12, { marginBottom: 1, children: /* @__PURE__ */ jsx15(Text14, { color: inkColors.accent, children: pinMessage }) }),
1669
- successItems.length > 0 && /* @__PURE__ */ jsx15(
1911
+ pinMessage && /* @__PURE__ */ jsx17(Box13, { marginBottom: 1, children: /* @__PURE__ */ jsx17(Text17, { color: inkColors.accent, children: pinMessage }) }),
1912
+ /* @__PURE__ */ jsx17(
1913
+ CommandOutput,
1914
+ {
1915
+ stdout: result?.stdout,
1916
+ stderr: result?.stderr,
1917
+ height: outputHeight,
1918
+ isActive: isInputActive
1919
+ }
1920
+ ),
1921
+ /* @__PURE__ */ jsx17(
1670
1922
  SelectList,
1671
1923
  {
1672
1924
  items: successItems,
1673
- onSelect: onBack,
1674
- onCancel: onBack,
1925
+ onSelect: onHome ?? onBack,
1926
+ onCancel: onHome ?? onBack,
1675
1927
  width: panelMode ? Math.max(20, width - 4) : width,
1676
1928
  maxVisible: panelMode ? Math.max(6, height - 6) : void 0,
1677
1929
  isInputActive,
1678
1930
  arrowNavigation: panelMode,
1679
- boxedSections: panelMode
1931
+ boxedSections: panelMode,
1932
+ panelFocused: isInputActive
1680
1933
  }
1681
1934
  )
1682
1935
  ] });
1683
1936
  }
1684
1937
  const hasDebug = currentArgs.includes("--debug");
1938
+ const suggestions = result ? parseErrorSuggestions(result.stdout, result.stderr, tool) : [];
1685
1939
  const errorItems = [];
1940
+ if (suggestions.length > 0) {
1941
+ errorItems.push({
1942
+ value: "__suggestions_header__",
1943
+ label: "\u{1F4A1} Suggested fixes",
1944
+ kind: "header"
1945
+ });
1946
+ for (const s of suggestions) {
1947
+ errorItems.push({
1948
+ value: `suggest:${s.display}`,
1949
+ label: s.display,
1950
+ hint: "from error output"
1951
+ });
1952
+ }
1953
+ }
1954
+ if (suggestions.length > 0) {
1955
+ errorItems.push({
1956
+ value: "__actions_header__",
1957
+ label: "",
1958
+ kind: "header"
1959
+ });
1960
+ }
1686
1961
  if (!result?.spawnError) {
1687
1962
  errorItems.push({ value: "retry", label: "\u{1F504} Retry the same command" });
1688
1963
  if (!hasDebug) {
@@ -1693,54 +1968,89 @@ function CommandExecution({
1693
1968
  });
1694
1969
  }
1695
1970
  }
1971
+ if (panelMode && !result?.spawnError) {
1972
+ errorItems.push({
1973
+ value: "run-interactive",
1974
+ label: "\u{1F4BB} Run in terminal",
1975
+ hint: "Suspend TUI and run interactively"
1976
+ });
1977
+ }
1696
1978
  errorItems.push({
1697
1979
  value: "copy",
1698
1980
  label: "\u{1F4CB} Copy command to clipboard"
1699
1981
  });
1700
- if (!panelMode) {
1701
- errorItems.push({ value: "menu", label: "\u2190 Return to main menu" });
1702
- }
1703
- errorItems.push({ value: "exit", label: "\u{1F6AA} Exit Polter" });
1704
- return /* @__PURE__ */ jsxs14(Box12, { flexDirection: "column", paddingX: panelMode ? 1 : 0, children: [
1705
- /* @__PURE__ */ jsx15(Divider, { width: panelMode ? width - 4 : width }),
1706
- result?.spawnError ? /* @__PURE__ */ jsxs14(Box12, { flexDirection: "column", marginY: 1, children: [
1707
- /* @__PURE__ */ jsxs14(Box12, { gap: 1, children: [
1708
- /* @__PURE__ */ jsx15(Text14, { color: "red", bold: true, children: "\u2717" }),
1709
- /* @__PURE__ */ jsx15(Text14, { color: "red", bold: true, children: "Failed to start command" })
1982
+ errorItems.push({
1983
+ value: "menu",
1984
+ label: "\u2190 Back to menu"
1985
+ });
1986
+ return /* @__PURE__ */ jsxs15(Box13, { flexDirection: "column", paddingX: panelMode ? 1 : 0, children: [
1987
+ /* @__PURE__ */ jsx17(Divider, { width: panelMode ? width - 4 : width }),
1988
+ result?.spawnError ? /* @__PURE__ */ jsxs15(Box13, { flexDirection: "column", marginY: 1, children: [
1989
+ /* @__PURE__ */ jsxs15(Box13, { gap: 1, children: [
1990
+ /* @__PURE__ */ jsx17(Text17, { color: "red", bold: true, children: "\u2717" }),
1991
+ /* @__PURE__ */ jsx17(Text17, { color: "red", bold: true, children: "Failed to start command" })
1710
1992
  ] }),
1711
- /* @__PURE__ */ jsxs14(Box12, { marginLeft: 2, marginTop: 1, children: [
1712
- /* @__PURE__ */ jsx15(Text14, { dimColor: true, children: "Error: " }),
1713
- /* @__PURE__ */ jsx15(Text14, { color: "red", children: result.spawnError })
1993
+ /* @__PURE__ */ jsxs15(Box13, { marginLeft: 2, marginTop: 1, children: [
1994
+ /* @__PURE__ */ jsx17(Text17, { dimColor: true, children: "Error: " }),
1995
+ /* @__PURE__ */ jsx17(Text17, { color: "red", children: result.spawnError })
1714
1996
  ] }),
1715
- (result.spawnError.includes("ENOENT") || result.spawnError.includes("not found")) && /* @__PURE__ */ jsx15(Box12, { flexDirection: "column", marginLeft: 2, marginTop: 1, children: /* @__PURE__ */ jsxs14(Text14, { color: inkColors.accent, bold: true, children: [
1716
- "\u{1F4A1} ",
1997
+ (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: [
1998
+ "\u{1F4A1}",
1999
+ " ",
1717
2000
  tool,
1718
2001
  " CLI not found in this repository or PATH"
1719
2002
  ] }) })
1720
- ] }) : /* @__PURE__ */ jsxs14(Box12, { flexDirection: "column", marginY: 1, children: [
1721
- /* @__PURE__ */ jsxs14(Box12, { gap: 1, children: [
1722
- /* @__PURE__ */ jsx15(Text14, { color: "red", bold: true, children: "\u2717" }),
1723
- /* @__PURE__ */ jsx15(Text14, { color: "red", children: "Command failed " }),
1724
- /* @__PURE__ */ jsx15(Text14, { dimColor: true, children: "(exit code " }),
1725
- /* @__PURE__ */ jsx15(Text14, { color: "red", bold: true, children: String(result?.exitCode) }),
1726
- /* @__PURE__ */ jsx15(Text14, { dimColor: true, children: ")" })
2003
+ ] }) : /* @__PURE__ */ jsxs15(Box13, { flexDirection: "column", marginY: 1, children: [
2004
+ /* @__PURE__ */ jsxs15(Box13, { gap: 1, children: [
2005
+ /* @__PURE__ */ jsx17(Text17, { color: "red", bold: true, children: "\u2717" }),
2006
+ /* @__PURE__ */ jsx17(Text17, { color: "red", children: "Command failed " }),
2007
+ /* @__PURE__ */ jsx17(Text17, { dimColor: true, children: "(exit code " }),
2008
+ /* @__PURE__ */ jsx17(Text17, { color: "red", bold: true, children: String(result?.exitCode) }),
2009
+ /* @__PURE__ */ jsx17(Text17, { dimColor: true, children: ")" })
1727
2010
  ] }),
1728
- /* @__PURE__ */ jsxs14(Box12, { marginLeft: 2, marginTop: 1, children: [
1729
- /* @__PURE__ */ jsx15(Text14, { dimColor: true, children: "Command: " }),
1730
- /* @__PURE__ */ jsx15(Text14, { children: cmdDisplay })
2011
+ /* @__PURE__ */ jsxs15(Box13, { marginLeft: 2, marginTop: 1, children: [
2012
+ /* @__PURE__ */ jsx17(Text17, { dimColor: true, children: "Command: " }),
2013
+ /* @__PURE__ */ jsx17(Text17, { children: cmdDisplay })
1731
2014
  ] }),
1732
- !hasDebug && /* @__PURE__ */ jsxs14(Box12, { marginLeft: 2, marginTop: 1, gap: 1, children: [
1733
- /* @__PURE__ */ jsx15(Text14, { dimColor: true, children: "\u{1F4A1} Tip: retry with" }),
1734
- /* @__PURE__ */ jsx15(Text14, { color: inkColors.accent, children: "--debug" }),
1735
- /* @__PURE__ */ jsx15(Text14, { dimColor: true, children: "to see detailed logs" })
2015
+ !hasDebug && /* @__PURE__ */ jsxs15(Box13, { marginLeft: 2, marginTop: 1, gap: 1, children: [
2016
+ /* @__PURE__ */ jsxs15(Text17, { dimColor: true, children: [
2017
+ "\u{1F4A1}",
2018
+ " Tip: retry with"
2019
+ ] }),
2020
+ /* @__PURE__ */ jsx17(Text17, { color: inkColors.accent, children: "--debug" }),
2021
+ /* @__PURE__ */ jsx17(Text17, { dimColor: true, children: "to see detailed logs" })
1736
2022
  ] })
1737
2023
  ] }),
1738
- /* @__PURE__ */ jsx15(Box12, { marginTop: 1, marginBottom: 1, children: /* @__PURE__ */ jsx15(Text14, { bold: true, children: "What would you like to do?" }) }),
1739
- /* @__PURE__ */ jsx15(
2024
+ /* @__PURE__ */ jsx17(
2025
+ CommandOutput,
2026
+ {
2027
+ stdout: result?.stdout,
2028
+ stderr: result?.stderr,
2029
+ height: Math.max(3, height - 13 - errorItems.length - (suggestions.length > 0 ? suggestions.length + 4 : 0)),
2030
+ isActive: false
2031
+ }
2032
+ ),
2033
+ /* @__PURE__ */ jsx17(Box13, { marginTop: 1, marginBottom: 1, children: /* @__PURE__ */ jsx17(Text17, { bold: true, children: "What would you like to do?" }) }),
2034
+ /* @__PURE__ */ jsx17(
1740
2035
  SelectList,
1741
2036
  {
1742
2037
  items: errorItems,
1743
2038
  onSelect: async (action) => {
2039
+ if (action.startsWith("suggest:")) {
2040
+ const rawCmd = action.slice("suggest:".length);
2041
+ const parts = rawCmd.split(/\s+/);
2042
+ const sugTool = parts[0];
2043
+ const sugArgs = parts.slice(1);
2044
+ if (onRunSuggestion) {
2045
+ onRunSuggestion(sugTool, sugArgs);
2046
+ } else {
2047
+ setCurrentArgs(sugArgs);
2048
+ setPinMessage(void 0);
2049
+ reset();
2050
+ setPhase("confirm");
2051
+ }
2052
+ return;
2053
+ }
1744
2054
  switch (action) {
1745
2055
  case "retry":
1746
2056
  setPinMessage(void 0);
@@ -1755,11 +2065,18 @@ function CommandExecution({
1755
2065
  setPhase("running");
1756
2066
  break;
1757
2067
  }
2068
+ case "run-interactive": {
2069
+ const interactiveResult = runInteractive(tool, currentArgs);
2070
+ if (!interactiveResult.spawnError && interactiveResult.exitCode === 0) {
2071
+ setPhase("success");
2072
+ }
2073
+ break;
2074
+ }
1758
2075
  case "copy":
1759
2076
  await copyToClipboard(cmdDisplay);
1760
2077
  break;
1761
2078
  case "menu":
1762
- onBack();
2079
+ (onHome ?? onBack)();
1763
2080
  break;
1764
2081
  case "exit":
1765
2082
  onExit();
@@ -1769,19 +2086,20 @@ function CommandExecution({
1769
2086
  onCancel: onBack,
1770
2087
  boxedSections: panelMode,
1771
2088
  width: panelMode ? Math.max(20, width - 4) : width,
1772
- maxVisible: panelMode ? Math.max(6, height - 6) : void 0,
2089
+ maxVisible: panelMode ? Math.max(errorItems.length + (suggestions.length > 0 ? 4 : 0), height - 6) : void 0,
1773
2090
  isInputActive,
1774
- arrowNavigation: panelMode
2091
+ arrowNavigation: panelMode,
2092
+ panelFocused: isInputActive
1775
2093
  }
1776
2094
  ),
1777
- !panelMode && /* @__PURE__ */ jsx15(StatusBar, { width })
2095
+ !panelMode && /* @__PURE__ */ jsx17(StatusBar, { width })
1778
2096
  ] });
1779
2097
  }
1780
2098
 
1781
2099
  // src/screens/SelfUpdate.tsx
1782
- import { useEffect as useEffect6, useState as useState11 } from "react";
1783
- import { Box as Box13, Text as Text15 } from "ink";
1784
- import { jsx as jsx16, jsxs as jsxs15 } from "react/jsx-runtime";
2100
+ import { useEffect as useEffect7, useState as useState12 } from "react";
2101
+ import { Box as Box14, Text as Text18 } from "ink";
2102
+ import { jsx as jsx18, jsxs as jsxs16 } from "react/jsx-runtime";
1785
2103
  var packageName = "@polterware/polter";
1786
2104
  var globalUpdateArgs = ["install", "-g", `${packageName}@latest`];
1787
2105
  var repositoryUpdateArgs = ["install", "-D", `${packageName}@latest`];
@@ -1797,22 +2115,24 @@ function SelfUpdate({
1797
2115
  isInputActive = true
1798
2116
  }) {
1799
2117
  const repositoryRoot = findNearestPackageRoot();
1800
- const [target, setTarget] = useState11(
2118
+ const [target, setTarget] = useState12(
1801
2119
  repositoryRoot ? "repository" : "global"
1802
2120
  );
1803
- const [phase, setPhase] = useState11(
2121
+ const [phase, setPhase] = useState12(
1804
2122
  repositoryRoot ? "target" : "confirm"
1805
2123
  );
1806
2124
  const updateArgs = getUpdateArgs(target);
1807
2125
  const updateDisplay = `npm ${updateArgs.join(" ")}`;
1808
2126
  const updateCwd = target === "repository" && repositoryRoot ? repositoryRoot : process.cwd();
1809
- const { status, result, run, reset } = useCommand("npm", updateCwd);
1810
- useEffect6(() => {
2127
+ const { status, result, run, reset } = useCommand("npm", updateCwd, {
2128
+ quiet: panelMode
2129
+ });
2130
+ useEffect7(() => {
1811
2131
  if (phase === "running" && status === "idle") {
1812
2132
  run(updateArgs);
1813
2133
  }
1814
2134
  }, [phase, run, status, updateArgs]);
1815
- useEffect6(() => {
2135
+ useEffect7(() => {
1816
2136
  if (phase === "running" && status === "success") {
1817
2137
  setPhase("success");
1818
2138
  }
@@ -1837,9 +2157,9 @@ function SelfUpdate({
1837
2157
  },
1838
2158
  ...!panelMode ? [{ value: "back", label: "\u2190 Back to menu" }] : []
1839
2159
  ];
1840
- return /* @__PURE__ */ jsxs15(Box13, { flexDirection: "column", paddingX: panelMode ? 1 : 0, children: [
1841
- /* @__PURE__ */ jsx16(Box13, { marginBottom: 1, children: /* @__PURE__ */ jsx16(Text15, { bold: true, children: "Choose where to update Polter." }) }),
1842
- /* @__PURE__ */ jsx16(
2160
+ return /* @__PURE__ */ jsxs16(Box14, { flexDirection: "column", paddingX: panelMode ? 1 : 0, children: [
2161
+ /* @__PURE__ */ jsx18(Box14, { marginBottom: 1, children: /* @__PURE__ */ jsx18(Text18, { bold: true, children: "Choose where to update Polter." }) }),
2162
+ /* @__PURE__ */ jsx18(
1843
2163
  SelectList,
1844
2164
  {
1845
2165
  items: targetItems,
@@ -1857,18 +2177,19 @@ function SelfUpdate({
1857
2177
  width: panelMode ? Math.max(20, width - 4) : width,
1858
2178
  maxVisible: panelMode ? Math.max(6, height - 6) : void 0,
1859
2179
  isInputActive,
1860
- arrowNavigation: panelMode
2180
+ arrowNavigation: panelMode,
2181
+ panelFocused: isInputActive
1861
2182
  }
1862
2183
  ),
1863
- repositoryRoot && /* @__PURE__ */ jsx16(Box13, { marginTop: 1, marginLeft: 2, children: /* @__PURE__ */ jsxs15(Text15, { dimColor: true, children: [
2184
+ repositoryRoot && /* @__PURE__ */ jsx18(Box14, { marginTop: 1, marginLeft: 2, children: /* @__PURE__ */ jsxs16(Text18, { dimColor: true, children: [
1864
2185
  "Repository root: ",
1865
2186
  repositoryRoot
1866
2187
  ] }) })
1867
2188
  ] });
1868
2189
  }
1869
2190
  if (phase === "confirm") {
1870
- return /* @__PURE__ */ jsxs15(Box13, { flexDirection: "column", paddingX: panelMode ? 1 : 0, children: [
1871
- /* @__PURE__ */ jsx16(
2191
+ return /* @__PURE__ */ jsxs16(Box14, { flexDirection: "column", paddingX: panelMode ? 1 : 0, children: [
2192
+ /* @__PURE__ */ jsx18(
1872
2193
  ConfirmPrompt,
1873
2194
  {
1874
2195
  message: `Run ${updateDisplay}?`,
@@ -1896,9 +2217,9 @@ function SelfUpdate({
1896
2217
  arrowNavigation: panelMode
1897
2218
  }
1898
2219
  ),
1899
- /* @__PURE__ */ jsxs15(Box13, { marginTop: 1, marginLeft: 2, flexDirection: "column", children: [
1900
- /* @__PURE__ */ jsx16(Text15, { dimColor: true, children: target === "repository" ? "This updates the dependency in the current repository." : "This updates the global npm install." }),
1901
- target === "repository" && repositoryRoot && /* @__PURE__ */ jsxs15(Text15, { dimColor: true, children: [
2220
+ /* @__PURE__ */ jsxs16(Box14, { marginTop: 1, marginLeft: 2, flexDirection: "column", children: [
2221
+ /* @__PURE__ */ jsx18(Text18, { dimColor: true, children: target === "repository" ? "This updates the dependency in the current repository." : "This updates the global npm install." }),
2222
+ target === "repository" && repositoryRoot && /* @__PURE__ */ jsxs16(Text18, { dimColor: true, children: [
1902
2223
  "Run location: ",
1903
2224
  repositoryRoot
1904
2225
  ] })
@@ -1906,15 +2227,15 @@ function SelfUpdate({
1906
2227
  ] });
1907
2228
  }
1908
2229
  if (phase === "running") {
1909
- return /* @__PURE__ */ jsxs15(Box13, { flexDirection: "column", paddingX: panelMode ? 1 : 0, children: [
1910
- /* @__PURE__ */ jsx16(Divider, { width: panelMode ? width - 4 : width }),
1911
- /* @__PURE__ */ jsxs15(Box13, { marginY: 1, gap: 1, children: [
1912
- /* @__PURE__ */ jsx16(Text15, { color: inkColors.accent, bold: true, children: "\u25B6" }),
1913
- /* @__PURE__ */ jsx16(Text15, { dimColor: true, children: "Running:" }),
1914
- /* @__PURE__ */ jsx16(Text15, { children: updateDisplay })
2230
+ return /* @__PURE__ */ jsxs16(Box14, { flexDirection: "column", paddingX: panelMode ? 1 : 0, children: [
2231
+ /* @__PURE__ */ jsx18(Divider, { width: panelMode ? width - 4 : width }),
2232
+ /* @__PURE__ */ jsxs16(Box14, { marginY: 1, gap: 1, children: [
2233
+ /* @__PURE__ */ jsx18(Text18, { color: inkColors.accent, bold: true, children: "\u25B6" }),
2234
+ /* @__PURE__ */ jsx18(Text18, { dimColor: true, children: "Running:" }),
2235
+ /* @__PURE__ */ jsx18(Text18, { children: updateDisplay })
1915
2236
  ] }),
1916
- /* @__PURE__ */ jsx16(Divider, { width: panelMode ? width - 4 : width }),
1917
- /* @__PURE__ */ jsx16(Box13, { marginTop: 1, children: /* @__PURE__ */ jsx16(Spinner, { label: "Updating Polter..." }) })
2237
+ /* @__PURE__ */ jsx18(Divider, { width: panelMode ? width - 4 : width }),
2238
+ /* @__PURE__ */ jsx18(Box14, { marginTop: 1, children: /* @__PURE__ */ jsx18(Spinner, { label: "Updating Polter..." }) })
1918
2239
  ] });
1919
2240
  }
1920
2241
  if (phase === "success") {
@@ -1923,20 +2244,29 @@ function SelfUpdate({
1923
2244
  ...!panelMode ? [{ value: "__back__", label: "\u2190 Back to menu", kind: "action" }] : [],
1924
2245
  { value: "__exit__", label: "\u{1F6AA} Exit Polter", kind: "action" }
1925
2246
  ];
1926
- return /* @__PURE__ */ jsxs15(Box13, { flexDirection: "column", paddingX: panelMode ? 1 : 0, children: [
1927
- /* @__PURE__ */ jsx16(Divider, { width: panelMode ? width - 4 : width }),
1928
- /* @__PURE__ */ jsxs15(Box13, { marginY: 1, gap: 1, children: [
1929
- /* @__PURE__ */ jsx16(Text15, { color: inkColors.accent, bold: true, children: "\u2713" }),
1930
- /* @__PURE__ */ jsx16(Text15, { color: inkColors.accent, bold: true, children: "Update completed successfully!" })
2247
+ return /* @__PURE__ */ jsxs16(Box14, { flexDirection: "column", paddingX: panelMode ? 1 : 0, children: [
2248
+ /* @__PURE__ */ jsx18(Divider, { width: panelMode ? width - 4 : width }),
2249
+ /* @__PURE__ */ jsxs16(Box14, { marginY: 1, gap: 1, children: [
2250
+ /* @__PURE__ */ jsx18(Text18, { color: inkColors.accent, bold: true, children: "\u2713" }),
2251
+ /* @__PURE__ */ jsx18(Text18, { color: inkColors.accent, bold: true, children: "Update completed successfully!" })
1931
2252
  ] }),
1932
- /* @__PURE__ */ jsxs15(Box13, { marginBottom: 1, marginLeft: 2, flexDirection: "column", children: [
1933
- /* @__PURE__ */ jsx16(Text15, { dimColor: true, children: "Restart Polter to use the latest version." }),
1934
- target === "repository" && repositoryRoot && /* @__PURE__ */ jsxs15(Text15, { dimColor: true, children: [
2253
+ /* @__PURE__ */ jsxs16(Box14, { marginBottom: 1, marginLeft: 2, flexDirection: "column", children: [
2254
+ /* @__PURE__ */ jsx18(Text18, { dimColor: true, children: "Restart Polter to use the latest version." }),
2255
+ target === "repository" && repositoryRoot && /* @__PURE__ */ jsxs16(Text18, { dimColor: true, children: [
1935
2256
  "Repository updated in: ",
1936
2257
  repositoryRoot
1937
2258
  ] })
1938
2259
  ] }),
1939
- /* @__PURE__ */ jsx16(
2260
+ /* @__PURE__ */ jsx18(
2261
+ CommandOutput,
2262
+ {
2263
+ stdout: result?.stdout,
2264
+ stderr: result?.stderr,
2265
+ height: Math.max(3, height - 12),
2266
+ isActive: isInputActive
2267
+ }
2268
+ ),
2269
+ /* @__PURE__ */ jsx18(
1940
2270
  SelectList,
1941
2271
  {
1942
2272
  items: successItems,
@@ -1952,7 +2282,8 @@ function SelfUpdate({
1952
2282
  width: panelMode ? Math.max(20, width - 4) : width,
1953
2283
  maxVisible: panelMode ? Math.max(6, height - 6) : void 0,
1954
2284
  isInputActive,
1955
- arrowNavigation: panelMode
2285
+ arrowNavigation: panelMode,
2286
+ panelFocused: isInputActive
1956
2287
  }
1957
2288
  )
1958
2289
  ] });
@@ -1964,40 +2295,49 @@ function SelfUpdate({
1964
2295
  ...!panelMode ? [{ value: "menu", label: "\u2190 Return to main menu", kind: "action" }] : [],
1965
2296
  { value: "exit", label: "\u{1F6AA} Exit Polter", kind: "action" }
1966
2297
  ];
1967
- return /* @__PURE__ */ jsxs15(Box13, { flexDirection: "column", paddingX: panelMode ? 1 : 0, children: [
1968
- /* @__PURE__ */ jsx16(Divider, { width: panelMode ? width - 4 : width }),
1969
- result?.spawnError ? /* @__PURE__ */ jsxs15(Box13, { flexDirection: "column", marginY: 1, children: [
1970
- /* @__PURE__ */ jsxs15(Box13, { gap: 1, children: [
1971
- /* @__PURE__ */ jsx16(Text15, { color: "red", bold: true, children: "\u2717" }),
1972
- /* @__PURE__ */ jsx16(Text15, { color: "red", bold: true, children: "Failed to start update" })
2298
+ return /* @__PURE__ */ jsxs16(Box14, { flexDirection: "column", paddingX: panelMode ? 1 : 0, children: [
2299
+ /* @__PURE__ */ jsx18(Divider, { width: panelMode ? width - 4 : width }),
2300
+ result?.spawnError ? /* @__PURE__ */ jsxs16(Box14, { flexDirection: "column", marginY: 1, children: [
2301
+ /* @__PURE__ */ jsxs16(Box14, { gap: 1, children: [
2302
+ /* @__PURE__ */ jsx18(Text18, { color: "red", bold: true, children: "\u2717" }),
2303
+ /* @__PURE__ */ jsx18(Text18, { color: "red", bold: true, children: "Failed to start update" })
1973
2304
  ] }),
1974
- /* @__PURE__ */ jsxs15(Box13, { marginLeft: 2, marginTop: 1, children: [
1975
- /* @__PURE__ */ jsx16(Text15, { dimColor: true, children: "Error: " }),
1976
- /* @__PURE__ */ jsx16(Text15, { color: "red", children: result.spawnError })
2305
+ /* @__PURE__ */ jsxs16(Box14, { marginLeft: 2, marginTop: 1, children: [
2306
+ /* @__PURE__ */ jsx18(Text18, { dimColor: true, children: "Error: " }),
2307
+ /* @__PURE__ */ jsx18(Text18, { color: "red", children: result.spawnError })
1977
2308
  ] })
1978
- ] }) : /* @__PURE__ */ jsxs15(Box13, { flexDirection: "column", marginY: 1, children: [
1979
- /* @__PURE__ */ jsxs15(Box13, { gap: 1, children: [
1980
- /* @__PURE__ */ jsx16(Text15, { color: "red", bold: true, children: "\u2717" }),
1981
- /* @__PURE__ */ jsx16(Text15, { color: "red", children: "Update failed " }),
1982
- /* @__PURE__ */ jsx16(Text15, { dimColor: true, children: "(exit code " }),
1983
- /* @__PURE__ */ jsx16(Text15, { color: "red", bold: true, children: String(result?.exitCode) }),
1984
- /* @__PURE__ */ jsx16(Text15, { dimColor: true, children: ")" })
2309
+ ] }) : /* @__PURE__ */ jsxs16(Box14, { flexDirection: "column", marginY: 1, children: [
2310
+ /* @__PURE__ */ jsxs16(Box14, { gap: 1, children: [
2311
+ /* @__PURE__ */ jsx18(Text18, { color: "red", bold: true, children: "\u2717" }),
2312
+ /* @__PURE__ */ jsx18(Text18, { color: "red", children: "Update failed " }),
2313
+ /* @__PURE__ */ jsx18(Text18, { dimColor: true, children: "(exit code " }),
2314
+ /* @__PURE__ */ jsx18(Text18, { color: "red", bold: true, children: String(result?.exitCode) }),
2315
+ /* @__PURE__ */ jsx18(Text18, { dimColor: true, children: ")" })
1985
2316
  ] }),
1986
- /* @__PURE__ */ jsxs15(Box13, { marginLeft: 2, marginTop: 1, children: [
1987
- /* @__PURE__ */ jsx16(Text15, { dimColor: true, children: "Command: " }),
1988
- /* @__PURE__ */ jsx16(Text15, { children: updateDisplay })
2317
+ /* @__PURE__ */ jsxs16(Box14, { marginLeft: 2, marginTop: 1, children: [
2318
+ /* @__PURE__ */ jsx18(Text18, { dimColor: true, children: "Command: " }),
2319
+ /* @__PURE__ */ jsx18(Text18, { children: updateDisplay })
1989
2320
  ] })
1990
2321
  ] }),
1991
- /* @__PURE__ */ jsxs15(Box13, { marginBottom: 1, marginLeft: 2, flexDirection: "column", children: [
1992
- /* @__PURE__ */ jsx16(Text15, { dimColor: true, children: "Manual fallback:" }),
1993
- /* @__PURE__ */ jsx16(Text15, { color: inkColors.accent, children: updateDisplay }),
1994
- target === "repository" && repositoryRoot && /* @__PURE__ */ jsxs15(Text15, { dimColor: true, children: [
2322
+ /* @__PURE__ */ jsx18(
2323
+ CommandOutput,
2324
+ {
2325
+ stdout: result?.stdout,
2326
+ stderr: result?.stderr,
2327
+ height: Math.max(3, height - 16),
2328
+ isActive: false
2329
+ }
2330
+ ),
2331
+ /* @__PURE__ */ jsxs16(Box14, { marginBottom: 1, marginLeft: 2, flexDirection: "column", children: [
2332
+ /* @__PURE__ */ jsx18(Text18, { dimColor: true, children: "Manual fallback:" }),
2333
+ /* @__PURE__ */ jsx18(Text18, { color: inkColors.accent, children: updateDisplay }),
2334
+ target === "repository" && repositoryRoot && /* @__PURE__ */ jsxs16(Text18, { dimColor: true, children: [
1995
2335
  "Run location: ",
1996
2336
  repositoryRoot
1997
2337
  ] })
1998
2338
  ] }),
1999
- !panelMode && /* @__PURE__ */ jsx16(Box13, { marginTop: 1, marginBottom: 1, children: /* @__PURE__ */ jsx16(Text15, { bold: true, children: "What would you like to do?" }) }),
2000
- /* @__PURE__ */ jsx16(
2339
+ !panelMode && /* @__PURE__ */ jsx18(Box14, { marginTop: 1, marginBottom: 1, children: /* @__PURE__ */ jsx18(Text18, { bold: true, children: "What would you like to do?" }) }),
2340
+ /* @__PURE__ */ jsx18(
2001
2341
  SelectList,
2002
2342
  {
2003
2343
  items: errorItems,
@@ -2024,38 +2364,55 @@ function SelfUpdate({
2024
2364
  width: panelMode ? Math.max(20, width - 4) : width,
2025
2365
  maxVisible: panelMode ? Math.max(6, height - 6) : void 0,
2026
2366
  isInputActive,
2027
- arrowNavigation: panelMode
2367
+ arrowNavigation: panelMode,
2368
+ panelFocused: isInputActive
2028
2369
  }
2029
2370
  ),
2030
- !panelMode && /* @__PURE__ */ jsx16(StatusBar, { width })
2371
+ !panelMode && /* @__PURE__ */ jsx18(StatusBar, { width })
2031
2372
  ] });
2032
2373
  }
2033
2374
 
2034
2375
  // src/screens/ToolStatus.tsx
2035
2376
  import { useMemo as useMemo4 } from "react";
2036
- import { Box as Box14, Text as Text16 } from "ink";
2037
- import { jsx as jsx17, jsxs as jsxs16 } from "react/jsx-runtime";
2377
+ import { Box as Box15, Text as Text19 } from "ink";
2378
+ import { jsx as jsx19, jsxs as jsxs17 } from "react/jsx-runtime";
2038
2379
  var toolIds = ["supabase", "gh", "vercel", "git"];
2039
2380
  function ToolStatus({ onBack, width = 80, height = 24, panelMode = false, isInputActive = true }) {
2040
2381
  const tools = useMemo4(() => toolIds.map(getToolInfo), []);
2041
2382
  if (panelMode) {
2042
- return /* @__PURE__ */ jsxs16(Box14, { flexDirection: "column", paddingX: 1, children: [
2043
- /* @__PURE__ */ jsx17(Box14, { marginBottom: 1, children: /* @__PURE__ */ jsx17(Text16, { bold: true, color: inkColors.accent, children: "\u{1F527} Tool Status" }) }),
2044
- tools.map((tool) => /* @__PURE__ */ jsxs16(Box14, { gap: 1, marginLeft: 2, children: [
2045
- /* @__PURE__ */ jsx17(Text16, { color: tool.installed ? inkColors.accent : "red", children: tool.installed ? "\u2713" : "\u2717" }),
2046
- /* @__PURE__ */ jsx17(Box14, { width: 16, children: /* @__PURE__ */ jsx17(Text16, { bold: true, children: tool.label }) }),
2047
- /* @__PURE__ */ jsx17(Text16, { dimColor: true, children: tool.installed ? tool.version ?? "installed" : "not found" })
2048
- ] }, tool.id))
2049
- ] });
2383
+ const statusItems = [
2384
+ { value: "__section__", label: "Installed Tools", kind: "header", selectable: false },
2385
+ ...tools.map((tool) => ({
2386
+ value: tool.id,
2387
+ label: `${tool.installed ? "\u2713" : "\u2717"} ${tool.label}`,
2388
+ hint: tool.installed ? tool.version ?? "installed" : "not found",
2389
+ kind: "action"
2390
+ }))
2391
+ ];
2392
+ return /* @__PURE__ */ jsx19(Box15, { flexDirection: "column", paddingX: 1, children: /* @__PURE__ */ jsx19(
2393
+ SelectList,
2394
+ {
2395
+ items: statusItems,
2396
+ onSelect: () => {
2397
+ },
2398
+ onCancel: onBack,
2399
+ boxedSections: true,
2400
+ width: Math.max(20, width - 4),
2401
+ maxVisible: Math.max(6, height - 6),
2402
+ isInputActive,
2403
+ arrowNavigation: true,
2404
+ panelFocused: isInputActive
2405
+ }
2406
+ ) });
2050
2407
  }
2051
- return /* @__PURE__ */ jsxs16(Box14, { flexDirection: "column", children: [
2052
- /* @__PURE__ */ jsx17(Box14, { marginBottom: 1, children: /* @__PURE__ */ jsx17(Text16, { bold: true, color: inkColors.accent, children: "\u{1F527} Tool Status" }) }),
2053
- tools.map((tool) => /* @__PURE__ */ jsxs16(Box14, { gap: 1, marginLeft: 2, children: [
2054
- /* @__PURE__ */ jsx17(Text16, { color: tool.installed ? inkColors.accent : "red", children: tool.installed ? "\u2713" : "\u2717" }),
2055
- /* @__PURE__ */ jsx17(Box14, { width: 16, children: /* @__PURE__ */ jsx17(Text16, { bold: true, children: tool.label }) }),
2056
- /* @__PURE__ */ jsx17(Text16, { dimColor: true, children: tool.installed ? tool.version ?? "installed" : "not found" })
2408
+ return /* @__PURE__ */ jsxs17(Box15, { flexDirection: "column", children: [
2409
+ /* @__PURE__ */ jsx19(Box15, { marginBottom: 1, children: /* @__PURE__ */ jsx19(Text19, { bold: true, color: inkColors.accent, children: "\u{1F527} Tool Status" }) }),
2410
+ tools.map((tool) => /* @__PURE__ */ jsxs17(Box15, { gap: 1, marginLeft: 2, children: [
2411
+ /* @__PURE__ */ jsx19(Text19, { color: tool.installed ? inkColors.accent : "red", children: tool.installed ? "\u2713" : "\u2717" }),
2412
+ /* @__PURE__ */ jsx19(Box15, { width: 16, children: /* @__PURE__ */ jsx19(Text19, { bold: true, children: tool.label }) }),
2413
+ /* @__PURE__ */ jsx19(Text19, { dimColor: true, children: tool.installed ? tool.version ?? "installed" : "not found" })
2057
2414
  ] }, tool.id)),
2058
- /* @__PURE__ */ jsx17(Box14, { marginTop: 1, children: /* @__PURE__ */ jsx17(
2415
+ /* @__PURE__ */ jsx19(Box15, { marginTop: 1, children: /* @__PURE__ */ jsx19(
2059
2416
  SelectList,
2060
2417
  {
2061
2418
  items: [{ value: "__back__", label: "\u2190 Back" }],
@@ -2065,17 +2422,17 @@ function ToolStatus({ onBack, width = 80, height = 24, panelMode = false, isInpu
2065
2422
  isInputActive
2066
2423
  }
2067
2424
  ) }),
2068
- /* @__PURE__ */ jsx17(StatusBar, { hint: "Enter to go back", width })
2425
+ /* @__PURE__ */ jsx19(StatusBar, { hint: "Enter to go back", width })
2069
2426
  ] });
2070
2427
  }
2071
2428
 
2072
2429
  // src/screens/ProjectConfig.tsx
2073
- import { useMemo as useMemo5, useState as useState13 } from "react";
2074
- import { Box as Box15, Text as Text17 } from "ink";
2430
+ import { useMemo as useMemo5, useState as useState14 } from "react";
2431
+ import { Box as Box16, Text as Text20 } from "ink";
2075
2432
 
2076
2433
  // src/hooks/useEditor.ts
2077
- import { useState as useState12, useCallback as useCallback3 } from "react";
2078
- import { useStdin } from "ink";
2434
+ import { useState as useState13, useCallback as useCallback4 } from "react";
2435
+ import { useStdin as useStdin2 } from "ink";
2079
2436
 
2080
2437
  // src/lib/editor.ts
2081
2438
  import { spawnSync, spawn as spawn2 } from "child_process";
@@ -2124,9 +2481,9 @@ function openInEditor(filePath) {
2124
2481
 
2125
2482
  // src/hooks/useEditor.ts
2126
2483
  function useEditor() {
2127
- const { setRawMode } = useStdin();
2128
- const [isEditing, setIsEditing] = useState12(false);
2129
- const openEditor = useCallback3(async (filePath) => {
2484
+ const { setRawMode } = useStdin2();
2485
+ const [isEditing, setIsEditing] = useState13(false);
2486
+ const openEditor = useCallback4(async (filePath) => {
2130
2487
  const editor = resolveEditor();
2131
2488
  const terminal = isTerminalEditor(editor.command);
2132
2489
  setIsEditing(true);
@@ -2146,7 +2503,7 @@ function useEditor() {
2146
2503
  }
2147
2504
 
2148
2505
  // src/screens/ProjectConfig.tsx
2149
- import { jsx as jsx18, jsxs as jsxs17 } from "react/jsx-runtime";
2506
+ import { jsx as jsx20, jsxs as jsxs18 } from "react/jsx-runtime";
2150
2507
  function ProjectConfig({
2151
2508
  onBack,
2152
2509
  width = 80,
@@ -2155,14 +2512,14 @@ function ProjectConfig({
2155
2512
  isInputActive = true
2156
2513
  }) {
2157
2514
  const configPath = useMemo5(() => getProjectConfigPath(), []);
2158
- const [config2, setConfig] = useState13(() => getOrCreateProjectConfig());
2159
- const [phase, setPhase] = useState13("overview");
2160
- const [feedback, setFeedback] = useState13();
2515
+ const [config2, setConfig] = useState14(() => getOrCreateProjectConfig());
2516
+ const [phase, setPhase] = useState14("overview");
2517
+ const [feedback, setFeedback] = useState14();
2161
2518
  const { openEditor, isEditing } = useEditor();
2162
2519
  if (!configPath) {
2163
- return /* @__PURE__ */ jsxs17(Box15, { flexDirection: "column", paddingX: panelMode ? 1 : 0, children: [
2164
- /* @__PURE__ */ jsx18(Text17, { color: "red", children: "No package.json found. Run from a project directory." }),
2165
- !panelMode && /* @__PURE__ */ jsx18(
2520
+ return /* @__PURE__ */ jsxs18(Box16, { flexDirection: "column", paddingX: panelMode ? 1 : 0, children: [
2521
+ /* @__PURE__ */ jsx20(Text20, { color: "red", children: "No package.json found. Run from a project directory." }),
2522
+ !panelMode && /* @__PURE__ */ jsx20(
2166
2523
  SelectList,
2167
2524
  {
2168
2525
  items: [{ value: "__back__", label: "\u2190 Back" }],
@@ -2175,7 +2532,7 @@ function ProjectConfig({
2175
2532
  ] });
2176
2533
  }
2177
2534
  if (phase === "edit-supabase-ref") {
2178
- return /* @__PURE__ */ jsx18(Box15, { flexDirection: "column", paddingX: panelMode ? 1 : 0, children: /* @__PURE__ */ jsx18(
2535
+ return /* @__PURE__ */ jsx20(Box16, { flexDirection: "column", paddingX: panelMode ? 1 : 0, children: /* @__PURE__ */ jsx20(
2179
2536
  TextPrompt,
2180
2537
  {
2181
2538
  label: "Supabase project ref:",
@@ -2193,12 +2550,16 @@ function ProjectConfig({
2193
2550
  setFeedback("Supabase project ref updated");
2194
2551
  setPhase("overview");
2195
2552
  },
2196
- onCancel: () => setPhase("overview")
2553
+ onCancel: () => setPhase("overview"),
2554
+ arrowNavigation: panelMode,
2555
+ isInputActive,
2556
+ boxed: panelMode,
2557
+ focused: isInputActive
2197
2558
  }
2198
2559
  ) });
2199
2560
  }
2200
2561
  if (phase === "edit-vercel-id") {
2201
- return /* @__PURE__ */ jsx18(Box15, { flexDirection: "column", paddingX: panelMode ? 1 : 0, children: /* @__PURE__ */ jsx18(
2562
+ return /* @__PURE__ */ jsx20(Box16, { flexDirection: "column", paddingX: panelMode ? 1 : 0, children: /* @__PURE__ */ jsx20(
2202
2563
  TextPrompt,
2203
2564
  {
2204
2565
  label: "Vercel project ID:",
@@ -2216,12 +2577,16 @@ function ProjectConfig({
2216
2577
  setFeedback("Vercel project ID updated");
2217
2578
  setPhase("overview");
2218
2579
  },
2219
- onCancel: () => setPhase("overview")
2580
+ onCancel: () => setPhase("overview"),
2581
+ arrowNavigation: panelMode,
2582
+ isInputActive,
2583
+ boxed: panelMode,
2584
+ focused: isInputActive
2220
2585
  }
2221
2586
  ) });
2222
2587
  }
2223
2588
  if (phase === "edit-gh-repo") {
2224
- return /* @__PURE__ */ jsx18(Box15, { flexDirection: "column", paddingX: panelMode ? 1 : 0, children: /* @__PURE__ */ jsx18(
2589
+ return /* @__PURE__ */ jsx20(Box16, { flexDirection: "column", paddingX: panelMode ? 1 : 0, children: /* @__PURE__ */ jsx20(
2225
2590
  TextPrompt,
2226
2591
  {
2227
2592
  label: "GitHub repo (owner/name):",
@@ -2239,7 +2604,11 @@ function ProjectConfig({
2239
2604
  setFeedback("GitHub repo updated");
2240
2605
  setPhase("overview");
2241
2606
  },
2242
- onCancel: () => setPhase("overview")
2607
+ onCancel: () => setPhase("overview"),
2608
+ arrowNavigation: panelMode,
2609
+ isInputActive,
2610
+ boxed: panelMode,
2611
+ focused: isInputActive
2243
2612
  }
2244
2613
  ) });
2245
2614
  }
@@ -2289,17 +2658,16 @@ function ProjectConfig({
2289
2658
  }
2290
2659
  };
2291
2660
  if (panelMode) {
2292
- return /* @__PURE__ */ jsxs17(Box15, { flexDirection: "column", paddingX: 1, children: [
2293
- /* @__PURE__ */ jsx18(Box15, { marginBottom: 1, children: /* @__PURE__ */ jsx18(Text17, { bold: true, color: inkColors.accent, children: "\u2699\uFE0F Project Config" }) }),
2294
- /* @__PURE__ */ jsx18(Box15, { marginBottom: 1, marginLeft: 2, children: /* @__PURE__ */ jsxs17(Text17, { dimColor: true, children: [
2661
+ return /* @__PURE__ */ jsxs18(Box16, { flexDirection: "column", paddingX: 1, children: [
2662
+ /* @__PURE__ */ jsx20(Box16, { marginBottom: 1, marginLeft: 2, children: /* @__PURE__ */ jsxs18(Text20, { dimColor: true, children: [
2295
2663
  "Path: ",
2296
2664
  configPath.file
2297
2665
  ] }) }),
2298
- feedback && /* @__PURE__ */ jsx18(Box15, { marginBottom: 1, children: /* @__PURE__ */ jsxs17(Text17, { color: inkColors.accent, children: [
2666
+ feedback && /* @__PURE__ */ jsx20(Box16, { marginBottom: 1, children: /* @__PURE__ */ jsxs18(Text20, { color: inkColors.accent, children: [
2299
2667
  "\u2713 ",
2300
2668
  feedback
2301
2669
  ] }) }),
2302
- /* @__PURE__ */ jsx18(
2670
+ /* @__PURE__ */ jsx20(
2303
2671
  SelectList,
2304
2672
  {
2305
2673
  items: configItems,
@@ -2309,36 +2677,37 @@ function ProjectConfig({
2309
2677
  width: Math.max(20, width - 4),
2310
2678
  maxVisible: Math.max(6, height - 6),
2311
2679
  isInputActive,
2312
- arrowNavigation: true
2680
+ arrowNavigation: true,
2681
+ panelFocused: isInputActive
2313
2682
  }
2314
2683
  )
2315
2684
  ] });
2316
2685
  }
2317
- return /* @__PURE__ */ jsxs17(Box15, { flexDirection: "column", children: [
2318
- /* @__PURE__ */ jsx18(Box15, { marginBottom: 1, children: /* @__PURE__ */ jsx18(Text17, { bold: true, color: inkColors.accent, children: "\u2699\uFE0F Project Config" }) }),
2319
- /* @__PURE__ */ jsxs17(Box15, { marginBottom: 1, marginLeft: 2, flexDirection: "column", children: [
2320
- /* @__PURE__ */ jsxs17(Text17, { dimColor: true, children: [
2686
+ return /* @__PURE__ */ jsxs18(Box16, { flexDirection: "column", children: [
2687
+ /* @__PURE__ */ jsx20(Box16, { marginBottom: 1, children: /* @__PURE__ */ jsx20(Text20, { bold: true, color: inkColors.accent, children: "\u2699\uFE0F Project Config" }) }),
2688
+ /* @__PURE__ */ jsxs18(Box16, { marginBottom: 1, marginLeft: 2, flexDirection: "column", children: [
2689
+ /* @__PURE__ */ jsxs18(Text20, { dimColor: true, children: [
2321
2690
  "Path: ",
2322
2691
  configPath.file
2323
2692
  ] }),
2324
- /* @__PURE__ */ jsxs17(Text17, { children: [
2693
+ /* @__PURE__ */ jsxs18(Text20, { children: [
2325
2694
  "Supabase ref: ",
2326
- config2.tools.supabase?.projectRef ?? /* @__PURE__ */ jsx18(Text17, { dimColor: true, children: "not set" })
2695
+ config2.tools.supabase?.projectRef ?? /* @__PURE__ */ jsx20(Text20, { dimColor: true, children: "not set" })
2327
2696
  ] }),
2328
- /* @__PURE__ */ jsxs17(Text17, { children: [
2697
+ /* @__PURE__ */ jsxs18(Text20, { children: [
2329
2698
  "Vercel ID: ",
2330
- config2.tools.vercel?.projectId ?? /* @__PURE__ */ jsx18(Text17, { dimColor: true, children: "not set" })
2699
+ config2.tools.vercel?.projectId ?? /* @__PURE__ */ jsx20(Text20, { dimColor: true, children: "not set" })
2331
2700
  ] }),
2332
- /* @__PURE__ */ jsxs17(Text17, { children: [
2701
+ /* @__PURE__ */ jsxs18(Text20, { children: [
2333
2702
  "GitHub repo: ",
2334
- config2.tools.gh?.repo ?? /* @__PURE__ */ jsx18(Text17, { dimColor: true, children: "not set" })
2703
+ config2.tools.gh?.repo ?? /* @__PURE__ */ jsx20(Text20, { dimColor: true, children: "not set" })
2335
2704
  ] })
2336
2705
  ] }),
2337
- feedback && /* @__PURE__ */ jsx18(Box15, { marginBottom: 1, children: /* @__PURE__ */ jsxs17(Text17, { color: inkColors.accent, children: [
2706
+ feedback && /* @__PURE__ */ jsx20(Box16, { marginBottom: 1, children: /* @__PURE__ */ jsxs18(Text20, { color: inkColors.accent, children: [
2338
2707
  "\u2713 ",
2339
2708
  feedback
2340
2709
  ] }) }),
2341
- /* @__PURE__ */ jsx18(
2710
+ /* @__PURE__ */ jsx20(
2342
2711
  SelectList,
2343
2712
  {
2344
2713
  items: flatItems,
@@ -2349,14 +2718,14 @@ function ProjectConfig({
2349
2718
  arrowNavigation: panelMode
2350
2719
  }
2351
2720
  ),
2352
- /* @__PURE__ */ jsx18(StatusBar, { hint: "\u2191\u2193 navigate \xB7 Enter select \xB7 Esc back", width })
2721
+ /* @__PURE__ */ jsx20(StatusBar, { hint: "\u2191\u2193 navigate \xB7 Enter select \xB7 Esc back", width })
2353
2722
  ] });
2354
2723
  }
2355
2724
 
2356
2725
  // src/screens/PipelineList.tsx
2357
2726
  import { useMemo as useMemo6 } from "react";
2358
- import { Box as Box16, Text as Text18 } from "ink";
2359
- import { jsx as jsx19, jsxs as jsxs18 } from "react/jsx-runtime";
2727
+ import { Box as Box17, Text as Text21 } from "ink";
2728
+ import { jsx as jsx21, jsxs as jsxs19 } from "react/jsx-runtime";
2360
2729
  function PipelineList({
2361
2730
  onNavigate,
2362
2731
  onBack,
@@ -2419,9 +2788,9 @@ function PipelineList({
2419
2788
  }
2420
2789
  return list;
2421
2790
  }, [pipelines, panelMode]);
2422
- return /* @__PURE__ */ jsxs18(Box16, { flexDirection: "column", paddingX: panelMode ? 1 : 0, children: [
2423
- /* @__PURE__ */ jsx19(Box16, { marginBottom: 1, children: /* @__PURE__ */ jsx19(Text18, { bold: true, color: inkColors.accent, children: "\u{1F517} Pipelines" }) }),
2424
- /* @__PURE__ */ jsx19(
2791
+ return /* @__PURE__ */ jsxs19(Box17, { flexDirection: "column", paddingX: panelMode ? 1 : 0, children: [
2792
+ !panelMode && /* @__PURE__ */ jsx21(Box17, { marginBottom: 1, children: /* @__PURE__ */ jsx21(Text21, { bold: true, color: inkColors.accent, children: "\u{1F517} Pipelines" }) }),
2793
+ /* @__PURE__ */ jsx21(
2425
2794
  SelectList,
2426
2795
  {
2427
2796
  items,
@@ -2441,17 +2810,18 @@ function PipelineList({
2441
2810
  width: panelMode ? Math.max(20, width - 4) : width,
2442
2811
  maxVisible: panelMode ? Math.max(6, height - 6) : void 0,
2443
2812
  isInputActive,
2444
- arrowNavigation: panelMode
2813
+ arrowNavigation: panelMode,
2814
+ panelFocused: isInputActive
2445
2815
  }
2446
2816
  ),
2447
- !panelMode && /* @__PURE__ */ jsx19(StatusBar, { hint: "\u2191\u2193 navigate \xB7 Enter select \xB7 Esc back", width })
2817
+ !panelMode && /* @__PURE__ */ jsx21(StatusBar, { hint: "\u2191\u2193 navigate \xB7 Enter select \xB7 Esc back", width })
2448
2818
  ] });
2449
2819
  }
2450
2820
 
2451
2821
  // src/screens/PipelineBuilder.tsx
2452
- import { useState as useState14 } from "react";
2453
- import { Box as Box17, Text as Text19 } from "ink";
2454
- import { jsx as jsx20, jsxs as jsxs19 } from "react/jsx-runtime";
2822
+ import { useState as useState15 } from "react";
2823
+ import { Box as Box18, Text as Text22 } from "ink";
2824
+ import { jsx as jsx22, jsxs as jsxs20 } from "react/jsx-runtime";
2455
2825
  var stepCounter = 0;
2456
2826
  function nextStepId() {
2457
2827
  stepCounter += 1;
@@ -2464,13 +2834,13 @@ function PipelineBuilder({
2464
2834
  panelMode = false,
2465
2835
  isInputActive = true
2466
2836
  }) {
2467
- const [phase, setPhase] = useState14("name");
2468
- const [name, setName] = useState14("");
2469
- const [steps, setSteps] = useState14([]);
2837
+ const [phase, setPhase] = useState15("name");
2838
+ const [name, setName] = useState15("");
2839
+ const [steps, setSteps] = useState15([]);
2470
2840
  if (phase === "name") {
2471
- return /* @__PURE__ */ jsxs19(Box17, { flexDirection: "column", children: [
2472
- /* @__PURE__ */ jsx20(Box17, { marginBottom: 1, children: /* @__PURE__ */ jsx20(Text19, { bold: true, color: inkColors.accent, children: "\u{1F517} New Pipeline" }) }),
2473
- /* @__PURE__ */ jsx20(
2841
+ return /* @__PURE__ */ jsxs20(Box18, { flexDirection: "column", paddingX: panelMode ? 1 : 0, children: [
2842
+ /* @__PURE__ */ jsx22(Box18, { marginBottom: 1, children: /* @__PURE__ */ jsx22(Text22, { bold: true, color: inkColors.accent, children: "\u{1F517} New Pipeline" }) }),
2843
+ /* @__PURE__ */ jsx22(
2474
2844
  TextPrompt,
2475
2845
  {
2476
2846
  label: "Pipeline name:",
@@ -2483,10 +2853,14 @@ function PipelineBuilder({
2483
2853
  setName(val.trim());
2484
2854
  setPhase("add-step");
2485
2855
  },
2486
- onCancel: onBack
2856
+ onCancel: onBack,
2857
+ arrowNavigation: panelMode,
2858
+ isInputActive,
2859
+ boxed: panelMode,
2860
+ focused: isInputActive
2487
2861
  }
2488
2862
  ),
2489
- !panelMode && /* @__PURE__ */ jsx20(StatusBar, { hint: "Type name \xB7 Enter to continue \xB7 Esc cancel", width })
2863
+ !panelMode && /* @__PURE__ */ jsx22(StatusBar, { hint: "Type name \xB7 Enter to continue \xB7 Esc cancel", width })
2490
2864
  ] });
2491
2865
  }
2492
2866
  if (phase === "add-step") {
@@ -2519,26 +2893,26 @@ function PipelineBuilder({
2519
2893
  kind: "action"
2520
2894
  }
2521
2895
  ];
2522
- return /* @__PURE__ */ jsxs19(Box17, { flexDirection: "column", children: [
2523
- /* @__PURE__ */ jsxs19(Box17, { marginBottom: 1, gap: 1, children: [
2524
- /* @__PURE__ */ jsxs19(Text19, { bold: true, color: inkColors.accent, children: [
2896
+ return /* @__PURE__ */ jsxs20(Box18, { flexDirection: "column", paddingX: panelMode ? 1 : 0, children: [
2897
+ /* @__PURE__ */ jsxs20(Box18, { marginBottom: 1, gap: 1, children: [
2898
+ /* @__PURE__ */ jsxs20(Text22, { bold: true, color: inkColors.accent, children: [
2525
2899
  "\u{1F517} ",
2526
2900
  name
2527
2901
  ] }),
2528
- /* @__PURE__ */ jsxs19(Text19, { dimColor: true, children: [
2902
+ /* @__PURE__ */ jsxs20(Text22, { dimColor: true, children: [
2529
2903
  "(",
2530
2904
  steps.length,
2531
2905
  " steps)"
2532
2906
  ] })
2533
2907
  ] }),
2534
- steps.length > 0 && /* @__PURE__ */ jsx20(Box17, { flexDirection: "column", marginBottom: 1, children: steps.map((step, i) => /* @__PURE__ */ jsxs19(Text19, { dimColor: true, children: [
2908
+ steps.length > 0 && /* @__PURE__ */ jsx22(Box18, { flexDirection: "column", marginBottom: 1, children: steps.map((step, i) => /* @__PURE__ */ jsxs20(Text22, { dimColor: true, children: [
2535
2909
  i + 1,
2536
2910
  ". ",
2537
2911
  step.commandId,
2538
2912
  step.args.length > 0 ? ` ${step.args.join(" ")}` : ""
2539
2913
  ] }, step.id)) }),
2540
- /* @__PURE__ */ jsx20(Text19, { dimColor: true, children: "Select a command to add as step:" }),
2541
- /* @__PURE__ */ jsx20(
2914
+ /* @__PURE__ */ jsx22(Text22, { dimColor: true, children: "Select a command to add as step:" }),
2915
+ /* @__PURE__ */ jsx22(
2542
2916
  SelectList,
2543
2917
  {
2544
2918
  items: commandItems,
@@ -2570,12 +2944,14 @@ function PipelineBuilder({
2570
2944
  }
2571
2945
  },
2572
2946
  maxVisible: Math.max(8, height - 14),
2573
- width,
2947
+ boxedSections: panelMode,
2948
+ width: panelMode ? Math.max(20, width - 4) : width,
2574
2949
  isInputActive,
2575
- arrowNavigation: panelMode
2950
+ arrowNavigation: panelMode,
2951
+ panelFocused: isInputActive
2576
2952
  }
2577
2953
  ),
2578
- !panelMode && /* @__PURE__ */ jsx20(StatusBar, { hint: "\u2191\u2193 navigate \xB7 Enter add step \xB7 Esc done", width })
2954
+ !panelMode && /* @__PURE__ */ jsx22(StatusBar, { hint: "\u2191\u2193 navigate \xB7 Enter add step \xB7 Esc done", width })
2579
2955
  ] });
2580
2956
  }
2581
2957
  const reviewItems = [
@@ -2598,18 +2974,18 @@ function PipelineBuilder({
2598
2974
  kind: "action"
2599
2975
  }
2600
2976
  ];
2601
- return /* @__PURE__ */ jsxs19(Box17, { flexDirection: "column", children: [
2602
- /* @__PURE__ */ jsx20(Box17, { marginBottom: 1, children: /* @__PURE__ */ jsxs19(Text19, { bold: true, color: inkColors.accent, children: [
2977
+ return /* @__PURE__ */ jsxs20(Box18, { flexDirection: "column", paddingX: panelMode ? 1 : 0, children: [
2978
+ /* @__PURE__ */ jsx22(Box18, { marginBottom: 1, children: /* @__PURE__ */ jsxs20(Text22, { bold: true, color: inkColors.accent, children: [
2603
2979
  "\u{1F517} Review: ",
2604
2980
  name
2605
2981
  ] }) }),
2606
- /* @__PURE__ */ jsx20(Box17, { flexDirection: "column", marginBottom: 1, children: steps.map((step, i) => /* @__PURE__ */ jsxs19(Text19, { children: [
2982
+ /* @__PURE__ */ jsx22(Box18, { flexDirection: "column", marginBottom: 1, children: steps.map((step, i) => /* @__PURE__ */ jsxs20(Text22, { children: [
2607
2983
  i + 1,
2608
2984
  ". ",
2609
2985
  step.commandId,
2610
2986
  step.args.length > 0 ? ` ${step.args.join(" ")}` : ""
2611
2987
  ] }, step.id)) }),
2612
- /* @__PURE__ */ jsx20(
2988
+ /* @__PURE__ */ jsx22(
2613
2989
  SelectList,
2614
2990
  {
2615
2991
  items: reviewItems,
@@ -2634,22 +3010,24 @@ function PipelineBuilder({
2634
3010
  onBack();
2635
3011
  },
2636
3012
  onCancel: onBack,
2637
- width,
3013
+ boxedSections: panelMode,
3014
+ width: panelMode ? Math.max(20, width - 4) : width,
2638
3015
  isInputActive,
2639
- arrowNavigation: panelMode
3016
+ arrowNavigation: panelMode,
3017
+ panelFocused: isInputActive
2640
3018
  }
2641
3019
  ),
2642
- !panelMode && /* @__PURE__ */ jsx20(StatusBar, { hint: "\u2191\u2193 navigate \xB7 Enter select \xB7 Esc back", width })
3020
+ !panelMode && /* @__PURE__ */ jsx22(StatusBar, { hint: "\u2191\u2193 navigate \xB7 Enter select \xB7 Esc back", width })
2643
3021
  ] });
2644
3022
  }
2645
3023
 
2646
3024
  // src/screens/PipelineExecution.tsx
2647
- import { useState as useState15, useEffect as useEffect7, useMemo as useMemo7 } from "react";
2648
- import { Box as Box20, Text as Text22 } from "ink";
3025
+ import { useState as useState16, useEffect as useEffect8, useMemo as useMemo7 } from "react";
3026
+ import { Box as Box21, Text as Text25 } from "ink";
2649
3027
 
2650
3028
  // src/components/StepIndicator.tsx
2651
- import { Box as Box18, Text as Text20 } from "ink";
2652
- import { jsx as jsx21, jsxs as jsxs20 } from "react/jsx-runtime";
3029
+ import { Box as Box19, Text as Text23 } from "ink";
3030
+ import { jsx as jsx23, jsxs as jsxs21 } from "react/jsx-runtime";
2653
3031
  var statusIcons = {
2654
3032
  pending: "\u25CB",
2655
3033
  running: "",
@@ -2669,21 +3047,21 @@ function StepIndicator({
2669
3047
  status,
2670
3048
  index
2671
3049
  }) {
2672
- return /* @__PURE__ */ jsxs20(Box18, { gap: 1, children: [
2673
- /* @__PURE__ */ jsxs20(Text20, { dimColor: true, children: [
3050
+ return /* @__PURE__ */ jsxs21(Box19, { gap: 1, children: [
3051
+ /* @__PURE__ */ jsxs21(Text23, { dimColor: true, children: [
2674
3052
  String(index + 1).padStart(2, " "),
2675
3053
  "."
2676
3054
  ] }),
2677
- status === "running" ? /* @__PURE__ */ jsx21(Spinner, { label: "" }) : /* @__PURE__ */ jsx21(
2678
- Text20,
3055
+ status === "running" ? /* @__PURE__ */ jsx23(Spinner, { label: "" }) : /* @__PURE__ */ jsx23(
3056
+ Text23,
2679
3057
  {
2680
3058
  color: statusColors[status],
2681
3059
  dimColor: status === "pending" || status === "skipped",
2682
3060
  children: statusIcons[status]
2683
3061
  }
2684
3062
  ),
2685
- /* @__PURE__ */ jsx21(
2686
- Text20,
3063
+ /* @__PURE__ */ jsx23(
3064
+ Text23,
2687
3065
  {
2688
3066
  color: statusColors[status],
2689
3067
  dimColor: status === "pending" || status === "skipped",
@@ -2695,8 +3073,8 @@ function StepIndicator({
2695
3073
  }
2696
3074
 
2697
3075
  // src/components/PipelineProgress.tsx
2698
- import { Box as Box19, Text as Text21 } from "ink";
2699
- import { jsxs as jsxs21 } from "react/jsx-runtime";
3076
+ import { Box as Box20, Text as Text24 } from "ink";
3077
+ import { jsxs as jsxs22 } from "react/jsx-runtime";
2700
3078
  function PipelineProgressBar({
2701
3079
  total,
2702
3080
  completed,
@@ -2707,14 +3085,14 @@ function PipelineProgressBar({
2707
3085
  const filledCount = total > 0 ? Math.round(completed / total * barWidth) : 0;
2708
3086
  const filled = "\u2588".repeat(filledCount);
2709
3087
  const empty = "\u2591".repeat(barWidth - filledCount);
2710
- return /* @__PURE__ */ jsxs21(Box19, { gap: 1, children: [
2711
- /* @__PURE__ */ jsxs21(Text21, { color: errors > 0 ? "red" : inkColors.accent, children: [
3088
+ return /* @__PURE__ */ jsxs22(Box20, { gap: 1, children: [
3089
+ /* @__PURE__ */ jsxs22(Text24, { color: errors > 0 ? "red" : inkColors.accent, children: [
2712
3090
  "[",
2713
3091
  filled,
2714
3092
  empty,
2715
3093
  "]"
2716
3094
  ] }),
2717
- /* @__PURE__ */ jsxs21(Text21, { dimColor: true, children: [
3095
+ /* @__PURE__ */ jsxs22(Text24, { dimColor: true, children: [
2718
3096
  completed,
2719
3097
  "/",
2720
3098
  total,
@@ -2724,7 +3102,7 @@ function PipelineProgressBar({
2724
3102
  }
2725
3103
 
2726
3104
  // src/screens/PipelineExecution.tsx
2727
- import { Fragment, jsx as jsx22, jsxs as jsxs22 } from "react/jsx-runtime";
3105
+ import { Fragment, jsx as jsx24, jsxs as jsxs23 } from "react/jsx-runtime";
2728
3106
  function PipelineExecution({
2729
3107
  pipelineId,
2730
3108
  onBack,
@@ -2737,10 +3115,10 @@ function PipelineExecution({
2737
3115
  () => getAllPipelines().find((p) => p.id === pipelineId),
2738
3116
  [pipelineId]
2739
3117
  );
2740
- const [phase, setPhase] = useState15("running");
2741
- const [progress, setProgress] = useState15(null);
2742
- const [results, setResults] = useState15([]);
2743
- useEffect7(() => {
3118
+ const [phase, setPhase] = useState16("running");
3119
+ const [progress, setProgress] = useState16(null);
3120
+ const [results, setResults] = useState16([]);
3121
+ useEffect8(() => {
2744
3122
  if (!pipeline) return;
2745
3123
  executePipeline(pipeline, (p) => {
2746
3124
  setProgress({ ...p });
@@ -2753,20 +3131,22 @@ function PipelineExecution({
2753
3131
  });
2754
3132
  }, [pipeline]);
2755
3133
  if (!pipeline) {
2756
- return /* @__PURE__ */ jsxs22(Box20, { flexDirection: "column", children: [
2757
- /* @__PURE__ */ jsxs22(Text22, { color: "red", children: [
3134
+ return /* @__PURE__ */ jsxs23(Box21, { flexDirection: "column", paddingX: panelMode ? 1 : 0, children: [
3135
+ /* @__PURE__ */ jsxs23(Text25, { color: "red", children: [
2758
3136
  "Pipeline not found: ",
2759
3137
  pipelineId
2760
3138
  ] }),
2761
- /* @__PURE__ */ jsx22(
3139
+ /* @__PURE__ */ jsx24(
2762
3140
  SelectList,
2763
3141
  {
2764
3142
  items: [{ value: "__back__", label: "\u2190 Back" }],
2765
3143
  onSelect: onBack,
2766
3144
  onCancel: onBack,
2767
- width,
3145
+ boxedSections: panelMode,
3146
+ width: panelMode ? Math.max(20, width - 4) : width,
2768
3147
  isInputActive,
2769
- arrowNavigation: panelMode
3148
+ arrowNavigation: panelMode,
3149
+ panelFocused: isInputActive
2770
3150
  }
2771
3151
  )
2772
3152
  ] });
@@ -2781,15 +3161,15 @@ function PipelineExecution({
2781
3161
  const base = cmdDef ? `${cmdDef.tool}: ${cmdDef.label}` : step.commandId;
2782
3162
  return step.args.length > 0 ? `${base} ${step.args.join(" ")}` : base;
2783
3163
  }
2784
- return /* @__PURE__ */ jsxs22(Box20, { flexDirection: "column", children: [
2785
- /* @__PURE__ */ jsxs22(Box20, { marginBottom: 1, gap: 1, children: [
2786
- /* @__PURE__ */ jsxs22(Text22, { bold: true, color: inkColors.accent, children: [
3164
+ return /* @__PURE__ */ jsxs23(Box21, { flexDirection: "column", paddingX: panelMode ? 1 : 0, children: [
3165
+ /* @__PURE__ */ jsxs23(Box21, { marginBottom: 1, gap: 1, children: [
3166
+ /* @__PURE__ */ jsxs23(Text25, { bold: true, color: inkColors.accent, children: [
2787
3167
  "\u{1F517} ",
2788
3168
  pipeline.name
2789
3169
  ] }),
2790
- /* @__PURE__ */ jsx22(Text22, { dimColor: true, children: phase === "running" ? "Running..." : "Complete" })
3170
+ /* @__PURE__ */ jsx24(Text25, { dimColor: true, children: phase === "running" ? "Running..." : "Complete" })
2791
3171
  ] }),
2792
- /* @__PURE__ */ jsx22(
3172
+ /* @__PURE__ */ jsx24(
2793
3173
  PipelineProgressBar,
2794
3174
  {
2795
3175
  total: pipeline.steps.length,
@@ -2798,8 +3178,8 @@ function PipelineExecution({
2798
3178
  width
2799
3179
  }
2800
3180
  ),
2801
- /* @__PURE__ */ jsx22(Divider, { width }),
2802
- /* @__PURE__ */ jsx22(Box20, { flexDirection: "column", marginY: 1, children: pipeline.steps.map((step, i) => /* @__PURE__ */ jsx22(
3181
+ /* @__PURE__ */ jsx24(Divider, { width }),
3182
+ /* @__PURE__ */ jsx24(Box21, { flexDirection: "column", marginY: 1, children: pipeline.steps.map((step, i) => /* @__PURE__ */ jsx24(
2803
3183
  StepIndicator,
2804
3184
  {
2805
3185
  label: step.label ?? getStepLabel(step),
@@ -2808,17 +3188,17 @@ function PipelineExecution({
2808
3188
  },
2809
3189
  step.id
2810
3190
  )) }),
2811
- phase === "done" && /* @__PURE__ */ jsxs22(Fragment, { children: [
2812
- /* @__PURE__ */ jsx22(Divider, { width }),
2813
- /* @__PURE__ */ jsx22(Box20, { marginY: 1, children: /* @__PURE__ */ jsx22(
2814
- Text22,
3191
+ phase === "done" && /* @__PURE__ */ jsxs23(Fragment, { children: [
3192
+ /* @__PURE__ */ jsx24(Divider, { width }),
3193
+ /* @__PURE__ */ jsx24(Box21, { marginY: 1, children: /* @__PURE__ */ jsx24(
3194
+ Text25,
2815
3195
  {
2816
3196
  color: errorCount > 0 ? "red" : inkColors.accent,
2817
3197
  bold: true,
2818
3198
  children: errorCount > 0 ? `Pipeline completed with ${errorCount} error(s)` : "Pipeline completed successfully!"
2819
3199
  }
2820
3200
  ) }),
2821
- /* @__PURE__ */ jsx22(
3201
+ /* @__PURE__ */ jsx24(
2822
3202
  SelectList,
2823
3203
  {
2824
3204
  items: [
@@ -2833,13 +3213,15 @@ function PipelineExecution({
2833
3213
  onBack();
2834
3214
  },
2835
3215
  onCancel: onBack,
2836
- width,
3216
+ boxedSections: panelMode,
3217
+ width: panelMode ? Math.max(20, width - 4) : width,
2837
3218
  isInputActive,
2838
- arrowNavigation: panelMode
3219
+ arrowNavigation: panelMode,
3220
+ panelFocused: isInputActive
2839
3221
  }
2840
3222
  )
2841
3223
  ] }),
2842
- !panelMode && /* @__PURE__ */ jsx22(
3224
+ !panelMode && /* @__PURE__ */ jsx24(
2843
3225
  StatusBar,
2844
3226
  {
2845
3227
  hint: phase === "running" ? "Running pipeline..." : "Enter select \xB7 Esc back",
@@ -2850,7 +3232,7 @@ function PipelineExecution({
2850
3232
  }
2851
3233
 
2852
3234
  // src/app.tsx
2853
- import { jsx as jsx23, jsxs as jsxs23 } from "react/jsx-runtime";
3235
+ import { jsx as jsx25, jsxs as jsxs24 } from "react/jsx-runtime";
2854
3236
  function AppClassic() {
2855
3237
  const { screen, params, navigate, goBack, goHome } = useNavigation();
2856
3238
  const { exit } = useApp();
@@ -2865,9 +3247,9 @@ function AppClassic() {
2865
3247
  const renderScreen = () => {
2866
3248
  switch (screen) {
2867
3249
  case "home":
2868
- return /* @__PURE__ */ jsx23(Home, { onNavigate: navigate, onExit: handleExit, width, height });
3250
+ return /* @__PURE__ */ jsx25(Home, { onNavigate: navigate, onExit: handleExit, width, height });
2869
3251
  case "command-args":
2870
- return /* @__PURE__ */ jsx23(
3252
+ return /* @__PURE__ */ jsx25(
2871
3253
  CommandArgs,
2872
3254
  {
2873
3255
  command: params.command ?? "",
@@ -2878,9 +3260,9 @@ function AppClassic() {
2878
3260
  }
2879
3261
  );
2880
3262
  case "custom-command":
2881
- return /* @__PURE__ */ jsx23(CustomCommand, { onNavigate: navigate, onBack: goBack, width });
3263
+ return /* @__PURE__ */ jsx25(CustomCommand, { onNavigate: navigate, onBack: goBack, width });
2882
3264
  case "flag-selection":
2883
- return /* @__PURE__ */ jsx23(
3265
+ return /* @__PURE__ */ jsx25(
2884
3266
  FlagSelection,
2885
3267
  {
2886
3268
  args: params.args ?? [],
@@ -2892,28 +3274,32 @@ function AppClassic() {
2892
3274
  );
2893
3275
  case "confirm-execute":
2894
3276
  case "command-execution":
2895
- return /* @__PURE__ */ jsx23(
3277
+ return /* @__PURE__ */ jsx25(
2896
3278
  CommandExecution,
2897
3279
  {
2898
3280
  args: params.args ?? [],
2899
3281
  tool: params.tool,
2900
3282
  onBack: goBack,
2901
3283
  onExit: handleExit,
3284
+ onRunSuggestion: (sugTool, sugArgs) => {
3285
+ goHome();
3286
+ navigate("confirm-execute", { tool: sugTool, args: sugArgs });
3287
+ },
2902
3288
  width
2903
3289
  }
2904
3290
  );
2905
3291
  case "self-update":
2906
- return /* @__PURE__ */ jsx23(SelfUpdate, { onBack: goBack, onExit: handleExit, width });
3292
+ return /* @__PURE__ */ jsx25(SelfUpdate, { onBack: goBack, onExit: handleExit, width });
2907
3293
  case "tool-status":
2908
- return /* @__PURE__ */ jsx23(ToolStatus, { onBack: goBack, width });
3294
+ return /* @__PURE__ */ jsx25(ToolStatus, { onBack: goBack, width });
2909
3295
  case "project-config":
2910
- return /* @__PURE__ */ jsx23(ProjectConfig, { onBack: goBack, width });
3296
+ return /* @__PURE__ */ jsx25(ProjectConfig, { onBack: goBack, width });
2911
3297
  case "pipeline-list":
2912
- return /* @__PURE__ */ jsx23(PipelineList, { onNavigate: navigate, onBack: goBack, width });
3298
+ return /* @__PURE__ */ jsx25(PipelineList, { onNavigate: navigate, onBack: goBack, width });
2913
3299
  case "pipeline-builder":
2914
- return /* @__PURE__ */ jsx23(PipelineBuilder, { onBack: goBack, width, height });
3300
+ return /* @__PURE__ */ jsx25(PipelineBuilder, { onBack: goBack, width, height });
2915
3301
  case "pipeline-execution":
2916
- return /* @__PURE__ */ jsx23(
3302
+ return /* @__PURE__ */ jsx25(
2917
3303
  PipelineExecution,
2918
3304
  {
2919
3305
  pipelineId: params.pipelineId ?? "",
@@ -2923,48 +3309,33 @@ function AppClassic() {
2923
3309
  }
2924
3310
  );
2925
3311
  default:
2926
- return /* @__PURE__ */ jsx23(Box21, { children: /* @__PURE__ */ jsxs23(Text23, { color: "red", children: [
3312
+ return /* @__PURE__ */ jsx25(Box22, { children: /* @__PURE__ */ jsxs24(Text26, { color: "red", children: [
2927
3313
  "Unknown screen: ",
2928
3314
  screen
2929
3315
  ] }) });
2930
3316
  }
2931
3317
  };
2932
- return /* @__PURE__ */ jsxs23(Box21, { flexDirection: "column", children: [
2933
- /* @__PURE__ */ jsx23(GhostBanner, { width }),
3318
+ return /* @__PURE__ */ jsxs24(Box22, { flexDirection: "column", children: [
3319
+ /* @__PURE__ */ jsx25(GhostBanner, { width }),
2934
3320
  renderScreen()
2935
3321
  ] });
2936
3322
  }
2937
3323
 
2938
3324
  // src/appPanel.tsx
2939
- import React18 from "react";
2940
- import { Box as Box29, Text as Text30, useApp as useApp2, useInput as useInput7 } from "ink";
2941
-
2942
- // src/hooks/useFullscreen.ts
2943
- import { useEffect as useEffect8 } from "react";
2944
- var ENTER_ALT_SCREEN = "\x1B[?1049h";
2945
- var LEAVE_ALT_SCREEN = "\x1B[?1049l";
2946
- var HIDE_CURSOR = "\x1B[?25l";
2947
- var SHOW_CURSOR = "\x1B[?25h";
2948
- function useFullscreen() {
2949
- useEffect8(() => {
2950
- process.stdout.write(ENTER_ALT_SCREEN + HIDE_CURSOR);
2951
- return () => {
2952
- process.stdout.write(SHOW_CURSOR + LEAVE_ALT_SCREEN);
2953
- };
2954
- }, []);
2955
- }
3325
+ import React19 from "react";
3326
+ import { Box as Box30, Text as Text33, useApp as useApp2, useInput as useInput9 } from "ink";
2956
3327
 
2957
3328
  // src/hooks/usePanelNavigation.ts
2958
- import { useState as useState16, useCallback as useCallback4 } from "react";
3329
+ import { useState as useState17, useCallback as useCallback5 } from "react";
2959
3330
  function usePanelNavigation() {
2960
- const [state, setState] = useState16({
2961
- view: "feature",
3331
+ const [state, setState] = useState17({
3332
+ view: "pipelines",
2962
3333
  featureId: "database",
2963
3334
  innerScreen: "home",
2964
3335
  innerParams: {},
2965
3336
  innerStack: []
2966
3337
  });
2967
- const selectSidebarItem = useCallback4((itemId) => {
3338
+ const selectSidebarItem = useCallback5((itemId) => {
2968
3339
  const featureIds = [
2969
3340
  "database",
2970
3341
  "functions",
@@ -3005,7 +3376,7 @@ function usePanelNavigation() {
3005
3376
  });
3006
3377
  }
3007
3378
  }, [state.featureId]);
3008
- const navigateInner = useCallback4((screen, params) => {
3379
+ const navigateInner = useCallback5((screen, params) => {
3009
3380
  setState((prev) => ({
3010
3381
  ...prev,
3011
3382
  innerStack: [...prev.innerStack, { screen: prev.innerScreen, params: prev.innerParams }],
@@ -3013,7 +3384,7 @@ function usePanelNavigation() {
3013
3384
  innerParams: params ?? {}
3014
3385
  }));
3015
3386
  }, []);
3016
- const goBackInner = useCallback4(() => {
3387
+ const goBackInner = useCallback5(() => {
3017
3388
  setState((prev) => {
3018
3389
  if (prev.innerStack.length === 0) {
3019
3390
  return { ...prev, innerScreen: "home", innerParams: {} };
@@ -3028,7 +3399,7 @@ function usePanelNavigation() {
3028
3399
  };
3029
3400
  });
3030
3401
  }, []);
3031
- const goHomeInner = useCallback4(() => {
3402
+ const goHomeInner = useCallback5(() => {
3032
3403
  setState((prev) => ({
3033
3404
  ...prev,
3034
3405
  innerScreen: "home",
@@ -3036,24 +3407,37 @@ function usePanelNavigation() {
3036
3407
  innerStack: []
3037
3408
  }));
3038
3409
  }, []);
3410
+ const switchViewAndNavigate = useCallback5(
3411
+ (view, screen, params) => {
3412
+ setState((prev) => ({
3413
+ ...prev,
3414
+ view,
3415
+ innerScreen: screen,
3416
+ innerParams: params ?? {},
3417
+ innerStack: [{ screen: "home", params: {} }]
3418
+ }));
3419
+ },
3420
+ []
3421
+ );
3039
3422
  return {
3040
3423
  ...state,
3041
3424
  selectSidebarItem,
3042
3425
  navigateInner,
3043
3426
  goBackInner,
3044
- goHomeInner
3427
+ goHomeInner,
3428
+ switchViewAndNavigate
3045
3429
  };
3046
3430
  }
3047
3431
 
3048
3432
  // src/hooks/usePanelFocus.ts
3049
- import { useState as useState17, useCallback as useCallback5 } from "react";
3433
+ import { useState as useState18, useCallback as useCallback6 } from "react";
3050
3434
  function usePanelFocus() {
3051
- const [focused, setFocused] = useState17("sidebar");
3052
- const toggleFocus = useCallback5(() => {
3435
+ const [focused, setFocused] = useState18("sidebar");
3436
+ const toggleFocus = useCallback6(() => {
3053
3437
  setFocused((prev) => prev === "sidebar" ? "main" : "sidebar");
3054
3438
  }, []);
3055
- const focusSidebar = useCallback5(() => setFocused("sidebar"), []);
3056
- const focusMain = useCallback5(() => setFocused("main"), []);
3439
+ const focusSidebar = useCallback6(() => setFocused("sidebar"), []);
3440
+ const focusMain = useCallback6(() => setFocused("main"), []);
3057
3441
  return {
3058
3442
  focused,
3059
3443
  isSidebarFocused: focused === "sidebar",
@@ -3087,19 +3471,18 @@ function useSidebarItems() {
3087
3471
  items.push({ id: "tool-status", label: "Tool Status", icon: "\u{1F527}", type: "action", section: "system" });
3088
3472
  items.push({ id: "config", label: "Config", icon: "\u2699\uFE0F", type: "action", section: "system" });
3089
3473
  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
3474
  return items;
3092
3475
  }, []);
3093
3476
  }
3094
3477
 
3095
3478
  // src/hooks/useModal.ts
3096
- import { useState as useState18, useCallback as useCallback6 } from "react";
3479
+ import { useState as useState19, useCallback as useCallback7 } from "react";
3097
3480
  function useModal() {
3098
- const [state, setState] = useState18(null);
3099
- const openModal = useCallback6((content, title) => {
3481
+ const [state, setState] = useState19(null);
3482
+ const openModal = useCallback7((content, title) => {
3100
3483
  setState({ content, title });
3101
3484
  }, []);
3102
- const closeModal = useCallback6(() => {
3485
+ const closeModal = useCallback7(() => {
3103
3486
  setState(null);
3104
3487
  }, []);
3105
3488
  return {
@@ -3112,8 +3495,8 @@ function useModal() {
3112
3495
  }
3113
3496
 
3114
3497
  // src/components/PanelLayout.tsx
3115
- import { Box as Box22 } from "ink";
3116
- import { jsx as jsx24, jsxs as jsxs24 } from "react/jsx-runtime";
3498
+ import { Box as Box23 } from "ink";
3499
+ import { jsx as jsx26, jsxs as jsxs25 } from "react/jsx-runtime";
3117
3500
  function PanelLayout({
3118
3501
  header,
3119
3502
  footer,
@@ -3128,19 +3511,19 @@ function PanelLayout({
3128
3511
  const contentHeight = Math.max(5, height - bannerHeight - footerHeight);
3129
3512
  const sidebarWidth = singlePanel ? 0 : panel.sidebarWidth(width);
3130
3513
  const mainWidth = singlePanel ? width : width - sidebarWidth;
3131
- return /* @__PURE__ */ jsxs24(Box22, { flexDirection: "column", width, height, children: [
3514
+ return /* @__PURE__ */ jsxs25(Box23, { flexDirection: "column", width, height, children: [
3132
3515
  header,
3133
- /* @__PURE__ */ jsxs24(Box22, { flexDirection: "row", height: contentHeight, children: [
3134
- !singlePanel && /* @__PURE__ */ jsx24(Box22, { width: sidebarWidth, height: contentHeight, children: sidebar }),
3135
- /* @__PURE__ */ jsx24(Box22, { width: mainWidth, height: contentHeight, children: main2 })
3516
+ /* @__PURE__ */ jsxs25(Box23, { flexDirection: "row", height: contentHeight, children: [
3517
+ !singlePanel && /* @__PURE__ */ jsx26(Box23, { width: sidebarWidth, height: contentHeight, children: sidebar }),
3518
+ /* @__PURE__ */ jsx26(Box23, { width: mainWidth, height: contentHeight, children: main2 })
3136
3519
  ] }),
3137
- /* @__PURE__ */ jsx24(Box22, { height: footerHeight, children: footer })
3520
+ /* @__PURE__ */ jsx26(Box23, { height: footerHeight, children: footer })
3138
3521
  ] });
3139
3522
  }
3140
3523
 
3141
3524
  // src/components/Panel.tsx
3142
- import { Box as Box23, Text as Text24 } from "ink";
3143
- import { jsx as jsx25, jsxs as jsxs25 } from "react/jsx-runtime";
3525
+ import { Box as Box24, Text as Text27 } from "ink";
3526
+ import { jsx as jsx27, jsxs as jsxs26 } from "react/jsx-runtime";
3144
3527
  function Panel({
3145
3528
  id,
3146
3529
  title,
@@ -3150,8 +3533,8 @@ function Panel({
3150
3533
  children
3151
3534
  }) {
3152
3535
  const borderColor = focused ? panel.borderFocused : panel.borderDim;
3153
- return /* @__PURE__ */ jsxs25(
3154
- Box23,
3536
+ return /* @__PURE__ */ jsxs26(
3537
+ Box24,
3155
3538
  {
3156
3539
  flexDirection: "column",
3157
3540
  width,
@@ -3160,21 +3543,21 @@ function Panel({
3160
3543
  borderColor,
3161
3544
  overflow: "hidden",
3162
3545
  children: [
3163
- title && /* @__PURE__ */ jsx25(Box23, { marginBottom: 0, children: /* @__PURE__ */ jsxs25(Text24, { color: focused ? inkColors.accent : void 0, bold: focused, dimColor: !focused, children: [
3546
+ title && /* @__PURE__ */ jsx27(Box24, { marginBottom: 0, children: /* @__PURE__ */ jsxs26(Text27, { color: focused ? inkColors.accent : void 0, bold: focused, dimColor: !focused, children: [
3164
3547
  " ",
3165
3548
  title,
3166
3549
  " "
3167
3550
  ] }) }),
3168
- /* @__PURE__ */ jsx25(Box23, { flexDirection: "column", flexGrow: 1, overflow: "hidden", children })
3551
+ /* @__PURE__ */ jsx27(Box24, { flexDirection: "column", flexGrow: 1, overflow: "hidden", children })
3169
3552
  ]
3170
3553
  }
3171
3554
  );
3172
3555
  }
3173
3556
 
3174
3557
  // src/components/Sidebar.tsx
3175
- import { useEffect as useEffect9, useMemo as useMemo9, useState as useState19 } from "react";
3176
- import { Box as Box24, Text as Text25, useInput as useInput6 } from "ink";
3177
- import { jsx as jsx26, jsxs as jsxs26 } from "react/jsx-runtime";
3558
+ import { useEffect as useEffect9, useMemo as useMemo9, useState as useState20 } from "react";
3559
+ import { Box as Box25, Text as Text28, useInput as useInput8 } from "ink";
3560
+ import { jsx as jsx28, jsxs as jsxs27 } from "react/jsx-runtime";
3178
3561
  function groupSections(items) {
3179
3562
  const groups = [];
3180
3563
  let current = null;
@@ -3201,13 +3584,13 @@ function Sidebar({
3201
3584
  [items]
3202
3585
  );
3203
3586
  const selectedIdx = selectableItems.findIndex((item) => item.id === selectedId);
3204
- const [cursorIdx, setCursorIdx] = useState19(Math.max(0, selectedIdx));
3587
+ const [cursorIdx, setCursorIdx] = useState20(Math.max(0, selectedIdx));
3205
3588
  const sections = useMemo9(() => groupSections(items), [items]);
3206
3589
  useEffect9(() => {
3207
3590
  const idx = selectableItems.findIndex((item) => item.id === selectedId);
3208
3591
  if (idx >= 0) setCursorIdx(idx);
3209
3592
  }, [selectedId, selectableItems]);
3210
- useInput6(
3593
+ useInput8(
3211
3594
  (input2, key) => {
3212
3595
  if (key.upArrow || input2 === "k") {
3213
3596
  setCursorIdx((prev) => {
@@ -3235,28 +3618,28 @@ function Sidebar({
3235
3618
  { isActive: isFocused }
3236
3619
  );
3237
3620
  let flatIdx = 0;
3238
- return /* @__PURE__ */ jsx26(Box24, { flexDirection: "column", gap: 2, children: sections.map((section) => {
3621
+ return /* @__PURE__ */ jsx28(Box25, { flexDirection: "column", gap: 0, children: sections.map((section) => {
3239
3622
  const sectionStartIdx = flatIdx;
3240
3623
  const sectionEndIdx = sectionStartIdx + section.items.length - 1;
3241
3624
  const hasCursorInSection = isFocused && cursorIdx >= sectionStartIdx && cursorIdx <= sectionEndIdx;
3242
3625
  const hasActiveInSection = section.items.some((item) => item.id === selectedId);
3243
3626
  const borderColor = hasCursorInSection || hasActiveInSection ? inkColors.accent : "#555555";
3244
- const rendered = /* @__PURE__ */ jsxs26(
3245
- Box24,
3627
+ const rendered = /* @__PURE__ */ jsxs27(
3628
+ Box25,
3246
3629
  {
3247
3630
  flexDirection: "column",
3248
3631
  borderStyle: "round",
3249
3632
  borderColor,
3250
3633
  paddingX: 1,
3251
3634
  children: [
3252
- /* @__PURE__ */ jsx26(Text25, { dimColor: true, bold: true, children: section.title }),
3635
+ /* @__PURE__ */ jsx28(Text28, { dimColor: true, bold: true, children: section.title }),
3253
3636
  section.items.map((item) => {
3254
3637
  const thisIdx = flatIdx;
3255
3638
  flatIdx++;
3256
3639
  const isCursor = isFocused && thisIdx === cursorIdx;
3257
3640
  const isActive = item.id === selectedId;
3258
- return /* @__PURE__ */ jsx26(Box24, { gap: 0, children: /* @__PURE__ */ jsxs26(
3259
- Text25,
3641
+ return /* @__PURE__ */ jsx28(Box25, { gap: 0, children: /* @__PURE__ */ jsxs27(
3642
+ Text28,
3260
3643
  {
3261
3644
  color: isCursor ? inkColors.accent : isActive ? inkColors.accent : void 0,
3262
3645
  bold: isCursor || isActive,
@@ -3279,12 +3662,12 @@ function Sidebar({
3279
3662
  }
3280
3663
 
3281
3664
  // src/components/PanelFooter.tsx
3282
- import { Box as Box25, Text as Text26 } from "ink";
3283
- import { jsx as jsx27, jsxs as jsxs27 } from "react/jsx-runtime";
3665
+ import { Box as Box26, Text as Text29 } from "ink";
3666
+ import { jsx as jsx29, jsxs as jsxs28 } from "react/jsx-runtime";
3284
3667
  function PanelFooter({ hints, width }) {
3285
- return /* @__PURE__ */ jsx27(Box25, { width, children: /* @__PURE__ */ jsx27(Box25, { gap: 1, children: hints.map((hint) => /* @__PURE__ */ jsxs27(Box25, { gap: 0, children: [
3286
- /* @__PURE__ */ jsx27(Text26, { color: inkColors.accent, bold: true, children: hint.key }),
3287
- /* @__PURE__ */ jsxs27(Text26, { dimColor: true, children: [
3668
+ return /* @__PURE__ */ jsx29(Box26, { width, children: /* @__PURE__ */ jsx29(Box26, { gap: 1, children: hints.map((hint) => /* @__PURE__ */ jsxs28(Box26, { gap: 0, children: [
3669
+ /* @__PURE__ */ jsx29(Text29, { color: inkColors.accent, bold: true, children: hint.key }),
3670
+ /* @__PURE__ */ jsxs28(Text29, { dimColor: true, children: [
3288
3671
  ":",
3289
3672
  hint.action
3290
3673
  ] })
@@ -3292,8 +3675,8 @@ function PanelFooter({ hints, width }) {
3292
3675
  }
3293
3676
 
3294
3677
  // src/components/Modal.tsx
3295
- import { Box as Box26, Text as Text27 } from "ink";
3296
- import { jsx as jsx28, jsxs as jsxs28 } from "react/jsx-runtime";
3678
+ import { Box as Box27, Text as Text30 } from "ink";
3679
+ import { jsx as jsx30, jsxs as jsxs29 } from "react/jsx-runtime";
3297
3680
  function Modal({
3298
3681
  title,
3299
3682
  width,
@@ -3304,10 +3687,10 @@ function Modal({
3304
3687
  const modalHeight = Math.min(height - 4, 20);
3305
3688
  const padX = Math.max(0, Math.floor((width - modalWidth) / 2));
3306
3689
  const padY = Math.max(0, Math.floor((height - modalHeight) / 2));
3307
- return /* @__PURE__ */ jsxs28(Box26, { flexDirection: "column", width, height, children: [
3308
- padY > 0 && /* @__PURE__ */ jsx28(Box26, { height: padY }),
3309
- /* @__PURE__ */ jsx28(Box26, { marginLeft: padX, children: /* @__PURE__ */ jsxs28(
3310
- Box26,
3690
+ return /* @__PURE__ */ jsxs29(Box27, { flexDirection: "column", width, height, children: [
3691
+ padY > 0 && /* @__PURE__ */ jsx30(Box27, { height: padY }),
3692
+ /* @__PURE__ */ jsx30(Box27, { marginLeft: padX, children: /* @__PURE__ */ jsxs29(
3693
+ Box27,
3311
3694
  {
3312
3695
  flexDirection: "column",
3313
3696
  width: modalWidth,
@@ -3316,8 +3699,8 @@ function Modal({
3316
3699
  borderColor: inkColors.accent,
3317
3700
  paddingX: 1,
3318
3701
  children: [
3319
- /* @__PURE__ */ jsx28(Box26, { marginBottom: 1, children: /* @__PURE__ */ jsx28(Text27, { color: inkColors.accent, bold: true, children: title }) }),
3320
- /* @__PURE__ */ jsx28(Box26, { flexDirection: "column", flexGrow: 1, overflow: "hidden", children })
3702
+ /* @__PURE__ */ jsx30(Box27, { marginBottom: 1, children: /* @__PURE__ */ jsx30(Text30, { color: inkColors.accent, bold: true, children: title }) }),
3703
+ /* @__PURE__ */ jsx30(Box27, { flexDirection: "column", flexGrow: 1, overflow: "hidden", children })
3321
3704
  ]
3322
3705
  }
3323
3706
  ) })
@@ -3325,9 +3708,9 @@ function Modal({
3325
3708
  }
3326
3709
 
3327
3710
  // src/components/FeatureCommands.tsx
3328
- import { useEffect as useEffect10, useMemo as useMemo10, useState as useState20 } from "react";
3329
- import { Box as Box27, Text as Text28 } from "ink";
3330
- import { jsx as jsx29, jsxs as jsxs29 } from "react/jsx-runtime";
3711
+ import { useEffect as useEffect10, useMemo as useMemo10, useState as useState21 } from "react";
3712
+ import { Box as Box28, Text as Text31 } from "ink";
3713
+ import { jsx as jsx31, jsxs as jsxs30 } from "react/jsx-runtime";
3331
3714
  function FeatureCommands({
3332
3715
  feature,
3333
3716
  onNavigate,
@@ -3338,9 +3721,9 @@ function FeatureCommands({
3338
3721
  height = 24,
3339
3722
  isInputActive = true
3340
3723
  }) {
3341
- const [pinnedCommands, setPinnedCommands2] = useState20(() => getPinnedCommands());
3342
- const [pinnedRuns, setPinnedRuns2] = useState20(() => getPinnedRuns());
3343
- const [pinFeedback, setPinFeedback] = useState20();
3724
+ const [pinnedCommands, setPinnedCommands2] = useState21(() => getPinnedCommands());
3725
+ const [pinnedRuns, setPinnedRuns2] = useState21(() => getPinnedRuns());
3726
+ const [pinFeedback, setPinFeedback] = useState21();
3344
3727
  useEffect10(() => {
3345
3728
  if (!pinFeedback) return;
3346
3729
  const timeout = setTimeout(() => setPinFeedback(void 0), 1400);
@@ -3351,7 +3734,8 @@ function FeatureCommands({
3351
3734
  activeFeature: feature,
3352
3735
  pinnedCommands,
3353
3736
  pinnedRuns,
3354
- showPinnedSection: false
3737
+ showPinnedSection: false,
3738
+ showFeatureHeader: false
3355
3739
  }),
3356
3740
  [feature, pinnedCommands, pinnedRuns]
3357
3741
  );
@@ -3408,17 +3792,12 @@ function FeatureCommands({
3408
3792
  );
3409
3793
  }
3410
3794
  };
3411
- return /* @__PURE__ */ jsxs29(Box27, { flexDirection: "column", paddingX: 1, children: [
3412
- /* @__PURE__ */ jsx29(Box27, { marginBottom: 1, children: /* @__PURE__ */ jsxs29(Text28, { color: inkColors.accent, bold: true, children: [
3413
- feature.icon,
3414
- " ",
3415
- feature.label
3416
- ] }) }),
3417
- pinFeedback && /* @__PURE__ */ jsx29(Box27, { marginBottom: 1, children: /* @__PURE__ */ jsxs29(Text28, { color: inkColors.accent, children: [
3795
+ return /* @__PURE__ */ jsxs30(Box28, { flexDirection: "column", paddingX: 1, children: [
3796
+ pinFeedback && /* @__PURE__ */ jsx31(Box28, { marginBottom: 1, children: /* @__PURE__ */ jsxs30(Text31, { color: inkColors.accent, children: [
3418
3797
  "\u2713 ",
3419
3798
  pinFeedback
3420
3799
  ] }) }),
3421
- /* @__PURE__ */ jsx29(
3800
+ /* @__PURE__ */ jsx31(
3422
3801
  SelectList,
3423
3802
  {
3424
3803
  items,
@@ -3429,16 +3808,17 @@ function FeatureCommands({
3429
3808
  maxVisible: Math.max(6, height - 6),
3430
3809
  onCancel: onBack,
3431
3810
  isInputActive,
3432
- arrowNavigation: true
3811
+ arrowNavigation: true,
3812
+ panelFocused: isInputActive
3433
3813
  }
3434
3814
  )
3435
3815
  ] });
3436
3816
  }
3437
3817
 
3438
3818
  // src/components/PinnedCommands.tsx
3439
- import { useEffect as useEffect11, useMemo as useMemo11, useState as useState21 } from "react";
3440
- import { Box as Box28, Text as Text29 } from "ink";
3441
- import { jsx as jsx30, jsxs as jsxs30 } from "react/jsx-runtime";
3819
+ import { useEffect as useEffect11, useMemo as useMemo11, useState as useState22 } from "react";
3820
+ import { Box as Box29, Text as Text32 } from "ink";
3821
+ import { jsx as jsx32, jsxs as jsxs31 } from "react/jsx-runtime";
3442
3822
  function PinnedCommands({
3443
3823
  onNavigate,
3444
3824
  onBack,
@@ -3447,9 +3827,9 @@ function PinnedCommands({
3447
3827
  height = 24,
3448
3828
  isInputActive = true
3449
3829
  }) {
3450
- const [pinnedCommands, setPinnedCommands2] = useState21(() => getPinnedCommands());
3451
- const [pinnedRuns, setPinnedRuns2] = useState21(() => getPinnedRuns());
3452
- const [pinFeedback, setPinFeedback] = useState21();
3830
+ const [pinnedCommands, setPinnedCommands2] = useState22(() => getPinnedCommands());
3831
+ const [pinnedRuns, setPinnedRuns2] = useState22(() => getPinnedRuns());
3832
+ const [pinFeedback, setPinFeedback] = useState22();
3453
3833
  useEffect11(() => {
3454
3834
  if (!pinFeedback) return;
3455
3835
  const timeout = setTimeout(() => setPinFeedback(void 0), 1400);
@@ -3512,18 +3892,14 @@ function PinnedCommands({
3512
3892
  }
3513
3893
  };
3514
3894
  if (items.length === 0) {
3515
- return /* @__PURE__ */ jsxs30(Box28, { flexDirection: "column", paddingX: 1, children: [
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
- ] });
3895
+ 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
3896
  }
3520
- return /* @__PURE__ */ jsxs30(Box28, { flexDirection: "column", paddingX: 1, children: [
3521
- /* @__PURE__ */ jsx30(Box28, { marginBottom: 1, children: /* @__PURE__ */ jsx30(Text29, { color: inkColors.accent, bold: true, children: "\u{1F4CC} Pinned" }) }),
3522
- pinFeedback && /* @__PURE__ */ jsx30(Box28, { marginBottom: 1, children: /* @__PURE__ */ jsxs30(Text29, { color: inkColors.accent, children: [
3897
+ return /* @__PURE__ */ jsxs31(Box29, { flexDirection: "column", paddingX: 1, children: [
3898
+ pinFeedback && /* @__PURE__ */ jsx32(Box29, { marginBottom: 1, children: /* @__PURE__ */ jsxs31(Text32, { color: inkColors.accent, children: [
3523
3899
  "\u2713 ",
3524
3900
  pinFeedback
3525
3901
  ] }) }),
3526
- /* @__PURE__ */ jsx30(
3902
+ /* @__PURE__ */ jsx32(
3527
3903
  SelectList,
3528
3904
  {
3529
3905
  items,
@@ -3534,14 +3910,15 @@ function PinnedCommands({
3534
3910
  maxVisible: Math.max(6, height - 6),
3535
3911
  onCancel: onBack,
3536
3912
  isInputActive,
3537
- arrowNavigation: true
3913
+ arrowNavigation: true,
3914
+ panelFocused: isInputActive
3538
3915
  }
3539
3916
  )
3540
3917
  ] });
3541
3918
  }
3542
3919
 
3543
3920
  // src/appPanel.tsx
3544
- import { jsx as jsx31, jsxs as jsxs31 } from "react/jsx-runtime";
3921
+ import { jsx as jsx33, jsxs as jsxs32 } from "react/jsx-runtime";
3545
3922
  var screenLabels = {
3546
3923
  "command-args": "Args",
3547
3924
  "flag-selection": "Flags",
@@ -3558,26 +3935,28 @@ var screenLabels = {
3558
3935
  function buildBreadcrumb(nav) {
3559
3936
  let base;
3560
3937
  switch (nav.view) {
3561
- case "feature":
3562
- base = getFeatureById(nav.featureId)?.label ?? nav.featureId;
3938
+ case "feature": {
3939
+ const feat = getFeatureById(nav.featureId);
3940
+ base = feat ? `${feat.icon} ${feat.label}` : nav.featureId;
3563
3941
  break;
3942
+ }
3564
3943
  case "pinned":
3565
- base = "Pinned";
3944
+ base = "\u{1F4CC} Pinned";
3566
3945
  break;
3567
3946
  case "custom-command":
3568
- base = "Custom Cmd";
3947
+ base = "\u270F\uFE0F Custom Cmd";
3569
3948
  break;
3570
3949
  case "pipelines":
3571
- base = "Pipelines";
3950
+ base = "\u{1F517} Pipelines";
3572
3951
  break;
3573
3952
  case "tool-status":
3574
- base = "Status";
3953
+ base = "\u{1F527} Status";
3575
3954
  break;
3576
3955
  case "config":
3577
- base = "Config";
3956
+ base = "\u2699\uFE0F Config";
3578
3957
  break;
3579
3958
  case "self-update":
3580
- base = "Update";
3959
+ base = "\u2B06\uFE0F Update";
3581
3960
  break;
3582
3961
  default:
3583
3962
  base = nav.view;
@@ -3595,12 +3974,12 @@ function buildBreadcrumb(nav) {
3595
3974
  return parts.join(" \u203A ");
3596
3975
  }
3597
3976
  var FOOTER_HINTS = [
3598
- { key: "\u2190\u2192", action: "panels" },
3977
+ { key: "Tab", action: "focus" },
3978
+ { key: "\u2190/Esc", action: "back" },
3979
+ { key: "\u2192/Enter", action: "select" },
3599
3980
  { key: "j/k", action: "nav" },
3600
- { key: "Enter", action: "select" },
3601
- { key: "Esc", action: "back" },
3602
- { key: "q", action: "quit" },
3603
3981
  { key: "p", action: "pin" },
3982
+ { key: "q", action: "quit" },
3604
3983
  { key: "?", action: "help" }
3605
3984
  ];
3606
3985
  function AppPanel() {
@@ -3611,7 +3990,7 @@ function AppPanel() {
3611
3990
  const focus = usePanelFocus();
3612
3991
  const sidebarItems = useSidebarItems();
3613
3992
  const modal = useModal();
3614
- const refreshPins = React18.useCallback(() => {
3993
+ const refreshPins = React19.useCallback(() => {
3615
3994
  }, []);
3616
3995
  const singlePanel = width < 60 || height < 15;
3617
3996
  const handleExit = () => {
@@ -3620,7 +3999,7 @@ function AppPanel() {
3620
3999
  );
3621
4000
  exit();
3622
4001
  };
3623
- useInput7((input2, key) => {
4002
+ useInput9((input2, key) => {
3624
4003
  if (modal.isOpen) {
3625
4004
  if (key.escape || input2 === "q") {
3626
4005
  modal.closeModal();
@@ -3645,37 +4024,37 @@ function AppPanel() {
3645
4024
  }
3646
4025
  if (input2 === "?") {
3647
4026
  modal.openModal(
3648
- /* @__PURE__ */ jsxs31(Box29, { flexDirection: "column", children: [
3649
- /* @__PURE__ */ jsxs31(Text30, { children: [
3650
- /* @__PURE__ */ jsx31(Text30, { bold: true, children: "\u2190/\u2192" }),
4027
+ /* @__PURE__ */ jsxs32(Box30, { flexDirection: "column", children: [
4028
+ /* @__PURE__ */ jsxs32(Text33, { children: [
4029
+ /* @__PURE__ */ jsx33(Text33, { bold: true, children: "\u2190/\u2192" }),
3651
4030
  " Move between sidebar and main panel"
3652
4031
  ] }),
3653
- /* @__PURE__ */ jsxs31(Text30, { children: [
3654
- /* @__PURE__ */ jsx31(Text30, { bold: true, children: "Tab" }),
4032
+ /* @__PURE__ */ jsxs32(Text33, { children: [
4033
+ /* @__PURE__ */ jsx33(Text33, { bold: true, children: "Tab" }),
3655
4034
  " Toggle sidebar / main panel"
3656
4035
  ] }),
3657
- /* @__PURE__ */ jsxs31(Text30, { children: [
3658
- /* @__PURE__ */ jsx31(Text30, { bold: true, children: "j/k" }),
4036
+ /* @__PURE__ */ jsxs32(Text33, { children: [
4037
+ /* @__PURE__ */ jsx33(Text33, { bold: true, children: "j/k" }),
3659
4038
  " Navigate up/down"
3660
4039
  ] }),
3661
- /* @__PURE__ */ jsxs31(Text30, { children: [
3662
- /* @__PURE__ */ jsx31(Text30, { bold: true, children: "Enter" }),
4040
+ /* @__PURE__ */ jsxs32(Text33, { children: [
4041
+ /* @__PURE__ */ jsx33(Text33, { bold: true, children: "Enter" }),
3663
4042
  " Select item"
3664
4043
  ] }),
3665
- /* @__PURE__ */ jsxs31(Text30, { children: [
3666
- /* @__PURE__ */ jsx31(Text30, { bold: true, children: "Esc" }),
4044
+ /* @__PURE__ */ jsxs32(Text33, { children: [
4045
+ /* @__PURE__ */ jsx33(Text33, { bold: true, children: "Esc" }),
3667
4046
  " Go back (or return to sidebar)"
3668
4047
  ] }),
3669
- /* @__PURE__ */ jsxs31(Text30, { children: [
3670
- /* @__PURE__ */ jsx31(Text30, { bold: true, children: "q" }),
4048
+ /* @__PURE__ */ jsxs32(Text33, { children: [
4049
+ /* @__PURE__ */ jsx33(Text33, { bold: true, children: "q" }),
3671
4050
  " Quit Polter"
3672
4051
  ] }),
3673
- /* @__PURE__ */ jsxs31(Text30, { children: [
3674
- /* @__PURE__ */ jsx31(Text30, { bold: true, children: "?" }),
4052
+ /* @__PURE__ */ jsxs32(Text33, { children: [
4053
+ /* @__PURE__ */ jsx33(Text33, { bold: true, children: "?" }),
3675
4054
  " Show this help"
3676
4055
  ] }),
3677
- /* @__PURE__ */ jsxs31(Text30, { children: [
3678
- /* @__PURE__ */ jsx31(Text30, { bold: true, children: "p" }),
4056
+ /* @__PURE__ */ jsxs32(Text33, { children: [
4057
+ /* @__PURE__ */ jsx33(Text33, { bold: true, children: "p" }),
3679
4058
  " Pin/unpin command"
3680
4059
  ] })
3681
4060
  ] }),
@@ -3725,7 +4104,7 @@ function AppPanel() {
3725
4104
  }
3726
4105
  switch (nav.view) {
3727
4106
  case "pinned":
3728
- return /* @__PURE__ */ jsx31(
4107
+ return /* @__PURE__ */ jsx33(
3729
4108
  PinnedCommands,
3730
4109
  {
3731
4110
  onNavigate: nav.navigateInner,
@@ -3739,12 +4118,12 @@ function AppPanel() {
3739
4118
  case "feature": {
3740
4119
  const feature = getFeatureById(nav.featureId);
3741
4120
  if (!feature) {
3742
- return /* @__PURE__ */ jsxs31(Text30, { color: "red", children: [
4121
+ return /* @__PURE__ */ jsxs32(Text33, { color: "red", children: [
3743
4122
  "Feature not found: ",
3744
4123
  nav.featureId
3745
4124
  ] });
3746
4125
  }
3747
- return /* @__PURE__ */ jsx31(
4126
+ return /* @__PURE__ */ jsx33(
3748
4127
  FeatureCommands,
3749
4128
  {
3750
4129
  feature,
@@ -3759,7 +4138,7 @@ function AppPanel() {
3759
4138
  );
3760
4139
  }
3761
4140
  case "custom-command":
3762
- return /* @__PURE__ */ jsx31(
4141
+ return /* @__PURE__ */ jsx33(
3763
4142
  CustomCommand,
3764
4143
  {
3765
4144
  onNavigate: nav.navigateInner,
@@ -3771,7 +4150,7 @@ function AppPanel() {
3771
4150
  }
3772
4151
  );
3773
4152
  case "pipelines":
3774
- return /* @__PURE__ */ jsx31(
4153
+ return /* @__PURE__ */ jsx33(
3775
4154
  PipelineList,
3776
4155
  {
3777
4156
  onNavigate: nav.navigateInner,
@@ -3783,7 +4162,7 @@ function AppPanel() {
3783
4162
  }
3784
4163
  );
3785
4164
  case "tool-status":
3786
- return /* @__PURE__ */ jsx31(
4165
+ return /* @__PURE__ */ jsx33(
3787
4166
  ToolStatus,
3788
4167
  {
3789
4168
  onBack: focus.focusSidebar,
@@ -3794,7 +4173,7 @@ function AppPanel() {
3794
4173
  }
3795
4174
  );
3796
4175
  case "config":
3797
- return /* @__PURE__ */ jsx31(
4176
+ return /* @__PURE__ */ jsx33(
3798
4177
  ProjectConfig,
3799
4178
  {
3800
4179
  onBack: focus.focusSidebar,
@@ -3805,7 +4184,7 @@ function AppPanel() {
3805
4184
  }
3806
4185
  );
3807
4186
  case "self-update":
3808
- return /* @__PURE__ */ jsx31(
4187
+ return /* @__PURE__ */ jsx33(
3809
4188
  SelfUpdate,
3810
4189
  {
3811
4190
  onBack: focus.focusSidebar,
@@ -3817,7 +4196,7 @@ function AppPanel() {
3817
4196
  }
3818
4197
  );
3819
4198
  default:
3820
- return /* @__PURE__ */ jsx31(Text30, { children: "Select an item from the sidebar" });
4199
+ return /* @__PURE__ */ jsx33(Text33, { children: "Select an item from the sidebar" });
3821
4200
  }
3822
4201
  };
3823
4202
  const renderInnerScreen = () => {
@@ -3825,7 +4204,7 @@ function AppPanel() {
3825
4204
  const w = mainContentWidth - 2;
3826
4205
  switch (nav.innerScreen) {
3827
4206
  case "command-args":
3828
- return /* @__PURE__ */ jsx31(
4207
+ return /* @__PURE__ */ jsx33(
3829
4208
  CommandArgs,
3830
4209
  {
3831
4210
  command: nav.innerParams.command ?? "",
@@ -3838,7 +4217,7 @@ function AppPanel() {
3838
4217
  }
3839
4218
  );
3840
4219
  case "custom-command":
3841
- return /* @__PURE__ */ jsx31(
4220
+ return /* @__PURE__ */ jsx33(
3842
4221
  CustomCommand,
3843
4222
  {
3844
4223
  onNavigate: nav.navigateInner,
@@ -3850,7 +4229,7 @@ function AppPanel() {
3850
4229
  }
3851
4230
  );
3852
4231
  case "flag-selection":
3853
- return /* @__PURE__ */ jsx31(
4232
+ return /* @__PURE__ */ jsx33(
3854
4233
  FlagSelection,
3855
4234
  {
3856
4235
  args: nav.innerParams.args ?? [],
@@ -3858,27 +4237,33 @@ function AppPanel() {
3858
4237
  onNavigate: nav.navigateInner,
3859
4238
  onBack: nav.goBackInner,
3860
4239
  width: w,
4240
+ height: mainContentHeight,
3861
4241
  panelMode: true,
3862
4242
  isInputActive: isActive
3863
4243
  }
3864
4244
  );
3865
4245
  case "confirm-execute":
3866
4246
  case "command-execution":
3867
- return /* @__PURE__ */ jsx31(
4247
+ return /* @__PURE__ */ jsx33(
3868
4248
  CommandExecution,
3869
4249
  {
3870
4250
  args: nav.innerParams.args ?? [],
3871
4251
  tool: nav.innerParams.tool,
3872
4252
  onBack: nav.goBackInner,
4253
+ onHome: nav.goHomeInner,
3873
4254
  onExit: handleExit,
4255
+ onRunSuggestion: (sugTool, sugArgs) => {
4256
+ nav.switchViewAndNavigate("custom-command", "confirm-execute", { tool: sugTool, args: sugArgs });
4257
+ },
3874
4258
  width: w,
3875
4259
  height: mainContentHeight,
3876
4260
  panelMode: true,
3877
4261
  isInputActive: isActive
3878
- }
4262
+ },
4263
+ `${nav.view}-${nav.innerParams.tool}-${(nav.innerParams.args ?? []).join("-")}`
3879
4264
  );
3880
4265
  case "pipeline-list":
3881
- return /* @__PURE__ */ jsx31(
4266
+ return /* @__PURE__ */ jsx33(
3882
4267
  PipelineList,
3883
4268
  {
3884
4269
  onNavigate: nav.navigateInner,
@@ -3890,7 +4275,7 @@ function AppPanel() {
3890
4275
  }
3891
4276
  );
3892
4277
  case "pipeline-builder":
3893
- return /* @__PURE__ */ jsx31(
4278
+ return /* @__PURE__ */ jsx33(
3894
4279
  PipelineBuilder,
3895
4280
  {
3896
4281
  onBack: nav.goBackInner,
@@ -3901,7 +4286,7 @@ function AppPanel() {
3901
4286
  }
3902
4287
  );
3903
4288
  case "pipeline-execution":
3904
- return /* @__PURE__ */ jsx31(
4289
+ return /* @__PURE__ */ jsx33(
3905
4290
  PipelineExecution,
3906
4291
  {
3907
4292
  pipelineId: nav.innerParams.pipelineId ?? "",
@@ -3913,7 +4298,7 @@ function AppPanel() {
3913
4298
  }
3914
4299
  );
3915
4300
  case "self-update":
3916
- return /* @__PURE__ */ jsx31(
4301
+ return /* @__PURE__ */ jsx33(
3917
4302
  SelfUpdate,
3918
4303
  {
3919
4304
  onBack: nav.goBackInner,
@@ -3925,7 +4310,7 @@ function AppPanel() {
3925
4310
  }
3926
4311
  );
3927
4312
  case "tool-status":
3928
- return /* @__PURE__ */ jsx31(
4313
+ return /* @__PURE__ */ jsx33(
3929
4314
  ToolStatus,
3930
4315
  {
3931
4316
  onBack: nav.goBackInner,
@@ -3936,7 +4321,7 @@ function AppPanel() {
3936
4321
  }
3937
4322
  );
3938
4323
  case "project-config":
3939
- return /* @__PURE__ */ jsx31(
4324
+ return /* @__PURE__ */ jsx33(
3940
4325
  ProjectConfig,
3941
4326
  {
3942
4327
  onBack: nav.goBackInner,
@@ -3947,17 +4332,17 @@ function AppPanel() {
3947
4332
  }
3948
4333
  );
3949
4334
  default:
3950
- return /* @__PURE__ */ jsxs31(Text30, { color: "red", children: [
4335
+ return /* @__PURE__ */ jsxs32(Text33, { color: "red", children: [
3951
4336
  "Unknown screen: ",
3952
4337
  nav.innerScreen
3953
4338
  ] });
3954
4339
  }
3955
4340
  };
3956
4341
  if (modal.isOpen) {
3957
- return /* @__PURE__ */ jsx31(Box29, { flexDirection: "column", width, height, children: /* @__PURE__ */ jsx31(Modal, { title: modal.modalTitle, width, height, children: modal.modalContent }) });
4342
+ return /* @__PURE__ */ jsx33(Box30, { flexDirection: "column", width, height, children: /* @__PURE__ */ jsx33(Modal, { title: modal.modalTitle, width, height, children: modal.modalContent }) });
3958
4343
  }
3959
- const header = /* @__PURE__ */ jsx31(GhostBanner, { width, compact: true });
3960
- const sidebar = /* @__PURE__ */ jsx31(
4344
+ const header = /* @__PURE__ */ jsx33(GhostBanner, { width, compact: true });
4345
+ const sidebar = /* @__PURE__ */ jsx33(
3961
4346
  Panel,
3962
4347
  {
3963
4348
  id: "sidebar",
@@ -3965,7 +4350,7 @@ function AppPanel() {
3965
4350
  width: Math.max(20, Math.min(35, Math.floor(width * 0.3))),
3966
4351
  height: Math.max(5, height - bannerHeight - 1),
3967
4352
  focused: focus.isSidebarFocused,
3968
- children: /* @__PURE__ */ jsx31(
4353
+ children: /* @__PURE__ */ jsx33(
3969
4354
  Sidebar,
3970
4355
  {
3971
4356
  items: sidebarItems,
@@ -3978,7 +4363,7 @@ function AppPanel() {
3978
4363
  )
3979
4364
  }
3980
4365
  );
3981
- const main2 = /* @__PURE__ */ jsx31(
4366
+ const main2 = /* @__PURE__ */ jsx33(
3982
4367
  Panel,
3983
4368
  {
3984
4369
  id: "main",
@@ -3989,8 +4374,8 @@ function AppPanel() {
3989
4374
  children: renderMainContent()
3990
4375
  }
3991
4376
  );
3992
- const footer = /* @__PURE__ */ jsx31(PanelFooter, { hints: footerHints, width });
3993
- return /* @__PURE__ */ jsx31(
4377
+ const footer = /* @__PURE__ */ jsx33(PanelFooter, { hints: footerHints, width });
4378
+ return /* @__PURE__ */ jsx33(
3994
4379
  PanelLayout,
3995
4380
  {
3996
4381
  header,
@@ -5264,11 +5649,11 @@ Apply completed with ${errors.length} error(s).
5264
5649
  process.exit(result.exitCode ?? 0);
5265
5650
  }
5266
5651
  const AppComponent2 = parsed.classic ? AppClassic : AppPanel;
5267
- render(React19.createElement(AppComponent2));
5652
+ render(React20.createElement(AppComponent2));
5268
5653
  return;
5269
5654
  }
5270
5655
  const AppComponent = parsed.classic ? AppClassic : AppPanel;
5271
- render(React19.createElement(AppComponent));
5656
+ render(React20.createElement(AppComponent));
5272
5657
  }
5273
5658
  main().catch((error) => {
5274
5659
  const message = error instanceof Error ? error.message : String(error);