reevesagents 1.4.0 → 1.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,30 +1,29 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
+ buildOnboardingState,
3
4
  readTuiOpenToken
4
- } from "./chunk-PEOJCUQI.js";
5
+ } from "./chunk-OHEIERAD.js";
5
6
  import {
6
7
  translate,
7
8
  translatePhrase
8
- } from "./chunk-BELIYZTN.js";
9
+ } from "./chunk-BWJKK6LM.js";
9
10
  import {
10
11
  modelDisplayName,
11
12
  modelValuesForProvider
12
- } from "./chunk-NJWOKVBZ.js";
13
+ } from "./chunk-LZMMFJYG.js";
13
14
  import {
14
15
  REEVESAGENTS_VERSION,
15
- attach,
16
- attachAll,
17
- detach,
18
- hostStatus,
19
16
  listRunApprovals,
20
17
  resolveRunApproval
21
- } from "./chunk-EX5LH2KW.js";
18
+ } from "./chunk-6RPG22BH.js";
22
19
  import {
23
20
  CONFIG_FIELDS,
24
21
  DEFAULT_LANGUAGE,
25
22
  LANGUAGE_OPTIONS,
26
23
  PROVIDERS,
27
24
  archiveAndRemoveRun,
25
+ attach,
26
+ attachAll,
28
27
  autoCleanupRuns,
29
28
  coerceExtraArgs,
30
29
  colors,
@@ -34,8 +33,10 @@ import {
34
33
  deleteAgent,
35
34
  deletePreset,
36
35
  deleteRunHistory,
36
+ detach,
37
37
  detectAvailable,
38
38
  findAgent,
39
+ hostStatus,
39
40
  killAgent,
40
41
  languageOption,
41
42
  listAgents,
@@ -69,14 +70,14 @@ import {
69
70
  startRunFromPreset,
70
71
  stateRoot,
71
72
  stopRun
72
- } from "./chunk-KL5YFLQF.js";
73
+ } from "./chunk-LKJSQLX2.js";
73
74
  import "./chunk-D24DQQ6V.js";
74
75
  import {
75
76
  startWebFromTui
76
- } from "./chunk-33EB4RUP.js";
77
+ } from "./chunk-HL5MTR5M.js";
77
78
 
78
79
  // src/tui/router.tsx
79
- import { createContext as createContext6, useContext as useContext6, useState as useState36, useCallback as useCallback5, useEffect as useEffect17, useRef as useRef4 } from "react";
80
+ import { createContext as createContext6, useContext as useContext6, useState as useState37, useCallback as useCallback5, useEffect as useEffect17, useRef as useRef4 } from "react";
80
81
  import { useApp as useApp3 } from "ink";
81
82
 
82
83
  // src/tui/contexts/ToastContext.tsx
