reevesagents 1.2.0 → 1.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,25 +1,26 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
- REEVESAGENTS_VERSION,
4
3
  readTuiOpenToken
5
- } from "./chunk-DHAW6OY3.js";
6
- import {
7
- ErrorBoundary,
8
- presetsDir
9
- } from "./chunk-3IXII4H5.js";
10
- import {
11
- runDoctor
12
- } from "./chunk-JY4ZTTRK.js";
13
- import "./chunk-D24DQQ6V.js";
4
+ } from "./chunk-4W6MVOPK.js";
14
5
  import {
15
6
  translate,
16
7
  translatePhrase
17
- } from "./chunk-G6FN75ZW.js";
8
+ } from "./chunk-YMUISYYB.js";
18
9
  import {
19
10
  modelDisplayName,
20
11
  modelValuesForProvider
21
- } from "./chunk-LUW6GCPO.js";
12
+ } from "./chunk-HS6TOISU.js";
22
13
  import {
14
+ REEVESAGENTS_VERSION,
15
+ attach,
16
+ attachAll,
17
+ detach,
18
+ hostStatus,
19
+ listRunApprovals,
20
+ resolveRunApproval
21
+ } from "./chunk-Z2JHNE7V.js";
22
+ import {
23
+ CONFIG_FIELDS,
23
24
  DEFAULT_LANGUAGE,
24
25
  LANGUAGE_OPTIONS,
25
26
  PROVIDERS,
@@ -30,12 +31,14 @@ import {
30
31
  configExists,
31
32
  configPath,
32
33
  deleteAgent,
34
+ deletePreset,
33
35
  deleteRunHistory,
34
36
  detectAvailable,
35
37
  findAgent,
36
38
  killAgent,
37
39
  languageOption,
38
40
  listAgents,
41
+ listPresets,
39
42
  listRunHistory,
40
43
  listRuns,
41
44
  loadConfig,
@@ -44,29 +47,36 @@ import {
44
47
  openAgent,
45
48
  openReeves,
46
49
  openRunTabs,
50
+ parseConfigValue,
47
51
  peekAgent,
52
+ presetsDir,
48
53
  providerColor,
49
54
  providerDisplayName,
50
55
  readRun,
56
+ runDoctor,
51
57
  runHasLiveTmuxTarget,
52
58
  runsDir,
53
59
  saveConfig,
60
+ savePresetFromRun,
54
61
  sep,
62
+ setConfigValues,
55
63
  space,
56
64
  spawnWorker,
57
65
  startRun,
66
+ startRunFromPreset,
58
67
  stateRoot,
59
68
  stopRun
60
- } from "./chunk-MVMGFG4W.js";
69
+ } from "./chunk-65LHCGPC.js";
70
+ import "./chunk-D24DQQ6V.js";
61
71
  import {
62
72
  startWebFromTui
63
- } from "./chunk-4Q3JF22J.js";
73
+ } from "./chunk-2LC6V55H.js";
64
74
 
65
- // src/router.tsx
66
- import { createContext as createContext6, useContext as useContext6, useState as useState32, useCallback as useCallback5, useEffect as useEffect15, useRef as useRef4 } from "react";
75
+ // src/tui/router.tsx
76
+ import { createContext as createContext6, useContext as useContext6, useState as useState36, useCallback as useCallback5, useEffect as useEffect17, useRef as useRef4 } from "react";
67
77
  import { useApp as useApp3 } from "ink";
68
78
 
69
- // src/state/ToastContext.tsx
79
+ // src/tui/contexts/ToastContext.tsx
70
80
  import { createContext, useCallback, useContext, useEffect, useRef, useState } from "react";
71
81
  import { jsx } from "react/jsx-runtime";
72
82
  var ToastContext = createContext(null);
@@ -101,7 +111,7 @@ function severityColor(s) {
101
111
  return colors.accent.bright;
102
112
  }
103
113
 
104
- // src/state/WizardContext.tsx
114
+ // src/tui/contexts/WizardContext.tsx
105
115
  import { createContext as createContext2, useContext as useContext2, useState as useState2, useCallback as useCallback2 } from "react";
106
116
  import { jsx as jsx2 } from "react/jsx-runtime";
107
117
  var WizardContext = createContext2(null);
@@ -116,7 +126,6 @@ var INITIAL_WORKER = {
116
126
  effort: "default"
117
127
  };
118
128
  var INITIAL_STATE = {
119
- mode: "spawner",
120
129
  presetName: null,
121
130
  name: "",
122
131
  workingDir: process.cwd(),
@@ -175,7 +184,7 @@ function WizardProvider({ children }) {
175
184
  }, children });
176
185
  }
177
186
 
178
- // src/state/WorkerDraftContext.tsx
187
+ // src/tui/contexts/WorkerDraftContext.tsx
179
188
  import { createContext as createContext3, useContext as useContext3, useState as useState3, useCallback as useCallback3 } from "react";
180
189
  import { jsx as jsx3 } from "react/jsx-runtime";
181
190
  var WorkerDraftContext = createContext3(null);
@@ -185,7 +194,9 @@ var INITIAL_DRAFT = {
185
194
  model: "",
186
195
  prompt: "",
187
196
  workingDir: process.cwd(),
188
- permissions: "ask"
197
+ permissions: "ask",
198
+ authMode: "default",
199
+ effort: "default"
189
200
  };