@@ -714,8 +715,9 @@ function LanguageSelect() {
714
715
  const visibleOptions = LANGUAGE_OPTIONS.slice(firstVisible, firstVisible + visibleLanguageCount);
715
716
  function choose() {
716
717
  const option = LANGUAGE_OPTIONS[selectedIdx] ?? LANGUAGE_OPTIONS[0];
718
+ const firstRun = !configExists();
717
719
  setLanguage(option.code);
718
- replace("Welcome");
720
+ replace(firstRun ? "Setup" : "Welcome");
719
721
  }
720
722
  useInput((_input, key) => {
721
723
  if (key.upArrow) {
@@ -4974,19 +4976,20 @@ function Settings() {
4974
4976
  const { language, setLanguage, t } = useLanguage();
4975
4977
  const { rows: termRows } = useWindowSize17();
4976
4978
  const bodyRows = frameBodyRows(termRows, true, true);
4977
- const nonCompactRows = PROVIDERS.length + LANGUAGE_OPTIONS.length + 3 + 4 + 8;
4979
+ const nonCompactRows = PROVIDERS.length + LANGUAGE_OPTIONS.length + 3 + 5 + 8;
4978
4980
  const compactBody = bodyRows < nonCompactRows;
4979
4981
  const showCompactStatePaths = compactBody && bodyRows >= 10;
4980
4982
  const [selectedIdx, setSelectedIdx] = useState27(0);
4981
4983
  const [refreshKey, setRefreshKey] = useState27(0);
4982
4984
  const available = useMemo8(() => detectAvailable(), [refreshKey]);
4983
- const actionLabelWidth = Math.max(t("settings.recheck").length, t("settings.showConfig").length, t("settings.editConfig").length, t("common.back").length);
4985
+ const actionLabelWidth = Math.max(t("welcome.setup").length, t("settings.recheck").length, t("settings.showConfig").length, t("settings.editConfig").length, t("common.back").length);
4984
4986
  const rows = [
4985
4987
  ...PROVIDERS.map((p) => ({ type: "provider", id: p, provider: p, selectable: true })),
4986
4988
  ...LANGUAGE_OPTIONS.map((option) => ({ type: "language", id: `language-${option.code}`, language: option.code, selectable: true })),
4987
4989
  { type: "statePath", id: "state", selectable: false },
4988
4990
  { type: "statePath", id: "runs", selectable: false },
4989
4991
  { type: "statePath", id: "presets", selectable: false },
4992
+ { type: "action", id: "setup", selectable: true },
4990
4993
  { type: "action", id: "recheck", selectable: true },
4991
4994
  { type: "action", id: "showConfig", selectable: true },
4992
4995
  { type: "action", id: "editConfig", selectable: true },
@@ -5009,6 +5012,10 @@ function Settings() {
5009
5012
  async function activate() {
5010
5013
  const row = selectableRows[currentIdx];
5011
5014
  if (!row) return;
5015
+ if (row.id === "setup") {
5016
+ push("Setup");
5017
+ return;
5018
+ }
5012
5019
  if (row.id === "recheck") {
5013
5020
  setRefreshKey((k) => k + 1);
5014
5021
  return;
@@ -5102,6 +5109,7 @@ function Settings() {
5102
5109
  );
5103
5110
  }
5104
5111
  const actionLabels = {
5112
+ setup: { primary: t("welcome.setup"), hint: t("welcome.setupHint") },
5105
5113
  recheck: { primary: t("settings.recheck"), hint: t("settings.recheckHint") },
5106
5114
  showConfig: { primary: t("settings.showConfig"), hint: t("settings.showConfigHint") },
5107
5115
  editConfig: { primary: t("settings.editConfig"), hint: t("settings.editConfigHint") },
@@ -5201,6 +5209,15 @@ function Settings() {
5201
5209
  ),
5202
5210
  /* @__PURE__ */ jsx43(SectionEnd, {}),
5203
5211
  /* @__PURE__ */ jsx43(Section, { label: t("common.actions") }),
5212
+ /* @__PURE__ */ jsx43(
5213
+ Row,
5214
+ {
5215
+ selected: selectedIdx === rows.findIndex((r) => r.id === "setup"),
5216
+ primary: t("welcome.setup"),
5217
+ primaryWidth: actionLabelWidth,
5218
+ hint: t("welcome.setupHint")
5219
+ }
5220
+ ),
5204
5221
  /* @__PURE__ */ jsx43(
5205
5222
  Row,
5206
5223
  {
@@ -5430,10 +5447,92 @@ function AgentControl() {
5430
5447
  );
5431
5448
  }
5432
5449
 
5450
+ // src/tui/screens/Setup.tsx
5451
+ import { useMemo as useMemo10, useState as useState29 } from "react";
5452
+ import { Box as Box32, Text as Text28, useInput as useInput24 } from "ink";
5453
+ import { jsx as jsx46, jsxs as jsxs37 } from "react/jsx-runtime";
5454
+ function Setup() {
5455
+ const { push, replace, pop, canBack } = useRouter();
5456
+ const { t } = useLanguage();
5457
+ const [refreshKey, setRefreshKey] = useState29(0);
5458
+ const [selectedIdx, setSelectedIdx] = useState29(0);
5459
+ const [toast, setToast] = useState29(null);
5460
+ const state = useMemo10(() => buildOnboardingState(), [refreshKey]);
5461
+ function leave() {
5462
+ if (canBack) pop();
5463
+ else replace("Welcome");
5464
+ }
5465
+ const actions = [];
5466
+ if (state.attachable.length > 0) {
5467
+ actions.push({
5468
+ key: "connect",
5469
+ label: t("setup.connectAll"),
5470
+ hint: t("setup.connectAllHint"),
5471
+ run: () => {
5472
+ const results = attachAll();
5473
+ const ok = results.filter((result) => result.ok).length;
5474
+ setToast(t("setup.connectedToast", { ok, total: results.length }));
5475
+ setRefreshKey((key) => key + 1);
5476
+ }
5477
+ });
5478
+ }
5479
+ actions.push({ key: "hosts", label: t("setup.manageHosts"), hint: t("setup.manageHostsHint"), run: () => push("AgentControl") });
5480
+ actions.push({ key: "run", label: t("setup.startRun"), hint: t("setup.startRunHint"), run: () => push("NewRun") });
5481
+ actions.push({ key: "done", label: t("setup.done"), hint: t("setup.doneHint"), run: leave });
5482
+ const maxIdx = actions.length - 1;
5483
+ useInput24((_input, key) => {
5484
+ if (key.upArrow) {
5485
+ setSelectedIdx((idx) => Math.max(0, idx - 1));
5486
+ return;
5487
+ }
5488
+ if (key.downArrow) {
5489
+ setSelectedIdx((idx) => Math.min(maxIdx, idx + 1));
5490
+ return;
5491
+ }
5492
+ if (key.return) {
5493
+ actions[Math.min(selectedIdx, maxIdx)]?.run();
5494
+ return;
5495
+ }
5496
+ if (key.escape) {
5497
+ leave();
5498
+ return;
5499
+ }
5500
+ });
5501
+ const providersText = state.installedProviders.length > 0 ? state.installedProviders.map(providerDisplayName).join(", ") : t("setup.noProviders");
5502
+ return /* @__PURE__ */ jsx46(
5503
+ Frame,
5504
+ {
5505
+ breadcrumb: ["ReevesAgents", t("setup.title")],
5506
+ tagline: t("setup.subtitle"),
5507
+ statusKeys: t("setup.status"),
5508
+ children: /* @__PURE__ */ jsxs37(Box32, { flexDirection: "column", children: [
5509
+ /* @__PURE__ */ jsx46(Text28, { color: colors.text.dim, wrap: "truncate-end", children: t("setup.intro") }),
5510
+ /* @__PURE__ */ jsx46(Section, { label: t("setup.environment") }),
5511
+ /* @__PURE__ */ jsx46(Row, { selected: false, disabled: true, primary: "tmux", primaryWidth: 12, hint: state.tmuxOk ? t("setup.ok") : t("setup.tmuxMissing") }),
5512
+ /* @__PURE__ */ jsx46(Row, { selected: false, disabled: true, primary: "node", primaryWidth: 12, hint: state.nodeOk ? t("setup.ok") : t("setup.nodeOld") }),
5513
+ /* @__PURE__ */ jsx46(Row, { selected: false, disabled: true, primary: t("setup.providersLabel"), primaryWidth: 12, hint: providersText }),
5514
+ /* @__PURE__ */ jsx46(Section, { label: t("setup.actions") }),
5515
+ actions.map((action, idx) => /* @__PURE__ */ jsx46(
5516
+ Row,
5517
+ {
5518
+ selected: selectedIdx === idx,
5519
+ primary: action.label,
5520
+ primaryWidth: 26,
5521
+ hint: action.hint
5522
+ },
5523
+ action.key
5524
+ )),
5525
+ toast && /* @__PURE__ */ jsx46(Text28, { color: colors.status.ok, wrap: "truncate-end", children: toast }),
5526
+ /* @__PURE__ */ jsx46(SectionEnd, {})
5527
+ ] })
5528
+ }
5529
+ );
5530
+ }
5531
+
5433
5532
  // src/tui/screens/Reference.tsx
5434
- import { useState as useState29 } from "react";
5435
- import { useInput as useInput24, useWindowSize as useWindowSize19 } from "ink";
5436
- import { Fragment as Fragment12, jsx as jsx46, jsxs as jsxs37 } from "react/jsx-runtime";
5533
+ import { useState as useState30 } from "react";
5534
+ import { useInput as useInput25, useWindowSize as useWindowSize19 } from "ink";
5535
+ import { Fragment as Fragment12, jsx as jsx47, jsxs as jsxs38 } from "react/jsx-runtime";
5437
5536
  var CONTENT = [
5438
5537
  { type: "section", label: "TUI Pages" },
5439
5538
  { type: "row", primary: "Welcome", trailing: "main menu, current run, reference, credits" },
@@ -5462,8 +5561,8 @@ function Reference() {
5462
5561
  const compactBody = bodyRows <= 10;
5463
5562
  const visibleCount = Math.max(1, compactBody ? bodyRows - 3 : bodyRows - 5);
5464
5563
  const maxScroll = Math.max(0, CONTENT.length - visibleCount);
5465
- const [scroll, setScroll] = useState29(0);
5466
- useInput24((_input, key) => {
5564
+ const [scroll, setScroll] = useState30(0);
5565
+ useInput25((_input, key) => {
5467
5566
  if (key.upArrow) {
5468
5567
  setScroll((value) => Math.max(0, value - 1));
5469
5568
  return;
@@ -5480,25 +5579,25 @@ function Reference() {
5480
5579
  let openSection = false;
5481
5580
  visible.forEach((item, idx) => {
5482
5581
  if (item.type === "section") {
5483
- if (openSection) contentRows.push(/* @__PURE__ */ jsx46(SectionEnd, {}, `end-${idx}`));
5484
- contentRows.push(/* @__PURE__ */ jsx46(Section, { label: item.label }, `${item.label}-${idx}`));
5582
+ if (openSection) contentRows.push(/* @__PURE__ */ jsx47(SectionEnd, {}, `end-${idx}`));
5583
+ contentRows.push(/* @__PURE__ */ jsx47(Section, { label: item.label }, `${item.label}-${idx}`));
5485
5584
  openSection = true;
5486
5585
  return;
5487
5586
  }
5488
- contentRows.push(/* @__PURE__ */ jsx46(Row, { selected: false, primary: item.primary, trailing: item.trailing }, `${item.primary}-${idx}`));
5587
+ contentRows.push(/* @__PURE__ */ jsx47(Row, { selected: false, primary: item.primary, trailing: item.trailing }, `${item.primary}-${idx}`));
5489
5588
  });
5490
- if (openSection) contentRows.push(/* @__PURE__ */ jsx46(SectionEnd, {}, "end-visible"));
5491
- return /* @__PURE__ */ jsx46(
5589
+ if (openSection) contentRows.push(/* @__PURE__ */ jsx47(SectionEnd, {}, "end-visible"));
5590
+ return /* @__PURE__ */ jsx47(
5492
5591
  Frame,
5493
5592
  {
5494
5593
  breadcrumb: ["ReevesAgents", "Reference"],
5495
5594
  tagline: "Quick map of run mode, command line, tmux workflow, and roles.",
5496
5595
  statusContext,
5497
5596
  statusKeys: maxScroll > 0 ? "\u2191\u2193 scroll \xB7 enter back \xB7 esc back" : "enter back \xB7 esc back",
5498
- children: compactBody ? /* @__PURE__ */ jsxs37(Fragment12, { children: [
5499
- /* @__PURE__ */ jsx46(Section, { label: "Reference" }),
5500
- visible.map((item, idx) => item.type === "section" ? /* @__PURE__ */ jsx46(Row, { selected: false, primary: item.label, disabled: true }, `${item.label}-${idx}`) : /* @__PURE__ */ jsx46(Row, { selected: false, primary: item.primary, trailing: item.trailing }, `${item.primary}-${idx}`)),
5501
- maxScroll > 0 && /* @__PURE__ */ jsx46(
5597
+ children: compactBody ? /* @__PURE__ */ jsxs38(Fragment12, { children: [
5598
+ /* @__PURE__ */ jsx47(Section, { label: "Reference" }),
5599
+ visible.map((item, idx) => item.type === "section" ? /* @__PURE__ */ jsx47(Row, { selected: false, primary: item.label, disabled: true }, `${item.label}-${idx}`) : /* @__PURE__ */ jsx47(Row, { selected: false, primary: item.primary, trailing: item.trailing }, `${item.primary}-${idx}`)),
5600
+ maxScroll > 0 && /* @__PURE__ */ jsx47(
5502
5601
  Row,
5503
5602
  {
5504
5603
  selected: false,
@@ -5507,21 +5606,21 @@ function Reference() {
5507
5606
  disabled: true
5508
5607
  }
5509
5608
  ),
5510
- /* @__PURE__ */ jsx46(SectionEnd, {})
5511
- ] }) : /* @__PURE__ */ jsxs37(Fragment12, { children: [
5609
+ /* @__PURE__ */ jsx47(SectionEnd, {})
5610
+ ] }) : /* @__PURE__ */ jsxs38(Fragment12, { children: [
5512
5611
  contentRows,
5513
- /* @__PURE__ */ jsx46(Section, { label: "Actions" }),
5514
- /* @__PURE__ */ jsx46(Row, { selected: true, primary: "Back", hint: "return to previous page" }),
5515
- /* @__PURE__ */ jsx46(SectionEnd, {})
5612
+ /* @__PURE__ */ jsx47(Section, { label: "Actions" }),
5613
+ /* @__PURE__ */ jsx47(Row, { selected: true, primary: "Back", hint: "return to previous page" }),
5614
+ /* @__PURE__ */ jsx47(SectionEnd, {})
5516
5615
  ] })
5517
5616
  }
5518
5617
  );
5519
5618
  }
5520
5619
 
5521
5620
  // src/tui/screens/Credits.tsx
5522
- import { useState as useState30 } from "react";
5523
- import { Box as Box32, useInput as useInput25, useWindowSize as useWindowSize20 } from "ink";
5524
- import { Fragment as Fragment13, jsx as jsx47, jsxs as jsxs38 } from "react/jsx-runtime";
5621
+ import { useState as useState31 } from "react";
5622
+ import { Box as Box33, useInput as useInput26, useWindowSize as useWindowSize20 } from "ink";
5623
+ import { Fragment as Fragment13, jsx as jsx48, jsxs as jsxs39 } from "react/jsx-runtime";
5525
5624
  function Credits() {
5526
5625
  const { pop } = useRouter();
5527
5626
  const { t } = useLanguage();
@@ -5539,10 +5638,10 @@ function Credits() {
5539
5638
  { primary: "Repository", trailing: "See package metadata" }
5540
5639
  ];
5541
5640
  const visibleCount = Math.max(1, bodyRows - (compactBody ? 3 : 6));
5542
- const [scroll, setScroll] = useState30(0);
5641
+ const [scroll, setScroll] = useState31(0);
5543
5642
  const maxScroll = Math.max(0, content.length - visibleCount);
5544
5643
  const visible = content.slice(scroll, scroll + visibleCount);
5545
- useInput25((_input, key) => {
5644
+ useInput26((_input, key) => {
5546
5645
  if (key.upArrow) {
5547
5646
  setScroll((value) => Math.max(0, value - 1));
5548
5647
  return;
@@ -5553,17 +5652,17 @@ function Credits() {
5553
5652
  }
5554
5653
  if (key.return || key.escape || key.backspace) pop();
5555
5654
  });
5556
- return /* @__PURE__ */ jsx47(
5655
+ return /* @__PURE__ */ jsx48(
5557
5656
  Frame,
5558
5657
  {
5559
5658
  breadcrumb: ["ReevesAgents", "Credits"],
5560
5659
  tagline: "About this local tmux-first workspace manager.",
5561
5660
  statusContext: `ReevesAgents ${REEVESAGENTS_VERSION}`,
5562
5661
  statusKeys: "enter back \xB7 esc back",
5563
- children: /* @__PURE__ */ jsxs38(Box32, { flexDirection: "column", children: [
5564
- /* @__PURE__ */ jsx47(Section, { label: "Credits" }),
5565
- visible.map((item) => /* @__PURE__ */ jsx47(Row, { selected: false, primary: item.primary, trailing: item.trailing }, item.primary)),
5566
- maxScroll > 0 && /* @__PURE__ */ jsx47(
5662
+ children: /* @__PURE__ */ jsxs39(Box33, { flexDirection: "column", children: [
5663
+ /* @__PURE__ */ jsx48(Section, { label: "Credits" }),
5664
+ visible.map((item) => /* @__PURE__ */ jsx48(Row, { selected: false, primary: item.primary, trailing: item.trailing }, item.primary)),
5665
+ maxScroll > 0 && /* @__PURE__ */ jsx48(
5567
5666
  Row,
5568
5667
  {
5569
5668
  selected: false,
@@ -5572,11 +5671,11 @@ function Credits() {
5572
5671
  disabled: true
5573
5672
  }
5574
5673
  ),
5575
- /* @__PURE__ */ jsx47(SectionEnd, {}),
5576
- !compactBody && /* @__PURE__ */ jsxs38(Fragment13, { children: [
5577
- /* @__PURE__ */ jsx47(Section, { label: "Actions" }),
5578
- /* @__PURE__ */ jsx47(Row, { selected: true, primary: "Back", hint: "return to main menu" }),
5579
- /* @__PURE__ */ jsx47(SectionEnd, {})
5674
+ /* @__PURE__ */ jsx48(SectionEnd, {}),
5675
+ !compactBody && /* @__PURE__ */ jsxs39(Fragment13, { children: [
5676
+ /* @__PURE__ */ jsx48(Section, { label: "Actions" }),
5677
+ /* @__PURE__ */ jsx48(Row, { selected: true, primary: "Back", hint: "return to main menu" }),
5678
+ /* @__PURE__ */ jsx48(SectionEnd, {})
5580
5679
  ] })
5581
5680
  ] })
5582
5681
  }
@@ -5584,9 +5683,9 @@ function Credits() {
5584
5683
  }
5585
5684
 
5586
5685
  // src/tui/screens/Doctor.tsx
5587
- import { useEffect as useEffect13, useMemo as useMemo10, useState as useState31 } from "react";
5588
- import { Box as Box33, useInput as useInput26, useWindowSize as useWindowSize21 } from "ink";
5589
- import { Fragment as Fragment14, jsx as jsx48, jsxs as jsxs39 } from "react/jsx-runtime";
5686
+ import { useEffect as useEffect13, useMemo as useMemo11, useState as useState32 } from "react";
5687
+ import { Box as Box34, useInput as useInput27, useWindowSize as useWindowSize21 } from "ink";
5688
+ import { Fragment as Fragment14, jsx as jsx49, jsxs as jsxs40 } from "react/jsx-runtime";
5590
5689
  var CHROME_ROWS5 = 17;
5591
5690
  function statusGlyph4(status) {
5592
5691
  if (status === "ok") return { char: glyphs.status.ok, color: colors.status.ok };
@@ -5600,11 +5699,11 @@ function Doctor() {
5600
5699
  const bodyRows = frameBodyRows(termRows, true, true);
5601
5700
  const compactBody = bodyRows <= 10;
5602
5701
  const pageSize = Math.max(1, compactBody ? bodyRows - 3 : Math.min(termRows - CHROME_ROWS5, bodyRows - 7));
5603
- const [selectedIdx, setSelectedIdx] = useState31(0);
5604
- const [refreshKey, setRefreshKey] = useState31(0);
5605
- const [isSpinning, setIsSpinning] = useState31(false);
5606
- const [page, setPage] = useState31(1);
5607
- const result = useMemo10(() => runDoctor(), [refreshKey]);
5702
+ const [selectedIdx, setSelectedIdx] = useState32(0);
5703
+ const [refreshKey, setRefreshKey] = useState32(0);
5704
+ const [isSpinning, setIsSpinning] = useState32(false);
5705
+ const [page, setPage] = useState32(1);
5706
+ const result = useMemo11(() => runDoctor(), [refreshKey]);
5608
5707
  const checks = result.checks;
5609
5708
  const counts = {
5610
5709
  ok: checks.filter((c) => c.status === "ok").length,
@@ -5641,7 +5740,7 @@ function Doctor() {
5641
5740
  setIsSpinning(false);
5642
5741
  }, 200);
5643
5742
  };
5644
- useInput26((_input, key) => {
5743
+ useInput27((_input, key) => {
5645
5744
  if (key.escape || key.backspace) {
5646
5745
  pop();
5647
5746
  return;
@@ -5671,7 +5770,7 @@ function Doctor() {
5671
5770
  }
5672
5771
  }
5673
5772
  });
5674
- return /* @__PURE__ */ jsx48(
5773
+ return /* @__PURE__ */ jsx49(
5675
5774
  Frame,
5676
5775
  {
5677
5776
  breadcrumb: ["ReevesAgents", "Doctor"],
@@ -5682,12 +5781,12 @@ function Doctor() {
5682
5781
  ],
5683
5782
  tagline: "Setup and environment health for TUI, CLI, Web UI, and tmux.",
5684
5783
  statusContext: selectedCheck ? `${selectedCheck.name}: ${selectedCheck.detail}` : "",
5685
- children: compactBody ? /* @__PURE__ */ jsxs39(Primary, { children: [
5686
- /* @__PURE__ */ jsx48(Section, { label: selectedIdx < pagedChecks.length ? "Checks" : "Actions" }),
5687
- isSpinning ? /* @__PURE__ */ jsx48(Spinner, { label: translatePhrase(language, "checking..."), color: colors.accent.bright }) : compactEntryIndexes.map((idx) => {
5784
+ children: compactBody ? /* @__PURE__ */ jsxs40(Primary, { children: [
5785
+ /* @__PURE__ */ jsx49(Section, { label: selectedIdx < pagedChecks.length ? "Checks" : "Actions" }),
5786
+ isSpinning ? /* @__PURE__ */ jsx49(Spinner, { label: translatePhrase(language, "checking..."), color: colors.accent.bright }) : compactEntryIndexes.map((idx) => {
5688
5787
  if (idx < pagedChecks.length) {
5689
5788
  const check = pagedChecks[idx];
5690
- return /* @__PURE__ */ jsx48(
5789
+ return /* @__PURE__ */ jsx49(
5691
5790
  Row,
5692
5791
  {
5693
5792
  selected: idx === selectedIdx,
@@ -5700,7 +5799,7 @@ function Doctor() {
5700
5799
  );
5701
5800
  }
5702
5801
  if (totalPages > 1 && idx === pagedChecks.length) {
5703
- return /* @__PURE__ */ jsx48(
5802
+ return /* @__PURE__ */ jsx49(
5704
5803
  Pagination,
5705
5804
  {
5706
5805
  page,
@@ -5713,14 +5812,14 @@ function Doctor() {
5713
5812
  );
5714
5813
  }
5715
5814
  if (idx === actionOffset) {
5716
- return /* @__PURE__ */ jsx48(Row, { selected: selectedIdx === actionOffset, primary: "Recheck", primaryWidth: checkLabelWidth, hint: "run doctor again" }, "recheck");
5815
+ return /* @__PURE__ */ jsx49(Row, { selected: selectedIdx === actionOffset, primary: "Recheck", primaryWidth: checkLabelWidth, hint: "run doctor again" }, "recheck");
5717
5816
  }
5718
- return /* @__PURE__ */ jsx48(Row, { selected: selectedIdx === actionOffset + 1, primary: "Back", primaryWidth: checkLabelWidth, hint: "return to previous page" }, "back");
5817
+ return /* @__PURE__ */ jsx49(Row, { selected: selectedIdx === actionOffset + 1, primary: "Back", primaryWidth: checkLabelWidth, hint: "return to previous page" }, "back");
5719
5818
  }),
5720
- /* @__PURE__ */ jsx48(SectionEnd, {})
5721
- ] }) : /* @__PURE__ */ jsxs39(Primary, { children: [
5722
- isSpinning && /* @__PURE__ */ jsx48(Spinner, { label: translatePhrase(language, "checking..."), color: colors.accent.bright }),
5723
- !isSpinning && pagedChecks.map((check, idx) => /* @__PURE__ */ jsx48(
5819
+ /* @__PURE__ */ jsx49(SectionEnd, {})
5820
+ ] }) : /* @__PURE__ */ jsxs40(Primary, { children: [
5821
+ isSpinning && /* @__PURE__ */ jsx49(Spinner, { label: translatePhrase(language, "checking..."), color: colors.accent.bright }),
5822
+ !isSpinning && pagedChecks.map((check, idx) => /* @__PURE__ */ jsx49(
5724
5823
  Row,
5725
5824
  {
5726
5825
  selected: idx === selectedIdx,
@@ -5731,7 +5830,7 @@ function Doctor() {
5731
5830
  },
5732
5831
  check.name
5733
5832
  )),
5734
- !isSpinning && totalPages > 1 && /* @__PURE__ */ jsx48(
5833
+ !isSpinning && totalPages > 1 && /* @__PURE__ */ jsx49(
5735
5834
  Pagination,
5736
5835
  {
5737
5836
  page,
@@ -5741,9 +5840,9 @@ function Doctor() {
5741
5840
  onNext: () => setPage((p) => Math.min(totalPages, p + 1))
5742
5841
  }
5743
5842
  ),
5744
- !isSpinning && /* @__PURE__ */ jsxs39(Fragment14, { children: [
5745
- /* @__PURE__ */ jsx48(Box33, { marginTop: 1 }),
5746
- /* @__PURE__ */ jsx48(
5843
+ !isSpinning && /* @__PURE__ */ jsxs40(Fragment14, { children: [
5844
+ /* @__PURE__ */ jsx49(Box34, { marginTop: 1 }),
5845
+ /* @__PURE__ */ jsx49(
5747
5846
  Legend,
5748
5847
  {
5749
5848
  items: [
@@ -5754,20 +5853,20 @@ function Doctor() {
5754
5853
  }
5755
5854
  )
5756
5855
  ] }),
5757
- /* @__PURE__ */ jsx48(Box33, { marginTop: 1 }),
5758
- /* @__PURE__ */ jsx48(Section, { label: "Actions" }),
5759
- /* @__PURE__ */ jsx48(Row, { selected: selectedIdx === actionOffset, primary: "Recheck", primaryWidth: checkLabelWidth, hint: "run doctor again" }),
5760
- /* @__PURE__ */ jsx48(Row, { selected: selectedIdx === actionOffset + 1, primary: "Back", primaryWidth: checkLabelWidth, hint: "return to previous page" }),
5761
- /* @__PURE__ */ jsx48(SectionEnd, {})
5856
+ /* @__PURE__ */ jsx49(Box34, { marginTop: 1 }),
5857
+ /* @__PURE__ */ jsx49(Section, { label: "Actions" }),
5858
+ /* @__PURE__ */ jsx49(Row, { selected: selectedIdx === actionOffset, primary: "Recheck", primaryWidth: checkLabelWidth, hint: "run doctor again" }),
5859
+ /* @__PURE__ */ jsx49(Row, { selected: selectedIdx === actionOffset + 1, primary: "Back", primaryWidth: checkLabelWidth, hint: "return to previous page" }),
5860
+ /* @__PURE__ */ jsx49(SectionEnd, {})
5762
5861
  ] })
5763
5862
  }
5764
5863
  );
5765
5864
  }
5766
5865
 
5767
5866
  // src/tui/screens/DoctorCheck.tsx
5768
- import { useEffect as useEffect14, useMemo as useMemo11, useState as useState32 } from "react";
5769
- import { Box as Box34, Text as Text28, useInput as useInput27 } from "ink";
5770
- import { Fragment as Fragment15, jsx as jsx49, jsxs as jsxs40 } from "react/jsx-runtime";
5867
+ import { useEffect as useEffect14, useMemo as useMemo12, useState as useState33 } from "react";
5868
+ import { Box as Box35, Text as Text29, useInput as useInput28 } from "ink";
5869
+ import { Fragment as Fragment15, jsx as jsx50, jsxs as jsxs41 } from "react/jsx-runtime";
5771
5870
  function statusGlyph5(status) {
5772
5871
  if (status === "ok") return { char: glyphs.status.ok, color: colors.status.ok };
5773
5872
  if (status === "warn") return { char: glyphs.status.warn, color: colors.status.warn };
@@ -5782,14 +5881,14 @@ function findFixHint(check) {
5782
5881
  function DoctorCheck() {
5783
5882
  const { pop, selectedCheckName } = useRouter();
5784
5883
  const { language } = useLanguage();
5785
- const [selectedIdx, setSelectedIdx] = useState32(0);
5786
- const result = useMemo11(() => runDoctor(), []);
5884
+ const [selectedIdx, setSelectedIdx] = useState33(0);
5885
+ const result = useMemo12(() => runDoctor(), []);
5787
5886
  const check = result.checks.find((c) => c.name === selectedCheckName);
5788
5887
  const backIdx = check ? 1 : 0;
5789
5888
  useEffect14(() => {
5790
5889
  setSelectedIdx(backIdx);
5791
5890
  }, [backIdx]);
5792
- useInput27((_input, key) => {
5891
+ useInput28((_input, key) => {
5793
5892
  if (key.escape || key.backspace) {
5794
5893
  pop();
5795
5894
  return;
@@ -5803,56 +5902,56 @@ function DoctorCheck() {
5803
5902
  }
5804
5903
  });
5805
5904
  if (!check) {
5806
- return /* @__PURE__ */ jsx49(
5905
+ return /* @__PURE__ */ jsx50(
5807
5906
  Frame,
5808
5907
  {
5809
5908
  breadcrumb: ["ReevesAgents", "Doctor", "Check"],
5810
5909
  tagline: "Check not found.",
5811
- children: /* @__PURE__ */ jsx49(Primary, { children: /* @__PURE__ */ jsx49(Row, { selected: selectedIdx === backIdx, primary: "Back" }) })
5910
+ children: /* @__PURE__ */ jsx50(Primary, { children: /* @__PURE__ */ jsx50(Row, { selected: selectedIdx === backIdx, primary: "Back" }) })
5812
5911
  }
5813
5912
  );
5814
5913
  }
5815
5914
  const fixHint = findFixHint(check);
5816
- return /* @__PURE__ */ jsx49(
5915
+ return /* @__PURE__ */ jsx50(
5817
5916
  Frame,
5818
5917
  {
5819
5918
  breadcrumb: ["ReevesAgents", "Doctor", check.name],
5820
5919
  meta: [{ label: "status", value: check.status }],
5821
5920
  tagline: "Check details and suggested fix.",
5822
- children: /* @__PURE__ */ jsxs40(Primary, { children: [
5823
- /* @__PURE__ */ jsxs40(Box34, { flexDirection: "column", children: [
5824
- /* @__PURE__ */ jsx49(Row, { selected: false, primary: "Name", trailing: check.name }),
5825
- /* @__PURE__ */ jsx49(Row, { selected: false, primary: "Status", trailing: check.status, glyph: statusGlyph5(check.status) }),
5826
- /* @__PURE__ */ jsx49(Row, { selected: false, primary: "Detail", trailing: check.detail })
5921
+ children: /* @__PURE__ */ jsxs41(Primary, { children: [
5922
+ /* @__PURE__ */ jsxs41(Box35, { flexDirection: "column", children: [
5923
+ /* @__PURE__ */ jsx50(Row, { selected: false, primary: "Name", trailing: check.name }),
5924
+ /* @__PURE__ */ jsx50(Row, { selected: false, primary: "Status", trailing: check.status, glyph: statusGlyph5(check.status) }),
5925
+ /* @__PURE__ */ jsx50(Row, { selected: false, primary: "Detail", trailing: check.detail })
5827
5926
  ] }),
5828
- fixHint && /* @__PURE__ */ jsxs40(Fragment15, { children: [
5829
- /* @__PURE__ */ jsx49(Box34, { marginY: 1 }),
5830
- /* @__PURE__ */ jsx49(Section, { label: "Fix" }),
5831
- /* @__PURE__ */ jsxs40(Box34, { marginY: 1, marginLeft: 2, flexDirection: "column", children: [
5832
- /* @__PURE__ */ jsx49(Text28, { color: colors.text.dim, children: translatePhrase(language, "Suggested fix:") }),
5833
- /* @__PURE__ */ jsx49(Text28, { color: colors.accent.primary, children: translatePhrase(language, fixHint) })
5927
+ fixHint && /* @__PURE__ */ jsxs41(Fragment15, { children: [
5928
+ /* @__PURE__ */ jsx50(Box35, { marginY: 1 }),
5929
+ /* @__PURE__ */ jsx50(Section, { label: "Fix" }),
5930
+ /* @__PURE__ */ jsxs41(Box35, { marginY: 1, marginLeft: 2, flexDirection: "column", children: [
5931
+ /* @__PURE__ */ jsx50(Text29, { color: colors.text.dim, children: translatePhrase(language, "Suggested fix:") }),
5932
+ /* @__PURE__ */ jsx50(Text29, { color: colors.accent.primary, children: translatePhrase(language, fixHint) })
5834
5933
  ] }),
5835
- /* @__PURE__ */ jsx49(SectionEnd, {})
5934
+ /* @__PURE__ */ jsx50(SectionEnd, {})
5836
5935
  ] }),
5837
- !fixHint && /* @__PURE__ */ jsxs40(Fragment15, { children: [
5838
- /* @__PURE__ */ jsx49(Box34, { marginY: 1 }),
5839
- /* @__PURE__ */ jsx49(Section, { label: "Fix" }),
5840
- /* @__PURE__ */ jsx49(Box34, { marginY: 1, marginLeft: 2, children: /* @__PURE__ */ jsx49(Text28, { color: colors.text.dim, children: translatePhrase(language, "No suggested fix. Check the source code or open an issue.") }) }),
5841
- /* @__PURE__ */ jsx49(SectionEnd, {})
5936
+ !fixHint && /* @__PURE__ */ jsxs41(Fragment15, { children: [
5937
+ /* @__PURE__ */ jsx50(Box35, { marginY: 1 }),
5938
+ /* @__PURE__ */ jsx50(Section, { label: "Fix" }),
5939
+ /* @__PURE__ */ jsx50(Box35, { marginY: 1, marginLeft: 2, children: /* @__PURE__ */ jsx50(Text29, { color: colors.text.dim, children: translatePhrase(language, "No suggested fix. Check the source code or open an issue.") }) }),
5940
+ /* @__PURE__ */ jsx50(SectionEnd, {})
5842
5941
  ] }),
5843
- /* @__PURE__ */ jsx49(Box34, { marginY: 1 }),
5844
- /* @__PURE__ */ jsx49(Section, { label: "Actions" }),
5845
- /* @__PURE__ */ jsx49(Row, { selected: selectedIdx === backIdx, primary: "Back" }),
5846
- /* @__PURE__ */ jsx49(SectionEnd, {})
5942
+ /* @__PURE__ */ jsx50(Box35, { marginY: 1 }),
5943
+ /* @__PURE__ */ jsx50(Section, { label: "Actions" }),
5944
+ /* @__PURE__ */ jsx50(Row, { selected: selectedIdx === backIdx, primary: "Back" }),
5945
+ /* @__PURE__ */ jsx50(SectionEnd, {})
5847
5946
  ] })
5848
5947
  }
5849
5948
  );
5850
5949
  }
5851
5950
 
5852
5951
  // src/tui/screens/Approvals.tsx
5853
- import { useEffect as useEffect15, useState as useState33 } from "react";
5854
- import { Box as Box35, useInput as useInput28 } from "ink";
5855
- import { jsx as jsx50, jsxs as jsxs41 } from "react/jsx-runtime";
5952
+ import { useEffect as useEffect15, useState as useState34 } from "react";
5953
+ import { Box as Box36, useInput as useInput29 } from "ink";
5954
+ import { jsx as jsx51, jsxs as jsxs42 } from "react/jsx-runtime";
5856
5955
  var ACTIONS3 = ["Approve", "Deny", "Back", "Main Menu"];
5857
5956
  var ACTION_COPY3 = {
5858
5957
  Approve: { label: "Approve", hint: "approve the selected request" },
@@ -5870,10 +5969,10 @@ function Approvals() {
5870
5969
  const { pop, resetStack } = useRouter();
5871
5970
  const { toast } = useToast();
5872
5971
  const { t } = useLanguage();
5873
- const [approvals, setApprovals] = useState33(() => listRunApprovals(void 0, "pending"));
5874
- const [selectedIdx, setSelectedIdx] = useState33(0);
5875
- const [selectedApprovalId, setSelectedApprovalId] = useState33(() => approvals[0]?.id ?? null);
5876
- const [pending, setPending] = useState33(null);
5972
+ const [approvals, setApprovals] = useState34(() => listRunApprovals(void 0, "pending"));
5973
+ const [selectedIdx, setSelectedIdx] = useState34(0);
5974
+ const [selectedApprovalId, setSelectedApprovalId] = useState34(() => approvals[0]?.id ?? null);
5975
+ const [pending, setPending] = useState34(null);
5877
5976
  useEffect15(() => {
5878
5977
  const timer = setInterval(() => setApprovals(listRunApprovals(void 0, "pending")), 5e3);
5879
5978
  return () => clearInterval(timer);
@@ -5918,7 +6017,7 @@ function Approvals() {
5918
6017
  break;
5919
6018
  }
5920
6019
  }
5921
- useInput28((_input, key) => {
6020
+ useInput29((_input, key) => {
5922
6021
  if (pending) return;
5923
6022
  if (key.upArrow) {
5924
6023
  setSelectedIdx((idx) => Math.max(0, Math.min(idx, itemCount - 1) - 1));
@@ -5938,7 +6037,7 @@ function Approvals() {
5938
6037
  }
5939
6038
  });
5940
6039
  if (pending) {
5941
- return /* @__PURE__ */ jsx50(Frame, { breadcrumb: ["ReevesAgents", "Approvals"], statusKeys: "\u2190\u2192 switch \xB7 enter select \xB7 esc cancel", children: /* @__PURE__ */ jsx50(
6040
+ return /* @__PURE__ */ jsx51(Frame, { breadcrumb: ["ReevesAgents", "Approvals"], statusKeys: "\u2190\u2192 switch \xB7 enter select \xB7 esc cancel", children: /* @__PURE__ */ jsx51(
5942
6041
  Dialog,
5943
6042
  {
5944
6043
  title: pending.decision === "approved" ? "Approve this request?" : "Deny this request?",
@@ -5957,7 +6056,7 @@ function Approvals() {
5957
6056
  } else if (selectedAction) {
5958
6057
  statusContext = (selectedAction === "Approve" || selectedAction === "Deny") && actionTarget ? `${ACTION_COPY3[selectedAction].hint} \xB7 ${actionTarget.action}` : ACTION_COPY3[selectedAction].hint;
5959
6058
  }
5960
- return /* @__PURE__ */ jsx50(
6059
+ return /* @__PURE__ */ jsx51(
5961
6060
  Frame,
5962
6061
  {
5963
6062
  breadcrumb: ["ReevesAgents", "Approvals"],
@@ -5965,9 +6064,9 @@ function Approvals() {
5965
6064
  tagline: "Pending approval requests raised by agents. Approve or deny them here.",
5966
6065
  statusContext,
5967
6066
  statusKeys: "enter action \xB7 \u2191\u2193 move \xB7 esc back",
5968
- children: /* @__PURE__ */ jsxs41(Box35, { flexDirection: "column", children: [
5969
- /* @__PURE__ */ jsx50(Section, { label: "Pending" }),
5970
- approvals.length === 0 ? /* @__PURE__ */ jsx50(Row, { selected: false, primary: "No pending approvals", trailing: "requests appear here", disabled: true }) : approvals.map((approval, idx) => /* @__PURE__ */ jsx50(
6067
+ children: /* @__PURE__ */ jsxs42(Box36, { flexDirection: "column", children: [
6068
+ /* @__PURE__ */ jsx51(Section, { label: "Pending" }),
6069
+ approvals.length === 0 ? /* @__PURE__ */ jsx51(Row, { selected: false, primary: "No pending approvals", trailing: "requests appear here", disabled: true }) : approvals.map((approval, idx) => /* @__PURE__ */ jsx51(
5971
6070
  Row,
5972
6071
  {
5973
6072
  selected: clampedIdx === idx,
@@ -5979,9 +6078,9 @@ function Approvals() {
5979
6078
  },
5980
6079
  approval.id
5981
6080
  )),
5982
- /* @__PURE__ */ jsx50(SectionEnd, {}),
5983
- /* @__PURE__ */ jsx50(Section, { label: "Actions" }),
5984
- ACTIONS3.map((action, idx) => /* @__PURE__ */ jsx50(
6081
+ /* @__PURE__ */ jsx51(SectionEnd, {}),
6082
+ /* @__PURE__ */ jsx51(Section, { label: "Actions" }),
6083
+ ACTIONS3.map((action, idx) => /* @__PURE__ */ jsx51(
5985
6084
  Row,
5986
6085
  {
5987
6086
  selected: clampedIdx === approvals.length + idx,
@@ -5993,16 +6092,16 @@ function Approvals() {
5993
6092
  },
5994
6093
  action
5995
6094
  )),
5996
- /* @__PURE__ */ jsx50(SectionEnd, {})
6095
+ /* @__PURE__ */ jsx51(SectionEnd, {})
5997
6096
  ] })
5998
6097
  }
5999
6098
  );
6000
6099
  }
6001
6100
 
6002
6101
  // src/tui/screens/Config.tsx
6003
- import { useState as useState34 } from "react";
6004
- import { Box as Box36, useInput as useInput29 } from "ink";
6005
- import { jsx as jsx51, jsxs as jsxs42 } from "react/jsx-runtime";
6102
+ import { useState as useState35 } from "react";
6103
+ import { Box as Box37, useInput as useInput30 } from "ink";
6104
+ import { jsx as jsx52, jsxs as jsxs43 } from "react/jsx-runtime";
6006
6105
  var EDITABLE_FIELDS = CONFIG_FIELDS.filter((field) => field.kind !== "language");
6007
6106
  function isNumeric(field) {
6008
6107
  return field.kind === "posint" || field.kind === "nonneg-int";
@@ -6011,10 +6110,10 @@ function Config() {
6011
6110
  const { pop } = useRouter();
6012
6111
  const { toast } = useToast();
6013
6112
  const { language } = useLanguage();
6014
- const [global, setGlobal] = useState34(() => loadConfig().global);
6015
- const [selectedIdx, setSelectedIdx] = useState34(0);
6016
- const [editingKey, setEditingKey] = useState34(null);
6017
- const [draft, setDraft] = useState34("");
6113
+ const [global, setGlobal] = useState35(() => loadConfig().global);
6114
+ const [selectedIdx, setSelectedIdx] = useState35(0);
6115
+ const [editingKey, setEditingKey] = useState35(null);
6116
+ const [draft, setDraft] = useState35("");
6018
6117
  const totalRows = EDITABLE_FIELDS.length + 1;
6019
6118
  function applyValue(key, value) {
6020
6119
  try {
@@ -6031,7 +6130,7 @@ function Config() {
6031
6130
  toast(err instanceof Error ? err.message : String(err), "error");
6032
6131
  }
6033
6132
  }
6034
- useInput29((_input, key) => {
6133
+ useInput30((_input, key) => {
6035
6134
  if (editingKey) return;
6036
6135
  if (key.escape || key.backspace) {
6037
6136
  pop();
@@ -6061,18 +6160,18 @@ function Config() {
6061
6160
  setEditingKey(field.key);
6062
6161
  }
6063
6162
  });
6064
- return /* @__PURE__ */ jsx51(
6163
+ return /* @__PURE__ */ jsx52(
6065
6164
  Frame,
6066
6165
  {
6067
6166
  breadcrumb: ["ReevesAgents", "Settings", "Config"],
6068
6167
  tagline: "Edit global settings. Numbers edit inline; permissions cycle.",
6069
6168
  statusKeys: "enter edit/cycle \xB7 \u2190\u2192 cycle \xB7 esc back",
6070
- children: /* @__PURE__ */ jsxs42(Box36, { flexDirection: "column", children: [
6071
- /* @__PURE__ */ jsx51(Section, { label: "Config" }),
6169
+ children: /* @__PURE__ */ jsxs43(Box37, { flexDirection: "column", children: [
6170
+ /* @__PURE__ */ jsx52(Section, { label: "Config" }),
6072
6171
  EDITABLE_FIELDS.map((field, idx) => {
6073
6172
  const value = global[field.key];
6074
6173
  if (isNumeric(field)) {
6075
- return /* @__PURE__ */ jsx51(
6174
+ return /* @__PURE__ */ jsx52(
6076
6175
  TextField,
6077
6176
  {
6078
6177
  label: field.label,
@@ -6088,7 +6187,7 @@ function Config() {
6088
6187
  field.key
6089
6188
  );
6090
6189
  }
6091
- return /* @__PURE__ */ jsx51(
6190
+ return /* @__PURE__ */ jsx52(
6092
6191
  Row,
6093
6192
  {
6094
6193
  selected: selectedIdx === idx,
@@ -6099,19 +6198,19 @@ function Config() {
6099
6198
  field.key
6100
6199
  );
6101
6200
  }),
6102
- /* @__PURE__ */ jsx51(SectionEnd, {}),
6103
- /* @__PURE__ */ jsx51(Section, { label: "Actions" }),
6104
- /* @__PURE__ */ jsx51(Row, { selected: selectedIdx === EDITABLE_FIELDS.length, primary: "Back", hint: "return to settings" }),
6105
- /* @__PURE__ */ jsx51(SectionEnd, {})
6201
+ /* @__PURE__ */ jsx52(SectionEnd, {}),
6202
+ /* @__PURE__ */ jsx52(Section, { label: "Actions" }),
6203
+ /* @__PURE__ */ jsx52(Row, { selected: selectedIdx === EDITABLE_FIELDS.length, primary: "Back", hint: "return to settings" }),
6204
+ /* @__PURE__ */ jsx52(SectionEnd, {})
6106
6205
  ] })
6107
6206
  }
6108
6207
  );
6109
6208
  }
6110
6209
 
6111
6210
  // src/tui/screens/Presets.tsx
6112
- import { useEffect as useEffect16, useState as useState35 } from "react";
6113
- import { Box as Box37, useInput as useInput30 } from "ink";
6114
- import { jsx as jsx52, jsxs as jsxs43 } from "react/jsx-runtime";
6211
+ import { useEffect as useEffect16, useState as useState36 } from "react";
6212
+ import { Box as Box38, useInput as useInput31 } from "ink";
6213
+ import { jsx as jsx53, jsxs as jsxs44 } from "react/jsx-runtime";
6115
6214
  var ACTIONS4 = ["Start", "SaveCurrentRun", "Delete", "Back", "Main Menu"];
6116
6215
  var ACTION_COPY4 = {
6117
6216
  Start: { label: "Start", hint: "launch a run from the selected preset" },
@@ -6125,12 +6224,12 @@ function Presets() {
6125
6224
  const { pop, resetStack, selectedRunId, setSelectedRunId } = useRouter();
6126
6225
  const { toast } = useToast();
6127
6226
  const { t } = useLanguage();
6128
- const [presets, setPresets] = useState35(() => listPresets());
6129
- const [selectedIdx, setSelectedIdx] = useState35(0);
6130
- const [actOnName, setActOnName] = useState35(() => presets[0]?.name ?? null);
6131
- const [pendingDelete, setPendingDelete] = useState35(null);
6132
- const [saving, setSaving] = useState35(false);
6133
- const [draftName, setDraftName] = useState35("");
6227
+ const [presets, setPresets] = useState36(() => listPresets());
6228
+ const [selectedIdx, setSelectedIdx] = useState36(0);
6229
+ const [actOnName, setActOnName] = useState36(() => presets[0]?.name ?? null);
6230
+ const [pendingDelete, setPendingDelete] = useState36(null);
6231
+ const [saving, setSaving] = useState36(false);
6232
+ const [draftName, setDraftName] = useState36("");
6134
6233
  const total = presets.length + ACTIONS4.length;
6135
6234
  const clampedIdx = Math.min(selectedIdx, Math.max(0, total - 1));
6136
6235
  const onPreset = clampedIdx < presets.length;
@@ -6196,7 +6295,7 @@ function Presets() {
6196
6295
  setSaving(true);
6197
6296
  }
6198
6297
  }
6199
- useInput30((_input, key) => {
6298
+ useInput31((_input, key) => {
6200
6299
  if (saving) return;
6201
6300
  if (key.upArrow) {
6202
6301
  setSelectedIdx(() => Math.max(0, clampedIdx - 1));
@@ -6216,15 +6315,15 @@ function Presets() {
6216
6315
  }
6217
6316
  });
6218
6317
  if (saving) {
6219
- return /* @__PURE__ */ jsx52(
6318
+ return /* @__PURE__ */ jsx53(
6220
6319
  Frame,
6221
6320
  {
6222
6321
  breadcrumb: ["ReevesAgents", "Presets", "Save"],
6223
6322
  tagline: "Name the preset captured from the current run.",
6224
6323
  statusKeys: "enter save \xB7 esc cancel",
6225
- children: /* @__PURE__ */ jsxs43(Box37, { flexDirection: "column", children: [
6226
- /* @__PURE__ */ jsx52(Section, { label: "Save Current Run as Preset" }),
6227
- /* @__PURE__ */ jsx52(
6324
+ children: /* @__PURE__ */ jsxs44(Box38, { flexDirection: "column", children: [
6325
+ /* @__PURE__ */ jsx53(Section, { label: "Save Current Run as Preset" }),
6326
+ /* @__PURE__ */ jsx53(
6228
6327
  TextField,
6229
6328
  {
6230
6329
  label: "Preset name",
@@ -6238,13 +6337,13 @@ function Presets() {
6238
6337
  onCancel: () => setSaving(false)
6239
6338
  }
6240
6339
  ),
6241
- /* @__PURE__ */ jsx52(SectionEnd, {})
6340
+ /* @__PURE__ */ jsx53(SectionEnd, {})
6242
6341
  ] })
6243
6342
  }
6244
6343
  );
6245
6344
  }
6246
6345
  if (pendingDelete) {
6247
- return /* @__PURE__ */ jsx52(Frame, { breadcrumb: ["ReevesAgents", "Presets"], statusKeys: "enter select \xB7 esc cancel", children: /* @__PURE__ */ jsx52(
6346
+ return /* @__PURE__ */ jsx53(Frame, { breadcrumb: ["ReevesAgents", "Presets"], statusKeys: "enter select \xB7 esc cancel", children: /* @__PURE__ */ jsx53(
6248
6347
  Dialog,
6249
6348
  {
6250
6349
  title: t("presets.deleteTitle", { name: pendingDelete.name }),
@@ -6257,16 +6356,16 @@ function Presets() {
6257
6356
  }
6258
6357
  ) });
6259
6358
  }
6260
- return /* @__PURE__ */ jsx52(
6359
+ return /* @__PURE__ */ jsx53(
6261
6360
  Frame,
6262
6361
  {
6263
6362
  breadcrumb: ["ReevesAgents", "Presets"],
6264
6363
  meta: [{ label: "presets", value: String(presets.length) }],
6265
6364
  tagline: "Saved agent-team templates. Start one, save the current run, or delete.",
6266
6365
  statusKeys: "enter start/select \xB7 \u2191\u2193 move \xB7 esc back",
6267
- children: /* @__PURE__ */ jsxs43(Box37, { flexDirection: "column", children: [
6268
- /* @__PURE__ */ jsx52(Section, { label: "Presets" }),
6269
- presets.length === 0 ? /* @__PURE__ */ jsx52(Row, { selected: false, primary: "No presets yet", trailing: "save a run to create one", disabled: true }) : presets.map((preset, idx) => /* @__PURE__ */ jsx52(
6366
+ children: /* @__PURE__ */ jsxs44(Box38, { flexDirection: "column", children: [
6367
+ /* @__PURE__ */ jsx53(Section, { label: "Presets" }),
6368
+ presets.length === 0 ? /* @__PURE__ */ jsx53(Row, { selected: false, primary: "No presets yet", trailing: "save a run to create one", disabled: true }) : presets.map((preset, idx) => /* @__PURE__ */ jsx53(
6270
6369
  Row,
6271
6370
  {
6272
6371
  selected: clampedIdx === idx,
@@ -6276,9 +6375,9 @@ function Presets() {
6276
6375
  },
6277
6376
  preset.name
6278
6377
  )),
6279
- /* @__PURE__ */ jsx52(SectionEnd, {}),
6280
- /* @__PURE__ */ jsx52(Section, { label: "Actions" }),
6281
- ACTIONS4.map((action, idx) => /* @__PURE__ */ jsx52(
6378
+ /* @__PURE__ */ jsx53(SectionEnd, {}),
6379
+ /* @__PURE__ */ jsx53(Section, { label: "Actions" }),
6380
+ ACTIONS4.map((action, idx) => /* @__PURE__ */ jsx53(
6282
6381
  Row,
6283
6382
  {
6284
6383
  selected: clampedIdx === presets.length + idx,
@@ -6290,14 +6389,14 @@ function Presets() {
6290
6389
  },
6291
6390
  action
6292
6391
  )),
6293
- /* @__PURE__ */ jsx52(SectionEnd, {})
6392
+ /* @__PURE__ */ jsx53(SectionEnd, {})
6294
6393
  ] })
6295
6394
  }
6296
6395
  );
6297
6396
  }
6298
6397
 
6299
6398
  // src/tui/router.tsx
6300
- import { jsx as jsx53 } from "react/jsx-runtime";
6399
+ import { jsx as jsx54 } from "react/jsx-runtime";
6301
6400
  var RouterContext = createContext6(null);
6302
6401
  function useRouter() {
6303
6402
  const ctx = useContext6(RouterContext);
@@ -6310,65 +6409,67 @@ function normalizeScreen(screen) {
6310
6409
  function renderScreen(screen) {
6311
6410
  switch (normalizeScreen(screen)) {
6312
6411
  case "LanguageSelect":
6313
- return /* @__PURE__ */ jsx53(LanguageSelect, {});
6412
+ return /* @__PURE__ */ jsx54(LanguageSelect, {});
6314
6413
  case "Welcome":
6315
- return /* @__PURE__ */ jsx53(Welcome, {});
6414
+ return /* @__PURE__ */ jsx54(Welcome, {});
6316
6415
  case "Runs":
6317
- return /* @__PURE__ */ jsx53(Runs, {});
6416
+ return /* @__PURE__ */ jsx54(Runs, {});
6318
6417
  case "RunHistory":
6319
- return /* @__PURE__ */ jsx53(RunHistory, {});
6418
+ return /* @__PURE__ */ jsx54(RunHistory, {});
6320
6419
  case "Run":
6321
- return /* @__PURE__ */ jsx53(Run, {});
6420
+ return /* @__PURE__ */ jsx54(Run, {});
6322
6421
  case "RunAgents":
6323
- return /* @__PURE__ */ jsx53(RunAgents, {});
6422
+ return /* @__PURE__ */ jsx54(RunAgents, {});
6324
6423
  case "RunOutput":
6325
- return /* @__PURE__ */ jsx53(RunOutput, {});
6424
+ return /* @__PURE__ */ jsx54(RunOutput, {});
6326
6425
  case "RunStop":
6327
- return /* @__PURE__ */ jsx53(RunStop, {});
6426
+ return /* @__PURE__ */ jsx54(RunStop, {});
6328
6427
  case "AgentDetail":
6329
- return /* @__PURE__ */ jsx53(AgentDetail, {});
6428
+ return /* @__PURE__ */ jsx54(AgentDetail, {});
6330
6429
  case "AgentOutput":
6331
- return /* @__PURE__ */ jsx53(AgentOutput, {});
6430
+ return /* @__PURE__ */ jsx54(AgentOutput, {});
6332
6431
  case "AgentTask":
6333
- return /* @__PURE__ */ jsx53(AgentTask, {});
6432
+ return /* @__PURE__ */ jsx54(AgentTask, {});
6334
6433
  case "AgentKill":
6335
- return /* @__PURE__ */ jsx53(AgentKill, {});
6434
+ return /* @__PURE__ */ jsx54(AgentKill, {});
6336
6435
  case "NewRun":
6337
- return /* @__PURE__ */ jsx53(NewRun, {});
6436
+ return /* @__PURE__ */ jsx54(NewRun, {});
6338
6437
  case "NewRunBasics":
6339
- return /* @__PURE__ */ jsx53(NewRunBasics, {});
6438
+ return /* @__PURE__ */ jsx54(NewRunBasics, {});
6340
6439
  case "NewRunRoot":
6341
- return /* @__PURE__ */ jsx53(NewRunRoot, {});
6440
+ return /* @__PURE__ */ jsx54(NewRunRoot, {});
6342
6441
  case "NewRunWorkers":
6343
- return /* @__PURE__ */ jsx53(NewRunWorkers, {});
6442
+ return /* @__PURE__ */ jsx54(NewRunWorkers, {});
6344
6443
  case "NewRunWorker":
6345
- return /* @__PURE__ */ jsx53(NewRunWorker, {});
6444
+ return /* @__PURE__ */ jsx54(NewRunWorker, {});
6346
6445
  case "NewRunReview":
6347
- return /* @__PURE__ */ jsx53(NewRunReview, {});
6446
+ return /* @__PURE__ */ jsx54(NewRunReview, {});
6348
6447
  case "NewRunStarting":
6349
- return /* @__PURE__ */ jsx53(NewRunStarting, {});
6448
+ return /* @__PURE__ */ jsx54(NewRunStarting, {});
6350
6449
  case "AddWorker":
6351
- return /* @__PURE__ */ jsx53(AddWorker, {});
6450
+ return /* @__PURE__ */ jsx54(AddWorker, {});
6352
6451
  case "Settings":
6353
- return /* @__PURE__ */ jsx53(Settings, {});
6452
+ return /* @__PURE__ */ jsx54(Settings, {});
6453
+ case "Setup":
6454
+ return /* @__PURE__ */ jsx54(Setup, {});
6354
6455
  case "AgentControl":
6355
- return /* @__PURE__ */ jsx53(AgentControl, {});
6456
+ return /* @__PURE__ */ jsx54(AgentControl, {});
6356
6457
  case "Reference":
6357
- return /* @__PURE__ */ jsx53(Reference, {});
6458
+ return /* @__PURE__ */ jsx54(Reference, {});
6358
6459
  case "Credits":
6359
- return /* @__PURE__ */ jsx53(Credits, {});
6460
+ return /* @__PURE__ */ jsx54(Credits, {});
6360
6461
  case "Doctor":
6361
- return /* @__PURE__ */ jsx53(Doctor, {});
6462
+ return /* @__PURE__ */ jsx54(Doctor, {});
6362
6463
  case "DoctorCheck":
6363
- return /* @__PURE__ */ jsx53(DoctorCheck, {});
6464
+ return /* @__PURE__ */ jsx54(DoctorCheck, {});
6364
6465
  case "Approvals":
6365
- return /* @__PURE__ */ jsx53(Approvals, {});
6466
+ return /* @__PURE__ */ jsx54(Approvals, {});
6366
6467
  case "Config":
6367
- return /* @__PURE__ */ jsx53(Config, {});
6468
+ return /* @__PURE__ */ jsx54(Config, {});
6368
6469
  case "Presets":
6369
- return /* @__PURE__ */ jsx53(Presets, {});
6470
+ return /* @__PURE__ */ jsx54(Presets, {});
6370
6471
  default:
6371
- return /* @__PURE__ */ jsx53(Runs, {});
6472
+ return /* @__PURE__ */ jsx54(Runs, {});
6372
6473
  }
6373
6474
  }
6374
6475
  function nextHistoryOnPush(prev, screen) {
@@ -6391,12 +6492,12 @@ function Router({ initialScreen } = {}) {
6391
6492
  const { exit } = useApp3();
6392
6493
  const envRunId = process.env.REEVES_RUN_ID ?? null;
6393
6494
  const openTokenRef = useRef4(readTuiOpenToken());
6394
- const [selectedRunId, setSelectedRunId] = useState36(envRunId);
6395
- const [selectedAgentId, setSelectedAgentId] = useState36(null);
6396
- const [selectedCheckName, setSelectedCheckName] = useState36(null);
6397
- const [selectedWorkerIdx, setSelectedWorkerIdx] = useState36(null);
6495
+ const [selectedRunId, setSelectedRunId] = useState37(envRunId);
6496
+ const [selectedAgentId, setSelectedAgentId] = useState37(null);
6497
+ const [selectedCheckName, setSelectedCheckName] = useState37(null);
6498
+ const [selectedWorkerIdx, setSelectedWorkerIdx] = useState37(null);
6398
6499
  const firstRunNeedsLanguage = !initialScreen && !configExists();
6399
- const [history, setHistory] = useState36(() => ({
6500
+ const [history, setHistory] = useState37(() => ({
6400
6501
  entries: [initialScreen ? normalizeScreen(initialScreen) : firstRunNeedsLanguage ? "LanguageSelect" : "Welcome"],
6401
6502
  index: 0
6402
6503
  }));
@@ -6439,7 +6540,7 @@ function Router({ initialScreen } = {}) {
6439
6540
  const current = normalizeScreen(history.entries[history.index] ?? "Runs");
6440
6541
  const canBack = history.index > 0;
6441
6542
  const canForward = history.index < history.entries.length - 1;
6442
- return /* @__PURE__ */ jsx53(RouterContext.Provider, { value: {
6543
+ return /* @__PURE__ */ jsx54(RouterContext.Provider, { value: {
6443
6544
  screen: current,
6444
6545
  push,
6445
6546
  pop,
@@ -6456,7 +6557,7 @@ function Router({ initialScreen } = {}) {
6456
6557
  setSelectedWorkerIdx,
6457
6558
  canBack,
6458
6559
  canForward
6459
- }, children: /* @__PURE__ */ jsx53(LanguageProvider, { children: /* @__PURE__ */ jsx53(WizardProvider, { children: /* @__PURE__ */ jsx53(WorkerDraftProvider, { children: /* @__PURE__ */ jsx53(ToastProvider, { children: /* @__PURE__ */ jsx53(ErrorBoundary, { children: renderScreen(current) }) }) }) }) }) });
6560
+ }, children: /* @__PURE__ */ jsx54(LanguageProvider, { children: /* @__PURE__ */ jsx54(WizardProvider, { children: /* @__PURE__ */ jsx54(WorkerDraftProvider, { children: /* @__PURE__ */ jsx54(ToastProvider, { children: /* @__PURE__ */ jsx54(ErrorBoundary, { children: renderScreen(current) }) }) }) }) }) });
6460
6561
  }
6461
6562
  export {
6462
6563
  Router,
@@ -6465,4 +6566,4 @@ export {
6465
6566
  nextHistoryOnReset,
6466
6567
  useRouter
6467
6568
  };
6468
- //# sourceMappingURL=router-MGXDADKM.js.map
6569
+ //# sourceMappingURL=router-7MRY24Y5.js.map