190
201
  function useWorkerDraft() {
191
202
  const ctx = useContext3(WorkerDraftContext);
@@ -203,7 +214,7 @@ function WorkerDraftProvider({ children }) {
203
214
  return /* @__PURE__ */ jsx3(WorkerDraftContext.Provider, { value: { draft, update, reset }, children });
204
215
  }
205
216
 
206
- // src/state/LanguageContext.tsx
217
+ // src/tui/contexts/LanguageContext.tsx
207
218
  import { createContext as createContext4, useCallback as useCallback4, useContext as useContext4, useState as useState4 } from "react";
208
219
  import { jsx as jsx4 } from "react/jsx-runtime";
209
220
  var LanguageContext = createContext4(null);
@@ -238,16 +249,44 @@ function tuiLanguageLabel(code) {
238
249
  return `${option.flag} ${option.nativeName}`;
239
250
  }
240
251
 
241
- // src/screens/LanguageSelect.tsx
252
+ // src/tui/components/ErrorBoundary.tsx
253
+ import { Component } from "react";
254
+ import { Box, Text } from "ink";
255
+ import { jsx as jsx5, jsxs } from "react/jsx-runtime";
256
+ var ErrorBoundary = class extends Component {
257
+ constructor(props) {
258
+ super(props);
259
+ this.state = { hasError: false, error: null };
260
+ }
261
+ static getDerivedStateFromError(error) {
262
+ return { hasError: true, error };
263
+ }
264
+ componentDidCatch(error) {
265
+ process.stderr.write(`[ERROR] ${error.message}
266
+ `);
267
+ }
268
+ render() {
269
+ if (this.state.hasError && this.state.error) {
270
+ return /* @__PURE__ */ jsxs(Box, { flexDirection: "column", paddingX: 1, children: [
271
+ /* @__PURE__ */ jsx5(Box, { marginBottom: 1, children: /* @__PURE__ */ jsx5(Text, { color: colors.status.error, bold: true, children: "ERROR" }) }),
272
+ /* @__PURE__ */ jsx5(Text, { color: colors.text.primary, children: this.state.error.message }),
273
+ /* @__PURE__ */ jsx5(Box, { marginTop: 1, children: /* @__PURE__ */ jsx5(Text, { color: colors.text.muted, dimColor: true, children: "press Ctrl-C to quit" }) })
274
+ ] });
275
+ }
276
+ return this.props.children;
277
+ }
278
+ };
279
+
280
+ // src/tui/screens/LanguageSelect.tsx
242
281
  import { useState as useState5 } from "react";
243
- import { Box as Box8, Text as Text8, useInput, useWindowSize as useWindowSize2 } from "ink";
282
+ import { Box as Box9, Text as Text9, useInput, useWindowSize as useWindowSize2 } from "ink";
244
283
 
245
- // src/components/Frame.tsx
284
+ // src/tui/components/Frame.tsx
246
285
  import { useInsertionEffect, useRef as useRef2 } from "react";
247
- import { Box as Box5, Text as Text5, useWindowSize } from "ink";
286
+ import { Box as Box6, Text as Text6, useWindowSize } from "ink";
248
287
 
249
- // src/components/Header.tsx
250
- import { Box, Text } from "ink";
288
+ // src/tui/components/Header.tsx
289
+ import { Box as Box2, Text as Text2 } from "ink";
251
290
 
252
291
  // src/utils/glyphs.ts
253
292
  var glyphs = {
@@ -267,8 +306,18 @@ var glyphs = {
267
306
  }
268
307
  };
269
308
 
270
- // src/components/Header.tsx
271
- import { jsx as jsx5, jsxs } from "react/jsx-runtime";
309
+ // src/utils/width.ts
310
+ import stringWidth from "string-width";
311
+ function displayWidth(text) {
312
+ return stringWidth(text);
313
+ }
314
+ function padEndDisplay(text, targetWidth) {
315
+ const gap = targetWidth - stringWidth(text);
316
+ return gap > 0 ? text + " ".repeat(gap) : text;
317
+ }
318
+
319
+ // src/tui/components/Header.tsx
320
+ import { jsx as jsx6, jsxs as jsxs2 } from "react/jsx-runtime";
272
321
  function Header({ breadcrumb, meta, tmuxSession, columns }) {
273
322
  const width = Math.max(1, columns - 1);
274
323
  const isNarrow = columns < 60;
@@ -277,11 +326,11 @@ function Header({ breadcrumb, meta, tmuxSession, columns }) {
277
326
  metaList = [...metaList, { label: "tmux", value: tmuxSession }];
278
327
  }
279
328
  const metaText = metaList.map(({ label, value }) => `${label} ${value}`).join(sep.dot);
280
- const metaWidth = Math.min(metaText.length, Math.max(0, Math.floor(width * 0.42)));
329
+ const metaWidth = Math.min(displayWidth(metaText), Math.max(0, Math.floor(width * 0.42)));
281
330
  const leftWidth = Math.max(1, width - metaWidth);
282
331
  if (isNarrow) {
283
332
  const current = breadcrumb[breadcrumb.length - 1] || "";
284
- return /* @__PURE__ */ jsx5(Box, { width, height: 1, children: /* @__PURE__ */ jsx5(Text, { color: colors.accent.primary, bold: true, wrap: "truncate-end", children: current }) });
333
+ return /* @__PURE__ */ jsx6(Box2, { width, height: 1, children: /* @__PURE__ */ jsx6(Text2, { color: colors.accent.primary, bold: true, wrap: "truncate-end", children: current }) });
285
334
  }
286
335
  const breadcrumbParts = [];
287
336
  for (let i = 0; i < breadcrumb.length; i++) {
@@ -289,12 +338,12 @@ function Header({ breadcrumb, meta, tmuxSession, columns }) {
289
338
  const isCurrent = i === breadcrumb.length - 1;
290
339
  if (i > 0) {
291
340
  breadcrumbParts.push(
292
- /* @__PURE__ */ jsx5(Text, { color: colors.text.dim, wrap: "truncate-end", children: ` ${glyphs.chevron} ` }, `sep-${i}`)
341
+ /* @__PURE__ */ jsx6(Text2, { color: colors.text.dim, wrap: "truncate-end", children: ` ${glyphs.chevron} ` }, `sep-${i}`)
293
342
  );
294
343
  }
295
344
  breadcrumbParts.push(
296
- /* @__PURE__ */ jsx5(
297
- Text,
345
+ /* @__PURE__ */ jsx6(
346
+ Text2,
298
347
  {
299
348
  color: isCurrent ? colors.accent.primary : colors.text.dim,
300
349
  bold: isCurrent,
@@ -305,15 +354,15 @@ function Header({ breadcrumb, meta, tmuxSession, columns }) {
305
354
  )
306
355
  );
307
356
  }
308
- return /* @__PURE__ */ jsxs(Box, { width, height: 1, flexDirection: "row", children: [
309
- /* @__PURE__ */ jsx5(Box, { width: leftWidth, height: 1, flexShrink: 0, flexDirection: "row", children: breadcrumbParts }),
310
- metaWidth > 0 && /* @__PURE__ */ jsx5(Box, { width: metaWidth, height: 1, flexShrink: 0, children: /* @__PURE__ */ jsx5(Text, { color: colors.text.dim, wrap: "truncate-end", children: metaText }) })
357
+ return /* @__PURE__ */ jsxs2(Box2, { width, height: 1, flexDirection: "row", children: [
358
+ /* @__PURE__ */ jsx6(Box2, { width: leftWidth, height: 1, flexShrink: 0, flexDirection: "row", children: breadcrumbParts }),
359
+ metaWidth > 0 && /* @__PURE__ */ jsx6(Box2, { width: metaWidth, height: 1, flexShrink: 0, children: /* @__PURE__ */ jsx6(Text2, { color: colors.text.dim, wrap: "truncate-end", children: metaText }) })
311
360
  ] });
312
361
  }
313
362
 
314
- // src/components/Tagline.tsx
315
- import { Box as Box2, Text as Text2 } from "ink";
316
- import { jsx as jsx6, jsxs as jsxs2 } from "react/jsx-runtime";
363
+ // src/tui/components/Tagline.tsx
364
+ import { Box as Box3, Text as Text3 } from "ink";
365
+ import { jsx as jsx7, jsxs as jsxs3 } from "react/jsx-runtime";
317
366
  function Tagline({ text, rows, cols }) {
318
367
  const isTight = rows < 22;
319
368
  const height = isTight ? 1 : 2;
@@ -324,16 +373,16 @@ function Tagline({ text, rows, cols }) {
324
373
  displayText = sentences[0] + ".";
325
374
  }
326
375
  }
327
- return /* @__PURE__ */ jsxs2(Box2, { flexDirection: "column", width: cols, height, paddingX: space.sm, children: [
328
- /* @__PURE__ */ jsx6(Text2, { color: colors.text.dim, wrap: "truncate-end", children: displayText }),
329
- !isTight && /* @__PURE__ */ jsx6(Text2, { children: " " })
376
+ return /* @__PURE__ */ jsxs3(Box3, { flexDirection: "column", width: cols, height, paddingX: space.sm, children: [
377
+ /* @__PURE__ */ jsx7(Text3, { color: colors.text.dim, wrap: "truncate-end", children: displayText }),
378
+ !isTight && /* @__PURE__ */ jsx7(Text3, { children: " " })
330
379
  ] });
331
380
  }
332
381
 
333
- // src/components/Detail.tsx
334
- import { Box as Box3, Text as Text3 } from "ink";
382
+ // src/tui/components/Detail.tsx
383
+ import { Box as Box4, Text as Text4 } from "ink";
335
384
 
336
- // src/components/borderStyles.ts
385
+ // src/tui/components/borderStyles.ts
337
386
  var DASHED_BORDER = {
338
387
  topLeft: "\u250C",
339
388
  top: "\u2504",
@@ -345,18 +394,18 @@ var DASHED_BORDER = {
345
394
  bottomRight: "\u2518"
346
395
  };
347
396
 
348
- // src/components/Detail.tsx
349
- import { jsx as jsx7, jsxs as jsxs3 } from "react/jsx-runtime";
397
+ // src/tui/components/Detail.tsx
398
+ import { jsx as jsx8, jsxs as jsxs4 } from "react/jsx-runtime";
350
399
  function Detail({ title, children }) {
351
- return /* @__PURE__ */ jsxs3(Box3, { flexDirection: "column", marginLeft: space.sm, borderStyle: DASHED_BORDER, borderColor: colors.accent.deep, paddingX: space.sm, paddingY: space.sm, children: [
352
- title && /* @__PURE__ */ jsx7(Box3, { marginBottom: space.sm, children: /* @__PURE__ */ jsx7(Text3, { color: colors.accent.primary, bold: true, children: title }) }),
353
- /* @__PURE__ */ jsx7(Box3, { flexDirection: "column", children })
400
+ return /* @__PURE__ */ jsxs4(Box4, { flexDirection: "column", marginLeft: space.sm, borderStyle: DASHED_BORDER, borderColor: colors.accent.deep, paddingX: space.sm, paddingY: space.sm, children: [
401
+ title && /* @__PURE__ */ jsx8(Box4, { marginBottom: space.sm, children: /* @__PURE__ */ jsx8(Text4, { color: colors.accent.primary, bold: true, children: title }) }),
402
+ /* @__PURE__ */ jsx8(Box4, { flexDirection: "column", children })
354
403
  ] });
355
404
  }
356
405
 
357
- // src/components/StatusBar.tsx
358
- import { Box as Box4, Text as Text4 } from "ink";
359
- import { jsx as jsx8, jsxs as jsxs4 } from "react/jsx-runtime";
406
+ // src/tui/components/StatusBar.tsx
407
+ import { Box as Box5, Text as Text5 } from "ink";
408
+ import { jsx as jsx9, jsxs as jsxs5 } from "react/jsx-runtime";
360
409
  function StatusBar({ context = "", keys, rows, cols }) {
361
410
  const { current: toast } = useToast();
362
411
  let line1Text = context;
@@ -373,18 +422,18 @@ function StatusBar({ context = "", keys, rows, cols }) {
373
422
  const compactToast = Boolean(toast) && !showKeysOnSecondLine;
374
423
  const firstLineText = showKeysOnSecondLine || compactToast ? hasContextLine ? line1Text : line2Text : line2Text;
375
424
  const firstLineColor = showKeysOnSecondLine || compactToast ? hasContextLine ? line1Color : colors.text.muted : colors.text.muted;
376
- return /* @__PURE__ */ jsxs4(Box4, { flexDirection: "column", width: cols, height, children: [
377
- /* @__PURE__ */ jsx8(Text4, { color: firstLineColor, wrap: "truncate-end", children: firstLineText }),
378
- showKeysOnSecondLine && /* @__PURE__ */ jsx8(Text4, { color: colors.text.muted, wrap: "truncate-end", children: line2Text })
425
+ return /* @__PURE__ */ jsxs5(Box5, { flexDirection: "column", width: cols, height, children: [
426
+ /* @__PURE__ */ jsx9(Text5, { color: firstLineColor, wrap: "truncate-end", children: firstLineText }),
427
+ showKeysOnSecondLine && /* @__PURE__ */ jsx9(Text5, { color: colors.text.muted, wrap: "truncate-end", children: line2Text })
379
428
  ] });
380
429
  }
381
430
 
382
- // src/components/LayoutContext.tsx
431
+ // src/tui/components/LayoutContext.tsx
383
432
  import { createContext as createContext5, useContext as useContext5 } from "react";
384
- import { jsx as jsx9 } from "react/jsx-runtime";
433
+ import { jsx as jsx10 } from "react/jsx-runtime";
385
434
  var LayoutContext = createContext5({});
386
435
  function LayoutProvider({ columns, rows, children }) {
387
- return /* @__PURE__ */ jsx9(LayoutContext.Provider, { value: { columns, rows }, children });
436
+ return /* @__PURE__ */ jsx10(LayoutContext.Provider, { value: { columns, rows }, children });
388
437
  }
389
438
  function useLayoutColumns() {
390
439
  return useContext5(LayoutContext).columns ?? process.stdout.columns ?? 100;
@@ -393,22 +442,22 @@ function panelWidth(columns) {
393
442
  return Math.max(1, columns);
394
443
  }
395
444
 
396
- // src/components/Frame.tsx
397
- import { jsx as jsx10, jsxs as jsxs5 } from "react/jsx-runtime";
445
+ // src/tui/components/Frame.tsx
446
+ import { jsx as jsx11, jsxs as jsxs6 } from "react/jsx-runtime";
398
447
  var FLOOR_COLS = 40;
399
448
  var FLOOR_ROWS = 12;
400
449
  var DETAIL_BREAKPOINT = 90;
401
450
  var CLEAR_TERMINAL = "\x1B[3J\x1B[2J\x1B[H";
402
451
  function ResizeMessage({ cols, rows }) {
403
- return /* @__PURE__ */ jsxs5(Box5, { flexDirection: "column", alignItems: "center", justifyContent: "center", width: cols, height: rows, children: [
404
- /* @__PURE__ */ jsxs5(Text5, { color: colors.text.dim, wrap: "truncate-end", children: [
452
+ return /* @__PURE__ */ jsxs6(Box6, { flexDirection: "column", alignItems: "center", justifyContent: "center", width: cols, height: rows, children: [
453
+ /* @__PURE__ */ jsxs6(Text6, { color: colors.text.dim, wrap: "truncate-end", children: [
405
454
  "ReevesAgents needs at least ",
406
455
  FLOOR_COLS,
407
456
  "x",
408
457
  FLOOR_ROWS,
409
458
  "."
410
459
  ] }),
411
- /* @__PURE__ */ jsxs5(Text5, { color: colors.text.dim, wrap: "truncate-end", children: [
460
+ /* @__PURE__ */ jsxs6(Text6, { color: colors.text.dim, wrap: "truncate-end", children: [
412
461
  "Current: ",
413
462
  cols,
414
463
  "x",
@@ -418,7 +467,7 @@ function ResizeMessage({ cols, rows }) {
418
467
  ] });
419
468
  }
420
469
  function Rule({ cols }) {
421
- return /* @__PURE__ */ jsx10(Text5, { color: colors.surface.quiet, wrap: "truncate-end", children: "\u2504".repeat(Math.max(1, cols - 1)) });
470
+ return /* @__PURE__ */ jsx11(Text6, { color: colors.surface.quiet, wrap: "truncate-end", children: "\u2504".repeat(Math.max(1, cols - 1)) });
422
471
  }
423
472
  function frameBodyRows(rows, hasTagline, hasStatusContext) {
424
473
  const innerRows = Math.max(1, rows - 2);
@@ -457,7 +506,7 @@ function Frame({
457
506
  const bodyPadding = space.sm;
458
507
  useResizeClear(cols, rows, tooSmall);
459
508
  if (tooSmall) {
460
- return /* @__PURE__ */ jsx10(ResizeMessage, { cols, rows });
509
+ return /* @__PURE__ */ jsx11(ResizeMessage, { cols, rows });
461
510
  }
462
511
  const showDetail = detail !== void 0 && innerCols >= DETAIL_BREAKPOINT;
463
512
  const bodyColumns = Math.max(1, innerCols - bodyPadding * 2 - (showDetail ? 36 : 0));
@@ -472,8 +521,8 @@ function Frame({
472
521
  const displayStatusContext = statusContext ? translatePhrase(language, statusContext) : statusContext;
473
522
  const displayStatusKeys = statusKeys ? translatePhrase(language, statusKeys) : statusKeys;
474
523
  const bodyRows = frameBodyRows(rows, Boolean(displayTagline), Boolean(displayStatusContext));
475
- return /* @__PURE__ */ jsxs5(Box5, { flexDirection: "column", width: cols, borderStyle: "single", borderColor: colors.surface.border, children: [
476
- /* @__PURE__ */ jsx10(
524
+ return /* @__PURE__ */ jsxs6(Box6, { flexDirection: "column", width: cols, borderStyle: "single", borderColor: colors.surface.border, children: [
525
+ /* @__PURE__ */ jsx11(
477
526
  Header,
478
527
  {
479
528
  breadcrumb: displayBreadcrumb,
@@ -482,21 +531,21 @@ function Frame({
482
531
  columns: innerCols
483
532
  }
484
533
  ),
485
- /* @__PURE__ */ jsx10(Rule, { cols: innerCols }),
486
- displayTagline ? /* @__PURE__ */ jsx10(Tagline, { text: displayTagline, rows: innerRows, cols: innerCols }) : null,
487
- /* @__PURE__ */ jsxs5(Box5, { flexDirection: "row", maxHeight: bodyRows, overflow: "hidden", children: [
488
- /* @__PURE__ */ jsx10(LayoutProvider, { columns: bodyColumns, rows: bodyRows, children: /* @__PURE__ */ jsx10(Box5, { flexDirection: "column", flexGrow: 1, maxHeight: bodyRows, paddingX: bodyPadding, overflow: "hidden", children }) }),
489
- showDetail ? /* @__PURE__ */ jsx10(Box5, { width: 36, flexShrink: 0, overflow: "hidden", children: /* @__PURE__ */ jsx10(Detail, { title: displayDetailTitle, children: detail }) }) : null
534
+ /* @__PURE__ */ jsx11(Rule, { cols: innerCols }),
535
+ displayTagline ? /* @__PURE__ */ jsx11(Tagline, { text: displayTagline, rows: innerRows, cols: innerCols }) : null,
536
+ /* @__PURE__ */ jsxs6(Box6, { flexDirection: "row", maxHeight: bodyRows, overflow: "hidden", children: [
537
+ /* @__PURE__ */ jsx11(LayoutProvider, { columns: bodyColumns, rows: bodyRows, children: /* @__PURE__ */ jsx11(Box6, { flexDirection: "column", flexGrow: 1, maxHeight: bodyRows, paddingX: bodyPadding, overflow: "hidden", children }) }),
538
+ showDetail ? /* @__PURE__ */ jsx11(Box6, { width: 36, flexShrink: 0, overflow: "hidden", children: /* @__PURE__ */ jsx11(Detail, { title: displayDetailTitle, children: detail }) }) : null
490
539
  ] }),
491
- /* @__PURE__ */ jsx10(Rule, { cols: innerCols }),
492
- /* @__PURE__ */ jsx10(StatusBar, { context: displayStatusContext, keys: displayStatusKeys, rows: innerRows, cols: innerCols })
540
+ /* @__PURE__ */ jsx11(Rule, { cols: innerCols }),
541
+ /* @__PURE__ */ jsx11(StatusBar, { context: displayStatusContext, keys: displayStatusKeys, rows: innerRows, cols: innerCols })
493
542
  ] });
494
543
  }
495
544
 
496
- // src/components/Row.tsx
497
- import React7 from "react";
498
- import { Box as Box6, Text as Text6 } from "ink";
499
- import { Fragment, jsx as jsx11, jsxs as jsxs6 } from "react/jsx-runtime";
545
+ // src/tui/components/Row.tsx
546
+ import React8 from "react";
547
+ import { Box as Box7, Text as Text7 } from "ink";
548
+ import { Fragment, jsx as jsx12, jsxs as jsxs7 } from "react/jsx-runtime";
500
549
  function truncateBadgeLabel(label, compact) {
501
550
  const max = compact ? 14 : 24;
502
551
  if (label.length <= max) return label;
@@ -534,8 +583,8 @@ function Row({
534
583
  const displayPrimary = translatePhrase(language, primary);
535
584
  const displayHint = hint ? translatePhrase(language, hint) : hint;
536
585
  const displayTrailing = trailing ? translatePhrase(language, trailing) : trailing;
537
- const buttonPrimaryWidth = buttonLike ? Math.max(primaryWidth ?? 0, displayPrimary.length, 12) : primaryWidth;
538
- const primaryText = buttonPrimaryWidth ? displayPrimary.padEnd(buttonPrimaryWidth) : displayPrimary;
586
+ const buttonPrimaryWidth = buttonLike ? Math.max(primaryWidth ?? 0, displayWidth(displayPrimary), 12) : primaryWidth;
587
+ const primaryText = buttonPrimaryWidth ? padEndDisplay(displayPrimary, buttonPrimaryWidth) : displayPrimary;
539
588
  const railColor = selected ? colors.accent.deep : colors.surface.border;
540
589
  const availableWidth = Math.max(1, width - 6);
541
590
  const canFitTrailing = availableWidth >= 24;
@@ -544,11 +593,11 @@ function Row({
544
593
  const mainWidth = showTrailing ? Math.max(1, availableWidth - trailingWidth) : void 0;
545
594
  const trailingSeparatorWidth = 3;
546
595
  const trailingTextWidth = Math.max(1, trailingWidth - trailingSeparatorWidth);
547
- return /* @__PURE__ */ jsxs6(Box6, { flexDirection: "row", width, children: [
548
- /* @__PURE__ */ jsx11(Box6, { width: 1, flexShrink: 0, children: /* @__PURE__ */ jsx11(Text6, { color: cursorColor, children: cursorChar }) }),
549
- /* @__PURE__ */ jsx11(Box6, { width: 2, flexShrink: 0, children: /* @__PURE__ */ jsx11(Text6, { color: railColor, children: " \u2502" }) }),
550
- /* @__PURE__ */ jsxs6(
551
- Box6,
596
+ return /* @__PURE__ */ jsxs7(Box7, { flexDirection: "row", width, children: [
597
+ /* @__PURE__ */ jsx12(Box7, { width: 1, flexShrink: 0, children: /* @__PURE__ */ jsx12(Text7, { color: cursorColor, children: cursorChar }) }),
598
+ /* @__PURE__ */ jsx12(Box7, { width: 2, flexShrink: 0, children: /* @__PURE__ */ jsx12(Text7, { color: railColor, children: " \u2502" }) }),
599
+ /* @__PURE__ */ jsxs7(
600
+ Box7,
552
601
  {
553
602
  marginLeft: space.sm,
554
603
  flexDirection: "row",
@@ -556,22 +605,22 @@ function Row({
556
605
  flexGrow: showTrailing ? 0 : 1,
557
606
  flexShrink: 1,
558
607
  children: [
559
- glyph && /* @__PURE__ */ jsx11(Text6, { color: glyph.color, children: glyph.char }),
560
- glyph && /* @__PURE__ */ jsx11(Text6, { children: " " }),
608
+ glyph && /* @__PURE__ */ jsx12(Text7, { color: glyph.color, children: glyph.char }),
609
+ glyph && /* @__PURE__ */ jsx12(Text7, { children: " " }),
561
610
  inlineBadges.map((item, idx) => {
562
- const label = truncateBadgeLabel(item.label, compact);
611
+ const label = truncateBadgeLabel(translatePhrase(language, item.label), compact);
563
612
  const displayLabel = item.width && !compact ? label.padEnd(item.width) : label;
564
- return /* @__PURE__ */ jsxs6(React7.Fragment, { children: [
565
- /* @__PURE__ */ jsx11(Text6, { color: badgeBracketColor, children: "[" }),
566
- /* @__PURE__ */ jsx11(Text6, { color: item.color, children: displayLabel }),
567
- /* @__PURE__ */ jsx11(Text6, { color: badgeBracketColor, children: "]" }),
568
- /* @__PURE__ */ jsx11(Text6, { children: " " })
613
+ return /* @__PURE__ */ jsxs7(React8.Fragment, { children: [
614
+ /* @__PURE__ */ jsx12(Text7, { color: badgeBracketColor, children: "[" }),
615
+ /* @__PURE__ */ jsx12(Text7, { color: item.color, children: displayLabel }),
616
+ /* @__PURE__ */ jsx12(Text7, { color: badgeBracketColor, children: "]" }),
617
+ /* @__PURE__ */ jsx12(Text7, { children: " " })
569
618
  ] }, `${item.label}-${idx}`);
570
619
  }),
571
- buttonLike ? /* @__PURE__ */ jsxs6(Fragment, { children: [
572
- /* @__PURE__ */ jsx11(Text6, { color: buttonBorderColor, backgroundColor: buttonBg, children: "[ " }),
573
- /* @__PURE__ */ jsx11(
574
- Text6,
620
+ buttonLike ? /* @__PURE__ */ jsxs7(Fragment, { children: [
621
+ /* @__PURE__ */ jsx12(Text7, { color: buttonBorderColor, backgroundColor: buttonBg, children: "[ " }),
622
+ /* @__PURE__ */ jsx12(
623
+ Text7,
575
624
  {
576
625
  color: primaryColor,
577
626
  backgroundColor: buttonBg,
@@ -581,9 +630,9 @@ function Row({
581
630
  children: primaryText
582
631
  }
583
632
  ),
584
- /* @__PURE__ */ jsx11(Text6, { color: buttonBorderColor, backgroundColor: buttonBg, children: " ]" })
585
- ] }) : /* @__PURE__ */ jsx11(
586
- Text6,
633
+ /* @__PURE__ */ jsx12(Text7, { color: buttonBorderColor, backgroundColor: buttonBg, children: " ]" })
634
+ ] }) : /* @__PURE__ */ jsx12(
635
+ Text7,
587
636
  {
588
637
  color: primaryColor,
589
638
  bold: textBold,
@@ -592,37 +641,37 @@ function Row({
592
641
  children: displayPrimary
593
642
  }
594
643
  ),
595
- showHint && displayHint && /* @__PURE__ */ jsxs6(Fragment, { children: [
596
- /* @__PURE__ */ jsx11(Text6, { color: separatorColor, children: " \u2502" }),
597
- /* @__PURE__ */ jsx11(Box6, { marginLeft: space.sm, flexShrink: 1, children: /* @__PURE__ */ jsx11(Text6, { color: hintColor, wrap: "truncate-end", children: displayHint }) })
644
+ showHint && displayHint && /* @__PURE__ */ jsxs7(Fragment, { children: [
645
+ /* @__PURE__ */ jsx12(Text7, { color: separatorColor, children: " \u2502" }),
646
+ /* @__PURE__ */ jsx12(Box7, { marginLeft: space.sm, flexShrink: 1, children: /* @__PURE__ */ jsx12(Text7, { color: hintColor, wrap: "truncate-end", children: displayHint }) })
598
647
  ] })
599
648
  ]
600
649
  }
601
650
  ),
602
- showTrailing && /* @__PURE__ */ jsxs6(Box6, { flexDirection: "row", width: trailingWidth, flexShrink: 0, children: [
603
- /* @__PURE__ */ jsx11(Box6, { width: trailingSeparatorWidth, flexShrink: 0, children: /* @__PURE__ */ jsx11(Text6, { color: separatorColor, children: " \u2502 " }) }),
604
- /* @__PURE__ */ jsx11(Box6, { width: trailingTextWidth, flexShrink: 0, children: /* @__PURE__ */ jsx11(Text6, { color: colors.text.muted, wrap: "truncate-end", children: displayTrailing }) })
651
+ showTrailing && /* @__PURE__ */ jsxs7(Box7, { flexDirection: "row", width: trailingWidth, flexShrink: 0, children: [
652
+ /* @__PURE__ */ jsx12(Box7, { width: trailingSeparatorWidth, flexShrink: 0, children: /* @__PURE__ */ jsx12(Text7, { color: separatorColor, children: " \u2502 " }) }),
653
+ /* @__PURE__ */ jsx12(Box7, { width: trailingTextWidth, flexShrink: 0, children: /* @__PURE__ */ jsx12(Text7, { color: colors.text.muted, wrap: "truncate-end", children: displayTrailing }) })
605
654
  ] }),
606
- /* @__PURE__ */ jsx11(Box6, { width: 2, flexShrink: 0, children: /* @__PURE__ */ jsx11(Text6, { color: railColor, children: " \u2502" }) })
655
+ /* @__PURE__ */ jsx12(Box7, { width: 2, flexShrink: 0, children: /* @__PURE__ */ jsx12(Text7, { color: railColor, children: " \u2502" }) })
607
656
  ] });
608
657
  }
609
658
 
610
- // src/components/Section.tsx
611
- import { Box as Box7, Text as Text7 } from "ink";
612
- import { Fragment as Fragment2, jsx as jsx12, jsxs as jsxs7 } from "react/jsx-runtime";
659
+ // src/tui/components/Section.tsx
660
+ import { Box as Box8, Text as Text8 } from "ink";
661
+ import { Fragment as Fragment2, jsx as jsx13, jsxs as jsxs8 } from "react/jsx-runtime";
613
662
  function Section({ label }) {
614
663
  const { language } = useLanguage();
615
664
  const columns = useLayoutColumns();
616
665
  const displayLabel = translatePhrase(language, label);
617
- const labelTextWidth = displayLabel ? displayLabel.length + 2 : 0;
666
+ const labelTextWidth = displayLabel ? displayWidth(displayLabel) + 2 : 0;
618
667
  const width = Math.max(labelTextWidth + 7, panelWidth(columns));
619
668
  const suffix = "\u2500".repeat(Math.max(2, width - labelTextWidth - 5));
620
- return /* @__PURE__ */ jsx12(Box7, { children: /* @__PURE__ */ jsxs7(Text7, { color: colors.surface.border, wrap: "truncate-end", children: [
669
+ return /* @__PURE__ */ jsx13(Box8, { children: /* @__PURE__ */ jsxs8(Text8, { color: colors.surface.border, wrap: "truncate-end", children: [
621
670
  " ",
622
671
  "\u256D\u2500",
623
- displayLabel ? /* @__PURE__ */ jsxs7(Fragment2, { children: [
672
+ displayLabel ? /* @__PURE__ */ jsxs8(Fragment2, { children: [
624
673
  " ",
625
- /* @__PURE__ */ jsx12(Text7, { color: colors.accent.primary, bold: true, children: displayLabel }),
674
+ /* @__PURE__ */ jsx13(Text8, { color: colors.accent.primary, bold: true, children: displayLabel }),
626
675
  " "
627
676
  ] }) : null,
628
677
  suffix,
@@ -633,7 +682,7 @@ function SectionEnd() {
633
682
  const columns = useLayoutColumns();
634
683
  const width = Math.max(4, panelWidth(columns));
635
684
  const suffix = "\u2500".repeat(Math.max(0, width - 4));
636
- return /* @__PURE__ */ jsx12(Box7, { children: /* @__PURE__ */ jsxs7(Text7, { color: colors.surface.border, wrap: "truncate-end", children: [
685
+ return /* @__PURE__ */ jsx13(Box8, { children: /* @__PURE__ */ jsxs8(Text8, { color: colors.surface.border, wrap: "truncate-end", children: [
637
686
  " ",
638
687
  "\u2570",
639
688
  suffix,
@@ -641,8 +690,8 @@ function SectionEnd() {
641
690
  ] }) });
642
691
  }
643
692
 
644
- // src/screens/LanguageSelect.tsx
645
- import { Fragment as Fragment3, jsx as jsx13, jsxs as jsxs8 } from "react/jsx-runtime";
693
+ // src/tui/screens/LanguageSelect.tsx
694
+ import { Fragment as Fragment3, jsx as jsx14, jsxs as jsxs9 } from "react/jsx-runtime";
646
695
  var LABEL_WIDTH = Math.max(...LANGUAGE_OPTIONS.map((option) => option.nativeName.length));
647
696
  function LanguageSelect() {
648
697
  const { replace } = useRouter();
@@ -677,21 +726,21 @@ function LanguageSelect() {
677
726
  return;
678
727
  }
679
728
  });
680
- return /* @__PURE__ */ jsx13(
729
+ return /* @__PURE__ */ jsx14(
681
730
  Frame,
682
731
  {
683
732
  breadcrumb: ["ReevesAgents", t("common.language")],
684
733
  tagline: t("language.subtitle"),
685
734
  statusKeys: t("language.status"),
686
- children: /* @__PURE__ */ jsxs8(Box8, { flexDirection: "column", children: [
687
- showIntro && /* @__PURE__ */ jsxs8(Fragment3, { children: [
688
- /* @__PURE__ */ jsx13(Text8, { color: colors.accent.primary, bold: true, wrap: "truncate-end", children: t("language.title") }),
689
- /* @__PURE__ */ jsx13(Text8, { color: colors.text.dim, wrap: "truncate-end", children: t("language.hint") })
735
+ children: /* @__PURE__ */ jsxs9(Box9, { flexDirection: "column", children: [
736
+ showIntro && /* @__PURE__ */ jsxs9(Fragment3, { children: [
737
+ /* @__PURE__ */ jsx14(Text9, { color: colors.accent.primary, bold: true, wrap: "truncate-end", children: t("language.title") }),
738
+ /* @__PURE__ */ jsx14(Text9, { color: colors.text.dim, wrap: "truncate-end", children: t("language.hint") })
690
739
  ] }),
691
- /* @__PURE__ */ jsx13(Section, { label: t("common.language") }),
740
+ /* @__PURE__ */ jsx14(Section, { label: t("common.language") }),
692
741
  visibleOptions.map((option, localIdx) => {
693
742
  const idx = firstVisible + localIdx;
694
- return /* @__PURE__ */ jsx13(
743
+ return /* @__PURE__ */ jsx14(
695
744
  Row,
696
745
  {
697
746
  selected: selectedIdx === idx,
@@ -703,30 +752,30 @@ function LanguageSelect() {
703
752
  option.code
704
753
  );
705
754
  }),
706
- LANGUAGE_OPTIONS.length > visibleLanguageCount && /* @__PURE__ */ jsx13(
755
+ LANGUAGE_OPTIONS.length > visibleLanguageCount && /* @__PURE__ */ jsx14(
707
756
  Row,
708
757
  {
709
758
  selected: false,
710
- primary: `${firstVisible + 1}-${firstVisible + visibleOptions.length} of ${LANGUAGE_OPTIONS.length}`,
759
+ primary: t("runtime.pageRange", { from: firstVisible + 1, to: firstVisible + visibleOptions.length, total: LANGUAGE_OPTIONS.length }),
711
760
  trailing: "scroll with arrows",
712
761
  disabled: true
713
762
  }
714
763
  ),
715
- /* @__PURE__ */ jsx13(SectionEnd, {})
764
+ /* @__PURE__ */ jsx14(SectionEnd, {})
716
765
  ] })
717
766
  }
718
767
  );
719
768
  }
720
769
 
721
- // src/screens/Welcome.tsx
770
+ // src/tui/screens/Welcome.tsx
722
771
  import { useInsertionEffect as useInsertionEffect2, useMemo as useMemo2, useRef as useRef3, useState as useState7 } from "react";
723
- import { Box as Box11, Text as Text11, useApp, useInput as useInput2, useWindowSize as useWindowSize3 } from "ink";
772
+ import { Box as Box12, Text as Text12, useApp, useInput as useInput2, useWindowSize as useWindowSize3 } from "ink";
724
773
 
725
- // src/components/Wordmark.tsx
774
+ // src/tui/components/Wordmark.tsx
726
775
  import { useEffect as useEffect2, useMemo, useState as useState6 } from "react";
727
- import { Box as Box9, Text as Text9 } from "ink";
776
+ import { Box as Box10, Text as Text10 } from "ink";
728
777
 
729
- // src/brand/wordmark.ts
778
+ // src/tui/brand/wordmark.ts
730
779
  var GLYPHS = {
731
780
  " ": ["000", "000", "000", "000", "000"],
732
781
  A: ["01110", "10001", "11111", "10001", "10001"],
@@ -781,8 +830,8 @@ function logoRowsHalf(lines = LOGO_LINES) {
781
830
  return out;
782
831
  }
783
832
 
784
- // src/components/Wordmark.tsx
785
- import { jsx as jsx14 } from "react/jsx-runtime";
833
+ // src/tui/components/Wordmark.tsx
834
+ import { jsx as jsx15 } from "react/jsx-runtime";
786
835
  var BREATH_INTERVAL_MS = 1600;
787
836
  function useBreathFrame(enabled, intervalMs = BREATH_INTERVAL_MS) {
788
837
  const [frame, setFrame] = useState6(0);
@@ -807,13 +856,13 @@ function Wordmark({ compact = false, animated = false, full = false, small = fal
807
856
  const wordLines = lines ?? (full ? FULL_LOGO_LINES : LOGO_LINES);
808
857
  return small ? logoRowsHalf(wordLines) : logoRows(wordLines, false);
809
858
  }, [full, small, lines]);
810
- return /* @__PURE__ */ jsx14(Box9, { flexDirection: "column", children: rows.map((row, rowIdx) => /* @__PURE__ */ jsx14(Box9, { children: chunks(row, compact ? 3 : 4).map((part, chunkIdx) => /* @__PURE__ */ jsx14(Text9, { color: colorForChunk(rowIdx, chunkIdx, animate ? frame : 0), bold: true, children: part }, `${rowIdx}-${chunkIdx}`)) }, `${rowIdx}-${row}`)) });
859
+ return /* @__PURE__ */ jsx15(Box10, { flexDirection: "column", children: rows.map((row, rowIdx) => /* @__PURE__ */ jsx15(Box10, { children: chunks(row, compact ? 3 : 4).map((part, chunkIdx) => /* @__PURE__ */ jsx15(Text10, { color: colorForChunk(rowIdx, chunkIdx, animate ? frame : 0), bold: true, children: part }, `${rowIdx}-${chunkIdx}`)) }, `${rowIdx}-${row}`)) });
811
860
  }
812
861
 
813
- // src/components/Mascot.tsx
814
- import { Box as Box10, Text as Text10 } from "ink";
862
+ // src/tui/components/Mascot.tsx
863
+ import { Box as Box11, Text as Text11 } from "ink";
815
864
 
816
- // src/brand/duck-rendered.ts
865
+ // src/tui/brand/duck-rendered.ts
817
866
  var DUCK_RENDERED = {
818
867
  hero: "\x1B[39m \x1B[38;5;1m \x1B[38;5;136m\u2583\x1B[38;5;221m\u2584\u2585\u2585\x1B[38;5;215m\u2584\x1B[38;5;136m\u2582 \x1B[39m\n \x1B[38;5;130m\u2581\x1B[38;5;208m\u2582\u259F\x1B[38;5;221m\u2588\u2588\x1B[38;5;179m\u2588\x1B[38;5;222m\u2588\x1B[38;5;221m\u2588\u2588\x1B[38;5;136m\u2599 \x1B[39m\n \x1B[38;5;202m\u2588\u2588\x1B[38;5;208m\u2588\x1B[38;5;221m\u2588\u2588\u2586\x1B[38;5;222m\u2588\x1B[38;5;221m\u2588\u2588\u2588\u2584\x1B[38;5;215m\u2584\x1B[38;5;221m\u2583\u2582\x1B[38;5;136m\u2581 \x1B[39m\n \x1B[38;5;166m\u2594\u2594\x1B[38;5;136m\u2580\x1B[38;5;215m\u2588\x1B[38;5;221m\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\x1B[38;5;215m\u2587\x1B[38;5;178m\u2585\x1B[38;5;214m\u2585\x1B[38;5;136m\u258F\x1B[39m\n \x1B[38;5;1m \x1B[38;5;178m\u2595\x1B[38;5;221m\u2588\u2588\u2588\u2588\u2588\x1B[38;5;214m\u2588\u2588\u2588\x1B[38;5;178m\u2588\u2588\x1B[38;5;214m\u2588\u2588\u2588\x1B[38;5;221m\u2588\x1B[38;5;178m\u2589 \x1B[39m\n \x1B[38;5;1m \x1B[38;5;142m\u259C\x1B[38;5;221m\u2588\u2588\u2588\u2588\x1B[38;5;214m\u2588\u2588\u2588\x1B[38;5;178m\u2588\u2588\x1B[38;5;214m\u2588\u2588\u2588\x1B[38;5;178m\u2588\u2598 \x1B[39m\n \x1B[38;5;1m \x1B[38;5;136m\u2580\x1B[38;5;221m\u2580\x1B[38;5;178m\u259C\x1B[38;5;142m\u2588\x1B[38;5;178m\u2588\u2588\u2588\x1B[38;5;136m\u2588\x1B[38;5;221m\u2580\x1B[38;5;178m\u2580\x1B[38;5;215m\u2594 \x1B[39m\n \x1B[38;5;1m \x1B[39m",
819
868
  single: "\x1B[39m \x1B[38;5;1m \x1B[38;5;94m\u2597\x1B[38;5;178m\u2585\x1B[38;5;221m\u2586\x1B[38;5;178m\u2586\u2584 \x1B[39m\n\x1B[38;5;130m\u2597\x1B[38;5;208m\u2585\u2588\x1B[38;5;221m\u2588\x1B[38;5;179m\u2588\x1B[38;5;221m\u2588\u2588\x1B[38;5;178m\u258B\u2581 \x1B[39m\n\x1B[38;5;130m\u259D\x1B[38;5;166m\u2580\x1B[38;5;136m\u259C\x1B[38;5;221m\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2587\x1B[38;5;178m\u2586\x1B[38;5;221m\u2583\x1B[38;5;178m\u2596\x1B[39m\n \x1B[38;5;1m \x1B[38;5;100m\u2590\x1B[38;5;221m\u2588\u2588\u2588\x1B[38;5;214m\u2588\u2588\x1B[38;5;178m\u2588\u2588\u2588\x1B[38;5;214m\u2588\x1B[38;5;221m\u2588\x1B[38;5;136m\u258F\x1B[39m\n \x1B[38;5;1m \x1B[38;5;136m\u2580\x1B[38;5;178m\u259C\x1B[38;5;215m\u2588\x1B[38;5;221m\u2588\x1B[38;5;220m\u2588\x1B[38;5;214m\u2588\u2588\x1B[38;5;178m\u2588\u259B\u2598 \x1B[39m\n \x1B[38;5;1m \x1B[38;5;178m\u2594\u2594 \x1B[39m",
@@ -829,14 +878,14 @@ var DUCK_RENDERED = {
829
878
  miniDown: "\x1B[39m \x1B[38;5;1m \x1B[39m\n\x1B[38;5;94m\u2590\x1B[38;5;221m\u2587\x1B[38;5;215m\u2583\x1B[38;5;136m\u2582\x1B[39m"
830
879
  };
831
880
 
832
- // src/components/Mascot.tsx
833
- import { jsx as jsx15, jsxs as jsxs9 } from "react/jsx-runtime";
881
+ // src/tui/components/Mascot.tsx
882
+ import { jsx as jsx16, jsxs as jsxs10 } from "react/jsx-runtime";
834
883
  function DuckRows({ artKey }) {
835
884
  const rows = DUCK_RENDERED[artKey].split("\n");
836
- return /* @__PURE__ */ jsx15(Box10, { flexDirection: "column", children: rows.map((row, idx) => /* @__PURE__ */ jsx15(Text10, { children: row }, `${artKey}-${idx}`)) });
885
+ return /* @__PURE__ */ jsx16(Box11, { flexDirection: "column", children: rows.map((row, idx) => /* @__PURE__ */ jsx16(Text11, { children: row }, `${artKey}-${idx}`)) });
837
886
  }
838
887
  function PadColumn({ rows }) {
839
- return /* @__PURE__ */ jsx15(Box10, { flexDirection: "column", children: Array.from({ length: rows }, (_, idx) => /* @__PURE__ */ jsx15(Text10, { children: " " }, idx)) });
888
+ return /* @__PURE__ */ jsx16(Box11, { flexDirection: "column", children: Array.from({ length: rows }, (_, idx) => /* @__PURE__ */ jsx16(Text11, { children: " " }, idx)) });
840
889
  }
841
890
  function shiftedKey(variant, shift) {
842
891
  if (shift === "down") return `${variant}Down`;
@@ -844,31 +893,31 @@ function shiftedKey(variant, shift) {
844
893
  return variant;
845
894
  }
846
895
  function Mascot({ variant, shift = "normal" }) {
847
- if (variant === "mini") return /* @__PURE__ */ jsx15(DuckRows, { artKey: shiftedKey("mini", shift) });
848
- if (variant === "single") return /* @__PURE__ */ jsx15(DuckRows, { artKey: shiftedKey("single", shift) });
849
- if (variant === "hero") return /* @__PURE__ */ jsx15(DuckRows, { artKey: shiftedKey("hero", shift) });
896
+ if (variant === "mini") return /* @__PURE__ */ jsx16(DuckRows, { artKey: shiftedKey("mini", shift) });
897
+ if (variant === "single") return /* @__PURE__ */ jsx16(DuckRows, { artKey: shiftedKey("single", shift) });
898
+ if (variant === "hero") return /* @__PURE__ */ jsx16(DuckRows, { artKey: shiftedKey("hero", shift) });
850
899
  const heroRowCount = DUCK_RENDERED.hero.split("\n").length;
851
900
  const ducklingRowCount = DUCK_RENDERED.duckling.split("\n").length;
852
901
  const pad = Math.max(0, heroRowCount - ducklingRowCount);
853
- return /* @__PURE__ */ jsxs9(Box10, { flexDirection: "row", children: [
854
- /* @__PURE__ */ jsx15(DuckRows, { artKey: shiftedKey("hero", shift) }),
855
- /* @__PURE__ */ jsxs9(Box10, { marginLeft: 1, flexDirection: "column", children: [
856
- /* @__PURE__ */ jsx15(PadColumn, { rows: pad }),
857
- /* @__PURE__ */ jsx15(DuckRows, { artKey: shiftedKey("duckling", shift) })
902
+ return /* @__PURE__ */ jsxs10(Box11, { flexDirection: "row", children: [
903
+ /* @__PURE__ */ jsx16(DuckRows, { artKey: shiftedKey("hero", shift) }),
904
+ /* @__PURE__ */ jsxs10(Box11, { marginLeft: 1, flexDirection: "column", children: [
905
+ /* @__PURE__ */ jsx16(PadColumn, { rows: pad }),
906
+ /* @__PURE__ */ jsx16(DuckRows, { artKey: shiftedKey("duckling", shift) })
858
907
  ] }),
859
- /* @__PURE__ */ jsxs9(Box10, { marginLeft: 1, flexDirection: "column", children: [
860
- /* @__PURE__ */ jsx15(PadColumn, { rows: pad }),
861
- /* @__PURE__ */ jsx15(DuckRows, { artKey: shiftedKey("duckling", shift) })
908
+ /* @__PURE__ */ jsxs10(Box11, { marginLeft: 1, flexDirection: "column", children: [
909
+ /* @__PURE__ */ jsx16(PadColumn, { rows: pad }),
910
+ /* @__PURE__ */ jsx16(DuckRows, { artKey: shiftedKey("duckling", shift) })
862
911
  ] }),
863
- /* @__PURE__ */ jsxs9(Box10, { marginLeft: 1, flexDirection: "column", children: [
864
- /* @__PURE__ */ jsx15(PadColumn, { rows: pad }),
865
- /* @__PURE__ */ jsx15(DuckRows, { artKey: shiftedKey("duckling", shift) })
912
+ /* @__PURE__ */ jsxs10(Box11, { marginLeft: 1, flexDirection: "column", children: [
913
+ /* @__PURE__ */ jsx16(PadColumn, { rows: pad }),
914
+ /* @__PURE__ */ jsx16(DuckRows, { artKey: shiftedKey("duckling", shift) })
866
915
  ] })
867
916
  ] });
868
917
  }
869
918
 
870
- // src/screens/Welcome.tsx
871
- import { jsx as jsx16, jsxs as jsxs10 } from "react/jsx-runtime";
919
+ // src/tui/screens/Welcome.tsx
920
+ import { jsx as jsx17, jsxs as jsxs11 } from "react/jsx-runtime";
872
921
  function pickMascotVariant(columns) {
873
922
  if (columns < 50) return "mini";
874
923
  if (columns < 90) return "single";
@@ -890,8 +939,11 @@ function Welcome() {
890
939
  const rows2 = [
891
940
  { label: t("welcome.newRun"), hint: t("welcome.newRunHint"), screen: "NewRun" },
892
941
  { label: t("welcome.runs"), hint: t("welcome.runsHint"), screen: "Runs" },
942
+ { label: t("welcome.presets"), hint: t("welcome.presetsHint"), screen: "Presets" },
893
943
  { label: t("welcome.doctor"), hint: t("welcome.doctorHint"), screen: "Doctor" },
894
- { label: `${t("welcome.startWeb")} (beta)`, hint: t("welcome.startWebHint"), launchWeb: true },
944
+ { label: t("welcome.agentControl"), hint: t("welcome.agentControlHint"), screen: "AgentControl" },
945
+ { label: t("welcome.approvals"), hint: t("welcome.approvalsHint"), screen: "Approvals" },
946
+ { label: `${t("welcome.startWeb")}`, hint: t("welcome.startWebHint"), launchWeb: true },
895
947
  { label: t("common.settings"), hint: t("welcome.settingsHint"), screen: "Settings" },
896
948
  { label: t("welcome.reference"), hint: t("welcome.referenceHint"), screen: "Reference" },
897
949
  { label: t("welcome.credits"), hint: t("welcome.creditsHint"), screen: "Credits" },
@@ -969,23 +1021,23 @@ function Welcome() {
969
1021
  return;
970
1022
  }
971
1023
  });
972
- return /* @__PURE__ */ jsx16(LayoutProvider, { columns: contentColumns, children: /* @__PURE__ */ jsxs10(Box11, { flexDirection: "column", paddingX: pagePadding, width: columns, maxHeight: tightRows ? rows : void 0, borderStyle: "single", borderColor: colors.surface.border, overflow: "hidden", children: [
973
- tinyRows ? /* @__PURE__ */ jsx16(Text11, { color: colors.accent.primary, bold: true, wrap: "truncate-end", children: "ReevesAgents" }) : /* @__PURE__ */ jsxs10(Box11, { flexDirection: "row", alignItems: "flex-start", children: [
974
- /* @__PURE__ */ jsxs10(Box11, { flexDirection: "column", children: [
975
- /* @__PURE__ */ jsx16(Wordmark, { compact, animated: true, small: true, intervalMs: 400 }),
976
- !tightRows && /* @__PURE__ */ jsx16(Box11, { marginTop: 1, children: /* @__PURE__ */ jsx16(Wordmark, { lines: AGENTS_LINES, compact, animated: true, small: true, intervalMs: 400 }) })
1024
+ return /* @__PURE__ */ jsx17(LayoutProvider, { columns: contentColumns, children: /* @__PURE__ */ jsxs11(Box12, { flexDirection: "column", paddingX: pagePadding, width: columns, maxHeight: tightRows ? rows : void 0, borderStyle: "single", borderColor: colors.surface.border, overflow: "hidden", children: [
1025
+ tinyRows ? /* @__PURE__ */ jsx17(Text12, { color: colors.accent.primary, bold: true, wrap: "truncate-end", children: "ReevesAgents" }) : /* @__PURE__ */ jsxs11(Box12, { flexDirection: "row", alignItems: "flex-start", children: [
1026
+ /* @__PURE__ */ jsxs11(Box12, { flexDirection: "column", children: [
1027
+ /* @__PURE__ */ jsx17(Wordmark, { compact, animated: true, small: true, intervalMs: 400 }),
1028
+ !tightRows && /* @__PURE__ */ jsx17(Box12, { marginTop: 1, children: /* @__PURE__ */ jsx17(Wordmark, { lines: AGENTS_LINES, compact, animated: true, small: true, intervalMs: 400 }) })
977
1029
  ] }),
978
- !tightRows && /* @__PURE__ */ jsx16(Box11, { marginLeft: 2, children: /* @__PURE__ */ jsx16(Mascot, { variant: mascotVariant }) })
1030
+ !tightRows && /* @__PURE__ */ jsx17(Box12, { marginLeft: 2, children: /* @__PURE__ */ jsx17(Mascot, { variant: mascotVariant }) })
979
1031
  ] }),
980
- !tightRows && /* @__PURE__ */ jsxs10(Box11, { flexDirection: "column", marginTop: 1, children: [
981
- /* @__PURE__ */ jsx16(Text11, { color: colors.text.dim, wrap: "truncate-end", children: t("welcome.tagline1") }),
982
- /* @__PURE__ */ jsx16(Text11, { color: colors.text.dim, wrap: "truncate-end", children: t("welcome.tagline2") })
1032
+ !tightRows && /* @__PURE__ */ jsxs11(Box12, { flexDirection: "column", marginTop: 1, children: [
1033
+ /* @__PURE__ */ jsx17(Text12, { color: colors.text.dim, wrap: "truncate-end", children: t("welcome.tagline1") }),
1034
+ /* @__PURE__ */ jsx17(Text12, { color: colors.text.dim, wrap: "truncate-end", children: t("welcome.tagline2") })
983
1035
  ] }),
984
- /* @__PURE__ */ jsx16(Box11, { flexDirection: "column", marginTop: tinyRows ? 0 : 1, children: /* @__PURE__ */ jsxs10(LayoutProvider, { columns: menuColumns, children: [
985
- /* @__PURE__ */ jsx16(Section, { label: t("welcome.menu") }),
1036
+ /* @__PURE__ */ jsx17(Box12, { flexDirection: "column", marginTop: tinyRows ? 0 : 1, children: /* @__PURE__ */ jsxs11(LayoutProvider, { columns: menuColumns, children: [
1037
+ /* @__PURE__ */ jsx17(Section, { label: t("welcome.menu") }),
986
1038
  visibleActions.map((action, localIdx) => {
987
1039
  const idx = firstVisibleAction + localIdx;
988
- return /* @__PURE__ */ jsx16(
1040
+ return /* @__PURE__ */ jsx17(
989
1041
  Row,
990
1042
  {
991
1043
  selected: selectedIdx === idx,
@@ -997,31 +1049,31 @@ function Welcome() {
997
1049
  action.label
998
1050
  );
999
1051
  }),
1000
- /* @__PURE__ */ jsx16(SectionEnd, {}),
1001
- /* @__PURE__ */ jsx16(Box11, { children: /* @__PURE__ */ jsxs10(Text11, { color: colors.text.muted, children: [
1052
+ /* @__PURE__ */ jsx17(SectionEnd, {}),
1053
+ /* @__PURE__ */ jsx17(Box12, { children: /* @__PURE__ */ jsxs11(Text12, { color: colors.text.muted, children: [
1002
1054
  t("welcome.keys"),
1003
1055
  rangeText
1004
1056
  ] }) }),
1005
- webStarting || webMessage ? /* @__PURE__ */ jsx16(Box11, { children: /* @__PURE__ */ jsx16(Text11, { color: webStarting ? colors.status.warn : colors.accent.bright, wrap: "truncate-end", children: webStarting ? t("welcome.webStarting") : webMessage }) }) : null
1057
+ webStarting || webMessage ? /* @__PURE__ */ jsx17(Box12, { children: /* @__PURE__ */ jsx17(Text12, { color: webStarting ? colors.status.warn : colors.accent.bright, wrap: "truncate-end", children: webStarting ? t("welcome.webStarting") : webMessage }) }) : null
1006
1058
  ] }) })
1007
1059
  ] }) });
1008
1060
  }
1009
1061
 
1010
- // src/screens/Runs.tsx
1062
+ // src/tui/screens/Runs.tsx
1011
1063
  import { useEffect as useEffect3, useMemo as useMemo3, useState as useState8 } from "react";
1012
- import { Box as Box13, useInput as useInput3, useApp as useApp2, useWindowSize as useWindowSize4 } from "ink";
1064
+ import { Box as Box14, useInput as useInput3, useApp as useApp2, useWindowSize as useWindowSize4 } from "ink";
1013
1065
 
1014
- // src/components/Legend.tsx
1015
- import { Box as Box12, Text as Text12 } from "ink";
1016
- import { jsx as jsx17, jsxs as jsxs11 } from "react/jsx-runtime";
1066
+ // src/tui/components/Legend.tsx
1067
+ import { Box as Box13, Text as Text13 } from "ink";
1068
+ import { jsx as jsx18, jsxs as jsxs12 } from "react/jsx-runtime";
1017
1069
  function Legend({ items }) {
1018
1070
  const { language } = useLanguage();
1019
- return /* @__PURE__ */ jsx17(Box12, { children: items.map((item, idx) => {
1071
+ return /* @__PURE__ */ jsx18(Box13, { children: items.map((item, idx) => {
1020
1072
  const displayLabel = translatePhrase(language, item.label);
1021
- return /* @__PURE__ */ jsxs11(Box12, { children: [
1022
- idx > 0 && /* @__PURE__ */ jsx17(Text12, { color: colors.text.dim, children: " " }),
1023
- /* @__PURE__ */ jsx17(Text12, { color: item.color, children: item.glyph }),
1024
- /* @__PURE__ */ jsxs11(Text12, { color: colors.text.dim, children: [
1073
+ return /* @__PURE__ */ jsxs12(Box13, { children: [
1074
+ idx > 0 && /* @__PURE__ */ jsx18(Text13, { color: colors.text.dim, children: " " }),
1075
+ /* @__PURE__ */ jsx18(Text13, { color: item.color, children: item.glyph }),
1076
+ /* @__PURE__ */ jsxs12(Text13, { color: colors.text.dim, children: [
1025
1077
  " ",
1026
1078
  displayLabel
1027
1079
  ] })
@@ -1029,8 +1081,13 @@ function Legend({ items }) {
1029
1081
  }) });
1030
1082
  }
1031
1083
 
1032
- // src/screens/Runs.tsx
1033
- import { jsx as jsx18, jsxs as jsxs12 } from "react/jsx-runtime";
1084
+ // src/utils/agentLabel.ts
1085
+ function agentCountLabel(t, count) {
1086
+ return count === 1 ? t("runtime.agentsOne", { count }) : t("runtime.agentsMany", { count });
1087
+ }
1088
+
1089
+ // src/tui/screens/Runs.tsx
1090
+ import { jsx as jsx19, jsxs as jsxs13 } from "react/jsx-runtime";
1034
1091
  var ACTIONS = ["NewRun", "History", "Main Menu", "Quit"];
1035
1092
  var CHROME_ROWS = 18;
1036
1093
  var ACTION_COPY = {
@@ -1062,6 +1119,7 @@ function moveSelectedIndex(idx, delta, runCount) {
1062
1119
  }
1063
1120
  function Runs() {
1064
1121
  const { exit } = useApp2();
1122
+ const { t, language } = useLanguage();
1065
1123
  const { push, resetStack, setSelectedRunId } = useRouter();
1066
1124
  const { rows: termRows } = useWindowSize4();
1067
1125
  const bodyRows = frameBodyRows(termRows, true, true);
@@ -1177,11 +1235,11 @@ function Runs() {
1177
1235
  let statusContext = "";
1178
1236
  if (selectedRun) {
1179
1237
  const agents = listAgents(selectedRun.id);
1180
- statusContext = `${selectedRun.name} \xB7 ${runStatus(selectedRun)} \xB7 ${agents.length} agents \xB7 ${selectedRun.working_dir}`;
1238
+ statusContext = `${selectedRun.name} \xB7 ${translatePhrase(language, runStatus(selectedRun))} \xB7 ${agentCountLabel(t, agents.length)} \xB7 ${selectedRun.working_dir}`;
1181
1239
  } else if (selected?.type === "action" && selected.action) {
1182
1240
  statusContext = ACTION_COPY[selected.action]?.hint ?? selected.action;
1183
1241
  }
1184
- return /* @__PURE__ */ jsx18(
1242
+ return /* @__PURE__ */ jsx19(
1185
1243
  Frame,
1186
1244
  {
1187
1245
  breadcrumb: ["ReevesAgents", "Runs"],
@@ -1192,14 +1250,14 @@ function Runs() {
1192
1250
  tagline: "Manage active runs and the agents inside them.",
1193
1251
  statusContext,
1194
1252
  statusKeys: "enter open \xB7 \u2191\u2193 scroll \xB7 esc main menu",
1195
- children: compactBody ? /* @__PURE__ */ jsxs12(Box13, { flexDirection: "column", children: [
1196
- /* @__PURE__ */ jsx18(Section, { label: activeIdx < runs.length ? "Runs" : "Actions" }),
1197
- runs.length === 0 && compactFirstEntry === 0 && /* @__PURE__ */ jsx18(Row, { selected: false, primary: "No runs yet", trailing: "choose New Run", disabled: true }),
1253
+ children: compactBody ? /* @__PURE__ */ jsxs13(Box14, { flexDirection: "column", children: [
1254
+ /* @__PURE__ */ jsx19(Section, { label: activeIdx < runs.length ? "Runs" : "Actions" }),
1255
+ runs.length === 0 && compactFirstEntry === 0 && /* @__PURE__ */ jsx19(Row, { selected: false, primary: "No runs yet", trailing: "choose New Run", disabled: true }),
1198
1256
  compactEntries.map((entry, idx) => {
1199
1257
  const absoluteEntryIdx = compactFirstEntry + idx;
1200
1258
  if (entry.type === "action") {
1201
1259
  const absoluteIdx = runs.length + 1 + ACTIONS.indexOf(entry.action);
1202
- return /* @__PURE__ */ jsx18(
1260
+ return /* @__PURE__ */ jsx19(
1203
1261
  Row,
1204
1262
  {
1205
1263
  selected: activeIdx === absoluteIdx,
@@ -1220,7 +1278,7 @@ function Runs() {
1220
1278
  { label: modelBadgeLabel(root.model), color: modelColor(root.model, root.provider) }
1221
1279
  ] : []
1222
1280
  ];
1223
- return /* @__PURE__ */ jsx18(
1281
+ return /* @__PURE__ */ jsx19(
1224
1282
  Row,
1225
1283
  {
1226
1284
  selected: activeEntryIdx === absoluteEntryIdx,
@@ -1228,24 +1286,24 @@ function Runs() {
1228
1286
  primaryWidth: runNameWidth,
1229
1287
  glyph: statusGlyph(runStatus(run)),
1230
1288
  badges,
1231
- hint: `${agents.length} agents`
1289
+ hint: agentCountLabel(t, agents.length)
1232
1290
  },
1233
1291
  run.id
1234
1292
  );
1235
1293
  }),
1236
- selectableEntries.length > compactEntryCount && /* @__PURE__ */ jsx18(
1294
+ selectableEntries.length > compactEntryCount && /* @__PURE__ */ jsx19(
1237
1295
  Row,
1238
1296
  {
1239
1297
  selected: false,
1240
- primary: `${compactFirstEntry + 1}-${compactFirstEntry + compactEntries.length} of ${selectableEntries.length}`,
1298
+ primary: t("runtime.pageRange", { from: compactFirstEntry + 1, to: compactFirstEntry + compactEntries.length, total: selectableEntries.length }),
1241
1299
  trailing: "scroll with arrows",
1242
1300
  disabled: true
1243
1301
  }
1244
1302
  ),
1245
- /* @__PURE__ */ jsx18(SectionEnd, {})
1246
- ] }) : /* @__PURE__ */ jsxs12(Box13, { flexDirection: "column", children: [
1247
- /* @__PURE__ */ jsx18(Section, { label: "Runs" }),
1248
- runs.length === 0 ? /* @__PURE__ */ jsx18(
1303
+ /* @__PURE__ */ jsx19(SectionEnd, {})
1304
+ ] }) : /* @__PURE__ */ jsxs13(Box14, { flexDirection: "column", children: [
1305
+ /* @__PURE__ */ jsx19(Section, { label: "Runs" }),
1306
+ runs.length === 0 ? /* @__PURE__ */ jsx19(
1249
1307
  Row,
1250
1308
  {
1251
1309
  selected: false,
@@ -1264,7 +1322,7 @@ function Runs() {
1264
1322
  { label: modelBadgeLabel(root.model), color: modelColor(root.model, root.provider) }
1265
1323
  ] : []
1266
1324
  ];
1267
- return /* @__PURE__ */ jsx18(
1325
+ return /* @__PURE__ */ jsx19(
1268
1326
  Row,
1269
1327
  {
1270
1328
  selected: activeIdx === absoluteIdx,
@@ -1272,22 +1330,22 @@ function Runs() {
1272
1330
  primaryWidth: runNameWidth,
1273
1331
  glyph: statusGlyph(runStatus(run)),
1274
1332
  badges,
1275
- hint: `${agents.length} agents`
1333
+ hint: agentCountLabel(t, agents.length)
1276
1334
  },
1277
1335
  run.id
1278
1336
  );
1279
1337
  }),
1280
- runs.length > visibleRunCount && /* @__PURE__ */ jsx18(
1338
+ runs.length > visibleRunCount && /* @__PURE__ */ jsx19(
1281
1339
  Row,
1282
1340
  {
1283
1341
  selected: false,
1284
- primary: `${runScroll + 1}-${runScroll + visibleRuns.length} of ${runs.length}`,
1342
+ primary: t("runtime.pageRange", { from: runScroll + 1, to: runScroll + visibleRuns.length, total: runs.length }),
1285
1343
  trailing: "scroll with arrows",
1286
1344
  disabled: true
1287
1345
  }
1288
1346
  ),
1289
- /* @__PURE__ */ jsx18(SectionEnd, {}),
1290
- /* @__PURE__ */ jsx18(
1347
+ /* @__PURE__ */ jsx19(SectionEnd, {}),
1348
+ /* @__PURE__ */ jsx19(
1291
1349
  Legend,
1292
1350
  {
1293
1351
  items: [
@@ -1296,8 +1354,8 @@ function Runs() {
1296
1354
  ]
1297
1355
  }
1298
1356
  ),
1299
- /* @__PURE__ */ jsx18(Section, { label: "Actions" }),
1300
- ACTIONS.map((action, idx) => /* @__PURE__ */ jsx18(
1357
+ /* @__PURE__ */ jsx19(Section, { label: "Actions" }),
1358
+ ACTIONS.map((action, idx) => /* @__PURE__ */ jsx19(
1301
1359
  Row,
1302
1360
  {
1303
1361
  selected: activeIdx === actionStartIdx + idx,
@@ -1307,20 +1365,20 @@ function Runs() {
1307
1365
  },
1308
1366
  action
1309
1367
  )),
1310
- /* @__PURE__ */ jsx18(SectionEnd, {})
1368
+ /* @__PURE__ */ jsx19(SectionEnd, {})
1311
1369
  ] })
1312
1370
  }
1313
1371
  );
1314
1372
  }
1315
1373
 
1316
- // src/screens/RunHistory.tsx
1374
+ // src/tui/screens/RunHistory.tsx
1317
1375
  import { useEffect as useEffect4, useState as useState10 } from "react";
1318
- import { Box as Box15, useInput as useInput5, useWindowSize as useWindowSize5 } from "ink";
1376
+ import { Box as Box16, useInput as useInput5, useWindowSize as useWindowSize5 } from "ink";
1319
1377
 
1320
- // src/components/Dialog.tsx
1378
+ // src/tui/components/Dialog.tsx
1321
1379
  import { useState as useState9 } from "react";
1322
- import { Box as Box14, Text as Text13, useInput as useInput4 } from "ink";
1323
- import { jsx as jsx19, jsxs as jsxs13 } from "react/jsx-runtime";
1380
+ import { Box as Box15, Text as Text14, useInput as useInput4 } from "ink";
1381
+ import { jsx as jsx20, jsxs as jsxs14 } from "react/jsx-runtime";
1324
1382
  function Dialog({
1325
1383
  title,
1326
1384
  body,
@@ -1330,8 +1388,13 @@ function Dialog({
1330
1388
  onConfirm,
1331
1389
  onCancel
1332
1390
  }) {
1391
+ const { language } = useLanguage();
1333
1392
  const [focusedButton, setFocusedButton] = useState9("cancel");
1334
1393
  const borderColor = intent === "danger" ? colors.status.warn : colors.accent.primary;
1394
+ const displayTitle = translatePhrase(language, title);
1395
+ const displayBody = translatePhrase(language, body);
1396
+ const displayConfirm = translatePhrase(language, confirmLabel);
1397
+ const displayCancel = translatePhrase(language, cancelLabel);
1335
1398
  useInput4((input, key) => {
1336
1399
  if (key.leftArrow) {
1337
1400
  setFocusedButton("cancel");
@@ -1351,25 +1414,25 @@ function Dialog({
1351
1414
  const isFocused = focusedButton === name;
1352
1415
  const prefix = isFocused ? `${glyphs.cursor.focused} ` : " ";
1353
1416
  const textColor = !isFocused ? colors.text.dim : intent === "danger" && name === "confirm" ? colors.status.error : colors.accent.bright;
1354
- return /* @__PURE__ */ jsxs13(Text13, { color: textColor, bold: isFocused, children: [
1417
+ return /* @__PURE__ */ jsxs14(Text14, { color: textColor, bold: isFocused, children: [
1355
1418
  prefix,
1356
1419
  "[ ",
1357
1420
  label,
1358
1421
  " ]"
1359
1422
  ] }, name);
1360
1423
  };
1361
- return /* @__PURE__ */ jsxs13(Box14, { flexDirection: "column", borderStyle: "round", borderColor, paddingX: 2, paddingY: 1, marginY: 1, children: [
1362
- /* @__PURE__ */ jsx19(Box14, { marginBottom: 1, children: /* @__PURE__ */ jsx19(Text13, { color: borderColor, bold: true, children: title }) }),
1363
- /* @__PURE__ */ jsx19(Box14, { marginBottom: 1, children: /* @__PURE__ */ jsx19(Text13, { color: colors.text.primary, children: body }) }),
1364
- /* @__PURE__ */ jsxs13(Box14, { marginTop: 1, flexDirection: "row", gap: 1, children: [
1365
- renderButton(cancelLabel, "cancel"),
1366
- renderButton(confirmLabel, "confirm")
1424
+ return /* @__PURE__ */ jsxs14(Box15, { flexDirection: "column", borderStyle: "round", borderColor, paddingX: 2, paddingY: 1, marginY: 1, children: [
1425
+ /* @__PURE__ */ jsx20(Box15, { marginBottom: 1, children: /* @__PURE__ */ jsx20(Text14, { color: borderColor, bold: true, children: displayTitle }) }),
1426
+ /* @__PURE__ */ jsx20(Box15, { marginBottom: 1, children: /* @__PURE__ */ jsx20(Text14, { color: colors.text.primary, children: displayBody }) }),
1427
+ /* @__PURE__ */ jsxs14(Box15, { marginTop: 1, flexDirection: "row", gap: 1, children: [
1428
+ renderButton(displayCancel, "cancel"),
1429
+ renderButton(displayConfirm, "confirm")
1367
1430
  ] })
1368
1431
  ] });
1369
1432
  }
1370
1433
 
1371
- // src/screens/RunHistory.tsx
1372
- import { jsx as jsx20, jsxs as jsxs14 } from "react/jsx-runtime";
1434
+ // src/tui/screens/RunHistory.tsx
1435
+ import { jsx as jsx21, jsxs as jsxs15 } from "react/jsx-runtime";
1373
1436
  var ACTIONS2 = ["DeleteSelected", "Back", "Main Menu"];
1374
1437
  var ACTION_COPY2 = {
1375
1438
  DeleteSelected: { label: "Delete Selected", hint: "delete archived run" },
@@ -1401,9 +1464,6 @@ function shortIso(value) {
1401
1464
  if (!value) return "unknown";
1402
1465
  return `${value.replace("T", " ").slice(0, 16)}Z`;
1403
1466
  }
1404
- function modeLabel(mode, language) {
1405
- return translatePhrase(language, mode === "orchestrator" ? "orchestrator" : "Agent run");
1406
- }
1407
1467
  function RunHistory() {
1408
1468
  const { pop, resetStack } = useRouter();
1409
1469
  const { toast } = useToast();
@@ -1412,7 +1472,7 @@ function RunHistory() {
1412
1472
  const bodyRows = frameBodyRows(termRows, true, true);
1413
1473
  const compactBody = bodyRows <= 10;
1414
1474
  const visibleRecordCount = Math.max(1, compactBody ? bodyRows - 3 : Math.min(termRows - CHROME_ROWS2, bodyRows - 7));
1415
- const [records, setRecords] = useState10(() => listRunHistory({ includeAllModes: true }));
1475
+ const [records, setRecords] = useState10(() => listRunHistory());
1416
1476
  const [selectedIdx, setSelectedIdx] = useState10(0);
1417
1477
  const [recordScroll, setRecordScroll] = useState10(0);
1418
1478
  const [selectedRecordId, setSelectedRecordId] = useState10(() => records[0]?.id ?? null);
@@ -1449,7 +1509,7 @@ function RunHistory() {
1449
1509
  );
1450
1510
  const compactEntries = selectableEntries.slice(compactFirstEntry, compactFirstEntry + compactEntryCount);
1451
1511
  function refreshRecords() {
1452
- const next = listRunHistory({ includeAllModes: true });
1512
+ const next = listRunHistory();
1453
1513
  setRecords(next);
1454
1514
  setSelectedRecordId((current) => current && next.some((record) => record.id === current) ? current : next[0]?.id ?? null);
1455
1515
  }
@@ -1468,7 +1528,7 @@ function RunHistory() {
1468
1528
  function confirmDelete(record) {
1469
1529
  deleteRunHistory(record.id);
1470
1530
  setPendingDelete(null);
1471
- const next = listRunHistory({ includeAllModes: true });
1531
+ const next = listRunHistory();
1472
1532
  setRecords(next);
1473
1533
  setSelectedRecordId(next[0]?.id ?? null);
1474
1534
  setSelectedIdx((idx) => normalizeSelectedIndex2(idx, next.length));
@@ -1514,12 +1574,12 @@ function RunHistory() {
1514
1574
  statusContext = selected.action === "DeleteSelected" && deleteTarget ? `${ACTION_COPY2[selected.action].hint} \xB7 ${deleteTarget.name}` : ACTION_COPY2[selected.action].hint;
1515
1575
  }
1516
1576
  if (pendingDelete) {
1517
- return /* @__PURE__ */ jsx20(
1577
+ return /* @__PURE__ */ jsx21(
1518
1578
  Frame,
1519
1579
  {
1520
1580
  breadcrumb: ["ReevesAgents", "Runs", "History"],
1521
1581
  statusKeys: "\u2190\u2192 switch \xB7 enter select \xB7 esc cancel",
1522
- children: /* @__PURE__ */ jsx20(
1582
+ children: /* @__PURE__ */ jsx21(
1523
1583
  Dialog,
1524
1584
  {
1525
1585
  title: t("history.deleteTitle", { name: pendingDelete.name }),
@@ -1534,7 +1594,7 @@ function RunHistory() {
1534
1594
  }
1535
1595
  );
1536
1596
  }
1537
- return /* @__PURE__ */ jsx20(
1597
+ return /* @__PURE__ */ jsx21(
1538
1598
  Frame,
1539
1599
  {
1540
1600
  breadcrumb: ["ReevesAgents", "Runs", "History"],
@@ -1544,14 +1604,14 @@ function RunHistory() {
1544
1604
  tagline: "Ended and stale runs are archived here with simple shared history.",
1545
1605
  statusContext,
1546
1606
  statusKeys: "enter action \xB7 \u2191\u2193 scroll \xB7 esc back",
1547
- children: compactBody ? /* @__PURE__ */ jsxs14(Box15, { flexDirection: "column", children: [
1548
- /* @__PURE__ */ jsx20(Section, { label: activeIdx < records.length ? "History" : "Actions" }),
1549
- records.length === 0 && compactFirstEntry === 0 && /* @__PURE__ */ jsx20(Row, { selected: false, primary: "No history yet", trailing: "ended runs appear here", disabled: true }),
1607
+ children: compactBody ? /* @__PURE__ */ jsxs15(Box16, { flexDirection: "column", children: [
1608
+ /* @__PURE__ */ jsx21(Section, { label: activeIdx < records.length ? "History" : "Actions" }),
1609
+ records.length === 0 && compactFirstEntry === 0 && /* @__PURE__ */ jsx21(Row, { selected: false, primary: "No history yet", trailing: "ended runs appear here", disabled: true }),
1550
1610
  compactEntries.map((entry, idx) => {
1551
1611
  const absoluteEntryIdx = compactFirstEntry + idx;
1552
1612
  if (entry.type === "action") {
1553
1613
  const absoluteIdx = records.length + 1 + ACTIONS2.indexOf(entry.action);
1554
- return /* @__PURE__ */ jsx20(
1614
+ return /* @__PURE__ */ jsx21(
1555
1615
  Row,
1556
1616
  {
1557
1617
  selected: activeIdx === absoluteIdx,
@@ -1566,11 +1626,10 @@ function RunHistory() {
1566
1626
  }
1567
1627
  const record = entry.record;
1568
1628
  const badges = [
1569
- { label: modeLabel(record.mode, language), color: colors.accent.primary },
1570
1629
  { label: translatePhrase(language, record.status), color: record.status === "stale" ? colors.status.warn : colors.status.error },
1571
1630
  ...record.root_provider ? [{ label: providerDisplayName(record.root_provider), color: providerColor(record.root_provider) }] : []
1572
1631
  ];
1573
- return /* @__PURE__ */ jsx20(
1632
+ return /* @__PURE__ */ jsx21(
1574
1633
  Row,
1575
1634
  {
1576
1635
  selected: activeEntryIdx === absoluteEntryIdx,
@@ -1584,7 +1643,7 @@ function RunHistory() {
1584
1643
  record.id
1585
1644
  );
1586
1645
  }),
1587
- selectableEntries.length > compactEntryCount && /* @__PURE__ */ jsx20(
1646
+ selectableEntries.length > compactEntryCount && /* @__PURE__ */ jsx21(
1588
1647
  Row,
1589
1648
  {
1590
1649
  selected: false,
@@ -1593,10 +1652,10 @@ function RunHistory() {
1593
1652
  disabled: true
1594
1653
  }
1595
1654
  ),
1596
- /* @__PURE__ */ jsx20(SectionEnd, {})
1597
- ] }) : /* @__PURE__ */ jsxs14(Box15, { flexDirection: "column", children: [
1598
- /* @__PURE__ */ jsx20(Section, { label: "History" }),
1599
- records.length === 0 ? /* @__PURE__ */ jsx20(
1655
+ /* @__PURE__ */ jsx21(SectionEnd, {})
1656
+ ] }) : /* @__PURE__ */ jsxs15(Box16, { flexDirection: "column", children: [
1657
+ /* @__PURE__ */ jsx21(Section, { label: "History" }),
1658
+ records.length === 0 ? /* @__PURE__ */ jsx21(
1600
1659
  Row,
1601
1660
  {
1602
1661
  selected: false,
@@ -1607,11 +1666,10 @@ function RunHistory() {
1607
1666
  ) : visibleRecords.map((record, idx) => {
1608
1667
  const absoluteIdx = recordScroll + idx;
1609
1668
  const badges = [
1610
- { label: modeLabel(record.mode, language), color: colors.accent.primary },
1611
1669
  { label: translatePhrase(language, record.status), color: record.status === "stale" ? colors.status.warn : colors.status.error },
1612
1670
  ...record.root_provider ? [{ label: providerDisplayName(record.root_provider), color: providerColor(record.root_provider) }] : []
1613
1671
  ];
1614
- return /* @__PURE__ */ jsx20(
1672
+ return /* @__PURE__ */ jsx21(
1615
1673
  Row,
1616
1674
  {
1617
1675
  selected: activeIdx === absoluteIdx,
@@ -1625,7 +1683,7 @@ function RunHistory() {
1625
1683
  record.id
1626
1684
  );
1627
1685
  }),
1628
- records.length > visibleRecordCount && /* @__PURE__ */ jsx20(
1686
+ records.length > visibleRecordCount && /* @__PURE__ */ jsx21(
1629
1687
  Row,
1630
1688
  {
1631
1689
  selected: false,
@@ -1634,9 +1692,9 @@ function RunHistory() {
1634
1692
  disabled: true
1635
1693
  }
1636
1694
  ),
1637
- /* @__PURE__ */ jsx20(SectionEnd, {}),
1638
- /* @__PURE__ */ jsx20(Section, { label: "Actions" }),
1639
- ACTIONS2.map((action, idx) => /* @__PURE__ */ jsx20(
1695
+ /* @__PURE__ */ jsx21(SectionEnd, {}),
1696
+ /* @__PURE__ */ jsx21(Section, { label: "Actions" }),
1697
+ ACTIONS2.map((action, idx) => /* @__PURE__ */ jsx21(
1640
1698
  Row,
1641
1699
  {
1642
1700
  selected: activeIdx === actionStartIdx + idx,
@@ -1648,16 +1706,16 @@ function RunHistory() {
1648
1706
  },
1649
1707
  action
1650
1708
  )),
1651
- /* @__PURE__ */ jsx20(SectionEnd, {})
1709
+ /* @__PURE__ */ jsx21(SectionEnd, {})
1652
1710
  ] })
1653
1711
  }
1654
1712
  );
1655
1713
  }
1656
1714
 
1657
- // src/screens/Run.tsx
1658
- import React14, { useEffect as useEffect5, useState as useState11 } from "react";
1659
- import { Box as Box16, Text as Text14, useInput as useInput6, useWindowSize as useWindowSize6 } from "ink";
1660
- import { jsx as jsx21, jsxs as jsxs15 } from "react/jsx-runtime";
1715
+ // src/tui/screens/Run.tsx
1716
+ import React15, { useEffect as useEffect5, useState as useState11 } from "react";
1717
+ import { Box as Box17, Text as Text15, useInput as useInput6, useWindowSize as useWindowSize6 } from "ink";
1718
+ import { jsx as jsx22, jsxs as jsxs16 } from "react/jsx-runtime";
1661
1719
  var REFRESH_INTERVAL_MS = 5e3;
1662
1720
  var LABELS = {
1663
1721
  Agents: "Agents",
@@ -1780,14 +1838,14 @@ function Run() {
1780
1838
  }
1781
1839
  });
1782
1840
  if (!run) {
1783
- return /* @__PURE__ */ jsx21(
1841
+ return /* @__PURE__ */ jsx22(
1784
1842
  Frame,
1785
1843
  {
1786
1844
  breadcrumb: ["ReevesAgents", "Runs"],
1787
1845
  statusContext: "Run not found",
1788
- children: /* @__PURE__ */ jsxs15(Box16, { flexDirection: "column", children: [
1789
- /* @__PURE__ */ jsx21(Text14, { color: colors.text.dim, children: "Run not found." }),
1790
- /* @__PURE__ */ jsx21(Box16, { marginTop: 1, children: /* @__PURE__ */ jsx21(
1846
+ children: /* @__PURE__ */ jsxs16(Box17, { flexDirection: "column", children: [
1847
+ /* @__PURE__ */ jsx22(Text15, { color: colors.text.dim, children: "Run not found." }),
1848
+ /* @__PURE__ */ jsx22(Box17, { marginTop: 1, children: /* @__PURE__ */ jsx22(
1791
1849
  Row,
1792
1850
  {
1793
1851
  selected: selectedIdx === 0,
@@ -1817,7 +1875,7 @@ function Run() {
1817
1875
  };
1818
1876
  statusContext = actionLabels[selected.action] || "";
1819
1877
  }
1820
- return /* @__PURE__ */ jsx21(
1878
+ return /* @__PURE__ */ jsx22(
1821
1879
  Frame,
1822
1880
  {
1823
1881
  breadcrumb: ["ReevesAgents", "Runs", run.name],
@@ -1828,8 +1886,8 @@ function Run() {
1828
1886
  tagline: "Open, add, stop, or inspect agents in this run.",
1829
1887
  statusContext,
1830
1888
  statusKeys: "enter open \xB7 \u2191\u2193 move \xB7 esc back",
1831
- children: compactBody ? /* @__PURE__ */ jsxs15(Box16, { flexDirection: "column", children: [
1832
- /* @__PURE__ */ jsx21(Section, { label: selectedIdx < 4 ? "Actions" : "Lifecycle" }),
1889
+ children: compactBody ? /* @__PURE__ */ jsxs16(Box17, { flexDirection: "column", children: [
1890
+ /* @__PURE__ */ jsx22(Section, { label: selectedIdx < 4 ? "Actions" : "Lifecycle" }),
1833
1891
  visibleCompactItems.map(({ item, itemIdx }) => {
1834
1892
  const isDisabledAddWorker = item.action === "AddWorker" && isRunEnded;
1835
1893
  const primary = item.action === "StopRun" && isRunEnded ? "Delete Run" : LABELS[item.action];
@@ -1843,7 +1901,7 @@ function Run() {
1843
1901
  "__section__": ""
1844
1902
  };
1845
1903
  const isDisabledOpenTabs = item.action === "OpenTabs" && isRunEnded;
1846
- return /* @__PURE__ */ jsx21(
1904
+ return /* @__PURE__ */ jsx22(
1847
1905
  Row,
1848
1906
  {
1849
1907
  selected: selectedIdx === itemIdx,
@@ -1856,16 +1914,16 @@ function Run() {
1856
1914
  item.action
1857
1915
  );
1858
1916
  }),
1859
- /* @__PURE__ */ jsx21(SectionEnd, {})
1860
- ] }) : /* @__PURE__ */ jsxs15(Box16, { flexDirection: "column", children: [
1861
- /* @__PURE__ */ jsx21(Box16, { marginBottom: 1, children: /* @__PURE__ */ jsx21(Text14, { color: colors.text.dim, wrap: "truncate-end", children: summaryLine }) }),
1862
- /* @__PURE__ */ jsx21(Section, { label: "Actions" }),
1917
+ /* @__PURE__ */ jsx22(SectionEnd, {})
1918
+ ] }) : /* @__PURE__ */ jsxs16(Box17, { flexDirection: "column", children: [
1919
+ /* @__PURE__ */ jsx22(Box17, { marginBottom: 1, children: /* @__PURE__ */ jsx22(Text15, { color: colors.text.dim, wrap: "truncate-end", children: summaryLine }) }),
1920
+ /* @__PURE__ */ jsx22(Section, { label: "Actions" }),
1863
1921
  items.map((item, idx) => {
1864
1922
  const isSelected = selectedIdx === idx;
1865
1923
  if (item.action === "__section__") {
1866
- return /* @__PURE__ */ jsxs15(React14.Fragment, { children: [
1867
- /* @__PURE__ */ jsx21(SectionEnd, {}),
1868
- /* @__PURE__ */ jsx21(Section, { label: "Lifecycle" })
1924
+ return /* @__PURE__ */ jsxs16(React15.Fragment, { children: [
1925
+ /* @__PURE__ */ jsx22(SectionEnd, {}),
1926
+ /* @__PURE__ */ jsx22(Section, { label: "Lifecycle" })
1869
1927
  ] }, "__section__");
1870
1928
  }
1871
1929
  const isDisabledAddWorker = item.action === "AddWorker" && isRunEnded;
@@ -1880,7 +1938,7 @@ function Run() {
1880
1938
  "__section__": ""
1881
1939
  };
1882
1940
  const isDisabledOpenTabs = item.action === "OpenTabs" && isRunEnded;
1883
- return /* @__PURE__ */ jsx21(
1941
+ return /* @__PURE__ */ jsx22(
1884
1942
  Row,
1885
1943
  {
1886
1944
  selected: isSelected,
@@ -1893,19 +1951,19 @@ function Run() {
1893
1951
  item.action
1894
1952
  );
1895
1953
  }),
1896
- /* @__PURE__ */ jsx21(SectionEnd, {})
1954
+ /* @__PURE__ */ jsx22(SectionEnd, {})
1897
1955
  ] })
1898
1956
  }
1899
1957
  );
1900
1958
  }
1901
1959
 
1902
- // src/screens/run/Agents.tsx
1960
+ // src/tui/screens/run/Agents.tsx
1903
1961
  import { useEffect as useEffect6, useState as useState12 } from "react";
1904
- import { Box as Box18, Text as Text16, useInput as useInput8, useWindowSize as useWindowSize7 } from "ink";
1962
+ import { Box as Box19, Text as Text17, useInput as useInput8, useWindowSize as useWindowSize7 } from "ink";
1905
1963
 
1906
- // src/components/Pagination.tsx
1907
- import { Box as Box17, Text as Text15, useInput as useInput7 } from "ink";
1908
- import { jsx as jsx22, jsxs as jsxs16 } from "react/jsx-runtime";
1964
+ // src/tui/components/Pagination.tsx
1965
+ import { Box as Box18, Text as Text16, useInput as useInput7 } from "ink";
1966
+ import { jsx as jsx23, jsxs as jsxs17 } from "react/jsx-runtime";
1909
1967
  function Pagination({ page, total, focused = false, onPrev, onNext }) {
1910
1968
  const isFirstPage = page === 1;
1911
1969
  const isLastPage = page === total;
@@ -1918,12 +1976,12 @@ function Pagination({ page, total, focused = false, onPrev, onNext }) {
1918
1976
  const nextColor = isLastPage ? colors.text.faint : colors.text.dim;
1919
1977
  const cursorColor = focused ? colors.accent.bright : colors.text.faint;
1920
1978
  const railColor = focused ? colors.accent.deep : colors.surface.border;
1921
- return /* @__PURE__ */ jsxs16(Box17, { flexDirection: "row", children: [
1922
- /* @__PURE__ */ jsx22(Box17, { width: 1, flexShrink: 0, children: /* @__PURE__ */ jsx22(Text15, { color: cursorColor, bold: focused, children: focused ? glyphs.cursor.focused : glyphs.cursor.unfocused }) }),
1923
- /* @__PURE__ */ jsx22(Box17, { width: 2, flexShrink: 0, children: /* @__PURE__ */ jsx22(Text15, { color: railColor, children: " \u2502" }) }),
1924
- /* @__PURE__ */ jsxs16(Box17, { marginLeft: space.sm, children: [
1925
- /* @__PURE__ */ jsx22(Text15, { color: prevColor, children: "\u2039" }),
1926
- /* @__PURE__ */ jsxs16(Text15, { color: colors.text.dim, children: [
1979
+ return /* @__PURE__ */ jsxs17(Box18, { flexDirection: "row", children: [
1980
+ /* @__PURE__ */ jsx23(Box18, { width: 1, flexShrink: 0, children: /* @__PURE__ */ jsx23(Text16, { color: cursorColor, bold: focused, children: focused ? glyphs.cursor.focused : glyphs.cursor.unfocused }) }),
1981
+ /* @__PURE__ */ jsx23(Box18, { width: 2, flexShrink: 0, children: /* @__PURE__ */ jsx23(Text16, { color: railColor, children: " \u2502" }) }),
1982
+ /* @__PURE__ */ jsxs17(Box18, { marginLeft: space.sm, children: [
1983
+ /* @__PURE__ */ jsx23(Text16, { color: prevColor, children: "\u2039" }),
1984
+ /* @__PURE__ */ jsxs17(Text16, { color: colors.text.dim, children: [
1927
1985
  " ",
1928
1986
  "page",
1929
1987
  " ",
@@ -1934,13 +1992,13 @@ function Pagination({ page, total, focused = false, onPrev, onNext }) {
1934
1992
  total,
1935
1993
  " "
1936
1994
  ] }),
1937
- /* @__PURE__ */ jsx22(Text15, { color: nextColor, children: "\u203A" })
1995
+ /* @__PURE__ */ jsx23(Text16, { color: nextColor, children: "\u203A" })
1938
1996
  ] })
1939
1997
  ] });
1940
1998
  }
1941
1999
 
1942
- // src/screens/run/Agents.tsx
1943
- import { jsx as jsx23, jsxs as jsxs17 } from "react/jsx-runtime";
2000
+ // src/tui/screens/run/Agents.tsx
2001
+ import { jsx as jsx24, jsxs as jsxs18 } from "react/jsx-runtime";
1944
2002
  var CHROME_ROWS3 = 13;
1945
2003
  var REFRESH_INTERVAL_MS2 = 5e3;
1946
2004
  function statusGlyph3(status) {
@@ -1952,6 +2010,7 @@ function statusGlyph3(status) {
1952
2010
  }
1953
2011
  function RunAgents() {
1954
2012
  const { selectedRunId, setSelectedAgentId, push, pop } = useRouter();
2013
+ const { language, t } = useLanguage();
1955
2014
  const { rows: termRows } = useWindowSize7();
1956
2015
  const bodyRows = frameBodyRows(termRows, true, true);
1957
2016
  const compactBody = bodyRows <= 9;
@@ -2071,9 +2130,9 @@ function RunAgents() {
2071
2130
  }
2072
2131
  });
2073
2132
  if (!run) {
2074
- return /* @__PURE__ */ jsx23(Frame, { breadcrumb: ["ReevesAgents", "Runs"], statusContext: "Run not found", children: /* @__PURE__ */ jsxs17(Box18, { flexDirection: "column", children: [
2075
- /* @__PURE__ */ jsx23(Text16, { color: colors.text.dim, children: "Run not found." }),
2076
- /* @__PURE__ */ jsx23(Box18, { marginTop: 1, children: /* @__PURE__ */ jsx23(Row, { selected: true, primary: "Back", hint: "return to all runs" }) })
2133
+ return /* @__PURE__ */ jsx24(Frame, { breadcrumb: ["ReevesAgents", "Runs"], statusContext: "Run not found", children: /* @__PURE__ */ jsxs18(Box19, { flexDirection: "column", children: [
2134
+ /* @__PURE__ */ jsx24(Text17, { color: colors.text.dim, children: translatePhrase(language, "Run not found.") }),
2135
+ /* @__PURE__ */ jsx24(Box19, { marginTop: 1, children: /* @__PURE__ */ jsx24(Row, { selected: true, primary: "Back", hint: "return to all runs" }) })
2077
2136
  ] }) });
2078
2137
  }
2079
2138
  const isRunEnded = run.status === "ended" || run.ended_at !== null;
@@ -2084,11 +2143,11 @@ function RunAgents() {
2084
2143
  "Add Agent".length,
2085
2144
  "Back".length
2086
2145
  );
2087
- let statusContext = `${run.name} \xB7 ${agents.length} agents`;
2088
- if (selected?.type === "pagination") statusContext = `page ${page} of ${totalPages} \xB7 \u2190 \u2192 turn page`;
2146
+ let statusContext = `${run.name} \xB7 ${agentCountLabel(t, agents.length)}`;
2147
+ if (selected?.type === "pagination") statusContext = t("runtime.pageNav", { page, total: totalPages });
2089
2148
  if (selected?.type === "action" && selected.action === "AddWorker") statusContext = isRunEnded ? "run is ended" : "add an agent to this run";
2090
2149
  if (selected?.type === "action" && selected.action === "Back") statusContext = "return to run hub";
2091
- return /* @__PURE__ */ jsx23(
2150
+ return /* @__PURE__ */ jsx24(
2092
2151
  Frame,
2093
2152
  {
2094
2153
  breadcrumb: ["ReevesAgents", "Runs", run.name, "Agents"],
@@ -2099,12 +2158,12 @@ function RunAgents() {
2099
2158
  tagline: "Agents in this run.",
2100
2159
  statusContext,
2101
2160
  statusKeys: "enter open \xB7 \u2191\u2193 move \xB7 esc back",
2102
- children: compactBody ? /* @__PURE__ */ jsxs17(Box18, { flexDirection: "column", children: [
2103
- /* @__PURE__ */ jsx23(Section, { label: selected?.type === "agent" ? "Agents" : "Actions" }),
2104
- agents.length === 0 && compactFirstEntry === 0 && /* @__PURE__ */ jsx23(Row, { selected: false, primary: "No agents", trailing: "add an agent", disabled: true }),
2161
+ children: compactBody ? /* @__PURE__ */ jsxs18(Box19, { flexDirection: "column", children: [
2162
+ /* @__PURE__ */ jsx24(Section, { label: selected?.type === "agent" ? "Agents" : "Actions" }),
2163
+ agents.length === 0 && compactFirstEntry === 0 && /* @__PURE__ */ jsx24(Row, { selected: false, primary: "No agents", trailing: "add an agent", disabled: true }),
2105
2164
  visibleCompactItems.map(({ itemIdx, item }) => {
2106
2165
  if (item.type === "pagination") {
2107
- return /* @__PURE__ */ jsx23(
2166
+ return /* @__PURE__ */ jsx24(
2108
2167
  Pagination,
2109
2168
  {
2110
2169
  page,
@@ -2123,7 +2182,7 @@ function RunAgents() {
2123
2182
  );
2124
2183
  }
2125
2184
  if (item.type === "action") {
2126
- return /* @__PURE__ */ jsx23(
2185
+ return /* @__PURE__ */ jsx24(
2127
2186
  Row,
2128
2187
  {
2129
2188
  selected: selectedIdx === itemIdx,
@@ -2141,7 +2200,7 @@ function RunAgents() {
2141
2200
  { label: providerLabel, color: providerColor(agent.provider), width: providerBadgeWidth },
2142
2201
  { label: modelBadgeLabel(agent.model), color: modelColor(agent.model, agent.provider), width: modelBadgeWidth }
2143
2202
  ];
2144
- return /* @__PURE__ */ jsx23(
2203
+ return /* @__PURE__ */ jsx24(
2145
2204
  Row,
2146
2205
  {
2147
2206
  selected: selectedIdx === itemIdx,
@@ -2154,10 +2213,10 @@ function RunAgents() {
2154
2213
  agent.id
2155
2214
  );
2156
2215
  }),
2157
- /* @__PURE__ */ jsx23(SectionEnd, {})
2158
- ] }) : /* @__PURE__ */ jsxs17(Box18, { flexDirection: "column", children: [
2159
- /* @__PURE__ */ jsx23(Section, { label: "Agents" }),
2160
- agents.length === 0 && /* @__PURE__ */ jsx23(Row, { selected: false, primary: "No agents", trailing: "add an agent below", disabled: true }),
2216
+ /* @__PURE__ */ jsx24(SectionEnd, {})
2217
+ ] }) : /* @__PURE__ */ jsxs18(Box19, { flexDirection: "column", children: [
2218
+ /* @__PURE__ */ jsx24(Section, { label: "Agents" }),
2219
+ agents.length === 0 && /* @__PURE__ */ jsx24(Row, { selected: false, primary: "No agents", trailing: "add an agent below", disabled: true }),
2161
2220
  pagedData.map((item, idx) => {
2162
2221
  const isSelected = selectedIdx === idx;
2163
2222
  if (item.type === "agent" && item.agent) {
@@ -2167,7 +2226,7 @@ function RunAgents() {
2167
2226
  { label: providerLabel, color: providerColor(agent.provider), width: providerBadgeWidth },
2168
2227
  { label: modelBadgeLabel(agent.model), color: modelColor(agent.model, agent.provider), width: modelBadgeWidth }
2169
2228
  ];
2170
- return /* @__PURE__ */ jsx23(
2229
+ return /* @__PURE__ */ jsx24(
2171
2230
  Row,
2172
2231
  {
2173
2232
  selected: isSelected,
@@ -2182,7 +2241,7 @@ function RunAgents() {
2182
2241
  }
2183
2242
  return null;
2184
2243
  }),
2185
- totalPages > 1 && /* @__PURE__ */ jsx23(
2244
+ totalPages > 1 && /* @__PURE__ */ jsx24(
2186
2245
  Pagination,
2187
2246
  {
2188
2247
  page,
@@ -2198,9 +2257,9 @@ function RunAgents() {
2198
2257
  }
2199
2258
  }
2200
2259
  ),
2201
- /* @__PURE__ */ jsx23(SectionEnd, {}),
2202
- /* @__PURE__ */ jsx23(Section, { label: "Actions" }),
2203
- /* @__PURE__ */ jsx23(
2260
+ /* @__PURE__ */ jsx24(SectionEnd, {}),
2261
+ /* @__PURE__ */ jsx24(Section, { label: "Actions" }),
2262
+ /* @__PURE__ */ jsx24(
2204
2263
  Row,
2205
2264
  {
2206
2265
  selected: selectedIdx === pagedData.length + paginOffset + 1,
@@ -2210,7 +2269,7 @@ function RunAgents() {
2210
2269
  disabled: isRunEnded
2211
2270
  }
2212
2271
  ),
2213
- /* @__PURE__ */ jsx23(
2272
+ /* @__PURE__ */ jsx24(
2214
2273
  Row,
2215
2274
  {
2216
2275
  selected: selectedIdx === pagedData.length + paginOffset + 2,
@@ -2219,16 +2278,16 @@ function RunAgents() {
2219
2278
  hint: "return to run hub"
2220
2279
  }
2221
2280
  ),
2222
- /* @__PURE__ */ jsx23(SectionEnd, {})
2281
+ /* @__PURE__ */ jsx24(SectionEnd, {})
2223
2282
  ] })
2224
2283
  }
2225
2284
  );
2226
2285
  }
2227
2286
 
2228
- // src/screens/run/Output.tsx
2287
+ // src/tui/screens/run/Output.tsx
2229
2288
  import { useEffect as useEffect7, useState as useState13 } from "react";
2230
- import { Box as Box19, Text as Text17, useInput as useInput9, useWindowSize as useWindowSize8 } from "ink";
2231
- import { jsx as jsx24, jsxs as jsxs18 } from "react/jsx-runtime";
2289
+ import { Box as Box20, Text as Text18, useInput as useInput9, useWindowSize as useWindowSize8 } from "ink";
2290
+ import { jsx as jsx25, jsxs as jsxs19 } from "react/jsx-runtime";
2232
2291
  var PEEK_INTERVAL_MS = 5e3;
2233
2292
  var PREVIEW_LINES = 5;
2234
2293
  var CHROME_ROWS4 = 16;
@@ -2254,6 +2313,7 @@ function peekAgents(agents) {
2254
2313
  }
2255
2314
  function RunOutput() {
2256
2315
  const { selectedRunId, pop, push, setSelectedAgentId } = useRouter();
2316
+ const { language, t } = useLanguage();
2257
2317
  const { rows: termRows } = useWindowSize8();
2258
2318
  const bodyRows = frameBodyRows(termRows, true, true);
2259
2319
  const compactBody = bodyRows <= 12;
@@ -2400,24 +2460,24 @@ function RunOutput() {
2400
2460
  }
2401
2461
  });
2402
2462
  if (!run) {
2403
- return /* @__PURE__ */ jsx24(
2463
+ return /* @__PURE__ */ jsx25(
2404
2464
  Frame,
2405
2465
  {
2406
2466
  breadcrumb: ["ReevesAgents", "Runs"],
2407
2467
  statusContext: "Run not found",
2408
- children: /* @__PURE__ */ jsxs18(Box19, { flexDirection: "column", children: [
2409
- /* @__PURE__ */ jsx24(Text17, { color: colors.text.dim, children: "Run not found." }),
2410
- /* @__PURE__ */ jsx24(Box19, { marginTop: 1, children: /* @__PURE__ */ jsx24(Row, { selected: true, primary: "Back", hint: "return to run" }) })
2468
+ children: /* @__PURE__ */ jsxs19(Box20, { flexDirection: "column", children: [
2469
+ /* @__PURE__ */ jsx25(Text18, { color: colors.text.dim, children: translatePhrase(language, "Run not found.") }),
2470
+ /* @__PURE__ */ jsx25(Box20, { marginTop: 1, children: /* @__PURE__ */ jsx25(Row, { selected: true, primary: "Back", hint: "return to run" }) })
2411
2471
  ] })
2412
2472
  }
2413
2473
  );
2414
2474
  }
2415
2475
  const secondsAgo = Math.floor((Date.now() - lastPeekAt) / 1e3);
2416
- const lastPeekLabel = secondsAgo === 0 ? "just now" : `${secondsAgo}s ago`;
2417
- let statusContext = agents.length > 0 ? `${agents.length} agent${agents.length === 1 ? "" : "s"}` : "no agents";
2418
- if (selected?.type === "agent" && selected.agent) statusContext = `${selected.agent.nickname} \xB7 enter opens output`;
2419
- if (selected?.type === "pagination") statusContext = `page ${activePage} of ${totalPages} \xB7 \u2190 \u2192 turn page`;
2420
- return /* @__PURE__ */ jsx24(
2476
+ const lastPeekLabel = secondsAgo === 0 ? t("runtime.justNow") : t("runtime.secondsAgo", { seconds: secondsAgo });
2477
+ let statusContext = agents.length > 0 ? agentCountLabel(t, agents.length) : "no agents";
2478
+ if (selected?.type === "agent" && selected.agent) statusContext = `${selected.agent.nickname} \xB7 ${t("runtime.enterOpensOutput")}`;
2479
+ if (selected?.type === "pagination") statusContext = t("runtime.pageNav", { page: activePage, total: totalPages });
2480
+ return /* @__PURE__ */ jsx25(
2421
2481
  Frame,
2422
2482
  {
2423
2483
  breadcrumb: ["ReevesAgents", "Runs", run.name, "Output"],
@@ -2428,12 +2488,12 @@ function RunOutput() {
2428
2488
  tagline: "Recent output from each agent in this run. Refreshes every 5 seconds.",
2429
2489
  statusContext,
2430
2490
  statusKeys: "\u2191\u2193 move \xB7 \u2190\u2192 page \xB7 enter open/refresh \xB7 esc back",
2431
- children: compactBody ? /* @__PURE__ */ jsxs18(Box19, { flexDirection: "column", children: [
2432
- /* @__PURE__ */ jsx24(Section, { label: selected?.type === "agent" ? "Output" : "Actions" }),
2433
- agents.length === 0 && compactFirstEntry === 0 && /* @__PURE__ */ jsx24(Row, { selected: false, primary: "No agents", trailing: "return to run", disabled: true }),
2491
+ children: compactBody ? /* @__PURE__ */ jsxs19(Box20, { flexDirection: "column", children: [
2492
+ /* @__PURE__ */ jsx25(Section, { label: selected?.type === "agent" ? "Output" : "Actions" }),
2493
+ agents.length === 0 && compactFirstEntry === 0 && /* @__PURE__ */ jsx25(Row, { selected: false, primary: "No agents", trailing: "return to run", disabled: true }),
2434
2494
  visibleCompactItems.map(({ itemIdx, item }) => {
2435
2495
  if (item.type === "pagination") {
2436
- return /* @__PURE__ */ jsx24(
2496
+ return /* @__PURE__ */ jsx25(
2437
2497
  Pagination,
2438
2498
  {
2439
2499
  page: activePage,
@@ -2453,7 +2513,7 @@ function RunOutput() {
2453
2513
  }
2454
2514
  if (item.type === "action") {
2455
2515
  const hint = item.action === "Refresh" ? "peek all agents now" : "return to run hub";
2456
- return /* @__PURE__ */ jsx24(
2516
+ return /* @__PURE__ */ jsx25(
2457
2517
  Row,
2458
2518
  {
2459
2519
  selected: selectedIdx === itemIdx,
@@ -2466,7 +2526,7 @@ function RunOutput() {
2466
2526
  }
2467
2527
  const agent = item.agent;
2468
2528
  const providerLabel = providerDisplayName(agent.provider);
2469
- return /* @__PURE__ */ jsx24(
2529
+ return /* @__PURE__ */ jsx25(
2470
2530
  Row,
2471
2531
  {
2472
2532
  selected: selectedIdx === itemIdx,
@@ -2475,34 +2535,34 @@ function RunOutput() {
2475
2535
  { label: providerLabel, color: providerColor(agent.provider) },
2476
2536
  { label: modelBadgeLabel(agent.model), color: modelColor(agent.model, agent.provider) }
2477
2537
  ],
2478
- hint: "enter opens output"
2538
+ hint: t("runtime.enterOpensOutput")
2479
2539
  },
2480
2540
  agent.id
2481
2541
  );
2482
2542
  }),
2483
- /* @__PURE__ */ jsx24(SectionEnd, {})
2484
- ] }) : /* @__PURE__ */ jsxs18(Box19, { flexDirection: "column", children: [
2485
- agents.length === 0 ? /* @__PURE__ */ jsx24(Text17, { color: colors.text.dim, children: "No agents in this run." }) : pagedAgents.map((agent) => {
2543
+ /* @__PURE__ */ jsx25(SectionEnd, {})
2544
+ ] }) : /* @__PURE__ */ jsxs19(Box20, { flexDirection: "column", children: [
2545
+ agents.length === 0 ? /* @__PURE__ */ jsx25(Text18, { color: colors.text.dim, children: translatePhrase(language, "No agents in this run.") }) : pagedAgents.map((agent) => {
2486
2546
  const peek = peeks[agent.id] || "";
2487
2547
  const lines = peek ? peek.split("\n").slice(-PREVIEW_LINES) : [];
2488
2548
  const isSelected = selected?.type === "agent" && selected.agent?.id === agent.id;
2489
2549
  const providerHue = providerColor(agent.provider);
2490
2550
  const modelHue = modelColor(agent.model, agent.provider);
2491
2551
  const providerLabel = providerDisplayName(agent.provider);
2492
- return /* @__PURE__ */ jsx24(Box19, { flexDirection: "column", marginBottom: 1, children: /* @__PURE__ */ jsx24(Box19, { borderStyle: "single", borderColor: isSelected ? colors.accent.bright : providerHue, paddingX: space.sm, children: /* @__PURE__ */ jsxs18(Box19, { flexDirection: "column", children: [
2493
- /* @__PURE__ */ jsxs18(Text17, { bold: true, children: [
2494
- /* @__PURE__ */ jsx24(Text17, { color: isSelected ? colors.accent.bright : colors.text.primary, children: agent.nickname }),
2495
- /* @__PURE__ */ jsx24(Text17, { color: colors.text.dim, children: " " }),
2496
- /* @__PURE__ */ jsx24(Text17, { color: colors.surface.border, children: "[" }),
2497
- /* @__PURE__ */ jsx24(Text17, { color: providerHue, children: providerLabel }),
2498
- /* @__PURE__ */ jsx24(Text17, { color: colors.surface.border, children: "] [" }),
2499
- /* @__PURE__ */ jsx24(Text17, { color: modelHue, children: modelBadgeLabel(agent.model) }),
2500
- /* @__PURE__ */ jsx24(Text17, { color: colors.surface.border, children: "]" })
2552
+ return /* @__PURE__ */ jsx25(Box20, { flexDirection: "column", marginBottom: 1, children: /* @__PURE__ */ jsx25(Box20, { borderStyle: "single", borderColor: isSelected ? colors.accent.bright : providerHue, paddingX: space.sm, children: /* @__PURE__ */ jsxs19(Box20, { flexDirection: "column", children: [
2553
+ /* @__PURE__ */ jsxs19(Text18, { bold: true, children: [
2554
+ /* @__PURE__ */ jsx25(Text18, { color: isSelected ? colors.accent.bright : colors.text.primary, children: agent.nickname }),
2555
+ /* @__PURE__ */ jsx25(Text18, { color: colors.text.dim, children: " " }),
2556
+ /* @__PURE__ */ jsx25(Text18, { color: colors.surface.border, children: "[" }),
2557
+ /* @__PURE__ */ jsx25(Text18, { color: providerHue, children: providerLabel }),
2558
+ /* @__PURE__ */ jsx25(Text18, { color: colors.surface.border, children: "] [" }),
2559
+ /* @__PURE__ */ jsx25(Text18, { color: modelHue, children: modelBadgeLabel(agent.model) }),
2560
+ /* @__PURE__ */ jsx25(Text18, { color: colors.surface.border, children: "]" })
2501
2561
  ] }),
2502
- /* @__PURE__ */ jsx24(Box19, { marginTop: space.sm, children: lines.length === 0 ? /* @__PURE__ */ jsx24(Text17, { color: colors.text.dim, children: "(no output yet)" }) : /* @__PURE__ */ jsx24(Box19, { flexDirection: "column", children: lines.map((line, lineIdx) => /* @__PURE__ */ jsx24(Text17, { color: colors.text.dim, children: line }, lineIdx)) }) })
2562
+ /* @__PURE__ */ jsx25(Box20, { marginTop: space.sm, children: lines.length === 0 ? /* @__PURE__ */ jsx25(Text18, { color: colors.text.dim, children: translatePhrase(language, "(no output yet)") }) : /* @__PURE__ */ jsx25(Box20, { flexDirection: "column", children: lines.map((line, lineIdx) => /* @__PURE__ */ jsx25(Text18, { color: colors.text.dim, children: line }, lineIdx)) }) })
2503
2563
  ] }) }) }, agent.id);
2504
2564
  }),
2505
- totalPages > 1 && /* @__PURE__ */ jsx24(
2565
+ totalPages > 1 && /* @__PURE__ */ jsx25(
2506
2566
  Pagination,
2507
2567
  {
2508
2568
  page: activePage,
@@ -2518,12 +2578,12 @@ function RunOutput() {
2518
2578
  }
2519
2579
  }
2520
2580
  ),
2521
- /* @__PURE__ */ jsx24(Section, { label: "Actions" }),
2581
+ /* @__PURE__ */ jsx25(Section, { label: "Actions" }),
2522
2582
  ["Refresh", "Back"].map((action, idx) => {
2523
2583
  const actionRowIdx = pagedAgents.length + paginOffset + 1 + idx;
2524
2584
  const isSelected = selectedIdx === actionRowIdx;
2525
2585
  const hint = action === "Refresh" ? "peek all agents now" : "return to run hub";
2526
- return /* @__PURE__ */ jsx24(
2586
+ return /* @__PURE__ */ jsx25(
2527
2587
  Row,
2528
2588
  {
2529
2589
  selected: isSelected,
@@ -2534,16 +2594,16 @@ function RunOutput() {
2534
2594
  action
2535
2595
  );
2536
2596
  }),
2537
- /* @__PURE__ */ jsx24(SectionEnd, {})
2597
+ /* @__PURE__ */ jsx25(SectionEnd, {})
2538
2598
  ] })
2539
2599
  }
2540
2600
  );
2541
2601
  }
2542
2602
 
2543
- // src/screens/AgentDetail.tsx
2544
- import React17, { useState as useState14 } from "react";
2545
- import { Box as Box20, Text as Text18, useInput as useInput10, useWindowSize as useWindowSize9 } from "ink";
2546
- import { jsx as jsx25, jsxs as jsxs19 } from "react/jsx-runtime";
2603
+ // src/tui/screens/AgentDetail.tsx
2604
+ import React18, { useState as useState14 } from "react";
2605
+ import { Box as Box21, Text as Text19, useInput as useInput10, useWindowSize as useWindowSize9 } from "ink";
2606
+ import { jsx as jsx26, jsxs as jsxs20 } from "react/jsx-runtime";
2547
2607
  var LABELS2 = {
2548
2608
  Output: "Output",
2549
2609
  Task: "Prompt",
@@ -2561,6 +2621,7 @@ var ACTION_LABEL_WIDTH5 = Math.max(
2561
2621
  function AgentDetail() {
2562
2622
  const { selectedAgentId, push, pop } = useRouter();
2563
2623
  const { toast } = useToast();
2624
+ const { t, language } = useLanguage();
2564
2625
  const { rows: termRows } = useWindowSize9();
2565
2626
  const bodyRows = frameBodyRows(termRows, true, true);
2566
2627
  const compactBody = bodyRows <= 8;
@@ -2657,14 +2718,14 @@ function AgentDetail() {
2657
2718
  }
2658
2719
  });
2659
2720
  if (!agent || !run) {
2660
- return /* @__PURE__ */ jsx25(
2721
+ return /* @__PURE__ */ jsx26(
2661
2722
  Frame,
2662
2723
  {
2663
2724
  breadcrumb: ["ReevesAgents", "Runs"],
2664
2725
  statusContext: "Agent not found",
2665
- children: /* @__PURE__ */ jsxs19(Box20, { flexDirection: "column", children: [
2666
- /* @__PURE__ */ jsx25(Text18, { color: colors.text.dim, children: "Agent not found." }),
2667
- /* @__PURE__ */ jsx25(Box20, { marginTop: 1, children: /* @__PURE__ */ jsx25(
2726
+ children: /* @__PURE__ */ jsxs20(Box21, { flexDirection: "column", children: [
2727
+ /* @__PURE__ */ jsx26(Text19, { color: colors.text.dim, children: translatePhrase(language, "Agent not found.") }),
2728
+ /* @__PURE__ */ jsx26(Box21, { marginTop: 1, children: /* @__PURE__ */ jsx26(
2668
2729
  Row,
2669
2730
  {
2670
2731
  selected: selectedIdx === 0,
@@ -2700,7 +2761,7 @@ function AgentDetail() {
2700
2761
  };
2701
2762
  statusContext = actionLabels[selected.action] || "";
2702
2763
  }
2703
- return /* @__PURE__ */ jsx25(
2764
+ return /* @__PURE__ */ jsx26(
2704
2765
  Frame,
2705
2766
  {
2706
2767
  breadcrumb: ["ReevesAgents", "Runs", run.name, "Agents", agent.nickname],
@@ -2708,11 +2769,11 @@ function AgentDetail() {
2708
2769
  { label: "provider", value: providerLabel },
2709
2770
  { label: "status", value: agent.task_status }
2710
2771
  ],
2711
- tagline: `${providerLabel} agent in ${run.name}. Open output, prompt, or lifecycle actions.`,
2772
+ tagline: t("agentDetail.tagline", { provider: providerLabel, name: run.name }),
2712
2773
  statusContext,
2713
2774
  statusKeys: "\u2191\u2193 move \xB7 enter select \xB7 esc back",
2714
- children: compactBody ? /* @__PURE__ */ jsxs19(Box20, { flexDirection: "column", children: [
2715
- /* @__PURE__ */ jsx25(Section, { label: selectedIdx < 2 ? "Agent" : "Actions" }),
2775
+ children: compactBody ? /* @__PURE__ */ jsxs20(Box21, { flexDirection: "column", children: [
2776
+ /* @__PURE__ */ jsx26(Section, { label: selectedIdx < 2 ? "Agent" : "Actions" }),
2716
2777
  visibleCompactItems.map(({ item, itemIdx }) => {
2717
2778
  const hints = {
2718
2779
  Output: isHeadless ? "no output" : "live peek of the tmux pane",
@@ -2723,7 +2784,7 @@ function AgentDetail() {
2723
2784
  "__section__": ""
2724
2785
  };
2725
2786
  const primary = item.action === "AgentLifecycle" && isAgentEnded ? "Delete Agent" : LABELS2[item.action];
2726
- return /* @__PURE__ */ jsx25(
2787
+ return /* @__PURE__ */ jsx26(
2727
2788
  Row,
2728
2789
  {
2729
2790
  selected: selectedIdx === itemIdx,
@@ -2736,25 +2797,25 @@ function AgentDetail() {
2736
2797
  item.action
2737
2798
  );
2738
2799
  }),
2739
- /* @__PURE__ */ jsx25(SectionEnd, {})
2740
- ] }) : /* @__PURE__ */ jsxs19(Box20, { flexDirection: "column", children: [
2741
- /* @__PURE__ */ jsxs19(Box20, { flexDirection: "column", marginBottom: 1, children: [
2742
- /* @__PURE__ */ jsxs19(Text18, { wrap: "truncate-end", children: [
2743
- /* @__PURE__ */ jsx25(Text18, { color: colors.surface.border, children: "[" }),
2744
- /* @__PURE__ */ jsx25(Text18, { color: providerColor(agent.provider), children: providerLabel }),
2745
- /* @__PURE__ */ jsx25(Text18, { color: colors.surface.border, children: "] [" }),
2746
- /* @__PURE__ */ jsx25(Text18, { color: modelColor(agent.model, agent.provider), children: modelBadgeLabel(agent.model) }),
2747
- /* @__PURE__ */ jsx25(Text18, { color: colors.surface.border, children: "]" })
2800
+ /* @__PURE__ */ jsx26(SectionEnd, {})
2801
+ ] }) : /* @__PURE__ */ jsxs20(Box21, { flexDirection: "column", children: [
2802
+ /* @__PURE__ */ jsxs20(Box21, { flexDirection: "column", marginBottom: 1, children: [
2803
+ /* @__PURE__ */ jsxs20(Text19, { wrap: "truncate-end", children: [
2804
+ /* @__PURE__ */ jsx26(Text19, { color: colors.surface.border, children: "[" }),
2805
+ /* @__PURE__ */ jsx26(Text19, { color: providerColor(agent.provider), children: providerLabel }),
2806
+ /* @__PURE__ */ jsx26(Text19, { color: colors.surface.border, children: "] [" }),
2807
+ /* @__PURE__ */ jsx26(Text19, { color: modelColor(agent.model, agent.provider), children: modelBadgeLabel(agent.model) }),
2808
+ /* @__PURE__ */ jsx26(Text19, { color: colors.surface.border, children: "]" })
2748
2809
  ] }),
2749
- /* @__PURE__ */ jsx25(Text18, { color: colors.text.dim, wrap: "truncate-end", children: summaryLine })
2810
+ /* @__PURE__ */ jsx26(Text19, { color: colors.text.dim, wrap: "truncate-end", children: summaryLine })
2750
2811
  ] }),
2751
- /* @__PURE__ */ jsx25(Section, { label: "Agent" }),
2812
+ /* @__PURE__ */ jsx26(Section, { label: "Agent" }),
2752
2813
  items.map((item, idx) => {
2753
2814
  const isSelected = selectedIdx === idx;
2754
2815
  if (item.action === "__section__") {
2755
- return /* @__PURE__ */ jsxs19(React17.Fragment, { children: [
2756
- /* @__PURE__ */ jsx25(SectionEnd, {}),
2757
- /* @__PURE__ */ jsx25(Section, { label: "Actions" })
2816
+ return /* @__PURE__ */ jsxs20(React18.Fragment, { children: [
2817
+ /* @__PURE__ */ jsx26(SectionEnd, {}),
2818
+ /* @__PURE__ */ jsx26(Section, { label: "Actions" })
2758
2819
  ] }, "__section__");
2759
2820
  }
2760
2821
  const hints = {
@@ -2766,7 +2827,7 @@ function AgentDetail() {
2766
2827
  "__section__": ""
2767
2828
  };
2768
2829
  const primary = item.action === "AgentLifecycle" && isAgentEnded ? "Delete Agent" : LABELS2[item.action];
2769
- return /* @__PURE__ */ jsx25(
2830
+ return /* @__PURE__ */ jsx26(
2770
2831
  Row,
2771
2832
  {
2772
2833
  selected: isSelected,
@@ -2779,22 +2840,23 @@ function AgentDetail() {
2779
2840
  item.action
2780
2841
  );
2781
2842
  }),
2782
- /* @__PURE__ */ jsx25(SectionEnd, {})
2843
+ /* @__PURE__ */ jsx26(SectionEnd, {})
2783
2844
  ] })
2784
2845
  }
2785
2846
  );
2786
2847
  }
2787
2848
 
2788
- // src/screens/run/agent/Output.tsx
2849
+ // src/tui/screens/run/AgentOutput.tsx
2789
2850
  import { useEffect as useEffect8, useState as useState15 } from "react";
2790
- import { Box as Box21, Text as Text19, useInput as useInput11, useWindowSize as useWindowSize10 } from "ink";
2791
- import { Fragment as Fragment4, jsx as jsx26, jsxs as jsxs20 } from "react/jsx-runtime";
2851
+ import { Box as Box22, Text as Text20, useInput as useInput11, useWindowSize as useWindowSize10 } from "ink";
2852
+ import { Fragment as Fragment4, jsx as jsx27, jsxs as jsxs21 } from "react/jsx-runtime";
2792
2853
  var PEEK_INTERVAL_MS2 = 5e3;
2793
2854
  var DETAIL_LINES = 50;
2794
2855
  var ACTION_LABEL_WIDTH6 = Math.max("Refresh Now".length, "Open Agent".length, "Back".length);
2795
2856
  function AgentOutput() {
2796
2857
  const { selectedAgentId, pop } = useRouter();
2797
2858
  const { toast } = useToast();
2859
+ const { language, t } = useLanguage();
2798
2860
  const { rows: termRows } = useWindowSize10();
2799
2861
  const bodyRows = frameBodyRows(termRows, true, true);
2800
2862
  const compactBody = bodyRows <= 9;
@@ -2916,14 +2978,14 @@ function AgentOutput() {
2916
2978
  }
2917
2979
  });
2918
2980
  if (!agent || !run) {
2919
- return /* @__PURE__ */ jsx26(
2981
+ return /* @__PURE__ */ jsx27(
2920
2982
  Frame,
2921
2983
  {
2922
2984
  breadcrumb: ["ReevesAgents", "Runs"],
2923
2985
  statusContext: "Agent not found",
2924
- children: /* @__PURE__ */ jsxs20(Box21, { flexDirection: "column", children: [
2925
- /* @__PURE__ */ jsx26(Text19, { color: colors.text.dim, children: "Agent not found." }),
2926
- /* @__PURE__ */ jsx26(Box21, { marginTop: 1, children: /* @__PURE__ */ jsx26(
2986
+ children: /* @__PURE__ */ jsxs21(Box22, { flexDirection: "column", children: [
2987
+ /* @__PURE__ */ jsx27(Text20, { color: colors.text.dim, children: translatePhrase(language, "Agent not found.") }),
2988
+ /* @__PURE__ */ jsx27(Box22, { marginTop: 1, children: /* @__PURE__ */ jsx27(
2927
2989
  Row,
2928
2990
  {
2929
2991
  selected: true,
@@ -2939,9 +3001,9 @@ function AgentOutput() {
2939
3001
  const isAgentEnded = agent.ended_at !== null;
2940
3002
  const canOpenAgent = !isAgentEnded && !isHeadless && !!agent.tmux_window_id;
2941
3003
  const openDisabledHint = isAgentEnded ? "agent has ended" : "no tmux window";
2942
- let statusContext = `${agent.nickname} \xB7 output`;
3004
+ let statusContext = `${agent.nickname} \xB7 ${t("runtime.output")}`;
2943
3005
  if (selected?.type === "pagination") {
2944
- statusContext = `output page ${activePage} of ${totalPages} \xB7 \u2190 \u2192 turn page`;
3006
+ statusContext = t("runtime.outputPageNav", { page: activePage, total: totalPages });
2945
3007
  } else if (selected?.type === "action") {
2946
3008
  const actionLabels = {
2947
3009
  RefreshNow: "fetch output now",
@@ -2955,7 +3017,7 @@ function AgentOutput() {
2955
3017
  const providerHue = providerColor(agent.provider);
2956
3018
  const modelHue = modelColor(agent.model, agent.provider);
2957
3019
  const providerLabel = providerDisplayName(agent.provider);
2958
- return /* @__PURE__ */ jsxs20(
3020
+ return /* @__PURE__ */ jsxs21(
2959
3021
  Frame,
2960
3022
  {
2961
3023
  breadcrumb: ["ReevesAgents", "Runs", run.name, "Agents", agent.nickname, "Output"],
@@ -2967,19 +3029,19 @@ function AgentOutput() {
2967
3029
  statusContext,
2968
3030
  statusKeys: "\u2191\u2193 move \xB7 \u2190\u2192 output pages \xB7 enter select \xB7 esc back",
2969
3031
  children: [
2970
- !compactBody && /* @__PURE__ */ jsxs20(Fragment4, { children: [
2971
- /* @__PURE__ */ jsxs20(Box21, { flexDirection: "column", marginBottom: 2, children: [
2972
- /* @__PURE__ */ jsx26(Box21, { marginBottom: 1, children: /* @__PURE__ */ jsxs20(Text19, { wrap: "truncate-end", children: [
2973
- /* @__PURE__ */ jsx26(Text19, { color: colors.text.primary, bold: true, children: agent.nickname }),
2974
- /* @__PURE__ */ jsx26(Text19, { color: colors.text.dim, children: " " }),
2975
- /* @__PURE__ */ jsx26(Text19, { color: colors.surface.border, children: "[" }),
2976
- /* @__PURE__ */ jsx26(Text19, { color: providerHue, children: providerLabel }),
2977
- /* @__PURE__ */ jsx26(Text19, { color: colors.surface.border, children: "] [" }),
2978
- /* @__PURE__ */ jsx26(Text19, { color: modelHue, children: modelBadgeLabel(agent.model) }),
2979
- /* @__PURE__ */ jsx26(Text19, { color: colors.surface.border, children: "]" })
3032
+ !compactBody && /* @__PURE__ */ jsxs21(Fragment4, { children: [
3033
+ /* @__PURE__ */ jsxs21(Box22, { flexDirection: "column", marginBottom: 2, children: [
3034
+ /* @__PURE__ */ jsx27(Box22, { marginBottom: 1, children: /* @__PURE__ */ jsxs21(Text20, { wrap: "truncate-end", children: [
3035
+ /* @__PURE__ */ jsx27(Text20, { color: colors.text.primary, bold: true, children: agent.nickname }),
3036
+ /* @__PURE__ */ jsx27(Text20, { color: colors.text.dim, children: " " }),
3037
+ /* @__PURE__ */ jsx27(Text20, { color: colors.surface.border, children: "[" }),
3038
+ /* @__PURE__ */ jsx27(Text20, { color: providerHue, children: providerLabel }),
3039
+ /* @__PURE__ */ jsx27(Text20, { color: colors.surface.border, children: "] [" }),
3040
+ /* @__PURE__ */ jsx27(Text20, { color: modelHue, children: modelBadgeLabel(agent.model) }),
3041
+ /* @__PURE__ */ jsx27(Text20, { color: colors.surface.border, children: "]" })
2980
3042
  ] }) }),
2981
- /* @__PURE__ */ jsxs20(
2982
- Box21,
3043
+ /* @__PURE__ */ jsxs21(
3044
+ Box22,
2983
3045
  {
2984
3046
  borderStyle: "round",
2985
3047
  borderColor: providerHue,
@@ -2988,13 +3050,13 @@ function AgentOutput() {
2988
3050
  height: visibleLineCount + 2,
2989
3051
  overflow: "hidden",
2990
3052
  children: [
2991
- visibleOutputLines.map((line, idx) => /* @__PURE__ */ jsx26(Text19, { color: colors.text.dim, children: line }, idx)),
2992
- visibleOutputLines.length === 0 && /* @__PURE__ */ jsx26(Text19, { color: colors.text.muted, children: "(no output yet)" })
3053
+ visibleOutputLines.map((line, idx) => /* @__PURE__ */ jsx27(Text20, { color: colors.text.dim, children: line }, idx)),
3054
+ visibleOutputLines.length === 0 && /* @__PURE__ */ jsx27(Text20, { color: colors.text.muted, children: translatePhrase(language, "(no output yet)") })
2993
3055
  ]
2994
3056
  }
2995
3057
  )
2996
3058
  ] }),
2997
- showPagination && /* @__PURE__ */ jsx26(
3059
+ showPagination && /* @__PURE__ */ jsx27(
2998
3060
  Pagination,
2999
3061
  {
3000
3062
  page: activePage,
@@ -3005,8 +3067,8 @@ function AgentOutput() {
3005
3067
  }
3006
3068
  )
3007
3069
  ] }),
3008
- /* @__PURE__ */ jsx26(Section, { label: "Actions" }),
3009
- /* @__PURE__ */ jsxs20(Box21, { flexDirection: "column", children: [
3070
+ /* @__PURE__ */ jsx27(Section, { label: "Actions" }),
3071
+ /* @__PURE__ */ jsxs21(Box22, { flexDirection: "column", children: [
3010
3072
  actionItems.map((item, idx) => {
3011
3073
  const rowIdx = idx + paginOffset;
3012
3074
  const isSelected = selectedIdx === rowIdx;
@@ -3020,7 +3082,7 @@ function AgentOutput() {
3020
3082
  OpenCLI: "Open Agent",
3021
3083
  Back: "Back"
3022
3084
  };
3023
- return /* @__PURE__ */ jsx26(
3085
+ return /* @__PURE__ */ jsx27(
3024
3086
  Row,
3025
3087
  {
3026
3088
  selected: isSelected,
@@ -3032,19 +3094,20 @@ function AgentOutput() {
3032
3094
  item.action
3033
3095
  );
3034
3096
  }),
3035
- /* @__PURE__ */ jsx26(SectionEnd, {})
3097
+ /* @__PURE__ */ jsx27(SectionEnd, {})
3036
3098
  ] })
3037
3099
  ]
3038
3100
  }
3039
3101
  );
3040
3102
  }
3041
3103
 
3042
- // src/screens/run/agent/Task.tsx
3104
+ // src/tui/screens/run/AgentTask.tsx
3043
3105
  import { useState as useState16 } from "react";
3044
- import { Box as Box22, Text as Text20, useInput as useInput12 } from "ink";
3045
- import { jsx as jsx27, jsxs as jsxs21 } from "react/jsx-runtime";
3106
+ import { Box as Box23, Text as Text21, useInput as useInput12 } from "ink";
3107
+ import { jsx as jsx28, jsxs as jsxs22 } from "react/jsx-runtime";
3046
3108
  function AgentTask() {
3047
3109
  const { selectedAgentId, pop } = useRouter();
3110
+ const { language, t } = useLanguage();
3048
3111
  const [agent] = useState16(
3049
3112
  () => selectedAgentId ? (() => {
3050
3113
  try {
@@ -3069,44 +3132,44 @@ function AgentTask() {
3069
3132
  }
3070
3133
  });
3071
3134
  if (!agent || !run) {
3072
- return /* @__PURE__ */ jsx27(Frame, { breadcrumb: ["ReevesAgents", "Runs"], statusContext: "Agent not found", children: /* @__PURE__ */ jsxs21(Box22, { flexDirection: "column", children: [
3073
- /* @__PURE__ */ jsx27(Text20, { color: colors.text.dim, children: "Agent not found." }),
3074
- /* @__PURE__ */ jsx27(Box22, { marginTop: 1, children: /* @__PURE__ */ jsx27(Row, { selected: true, primary: "Back", hint: "return to agent detail" }) })
3135
+ return /* @__PURE__ */ jsx28(Frame, { breadcrumb: ["ReevesAgents", "Runs"], statusContext: "Agent not found", children: /* @__PURE__ */ jsxs22(Box23, { flexDirection: "column", children: [
3136
+ /* @__PURE__ */ jsx28(Text21, { color: colors.text.dim, children: translatePhrase(language, "Agent not found.") }),
3137
+ /* @__PURE__ */ jsx28(Box23, { marginTop: 1, children: /* @__PURE__ */ jsx28(Row, { selected: true, primary: "Back", hint: "return to agent detail" }) })
3075
3138
  ] }) });
3076
3139
  }
3077
- return /* @__PURE__ */ jsx27(
3140
+ return /* @__PURE__ */ jsx28(
3078
3141
  Frame,
3079
3142
  {
3080
3143
  breadcrumb: ["ReevesAgents", "Runs", run.name, "Agents", agent.nickname, "Prompt"],
3081
3144
  meta: [{ label: "status", value: agent.task_status }],
3082
3145
  tagline: "Read-only view of this agent's initial prompt and current status.",
3083
3146
  statusKeys: "enter/esc back",
3084
- children: /* @__PURE__ */ jsxs21(Box22, { flexDirection: "column", children: [
3085
- /* @__PURE__ */ jsx27(Section, { label: "Prompt" }),
3086
- /* @__PURE__ */ jsx27(Row, { selected: false, primary: "Prompt", trailing: agent.task || "(no prompt)" }),
3087
- /* @__PURE__ */ jsx27(Row, { selected: false, primary: "Status", trailing: agent.task_status }),
3088
- /* @__PURE__ */ jsx27(Row, { selected: false, primary: "Note", trailing: agent.task_note || "(no note)" }),
3089
- /* @__PURE__ */ jsx27(
3147
+ children: /* @__PURE__ */ jsxs22(Box23, { flexDirection: "column", children: [
3148
+ /* @__PURE__ */ jsx28(Section, { label: "Prompt" }),
3149
+ /* @__PURE__ */ jsx28(Row, { selected: false, primary: "Prompt", trailing: agent.task || "(no prompt)" }),
3150
+ /* @__PURE__ */ jsx28(Row, { selected: false, primary: "Status", trailing: agent.task_status }),
3151
+ /* @__PURE__ */ jsx28(Row, { selected: false, primary: "Note", trailing: agent.task_note || "(no note)" }),
3152
+ /* @__PURE__ */ jsx28(
3090
3153
  Row,
3091
3154
  {
3092
3155
  selected: false,
3093
3156
  primary: "Last seen",
3094
- trailing: agent.last_seen ? `${Math.round((Date.now() - agent.last_seen) / 1e3)}s ago` : "never"
3157
+ trailing: agent.last_seen ? t("runtime.secondsAgo", { seconds: Math.round((Date.now() - agent.last_seen) / 1e3) }) : "never"
3095
3158
  }
3096
3159
  ),
3097
- /* @__PURE__ */ jsx27(SectionEnd, {}),
3098
- /* @__PURE__ */ jsx27(Section, { label: "Actions" }),
3099
- /* @__PURE__ */ jsx27(Row, { selected: true, primary: "Back", hint: "return to agent detail" }),
3100
- /* @__PURE__ */ jsx27(SectionEnd, {})
3160
+ /* @__PURE__ */ jsx28(SectionEnd, {}),
3161
+ /* @__PURE__ */ jsx28(Section, { label: "Actions" }),
3162
+ /* @__PURE__ */ jsx28(Row, { selected: true, primary: "Back", hint: "return to agent detail" }),
3163
+ /* @__PURE__ */ jsx28(SectionEnd, {})
3101
3164
  ] })
3102
3165
  }
3103
3166
  );
3104
3167
  }
3105
3168
 
3106
- // src/screens/run/agent/Kill.tsx
3169
+ // src/tui/screens/run/AgentKill.tsx
3107
3170
  import { useState as useState17 } from "react";
3108
- import { Box as Box23, Text as Text21, useInput as useInput13 } from "ink";
3109
- import { jsx as jsx28, jsxs as jsxs22 } from "react/jsx-runtime";
3171
+ import { Box as Box24, Text as Text22, useInput as useInput13 } from "ink";
3172
+ import { jsx as jsx29, jsxs as jsxs23 } from "react/jsx-runtime";
3110
3173
  function AgentKill() {
3111
3174
  const { selectedAgentId, pop, resetStack } = useRouter();
3112
3175
  const { language, t } = useLanguage();
@@ -3152,14 +3215,14 @@ function AgentKill() {
3152
3215
  }
3153
3216
  });
3154
3217
  if (!agent || !run) {
3155
- return /* @__PURE__ */ jsx28(
3218
+ return /* @__PURE__ */ jsx29(
3156
3219
  Frame,
3157
3220
  {
3158
3221
  breadcrumb: ["ReevesAgents", "Runs"],
3159
3222
  statusContext: "Agent not found",
3160
- children: /* @__PURE__ */ jsxs22(Box23, { flexDirection: "column", children: [
3161
- /* @__PURE__ */ jsx28(Text21, { color: colors.text.dim, children: "Agent not found." }),
3162
- /* @__PURE__ */ jsx28(Box23, { marginTop: 1, children: /* @__PURE__ */ jsx28(
3223
+ children: /* @__PURE__ */ jsxs23(Box24, { flexDirection: "column", children: [
3224
+ /* @__PURE__ */ jsx29(Text22, { color: colors.text.dim, children: translatePhrase(language, "Agent not found.") }),
3225
+ /* @__PURE__ */ jsx29(Box24, { marginTop: 1, children: /* @__PURE__ */ jsx29(
3163
3226
  Row,
3164
3227
  {
3165
3228
  selected: true,
@@ -3173,12 +3236,12 @@ function AgentKill() {
3173
3236
  }
3174
3237
  const isAgentEnded = agent.ended_at !== null;
3175
3238
  const isLastLiveAgent = !isAgentEnded && listAgents(agent.run_id).filter((item) => !item.ended_at).length <= 1;
3176
- return /* @__PURE__ */ jsx28(
3239
+ return /* @__PURE__ */ jsx29(
3177
3240
  Frame,
3178
3241
  {
3179
3242
  breadcrumb: ["ReevesAgents", "Runs", run.name, "Agents", agent.nickname, isAgentEnded ? "Delete" : "Stop"],
3180
3243
  statusKeys: "\u2190\u2192 switch \xB7 enter select \xB7 esc cancel",
3181
- children: /* @__PURE__ */ jsx28(
3244
+ children: /* @__PURE__ */ jsx29(
3182
3245
  Dialog,
3183
3246
  {
3184
3247
  title: t(isAgentEnded ? "agentKill.deleteTitle" : "agentKill.stopTitle", { name: agent.nickname }),
@@ -3194,44 +3257,44 @@ function AgentKill() {
3194
3257
  );
3195
3258
  }
3196
3259
 
3197
- // src/screens/NewRun.tsx
3260
+ // src/tui/screens/NewRun.tsx
3198
3261
  import { useEffect as useEffect9 } from "react";
3199
- import { Text as Text22 } from "ink";
3200
- import { jsx as jsx29 } from "react/jsx-runtime";
3262
+ import { Text as Text23 } from "ink";
3263
+ import { jsx as jsx30 } from "react/jsx-runtime";
3201
3264
  function NewRunInner() {
3202
3265
  const { replace } = useRouter();
3203
3266
  useEffect9(() => {
3204
3267
  replace("NewRunBasics");
3205
3268
  }, [replace]);
3206
- return /* @__PURE__ */ jsx29(Frame, { breadcrumb: ["ReevesAgents", "New Run"], children: /* @__PURE__ */ jsx29(Text22, { children: "Starting wizard..." }) });
3269
+ return /* @__PURE__ */ jsx30(Frame, { breadcrumb: ["ReevesAgents", "New Run"], children: /* @__PURE__ */ jsx30(Text23, { children: "Starting wizard..." }) });
3207
3270
  }
3208
3271
  function NewRun() {
3209
- return /* @__PURE__ */ jsx29(WizardProvider, { children: /* @__PURE__ */ jsx29(NewRunInner, {}) });
3272
+ return /* @__PURE__ */ jsx30(WizardProvider, { children: /* @__PURE__ */ jsx30(NewRunInner, {}) });
3210
3273
  }
3211
3274
 
3212
- // src/screens/newrun/02Basics.tsx
3275
+ // src/tui/screens/newrun/02Basics.tsx
3213
3276
  import { useState as useState19, useMemo as useMemo4 } from "react";
3214
3277
  import { useInput as useInput15, useWindowSize as useWindowSize11 } from "ink";
3215
3278
 
3216
- // src/components/StepIndicator.tsx
3217
- import { Box as Box24, Text as Text23 } from "ink";
3218
- import { jsx as jsx30, jsxs as jsxs23 } from "react/jsx-runtime";
3279
+ // src/tui/components/StepIndicator.tsx
3280
+ import { Box as Box25, Text as Text24 } from "ink";
3281
+ import { jsx as jsx31, jsxs as jsxs24 } from "react/jsx-runtime";
3219
3282
  function StepIndicator({ step, total, name }) {
3220
3283
  const { language } = useLanguage();
3221
3284
  const displayName = translatePhrase(language, name);
3222
- return /* @__PURE__ */ jsxs23(Box24, { children: [
3223
- /* @__PURE__ */ jsx30(Text23, { color: colors.accent.bright, children: step }),
3224
- /* @__PURE__ */ jsx30(Text23, { children: " / " }),
3225
- /* @__PURE__ */ jsx30(Text23, { color: colors.text.muted, children: total }),
3226
- /* @__PURE__ */ jsx30(Text23, { children: " \xB7 " }),
3227
- /* @__PURE__ */ jsx30(Text23, { color: colors.accent.primary, bold: true, children: displayName })
3285
+ return /* @__PURE__ */ jsxs24(Box25, { children: [
3286
+ /* @__PURE__ */ jsx31(Text24, { color: colors.accent.bright, children: step }),
3287
+ /* @__PURE__ */ jsx31(Text24, { children: " / " }),
3288
+ /* @__PURE__ */ jsx31(Text24, { color: colors.text.muted, children: total }),
3289
+ /* @__PURE__ */ jsx31(Text24, { children: " \xB7 " }),
3290
+ /* @__PURE__ */ jsx31(Text24, { color: colors.accent.primary, bold: true, children: displayName })
3228
3291
  ] });
3229
3292
  }
3230
3293
 
3231
- // src/components/TextField.tsx
3294
+ // src/tui/components/TextField.tsx
3232
3295
  import { useState as useState18, useEffect as useEffect10 } from "react";
3233
- import { Box as Box25, Text as Text24, useInput as useInput14 } from "ink";
3234
- import { jsx as jsx31, jsxs as jsxs24 } from "react/jsx-runtime";
3296
+ import { Box as Box26, Text as Text25, useInput as useInput14 } from "ink";
3297
+ import { jsx as jsx32, jsxs as jsxs25 } from "react/jsx-runtime";
3235
3298
  function TextField({
3236
3299
  label,
3237
3300
  value,
@@ -3298,21 +3361,21 @@ function TextField({
3298
3361
  const displayHelpText = helpText ? translatePhrase(language, helpText) : helpText;
3299
3362
  const labelText = `${displayLabel}${required ? " *" : ""}`;
3300
3363
  const contentWidth = Math.max(1, width - 6);
3301
- const labelWidth = Math.max(1, Math.min(Math.max(12, labelText.length), Math.floor(contentWidth * 0.35)));
3364
+ const labelWidth = Math.max(1, Math.min(Math.max(12, displayWidth(labelText)), Math.floor(contentWidth * 0.35)));
3302
3365
  const valueWidth = Math.max(1, contentWidth - labelWidth - sep.pipe.length);
3303
3366
  const lines = multiline ? wrapLines(displayValue, valueWidth) : [displayValue];
3304
- return /* @__PURE__ */ jsxs24(Box25, { flexDirection: "column", width, children: [
3305
- lines.map((line, idx) => /* @__PURE__ */ jsxs24(Box25, { flexDirection: "row", width, children: [
3306
- /* @__PURE__ */ jsx31(Box25, { width: 1, flexShrink: 0, children: /* @__PURE__ */ jsx31(Text24, { color: cursorColor, bold: selected && !editing, children: idx === 0 ? cursorChar : " " }) }),
3307
- /* @__PURE__ */ jsx31(Box25, { width: 2, flexShrink: 0, children: /* @__PURE__ */ jsx31(Text24, { color: railColor, children: " \u2502" }) }),
3308
- /* @__PURE__ */ jsxs24(Box25, { marginLeft: space.sm, flexDirection: "row", width: contentWidth, flexShrink: 1, children: [
3309
- /* @__PURE__ */ jsx31(Box25, { width: labelWidth, flexShrink: 0, children: idx === 0 ? /* @__PURE__ */ jsx31(Text24, { color: labelColor, bold: selected && editing, wrap: "truncate-end", children: labelText }) : /* @__PURE__ */ jsx31(Text24, { children: " " }) }),
3310
- /* @__PURE__ */ jsx31(Text24, { color: colors.text.faint, children: sep.pipe }),
3311
- /* @__PURE__ */ jsx31(Box25, { width: valueWidth, flexShrink: 1, children: /* @__PURE__ */ jsx31(Text24, { color: valueColor, wrap: "truncate-end", children: line }) })
3367
+ return /* @__PURE__ */ jsxs25(Box26, { flexDirection: "column", width, children: [
3368
+ lines.map((line, idx) => /* @__PURE__ */ jsxs25(Box26, { flexDirection: "row", width, children: [
3369
+ /* @__PURE__ */ jsx32(Box26, { width: 1, flexShrink: 0, children: /* @__PURE__ */ jsx32(Text25, { color: cursorColor, bold: selected && !editing, children: idx === 0 ? cursorChar : " " }) }),
3370
+ /* @__PURE__ */ jsx32(Box26, { width: 2, flexShrink: 0, children: /* @__PURE__ */ jsx32(Text25, { color: railColor, children: " \u2502" }) }),
3371
+ /* @__PURE__ */ jsxs25(Box26, { marginLeft: space.sm, flexDirection: "row", width: contentWidth, flexShrink: 1, children: [
3372
+ /* @__PURE__ */ jsx32(Box26, { width: labelWidth, flexShrink: 0, children: idx === 0 ? /* @__PURE__ */ jsx32(Text25, { color: labelColor, bold: selected && editing, wrap: "truncate-end", children: labelText }) : /* @__PURE__ */ jsx32(Text25, { children: " " }) }),
3373
+ /* @__PURE__ */ jsx32(Text25, { color: colors.text.faint, children: sep.pipe }),
3374
+ /* @__PURE__ */ jsx32(Box26, { width: valueWidth, flexShrink: 1, children: /* @__PURE__ */ jsx32(Text25, { color: valueColor, wrap: "truncate-end", children: line }) })
3312
3375
  ] }),
3313
- /* @__PURE__ */ jsx31(Box25, { width: 2, flexShrink: 0, children: /* @__PURE__ */ jsx31(Text24, { color: railColor, children: " \u2502" }) })
3376
+ /* @__PURE__ */ jsx32(Box26, { width: 2, flexShrink: 0, children: /* @__PURE__ */ jsx32(Text25, { color: railColor, children: " \u2502" }) })
3314
3377
  ] }, `${idx}-${line}`)),
3315
- selected && displayHelpText && /* @__PURE__ */ jsx31(Box25, { marginLeft: 4, marginTop: space.sm, width: Math.max(1, width - 4), children: /* @__PURE__ */ jsx31(Text24, { color: colors.text.dim, wrap: "truncate-end", children: displayHelpText }) })
3378
+ selected && displayHelpText && /* @__PURE__ */ jsx32(Box26, { marginLeft: 4, marginTop: space.sm, width: Math.max(1, width - 4), children: /* @__PURE__ */ jsx32(Text25, { color: colors.text.dim, wrap: "truncate-end", children: displayHelpText }) })
3316
3379
  ] });
3317
3380
  }
3318
3381
  function wrapLines(value, width) {
@@ -3330,12 +3393,13 @@ function wrapLines(value, width) {
3330
3393
  return lines.length > 0 ? lines : [""];
3331
3394
  }
3332
3395
 
3333
- // src/screens/newrun/02Basics.tsx
3334
- import { jsx as jsx32, jsxs as jsxs25 } from "react/jsx-runtime";
3396
+ // src/tui/screens/newrun/02Basics.tsx
3397
+ import { jsx as jsx33, jsxs as jsxs26 } from "react/jsx-runtime";
3335
3398
  var ACTION_LABEL_WIDTH7 = Math.max("Continue".length, "Back".length, "Reset Wizard".length);
3336
3399
  function NewRunBasics() {
3337
3400
  const { push, pop } = useRouter();
3338
3401
  const { toast } = useToast();
3402
+ const { t } = useLanguage();
3339
3403
  const { state, update, reset } = useWizard();
3340
3404
  const { rows: termRows } = useWindowSize11();
3341
3405
  const bodyRows = frameBodyRows(termRows, true, false);
@@ -3374,7 +3438,7 @@ function NewRunBasics() {
3374
3438
  function handleAction(id) {
3375
3439
  if (id === "continue") {
3376
3440
  if (!state.name.trim()) {
3377
- toast("Run name is required", "error");
3441
+ toast(t("newRun.nameRequired"), "error");
3378
3442
  return;
3379
3443
  }
3380
3444
  push("NewRunRoot");
@@ -3407,19 +3471,19 @@ function NewRunBasics() {
3407
3471
  }
3408
3472
  }
3409
3473
  });
3410
- return /* @__PURE__ */ jsxs25(
3474
+ return /* @__PURE__ */ jsxs26(
3411
3475
  Frame,
3412
3476
  {
3413
3477
  breadcrumb: ["ReevesAgents", "New Run", "Basics"],
3414
3478
  tagline: "Name the run and choose where its agents start.",
3415
3479
  statusKeys: "enter edit \xB7 \u2191\u2193 move \xB7 esc back",
3416
3480
  children: [
3417
- !compactBody && /* @__PURE__ */ jsx32(StepIndicator, { step: 1, total: 4, name: "Basics" }),
3418
- compactBody && /* @__PURE__ */ jsx32(Section, { label: selectedIdx < fields.length ? "Basics" : "Actions" }),
3481
+ !compactBody && /* @__PURE__ */ jsx33(StepIndicator, { step: 1, total: 4, name: "Basics" }),
3482
+ compactBody && /* @__PURE__ */ jsx33(Section, { label: selectedIdx < fields.length ? "Basics" : "Actions" }),
3419
3483
  (compactBody ? visibleRows : fields.map((_field, idx) => idx)).map((idx) => {
3420
3484
  if (idx < fields.length) {
3421
3485
  const field = fields[idx];
3422
- return /* @__PURE__ */ jsx32(
3486
+ return /* @__PURE__ */ jsx33(
3423
3487
  TextField,
3424
3488
  {
3425
3489
  label: field.label,
@@ -3436,7 +3500,7 @@ function NewRunBasics() {
3436
3500
  );
3437
3501
  }
3438
3502
  const action = actions[idx - fields.length];
3439
- return /* @__PURE__ */ jsx32(
3503
+ return /* @__PURE__ */ jsx33(
3440
3504
  Row,
3441
3505
  {
3442
3506
  selected: selectedIdx === idx,
@@ -3447,8 +3511,8 @@ function NewRunBasics() {
3447
3511
  action.id
3448
3512
  );
3449
3513
  }),
3450
- !compactBody && /* @__PURE__ */ jsx32(Section, { label: "Actions" }),
3451
- !compactBody && actions.map((action, idx) => /* @__PURE__ */ jsx32(
3514
+ !compactBody && /* @__PURE__ */ jsx33(Section, { label: "Actions" }),
3515
+ !compactBody && actions.map((action, idx) => /* @__PURE__ */ jsx33(
3452
3516
  Row,
3453
3517
  {
3454
3518
  selected: selectedIdx === fields.length + idx,
@@ -3458,18 +3522,18 @@ function NewRunBasics() {
3458
3522
  },
3459
3523
  action.id
3460
3524
  )),
3461
- /* @__PURE__ */ jsx32(SectionEnd, {})
3525
+ /* @__PURE__ */ jsx33(SectionEnd, {})
3462
3526
  ]
3463
3527
  }
3464
3528
  );
3465
3529
  }
3466
3530
 
3467
- // src/screens/newrun/03Root.tsx
3531
+ // src/tui/screens/newrun/03Root.tsx
3468
3532
  import { useState as useState20, useMemo as useMemo5 } from "react";
3469
3533
  import { useInput as useInput16, useWindowSize as useWindowSize12 } from "ink";
3470
3534
 
3471
- // src/components/ModelOptionList.tsx
3472
- import { Fragment as Fragment5, jsx as jsx33, jsxs as jsxs26 } from "react/jsx-runtime";
3535
+ // src/tui/components/ModelOptionList.tsx
3536
+ import { Fragment as Fragment5, jsx as jsx34, jsxs as jsxs27 } from "react/jsx-runtime";
3473
3537
  function ModelOptionList({ provider, values, current, selectedIdx, visibleCount }) {
3474
3538
  const rowCount = Math.max(1, visibleCount ?? values.length);
3475
3539
  const firstVisible = Math.min(
@@ -3477,11 +3541,11 @@ function ModelOptionList({ provider, values, current, selectedIdx, visibleCount
3477
3541
  Math.max(0, values.length - rowCount)
3478
3542
  );
3479
3543
  const visibleValues = values.slice(firstVisible, firstVisible + rowCount);
3480
- return /* @__PURE__ */ jsxs26(Fragment5, { children: [
3481
- /* @__PURE__ */ jsx33(Section, { label: "Model Options" }),
3544
+ return /* @__PURE__ */ jsxs27(Fragment5, { children: [
3545
+ /* @__PURE__ */ jsx34(Section, { label: "Model Options" }),
3482
3546
  visibleValues.map((model, localIdx) => {
3483
3547
  const idx = firstVisible + localIdx;
3484
- return /* @__PURE__ */ jsx33(
3548
+ return /* @__PURE__ */ jsx34(
3485
3549
  Row,
3486
3550
  {
3487
3551
  selected: selectedIdx === idx,
@@ -3492,7 +3556,7 @@ function ModelOptionList({ provider, values, current, selectedIdx, visibleCount
3492
3556
  model || "provider-default"
3493
3557
  );
3494
3558
  }),
3495
- values.length > rowCount && /* @__PURE__ */ jsx33(
3559
+ values.length > rowCount && /* @__PURE__ */ jsx34(
3496
3560
  Row,
3497
3561
  {
3498
3562
  selected: false,
@@ -3501,17 +3565,21 @@ function ModelOptionList({ provider, values, current, selectedIdx, visibleCount
3501
3565
  disabled: true
3502
3566
  }
3503
3567
  ),
3504
- /* @__PURE__ */ jsx33(SectionEnd, {})
3568
+ /* @__PURE__ */ jsx34(SectionEnd, {})
3505
3569
  ] });
3506
3570
  }
3507
3571
 
3508
- // src/screens/newrun/03Root.tsx
3509
- import { Fragment as Fragment6, jsx as jsx34, jsxs as jsxs27 } from "react/jsx-runtime";
3572
+ // src/tui/screens/newrun/03Root.tsx
3573
+ import { Fragment as Fragment6, jsx as jsx35, jsxs as jsxs28 } from "react/jsx-runtime";
3510
3574
  var PERMISSIONS_VALUES = ["ask", "skip"];
3511
3575
  var EFFORT_VALUES = ["default", "low", "medium", "high", "xhigh", "max"];
3576
+ var AUTH_MODE_VALUES = ["default", "api-key"];
3512
3577
  function permissionDisplay(value) {
3513
3578
  return value === "skip" ? "Skip prompts" : "Ask first";
3514
3579
  }
3580
+ function authModeDisplay(value) {
3581
+ return value === "api-key" ? "API key" : "Default login";
3582
+ }
3515
3583
  var ACTION_LABEL_WIDTH8 = Math.max("Continue".length, "Back".length, "Reset Wizard".length);
3516
3584
  function cycle(values, current, dir) {
3517
3585
  if (values.length === 0) return current;
@@ -3549,11 +3617,14 @@ function NewRunRoot() {
3549
3617
  hint: state.root.permissions === "skip" ? "trusted workspaces only" : "provider asks before sensitive actions"
3550
3618
  }
3551
3619
  ];
3620
+ if (state.root.provider === "cc") {
3621
+ list.push({ kind: "picker", id: "authMode", label: "Auth", current: state.root.authMode, values: AUTH_MODE_VALUES, display: authModeDisplay(state.root.authMode), hint: "api-key uses the API key instead of the default login" });
3622
+ }
3552
3623
  if (state.root.provider === "cc" || state.root.provider === "codex") {
3553
3624
  list.push({ kind: "picker", id: "effort", label: "Effort", current: state.root.effort, values: EFFORT_VALUES });
3554
3625
  }
3555
3626
  return list;
3556
- }, [state.root.provider, state.root.model, state.root.prompt, state.root.permissions, state.root.effort]);
3627
+ }, [state.root.provider, state.root.model, state.root.prompt, state.root.permissions, state.root.authMode, state.root.effort]);
3557
3628
  const actions = [
3558
3629
  { id: "continue", label: "Continue", hint: "to additional agents" },
3559
3630
  { id: "back", label: "Back", hint: "return to basics" },
@@ -3608,6 +3679,8 @@ function NewRunRoot() {
3608
3679
  updateRoot({ model: cycle(modelValuesForProvider(state.root.provider), state.root.model, dir) });
3609
3680
  } else if (id === "permissions") {
3610
3681
  updateRoot({ permissions: cycle(PERMISSIONS_VALUES, state.root.permissions, dir) });
3682
+ } else if (id === "authMode") {
3683
+ updateRoot({ authMode: cycle(AUTH_MODE_VALUES, state.root.authMode, dir) });
3611
3684
  } else if (id === "effort") {
3612
3685
  updateRoot({ effort: cycle(EFFORT_VALUES, state.root.effort, dir) });
3613
3686
  }
@@ -3675,15 +3748,15 @@ function NewRunRoot() {
3675
3748
  }
3676
3749
  }
3677
3750
  });
3678
- return /* @__PURE__ */ jsxs27(
3751
+ return /* @__PURE__ */ jsxs28(
3679
3752
  Frame,
3680
3753
  {
3681
3754
  breadcrumb: ["ReevesAgents", "New Run", "First Agent"],
3682
3755
  tagline: "Choose the provider, model, permissions, and first prompt.",
3683
3756
  statusKeys: modelPickerOpen ? "enter choose model \xB7 \u2191\u2193 move \xB7 esc close" : "enter edit/select \xB7 \u2190\u2192 quick cycle \xB7 esc done/back",
3684
3757
  children: [
3685
- !compactBody && /* @__PURE__ */ jsx34(StepIndicator, { step: 2, total: 4, name: "First Agent" }),
3686
- compactBody && modelPickerOpen ? /* @__PURE__ */ jsx34(
3758
+ !compactBody && /* @__PURE__ */ jsx35(StepIndicator, { step: 2, total: 4, name: "First Agent" }),
3759
+ compactBody && modelPickerOpen ? /* @__PURE__ */ jsx35(
3687
3760
  ModelOptionList,
3688
3761
  {
3689
3762
  provider: state.root.provider,
@@ -3692,12 +3765,12 @@ function NewRunRoot() {
3692
3765
  selectedIdx: modelPickerIdx,
3693
3766
  visibleCount: Math.max(1, bodyRows - 3)
3694
3767
  }
3695
- ) : /* @__PURE__ */ jsxs27(Fragment6, { children: [
3696
- compactBody && /* @__PURE__ */ jsx34(Section, { label: selectedIdx < fields.length ? "First Agent" : "Actions" }),
3768
+ ) : /* @__PURE__ */ jsxs28(Fragment6, { children: [
3769
+ compactBody && /* @__PURE__ */ jsx35(Section, { label: selectedIdx < fields.length ? "First Agent" : "Actions" }),
3697
3770
  (compactBody ? visibleRows.filter((idx) => idx < fields.length) : fields.map((_field, idx) => idx)).map((idx) => {
3698
3771
  const field = fields[idx];
3699
3772
  if (field.kind === "text") {
3700
- return /* @__PURE__ */ jsx34(
3773
+ return /* @__PURE__ */ jsx35(
3701
3774
  TextField,
3702
3775
  {
3703
3776
  label: field.label,
@@ -3715,7 +3788,7 @@ function NewRunRoot() {
3715
3788
  );
3716
3789
  }
3717
3790
  const badge = pickerBadge(field, state.root.provider);
3718
- return /* @__PURE__ */ jsx34(
3791
+ return /* @__PURE__ */ jsx35(
3719
3792
  Row,
3720
3793
  {
3721
3794
  selected: selectedIdx === idx,
@@ -3727,7 +3800,7 @@ function NewRunRoot() {
3727
3800
  field.id
3728
3801
  );
3729
3802
  }),
3730
- modelPickerOpen && !compactBody && /* @__PURE__ */ jsx34(
3803
+ modelPickerOpen && !compactBody && /* @__PURE__ */ jsx35(
3731
3804
  ModelOptionList,
3732
3805
  {
3733
3806
  provider: state.root.provider,
@@ -3736,10 +3809,10 @@ function NewRunRoot() {
3736
3809
  selectedIdx: modelPickerIdx
3737
3810
  }
3738
3811
  ),
3739
- !compactBody && /* @__PURE__ */ jsx34(Section, { label: "Actions" }),
3812
+ !compactBody && /* @__PURE__ */ jsx35(Section, { label: "Actions" }),
3740
3813
  compactBody ? visibleRows.filter((idx) => idx >= fields.length).map((idx) => {
3741
3814
  const action = actions[idx - fields.length];
3742
- return /* @__PURE__ */ jsx34(
3815
+ return /* @__PURE__ */ jsx35(
3743
3816
  Row,
3744
3817
  {
3745
3818
  selected: selectedIdx === idx,
@@ -3749,7 +3822,7 @@ function NewRunRoot() {
3749
3822
  },
3750
3823
  action.id
3751
3824
  );
3752
- }) : actions.map((action, idx) => /* @__PURE__ */ jsx34(
3825
+ }) : actions.map((action, idx) => /* @__PURE__ */ jsx35(
3753
3826
  Row,
3754
3827
  {
3755
3828
  selected: selectedIdx === fields.length + idx,
@@ -3759,7 +3832,7 @@ function NewRunRoot() {
3759
3832
  },
3760
3833
  action.id
3761
3834
  )),
3762
- /* @__PURE__ */ jsx34(SectionEnd, {})
3835
+ /* @__PURE__ */ jsx35(SectionEnd, {})
3763
3836
  ] })
3764
3837
  ]
3765
3838
  }
@@ -3771,10 +3844,10 @@ function pickerBadge(field, provider) {
3771
3844
  return void 0;
3772
3845
  }
3773
3846
 
3774
- // src/screens/newrun/04Workers.tsx
3847
+ // src/tui/screens/newrun/04Workers.tsx
3775
3848
  import { useState as useState21 } from "react";
3776
3849
  import { useInput as useInput17, useWindowSize as useWindowSize13 } from "ink";
3777
- import { Fragment as Fragment7, jsx as jsx35, jsxs as jsxs28 } from "react/jsx-runtime";
3850
+ import { Fragment as Fragment7, jsx as jsx36, jsxs as jsxs29 } from "react/jsx-runtime";
3778
3851
  var ACTION_LABEL_WIDTH9 = Math.max("Add Agent".length, "Continue".length, "Back".length, "Reset Wizard".length);
3779
3852
  function NewRunWorkers() {
3780
3853
  const { push, pop, setSelectedWorkerIdx } = useRouter();
@@ -3845,21 +3918,21 @@ function NewRunWorkers() {
3845
3918
  }
3846
3919
  }
3847
3920
  });
3848
- return /* @__PURE__ */ jsxs28(
3921
+ return /* @__PURE__ */ jsxs29(
3849
3922
  Frame,
3850
3923
  {
3851
3924
  breadcrumb: ["ReevesAgents", "New Run", "Agents"],
3852
3925
  tagline: "Add optional extra agents for the same run.",
3853
3926
  statusKeys: "enter select \xB7 \u2191\u2193 move \xB7 esc back",
3854
3927
  children: [
3855
- !compactBody && /* @__PURE__ */ jsx35(StepIndicator, { step: 3, total: 4, name: "Agents" }),
3856
- compactBody ? /* @__PURE__ */ jsxs28(Fragment7, { children: [
3857
- /* @__PURE__ */ jsx35(Section, { label: selectedIdx < workers.length ? "Additional Agents" : "Actions" }),
3858
- workers.length === 0 && firstVisible === 0 && /* @__PURE__ */ jsx35(Row, { selected: false, primary: "No extra agents yet.", trailing: "choose Add Agent", disabled: true }),
3928
+ !compactBody && /* @__PURE__ */ jsx36(StepIndicator, { step: 3, total: 4, name: "Agents" }),
3929
+ compactBody ? /* @__PURE__ */ jsxs29(Fragment7, { children: [
3930
+ /* @__PURE__ */ jsx36(Section, { label: selectedIdx < workers.length ? "Additional Agents" : "Actions" }),
3931
+ workers.length === 0 && firstVisible === 0 && /* @__PURE__ */ jsx36(Row, { selected: false, primary: "No extra agents yet.", trailing: "choose Add Agent", disabled: true }),
3859
3932
  visibleRows.map((idx) => {
3860
3933
  if (idx >= workers.length) {
3861
3934
  const action = actions[idx - workers.length];
3862
- return /* @__PURE__ */ jsx35(
3935
+ return /* @__PURE__ */ jsx36(
3863
3936
  Row,
3864
3937
  {
3865
3938
  selected: selectedIdx === idx,
@@ -3872,7 +3945,7 @@ function NewRunWorkers() {
3872
3945
  }
3873
3946
  const worker = workers[idx];
3874
3947
  const providerLabel = providerDisplayName(worker.provider);
3875
- return /* @__PURE__ */ jsx35(
3948
+ return /* @__PURE__ */ jsx36(
3876
3949
  Row,
3877
3950
  {
3878
3951
  selected: selectedIdx === idx,
@@ -3887,12 +3960,12 @@ function NewRunWorkers() {
3887
3960
  `worker-${idx}`
3888
3961
  );
3889
3962
  }),
3890
- /* @__PURE__ */ jsx35(SectionEnd, {})
3891
- ] }) : /* @__PURE__ */ jsxs28(Fragment7, { children: [
3892
- /* @__PURE__ */ jsx35(Section, { label: "Additional Agents" }),
3893
- workers.length === 0 ? /* @__PURE__ */ jsx35(Row, { selected: false, primary: "No extra agents yet.", trailing: "choose Add Agent below", disabled: true }) : workers.map((worker, idx) => {
3963
+ /* @__PURE__ */ jsx36(SectionEnd, {})
3964
+ ] }) : /* @__PURE__ */ jsxs29(Fragment7, { children: [
3965
+ /* @__PURE__ */ jsx36(Section, { label: "Additional Agents" }),
3966
+ workers.length === 0 ? /* @__PURE__ */ jsx36(Row, { selected: false, primary: "No extra agents yet.", trailing: "choose Add Agent below", disabled: true }) : workers.map((worker, idx) => {
3894
3967
  const providerLabel = providerDisplayName(worker.provider);
3895
- return /* @__PURE__ */ jsx35(
3968
+ return /* @__PURE__ */ jsx36(
3896
3969
  Row,
3897
3970
  {
3898
3971
  selected: selectedIdx === idx,
@@ -3907,9 +3980,9 @@ function NewRunWorkers() {
3907
3980
  `worker-${idx}`
3908
3981
  );
3909
3982
  }),
3910
- /* @__PURE__ */ jsx35(SectionEnd, {}),
3911
- /* @__PURE__ */ jsx35(Section, { label: "Actions" }),
3912
- actions.map((action, idx) => /* @__PURE__ */ jsx35(
3983
+ /* @__PURE__ */ jsx36(SectionEnd, {}),
3984
+ /* @__PURE__ */ jsx36(Section, { label: "Actions" }),
3985
+ actions.map((action, idx) => /* @__PURE__ */ jsx36(
3913
3986
  Row,
3914
3987
  {
3915
3988
  selected: selectedIdx === workers.length + idx,
@@ -3919,22 +3992,26 @@ function NewRunWorkers() {
3919
3992
  },
3920
3993
  action.id
3921
3994
  )),
3922
- /* @__PURE__ */ jsx35(SectionEnd, {})
3995
+ /* @__PURE__ */ jsx36(SectionEnd, {})
3923
3996
  ] })
3924
3997
  ]
3925
3998
  }
3926
3999
  );
3927
4000
  }
3928
4001
 
3929
- // src/screens/newrun/04Worker.tsx
4002
+ // src/tui/screens/newrun/04Worker.tsx
3930
4003
  import { useState as useState22, useMemo as useMemo6 } from "react";
3931
4004
  import { useInput as useInput18, useWindowSize as useWindowSize14 } from "ink";
3932
- import { Fragment as Fragment8, jsx as jsx36, jsxs as jsxs29 } from "react/jsx-runtime";
4005
+ import { Fragment as Fragment8, jsx as jsx37, jsxs as jsxs30 } from "react/jsx-runtime";
3933
4006
  var PERMISSIONS_VALUES2 = ["ask", "skip"];
3934
4007
  var EFFORT_VALUES2 = ["default", "low", "medium", "high", "xhigh", "max"];
4008
+ var AUTH_MODE_VALUES2 = ["default", "api-key"];
3935
4009
  function permissionDisplay2(value) {
3936
4010
  return value === "skip" ? "Skip prompts" : "Ask first";
3937
4011
  }
4012
+ function authModeDisplay2(value) {
4013
+ return value === "api-key" ? "API key" : "Default login";
4014
+ }
3938
4015
  var ACTION_LABEL_WIDTH10 = Math.max("Done".length, "Remove This Agent".length, "Back".length);
3939
4016
  function cycle2(values, current, dir) {
3940
4017
  if (values.length === 0) return current;
@@ -3977,6 +4054,9 @@ function NewRunWorker() {
3977
4054
  hint: worker.permissions === "skip" ? "trusted workspaces only" : "provider asks before sensitive actions"
3978
4055
  }
3979
4056
  ];
4057
+ if (worker.provider === "cc") {
4058
+ list.push({ kind: "picker", id: "authMode", label: "Auth", current: worker.authMode, values: AUTH_MODE_VALUES2, display: authModeDisplay2(worker.authMode), hint: "api-key uses the API key instead of the default login" });
4059
+ }
3980
4060
  if (worker.provider === "cc" || worker.provider === "codex") {
3981
4061
  list.push({ kind: "picker", id: "effort", label: "Effort", current: worker.effort, values: EFFORT_VALUES2 });
3982
4062
  }
@@ -4039,6 +4119,7 @@ function NewRunWorker() {
4039
4119
  if (id === "provider") updateWorker(idx, { provider: cycle2(PROVIDERS, worker.provider, dir), model: "" });
4040
4120
  else if (id === "model") updateWorker(idx, { model: cycle2(modelValuesForProvider(worker.provider), worker.model, dir) });
4041
4121
  else if (id === "permissions") updateWorker(idx, { permissions: cycle2(PERMISSIONS_VALUES2, worker.permissions, dir) });
4122
+ else if (id === "authMode") updateWorker(idx, { authMode: cycle2(AUTH_MODE_VALUES2, worker.authMode, dir) });
4042
4123
  else if (id === "effort") updateWorker(idx, { effort: cycle2(EFFORT_VALUES2, worker.effort, dir) });
4043
4124
  }
4044
4125
  function handleAction(id) {
@@ -4098,17 +4179,17 @@ function NewRunWorker() {
4098
4179
  }
4099
4180
  });
4100
4181
  if (!worker) {
4101
- return /* @__PURE__ */ jsx36(Frame, { breadcrumb: ["ReevesAgents", "New Run", "Agents", "Agent"], children: /* @__PURE__ */ jsx36(Row, { selected: true, primary: "Agent not found", hint: "press Esc to go back" }) });
4182
+ return /* @__PURE__ */ jsx37(Frame, { breadcrumb: ["ReevesAgents", "New Run", "Agents", "Agent"], children: /* @__PURE__ */ jsx37(Row, { selected: true, primary: "Agent not found", hint: "press Esc to go back" }) });
4102
4183
  }
4103
- return /* @__PURE__ */ jsxs29(
4184
+ return /* @__PURE__ */ jsxs30(
4104
4185
  Frame,
4105
4186
  {
4106
4187
  breadcrumb: ["ReevesAgents", "New Run", "Agents", worker.nickname || `agent-${idx + 2}`],
4107
4188
  tagline: "Configure this additional agent.",
4108
4189
  statusKeys: modelPickerOpen ? "enter choose model \xB7 \u2191\u2193 move \xB7 esc close" : "enter edit/select \xB7 \u2190\u2192 quick cycle \xB7 esc done/back",
4109
4190
  children: [
4110
- !compactBody && /* @__PURE__ */ jsx36(StepIndicator, { step: 3, total: 4, name: "Agent" }),
4111
- compactBody && modelPickerOpen ? /* @__PURE__ */ jsx36(
4191
+ !compactBody && /* @__PURE__ */ jsx37(StepIndicator, { step: 3, total: 4, name: "Agent" }),
4192
+ compactBody && modelPickerOpen ? /* @__PURE__ */ jsx37(
4112
4193
  ModelOptionList,
4113
4194
  {
4114
4195
  provider: worker.provider,
@@ -4117,12 +4198,12 @@ function NewRunWorker() {
4117
4198
  selectedIdx: modelPickerIdx,
4118
4199
  visibleCount: Math.max(1, bodyRows - 3)
4119
4200
  }
4120
- ) : /* @__PURE__ */ jsxs29(Fragment8, { children: [
4121
- compactBody && /* @__PURE__ */ jsx36(Section, { label: selectedIdx < fields.length ? "Agent" : "Actions" }),
4201
+ ) : /* @__PURE__ */ jsxs30(Fragment8, { children: [
4202
+ compactBody && /* @__PURE__ */ jsx37(Section, { label: selectedIdx < fields.length ? "Agent" : "Actions" }),
4122
4203
  (compactBody ? visibleRows.filter((rowIdx) => rowIdx < fields.length) : fields.map((_field, rowIdx) => rowIdx)).map((fIdx) => {
4123
4204
  const field = fields[fIdx];
4124
4205
  if (field.kind === "text") {
4125
- return /* @__PURE__ */ jsx36(
4206
+ return /* @__PURE__ */ jsx37(
4126
4207
  TextField,
4127
4208
  {
4128
4209
  label: field.label,
@@ -4140,7 +4221,7 @@ function NewRunWorker() {
4140
4221
  );
4141
4222
  }
4142
4223
  const badge = pickerBadge2(field, worker.provider);
4143
- return /* @__PURE__ */ jsx36(
4224
+ return /* @__PURE__ */ jsx37(
4144
4225
  Row,
4145
4226
  {
4146
4227
  selected: selectedIdx === fIdx,
@@ -4152,7 +4233,7 @@ function NewRunWorker() {
4152
4233
  field.id
4153
4234
  );
4154
4235
  }),
4155
- modelPickerOpen && !compactBody && /* @__PURE__ */ jsx36(
4236
+ modelPickerOpen && !compactBody && /* @__PURE__ */ jsx37(
4156
4237
  ModelOptionList,
4157
4238
  {
4158
4239
  provider: worker.provider,
@@ -4161,10 +4242,10 @@ function NewRunWorker() {
4161
4242
  selectedIdx: modelPickerIdx
4162
4243
  }
4163
4244
  ),
4164
- !compactBody && /* @__PURE__ */ jsx36(Section, { label: "Actions" }),
4245
+ !compactBody && /* @__PURE__ */ jsx37(Section, { label: "Actions" }),
4165
4246
  compactBody ? visibleRows.filter((rowIdx) => rowIdx >= fields.length).map((rowIdx) => {
4166
4247
  const action = actions[rowIdx - fields.length];
4167
- return /* @__PURE__ */ jsx36(
4248
+ return /* @__PURE__ */ jsx37(
4168
4249
  Row,
4169
4250
  {
4170
4251
  selected: selectedIdx === rowIdx,
@@ -4174,7 +4255,7 @@ function NewRunWorker() {
4174
4255
  },
4175
4256
  action.id
4176
4257
  );
4177
- }) : actions.map((action, aIdx) => /* @__PURE__ */ jsx36(
4258
+ }) : actions.map((action, aIdx) => /* @__PURE__ */ jsx37(
4178
4259
  Row,
4179
4260
  {
4180
4261
  selected: selectedIdx === fields.length + aIdx,
@@ -4184,7 +4265,7 @@ function NewRunWorker() {
4184
4265
  },
4185
4266
  action.id
4186
4267
  )),
4187
- /* @__PURE__ */ jsx36(SectionEnd, {})
4268
+ /* @__PURE__ */ jsx37(SectionEnd, {})
4188
4269
  ] })
4189
4270
  ]
4190
4271
  }
@@ -4196,10 +4277,10 @@ function pickerBadge2(field, provider) {
4196
4277
  return void 0;
4197
4278
  }
4198
4279
 
4199
- // src/screens/newrun/05Review.tsx
4280
+ // src/tui/screens/newrun/05Review.tsx
4200
4281
  import { useState as useState23 } from "react";
4201
4282
  import { useInput as useInput19, useWindowSize as useWindowSize15 } from "ink";
4202
- import { Fragment as Fragment9, jsx as jsx37, jsxs as jsxs30 } from "react/jsx-runtime";
4283
+ import { Fragment as Fragment9, jsx as jsx38, jsxs as jsxs31 } from "react/jsx-runtime";
4203
4284
  var ACTION_LABEL_WIDTH11 = Math.max("Start Run".length, "Back to Edit".length, "Reset Wizard".length);
4204
4285
  function permissionDisplay3(value) {
4205
4286
  return value === "skip" ? "Skip prompts" : "Ask first";
@@ -4207,6 +4288,7 @@ function permissionDisplay3(value) {
4207
4288
  function NewRunReview() {
4208
4289
  const { push, pop } = useRouter();
4209
4290
  const { state, reset } = useWizard();
4291
+ const { t } = useLanguage();
4210
4292
  const { rows: termRows } = useWindowSize15();
4211
4293
  const bodyRows = frameBodyRows(termRows, true, false);
4212
4294
  const compactBody = bodyRows <= 14;
@@ -4245,18 +4327,18 @@ function NewRunReview() {
4245
4327
  const promptPreview = state.root.prompt.length > 40 ? state.root.prompt.slice(0, 40) + "..." : state.root.prompt;
4246
4328
  const showEffort = state.root.provider === "cc" || state.root.provider === "codex";
4247
4329
  const permissionsSummary = showEffort ? `${permissionDisplay3(state.root.permissions)} \xB7 ${state.root.effort}` : permissionDisplay3(state.root.permissions);
4248
- return /* @__PURE__ */ jsxs30(
4330
+ return /* @__PURE__ */ jsxs31(
4249
4331
  Frame,
4250
4332
  {
4251
4333
  breadcrumb: ["ReevesAgents", "New Run", "Review"],
4252
4334
  tagline: "Review the run and agents before starting.",
4253
4335
  statusKeys: "enter select \xB7 \u2191\u2193 move \xB7 esc back",
4254
4336
  children: [
4255
- !compactBody && /* @__PURE__ */ jsx37(StepIndicator, { step: 4, total: 4, name: "Review" }),
4256
- compactBody ? /* @__PURE__ */ jsxs30(Fragment9, { children: [
4257
- /* @__PURE__ */ jsx37(Section, { label: "Review" }),
4258
- showCompactSummary && /* @__PURE__ */ jsx37(Row, { selected: false, primary: state.name || "(unset)", trailing: `${state.workers.length + 1} agents`, alwaysShowTrailing: true, disabled: true }),
4259
- actions.map((action, idx) => /* @__PURE__ */ jsx37(
4337
+ !compactBody && /* @__PURE__ */ jsx38(StepIndicator, { step: 4, total: 4, name: "Review" }),
4338
+ compactBody ? /* @__PURE__ */ jsxs31(Fragment9, { children: [
4339
+ /* @__PURE__ */ jsx38(Section, { label: "Review" }),
4340
+ showCompactSummary && /* @__PURE__ */ jsx38(Row, { selected: false, primary: state.name || "(unset)", trailing: agentCountLabel(t, state.workers.length + 1), alwaysShowTrailing: true, disabled: true }),
4341
+ actions.map((action, idx) => /* @__PURE__ */ jsx38(
4260
4342
  Row,
4261
4343
  {
4262
4344
  selected: selectedIdx === idx,
@@ -4266,21 +4348,21 @@ function NewRunReview() {
4266
4348
  },
4267
4349
  action.id
4268
4350
  )),
4269
- /* @__PURE__ */ jsx37(SectionEnd, {})
4270
- ] }) : /* @__PURE__ */ jsxs30(Fragment9, { children: [
4271
- /* @__PURE__ */ jsx37(Section, { label: "Run" }),
4272
- /* @__PURE__ */ jsx37(Row, { selected: false, primary: "Name", trailing: state.name || "(unset)" }),
4273
- /* @__PURE__ */ jsx37(Row, { selected: false, primary: "Working Dir", trailing: state.workingDir || "(none)" }),
4274
- /* @__PURE__ */ jsx37(SectionEnd, {}),
4275
- /* @__PURE__ */ jsx37(Section, { label: "First Agent" }),
4276
- /* @__PURE__ */ jsx37(Row, { selected: false, primary: "Provider", badge: { label: providerDisplayName(state.root.provider), color: providerColor(state.root.provider) } }),
4277
- /* @__PURE__ */ jsx37(Row, { selected: false, primary: "Model", badge: { label: modelBadgeLabel(state.root.model), color: modelColor(state.root.model, state.root.provider) } }),
4278
- /* @__PURE__ */ jsx37(Row, { selected: false, primary: "Prompt", trailing: promptPreview || "(none)" }),
4279
- /* @__PURE__ */ jsx37(Row, { selected: false, primary: showEffort ? "Permissions / Effort" : "Permissions", trailing: permissionsSummary }),
4280
- /* @__PURE__ */ jsx37(SectionEnd, {}),
4281
- state.workers.length > 0 && /* @__PURE__ */ jsxs30(Fragment9, { children: [
4282
- /* @__PURE__ */ jsx37(Section, { label: `Additional Agents (${state.workers.length})` }),
4283
- state.workers.map((worker, idx) => /* @__PURE__ */ jsx37(
4351
+ /* @__PURE__ */ jsx38(SectionEnd, {})
4352
+ ] }) : /* @__PURE__ */ jsxs31(Fragment9, { children: [
4353
+ /* @__PURE__ */ jsx38(Section, { label: "Run" }),
4354
+ /* @__PURE__ */ jsx38(Row, { selected: false, primary: "Name", trailing: state.name || "(unset)" }),
4355
+ /* @__PURE__ */ jsx38(Row, { selected: false, primary: "Working Dir", trailing: state.workingDir || "(none)" }),
4356
+ /* @__PURE__ */ jsx38(SectionEnd, {}),
4357
+ /* @__PURE__ */ jsx38(Section, { label: "First Agent" }),
4358
+ /* @__PURE__ */ jsx38(Row, { selected: false, primary: "Provider", badge: { label: providerDisplayName(state.root.provider), color: providerColor(state.root.provider) } }),
4359
+ /* @__PURE__ */ jsx38(Row, { selected: false, primary: "Model", badge: { label: modelBadgeLabel(state.root.model), color: modelColor(state.root.model, state.root.provider) } }),
4360
+ /* @__PURE__ */ jsx38(Row, { selected: false, primary: "Prompt", trailing: promptPreview || "(none)" }),
4361
+ /* @__PURE__ */ jsx38(Row, { selected: false, primary: showEffort ? "Permissions / Effort" : "Permissions", trailing: permissionsSummary }),
4362
+ /* @__PURE__ */ jsx38(SectionEnd, {}),
4363
+ state.workers.length > 0 && /* @__PURE__ */ jsxs31(Fragment9, { children: [
4364
+ /* @__PURE__ */ jsx38(Section, { label: t("runtime.additionalAgentsCount", { count: state.workers.length }) }),
4365
+ state.workers.map((worker, idx) => /* @__PURE__ */ jsx38(
4284
4366
  Row,
4285
4367
  {
4286
4368
  selected: false,
@@ -4293,24 +4375,24 @@ function NewRunReview() {
4293
4375
  },
4294
4376
  `worker-${idx}`
4295
4377
  )),
4296
- /* @__PURE__ */ jsx37(SectionEnd, {})
4378
+ /* @__PURE__ */ jsx38(SectionEnd, {})
4297
4379
  ] }),
4298
- /* @__PURE__ */ jsx37(Section, { label: "Planned Tmux Windows" }),
4299
- /* @__PURE__ */ jsx37(Row, { selected: false, primary: "agent 1", trailing: providerDisplayName(state.root.provider) }),
4300
- state.workers.map((worker, idx) => /* @__PURE__ */ jsx37(
4380
+ /* @__PURE__ */ jsx38(Section, { label: "Planned Tmux Windows" }),
4381
+ /* @__PURE__ */ jsx38(Row, { selected: false, primary: t("runtime.agentN", { n: 1 }), trailing: providerDisplayName(state.root.provider) }),
4382
+ state.workers.map((worker, idx) => /* @__PURE__ */ jsx38(
4301
4383
  Row,
4302
4384
  {
4303
4385
  selected: false,
4304
- primary: `agent ${idx + 2}`,
4386
+ primary: t("runtime.agentN", { n: idx + 2 }),
4305
4387
  trailing: worker.nickname || providerDisplayName(worker.provider)
4306
4388
  },
4307
4389
  `tmux-${idx}`
4308
4390
  )),
4309
- /* @__PURE__ */ jsx37(SectionEnd, {})
4391
+ /* @__PURE__ */ jsx38(SectionEnd, {})
4310
4392
  ] }),
4311
- !compactBody && /* @__PURE__ */ jsxs30(Fragment9, { children: [
4312
- /* @__PURE__ */ jsx37(Section, { label: "Actions" }),
4313
- actions.map((action, idx) => /* @__PURE__ */ jsx37(
4393
+ !compactBody && /* @__PURE__ */ jsxs31(Fragment9, { children: [
4394
+ /* @__PURE__ */ jsx38(Section, { label: "Actions" }),
4395
+ actions.map((action, idx) => /* @__PURE__ */ jsx38(
4314
4396
  Row,
4315
4397
  {
4316
4398
  selected: selectedIdx === idx,
@@ -4320,21 +4402,21 @@ function NewRunReview() {
4320
4402
  },
4321
4403
  action.id
4322
4404
  )),
4323
- /* @__PURE__ */ jsx37(SectionEnd, {})
4405
+ /* @__PURE__ */ jsx38(SectionEnd, {})
4324
4406
  ] })
4325
4407
  ]
4326
4408
  }
4327
4409
  );
4328
4410
  }
4329
4411
 
4330
- // src/screens/newrun/05Starting.tsx
4412
+ // src/tui/screens/newrun/05Starting.tsx
4331
4413
  import { useEffect as useEffect12, useState as useState25 } from "react";
4332
- import { Box as Box27, Text as Text26, useInput as useInput20 } from "ink";
4414
+ import { Box as Box28, Text as Text27, useInput as useInput20 } from "ink";
4333
4415
 
4334
- // src/components/Spinner.tsx
4416
+ // src/tui/components/Spinner.tsx
4335
4417
  import { useEffect as useEffect11, useState as useState24 } from "react";
4336
- import { Box as Box26, Text as Text25 } from "ink";
4337
- import { jsx as jsx38, jsxs as jsxs31 } from "react/jsx-runtime";
4418
+ import { Box as Box27, Text as Text26 } from "ink";
4419
+ import { jsx as jsx39, jsxs as jsxs32 } from "react/jsx-runtime";
4338
4420
  var FRAMES = ["\u280B", "\u2819", "\u2839", "\u2838", "\u283C", "\u2834", "\u2826", "\u2827", "\u2807", "\u280F"];
4339
4421
  var INTERVAL_MS = 80;
4340
4422
  function Spinner({ label, color = colors.accent.primary }) {
@@ -4345,24 +4427,24 @@ function Spinner({ label, color = colors.accent.primary }) {
4345
4427
  const t = setInterval(() => setFrame((f) => (f + 1) % FRAMES.length), INTERVAL_MS);
4346
4428
  return () => clearInterval(t);
4347
4429
  }, [animate]);
4348
- return /* @__PURE__ */ jsxs31(Box26, { children: [
4349
- /* @__PURE__ */ jsx38(Text25, { color, children: FRAMES[frame] }),
4350
- label && /* @__PURE__ */ jsx38(Box26, { marginLeft: space.sm, children: /* @__PURE__ */ jsx38(Text25, { color: colors.text.dim, children: label }) })
4430
+ return /* @__PURE__ */ jsxs32(Box27, { children: [
4431
+ /* @__PURE__ */ jsx39(Text26, { color, children: FRAMES[frame] }),
4432
+ label && /* @__PURE__ */ jsx39(Box27, { marginLeft: space.sm, children: /* @__PURE__ */ jsx39(Text26, { color: colors.text.dim, children: label }) })
4351
4433
  ] });
4352
4434
  }
4353
4435
 
4354
- // src/screens/newrun/05Starting.tsx
4355
- import { jsx as jsx39, jsxs as jsxs32 } from "react/jsx-runtime";
4436
+ // src/tui/screens/newrun/05Starting.tsx
4437
+ import { jsx as jsx40, jsxs as jsxs33 } from "react/jsx-runtime";
4356
4438
  var ACTION_LABEL_WIDTH12 = Math.max("Retry".length, "Back to Review".length);
4357
4439
  function NewRunStarting() {
4358
4440
  const { pop, resetStack, setSelectedRunId } = useRouter();
4359
4441
  const { state, reset } = useWizard();
4442
+ const { t } = useLanguage();
4360
4443
  const [error, setError] = useState25(null);
4361
4444
  const [actionIdx, setActionIdx] = useState25(0);
4362
4445
  const [retryCount, setRetryCount] = useState25(0);
4363
4446
  useEffect12(() => {
4364
4447
  const req = {
4365
- mode: "spawner",
4366
4448
  name: state.name,
4367
4449
  working_dir: state.workingDir,
4368
4450
  root: {
@@ -4430,19 +4512,19 @@ function NewRunStarting() {
4430
4512
  }
4431
4513
  });
4432
4514
  if (error) {
4433
- return /* @__PURE__ */ jsxs32(
4515
+ return /* @__PURE__ */ jsxs33(
4434
4516
  Frame,
4435
4517
  {
4436
4518
  breadcrumb: ["ReevesAgents", "New Run", "Starting"],
4437
4519
  tagline: "Run failed to start.",
4438
4520
  statusKeys: "enter select \xB7 \u2191\u2193 move \xB7 esc back",
4439
4521
  children: [
4440
- /* @__PURE__ */ jsx39(Box27, { flexDirection: "column", marginY: 1, children: /* @__PURE__ */ jsxs32(Text26, { children: [
4441
- "Error: ",
4522
+ /* @__PURE__ */ jsx40(Box28, { flexDirection: "column", marginY: 1, children: /* @__PURE__ */ jsxs33(Text27, { children: [
4523
+ t("runtime.errorPrefix"),
4442
4524
  error
4443
4525
  ] }) }),
4444
- /* @__PURE__ */ jsx39(Section, { label: "Actions" }),
4445
- errorActions.map((action, idx) => /* @__PURE__ */ jsx39(
4526
+ /* @__PURE__ */ jsx40(Section, { label: "Actions" }),
4527
+ errorActions.map((action, idx) => /* @__PURE__ */ jsx40(
4446
4528
  Row,
4447
4529
  {
4448
4530
  selected: actionIdx === idx,
@@ -4452,36 +4534,40 @@ function NewRunStarting() {
4452
4534
  },
4453
4535
  action.id
4454
4536
  )),
4455
- /* @__PURE__ */ jsx39(SectionEnd, {})
4537
+ /* @__PURE__ */ jsx40(SectionEnd, {})
4456
4538
  ]
4457
4539
  }
4458
4540
  );
4459
4541
  }
4460
- return /* @__PURE__ */ jsx39(
4542
+ return /* @__PURE__ */ jsx40(
4461
4543
  Frame,
4462
4544
  {
4463
4545
  breadcrumb: ["ReevesAgents", "New Run", "Starting"],
4464
4546
  tagline: "Creating the run and launching its agents.",
4465
- children: /* @__PURE__ */ jsxs32(Box27, { flexDirection: "row", marginY: 1, children: [
4466
- /* @__PURE__ */ jsx39(Spinner, {}),
4467
- /* @__PURE__ */ jsxs32(Text26, { children: [
4468
- " Launching ",
4469
- state.name,
4470
- "..."
4547
+ children: /* @__PURE__ */ jsxs33(Box28, { flexDirection: "row", marginY: 1, children: [
4548
+ /* @__PURE__ */ jsx40(Spinner, {}),
4549
+ /* @__PURE__ */ jsxs33(Text27, { children: [
4550
+ " ",
4551
+ t("runtime.launching", { name: state.name })
4471
4552
  ] })
4472
4553
  ] })
4473
4554
  }
4474
4555
  );
4475
4556
  }
4476
4557
 
4477
- // src/screens/run/AddWorker.tsx
4558
+ // src/tui/screens/run/AddWorker.tsx
4478
4559
  import { useState as useState26, useMemo as useMemo7 } from "react";
4479
4560
  import { useInput as useInput21, useWindowSize as useWindowSize16 } from "ink";
4480
- import { Fragment as Fragment10, jsx as jsx40, jsxs as jsxs33 } from "react/jsx-runtime";
4561
+ import { Fragment as Fragment10, jsx as jsx41, jsxs as jsxs34 } from "react/jsx-runtime";
4481
4562
  var PERMISSIONS_VALUES3 = ["ask", "skip"];
4563
+ var EFFORT_VALUES3 = ["default", "low", "medium", "high", "xhigh", "max"];
4564
+ var AUTH_MODE_VALUES3 = ["default", "api-key"];
4482
4565
  function permissionDisplay4(value) {
4483
4566
  return value === "skip" ? "Skip prompts" : "Ask first";
4484
4567
  }
4568
+ function authModeDisplay3(value) {
4569
+ return value === "api-key" ? "API key" : "Default login";
4570
+ }
4485
4571
  var ACTION_LABEL_WIDTH13 = Math.max("Add Agent".length, "Cancel".length);
4486
4572
  function cycle3(values, current, dir) {
4487
4573
  if (values.length === 0) return current;
@@ -4493,6 +4579,7 @@ function cycle3(values, current, dir) {
4493
4579
  function AddWorker() {
4494
4580
  const { selectedRunId, pop } = useRouter();
4495
4581
  const { toast } = useToast();
4582
+ const { t } = useLanguage();
4496
4583
  const { draft, update, reset } = useWorkerDraft();
4497
4584
  const { rows: termRows } = useWindowSize16();
4498
4585
  const bodyRows = frameBodyRows(termRows, true, false);
@@ -4520,7 +4607,9 @@ function AddWorker() {
4520
4607
  values: PERMISSIONS_VALUES3,
4521
4608
  display: permissionDisplay4(draft.permissions),
4522
4609
  hint: draft.permissions === "skip" ? "trusted workspaces only" : "provider asks before sensitive actions"
4523
- }
4610
+ },
4611
+ { kind: "picker", id: "authMode", label: "Auth", current: draft.authMode, values: AUTH_MODE_VALUES3, display: authModeDisplay3(draft.authMode), hint: "api-key uses the API key instead of the default login" },
4612
+ { kind: "picker", id: "effort", label: "Effort", current: draft.effort, values: EFFORT_VALUES3 }
4524
4613
  ], [draft]);
4525
4614
  const actions = [
4526
4615
  { id: "add", label: "Add Agent", hint: "add this agent to the run" },
@@ -4570,14 +4659,16 @@ function AddWorker() {
4570
4659
  if (id === "provider") update({ provider: cycle3(PROVIDERS, draft.provider, dir), model: "" });
4571
4660
  else if (id === "model") update({ model: cycle3(modelValuesForProvider(draft.provider), draft.model, dir) });
4572
4661
  else if (id === "permissions") update({ permissions: cycle3(PERMISSIONS_VALUES3, draft.permissions, dir) });
4662
+ else if (id === "authMode") update({ authMode: cycle3(AUTH_MODE_VALUES3, draft.authMode, dir) });
4663
+ else if (id === "effort") update({ effort: cycle3(EFFORT_VALUES3, draft.effort, dir) });
4573
4664
  }
4574
4665
  function handleAdd() {
4575
4666
  if (!selectedRunId) {
4576
- toast("No run selected", "error");
4667
+ toast(t("addWorker.noRunSelected"), "error");
4577
4668
  return;
4578
4669
  }
4579
4670
  if (!draft.provider) {
4580
- toast("Provider is required", "error");
4671
+ toast(t("addWorker.providerRequired"), "error");
4581
4672
  return;
4582
4673
  }
4583
4674
  try {
@@ -4588,7 +4679,9 @@ function AddWorker() {
4588
4679
  model: draft.model,
4589
4680
  task: draft.prompt,
4590
4681
  working_dir: draft.workingDir || void 0,
4591
- permissions: draft.permissions
4682
+ permissions: draft.permissions,
4683
+ auth_mode: draft.authMode,
4684
+ effort: draft.effort
4592
4685
  });
4593
4686
  reset();
4594
4687
  pop();
@@ -4658,15 +4751,15 @@ function AddWorker() {
4658
4751
  }
4659
4752
  });
4660
4753
  if (!run) {
4661
- return /* @__PURE__ */ jsx40(Frame, { breadcrumb: ["ReevesAgents", "Runs", "Add Agent"], children: /* @__PURE__ */ jsx40(Row, { primary: "No run selected", hint: "press Esc to go back", selected: true }) });
4754
+ return /* @__PURE__ */ jsx41(Frame, { breadcrumb: ["ReevesAgents", "Runs", "Add Agent"], children: /* @__PURE__ */ jsx41(Row, { primary: "No run selected", hint: "press Esc to go back", selected: true }) });
4662
4755
  }
4663
- return /* @__PURE__ */ jsx40(
4756
+ return /* @__PURE__ */ jsx41(
4664
4757
  Frame,
4665
4758
  {
4666
4759
  breadcrumb: ["ReevesAgents", "Runs", run.name, "Add Agent"],
4667
- tagline: `Configure a new agent for ${run.name}.`,
4760
+ tagline: t("addWorker.tagline", { name: run.name }),
4668
4761
  statusKeys: modelPickerOpen ? "enter choose model \xB7 \u2191\u2193 move \xB7 esc close" : "enter edit/select \xB7 \u2190\u2192 quick cycle \xB7 esc done/back",
4669
- children: compactBody && modelPickerOpen ? /* @__PURE__ */ jsx40(
4762
+ children: compactBody && modelPickerOpen ? /* @__PURE__ */ jsx41(
4670
4763
  ModelOptionList,
4671
4764
  {
4672
4765
  provider: draft.provider,
@@ -4675,12 +4768,12 @@ function AddWorker() {
4675
4768
  selectedIdx: modelPickerIdx,
4676
4769
  visibleCount: Math.max(1, bodyRows - 3)
4677
4770
  }
4678
- ) : /* @__PURE__ */ jsxs33(Fragment10, { children: [
4679
- compactBody && /* @__PURE__ */ jsx40(Section, { label: selectedIdx < fields.length ? "Add Agent" : "Actions" }),
4771
+ ) : /* @__PURE__ */ jsxs34(Fragment10, { children: [
4772
+ compactBody && /* @__PURE__ */ jsx41(Section, { label: selectedIdx < fields.length ? "Add Agent" : "Actions" }),
4680
4773
  (compactBody ? visibleRows.filter((rowIdx) => rowIdx < fields.length) : fields.map((_field, rowIdx) => rowIdx)).map((fIdx) => {
4681
4774
  const field = fields[fIdx];
4682
4775
  if (field.kind === "text") {
4683
- return /* @__PURE__ */ jsx40(
4776
+ return /* @__PURE__ */ jsx41(
4684
4777
  TextField,
4685
4778
  {
4686
4779
  label: field.label,
@@ -4698,7 +4791,7 @@ function AddWorker() {
4698
4791
  );
4699
4792
  }
4700
4793
  const badge = pickerBadge3(field, draft.provider);
4701
- return /* @__PURE__ */ jsx40(
4794
+ return /* @__PURE__ */ jsx41(
4702
4795
  Row,
4703
4796
  {
4704
4797
  selected: selectedIdx === fIdx,
@@ -4710,7 +4803,7 @@ function AddWorker() {
4710
4803
  field.id
4711
4804
  );
4712
4805
  }),
4713
- modelPickerOpen && !compactBody && /* @__PURE__ */ jsx40(
4806
+ modelPickerOpen && !compactBody && /* @__PURE__ */ jsx41(
4714
4807
  ModelOptionList,
4715
4808
  {
4716
4809
  provider: draft.provider,
@@ -4719,10 +4812,10 @@ function AddWorker() {
4719
4812
  selectedIdx: modelPickerIdx
4720
4813
  }
4721
4814
  ),
4722
- !compactBody && /* @__PURE__ */ jsx40(Section, { label: "Actions" }),
4815
+ !compactBody && /* @__PURE__ */ jsx41(Section, { label: "Actions" }),
4723
4816
  compactBody ? visibleRows.filter((rowIdx) => rowIdx >= fields.length).map((rowIdx) => {
4724
4817
  const action = actions[rowIdx - fields.length];
4725
- return /* @__PURE__ */ jsx40(
4818
+ return /* @__PURE__ */ jsx41(
4726
4819
  Row,
4727
4820
  {
4728
4821
  selected: selectedIdx === rowIdx,
@@ -4732,7 +4825,7 @@ function AddWorker() {
4732
4825
  },
4733
4826
  action.id
4734
4827
  );
4735
- }) : actions.map((action, aIdx) => /* @__PURE__ */ jsx40(
4828
+ }) : actions.map((action, aIdx) => /* @__PURE__ */ jsx41(
4736
4829
  Row,
4737
4830
  {
4738
4831
  selected: selectedIdx === fields.length + aIdx,
@@ -4742,7 +4835,7 @@ function AddWorker() {
4742
4835
  },
4743
4836
  action.id
4744
4837
  )),
4745
- /* @__PURE__ */ jsx40(SectionEnd, {})
4838
+ /* @__PURE__ */ jsx41(SectionEnd, {})
4746
4839
  ] })
4747
4840
  }
4748
4841
  );
@@ -4760,8 +4853,8 @@ function pickerBadge3(field, provider) {
4760
4853
  return void 0;
4761
4854
  }
4762
4855
 
4763
- // src/screens/run/Stop.tsx
4764
- import { jsx as jsx41 } from "react/jsx-runtime";
4856
+ // src/tui/screens/run/Stop.tsx
4857
+ import { jsx as jsx42 } from "react/jsx-runtime";
4765
4858
  function RunStop() {
4766
4859
  const { selectedRunId, pop, resetStack } = useRouter();
4767
4860
  const { toast } = useToast();
@@ -4774,12 +4867,12 @@ function RunStop() {
4774
4867
  }
4775
4868
  })() : null;
4776
4869
  if (!run) {
4777
- return /* @__PURE__ */ jsx41(
4870
+ return /* @__PURE__ */ jsx42(
4778
4871
  Frame,
4779
4872
  {
4780
4873
  breadcrumb: ["ReevesAgents", "Runs", "Stop"],
4781
4874
  statusKeys: "\u2190\u2192 switch \xB7 enter select \xB7 esc cancel",
4782
- children: /* @__PURE__ */ jsx41(
4875
+ children: /* @__PURE__ */ jsx42(
4783
4876
  Dialog,
4784
4877
  {
4785
4878
  title: t("runStop.noRunTitle"),
@@ -4815,12 +4908,12 @@ function RunStop() {
4815
4908
  }
4816
4909
  }
4817
4910
  const isRunEnded = run.status === "ended" || run.ended_at !== null;
4818
- return /* @__PURE__ */ jsx41(
4911
+ return /* @__PURE__ */ jsx42(
4819
4912
  Frame,
4820
4913
  {
4821
4914
  breadcrumb: ["ReevesAgents", "Runs", run.name, isRunEnded ? "Delete" : "Stop"],
4822
4915
  statusKeys: "\u2190\u2192 switch \xB7 enter select \xB7 esc cancel",
4823
- children: /* @__PURE__ */ jsx41(
4916
+ children: /* @__PURE__ */ jsx42(
4824
4917
  Dialog,
4825
4918
  {
4826
4919
  title: t(isRunEnded ? "runStop.deleteTitle" : "runStop.stopTitle", { name: run.name }),
@@ -4836,10 +4929,10 @@ function RunStop() {
4836
4929
  );
4837
4930
  }
4838
4931
 
4839
- // src/screens/Settings.tsx
4932
+ // src/tui/screens/Settings.tsx
4840
4933
  import { useMemo as useMemo8, useState as useState27 } from "react";
4841
- import { Box as Box28, useInput as useInput22, useWindowSize as useWindowSize17 } from "ink";
4842
- import { Fragment as Fragment11, jsx as jsx42, jsxs as jsxs34 } from "react/jsx-runtime";
4934
+ import { Box as Box29, useInput as useInput22, useWindowSize as useWindowSize17 } from "ink";
4935
+ import { Fragment as Fragment11, jsx as jsx43, jsxs as jsxs35 } from "react/jsx-runtime";
4843
4936
  var CONFIG_PATHS = {
4844
4937
  cc: "~/.claude/settings.json",
4845
4938
  codex: "~/.codex/config.toml",
@@ -4854,17 +4947,18 @@ var CONFIG_PATHS = {
4854
4947
  var PROVIDER_LABEL_WIDTH = Math.max(...PROVIDERS.map((provider) => providerDisplayName(provider).length));
4855
4948
  var LANGUAGE_LABEL_WIDTH = Math.max(...LANGUAGE_OPTIONS.map((option) => option.nativeName.length + 3));
4856
4949
  function Settings() {
4857
- const { pop } = useRouter();
4950
+ const { pop, push } = useRouter();
4858
4951
  const { toast } = useToast();
4859
4952
  const { language, setLanguage, t } = useLanguage();
4860
4953
  const { rows: termRows } = useWindowSize17();
4861
4954
  const bodyRows = frameBodyRows(termRows, true, true);
4862
- const compactBody = bodyRows <= 13;
4955
+ const nonCompactRows = PROVIDERS.length + LANGUAGE_OPTIONS.length + 3 + 4 + 8;
4956
+ const compactBody = bodyRows < nonCompactRows;
4863
4957
  const showCompactStatePaths = compactBody && bodyRows >= 10;
4864
4958
  const [selectedIdx, setSelectedIdx] = useState27(0);
4865
4959
  const [refreshKey, setRefreshKey] = useState27(0);
4866
4960
  const available = useMemo8(() => detectAvailable(), [refreshKey]);
4867
- const actionLabelWidth = Math.max(t("settings.recheck").length, t("settings.showConfig").length, t("common.back").length);
4961
+ const actionLabelWidth = Math.max(t("settings.recheck").length, t("settings.showConfig").length, t("settings.editConfig").length, t("common.back").length);
4868
4962
  const rows = [
4869
4963
  ...PROVIDERS.map((p) => ({ type: "provider", id: p, provider: p, selectable: true })),
4870
4964
  ...LANGUAGE_OPTIONS.map((option) => ({ type: "language", id: `language-${option.code}`, language: option.code, selectable: true })),
@@ -4873,6 +4967,7 @@ function Settings() {
4873
4967
  { type: "statePath", id: "presets", selectable: false },
4874
4968
  { type: "action", id: "recheck", selectable: true },
4875
4969
  { type: "action", id: "showConfig", selectable: true },
4970
+ { type: "action", id: "editConfig", selectable: true },
4876
4971
  { type: "action", id: "back", selectable: true }
4877
4972
  ];
4878
4973
  const selectableRows = rows.filter((r) => r.selectable);
@@ -4900,6 +4995,10 @@ function Settings() {
4900
4995
  toast(t("settings.configToast", { path: configPath() }), "info");
4901
4996
  return;
4902
4997
  }
4998
+ if (row.id === "editConfig") {
4999
+ push("Config");
5000
+ return;
5001
+ }
4903
5002
  if (row.type === "language" && row.language) {
4904
5003
  setLanguage(row.language);
4905
5004
  toast(t("language.saved"), "info");
@@ -4934,7 +5033,7 @@ function Settings() {
4934
5033
  const installedCount = Object.values(available).filter(Boolean).length;
4935
5034
  const totalCount = PROVIDERS.length;
4936
5035
  const statusContext = selectedProvider ? `${providerDisplayName(selectedProvider)} \xB7 ${available[selectedProvider] ? t("common.installed") : t("common.notInstalled")} \xB7 config ${CONFIG_PATHS[selectedProvider]}` : selectedLanguage ? tuiLanguageLabel(selectedLanguage) : selectedRow?.id === "showConfig" ? configPath() : void 0;
4937
- return /* @__PURE__ */ jsx42(
5036
+ return /* @__PURE__ */ jsx43(
4938
5037
  Frame,
4939
5038
  {
4940
5039
  breadcrumb: ["ReevesAgents", t("settings.title")],
@@ -4945,13 +5044,13 @@ function Settings() {
4945
5044
  tagline: t("settings.tagline"),
4946
5045
  statusContext,
4947
5046
  statusKeys: t("settings.statusKeys"),
4948
- children: compactBody ? /* @__PURE__ */ jsxs34(Box28, { flexDirection: "column", children: [
4949
- /* @__PURE__ */ jsx42(Section, { label: selectedRow?.type === "language" ? t("common.language") : selectedRow?.type === "action" ? t("common.actions") : t("common.providers") }),
5047
+ children: compactBody ? /* @__PURE__ */ jsxs35(Box29, { flexDirection: "column", children: [
5048
+ /* @__PURE__ */ jsx43(Section, { label: selectedRow?.type === "language" ? t("common.language") : selectedRow?.type === "action" ? t("common.actions") : t("common.providers") }),
4950
5049
  compactRows.map((row) => {
4951
5050
  const rowIdx = rows.findIndex((r) => r.id === row.id);
4952
5051
  if (row.type === "provider" && row.provider) {
4953
5052
  const isInstalled = available[row.provider];
4954
- return /* @__PURE__ */ jsx42(
5053
+ return /* @__PURE__ */ jsx43(
4955
5054
  Row,
4956
5055
  {
4957
5056
  selected: selectedIdx === rowIdx,
@@ -4968,7 +5067,7 @@ function Settings() {
4968
5067
  }
4969
5068
  if (row.type === "language" && row.language) {
4970
5069
  const option = LANGUAGE_OPTIONS.find((item) => item.code === row.language);
4971
- return /* @__PURE__ */ jsx42(
5070
+ return /* @__PURE__ */ jsx43(
4972
5071
  Row,
4973
5072
  {
4974
5073
  selected: selectedIdx === rowIdx,
@@ -4983,10 +5082,11 @@ function Settings() {
4983
5082
  const actionLabels = {
4984
5083
  recheck: { primary: t("settings.recheck"), hint: t("settings.recheckHint") },
4985
5084
  showConfig: { primary: t("settings.showConfig"), hint: t("settings.showConfigHint") },
5085
+ editConfig: { primary: t("settings.editConfig"), hint: t("settings.editConfigHint") },
4986
5086
  back: { primary: t("common.back"), hint: t("settings.backHint") }
4987
5087
  };
4988
5088
  const action = actionLabels[row.id];
4989
- return /* @__PURE__ */ jsx42(
5089
+ return /* @__PURE__ */ jsx43(
4990
5090
  Row,
4991
5091
  {
4992
5092
  selected: selectedIdx === rowIdx,
@@ -4997,7 +5097,7 @@ function Settings() {
4997
5097
  row.id
4998
5098
  );
4999
5099
  }),
5000
- selectableRows.length > compactRowCount && /* @__PURE__ */ jsx42(
5100
+ selectableRows.length > compactRowCount && /* @__PURE__ */ jsx43(
5001
5101
  Row,
5002
5102
  {
5003
5103
  selected: false,
@@ -5006,21 +5106,21 @@ function Settings() {
5006
5106
  disabled: true
5007
5107
  }
5008
5108
  ),
5009
- /* @__PURE__ */ jsx42(SectionEnd, {}),
5010
- showCompactStatePaths && /* @__PURE__ */ jsxs34(Fragment11, { children: [
5011
- /* @__PURE__ */ jsx42(Section, { label: t("settings.statePaths") }),
5012
- /* @__PURE__ */ jsx42(Row, { selected: false, primary: t("settings.state"), trailing: stateRoot(), alwaysShowTrailing: true, disabled: true }),
5013
- /* @__PURE__ */ jsx42(Row, { selected: false, primary: t("settings.runs"), trailing: runsDir(), alwaysShowTrailing: true, disabled: true }),
5014
- /* @__PURE__ */ jsx42(Row, { selected: false, primary: t("settings.presets"), trailing: presetsDir(), alwaysShowTrailing: true, disabled: true }),
5015
- /* @__PURE__ */ jsx42(SectionEnd, {})
5109
+ /* @__PURE__ */ jsx43(SectionEnd, {}),
5110
+ showCompactStatePaths && /* @__PURE__ */ jsxs35(Fragment11, { children: [
5111
+ /* @__PURE__ */ jsx43(Section, { label: t("settings.statePaths") }),
5112
+ /* @__PURE__ */ jsx43(Row, { selected: false, primary: t("settings.state"), trailing: stateRoot(), alwaysShowTrailing: true, disabled: true }),
5113
+ /* @__PURE__ */ jsx43(Row, { selected: false, primary: t("settings.runs"), trailing: runsDir(), alwaysShowTrailing: true, disabled: true }),
5114
+ /* @__PURE__ */ jsx43(Row, { selected: false, primary: t("settings.presets"), trailing: presetsDir(), alwaysShowTrailing: true, disabled: true }),
5115
+ /* @__PURE__ */ jsx43(SectionEnd, {})
5016
5116
  ] })
5017
- ] }) : /* @__PURE__ */ jsxs34(Box28, { flexDirection: "column", children: [
5018
- /* @__PURE__ */ jsx42(Section, { label: t("common.providers") }),
5117
+ ] }) : /* @__PURE__ */ jsxs35(Box29, { flexDirection: "column", children: [
5118
+ /* @__PURE__ */ jsx43(Section, { label: t("common.providers") }),
5019
5119
  PROVIDERS.map((provider, _idx) => {
5020
5120
  const rowIdx = rows.findIndex((r) => r.type === "provider" && r.provider === provider);
5021
5121
  const isSelected = selectedIdx === rowIdx;
5022
5122
  const isInstalled = available[provider];
5023
- return /* @__PURE__ */ jsx42(
5123
+ return /* @__PURE__ */ jsx43(
5024
5124
  Row,
5025
5125
  {
5026
5126
  selected: isSelected,
@@ -5035,11 +5135,11 @@ function Settings() {
5035
5135
  provider
5036
5136
  );
5037
5137
  }),
5038
- /* @__PURE__ */ jsx42(SectionEnd, {}),
5039
- /* @__PURE__ */ jsx42(Section, { label: t("common.language") }),
5138
+ /* @__PURE__ */ jsx43(SectionEnd, {}),
5139
+ /* @__PURE__ */ jsx43(Section, { label: t("common.language") }),
5040
5140
  LANGUAGE_OPTIONS.map((option) => {
5041
5141
  const rowIdx = rows.findIndex((r) => r.type === "language" && r.language === option.code);
5042
- return /* @__PURE__ */ jsx42(
5142
+ return /* @__PURE__ */ jsx43(
5043
5143
  Row,
5044
5144
  {
5045
5145
  selected: selectedIdx === rowIdx,
@@ -5051,9 +5151,9 @@ function Settings() {
5051
5151
  option.code
5052
5152
  );
5053
5153
  }),
5054
- /* @__PURE__ */ jsx42(SectionEnd, {}),
5055
- /* @__PURE__ */ jsx42(Section, { label: t("settings.statePaths") }),
5056
- /* @__PURE__ */ jsx42(
5154
+ /* @__PURE__ */ jsx43(SectionEnd, {}),
5155
+ /* @__PURE__ */ jsx43(Section, { label: t("settings.statePaths") }),
5156
+ /* @__PURE__ */ jsx43(
5057
5157
  Row,
5058
5158
  {
5059
5159
  selected: selectedIdx === rows.findIndex((r) => r.id === "state"),
@@ -5061,7 +5161,7 @@ function Settings() {
5061
5161
  trailing: stateRoot()
5062
5162
  }
5063
5163
  ),
5064
- /* @__PURE__ */ jsx42(
5164
+ /* @__PURE__ */ jsx43(
5065
5165
  Row,
5066
5166
  {
5067
5167
  selected: selectedIdx === rows.findIndex((r) => r.id === "runs"),
@@ -5069,7 +5169,7 @@ function Settings() {
5069
5169
  trailing: runsDir()
5070
5170
  }
5071
5171
  ),
5072
- /* @__PURE__ */ jsx42(
5172
+ /* @__PURE__ */ jsx43(
5073
5173
  Row,
5074
5174
  {
5075
5175
  selected: selectedIdx === rows.findIndex((r) => r.id === "presets"),
@@ -5077,9 +5177,9 @@ function Settings() {
5077
5177
  trailing: presetsDir()
5078
5178
  }
5079
5179
  ),
5080
- /* @__PURE__ */ jsx42(SectionEnd, {}),
5081
- /* @__PURE__ */ jsx42(Section, { label: t("common.actions") }),
5082
- /* @__PURE__ */ jsx42(
5180
+ /* @__PURE__ */ jsx43(SectionEnd, {}),
5181
+ /* @__PURE__ */ jsx43(Section, { label: t("common.actions") }),
5182
+ /* @__PURE__ */ jsx43(
5083
5183
  Row,
5084
5184
  {
5085
5185
  selected: selectedIdx === rows.findIndex((r) => r.id === "recheck"),
@@ -5088,7 +5188,7 @@ function Settings() {
5088
5188
  hint: t("settings.recheckHint")
5089
5189
  }
5090
5190
  ),
5091
- /* @__PURE__ */ jsx42(
5191
+ /* @__PURE__ */ jsx43(
5092
5192
  Row,
5093
5193
  {
5094
5194
  selected: selectedIdx === rows.findIndex((r) => r.id === "showConfig"),
@@ -5097,7 +5197,16 @@ function Settings() {
5097
5197
  hint: t("settings.showConfigHint")
5098
5198
  }
5099
5199
  ),
5100
- /* @__PURE__ */ jsx42(
5200
+ /* @__PURE__ */ jsx43(
5201
+ Row,
5202
+ {
5203
+ selected: selectedIdx === rows.findIndex((r) => r.id === "editConfig"),
5204
+ primary: t("settings.editConfig"),
5205
+ primaryWidth: actionLabelWidth,
5206
+ hint: t("settings.editConfigHint")
5207
+ }
5208
+ ),
5209
+ /* @__PURE__ */ jsx43(
5101
5210
  Row,
5102
5211
  {
5103
5212
  selected: selectedIdx === rows.findIndex((r) => r.id === "back"),
@@ -5106,16 +5215,203 @@ function Settings() {
5106
5215
  hint: t("settings.backHint")
5107
5216
  }
5108
5217
  ),
5109
- /* @__PURE__ */ jsx42(SectionEnd, {})
5218
+ /* @__PURE__ */ jsx43(SectionEnd, {})
5110
5219
  ] })
5111
5220
  }
5112
5221
  );
5113
5222
  }
5114
5223
 
5115
- // src/screens/Reference.tsx
5116
- import { useState as useState28 } from "react";
5117
- import { useInput as useInput23, useWindowSize as useWindowSize18 } from "ink";
5118
- import { Fragment as Fragment12, jsx as jsx43, jsxs as jsxs35 } from "react/jsx-runtime";
5224
+ // src/tui/screens/AgentControl.tsx
5225
+ import { useMemo as useMemo9, useState as useState28 } from "react";
5226
+ import { Box as Box31, useInput as useInput23, useWindowSize as useWindowSize18 } from "ink";
5227
+
5228
+ // src/tui/components/Primary.tsx
5229
+ import { Box as Box30 } from "ink";
5230
+ import { jsx as jsx44 } from "react/jsx-runtime";
5231
+ function Primary({ children }) {
5232
+ return /* @__PURE__ */ jsx44(Box30, { flexDirection: "column", flexGrow: 1, children });
5233
+ }
5234
+
5235
+ // src/tui/screens/AgentControl.tsx
5236
+ import { jsx as jsx45, jsxs as jsxs36 } from "react/jsx-runtime";
5237
+ function hostGlyph(host) {
5238
+ if (!host.installed) return { char: glyphs.status.fail, color: colors.text.faint };
5239
+ if (host.attached) return { char: glyphs.status.ok, color: colors.status.ok };
5240
+ if (host.manual) return { char: glyphs.status.pending, color: colors.text.faint };
5241
+ return { char: glyphs.status.warn, color: colors.status.warn };
5242
+ }
5243
+ function AgentControl() {
5244
+ const { pop } = useRouter();
5245
+ const { t } = useLanguage();
5246
+ const { rows: termRows } = useWindowSize18();
5247
+ const bodyRows = frameBodyRows(termRows, true, true);
5248
+ const compactBody = bodyRows <= 10;
5249
+ const [selectedIdx, setSelectedIdx] = useState28(0);
5250
+ const [refreshKey, setRefreshKey] = useState28(0);
5251
+ const [result, setResult] = useState28(null);
5252
+ const hosts = useMemo9(() => hostStatus(), [refreshKey]);
5253
+ const attachedCount = hosts.filter((host) => host.attached).length;
5254
+ const actionOffset = hosts.length;
5255
+ const totalItems = actionOffset + 2;
5256
+ const hostLabelWidth = Math.max(
5257
+ ...hosts.map((host) => host.label.length),
5258
+ t("agentControl.attachAll").length,
5259
+ t("common.back").length
5260
+ );
5261
+ const compactEntryCount = Math.max(1, bodyRows - 2);
5262
+ const compactFirstEntry = Math.min(
5263
+ Math.max(0, selectedIdx - compactEntryCount + 1),
5264
+ Math.max(0, totalItems - compactEntryCount)
5265
+ );
5266
+ const compactEntryIndexes = Array.from(
5267
+ { length: Math.min(compactEntryCount, totalItems - compactFirstEntry) },
5268
+ (_, idx) => compactFirstEntry + idx
5269
+ );
5270
+ function hostHint(host) {
5271
+ if (!host.installed) return t("agentControl.notInstalledHint");
5272
+ if (host.manual) return t("agentControl.manualHint");
5273
+ return host.attached ? t("agentControl.detachHint") : t("agentControl.attachHint");
5274
+ }
5275
+ function hostTrailing(host) {
5276
+ if (!host.installed) return t("agentControl.notInstalled");
5277
+ if (host.manual) return t("agentControl.manual");
5278
+ return host.attached ? t("agentControl.attached") : t("agentControl.detached");
5279
+ }
5280
+ function toggleHost(host) {
5281
+ if (host.manual || !host.installed) return;
5282
+ const res = host.attached ? detach(host.key) : attach(host.key);
5283
+ setResult(res);
5284
+ setRefreshKey((k) => k + 1);
5285
+ }
5286
+ function runAttachAll() {
5287
+ const results = attachAll();
5288
+ const ok = results.filter((r) => r.ok).length;
5289
+ setResult({
5290
+ key: "all",
5291
+ label: t("agentControl.attachAll"),
5292
+ ok: results.every((r) => r.ok),
5293
+ message: t("agentControl.attachAllToast", { ok, total: results.length })
5294
+ });
5295
+ setRefreshKey((k) => k + 1);
5296
+ }
5297
+ useInput23((input, key) => {
5298
+ if (key.escape || key.backspace) {
5299
+ pop();
5300
+ return;
5301
+ }
5302
+ if (input === "a") {
5303
+ runAttachAll();
5304
+ return;
5305
+ }
5306
+ if (key.upArrow) {
5307
+ setSelectedIdx((idx) => Math.max(0, idx - 1));
5308
+ return;
5309
+ }
5310
+ if (key.downArrow) {
5311
+ setSelectedIdx((idx) => Math.min(totalItems - 1, idx + 1));
5312
+ return;
5313
+ }
5314
+ if (key.return) {
5315
+ if (selectedIdx < hosts.length) {
5316
+ toggleHost(hosts[selectedIdx]);
5317
+ return;
5318
+ }
5319
+ if (selectedIdx === actionOffset) {
5320
+ runAttachAll();
5321
+ return;
5322
+ }
5323
+ if (selectedIdx === actionOffset + 1) {
5324
+ pop();
5325
+ return;
5326
+ }
5327
+ }
5328
+ });
5329
+ const selectedHost = selectedIdx < hosts.length ? hosts[selectedIdx] : void 0;
5330
+ const statusContext = result ? `${result.label}: ${result.message}` : selectedHost ? `${selectedHost.label} \xB7 ${selectedHost.bin}` : "";
5331
+ function renderHost(host, idx) {
5332
+ return /* @__PURE__ */ jsx45(
5333
+ Row,
5334
+ {
5335
+ selected: idx === selectedIdx,
5336
+ glyph: hostGlyph(host),
5337
+ primary: host.label,
5338
+ primaryWidth: hostLabelWidth,
5339
+ hint: hostHint(host),
5340
+ trailing: hostTrailing(host)
5341
+ },
5342
+ host.key
5343
+ );
5344
+ }
5345
+ function renderAttachAll(idx) {
5346
+ return /* @__PURE__ */ jsx45(
5347
+ Row,
5348
+ {
5349
+ selected: idx === selectedIdx,
5350
+ primary: t("agentControl.attachAll"),
5351
+ primaryWidth: hostLabelWidth,
5352
+ hint: t("agentControl.attachAllHint")
5353
+ },
5354
+ "attach-all"
5355
+ );
5356
+ }
5357
+ function renderBack(idx) {
5358
+ return /* @__PURE__ */ jsx45(
5359
+ Row,
5360
+ {
5361
+ selected: idx === selectedIdx,
5362
+ primary: t("common.back"),
5363
+ primaryWidth: hostLabelWidth,
5364
+ hint: t("agentControl.backHint")
5365
+ },
5366
+ "back"
5367
+ );
5368
+ }
5369
+ return /* @__PURE__ */ jsx45(
5370
+ Frame,
5371
+ {
5372
+ breadcrumb: ["ReevesAgents", t("agentControl.title")],
5373
+ meta: [{ label: t("agentControl.hostsMeta"), value: `${attachedCount}/${hosts.length}` }],
5374
+ tagline: t("agentControl.tagline"),
5375
+ statusContext,
5376
+ statusKeys: t("agentControl.statusKeys"),
5377
+ children: compactBody ? /* @__PURE__ */ jsxs36(Primary, { children: [
5378
+ /* @__PURE__ */ jsx45(Section, { label: selectedIdx < hosts.length ? t("agentControl.hosts") : t("common.actions") }),
5379
+ compactEntryIndexes.map((idx) => {
5380
+ if (idx < hosts.length) return renderHost(hosts[idx], idx);
5381
+ if (idx === actionOffset) return renderAttachAll(idx);
5382
+ return renderBack(idx);
5383
+ }),
5384
+ /* @__PURE__ */ jsx45(SectionEnd, {})
5385
+ ] }) : /* @__PURE__ */ jsxs36(Primary, { children: [
5386
+ /* @__PURE__ */ jsx45(Section, { label: t("agentControl.hosts") }),
5387
+ hosts.map((host, idx) => renderHost(host, idx)),
5388
+ /* @__PURE__ */ jsx45(SectionEnd, {}),
5389
+ /* @__PURE__ */ jsx45(Box31, { marginTop: 1 }),
5390
+ /* @__PURE__ */ jsx45(
5391
+ Legend,
5392
+ {
5393
+ items: [
5394
+ { glyph: glyphs.status.ok, label: t("agentControl.attached"), color: colors.status.ok },
5395
+ { glyph: glyphs.status.warn, label: t("agentControl.detached"), color: colors.status.warn },
5396
+ { glyph: glyphs.status.pending, label: t("agentControl.manual"), color: colors.text.faint },
5397
+ { glyph: glyphs.status.fail, label: t("agentControl.notInstalled"), color: colors.text.faint }
5398
+ ]
5399
+ }
5400
+ ),
5401
+ /* @__PURE__ */ jsx45(Box31, { marginTop: 1 }),
5402
+ /* @__PURE__ */ jsx45(Section, { label: t("common.actions") }),
5403
+ renderAttachAll(actionOffset),
5404
+ renderBack(actionOffset + 1),
5405
+ /* @__PURE__ */ jsx45(SectionEnd, {})
5406
+ ] })
5407
+ }
5408
+ );
5409
+ }
5410
+
5411
+ // src/tui/screens/Reference.tsx
5412
+ import { useState as useState29 } from "react";
5413
+ import { useInput as useInput24, useWindowSize as useWindowSize19 } from "ink";
5414
+ import { Fragment as Fragment12, jsx as jsx46, jsxs as jsxs37 } from "react/jsx-runtime";
5119
5415
  var CONTENT = [
5120
5416
  { type: "section", label: "TUI Pages" },
5121
5417
  { type: "row", primary: "Welcome", trailing: "main menu, current run, reference, credits" },
@@ -5138,13 +5434,14 @@ var CONTENT = [
5138
5434
  ];
5139
5435
  function Reference() {
5140
5436
  const { pop } = useRouter();
5141
- const { rows } = useWindowSize18();
5437
+ const { t } = useLanguage();
5438
+ const { rows } = useWindowSize19();
5142
5439
  const bodyRows = frameBodyRows(rows, true, true);
5143
5440
  const compactBody = bodyRows <= 10;
5144
5441
  const visibleCount = Math.max(1, compactBody ? bodyRows - 3 : bodyRows - 5);
5145
5442
  const maxScroll = Math.max(0, CONTENT.length - visibleCount);
5146
- const [scroll, setScroll] = useState28(0);
5147
- useInput23((_input, key) => {
5443
+ const [scroll, setScroll] = useState29(0);
5444
+ useInput24((_input, key) => {
5148
5445
  if (key.upArrow) {
5149
5446
  setScroll((value) => Math.max(0, value - 1));
5150
5447
  return;
@@ -5156,56 +5453,57 @@ function Reference() {
5156
5453
  if (key.return || key.escape || key.backspace) pop();
5157
5454
  });
5158
5455
  const visible = CONTENT.slice(scroll, scroll + visibleCount);
5159
- const statusContext = maxScroll > 0 ? `Reference ${scroll + 1}-${Math.min(CONTENT.length, scroll + visibleCount)} of ${CONTENT.length}` : "ReevesAgents reference";
5456
+ const statusContext = maxScroll > 0 ? t("runtime.referenceRange", { from: scroll + 1, to: Math.min(CONTENT.length, scroll + visibleCount), total: CONTENT.length }) : "ReevesAgents reference";
5160
5457
  const contentRows = [];
5161
5458
  let openSection = false;
5162
5459
  visible.forEach((item, idx) => {
5163
5460
  if (item.type === "section") {
5164
- if (openSection) contentRows.push(/* @__PURE__ */ jsx43(SectionEnd, {}, `end-${idx}`));
5165
- contentRows.push(/* @__PURE__ */ jsx43(Section, { label: item.label }, `${item.label}-${idx}`));
5461
+ if (openSection) contentRows.push(/* @__PURE__ */ jsx46(SectionEnd, {}, `end-${idx}`));
5462
+ contentRows.push(/* @__PURE__ */ jsx46(Section, { label: item.label }, `${item.label}-${idx}`));
5166
5463
  openSection = true;
5167
5464
  return;
5168
5465
  }
5169
- contentRows.push(/* @__PURE__ */ jsx43(Row, { selected: false, primary: item.primary, trailing: item.trailing }, `${item.primary}-${idx}`));
5466
+ contentRows.push(/* @__PURE__ */ jsx46(Row, { selected: false, primary: item.primary, trailing: item.trailing }, `${item.primary}-${idx}`));
5170
5467
  });
5171
- if (openSection) contentRows.push(/* @__PURE__ */ jsx43(SectionEnd, {}, "end-visible"));
5172
- return /* @__PURE__ */ jsx43(
5468
+ if (openSection) contentRows.push(/* @__PURE__ */ jsx46(SectionEnd, {}, "end-visible"));
5469
+ return /* @__PURE__ */ jsx46(
5173
5470
  Frame,
5174
5471
  {
5175
5472
  breadcrumb: ["ReevesAgents", "Reference"],
5176
5473
  tagline: "Quick map of run mode, command line, tmux workflow, and roles.",
5177
5474
  statusContext,
5178
5475
  statusKeys: maxScroll > 0 ? "\u2191\u2193 scroll \xB7 enter back \xB7 esc back" : "enter back \xB7 esc back",
5179
- children: compactBody ? /* @__PURE__ */ jsxs35(Fragment12, { children: [
5180
- /* @__PURE__ */ jsx43(Section, { label: "Reference" }),
5181
- visible.map((item, idx) => item.type === "section" ? /* @__PURE__ */ jsx43(Row, { selected: false, primary: item.label, disabled: true }, `${item.label}-${idx}`) : /* @__PURE__ */ jsx43(Row, { selected: false, primary: item.primary, trailing: item.trailing }, `${item.primary}-${idx}`)),
5182
- maxScroll > 0 && /* @__PURE__ */ jsx43(
5476
+ children: compactBody ? /* @__PURE__ */ jsxs37(Fragment12, { children: [
5477
+ /* @__PURE__ */ jsx46(Section, { label: "Reference" }),
5478
+ 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}`)),
5479
+ maxScroll > 0 && /* @__PURE__ */ jsx46(
5183
5480
  Row,
5184
5481
  {
5185
5482
  selected: false,
5186
- primary: `${scroll + 1}-${Math.min(CONTENT.length, scroll + visibleCount)} of ${CONTENT.length}`,
5483
+ primary: t("runtime.pageRange", { from: scroll + 1, to: Math.min(CONTENT.length, scroll + visibleCount), total: CONTENT.length }),
5187
5484
  trailing: "scroll with arrows",
5188
5485
  disabled: true
5189
5486
  }
5190
5487
  ),
5191
- /* @__PURE__ */ jsx43(SectionEnd, {})
5192
- ] }) : /* @__PURE__ */ jsxs35(Fragment12, { children: [
5488
+ /* @__PURE__ */ jsx46(SectionEnd, {})
5489
+ ] }) : /* @__PURE__ */ jsxs37(Fragment12, { children: [
5193
5490
  contentRows,
5194
- /* @__PURE__ */ jsx43(Section, { label: "Actions" }),
5195
- /* @__PURE__ */ jsx43(Row, { selected: true, primary: "Back", hint: "return to previous page" }),
5196
- /* @__PURE__ */ jsx43(SectionEnd, {})
5491
+ /* @__PURE__ */ jsx46(Section, { label: "Actions" }),
5492
+ /* @__PURE__ */ jsx46(Row, { selected: true, primary: "Back", hint: "return to previous page" }),
5493
+ /* @__PURE__ */ jsx46(SectionEnd, {})
5197
5494
  ] })
5198
5495
  }
5199
5496
  );
5200
5497
  }
5201
5498
 
5202
- // src/screens/Credits.tsx
5203
- import { useState as useState29 } from "react";
5204
- import { Box as Box29, useInput as useInput24, useWindowSize as useWindowSize19 } from "ink";
5205
- import { Fragment as Fragment13, jsx as jsx44, jsxs as jsxs36 } from "react/jsx-runtime";
5499
+ // src/tui/screens/Credits.tsx
5500
+ import { useState as useState30 } from "react";
5501
+ import { Box as Box32, useInput as useInput25, useWindowSize as useWindowSize20 } from "ink";
5502
+ import { Fragment as Fragment13, jsx as jsx47, jsxs as jsxs38 } from "react/jsx-runtime";
5206
5503
  function Credits() {
5207
5504
  const { pop } = useRouter();
5208
- const { rows: termRows } = useWindowSize19();
5505
+ const { t } = useLanguage();
5506
+ const { rows: termRows } = useWindowSize20();
5209
5507
  const bodyRows = frameBodyRows(termRows, true, true);
5210
5508
  const compactBody = bodyRows <= 8;
5211
5509
  const content = [
@@ -5219,10 +5517,10 @@ function Credits() {
5219
5517
  { primary: "Repository", trailing: "See package metadata" }
5220
5518
  ];
5221
5519
  const visibleCount = Math.max(1, bodyRows - (compactBody ? 3 : 6));
5222
- const [scroll, setScroll] = useState29(0);
5520
+ const [scroll, setScroll] = useState30(0);
5223
5521
  const maxScroll = Math.max(0, content.length - visibleCount);
5224
5522
  const visible = content.slice(scroll, scroll + visibleCount);
5225
- useInput24((_input, key) => {
5523
+ useInput25((_input, key) => {
5226
5524
  if (key.upArrow) {
5227
5525
  setScroll((value) => Math.max(0, value - 1));
5228
5526
  return;
@@ -5233,49 +5531,40 @@ function Credits() {
5233
5531
  }
5234
5532
  if (key.return || key.escape || key.backspace) pop();
5235
5533
  });
5236
- return /* @__PURE__ */ jsx44(
5534
+ return /* @__PURE__ */ jsx47(
5237
5535
  Frame,
5238
5536
  {
5239
5537
  breadcrumb: ["ReevesAgents", "Credits"],
5240
5538
  tagline: "About this local tmux-first workspace manager.",
5241
5539
  statusContext: `ReevesAgents ${REEVESAGENTS_VERSION}`,
5242
5540
  statusKeys: "enter back \xB7 esc back",
5243
- children: /* @__PURE__ */ jsxs36(Box29, { flexDirection: "column", children: [
5244
- /* @__PURE__ */ jsx44(Section, { label: "Credits" }),
5245
- visible.map((item) => /* @__PURE__ */ jsx44(Row, { selected: false, primary: item.primary, trailing: item.trailing }, item.primary)),
5246
- maxScroll > 0 && /* @__PURE__ */ jsx44(
5541
+ children: /* @__PURE__ */ jsxs38(Box32, { flexDirection: "column", children: [
5542
+ /* @__PURE__ */ jsx47(Section, { label: "Credits" }),
5543
+ visible.map((item) => /* @__PURE__ */ jsx47(Row, { selected: false, primary: item.primary, trailing: item.trailing }, item.primary)),
5544
+ maxScroll > 0 && /* @__PURE__ */ jsx47(
5247
5545
  Row,
5248
5546
  {
5249
5547
  selected: false,
5250
- primary: `${scroll + 1}-${scroll + visible.length} of ${content.length}`,
5548
+ primary: t("runtime.pageRange", { from: scroll + 1, to: scroll + visible.length, total: content.length }),
5251
5549
  trailing: "scroll with arrows",
5252
5550
  disabled: true
5253
5551
  }
5254
5552
  ),
5255
- /* @__PURE__ */ jsx44(SectionEnd, {}),
5256
- !compactBody && /* @__PURE__ */ jsxs36(Fragment13, { children: [
5257
- /* @__PURE__ */ jsx44(Section, { label: "Actions" }),
5258
- /* @__PURE__ */ jsx44(Row, { selected: true, primary: "Back", hint: "return to main menu" }),
5259
- /* @__PURE__ */ jsx44(SectionEnd, {})
5553
+ /* @__PURE__ */ jsx47(SectionEnd, {}),
5554
+ !compactBody && /* @__PURE__ */ jsxs38(Fragment13, { children: [
5555
+ /* @__PURE__ */ jsx47(Section, { label: "Actions" }),
5556
+ /* @__PURE__ */ jsx47(Row, { selected: true, primary: "Back", hint: "return to main menu" }),
5557
+ /* @__PURE__ */ jsx47(SectionEnd, {})
5260
5558
  ] })
5261
5559
  ] })
5262
5560
  }
5263
5561
  );
5264
5562
  }
5265
5563
 
5266
- // src/screens/Doctor.tsx
5267
- import { useEffect as useEffect13, useMemo as useMemo9, useState as useState30 } from "react";
5268
- import { Box as Box31, useInput as useInput25, useWindowSize as useWindowSize20 } from "ink";
5269
-
5270
- // src/components/Primary.tsx
5271
- import { Box as Box30 } from "ink";
5272
- import { jsx as jsx45 } from "react/jsx-runtime";
5273
- function Primary({ children }) {
5274
- return /* @__PURE__ */ jsx45(Box30, { flexDirection: "column", flexGrow: 1, children });
5275
- }
5276
-
5277
- // src/screens/Doctor.tsx
5278
- import { Fragment as Fragment14, jsx as jsx46, jsxs as jsxs37 } from "react/jsx-runtime";
5564
+ // src/tui/screens/Doctor.tsx
5565
+ import { useEffect as useEffect13, useMemo as useMemo10, useState as useState31 } from "react";
5566
+ import { Box as Box33, useInput as useInput26, useWindowSize as useWindowSize21 } from "ink";
5567
+ import { Fragment as Fragment14, jsx as jsx48, jsxs as jsxs39 } from "react/jsx-runtime";
5279
5568
  var CHROME_ROWS5 = 17;
5280
5569
  function statusGlyph4(status) {
5281
5570
  if (status === "ok") return { char: glyphs.status.ok, color: colors.status.ok };
@@ -5284,15 +5573,16 @@ function statusGlyph4(status) {
5284
5573
  }
5285
5574
  function Doctor() {
5286
5575
  const { pop, push, setSelectedCheckName } = useRouter();
5287
- const { rows: termRows } = useWindowSize20();
5576
+ const { language } = useLanguage();
5577
+ const { rows: termRows } = useWindowSize21();
5288
5578
  const bodyRows = frameBodyRows(termRows, true, true);
5289
5579
  const compactBody = bodyRows <= 10;
5290
5580
  const pageSize = Math.max(1, compactBody ? bodyRows - 3 : Math.min(termRows - CHROME_ROWS5, bodyRows - 7));
5291
- const [selectedIdx, setSelectedIdx] = useState30(0);
5292
- const [refreshKey, setRefreshKey] = useState30(0);
5293
- const [isSpinning, setIsSpinning] = useState30(false);
5294
- const [page, setPage] = useState30(1);
5295
- const result = useMemo9(() => runDoctor(), [refreshKey]);
5581
+ const [selectedIdx, setSelectedIdx] = useState31(0);
5582
+ const [refreshKey, setRefreshKey] = useState31(0);
5583
+ const [isSpinning, setIsSpinning] = useState31(false);
5584
+ const [page, setPage] = useState31(1);
5585
+ const result = useMemo10(() => runDoctor(), [refreshKey]);
5296
5586
  const checks = result.checks;
5297
5587
  const counts = {
5298
5588
  ok: checks.filter((c) => c.status === "ok").length,
@@ -5329,7 +5619,7 @@ function Doctor() {
5329
5619
  setIsSpinning(false);
5330
5620
  }, 200);
5331
5621
  };
5332
- useInput25((_input, key) => {
5622
+ useInput26((_input, key) => {
5333
5623
  if (key.escape || key.backspace) {
5334
5624
  pop();
5335
5625
  return;
@@ -5359,7 +5649,7 @@ function Doctor() {
5359
5649
  }
5360
5650
  }
5361
5651
  });
5362
- return /* @__PURE__ */ jsx46(
5652
+ return /* @__PURE__ */ jsx48(
5363
5653
  Frame,
5364
5654
  {
5365
5655
  breadcrumb: ["ReevesAgents", "Doctor"],
@@ -5370,12 +5660,12 @@ function Doctor() {
5370
5660
  ],
5371
5661
  tagline: "Setup and environment health for TUI, CLI, Web UI, and tmux.",
5372
5662
  statusContext: selectedCheck ? `${selectedCheck.name}: ${selectedCheck.detail}` : "",
5373
- children: compactBody ? /* @__PURE__ */ jsxs37(Primary, { children: [
5374
- /* @__PURE__ */ jsx46(Section, { label: selectedIdx < pagedChecks.length ? "Checks" : "Actions" }),
5375
- isSpinning ? /* @__PURE__ */ jsx46(Spinner, { label: "checking...", color: colors.accent.bright }) : compactEntryIndexes.map((idx) => {
5663
+ children: compactBody ? /* @__PURE__ */ jsxs39(Primary, { children: [
5664
+ /* @__PURE__ */ jsx48(Section, { label: selectedIdx < pagedChecks.length ? "Checks" : "Actions" }),
5665
+ isSpinning ? /* @__PURE__ */ jsx48(Spinner, { label: translatePhrase(language, "checking..."), color: colors.accent.bright }) : compactEntryIndexes.map((idx) => {
5376
5666
  if (idx < pagedChecks.length) {
5377
5667
  const check = pagedChecks[idx];
5378
- return /* @__PURE__ */ jsx46(
5668
+ return /* @__PURE__ */ jsx48(
5379
5669
  Row,
5380
5670
  {
5381
5671
  selected: idx === selectedIdx,
@@ -5388,7 +5678,7 @@ function Doctor() {
5388
5678
  );
5389
5679
  }
5390
5680
  if (totalPages > 1 && idx === pagedChecks.length) {
5391
- return /* @__PURE__ */ jsx46(
5681
+ return /* @__PURE__ */ jsx48(
5392
5682
  Pagination,
5393
5683
  {
5394
5684
  page,
@@ -5401,14 +5691,14 @@ function Doctor() {
5401
5691
  );
5402
5692
  }
5403
5693
  if (idx === actionOffset) {
5404
- return /* @__PURE__ */ jsx46(Row, { selected: selectedIdx === actionOffset, primary: "Recheck", primaryWidth: checkLabelWidth, hint: "run doctor again" }, "recheck");
5694
+ return /* @__PURE__ */ jsx48(Row, { selected: selectedIdx === actionOffset, primary: "Recheck", primaryWidth: checkLabelWidth, hint: "run doctor again" }, "recheck");
5405
5695
  }
5406
- return /* @__PURE__ */ jsx46(Row, { selected: selectedIdx === actionOffset + 1, primary: "Back", primaryWidth: checkLabelWidth, hint: "return to previous page" }, "back");
5696
+ return /* @__PURE__ */ jsx48(Row, { selected: selectedIdx === actionOffset + 1, primary: "Back", primaryWidth: checkLabelWidth, hint: "return to previous page" }, "back");
5407
5697
  }),
5408
- /* @__PURE__ */ jsx46(SectionEnd, {})
5409
- ] }) : /* @__PURE__ */ jsxs37(Primary, { children: [
5410
- isSpinning && /* @__PURE__ */ jsx46(Spinner, { label: "checking...", color: colors.accent.bright }),
5411
- !isSpinning && pagedChecks.map((check, idx) => /* @__PURE__ */ jsx46(
5698
+ /* @__PURE__ */ jsx48(SectionEnd, {})
5699
+ ] }) : /* @__PURE__ */ jsxs39(Primary, { children: [
5700
+ isSpinning && /* @__PURE__ */ jsx48(Spinner, { label: translatePhrase(language, "checking..."), color: colors.accent.bright }),
5701
+ !isSpinning && pagedChecks.map((check, idx) => /* @__PURE__ */ jsx48(
5412
5702
  Row,
5413
5703
  {
5414
5704
  selected: idx === selectedIdx,
@@ -5419,7 +5709,7 @@ function Doctor() {
5419
5709
  },
5420
5710
  check.name
5421
5711
  )),
5422
- !isSpinning && totalPages > 1 && /* @__PURE__ */ jsx46(
5712
+ !isSpinning && totalPages > 1 && /* @__PURE__ */ jsx48(
5423
5713
  Pagination,
5424
5714
  {
5425
5715
  page,
@@ -5429,9 +5719,9 @@ function Doctor() {
5429
5719
  onNext: () => setPage((p) => Math.min(totalPages, p + 1))
5430
5720
  }
5431
5721
  ),
5432
- !isSpinning && /* @__PURE__ */ jsxs37(Fragment14, { children: [
5433
- /* @__PURE__ */ jsx46(Box31, { marginTop: 1 }),
5434
- /* @__PURE__ */ jsx46(
5722
+ !isSpinning && /* @__PURE__ */ jsxs39(Fragment14, { children: [
5723
+ /* @__PURE__ */ jsx48(Box33, { marginTop: 1 }),
5724
+ /* @__PURE__ */ jsx48(
5435
5725
  Legend,
5436
5726
  {
5437
5727
  items: [
@@ -5442,20 +5732,20 @@ function Doctor() {
5442
5732
  }
5443
5733
  )
5444
5734
  ] }),
5445
- /* @__PURE__ */ jsx46(Box31, { marginTop: 1 }),
5446
- /* @__PURE__ */ jsx46(Section, { label: "Actions" }),
5447
- /* @__PURE__ */ jsx46(Row, { selected: selectedIdx === actionOffset, primary: "Recheck", primaryWidth: checkLabelWidth, hint: "run doctor again" }),
5448
- /* @__PURE__ */ jsx46(Row, { selected: selectedIdx === actionOffset + 1, primary: "Back", primaryWidth: checkLabelWidth, hint: "return to previous page" }),
5449
- /* @__PURE__ */ jsx46(SectionEnd, {})
5735
+ /* @__PURE__ */ jsx48(Box33, { marginTop: 1 }),
5736
+ /* @__PURE__ */ jsx48(Section, { label: "Actions" }),
5737
+ /* @__PURE__ */ jsx48(Row, { selected: selectedIdx === actionOffset, primary: "Recheck", primaryWidth: checkLabelWidth, hint: "run doctor again" }),
5738
+ /* @__PURE__ */ jsx48(Row, { selected: selectedIdx === actionOffset + 1, primary: "Back", primaryWidth: checkLabelWidth, hint: "return to previous page" }),
5739
+ /* @__PURE__ */ jsx48(SectionEnd, {})
5450
5740
  ] })
5451
5741
  }
5452
5742
  );
5453
5743
  }
5454
5744
 
5455
- // src/screens/doctor/Check.tsx
5456
- import { useEffect as useEffect14, useMemo as useMemo10, useState as useState31 } from "react";
5457
- import { Box as Box32, Text as Text27, useInput as useInput26 } from "ink";
5458
- import { Fragment as Fragment15, jsx as jsx47, jsxs as jsxs38 } from "react/jsx-runtime";
5745
+ // src/tui/screens/DoctorCheck.tsx
5746
+ import { useEffect as useEffect14, useMemo as useMemo11, useState as useState32 } from "react";
5747
+ import { Box as Box34, Text as Text28, useInput as useInput27 } from "ink";
5748
+ import { Fragment as Fragment15, jsx as jsx49, jsxs as jsxs40 } from "react/jsx-runtime";
5459
5749
  function statusGlyph5(status) {
5460
5750
  if (status === "ok") return { char: glyphs.status.ok, color: colors.status.ok };
5461
5751
  if (status === "warn") return { char: glyphs.status.warn, color: colors.status.warn };
@@ -5469,14 +5759,15 @@ function findFixHint(check) {
5469
5759
  }
5470
5760
  function DoctorCheck() {
5471
5761
  const { pop, selectedCheckName } = useRouter();
5472
- const [selectedIdx, setSelectedIdx] = useState31(0);
5473
- const result = useMemo10(() => runDoctor(), []);
5762
+ const { language } = useLanguage();
5763
+ const [selectedIdx, setSelectedIdx] = useState32(0);
5764
+ const result = useMemo11(() => runDoctor(), []);
5474
5765
  const check = result.checks.find((c) => c.name === selectedCheckName);
5475
5766
  const backIdx = check ? 1 : 0;
5476
5767
  useEffect14(() => {
5477
5768
  setSelectedIdx(backIdx);
5478
5769
  }, [backIdx]);
5479
- useInput26((_input, key) => {
5770
+ useInput27((_input, key) => {
5480
5771
  if (key.escape || key.backspace) {
5481
5772
  pop();
5482
5773
  return;
@@ -5490,54 +5781,501 @@ function DoctorCheck() {
5490
5781
  }
5491
5782
  });
5492
5783
  if (!check) {
5493
- return /* @__PURE__ */ jsx47(
5784
+ return /* @__PURE__ */ jsx49(
5494
5785
  Frame,
5495
5786
  {
5496
5787
  breadcrumb: ["ReevesAgents", "Doctor", "Check"],
5497
5788
  tagline: "Check not found.",
5498
- children: /* @__PURE__ */ jsx47(Primary, { children: /* @__PURE__ */ jsx47(Row, { selected: selectedIdx === backIdx, primary: "Back" }) })
5789
+ children: /* @__PURE__ */ jsx49(Primary, { children: /* @__PURE__ */ jsx49(Row, { selected: selectedIdx === backIdx, primary: "Back" }) })
5499
5790
  }
5500
5791
  );
5501
5792
  }
5502
5793
  const fixHint = findFixHint(check);
5503
- return /* @__PURE__ */ jsx47(
5794
+ return /* @__PURE__ */ jsx49(
5504
5795
  Frame,
5505
5796
  {
5506
5797
  breadcrumb: ["ReevesAgents", "Doctor", check.name],
5507
5798
  meta: [{ label: "status", value: check.status }],
5508
5799
  tagline: "Check details and suggested fix.",
5509
- children: /* @__PURE__ */ jsxs38(Primary, { children: [
5510
- /* @__PURE__ */ jsxs38(Box32, { flexDirection: "column", children: [
5511
- /* @__PURE__ */ jsx47(Row, { selected: false, primary: "Name", trailing: check.name }),
5512
- /* @__PURE__ */ jsx47(Row, { selected: false, primary: "Status", trailing: check.status, glyph: statusGlyph5(check.status) }),
5513
- /* @__PURE__ */ jsx47(Row, { selected: false, primary: "Detail", trailing: check.detail })
5800
+ children: /* @__PURE__ */ jsxs40(Primary, { children: [
5801
+ /* @__PURE__ */ jsxs40(Box34, { flexDirection: "column", children: [
5802
+ /* @__PURE__ */ jsx49(Row, { selected: false, primary: "Name", trailing: check.name }),
5803
+ /* @__PURE__ */ jsx49(Row, { selected: false, primary: "Status", trailing: check.status, glyph: statusGlyph5(check.status) }),
5804
+ /* @__PURE__ */ jsx49(Row, { selected: false, primary: "Detail", trailing: check.detail })
5514
5805
  ] }),
5515
- fixHint && /* @__PURE__ */ jsxs38(Fragment15, { children: [
5516
- /* @__PURE__ */ jsx47(Box32, { marginY: 1 }),
5517
- /* @__PURE__ */ jsx47(Section, { label: "Fix" }),
5518
- /* @__PURE__ */ jsxs38(Box32, { marginY: 1, marginLeft: 2, flexDirection: "column", children: [
5519
- /* @__PURE__ */ jsx47(Text27, { color: colors.text.dim, children: "Suggested fix:" }),
5520
- /* @__PURE__ */ jsx47(Text27, { color: colors.accent.primary, children: fixHint })
5806
+ fixHint && /* @__PURE__ */ jsxs40(Fragment15, { children: [
5807
+ /* @__PURE__ */ jsx49(Box34, { marginY: 1 }),
5808
+ /* @__PURE__ */ jsx49(Section, { label: "Fix" }),
5809
+ /* @__PURE__ */ jsxs40(Box34, { marginY: 1, marginLeft: 2, flexDirection: "column", children: [
5810
+ /* @__PURE__ */ jsx49(Text28, { color: colors.text.dim, children: translatePhrase(language, "Suggested fix:") }),
5811
+ /* @__PURE__ */ jsx49(Text28, { color: colors.accent.primary, children: translatePhrase(language, fixHint) })
5521
5812
  ] }),
5522
- /* @__PURE__ */ jsx47(SectionEnd, {})
5813
+ /* @__PURE__ */ jsx49(SectionEnd, {})
5523
5814
  ] }),
5524
- !fixHint && /* @__PURE__ */ jsxs38(Fragment15, { children: [
5525
- /* @__PURE__ */ jsx47(Box32, { marginY: 1 }),
5526
- /* @__PURE__ */ jsx47(Section, { label: "Fix" }),
5527
- /* @__PURE__ */ jsx47(Box32, { marginY: 1, marginLeft: 2, children: /* @__PURE__ */ jsx47(Text27, { color: colors.text.dim, children: "No suggested fix. Check the source code or open an issue." }) }),
5528
- /* @__PURE__ */ jsx47(SectionEnd, {})
5815
+ !fixHint && /* @__PURE__ */ jsxs40(Fragment15, { children: [
5816
+ /* @__PURE__ */ jsx49(Box34, { marginY: 1 }),
5817
+ /* @__PURE__ */ jsx49(Section, { label: "Fix" }),
5818
+ /* @__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.") }) }),
5819
+ /* @__PURE__ */ jsx49(SectionEnd, {})
5529
5820
  ] }),
5530
- /* @__PURE__ */ jsx47(Box32, { marginY: 1 }),
5531
- /* @__PURE__ */ jsx47(Section, { label: "Actions" }),
5532
- /* @__PURE__ */ jsx47(Row, { selected: selectedIdx === backIdx, primary: "Back" }),
5533
- /* @__PURE__ */ jsx47(SectionEnd, {})
5821
+ /* @__PURE__ */ jsx49(Box34, { marginY: 1 }),
5822
+ /* @__PURE__ */ jsx49(Section, { label: "Actions" }),
5823
+ /* @__PURE__ */ jsx49(Row, { selected: selectedIdx === backIdx, primary: "Back" }),
5824
+ /* @__PURE__ */ jsx49(SectionEnd, {})
5534
5825
  ] })
5535
5826
  }
5536
5827
  );
5537
5828
  }
5538
5829
 
5539
- // src/router.tsx
5540
- import { jsx as jsx48 } from "react/jsx-runtime";
5830
+ // src/tui/screens/Approvals.tsx
5831
+ import { useEffect as useEffect15, useState as useState33 } from "react";
5832
+ import { Box as Box35, useInput as useInput28 } from "ink";
5833
+ import { jsx as jsx50, jsxs as jsxs41 } from "react/jsx-runtime";
5834
+ var ACTIONS3 = ["Approve", "Deny", "Back", "Main Menu"];
5835
+ var ACTION_COPY3 = {
5836
+ Approve: { label: "Approve", hint: "approve the selected request" },
5837
+ Deny: { label: "Deny", hint: "deny the selected request" },
5838
+ Back: { label: "Back", hint: "return to the previous screen" },
5839
+ "Main Menu": { label: "Main Menu", hint: "settings, doctor, reference, credits" }
5840
+ };
5841
+ var ACTION_LABEL_WIDTH14 = Math.max(...ACTIONS3.map((action) => ACTION_COPY3[action].label.length));
5842
+ function riskBadge(risk) {
5843
+ if (risk === "high") return { label: "high", color: colors.status.error };
5844
+ if (risk === "low") return { label: "low", color: colors.status.ok };
5845
+ return { label: "medium", color: colors.status.warn };
5846
+ }
5847
+ function Approvals() {
5848
+ const { pop, resetStack } = useRouter();
5849
+ const { toast } = useToast();
5850
+ const { t } = useLanguage();
5851
+ const [approvals, setApprovals] = useState33(() => listRunApprovals(void 0, "pending"));
5852
+ const [selectedIdx, setSelectedIdx] = useState33(0);
5853
+ const [selectedApprovalId, setSelectedApprovalId] = useState33(() => approvals[0]?.id ?? null);
5854
+ const [pending, setPending] = useState33(null);
5855
+ useEffect15(() => {
5856
+ const timer = setInterval(() => setApprovals(listRunApprovals(void 0, "pending")), 5e3);
5857
+ return () => clearInterval(timer);
5858
+ }, []);
5859
+ const itemCount = approvals.length + ACTIONS3.length;
5860
+ const clampedIdx = Math.min(Math.max(0, selectedIdx), Math.max(0, itemCount - 1));
5861
+ const onApproval = clampedIdx < approvals.length;
5862
+ const selectedApproval = onApproval ? approvals[clampedIdx] ?? null : null;
5863
+ const selectedAction = onApproval ? null : ACTIONS3[clampedIdx - approvals.length] ?? null;
5864
+ const actionTarget = approvals.find((item) => item.id === selectedApprovalId) ?? approvals[0] ?? null;
5865
+ useEffect15(() => {
5866
+ if (selectedApproval) setSelectedApprovalId(selectedApproval.id);
5867
+ }, [selectedApproval]);
5868
+ function refresh() {
5869
+ const next = listRunApprovals(void 0, "pending");
5870
+ setApprovals(next);
5871
+ setSelectedApprovalId((current) => current && next.some((item) => item.id === current) ? current : next[0]?.id ?? null);
5872
+ }
5873
+ function resolve(approval, decision) {
5874
+ resolveRunApproval(approval.id, decision);
5875
+ setPending(null);
5876
+ refresh();
5877
+ toast(
5878
+ decision === "approved" ? t("approvals.approvedToast", { action: approval.action }) : t("approvals.deniedToast", { action: approval.action }),
5879
+ "info"
5880
+ );
5881
+ }
5882
+ function handleActivate() {
5883
+ if (!selectedAction) return;
5884
+ switch (selectedAction) {
5885
+ case "Approve":
5886
+ if (actionTarget) setPending({ approval: actionTarget, decision: "approved" });
5887
+ break;
5888
+ case "Deny":
5889
+ if (actionTarget) setPending({ approval: actionTarget, decision: "denied" });
5890
+ break;
5891
+ case "Back":
5892
+ pop();
5893
+ break;
5894
+ case "Main Menu":
5895
+ resetStack("Welcome", ["Welcome"]);
5896
+ break;
5897
+ }
5898
+ }
5899
+ useInput28((_input, key) => {
5900
+ if (pending) return;
5901
+ if (key.upArrow) {
5902
+ setSelectedIdx((idx) => Math.max(0, Math.min(idx, itemCount - 1) - 1));
5903
+ return;
5904
+ }
5905
+ if (key.downArrow) {
5906
+ setSelectedIdx((idx) => Math.min(itemCount - 1, idx + 1));
5907
+ return;
5908
+ }
5909
+ if (key.return) {
5910
+ handleActivate();
5911
+ return;
5912
+ }
5913
+ if (key.escape || key.backspace) {
5914
+ pop();
5915
+ return;
5916
+ }
5917
+ });
5918
+ if (pending) {
5919
+ return /* @__PURE__ */ jsx50(Frame, { breadcrumb: ["ReevesAgents", "Approvals"], statusKeys: "\u2190\u2192 switch \xB7 enter select \xB7 esc cancel", children: /* @__PURE__ */ jsx50(
5920
+ Dialog,
5921
+ {
5922
+ title: pending.decision === "approved" ? "Approve this request?" : "Deny this request?",
5923
+ body: pending.approval.summary || pending.approval.action,
5924
+ intent: pending.decision === "denied" ? "danger" : "default",
5925
+ confirmLabel: pending.decision === "approved" ? "Approve" : "Deny",
5926
+ cancelLabel: "Cancel",
5927
+ onConfirm: () => resolve(pending.approval, pending.decision),
5928
+ onCancel: () => setPending(null)
5929
+ }
5930
+ ) });
5931
+ }
5932
+ let statusContext = "";
5933
+ if (selectedApproval) {
5934
+ statusContext = `${selectedApproval.action} \xB7 ${selectedApproval.risk} \xB7 ${selectedApproval.summary}`;
5935
+ } else if (selectedAction) {
5936
+ statusContext = (selectedAction === "Approve" || selectedAction === "Deny") && actionTarget ? `${ACTION_COPY3[selectedAction].hint} \xB7 ${actionTarget.action}` : ACTION_COPY3[selectedAction].hint;
5937
+ }
5938
+ return /* @__PURE__ */ jsx50(
5939
+ Frame,
5940
+ {
5941
+ breadcrumb: ["ReevesAgents", "Approvals"],
5942
+ meta: [{ label: "pending", value: String(approvals.length) }],
5943
+ tagline: "Pending approval requests raised by agents. Approve or deny them here.",
5944
+ statusContext,
5945
+ statusKeys: "enter action \xB7 \u2191\u2193 move \xB7 esc back",
5946
+ children: /* @__PURE__ */ jsxs41(Box35, { flexDirection: "column", children: [
5947
+ /* @__PURE__ */ jsx50(Section, { label: "Pending" }),
5948
+ approvals.length === 0 ? /* @__PURE__ */ jsx50(Row, { selected: false, primary: "No pending approvals", trailing: "requests appear here", disabled: true }) : approvals.map((approval, idx) => /* @__PURE__ */ jsx50(
5949
+ Row,
5950
+ {
5951
+ selected: clampedIdx === idx,
5952
+ primary: approval.action,
5953
+ glyph: { char: glyphs.status.warn, color: colors.status.warn },
5954
+ badges: [riskBadge(approval.risk)],
5955
+ hint: approval.summary,
5956
+ trailing: approval.agent_id.slice(0, 8)
5957
+ },
5958
+ approval.id
5959
+ )),
5960
+ /* @__PURE__ */ jsx50(SectionEnd, {}),
5961
+ /* @__PURE__ */ jsx50(Section, { label: "Actions" }),
5962
+ ACTIONS3.map((action, idx) => /* @__PURE__ */ jsx50(
5963
+ Row,
5964
+ {
5965
+ selected: clampedIdx === approvals.length + idx,
5966
+ primary: ACTION_COPY3[action].label,
5967
+ primaryWidth: ACTION_LABEL_WIDTH14,
5968
+ hint: ACTION_COPY3[action].hint,
5969
+ disabled: (action === "Approve" || action === "Deny") && !actionTarget,
5970
+ danger: action === "Deny"
5971
+ },
5972
+ action
5973
+ )),
5974
+ /* @__PURE__ */ jsx50(SectionEnd, {})
5975
+ ] })
5976
+ }
5977
+ );
5978
+ }
5979
+
5980
+ // src/tui/screens/Config.tsx
5981
+ import { useState as useState34 } from "react";
5982
+ import { Box as Box36, useInput as useInput29 } from "ink";
5983
+ import { jsx as jsx51, jsxs as jsxs42 } from "react/jsx-runtime";
5984
+ var EDITABLE_FIELDS = CONFIG_FIELDS.filter((field) => field.kind !== "language");
5985
+ function isNumeric(field) {
5986
+ return field.kind === "posint" || field.kind === "nonneg-int";
5987
+ }
5988
+ function Config() {
5989
+ const { pop } = useRouter();
5990
+ const { toast } = useToast();
5991
+ const { language } = useLanguage();
5992
+ const [global, setGlobal] = useState34(() => loadConfig().global);
5993
+ const [selectedIdx, setSelectedIdx] = useState34(0);
5994
+ const [editingKey, setEditingKey] = useState34(null);
5995
+ const [draft, setDraft] = useState34("");
5996
+ const totalRows = EDITABLE_FIELDS.length + 1;
5997
+ function applyValue(key, value) {
5998
+ try {
5999
+ setGlobal(setConfigValues({ [key]: value }).global);
6000
+ } catch (err) {
6001
+ toast(err instanceof Error ? err.message : String(err), "error");
6002
+ }
6003
+ }
6004
+ function commitEdit(field) {
6005
+ setEditingKey(null);
6006
+ try {
6007
+ applyValue(field.key, parseConfigValue(field.key, draft));
6008
+ } catch (err) {
6009
+ toast(err instanceof Error ? err.message : String(err), "error");
6010
+ }
6011
+ }
6012
+ useInput29((_input, key) => {
6013
+ if (editingKey) return;
6014
+ if (key.escape || key.backspace) {
6015
+ pop();
6016
+ return;
6017
+ }
6018
+ if (key.upArrow) {
6019
+ setSelectedIdx((i) => Math.max(0, i - 1));
6020
+ return;
6021
+ }
6022
+ if (key.downArrow) {
6023
+ setSelectedIdx((i) => Math.min(totalRows - 1, i + 1));
6024
+ return;
6025
+ }
6026
+ if (selectedIdx >= EDITABLE_FIELDS.length) {
6027
+ if (key.return) pop();
6028
+ return;
6029
+ }
6030
+ const field = EDITABLE_FIELDS[selectedIdx];
6031
+ if (field.kind === "permissions") {
6032
+ if (key.leftArrow || key.rightArrow || key.return) {
6033
+ applyValue(field.key, global[field.key] === "ask" ? "skip" : "ask");
6034
+ }
6035
+ return;
6036
+ }
6037
+ if (key.return && isNumeric(field)) {
6038
+ setDraft(String(global[field.key]));
6039
+ setEditingKey(field.key);
6040
+ }
6041
+ });
6042
+ return /* @__PURE__ */ jsx51(
6043
+ Frame,
6044
+ {
6045
+ breadcrumb: ["ReevesAgents", "Settings", "Config"],
6046
+ tagline: "Edit global settings. Numbers edit inline; permissions cycle.",
6047
+ statusKeys: "enter edit/cycle \xB7 \u2190\u2192 cycle \xB7 esc back",
6048
+ children: /* @__PURE__ */ jsxs42(Box36, { flexDirection: "column", children: [
6049
+ /* @__PURE__ */ jsx51(Section, { label: "Config" }),
6050
+ EDITABLE_FIELDS.map((field, idx) => {
6051
+ const value = global[field.key];
6052
+ if (isNumeric(field)) {
6053
+ return /* @__PURE__ */ jsx51(
6054
+ TextField,
6055
+ {
6056
+ label: field.label,
6057
+ value: editingKey === field.key ? draft : String(value),
6058
+ helpText: "enter edit \xB7 esc cancel",
6059
+ required: false,
6060
+ selected: selectedIdx === idx,
6061
+ editing: editingKey === field.key,
6062
+ onChange: setDraft,
6063
+ onCommit: () => commitEdit(field),
6064
+ onCancel: () => setEditingKey(null)
6065
+ },
6066
+ field.key
6067
+ );
6068
+ }
6069
+ return /* @__PURE__ */ jsx51(
6070
+ Row,
6071
+ {
6072
+ selected: selectedIdx === idx,
6073
+ primary: field.label,
6074
+ trailing: `\u2039 ${translatePhrase(language, String(value))} \u203A`,
6075
+ hint: selectedIdx === idx ? "\u2190 \u2192 cycle" : void 0
6076
+ },
6077
+ field.key
6078
+ );
6079
+ }),
6080
+ /* @__PURE__ */ jsx51(SectionEnd, {}),
6081
+ /* @__PURE__ */ jsx51(Section, { label: "Actions" }),
6082
+ /* @__PURE__ */ jsx51(Row, { selected: selectedIdx === EDITABLE_FIELDS.length, primary: "Back", hint: "return to settings" }),
6083
+ /* @__PURE__ */ jsx51(SectionEnd, {})
6084
+ ] })
6085
+ }
6086
+ );
6087
+ }
6088
+
6089
+ // src/tui/screens/Presets.tsx
6090
+ import { useEffect as useEffect16, useState as useState35 } from "react";
6091
+ import { Box as Box37, useInput as useInput30 } from "ink";
6092
+ import { jsx as jsx52, jsxs as jsxs43 } from "react/jsx-runtime";
6093
+ var ACTIONS4 = ["Start", "SaveCurrentRun", "Delete", "Back", "Main Menu"];
6094
+ var ACTION_COPY4 = {
6095
+ Start: { label: "Start", hint: "launch a run from the selected preset" },
6096
+ SaveCurrentRun: { label: "Save Current Run", hint: "save the active run as a preset" },
6097
+ Delete: { label: "Delete", hint: "delete the selected preset" },
6098
+ Back: { label: "Back", hint: "return" },
6099
+ "Main Menu": { label: "Main Menu", hint: "return to the main menu" }
6100
+ };
6101
+ var ACTION_LABEL_WIDTH15 = Math.max(...ACTIONS4.map((action) => ACTION_COPY4[action].label.length));
6102
+ function Presets() {
6103
+ const { pop, resetStack, selectedRunId, setSelectedRunId } = useRouter();
6104
+ const { toast } = useToast();
6105
+ const { t } = useLanguage();
6106
+ const [presets, setPresets] = useState35(() => listPresets());
6107
+ const [selectedIdx, setSelectedIdx] = useState35(0);
6108
+ const [actOnName, setActOnName] = useState35(() => presets[0]?.name ?? null);
6109
+ const [pendingDelete, setPendingDelete] = useState35(null);
6110
+ const [saving, setSaving] = useState35(false);
6111
+ const [draftName, setDraftName] = useState35("");
6112
+ const total = presets.length + ACTIONS4.length;
6113
+ const clampedIdx = Math.min(selectedIdx, Math.max(0, total - 1));
6114
+ const onPreset = clampedIdx < presets.length;
6115
+ const targetPreset = onPreset ? presets[clampedIdx] : presets.find((preset) => preset.name === actOnName) ?? presets[0] ?? null;
6116
+ useEffect16(() => {
6117
+ if (onPreset && presets[clampedIdx]) setActOnName(presets[clampedIdx].name);
6118
+ }, [onPreset, clampedIdx, presets]);
6119
+ function refresh() {
6120
+ const next = listPresets();
6121
+ setPresets(next);
6122
+ setActOnName((current) => current && next.some((p) => p.name === current) ? current : next[0]?.name ?? null);
6123
+ }
6124
+ function confirmDelete(preset) {
6125
+ deletePreset(preset.name);
6126
+ setPendingDelete(null);
6127
+ refresh();
6128
+ toast(t("presets.deletedToast", { name: preset.name }), "info");
6129
+ }
6130
+ function commitSave() {
6131
+ setSaving(false);
6132
+ if (!selectedRunId) return;
6133
+ try {
6134
+ const preset = savePresetFromRun(selectedRunId, draftName);
6135
+ refresh();
6136
+ toast(t("presets.savedToast", { name: preset.name }), "info");
6137
+ } catch (err) {
6138
+ toast(err instanceof Error ? err.message : String(err), "error");
6139
+ }
6140
+ }
6141
+ function handleAction(action) {
6142
+ if (action === "Back") {
6143
+ pop();
6144
+ return;
6145
+ }
6146
+ if (action === "Main Menu") {
6147
+ resetStack("Welcome", ["Welcome"]);
6148
+ return;
6149
+ }
6150
+ if (action === "Start") {
6151
+ if (!targetPreset) {
6152
+ toast(t("presets.noStartTarget"), "error");
6153
+ return;
6154
+ }
6155
+ try {
6156
+ const result = startRunFromPreset(targetPreset.name);
6157
+ setSelectedRunId(result.run.id);
6158
+ resetStack("Run");
6159
+ } catch (err) {
6160
+ toast(err instanceof Error ? err.message : String(err), "error");
6161
+ }
6162
+ return;
6163
+ }
6164
+ if (action === "Delete") {
6165
+ if (targetPreset) setPendingDelete(targetPreset);
6166
+ return;
6167
+ }
6168
+ if (action === "SaveCurrentRun") {
6169
+ if (!selectedRunId) {
6170
+ toast(t("presets.openRunFirst"), "error");
6171
+ return;
6172
+ }
6173
+ setDraftName("");
6174
+ setSaving(true);
6175
+ }
6176
+ }
6177
+ useInput30((_input, key) => {
6178
+ if (saving) return;
6179
+ if (key.upArrow) {
6180
+ setSelectedIdx(() => Math.max(0, clampedIdx - 1));
6181
+ return;
6182
+ }
6183
+ if (key.downArrow) {
6184
+ setSelectedIdx(() => Math.min(total - 1, clampedIdx + 1));
6185
+ return;
6186
+ }
6187
+ if (key.escape || key.backspace) {
6188
+ pop();
6189
+ return;
6190
+ }
6191
+ if (key.return) {
6192
+ if (onPreset) handleAction("Start");
6193
+ else handleAction(ACTIONS4[clampedIdx - presets.length]);
6194
+ }
6195
+ });
6196
+ if (saving) {
6197
+ return /* @__PURE__ */ jsx52(
6198
+ Frame,
6199
+ {
6200
+ breadcrumb: ["ReevesAgents", "Presets", "Save"],
6201
+ tagline: "Name the preset captured from the current run.",
6202
+ statusKeys: "enter save \xB7 esc cancel",
6203
+ children: /* @__PURE__ */ jsxs43(Box37, { flexDirection: "column", children: [
6204
+ /* @__PURE__ */ jsx52(Section, { label: "Save Current Run as Preset" }),
6205
+ /* @__PURE__ */ jsx52(
6206
+ TextField,
6207
+ {
6208
+ label: "Preset name",
6209
+ value: draftName,
6210
+ helpText: "letters, digits, dashes \xB7 enter save \xB7 esc cancel",
6211
+ required: true,
6212
+ selected: true,
6213
+ editing: true,
6214
+ onChange: setDraftName,
6215
+ onCommit: commitSave,
6216
+ onCancel: () => setSaving(false)
6217
+ }
6218
+ ),
6219
+ /* @__PURE__ */ jsx52(SectionEnd, {})
6220
+ ] })
6221
+ }
6222
+ );
6223
+ }
6224
+ if (pendingDelete) {
6225
+ return /* @__PURE__ */ jsx52(Frame, { breadcrumb: ["ReevesAgents", "Presets"], statusKeys: "enter select \xB7 esc cancel", children: /* @__PURE__ */ jsx52(
6226
+ Dialog,
6227
+ {
6228
+ title: t("presets.deleteTitle", { name: pendingDelete.name }),
6229
+ body: "This removes the saved preset. Running runs are not affected.",
6230
+ intent: "danger",
6231
+ confirmLabel: "Delete",
6232
+ cancelLabel: "Cancel",
6233
+ onConfirm: () => confirmDelete(pendingDelete),
6234
+ onCancel: () => setPendingDelete(null)
6235
+ }
6236
+ ) });
6237
+ }
6238
+ return /* @__PURE__ */ jsx52(
6239
+ Frame,
6240
+ {
6241
+ breadcrumb: ["ReevesAgents", "Presets"],
6242
+ meta: [{ label: "presets", value: String(presets.length) }],
6243
+ tagline: "Saved agent-team templates. Start one, save the current run, or delete.",
6244
+ statusKeys: "enter start/select \xB7 \u2191\u2193 move \xB7 esc back",
6245
+ children: /* @__PURE__ */ jsxs43(Box37, { flexDirection: "column", children: [
6246
+ /* @__PURE__ */ jsx52(Section, { label: "Presets" }),
6247
+ 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(
6248
+ Row,
6249
+ {
6250
+ selected: clampedIdx === idx,
6251
+ primary: preset.name,
6252
+ hint: `${1 + preset.workers.length} agents`,
6253
+ trailing: preset.description || void 0
6254
+ },
6255
+ preset.name
6256
+ )),
6257
+ /* @__PURE__ */ jsx52(SectionEnd, {}),
6258
+ /* @__PURE__ */ jsx52(Section, { label: "Actions" }),
6259
+ ACTIONS4.map((action, idx) => /* @__PURE__ */ jsx52(
6260
+ Row,
6261
+ {
6262
+ selected: clampedIdx === presets.length + idx,
6263
+ primary: ACTION_COPY4[action].label,
6264
+ primaryWidth: ACTION_LABEL_WIDTH15,
6265
+ hint: ACTION_COPY4[action].hint,
6266
+ disabled: action === "Start" || action === "Delete" ? presets.length === 0 : action === "SaveCurrentRun" ? !selectedRunId : false,
6267
+ danger: action === "Delete"
6268
+ },
6269
+ action
6270
+ )),
6271
+ /* @__PURE__ */ jsx52(SectionEnd, {})
6272
+ ] })
6273
+ }
6274
+ );
6275
+ }
6276
+
6277
+ // src/tui/router.tsx
6278
+ import { jsx as jsx53 } from "react/jsx-runtime";
5541
6279
  var RouterContext = createContext6(null);
5542
6280
  function useRouter() {
5543
6281
  const ctx = useContext6(RouterContext);
@@ -5550,57 +6288,65 @@ function normalizeScreen(screen) {
5550
6288
  function renderScreen(screen) {
5551
6289
  switch (normalizeScreen(screen)) {
5552
6290
  case "LanguageSelect":
5553
- return /* @__PURE__ */ jsx48(LanguageSelect, {});
6291
+ return /* @__PURE__ */ jsx53(LanguageSelect, {});
5554
6292
  case "Welcome":
5555
- return /* @__PURE__ */ jsx48(Welcome, {});
6293
+ return /* @__PURE__ */ jsx53(Welcome, {});
5556
6294
  case "Runs":
5557
- return /* @__PURE__ */ jsx48(Runs, {});
6295
+ return /* @__PURE__ */ jsx53(Runs, {});
5558
6296
  case "RunHistory":
5559
- return /* @__PURE__ */ jsx48(RunHistory, {});
6297
+ return /* @__PURE__ */ jsx53(RunHistory, {});
5560
6298
  case "Run":
5561
- return /* @__PURE__ */ jsx48(Run, {});
6299
+ return /* @__PURE__ */ jsx53(Run, {});
5562
6300
  case "RunAgents":
5563
- return /* @__PURE__ */ jsx48(RunAgents, {});
6301
+ return /* @__PURE__ */ jsx53(RunAgents, {});
5564
6302
  case "RunOutput":
5565
- return /* @__PURE__ */ jsx48(RunOutput, {});
6303
+ return /* @__PURE__ */ jsx53(RunOutput, {});
5566
6304
  case "RunStop":
5567
- return /* @__PURE__ */ jsx48(RunStop, {});
6305
+ return /* @__PURE__ */ jsx53(RunStop, {});
5568
6306
  case "AgentDetail":
5569
- return /* @__PURE__ */ jsx48(AgentDetail, {});
6307
+ return /* @__PURE__ */ jsx53(AgentDetail, {});
5570
6308
  case "AgentOutput":
5571
- return /* @__PURE__ */ jsx48(AgentOutput, {});
6309
+ return /* @__PURE__ */ jsx53(AgentOutput, {});
5572
6310
  case "AgentTask":
5573
- return /* @__PURE__ */ jsx48(AgentTask, {});
6311
+ return /* @__PURE__ */ jsx53(AgentTask, {});
5574
6312
  case "AgentKill":
5575
- return /* @__PURE__ */ jsx48(AgentKill, {});
6313
+ return /* @__PURE__ */ jsx53(AgentKill, {});
5576
6314
  case "NewRun":
5577
- return /* @__PURE__ */ jsx48(NewRun, {});
6315
+ return /* @__PURE__ */ jsx53(NewRun, {});
5578
6316
  case "NewRunBasics":
5579
- return /* @__PURE__ */ jsx48(NewRunBasics, {});
6317
+ return /* @__PURE__ */ jsx53(NewRunBasics, {});
5580
6318
  case "NewRunRoot":
5581
- return /* @__PURE__ */ jsx48(NewRunRoot, {});
6319
+ return /* @__PURE__ */ jsx53(NewRunRoot, {});
5582
6320
  case "NewRunWorkers":
5583
- return /* @__PURE__ */ jsx48(NewRunWorkers, {});
6321
+ return /* @__PURE__ */ jsx53(NewRunWorkers, {});
5584
6322
  case "NewRunWorker":
5585
- return /* @__PURE__ */ jsx48(NewRunWorker, {});
6323
+ return /* @__PURE__ */ jsx53(NewRunWorker, {});
5586
6324
  case "NewRunReview":
5587
- return /* @__PURE__ */ jsx48(NewRunReview, {});
6325
+ return /* @__PURE__ */ jsx53(NewRunReview, {});
5588
6326
  case "NewRunStarting":
5589
- return /* @__PURE__ */ jsx48(NewRunStarting, {});
6327
+ return /* @__PURE__ */ jsx53(NewRunStarting, {});
5590
6328
  case "AddWorker":
5591
- return /* @__PURE__ */ jsx48(AddWorker, {});
6329
+ return /* @__PURE__ */ jsx53(AddWorker, {});
5592
6330
  case "Settings":
5593
- return /* @__PURE__ */ jsx48(Settings, {});
6331
+ return /* @__PURE__ */ jsx53(Settings, {});
6332
+ case "AgentControl":
6333
+ return /* @__PURE__ */ jsx53(AgentControl, {});
5594
6334
  case "Reference":
5595
- return /* @__PURE__ */ jsx48(Reference, {});
6335
+ return /* @__PURE__ */ jsx53(Reference, {});
5596
6336
  case "Credits":
5597
- return /* @__PURE__ */ jsx48(Credits, {});
6337
+ return /* @__PURE__ */ jsx53(Credits, {});
5598
6338
  case "Doctor":
5599
- return /* @__PURE__ */ jsx48(Doctor, {});
6339
+ return /* @__PURE__ */ jsx53(Doctor, {});
5600
6340
  case "DoctorCheck":
5601
- return /* @__PURE__ */ jsx48(DoctorCheck, {});
6341
+ return /* @__PURE__ */ jsx53(DoctorCheck, {});
6342
+ case "Approvals":
6343
+ return /* @__PURE__ */ jsx53(Approvals, {});
6344
+ case "Config":
6345
+ return /* @__PURE__ */ jsx53(Config, {});
6346
+ case "Presets":
6347
+ return /* @__PURE__ */ jsx53(Presets, {});
5602
6348
  default:
5603
- return /* @__PURE__ */ jsx48(Runs, {});
6349
+ return /* @__PURE__ */ jsx53(Runs, {});
5604
6350
  }
5605
6351
  }
5606
6352
  function nextHistoryOnPush(prev, screen) {
@@ -5623,16 +6369,16 @@ function Router({ initialScreen } = {}) {
5623
6369
  const { exit } = useApp3();
5624
6370
  const envRunId = process.env.REEVES_RUN_ID ?? null;
5625
6371
  const openTokenRef = useRef4(readTuiOpenToken());
5626
- const [selectedRunId, setSelectedRunId] = useState32(envRunId);
5627
- const [selectedAgentId, setSelectedAgentId] = useState32(null);
5628
- const [selectedCheckName, setSelectedCheckName] = useState32(null);
5629
- const [selectedWorkerIdx, setSelectedWorkerIdx] = useState32(null);
6372
+ const [selectedRunId, setSelectedRunId] = useState36(envRunId);
6373
+ const [selectedAgentId, setSelectedAgentId] = useState36(null);
6374
+ const [selectedCheckName, setSelectedCheckName] = useState36(null);
6375
+ const [selectedWorkerIdx, setSelectedWorkerIdx] = useState36(null);
5630
6376
  const firstRunNeedsLanguage = !initialScreen && !configExists();
5631
- const [history, setHistory] = useState32(() => ({
6377
+ const [history, setHistory] = useState36(() => ({
5632
6378
  entries: [initialScreen ? normalizeScreen(initialScreen) : firstRunNeedsLanguage ? "LanguageSelect" : "Welcome"],
5633
6379
  index: 0
5634
6380
  }));
5635
- useEffect15(() => {
6381
+ useEffect17(() => {
5636
6382
  if (initialScreen) return;
5637
6383
  const timer = setInterval(() => {
5638
6384
  const token = readTuiOpenToken();
@@ -5671,7 +6417,7 @@ function Router({ initialScreen } = {}) {
5671
6417
  const current = normalizeScreen(history.entries[history.index] ?? "Runs");
5672
6418
  const canBack = history.index > 0;
5673
6419
  const canForward = history.index < history.entries.length - 1;
5674
- return /* @__PURE__ */ jsx48(RouterContext.Provider, { value: {
6420
+ return /* @__PURE__ */ jsx53(RouterContext.Provider, { value: {
5675
6421
  screen: current,
5676
6422
  push,
5677
6423
  pop,
@@ -5688,7 +6434,7 @@ function Router({ initialScreen } = {}) {
5688
6434
  setSelectedWorkerIdx,
5689
6435
  canBack,
5690
6436
  canForward
5691
- }, children: /* @__PURE__ */ jsx48(LanguageProvider, { children: /* @__PURE__ */ jsx48(WizardProvider, { children: /* @__PURE__ */ jsx48(WorkerDraftProvider, { children: /* @__PURE__ */ jsx48(ToastProvider, { children: /* @__PURE__ */ jsx48(ErrorBoundary, { children: renderScreen(current) }) }) }) }) }) });
6437
+ }, children: /* @__PURE__ */ jsx53(LanguageProvider, { children: /* @__PURE__ */ jsx53(WizardProvider, { children: /* @__PURE__ */ jsx53(WorkerDraftProvider, { children: /* @__PURE__ */ jsx53(ToastProvider, { children: /* @__PURE__ */ jsx53(ErrorBoundary, { children: renderScreen(current) }) }) }) }) }) });
5692
6438
  }
5693
6439
  export {
5694
6440
  Router,
@@ -5697,4 +6443,4 @@ export {
5697
6443
  nextHistoryOnReset,
5698
6444
  useRouter
5699
6445
  };
5700
- //# sourceMappingURL=router-WCFLHJV7.js.map
6446
+ //# sourceMappingURL=router-TGRU5BFX.js.map