reevesagents 1.2.0 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +41 -0
- package/README.ar.md +397 -0
- package/README.de.md +406 -0
- package/README.es.md +418 -0
- package/README.fr.md +340 -0
- package/README.it.md +400 -0
- package/README.md +290 -171
- package/README.pt.md +417 -0
- package/README.ru.md +401 -0
- package/README.tr.md +415 -0
- package/README.zh-Hans.md +340 -0
- package/dist/chunk-4LWTEYRI.js +4878 -0
- package/dist/chunk-4W6MVOPK.js +29 -0
- package/dist/{chunk-4Q3JF22J.js → chunk-5DOCQLT7.js} +2 -2
- package/dist/{chunk-MVMGFG4W.js → chunk-65LHCGPC.js} +836 -263
- package/dist/chunk-D24DQQ6V.js +0 -0
- package/dist/chunk-HS6TOISU.js +30 -0
- package/dist/chunk-Z2JHNE7V.js +317 -0
- package/dist/cli.d.ts +4 -1
- package/dist/cli.js +374 -45
- package/dist/extras-25AF6TAR.js +0 -0
- package/dist/index.d.ts +13 -37
- package/dist/index.js +13 -19
- package/dist/open-browser-DRSIJQ37.js +0 -0
- package/dist/{router-WCFLHJV7.js → router-I4WDR7CD.js} +1478 -764
- package/dist/server-H2XEJQYT.js +622 -0
- package/dist/{server-Z2YTGWSX.js → server-ZJKAIRL5.js} +261 -135
- package/dist/{tui-launch-7RGFE5KY.js → tui-launch-VHLX6JOW.js} +2 -2
- package/dist/web/app.css +321 -13
- package/dist/web/app.js +626 -51
- package/dist/web/index.html +115 -10
- package/package.json +22 -18
- package/dist/chunk-3IXII4H5.js +0 -129
- package/dist/chunk-DHAW6OY3.js +0 -40
- package/dist/chunk-G6FN75ZW.js +0 -2393
- package/dist/chunk-JY4ZTTRK.js +0 -172
- package/dist/chunk-LUW6GCPO.js +0 -108
|
@@ -1,25 +1,26 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
|
-
REEVESAGENTS_VERSION,
|
|
4
3
|
readTuiOpenToken
|
|
5
|
-
} from "./chunk-
|
|
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-
|
|
8
|
+
} from "./chunk-4LWTEYRI.js";
|
|
18
9
|
import {
|
|
19
10
|
modelDisplayName,
|
|
20
11
|
modelValuesForProvider
|
|
21
|
-
} from "./chunk-
|
|
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-
|
|
69
|
+
} from "./chunk-65LHCGPC.js";
|
|
70
|
+
import "./chunk-D24DQQ6V.js";
|
|
61
71
|
import {
|
|
62
72
|
startWebFromTui
|
|
63
|
-
} from "./chunk-
|
|
73
|
+
} from "./chunk-5DOCQLT7.js";
|
|
64
74
|
|
|
65
|
-
// src/router.tsx
|
|
66
|
-
import { createContext as createContext6, useContext as useContext6, useState as
|
|
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/
|
|
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/
|
|
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/
|
|
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/
|
|
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/
|
|
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
|
|
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
|
|
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,8 @@ var glyphs = {
|
|
|
267
306
|
}
|
|
268
307
|
};
|
|
269
308
|
|
|
270
|
-
// src/components/Header.tsx
|
|
271
|
-
import { jsx as
|
|
309
|
+
// src/tui/components/Header.tsx
|
|
310
|
+
import { jsx as jsx6, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
272
311
|
function Header({ breadcrumb, meta, tmuxSession, columns }) {
|
|
273
312
|
const width = Math.max(1, columns - 1);
|
|
274
313
|
const isNarrow = columns < 60;
|
|
@@ -281,7 +320,7 @@ function Header({ breadcrumb, meta, tmuxSession, columns }) {
|
|
|
281
320
|
const leftWidth = Math.max(1, width - metaWidth);
|
|
282
321
|
if (isNarrow) {
|
|
283
322
|
const current = breadcrumb[breadcrumb.length - 1] || "";
|
|
284
|
-
return /* @__PURE__ */
|
|
323
|
+
return /* @__PURE__ */ jsx6(Box2, { width, height: 1, children: /* @__PURE__ */ jsx6(Text2, { color: colors.accent.primary, bold: true, wrap: "truncate-end", children: current }) });
|
|
285
324
|
}
|
|
286
325
|
const breadcrumbParts = [];
|
|
287
326
|
for (let i = 0; i < breadcrumb.length; i++) {
|
|
@@ -289,12 +328,12 @@ function Header({ breadcrumb, meta, tmuxSession, columns }) {
|
|
|
289
328
|
const isCurrent = i === breadcrumb.length - 1;
|
|
290
329
|
if (i > 0) {
|
|
291
330
|
breadcrumbParts.push(
|
|
292
|
-
/* @__PURE__ */
|
|
331
|
+
/* @__PURE__ */ jsx6(Text2, { color: colors.text.dim, wrap: "truncate-end", children: ` ${glyphs.chevron} ` }, `sep-${i}`)
|
|
293
332
|
);
|
|
294
333
|
}
|
|
295
334
|
breadcrumbParts.push(
|
|
296
|
-
/* @__PURE__ */
|
|
297
|
-
|
|
335
|
+
/* @__PURE__ */ jsx6(
|
|
336
|
+
Text2,
|
|
298
337
|
{
|
|
299
338
|
color: isCurrent ? colors.accent.primary : colors.text.dim,
|
|
300
339
|
bold: isCurrent,
|
|
@@ -305,15 +344,15 @@ function Header({ breadcrumb, meta, tmuxSession, columns }) {
|
|
|
305
344
|
)
|
|
306
345
|
);
|
|
307
346
|
}
|
|
308
|
-
return /* @__PURE__ */
|
|
309
|
-
/* @__PURE__ */
|
|
310
|
-
metaWidth > 0 && /* @__PURE__ */
|
|
347
|
+
return /* @__PURE__ */ jsxs2(Box2, { width, height: 1, flexDirection: "row", children: [
|
|
348
|
+
/* @__PURE__ */ jsx6(Box2, { width: leftWidth, height: 1, flexShrink: 0, flexDirection: "row", children: breadcrumbParts }),
|
|
349
|
+
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
350
|
] });
|
|
312
351
|
}
|
|
313
352
|
|
|
314
|
-
// src/components/Tagline.tsx
|
|
315
|
-
import { Box as
|
|
316
|
-
import { jsx as
|
|
353
|
+
// src/tui/components/Tagline.tsx
|
|
354
|
+
import { Box as Box3, Text as Text3 } from "ink";
|
|
355
|
+
import { jsx as jsx7, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
317
356
|
function Tagline({ text, rows, cols }) {
|
|
318
357
|
const isTight = rows < 22;
|
|
319
358
|
const height = isTight ? 1 : 2;
|
|
@@ -324,16 +363,16 @@ function Tagline({ text, rows, cols }) {
|
|
|
324
363
|
displayText = sentences[0] + ".";
|
|
325
364
|
}
|
|
326
365
|
}
|
|
327
|
-
return /* @__PURE__ */
|
|
328
|
-
/* @__PURE__ */
|
|
329
|
-
!isTight && /* @__PURE__ */
|
|
366
|
+
return /* @__PURE__ */ jsxs3(Box3, { flexDirection: "column", width: cols, height, paddingX: space.sm, children: [
|
|
367
|
+
/* @__PURE__ */ jsx7(Text3, { color: colors.text.dim, wrap: "truncate-end", children: displayText }),
|
|
368
|
+
!isTight && /* @__PURE__ */ jsx7(Text3, { children: " " })
|
|
330
369
|
] });
|
|
331
370
|
}
|
|
332
371
|
|
|
333
|
-
// src/components/Detail.tsx
|
|
334
|
-
import { Box as
|
|
372
|
+
// src/tui/components/Detail.tsx
|
|
373
|
+
import { Box as Box4, Text as Text4 } from "ink";
|
|
335
374
|
|
|
336
|
-
// src/components/borderStyles.ts
|
|
375
|
+
// src/tui/components/borderStyles.ts
|
|
337
376
|
var DASHED_BORDER = {
|
|
338
377
|
topLeft: "\u250C",
|
|
339
378
|
top: "\u2504",
|
|
@@ -345,18 +384,18 @@ var DASHED_BORDER = {
|
|
|
345
384
|
bottomRight: "\u2518"
|
|
346
385
|
};
|
|
347
386
|
|
|
348
|
-
// src/components/Detail.tsx
|
|
349
|
-
import { jsx as
|
|
387
|
+
// src/tui/components/Detail.tsx
|
|
388
|
+
import { jsx as jsx8, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
350
389
|
function Detail({ title, children }) {
|
|
351
|
-
return /* @__PURE__ */
|
|
352
|
-
title && /* @__PURE__ */
|
|
353
|
-
/* @__PURE__ */
|
|
390
|
+
return /* @__PURE__ */ jsxs4(Box4, { flexDirection: "column", marginLeft: space.sm, borderStyle: DASHED_BORDER, borderColor: colors.accent.deep, paddingX: space.sm, paddingY: space.sm, children: [
|
|
391
|
+
title && /* @__PURE__ */ jsx8(Box4, { marginBottom: space.sm, children: /* @__PURE__ */ jsx8(Text4, { color: colors.accent.primary, bold: true, children: title }) }),
|
|
392
|
+
/* @__PURE__ */ jsx8(Box4, { flexDirection: "column", children })
|
|
354
393
|
] });
|
|
355
394
|
}
|
|
356
395
|
|
|
357
|
-
// src/components/StatusBar.tsx
|
|
358
|
-
import { Box as
|
|
359
|
-
import { jsx as
|
|
396
|
+
// src/tui/components/StatusBar.tsx
|
|
397
|
+
import { Box as Box5, Text as Text5 } from "ink";
|
|
398
|
+
import { jsx as jsx9, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
360
399
|
function StatusBar({ context = "", keys, rows, cols }) {
|
|
361
400
|
const { current: toast } = useToast();
|
|
362
401
|
let line1Text = context;
|
|
@@ -373,18 +412,18 @@ function StatusBar({ context = "", keys, rows, cols }) {
|
|
|
373
412
|
const compactToast = Boolean(toast) && !showKeysOnSecondLine;
|
|
374
413
|
const firstLineText = showKeysOnSecondLine || compactToast ? hasContextLine ? line1Text : line2Text : line2Text;
|
|
375
414
|
const firstLineColor = showKeysOnSecondLine || compactToast ? hasContextLine ? line1Color : colors.text.muted : colors.text.muted;
|
|
376
|
-
return /* @__PURE__ */
|
|
377
|
-
/* @__PURE__ */
|
|
378
|
-
showKeysOnSecondLine && /* @__PURE__ */
|
|
415
|
+
return /* @__PURE__ */ jsxs5(Box5, { flexDirection: "column", width: cols, height, children: [
|
|
416
|
+
/* @__PURE__ */ jsx9(Text5, { color: firstLineColor, wrap: "truncate-end", children: firstLineText }),
|
|
417
|
+
showKeysOnSecondLine && /* @__PURE__ */ jsx9(Text5, { color: colors.text.muted, wrap: "truncate-end", children: line2Text })
|
|
379
418
|
] });
|
|
380
419
|
}
|
|
381
420
|
|
|
382
|
-
// src/components/LayoutContext.tsx
|
|
421
|
+
// src/tui/components/LayoutContext.tsx
|
|
383
422
|
import { createContext as createContext5, useContext as useContext5 } from "react";
|
|
384
|
-
import { jsx as
|
|
423
|
+
import { jsx as jsx10 } from "react/jsx-runtime";
|
|
385
424
|
var LayoutContext = createContext5({});
|
|
386
425
|
function LayoutProvider({ columns, rows, children }) {
|
|
387
|
-
return /* @__PURE__ */
|
|
426
|
+
return /* @__PURE__ */ jsx10(LayoutContext.Provider, { value: { columns, rows }, children });
|
|
388
427
|
}
|
|
389
428
|
function useLayoutColumns() {
|
|
390
429
|
return useContext5(LayoutContext).columns ?? process.stdout.columns ?? 100;
|
|
@@ -393,22 +432,22 @@ function panelWidth(columns) {
|
|
|
393
432
|
return Math.max(1, columns);
|
|
394
433
|
}
|
|
395
434
|
|
|
396
|
-
// src/components/Frame.tsx
|
|
397
|
-
import { jsx as
|
|
435
|
+
// src/tui/components/Frame.tsx
|
|
436
|
+
import { jsx as jsx11, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
398
437
|
var FLOOR_COLS = 40;
|
|
399
438
|
var FLOOR_ROWS = 12;
|
|
400
439
|
var DETAIL_BREAKPOINT = 90;
|
|
401
440
|
var CLEAR_TERMINAL = "\x1B[3J\x1B[2J\x1B[H";
|
|
402
441
|
function ResizeMessage({ cols, rows }) {
|
|
403
|
-
return /* @__PURE__ */
|
|
404
|
-
/* @__PURE__ */
|
|
442
|
+
return /* @__PURE__ */ jsxs6(Box6, { flexDirection: "column", alignItems: "center", justifyContent: "center", width: cols, height: rows, children: [
|
|
443
|
+
/* @__PURE__ */ jsxs6(Text6, { color: colors.text.dim, wrap: "truncate-end", children: [
|
|
405
444
|
"ReevesAgents needs at least ",
|
|
406
445
|
FLOOR_COLS,
|
|
407
446
|
"x",
|
|
408
447
|
FLOOR_ROWS,
|
|
409
448
|
"."
|
|
410
449
|
] }),
|
|
411
|
-
/* @__PURE__ */
|
|
450
|
+
/* @__PURE__ */ jsxs6(Text6, { color: colors.text.dim, wrap: "truncate-end", children: [
|
|
412
451
|
"Current: ",
|
|
413
452
|
cols,
|
|
414
453
|
"x",
|
|
@@ -418,7 +457,7 @@ function ResizeMessage({ cols, rows }) {
|
|
|
418
457
|
] });
|
|
419
458
|
}
|
|
420
459
|
function Rule({ cols }) {
|
|
421
|
-
return /* @__PURE__ */
|
|
460
|
+
return /* @__PURE__ */ jsx11(Text6, { color: colors.surface.quiet, wrap: "truncate-end", children: "\u2504".repeat(Math.max(1, cols - 1)) });
|
|
422
461
|
}
|
|
423
462
|
function frameBodyRows(rows, hasTagline, hasStatusContext) {
|
|
424
463
|
const innerRows = Math.max(1, rows - 2);
|
|
@@ -457,7 +496,7 @@ function Frame({
|
|
|
457
496
|
const bodyPadding = space.sm;
|
|
458
497
|
useResizeClear(cols, rows, tooSmall);
|
|
459
498
|
if (tooSmall) {
|
|
460
|
-
return /* @__PURE__ */
|
|
499
|
+
return /* @__PURE__ */ jsx11(ResizeMessage, { cols, rows });
|
|
461
500
|
}
|
|
462
501
|
const showDetail = detail !== void 0 && innerCols >= DETAIL_BREAKPOINT;
|
|
463
502
|
const bodyColumns = Math.max(1, innerCols - bodyPadding * 2 - (showDetail ? 36 : 0));
|
|
@@ -472,8 +511,8 @@ function Frame({
|
|
|
472
511
|
const displayStatusContext = statusContext ? translatePhrase(language, statusContext) : statusContext;
|
|
473
512
|
const displayStatusKeys = statusKeys ? translatePhrase(language, statusKeys) : statusKeys;
|
|
474
513
|
const bodyRows = frameBodyRows(rows, Boolean(displayTagline), Boolean(displayStatusContext));
|
|
475
|
-
return /* @__PURE__ */
|
|
476
|
-
/* @__PURE__ */
|
|
514
|
+
return /* @__PURE__ */ jsxs6(Box6, { flexDirection: "column", width: cols, borderStyle: "single", borderColor: colors.surface.border, children: [
|
|
515
|
+
/* @__PURE__ */ jsx11(
|
|
477
516
|
Header,
|
|
478
517
|
{
|
|
479
518
|
breadcrumb: displayBreadcrumb,
|
|
@@ -482,21 +521,21 @@ function Frame({
|
|
|
482
521
|
columns: innerCols
|
|
483
522
|
}
|
|
484
523
|
),
|
|
485
|
-
/* @__PURE__ */
|
|
486
|
-
displayTagline ? /* @__PURE__ */
|
|
487
|
-
/* @__PURE__ */
|
|
488
|
-
/* @__PURE__ */
|
|
489
|
-
showDetail ? /* @__PURE__ */
|
|
524
|
+
/* @__PURE__ */ jsx11(Rule, { cols: innerCols }),
|
|
525
|
+
displayTagline ? /* @__PURE__ */ jsx11(Tagline, { text: displayTagline, rows: innerRows, cols: innerCols }) : null,
|
|
526
|
+
/* @__PURE__ */ jsxs6(Box6, { flexDirection: "row", maxHeight: bodyRows, overflow: "hidden", children: [
|
|
527
|
+
/* @__PURE__ */ jsx11(LayoutProvider, { columns: bodyColumns, rows: bodyRows, children: /* @__PURE__ */ jsx11(Box6, { flexDirection: "column", flexGrow: 1, maxHeight: bodyRows, paddingX: bodyPadding, overflow: "hidden", children }) }),
|
|
528
|
+
showDetail ? /* @__PURE__ */ jsx11(Box6, { width: 36, flexShrink: 0, overflow: "hidden", children: /* @__PURE__ */ jsx11(Detail, { title: displayDetailTitle, children: detail }) }) : null
|
|
490
529
|
] }),
|
|
491
|
-
/* @__PURE__ */
|
|
492
|
-
/* @__PURE__ */
|
|
530
|
+
/* @__PURE__ */ jsx11(Rule, { cols: innerCols }),
|
|
531
|
+
/* @__PURE__ */ jsx11(StatusBar, { context: displayStatusContext, keys: displayStatusKeys, rows: innerRows, cols: innerCols })
|
|
493
532
|
] });
|
|
494
533
|
}
|
|
495
534
|
|
|
496
|
-
// src/components/Row.tsx
|
|
497
|
-
import
|
|
498
|
-
import { Box as
|
|
499
|
-
import { Fragment, jsx as
|
|
535
|
+
// src/tui/components/Row.tsx
|
|
536
|
+
import React8 from "react";
|
|
537
|
+
import { Box as Box7, Text as Text7 } from "ink";
|
|
538
|
+
import { Fragment, jsx as jsx12, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
500
539
|
function truncateBadgeLabel(label, compact) {
|
|
501
540
|
const max = compact ? 14 : 24;
|
|
502
541
|
if (label.length <= max) return label;
|
|
@@ -544,11 +583,11 @@ function Row({
|
|
|
544
583
|
const mainWidth = showTrailing ? Math.max(1, availableWidth - trailingWidth) : void 0;
|
|
545
584
|
const trailingSeparatorWidth = 3;
|
|
546
585
|
const trailingTextWidth = Math.max(1, trailingWidth - trailingSeparatorWidth);
|
|
547
|
-
return /* @__PURE__ */
|
|
548
|
-
/* @__PURE__ */
|
|
549
|
-
/* @__PURE__ */
|
|
550
|
-
/* @__PURE__ */
|
|
551
|
-
|
|
586
|
+
return /* @__PURE__ */ jsxs7(Box7, { flexDirection: "row", width, children: [
|
|
587
|
+
/* @__PURE__ */ jsx12(Box7, { width: 1, flexShrink: 0, children: /* @__PURE__ */ jsx12(Text7, { color: cursorColor, children: cursorChar }) }),
|
|
588
|
+
/* @__PURE__ */ jsx12(Box7, { width: 2, flexShrink: 0, children: /* @__PURE__ */ jsx12(Text7, { color: railColor, children: " \u2502" }) }),
|
|
589
|
+
/* @__PURE__ */ jsxs7(
|
|
590
|
+
Box7,
|
|
552
591
|
{
|
|
553
592
|
marginLeft: space.sm,
|
|
554
593
|
flexDirection: "row",
|
|
@@ -556,22 +595,22 @@ function Row({
|
|
|
556
595
|
flexGrow: showTrailing ? 0 : 1,
|
|
557
596
|
flexShrink: 1,
|
|
558
597
|
children: [
|
|
559
|
-
glyph && /* @__PURE__ */
|
|
560
|
-
glyph && /* @__PURE__ */
|
|
598
|
+
glyph && /* @__PURE__ */ jsx12(Text7, { color: glyph.color, children: glyph.char }),
|
|
599
|
+
glyph && /* @__PURE__ */ jsx12(Text7, { children: " " }),
|
|
561
600
|
inlineBadges.map((item, idx) => {
|
|
562
601
|
const label = truncateBadgeLabel(item.label, compact);
|
|
563
602
|
const displayLabel = item.width && !compact ? label.padEnd(item.width) : label;
|
|
564
|
-
return /* @__PURE__ */
|
|
565
|
-
/* @__PURE__ */
|
|
566
|
-
/* @__PURE__ */
|
|
567
|
-
/* @__PURE__ */
|
|
568
|
-
/* @__PURE__ */
|
|
603
|
+
return /* @__PURE__ */ jsxs7(React8.Fragment, { children: [
|
|
604
|
+
/* @__PURE__ */ jsx12(Text7, { color: badgeBracketColor, children: "[" }),
|
|
605
|
+
/* @__PURE__ */ jsx12(Text7, { color: item.color, children: displayLabel }),
|
|
606
|
+
/* @__PURE__ */ jsx12(Text7, { color: badgeBracketColor, children: "]" }),
|
|
607
|
+
/* @__PURE__ */ jsx12(Text7, { children: " " })
|
|
569
608
|
] }, `${item.label}-${idx}`);
|
|
570
609
|
}),
|
|
571
|
-
buttonLike ? /* @__PURE__ */
|
|
572
|
-
/* @__PURE__ */
|
|
573
|
-
/* @__PURE__ */
|
|
574
|
-
|
|
610
|
+
buttonLike ? /* @__PURE__ */ jsxs7(Fragment, { children: [
|
|
611
|
+
/* @__PURE__ */ jsx12(Text7, { color: buttonBorderColor, backgroundColor: buttonBg, children: "[ " }),
|
|
612
|
+
/* @__PURE__ */ jsx12(
|
|
613
|
+
Text7,
|
|
575
614
|
{
|
|
576
615
|
color: primaryColor,
|
|
577
616
|
backgroundColor: buttonBg,
|
|
@@ -581,9 +620,9 @@ function Row({
|
|
|
581
620
|
children: primaryText
|
|
582
621
|
}
|
|
583
622
|
),
|
|
584
|
-
/* @__PURE__ */
|
|
585
|
-
] }) : /* @__PURE__ */
|
|
586
|
-
|
|
623
|
+
/* @__PURE__ */ jsx12(Text7, { color: buttonBorderColor, backgroundColor: buttonBg, children: " ]" })
|
|
624
|
+
] }) : /* @__PURE__ */ jsx12(
|
|
625
|
+
Text7,
|
|
587
626
|
{
|
|
588
627
|
color: primaryColor,
|
|
589
628
|
bold: textBold,
|
|
@@ -592,24 +631,24 @@ function Row({
|
|
|
592
631
|
children: displayPrimary
|
|
593
632
|
}
|
|
594
633
|
),
|
|
595
|
-
showHint && displayHint && /* @__PURE__ */
|
|
596
|
-
/* @__PURE__ */
|
|
597
|
-
/* @__PURE__ */
|
|
634
|
+
showHint && displayHint && /* @__PURE__ */ jsxs7(Fragment, { children: [
|
|
635
|
+
/* @__PURE__ */ jsx12(Text7, { color: separatorColor, children: " \u2502" }),
|
|
636
|
+
/* @__PURE__ */ jsx12(Box7, { marginLeft: space.sm, flexShrink: 1, children: /* @__PURE__ */ jsx12(Text7, { color: hintColor, wrap: "truncate-end", children: displayHint }) })
|
|
598
637
|
] })
|
|
599
638
|
]
|
|
600
639
|
}
|
|
601
640
|
),
|
|
602
|
-
showTrailing && /* @__PURE__ */
|
|
603
|
-
/* @__PURE__ */
|
|
604
|
-
/* @__PURE__ */
|
|
641
|
+
showTrailing && /* @__PURE__ */ jsxs7(Box7, { flexDirection: "row", width: trailingWidth, flexShrink: 0, children: [
|
|
642
|
+
/* @__PURE__ */ jsx12(Box7, { width: trailingSeparatorWidth, flexShrink: 0, children: /* @__PURE__ */ jsx12(Text7, { color: separatorColor, children: " \u2502 " }) }),
|
|
643
|
+
/* @__PURE__ */ jsx12(Box7, { width: trailingTextWidth, flexShrink: 0, children: /* @__PURE__ */ jsx12(Text7, { color: colors.text.muted, wrap: "truncate-end", children: displayTrailing }) })
|
|
605
644
|
] }),
|
|
606
|
-
/* @__PURE__ */
|
|
645
|
+
/* @__PURE__ */ jsx12(Box7, { width: 2, flexShrink: 0, children: /* @__PURE__ */ jsx12(Text7, { color: railColor, children: " \u2502" }) })
|
|
607
646
|
] });
|
|
608
647
|
}
|
|
609
648
|
|
|
610
|
-
// src/components/Section.tsx
|
|
611
|
-
import { Box as
|
|
612
|
-
import { Fragment as Fragment2, jsx as
|
|
649
|
+
// src/tui/components/Section.tsx
|
|
650
|
+
import { Box as Box8, Text as Text8 } from "ink";
|
|
651
|
+
import { Fragment as Fragment2, jsx as jsx13, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
613
652
|
function Section({ label }) {
|
|
614
653
|
const { language } = useLanguage();
|
|
615
654
|
const columns = useLayoutColumns();
|
|
@@ -617,12 +656,12 @@ function Section({ label }) {
|
|
|
617
656
|
const labelTextWidth = displayLabel ? displayLabel.length + 2 : 0;
|
|
618
657
|
const width = Math.max(labelTextWidth + 7, panelWidth(columns));
|
|
619
658
|
const suffix = "\u2500".repeat(Math.max(2, width - labelTextWidth - 5));
|
|
620
|
-
return /* @__PURE__ */
|
|
659
|
+
return /* @__PURE__ */ jsx13(Box8, { children: /* @__PURE__ */ jsxs8(Text8, { color: colors.surface.border, wrap: "truncate-end", children: [
|
|
621
660
|
" ",
|
|
622
661
|
"\u256D\u2500",
|
|
623
|
-
displayLabel ? /* @__PURE__ */
|
|
662
|
+
displayLabel ? /* @__PURE__ */ jsxs8(Fragment2, { children: [
|
|
624
663
|
" ",
|
|
625
|
-
/* @__PURE__ */
|
|
664
|
+
/* @__PURE__ */ jsx13(Text8, { color: colors.accent.primary, bold: true, children: displayLabel }),
|
|
626
665
|
" "
|
|
627
666
|
] }) : null,
|
|
628
667
|
suffix,
|
|
@@ -633,7 +672,7 @@ function SectionEnd() {
|
|
|
633
672
|
const columns = useLayoutColumns();
|
|
634
673
|
const width = Math.max(4, panelWidth(columns));
|
|
635
674
|
const suffix = "\u2500".repeat(Math.max(0, width - 4));
|
|
636
|
-
return /* @__PURE__ */
|
|
675
|
+
return /* @__PURE__ */ jsx13(Box8, { children: /* @__PURE__ */ jsxs8(Text8, { color: colors.surface.border, wrap: "truncate-end", children: [
|
|
637
676
|
" ",
|
|
638
677
|
"\u2570",
|
|
639
678
|
suffix,
|
|
@@ -641,8 +680,8 @@ function SectionEnd() {
|
|
|
641
680
|
] }) });
|
|
642
681
|
}
|
|
643
682
|
|
|
644
|
-
// src/screens/LanguageSelect.tsx
|
|
645
|
-
import { Fragment as Fragment3, jsx as
|
|
683
|
+
// src/tui/screens/LanguageSelect.tsx
|
|
684
|
+
import { Fragment as Fragment3, jsx as jsx14, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
646
685
|
var LABEL_WIDTH = Math.max(...LANGUAGE_OPTIONS.map((option) => option.nativeName.length));
|
|
647
686
|
function LanguageSelect() {
|
|
648
687
|
const { replace } = useRouter();
|
|
@@ -677,21 +716,21 @@ function LanguageSelect() {
|
|
|
677
716
|
return;
|
|
678
717
|
}
|
|
679
718
|
});
|
|
680
|
-
return /* @__PURE__ */
|
|
719
|
+
return /* @__PURE__ */ jsx14(
|
|
681
720
|
Frame,
|
|
682
721
|
{
|
|
683
722
|
breadcrumb: ["ReevesAgents", t("common.language")],
|
|
684
723
|
tagline: t("language.subtitle"),
|
|
685
724
|
statusKeys: t("language.status"),
|
|
686
|
-
children: /* @__PURE__ */
|
|
687
|
-
showIntro && /* @__PURE__ */
|
|
688
|
-
/* @__PURE__ */
|
|
689
|
-
/* @__PURE__ */
|
|
725
|
+
children: /* @__PURE__ */ jsxs9(Box9, { flexDirection: "column", children: [
|
|
726
|
+
showIntro && /* @__PURE__ */ jsxs9(Fragment3, { children: [
|
|
727
|
+
/* @__PURE__ */ jsx14(Text9, { color: colors.accent.primary, bold: true, wrap: "truncate-end", children: t("language.title") }),
|
|
728
|
+
/* @__PURE__ */ jsx14(Text9, { color: colors.text.dim, wrap: "truncate-end", children: t("language.hint") })
|
|
690
729
|
] }),
|
|
691
|
-
/* @__PURE__ */
|
|
730
|
+
/* @__PURE__ */ jsx14(Section, { label: t("common.language") }),
|
|
692
731
|
visibleOptions.map((option, localIdx) => {
|
|
693
732
|
const idx = firstVisible + localIdx;
|
|
694
|
-
return /* @__PURE__ */
|
|
733
|
+
return /* @__PURE__ */ jsx14(
|
|
695
734
|
Row,
|
|
696
735
|
{
|
|
697
736
|
selected: selectedIdx === idx,
|
|
@@ -703,7 +742,7 @@ function LanguageSelect() {
|
|
|
703
742
|
option.code
|
|
704
743
|
);
|
|
705
744
|
}),
|
|
706
|
-
LANGUAGE_OPTIONS.length > visibleLanguageCount && /* @__PURE__ */
|
|
745
|
+
LANGUAGE_OPTIONS.length > visibleLanguageCount && /* @__PURE__ */ jsx14(
|
|
707
746
|
Row,
|
|
708
747
|
{
|
|
709
748
|
selected: false,
|
|
@@ -712,21 +751,21 @@ function LanguageSelect() {
|
|
|
712
751
|
disabled: true
|
|
713
752
|
}
|
|
714
753
|
),
|
|
715
|
-
/* @__PURE__ */
|
|
754
|
+
/* @__PURE__ */ jsx14(SectionEnd, {})
|
|
716
755
|
] })
|
|
717
756
|
}
|
|
718
757
|
);
|
|
719
758
|
}
|
|
720
759
|
|
|
721
|
-
// src/screens/Welcome.tsx
|
|
760
|
+
// src/tui/screens/Welcome.tsx
|
|
722
761
|
import { useInsertionEffect as useInsertionEffect2, useMemo as useMemo2, useRef as useRef3, useState as useState7 } from "react";
|
|
723
|
-
import { Box as
|
|
762
|
+
import { Box as Box12, Text as Text12, useApp, useInput as useInput2, useWindowSize as useWindowSize3 } from "ink";
|
|
724
763
|
|
|
725
|
-
// src/components/Wordmark.tsx
|
|
764
|
+
// src/tui/components/Wordmark.tsx
|
|
726
765
|
import { useEffect as useEffect2, useMemo, useState as useState6 } from "react";
|
|
727
|
-
import { Box as
|
|
766
|
+
import { Box as Box10, Text as Text10 } from "ink";
|
|
728
767
|
|
|
729
|
-
// src/brand/wordmark.ts
|
|
768
|
+
// src/tui/brand/wordmark.ts
|
|
730
769
|
var GLYPHS = {
|
|
731
770
|
" ": ["000", "000", "000", "000", "000"],
|
|
732
771
|
A: ["01110", "10001", "11111", "10001", "10001"],
|
|
@@ -781,8 +820,8 @@ function logoRowsHalf(lines = LOGO_LINES) {
|
|
|
781
820
|
return out;
|
|
782
821
|
}
|
|
783
822
|
|
|
784
|
-
// src/components/Wordmark.tsx
|
|
785
|
-
import { jsx as
|
|
823
|
+
// src/tui/components/Wordmark.tsx
|
|
824
|
+
import { jsx as jsx15 } from "react/jsx-runtime";
|
|
786
825
|
var BREATH_INTERVAL_MS = 1600;
|
|
787
826
|
function useBreathFrame(enabled, intervalMs = BREATH_INTERVAL_MS) {
|
|
788
827
|
const [frame, setFrame] = useState6(0);
|
|
@@ -807,13 +846,13 @@ function Wordmark({ compact = false, animated = false, full = false, small = fal
|
|
|
807
846
|
const wordLines = lines ?? (full ? FULL_LOGO_LINES : LOGO_LINES);
|
|
808
847
|
return small ? logoRowsHalf(wordLines) : logoRows(wordLines, false);
|
|
809
848
|
}, [full, small, lines]);
|
|
810
|
-
return /* @__PURE__ */
|
|
849
|
+
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
850
|
}
|
|
812
851
|
|
|
813
|
-
// src/components/Mascot.tsx
|
|
814
|
-
import { Box as
|
|
852
|
+
// src/tui/components/Mascot.tsx
|
|
853
|
+
import { Box as Box11, Text as Text11 } from "ink";
|
|
815
854
|
|
|
816
|
-
// src/brand/duck-rendered.ts
|
|
855
|
+
// src/tui/brand/duck-rendered.ts
|
|
817
856
|
var DUCK_RENDERED = {
|
|
818
857
|
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
858
|
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 +868,14 @@ var DUCK_RENDERED = {
|
|
|
829
868
|
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
869
|
};
|
|
831
870
|
|
|
832
|
-
// src/components/Mascot.tsx
|
|
833
|
-
import { jsx as
|
|
871
|
+
// src/tui/components/Mascot.tsx
|
|
872
|
+
import { jsx as jsx16, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
834
873
|
function DuckRows({ artKey }) {
|
|
835
874
|
const rows = DUCK_RENDERED[artKey].split("\n");
|
|
836
|
-
return /* @__PURE__ */
|
|
875
|
+
return /* @__PURE__ */ jsx16(Box11, { flexDirection: "column", children: rows.map((row, idx) => /* @__PURE__ */ jsx16(Text11, { children: row }, `${artKey}-${idx}`)) });
|
|
837
876
|
}
|
|
838
877
|
function PadColumn({ rows }) {
|
|
839
|
-
return /* @__PURE__ */
|
|
878
|
+
return /* @__PURE__ */ jsx16(Box11, { flexDirection: "column", children: Array.from({ length: rows }, (_, idx) => /* @__PURE__ */ jsx16(Text11, { children: " " }, idx)) });
|
|
840
879
|
}
|
|
841
880
|
function shiftedKey(variant, shift) {
|
|
842
881
|
if (shift === "down") return `${variant}Down`;
|
|
@@ -844,31 +883,31 @@ function shiftedKey(variant, shift) {
|
|
|
844
883
|
return variant;
|
|
845
884
|
}
|
|
846
885
|
function Mascot({ variant, shift = "normal" }) {
|
|
847
|
-
if (variant === "mini") return /* @__PURE__ */
|
|
848
|
-
if (variant === "single") return /* @__PURE__ */
|
|
849
|
-
if (variant === "hero") return /* @__PURE__ */
|
|
886
|
+
if (variant === "mini") return /* @__PURE__ */ jsx16(DuckRows, { artKey: shiftedKey("mini", shift) });
|
|
887
|
+
if (variant === "single") return /* @__PURE__ */ jsx16(DuckRows, { artKey: shiftedKey("single", shift) });
|
|
888
|
+
if (variant === "hero") return /* @__PURE__ */ jsx16(DuckRows, { artKey: shiftedKey("hero", shift) });
|
|
850
889
|
const heroRowCount = DUCK_RENDERED.hero.split("\n").length;
|
|
851
890
|
const ducklingRowCount = DUCK_RENDERED.duckling.split("\n").length;
|
|
852
891
|
const pad = Math.max(0, heroRowCount - ducklingRowCount);
|
|
853
|
-
return /* @__PURE__ */
|
|
854
|
-
/* @__PURE__ */
|
|
855
|
-
/* @__PURE__ */
|
|
856
|
-
/* @__PURE__ */
|
|
857
|
-
/* @__PURE__ */
|
|
892
|
+
return /* @__PURE__ */ jsxs10(Box11, { flexDirection: "row", children: [
|
|
893
|
+
/* @__PURE__ */ jsx16(DuckRows, { artKey: shiftedKey("hero", shift) }),
|
|
894
|
+
/* @__PURE__ */ jsxs10(Box11, { marginLeft: 1, flexDirection: "column", children: [
|
|
895
|
+
/* @__PURE__ */ jsx16(PadColumn, { rows: pad }),
|
|
896
|
+
/* @__PURE__ */ jsx16(DuckRows, { artKey: shiftedKey("duckling", shift) })
|
|
858
897
|
] }),
|
|
859
|
-
/* @__PURE__ */
|
|
860
|
-
/* @__PURE__ */
|
|
861
|
-
/* @__PURE__ */
|
|
898
|
+
/* @__PURE__ */ jsxs10(Box11, { marginLeft: 1, flexDirection: "column", children: [
|
|
899
|
+
/* @__PURE__ */ jsx16(PadColumn, { rows: pad }),
|
|
900
|
+
/* @__PURE__ */ jsx16(DuckRows, { artKey: shiftedKey("duckling", shift) })
|
|
862
901
|
] }),
|
|
863
|
-
/* @__PURE__ */
|
|
864
|
-
/* @__PURE__ */
|
|
865
|
-
/* @__PURE__ */
|
|
902
|
+
/* @__PURE__ */ jsxs10(Box11, { marginLeft: 1, flexDirection: "column", children: [
|
|
903
|
+
/* @__PURE__ */ jsx16(PadColumn, { rows: pad }),
|
|
904
|
+
/* @__PURE__ */ jsx16(DuckRows, { artKey: shiftedKey("duckling", shift) })
|
|
866
905
|
] })
|
|
867
906
|
] });
|
|
868
907
|
}
|
|
869
908
|
|
|
870
|
-
// src/screens/Welcome.tsx
|
|
871
|
-
import { jsx as
|
|
909
|
+
// src/tui/screens/Welcome.tsx
|
|
910
|
+
import { jsx as jsx17, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
872
911
|
function pickMascotVariant(columns) {
|
|
873
912
|
if (columns < 50) return "mini";
|
|
874
913
|
if (columns < 90) return "single";
|
|
@@ -890,8 +929,11 @@ function Welcome() {
|
|
|
890
929
|
const rows2 = [
|
|
891
930
|
{ label: t("welcome.newRun"), hint: t("welcome.newRunHint"), screen: "NewRun" },
|
|
892
931
|
{ label: t("welcome.runs"), hint: t("welcome.runsHint"), screen: "Runs" },
|
|
932
|
+
{ label: t("welcome.presets"), hint: t("welcome.presetsHint"), screen: "Presets" },
|
|
893
933
|
{ label: t("welcome.doctor"), hint: t("welcome.doctorHint"), screen: "Doctor" },
|
|
894
|
-
{ label:
|
|
934
|
+
{ label: t("welcome.agentControl"), hint: t("welcome.agentControlHint"), screen: "AgentControl" },
|
|
935
|
+
{ label: t("welcome.approvals"), hint: t("welcome.approvalsHint"), screen: "Approvals" },
|
|
936
|
+
{ label: `${t("welcome.startWeb")}`, hint: t("welcome.startWebHint"), launchWeb: true },
|
|
895
937
|
{ label: t("common.settings"), hint: t("welcome.settingsHint"), screen: "Settings" },
|
|
896
938
|
{ label: t("welcome.reference"), hint: t("welcome.referenceHint"), screen: "Reference" },
|
|
897
939
|
{ label: t("welcome.credits"), hint: t("welcome.creditsHint"), screen: "Credits" },
|
|
@@ -969,23 +1011,23 @@ function Welcome() {
|
|
|
969
1011
|
return;
|
|
970
1012
|
}
|
|
971
1013
|
});
|
|
972
|
-
return /* @__PURE__ */
|
|
973
|
-
tinyRows ? /* @__PURE__ */
|
|
974
|
-
/* @__PURE__ */
|
|
975
|
-
/* @__PURE__ */
|
|
976
|
-
!tightRows && /* @__PURE__ */
|
|
1014
|
+
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: [
|
|
1015
|
+
tinyRows ? /* @__PURE__ */ jsx17(Text12, { color: colors.accent.primary, bold: true, wrap: "truncate-end", children: "ReevesAgents" }) : /* @__PURE__ */ jsxs11(Box12, { flexDirection: "row", alignItems: "flex-start", children: [
|
|
1016
|
+
/* @__PURE__ */ jsxs11(Box12, { flexDirection: "column", children: [
|
|
1017
|
+
/* @__PURE__ */ jsx17(Wordmark, { compact, animated: true, small: true, intervalMs: 400 }),
|
|
1018
|
+
!tightRows && /* @__PURE__ */ jsx17(Box12, { marginTop: 1, children: /* @__PURE__ */ jsx17(Wordmark, { lines: AGENTS_LINES, compact, animated: true, small: true, intervalMs: 400 }) })
|
|
977
1019
|
] }),
|
|
978
|
-
!tightRows && /* @__PURE__ */
|
|
1020
|
+
!tightRows && /* @__PURE__ */ jsx17(Box12, { marginLeft: 2, children: /* @__PURE__ */ jsx17(Mascot, { variant: mascotVariant }) })
|
|
979
1021
|
] }),
|
|
980
|
-
!tightRows && /* @__PURE__ */
|
|
981
|
-
/* @__PURE__ */
|
|
982
|
-
/* @__PURE__ */
|
|
1022
|
+
!tightRows && /* @__PURE__ */ jsxs11(Box12, { flexDirection: "column", marginTop: 1, children: [
|
|
1023
|
+
/* @__PURE__ */ jsx17(Text12, { color: colors.text.dim, wrap: "truncate-end", children: t("welcome.tagline1") }),
|
|
1024
|
+
/* @__PURE__ */ jsx17(Text12, { color: colors.text.dim, wrap: "truncate-end", children: t("welcome.tagline2") })
|
|
983
1025
|
] }),
|
|
984
|
-
/* @__PURE__ */
|
|
985
|
-
/* @__PURE__ */
|
|
1026
|
+
/* @__PURE__ */ jsx17(Box12, { flexDirection: "column", marginTop: tinyRows ? 0 : 1, children: /* @__PURE__ */ jsxs11(LayoutProvider, { columns: menuColumns, children: [
|
|
1027
|
+
/* @__PURE__ */ jsx17(Section, { label: t("welcome.menu") }),
|
|
986
1028
|
visibleActions.map((action, localIdx) => {
|
|
987
1029
|
const idx = firstVisibleAction + localIdx;
|
|
988
|
-
return /* @__PURE__ */
|
|
1030
|
+
return /* @__PURE__ */ jsx17(
|
|
989
1031
|
Row,
|
|
990
1032
|
{
|
|
991
1033
|
selected: selectedIdx === idx,
|
|
@@ -997,31 +1039,31 @@ function Welcome() {
|
|
|
997
1039
|
action.label
|
|
998
1040
|
);
|
|
999
1041
|
}),
|
|
1000
|
-
/* @__PURE__ */
|
|
1001
|
-
/* @__PURE__ */
|
|
1042
|
+
/* @__PURE__ */ jsx17(SectionEnd, {}),
|
|
1043
|
+
/* @__PURE__ */ jsx17(Box12, { children: /* @__PURE__ */ jsxs11(Text12, { color: colors.text.muted, children: [
|
|
1002
1044
|
t("welcome.keys"),
|
|
1003
1045
|
rangeText
|
|
1004
1046
|
] }) }),
|
|
1005
|
-
webStarting || webMessage ? /* @__PURE__ */
|
|
1047
|
+
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
1048
|
] }) })
|
|
1007
1049
|
] }) });
|
|
1008
1050
|
}
|
|
1009
1051
|
|
|
1010
|
-
// src/screens/Runs.tsx
|
|
1052
|
+
// src/tui/screens/Runs.tsx
|
|
1011
1053
|
import { useEffect as useEffect3, useMemo as useMemo3, useState as useState8 } from "react";
|
|
1012
|
-
import { Box as
|
|
1054
|
+
import { Box as Box14, useInput as useInput3, useApp as useApp2, useWindowSize as useWindowSize4 } from "ink";
|
|
1013
1055
|
|
|
1014
|
-
// src/components/Legend.tsx
|
|
1015
|
-
import { Box as
|
|
1016
|
-
import { jsx as
|
|
1056
|
+
// src/tui/components/Legend.tsx
|
|
1057
|
+
import { Box as Box13, Text as Text13 } from "ink";
|
|
1058
|
+
import { jsx as jsx18, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
1017
1059
|
function Legend({ items }) {
|
|
1018
1060
|
const { language } = useLanguage();
|
|
1019
|
-
return /* @__PURE__ */
|
|
1061
|
+
return /* @__PURE__ */ jsx18(Box13, { children: items.map((item, idx) => {
|
|
1020
1062
|
const displayLabel = translatePhrase(language, item.label);
|
|
1021
|
-
return /* @__PURE__ */
|
|
1022
|
-
idx > 0 && /* @__PURE__ */
|
|
1023
|
-
/* @__PURE__ */
|
|
1024
|
-
/* @__PURE__ */
|
|
1063
|
+
return /* @__PURE__ */ jsxs12(Box13, { children: [
|
|
1064
|
+
idx > 0 && /* @__PURE__ */ jsx18(Text13, { color: colors.text.dim, children: " " }),
|
|
1065
|
+
/* @__PURE__ */ jsx18(Text13, { color: item.color, children: item.glyph }),
|
|
1066
|
+
/* @__PURE__ */ jsxs12(Text13, { color: colors.text.dim, children: [
|
|
1025
1067
|
" ",
|
|
1026
1068
|
displayLabel
|
|
1027
1069
|
] })
|
|
@@ -1029,8 +1071,8 @@ function Legend({ items }) {
|
|
|
1029
1071
|
}) });
|
|
1030
1072
|
}
|
|
1031
1073
|
|
|
1032
|
-
// src/screens/Runs.tsx
|
|
1033
|
-
import { jsx as
|
|
1074
|
+
// src/tui/screens/Runs.tsx
|
|
1075
|
+
import { jsx as jsx19, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
1034
1076
|
var ACTIONS = ["NewRun", "History", "Main Menu", "Quit"];
|
|
1035
1077
|
var CHROME_ROWS = 18;
|
|
1036
1078
|
var ACTION_COPY = {
|
|
@@ -1181,7 +1223,7 @@ function Runs() {
|
|
|
1181
1223
|
} else if (selected?.type === "action" && selected.action) {
|
|
1182
1224
|
statusContext = ACTION_COPY[selected.action]?.hint ?? selected.action;
|
|
1183
1225
|
}
|
|
1184
|
-
return /* @__PURE__ */
|
|
1226
|
+
return /* @__PURE__ */ jsx19(
|
|
1185
1227
|
Frame,
|
|
1186
1228
|
{
|
|
1187
1229
|
breadcrumb: ["ReevesAgents", "Runs"],
|
|
@@ -1192,14 +1234,14 @@ function Runs() {
|
|
|
1192
1234
|
tagline: "Manage active runs and the agents inside them.",
|
|
1193
1235
|
statusContext,
|
|
1194
1236
|
statusKeys: "enter open \xB7 \u2191\u2193 scroll \xB7 esc main menu",
|
|
1195
|
-
children: compactBody ? /* @__PURE__ */
|
|
1196
|
-
/* @__PURE__ */
|
|
1197
|
-
runs.length === 0 && compactFirstEntry === 0 && /* @__PURE__ */
|
|
1237
|
+
children: compactBody ? /* @__PURE__ */ jsxs13(Box14, { flexDirection: "column", children: [
|
|
1238
|
+
/* @__PURE__ */ jsx19(Section, { label: activeIdx < runs.length ? "Runs" : "Actions" }),
|
|
1239
|
+
runs.length === 0 && compactFirstEntry === 0 && /* @__PURE__ */ jsx19(Row, { selected: false, primary: "No runs yet", trailing: "choose New Run", disabled: true }),
|
|
1198
1240
|
compactEntries.map((entry, idx) => {
|
|
1199
1241
|
const absoluteEntryIdx = compactFirstEntry + idx;
|
|
1200
1242
|
if (entry.type === "action") {
|
|
1201
1243
|
const absoluteIdx = runs.length + 1 + ACTIONS.indexOf(entry.action);
|
|
1202
|
-
return /* @__PURE__ */
|
|
1244
|
+
return /* @__PURE__ */ jsx19(
|
|
1203
1245
|
Row,
|
|
1204
1246
|
{
|
|
1205
1247
|
selected: activeIdx === absoluteIdx,
|
|
@@ -1220,7 +1262,7 @@ function Runs() {
|
|
|
1220
1262
|
{ label: modelBadgeLabel(root.model), color: modelColor(root.model, root.provider) }
|
|
1221
1263
|
] : []
|
|
1222
1264
|
];
|
|
1223
|
-
return /* @__PURE__ */
|
|
1265
|
+
return /* @__PURE__ */ jsx19(
|
|
1224
1266
|
Row,
|
|
1225
1267
|
{
|
|
1226
1268
|
selected: activeEntryIdx === absoluteEntryIdx,
|
|
@@ -1233,7 +1275,7 @@ function Runs() {
|
|
|
1233
1275
|
run.id
|
|
1234
1276
|
);
|
|
1235
1277
|
}),
|
|
1236
|
-
selectableEntries.length > compactEntryCount && /* @__PURE__ */
|
|
1278
|
+
selectableEntries.length > compactEntryCount && /* @__PURE__ */ jsx19(
|
|
1237
1279
|
Row,
|
|
1238
1280
|
{
|
|
1239
1281
|
selected: false,
|
|
@@ -1242,10 +1284,10 @@ function Runs() {
|
|
|
1242
1284
|
disabled: true
|
|
1243
1285
|
}
|
|
1244
1286
|
),
|
|
1245
|
-
/* @__PURE__ */
|
|
1246
|
-
] }) : /* @__PURE__ */
|
|
1247
|
-
/* @__PURE__ */
|
|
1248
|
-
runs.length === 0 ? /* @__PURE__ */
|
|
1287
|
+
/* @__PURE__ */ jsx19(SectionEnd, {})
|
|
1288
|
+
] }) : /* @__PURE__ */ jsxs13(Box14, { flexDirection: "column", children: [
|
|
1289
|
+
/* @__PURE__ */ jsx19(Section, { label: "Runs" }),
|
|
1290
|
+
runs.length === 0 ? /* @__PURE__ */ jsx19(
|
|
1249
1291
|
Row,
|
|
1250
1292
|
{
|
|
1251
1293
|
selected: false,
|
|
@@ -1264,7 +1306,7 @@ function Runs() {
|
|
|
1264
1306
|
{ label: modelBadgeLabel(root.model), color: modelColor(root.model, root.provider) }
|
|
1265
1307
|
] : []
|
|
1266
1308
|
];
|
|
1267
|
-
return /* @__PURE__ */
|
|
1309
|
+
return /* @__PURE__ */ jsx19(
|
|
1268
1310
|
Row,
|
|
1269
1311
|
{
|
|
1270
1312
|
selected: activeIdx === absoluteIdx,
|
|
@@ -1277,7 +1319,7 @@ function Runs() {
|
|
|
1277
1319
|
run.id
|
|
1278
1320
|
);
|
|
1279
1321
|
}),
|
|
1280
|
-
runs.length > visibleRunCount && /* @__PURE__ */
|
|
1322
|
+
runs.length > visibleRunCount && /* @__PURE__ */ jsx19(
|
|
1281
1323
|
Row,
|
|
1282
1324
|
{
|
|
1283
1325
|
selected: false,
|
|
@@ -1286,8 +1328,8 @@ function Runs() {
|
|
|
1286
1328
|
disabled: true
|
|
1287
1329
|
}
|
|
1288
1330
|
),
|
|
1289
|
-
/* @__PURE__ */
|
|
1290
|
-
/* @__PURE__ */
|
|
1331
|
+
/* @__PURE__ */ jsx19(SectionEnd, {}),
|
|
1332
|
+
/* @__PURE__ */ jsx19(
|
|
1291
1333
|
Legend,
|
|
1292
1334
|
{
|
|
1293
1335
|
items: [
|
|
@@ -1296,8 +1338,8 @@ function Runs() {
|
|
|
1296
1338
|
]
|
|
1297
1339
|
}
|
|
1298
1340
|
),
|
|
1299
|
-
/* @__PURE__ */
|
|
1300
|
-
ACTIONS.map((action, idx) => /* @__PURE__ */
|
|
1341
|
+
/* @__PURE__ */ jsx19(Section, { label: "Actions" }),
|
|
1342
|
+
ACTIONS.map((action, idx) => /* @__PURE__ */ jsx19(
|
|
1301
1343
|
Row,
|
|
1302
1344
|
{
|
|
1303
1345
|
selected: activeIdx === actionStartIdx + idx,
|
|
@@ -1307,20 +1349,20 @@ function Runs() {
|
|
|
1307
1349
|
},
|
|
1308
1350
|
action
|
|
1309
1351
|
)),
|
|
1310
|
-
/* @__PURE__ */
|
|
1352
|
+
/* @__PURE__ */ jsx19(SectionEnd, {})
|
|
1311
1353
|
] })
|
|
1312
1354
|
}
|
|
1313
1355
|
);
|
|
1314
1356
|
}
|
|
1315
1357
|
|
|
1316
|
-
// src/screens/RunHistory.tsx
|
|
1358
|
+
// src/tui/screens/RunHistory.tsx
|
|
1317
1359
|
import { useEffect as useEffect4, useState as useState10 } from "react";
|
|
1318
|
-
import { Box as
|
|
1360
|
+
import { Box as Box16, useInput as useInput5, useWindowSize as useWindowSize5 } from "ink";
|
|
1319
1361
|
|
|
1320
|
-
// src/components/Dialog.tsx
|
|
1362
|
+
// src/tui/components/Dialog.tsx
|
|
1321
1363
|
import { useState as useState9 } from "react";
|
|
1322
|
-
import { Box as
|
|
1323
|
-
import { jsx as
|
|
1364
|
+
import { Box as Box15, Text as Text14, useInput as useInput4 } from "ink";
|
|
1365
|
+
import { jsx as jsx20, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
1324
1366
|
function Dialog({
|
|
1325
1367
|
title,
|
|
1326
1368
|
body,
|
|
@@ -1351,25 +1393,25 @@ function Dialog({
|
|
|
1351
1393
|
const isFocused = focusedButton === name;
|
|
1352
1394
|
const prefix = isFocused ? `${glyphs.cursor.focused} ` : " ";
|
|
1353
1395
|
const textColor = !isFocused ? colors.text.dim : intent === "danger" && name === "confirm" ? colors.status.error : colors.accent.bright;
|
|
1354
|
-
return /* @__PURE__ */
|
|
1396
|
+
return /* @__PURE__ */ jsxs14(Text14, { color: textColor, bold: isFocused, children: [
|
|
1355
1397
|
prefix,
|
|
1356
1398
|
"[ ",
|
|
1357
1399
|
label,
|
|
1358
1400
|
" ]"
|
|
1359
1401
|
] }, name);
|
|
1360
1402
|
};
|
|
1361
|
-
return /* @__PURE__ */
|
|
1362
|
-
/* @__PURE__ */
|
|
1363
|
-
/* @__PURE__ */
|
|
1364
|
-
/* @__PURE__ */
|
|
1403
|
+
return /* @__PURE__ */ jsxs14(Box15, { flexDirection: "column", borderStyle: "round", borderColor, paddingX: 2, paddingY: 1, marginY: 1, children: [
|
|
1404
|
+
/* @__PURE__ */ jsx20(Box15, { marginBottom: 1, children: /* @__PURE__ */ jsx20(Text14, { color: borderColor, bold: true, children: title }) }),
|
|
1405
|
+
/* @__PURE__ */ jsx20(Box15, { marginBottom: 1, children: /* @__PURE__ */ jsx20(Text14, { color: colors.text.primary, children: body }) }),
|
|
1406
|
+
/* @__PURE__ */ jsxs14(Box15, { marginTop: 1, flexDirection: "row", gap: 1, children: [
|
|
1365
1407
|
renderButton(cancelLabel, "cancel"),
|
|
1366
1408
|
renderButton(confirmLabel, "confirm")
|
|
1367
1409
|
] })
|
|
1368
1410
|
] });
|
|
1369
1411
|
}
|
|
1370
1412
|
|
|
1371
|
-
// src/screens/RunHistory.tsx
|
|
1372
|
-
import { jsx as
|
|
1413
|
+
// src/tui/screens/RunHistory.tsx
|
|
1414
|
+
import { jsx as jsx21, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
1373
1415
|
var ACTIONS2 = ["DeleteSelected", "Back", "Main Menu"];
|
|
1374
1416
|
var ACTION_COPY2 = {
|
|
1375
1417
|
DeleteSelected: { label: "Delete Selected", hint: "delete archived run" },
|
|
@@ -1401,9 +1443,6 @@ function shortIso(value) {
|
|
|
1401
1443
|
if (!value) return "unknown";
|
|
1402
1444
|
return `${value.replace("T", " ").slice(0, 16)}Z`;
|
|
1403
1445
|
}
|
|
1404
|
-
function modeLabel(mode, language) {
|
|
1405
|
-
return translatePhrase(language, mode === "orchestrator" ? "orchestrator" : "Agent run");
|
|
1406
|
-
}
|
|
1407
1446
|
function RunHistory() {
|
|
1408
1447
|
const { pop, resetStack } = useRouter();
|
|
1409
1448
|
const { toast } = useToast();
|
|
@@ -1412,7 +1451,7 @@ function RunHistory() {
|
|
|
1412
1451
|
const bodyRows = frameBodyRows(termRows, true, true);
|
|
1413
1452
|
const compactBody = bodyRows <= 10;
|
|
1414
1453
|
const visibleRecordCount = Math.max(1, compactBody ? bodyRows - 3 : Math.min(termRows - CHROME_ROWS2, bodyRows - 7));
|
|
1415
|
-
const [records, setRecords] = useState10(() => listRunHistory(
|
|
1454
|
+
const [records, setRecords] = useState10(() => listRunHistory());
|
|
1416
1455
|
const [selectedIdx, setSelectedIdx] = useState10(0);
|
|
1417
1456
|
const [recordScroll, setRecordScroll] = useState10(0);
|
|
1418
1457
|
const [selectedRecordId, setSelectedRecordId] = useState10(() => records[0]?.id ?? null);
|
|
@@ -1449,7 +1488,7 @@ function RunHistory() {
|
|
|
1449
1488
|
);
|
|
1450
1489
|
const compactEntries = selectableEntries.slice(compactFirstEntry, compactFirstEntry + compactEntryCount);
|
|
1451
1490
|
function refreshRecords() {
|
|
1452
|
-
const next = listRunHistory(
|
|
1491
|
+
const next = listRunHistory();
|
|
1453
1492
|
setRecords(next);
|
|
1454
1493
|
setSelectedRecordId((current) => current && next.some((record) => record.id === current) ? current : next[0]?.id ?? null);
|
|
1455
1494
|
}
|
|
@@ -1468,7 +1507,7 @@ function RunHistory() {
|
|
|
1468
1507
|
function confirmDelete(record) {
|
|
1469
1508
|
deleteRunHistory(record.id);
|
|
1470
1509
|
setPendingDelete(null);
|
|
1471
|
-
const next = listRunHistory(
|
|
1510
|
+
const next = listRunHistory();
|
|
1472
1511
|
setRecords(next);
|
|
1473
1512
|
setSelectedRecordId(next[0]?.id ?? null);
|
|
1474
1513
|
setSelectedIdx((idx) => normalizeSelectedIndex2(idx, next.length));
|
|
@@ -1514,12 +1553,12 @@ function RunHistory() {
|
|
|
1514
1553
|
statusContext = selected.action === "DeleteSelected" && deleteTarget ? `${ACTION_COPY2[selected.action].hint} \xB7 ${deleteTarget.name}` : ACTION_COPY2[selected.action].hint;
|
|
1515
1554
|
}
|
|
1516
1555
|
if (pendingDelete) {
|
|
1517
|
-
return /* @__PURE__ */
|
|
1556
|
+
return /* @__PURE__ */ jsx21(
|
|
1518
1557
|
Frame,
|
|
1519
1558
|
{
|
|
1520
1559
|
breadcrumb: ["ReevesAgents", "Runs", "History"],
|
|
1521
1560
|
statusKeys: "\u2190\u2192 switch \xB7 enter select \xB7 esc cancel",
|
|
1522
|
-
children: /* @__PURE__ */
|
|
1561
|
+
children: /* @__PURE__ */ jsx21(
|
|
1523
1562
|
Dialog,
|
|
1524
1563
|
{
|
|
1525
1564
|
title: t("history.deleteTitle", { name: pendingDelete.name }),
|
|
@@ -1534,7 +1573,7 @@ function RunHistory() {
|
|
|
1534
1573
|
}
|
|
1535
1574
|
);
|
|
1536
1575
|
}
|
|
1537
|
-
return /* @__PURE__ */
|
|
1576
|
+
return /* @__PURE__ */ jsx21(
|
|
1538
1577
|
Frame,
|
|
1539
1578
|
{
|
|
1540
1579
|
breadcrumb: ["ReevesAgents", "Runs", "History"],
|
|
@@ -1544,14 +1583,14 @@ function RunHistory() {
|
|
|
1544
1583
|
tagline: "Ended and stale runs are archived here with simple shared history.",
|
|
1545
1584
|
statusContext,
|
|
1546
1585
|
statusKeys: "enter action \xB7 \u2191\u2193 scroll \xB7 esc back",
|
|
1547
|
-
children: compactBody ? /* @__PURE__ */
|
|
1548
|
-
/* @__PURE__ */
|
|
1549
|
-
records.length === 0 && compactFirstEntry === 0 && /* @__PURE__ */
|
|
1586
|
+
children: compactBody ? /* @__PURE__ */ jsxs15(Box16, { flexDirection: "column", children: [
|
|
1587
|
+
/* @__PURE__ */ jsx21(Section, { label: activeIdx < records.length ? "History" : "Actions" }),
|
|
1588
|
+
records.length === 0 && compactFirstEntry === 0 && /* @__PURE__ */ jsx21(Row, { selected: false, primary: "No history yet", trailing: "ended runs appear here", disabled: true }),
|
|
1550
1589
|
compactEntries.map((entry, idx) => {
|
|
1551
1590
|
const absoluteEntryIdx = compactFirstEntry + idx;
|
|
1552
1591
|
if (entry.type === "action") {
|
|
1553
1592
|
const absoluteIdx = records.length + 1 + ACTIONS2.indexOf(entry.action);
|
|
1554
|
-
return /* @__PURE__ */
|
|
1593
|
+
return /* @__PURE__ */ jsx21(
|
|
1555
1594
|
Row,
|
|
1556
1595
|
{
|
|
1557
1596
|
selected: activeIdx === absoluteIdx,
|
|
@@ -1566,11 +1605,10 @@ function RunHistory() {
|
|
|
1566
1605
|
}
|
|
1567
1606
|
const record = entry.record;
|
|
1568
1607
|
const badges = [
|
|
1569
|
-
{ label: modeLabel(record.mode, language), color: colors.accent.primary },
|
|
1570
1608
|
{ label: translatePhrase(language, record.status), color: record.status === "stale" ? colors.status.warn : colors.status.error },
|
|
1571
1609
|
...record.root_provider ? [{ label: providerDisplayName(record.root_provider), color: providerColor(record.root_provider) }] : []
|
|
1572
1610
|
];
|
|
1573
|
-
return /* @__PURE__ */
|
|
1611
|
+
return /* @__PURE__ */ jsx21(
|
|
1574
1612
|
Row,
|
|
1575
1613
|
{
|
|
1576
1614
|
selected: activeEntryIdx === absoluteEntryIdx,
|
|
@@ -1584,7 +1622,7 @@ function RunHistory() {
|
|
|
1584
1622
|
record.id
|
|
1585
1623
|
);
|
|
1586
1624
|
}),
|
|
1587
|
-
selectableEntries.length > compactEntryCount && /* @__PURE__ */
|
|
1625
|
+
selectableEntries.length > compactEntryCount && /* @__PURE__ */ jsx21(
|
|
1588
1626
|
Row,
|
|
1589
1627
|
{
|
|
1590
1628
|
selected: false,
|
|
@@ -1593,10 +1631,10 @@ function RunHistory() {
|
|
|
1593
1631
|
disabled: true
|
|
1594
1632
|
}
|
|
1595
1633
|
),
|
|
1596
|
-
/* @__PURE__ */
|
|
1597
|
-
] }) : /* @__PURE__ */
|
|
1598
|
-
/* @__PURE__ */
|
|
1599
|
-
records.length === 0 ? /* @__PURE__ */
|
|
1634
|
+
/* @__PURE__ */ jsx21(SectionEnd, {})
|
|
1635
|
+
] }) : /* @__PURE__ */ jsxs15(Box16, { flexDirection: "column", children: [
|
|
1636
|
+
/* @__PURE__ */ jsx21(Section, { label: "History" }),
|
|
1637
|
+
records.length === 0 ? /* @__PURE__ */ jsx21(
|
|
1600
1638
|
Row,
|
|
1601
1639
|
{
|
|
1602
1640
|
selected: false,
|
|
@@ -1607,11 +1645,10 @@ function RunHistory() {
|
|
|
1607
1645
|
) : visibleRecords.map((record, idx) => {
|
|
1608
1646
|
const absoluteIdx = recordScroll + idx;
|
|
1609
1647
|
const badges = [
|
|
1610
|
-
{ label: modeLabel(record.mode, language), color: colors.accent.primary },
|
|
1611
1648
|
{ label: translatePhrase(language, record.status), color: record.status === "stale" ? colors.status.warn : colors.status.error },
|
|
1612
1649
|
...record.root_provider ? [{ label: providerDisplayName(record.root_provider), color: providerColor(record.root_provider) }] : []
|
|
1613
1650
|
];
|
|
1614
|
-
return /* @__PURE__ */
|
|
1651
|
+
return /* @__PURE__ */ jsx21(
|
|
1615
1652
|
Row,
|
|
1616
1653
|
{
|
|
1617
1654
|
selected: activeIdx === absoluteIdx,
|
|
@@ -1625,7 +1662,7 @@ function RunHistory() {
|
|
|
1625
1662
|
record.id
|
|
1626
1663
|
);
|
|
1627
1664
|
}),
|
|
1628
|
-
records.length > visibleRecordCount && /* @__PURE__ */
|
|
1665
|
+
records.length > visibleRecordCount && /* @__PURE__ */ jsx21(
|
|
1629
1666
|
Row,
|
|
1630
1667
|
{
|
|
1631
1668
|
selected: false,
|
|
@@ -1634,9 +1671,9 @@ function RunHistory() {
|
|
|
1634
1671
|
disabled: true
|
|
1635
1672
|
}
|
|
1636
1673
|
),
|
|
1637
|
-
/* @__PURE__ */
|
|
1638
|
-
/* @__PURE__ */
|
|
1639
|
-
ACTIONS2.map((action, idx) => /* @__PURE__ */
|
|
1674
|
+
/* @__PURE__ */ jsx21(SectionEnd, {}),
|
|
1675
|
+
/* @__PURE__ */ jsx21(Section, { label: "Actions" }),
|
|
1676
|
+
ACTIONS2.map((action, idx) => /* @__PURE__ */ jsx21(
|
|
1640
1677
|
Row,
|
|
1641
1678
|
{
|
|
1642
1679
|
selected: activeIdx === actionStartIdx + idx,
|
|
@@ -1648,16 +1685,16 @@ function RunHistory() {
|
|
|
1648
1685
|
},
|
|
1649
1686
|
action
|
|
1650
1687
|
)),
|
|
1651
|
-
/* @__PURE__ */
|
|
1688
|
+
/* @__PURE__ */ jsx21(SectionEnd, {})
|
|
1652
1689
|
] })
|
|
1653
1690
|
}
|
|
1654
1691
|
);
|
|
1655
1692
|
}
|
|
1656
1693
|
|
|
1657
|
-
// src/screens/Run.tsx
|
|
1658
|
-
import
|
|
1659
|
-
import { Box as
|
|
1660
|
-
import { jsx as
|
|
1694
|
+
// src/tui/screens/Run.tsx
|
|
1695
|
+
import React15, { useEffect as useEffect5, useState as useState11 } from "react";
|
|
1696
|
+
import { Box as Box17, Text as Text15, useInput as useInput6, useWindowSize as useWindowSize6 } from "ink";
|
|
1697
|
+
import { jsx as jsx22, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
1661
1698
|
var REFRESH_INTERVAL_MS = 5e3;
|
|
1662
1699
|
var LABELS = {
|
|
1663
1700
|
Agents: "Agents",
|
|
@@ -1780,14 +1817,14 @@ function Run() {
|
|
|
1780
1817
|
}
|
|
1781
1818
|
});
|
|
1782
1819
|
if (!run) {
|
|
1783
|
-
return /* @__PURE__ */
|
|
1820
|
+
return /* @__PURE__ */ jsx22(
|
|
1784
1821
|
Frame,
|
|
1785
1822
|
{
|
|
1786
1823
|
breadcrumb: ["ReevesAgents", "Runs"],
|
|
1787
1824
|
statusContext: "Run not found",
|
|
1788
|
-
children: /* @__PURE__ */
|
|
1789
|
-
/* @__PURE__ */
|
|
1790
|
-
/* @__PURE__ */
|
|
1825
|
+
children: /* @__PURE__ */ jsxs16(Box17, { flexDirection: "column", children: [
|
|
1826
|
+
/* @__PURE__ */ jsx22(Text15, { color: colors.text.dim, children: "Run not found." }),
|
|
1827
|
+
/* @__PURE__ */ jsx22(Box17, { marginTop: 1, children: /* @__PURE__ */ jsx22(
|
|
1791
1828
|
Row,
|
|
1792
1829
|
{
|
|
1793
1830
|
selected: selectedIdx === 0,
|
|
@@ -1817,7 +1854,7 @@ function Run() {
|
|
|
1817
1854
|
};
|
|
1818
1855
|
statusContext = actionLabels[selected.action] || "";
|
|
1819
1856
|
}
|
|
1820
|
-
return /* @__PURE__ */
|
|
1857
|
+
return /* @__PURE__ */ jsx22(
|
|
1821
1858
|
Frame,
|
|
1822
1859
|
{
|
|
1823
1860
|
breadcrumb: ["ReevesAgents", "Runs", run.name],
|
|
@@ -1828,8 +1865,8 @@ function Run() {
|
|
|
1828
1865
|
tagline: "Open, add, stop, or inspect agents in this run.",
|
|
1829
1866
|
statusContext,
|
|
1830
1867
|
statusKeys: "enter open \xB7 \u2191\u2193 move \xB7 esc back",
|
|
1831
|
-
children: compactBody ? /* @__PURE__ */
|
|
1832
|
-
/* @__PURE__ */
|
|
1868
|
+
children: compactBody ? /* @__PURE__ */ jsxs16(Box17, { flexDirection: "column", children: [
|
|
1869
|
+
/* @__PURE__ */ jsx22(Section, { label: selectedIdx < 4 ? "Actions" : "Lifecycle" }),
|
|
1833
1870
|
visibleCompactItems.map(({ item, itemIdx }) => {
|
|
1834
1871
|
const isDisabledAddWorker = item.action === "AddWorker" && isRunEnded;
|
|
1835
1872
|
const primary = item.action === "StopRun" && isRunEnded ? "Delete Run" : LABELS[item.action];
|
|
@@ -1843,7 +1880,7 @@ function Run() {
|
|
|
1843
1880
|
"__section__": ""
|
|
1844
1881
|
};
|
|
1845
1882
|
const isDisabledOpenTabs = item.action === "OpenTabs" && isRunEnded;
|
|
1846
|
-
return /* @__PURE__ */
|
|
1883
|
+
return /* @__PURE__ */ jsx22(
|
|
1847
1884
|
Row,
|
|
1848
1885
|
{
|
|
1849
1886
|
selected: selectedIdx === itemIdx,
|
|
@@ -1856,16 +1893,16 @@ function Run() {
|
|
|
1856
1893
|
item.action
|
|
1857
1894
|
);
|
|
1858
1895
|
}),
|
|
1859
|
-
/* @__PURE__ */
|
|
1860
|
-
] }) : /* @__PURE__ */
|
|
1861
|
-
/* @__PURE__ */
|
|
1862
|
-
/* @__PURE__ */
|
|
1896
|
+
/* @__PURE__ */ jsx22(SectionEnd, {})
|
|
1897
|
+
] }) : /* @__PURE__ */ jsxs16(Box17, { flexDirection: "column", children: [
|
|
1898
|
+
/* @__PURE__ */ jsx22(Box17, { marginBottom: 1, children: /* @__PURE__ */ jsx22(Text15, { color: colors.text.dim, wrap: "truncate-end", children: summaryLine }) }),
|
|
1899
|
+
/* @__PURE__ */ jsx22(Section, { label: "Actions" }),
|
|
1863
1900
|
items.map((item, idx) => {
|
|
1864
1901
|
const isSelected = selectedIdx === idx;
|
|
1865
1902
|
if (item.action === "__section__") {
|
|
1866
|
-
return /* @__PURE__ */
|
|
1867
|
-
/* @__PURE__ */
|
|
1868
|
-
/* @__PURE__ */
|
|
1903
|
+
return /* @__PURE__ */ jsxs16(React15.Fragment, { children: [
|
|
1904
|
+
/* @__PURE__ */ jsx22(SectionEnd, {}),
|
|
1905
|
+
/* @__PURE__ */ jsx22(Section, { label: "Lifecycle" })
|
|
1869
1906
|
] }, "__section__");
|
|
1870
1907
|
}
|
|
1871
1908
|
const isDisabledAddWorker = item.action === "AddWorker" && isRunEnded;
|
|
@@ -1880,7 +1917,7 @@ function Run() {
|
|
|
1880
1917
|
"__section__": ""
|
|
1881
1918
|
};
|
|
1882
1919
|
const isDisabledOpenTabs = item.action === "OpenTabs" && isRunEnded;
|
|
1883
|
-
return /* @__PURE__ */
|
|
1920
|
+
return /* @__PURE__ */ jsx22(
|
|
1884
1921
|
Row,
|
|
1885
1922
|
{
|
|
1886
1923
|
selected: isSelected,
|
|
@@ -1893,19 +1930,19 @@ function Run() {
|
|
|
1893
1930
|
item.action
|
|
1894
1931
|
);
|
|
1895
1932
|
}),
|
|
1896
|
-
/* @__PURE__ */
|
|
1933
|
+
/* @__PURE__ */ jsx22(SectionEnd, {})
|
|
1897
1934
|
] })
|
|
1898
1935
|
}
|
|
1899
1936
|
);
|
|
1900
1937
|
}
|
|
1901
1938
|
|
|
1902
|
-
// src/screens/run/Agents.tsx
|
|
1939
|
+
// src/tui/screens/run/Agents.tsx
|
|
1903
1940
|
import { useEffect as useEffect6, useState as useState12 } from "react";
|
|
1904
|
-
import { Box as
|
|
1941
|
+
import { Box as Box19, Text as Text17, useInput as useInput8, useWindowSize as useWindowSize7 } from "ink";
|
|
1905
1942
|
|
|
1906
|
-
// src/components/Pagination.tsx
|
|
1907
|
-
import { Box as
|
|
1908
|
-
import { jsx as
|
|
1943
|
+
// src/tui/components/Pagination.tsx
|
|
1944
|
+
import { Box as Box18, Text as Text16, useInput as useInput7 } from "ink";
|
|
1945
|
+
import { jsx as jsx23, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
1909
1946
|
function Pagination({ page, total, focused = false, onPrev, onNext }) {
|
|
1910
1947
|
const isFirstPage = page === 1;
|
|
1911
1948
|
const isLastPage = page === total;
|
|
@@ -1918,12 +1955,12 @@ function Pagination({ page, total, focused = false, onPrev, onNext }) {
|
|
|
1918
1955
|
const nextColor = isLastPage ? colors.text.faint : colors.text.dim;
|
|
1919
1956
|
const cursorColor = focused ? colors.accent.bright : colors.text.faint;
|
|
1920
1957
|
const railColor = focused ? colors.accent.deep : colors.surface.border;
|
|
1921
|
-
return /* @__PURE__ */
|
|
1922
|
-
/* @__PURE__ */
|
|
1923
|
-
/* @__PURE__ */
|
|
1924
|
-
/* @__PURE__ */
|
|
1925
|
-
/* @__PURE__ */
|
|
1926
|
-
/* @__PURE__ */
|
|
1958
|
+
return /* @__PURE__ */ jsxs17(Box18, { flexDirection: "row", children: [
|
|
1959
|
+
/* @__PURE__ */ jsx23(Box18, { width: 1, flexShrink: 0, children: /* @__PURE__ */ jsx23(Text16, { color: cursorColor, bold: focused, children: focused ? glyphs.cursor.focused : glyphs.cursor.unfocused }) }),
|
|
1960
|
+
/* @__PURE__ */ jsx23(Box18, { width: 2, flexShrink: 0, children: /* @__PURE__ */ jsx23(Text16, { color: railColor, children: " \u2502" }) }),
|
|
1961
|
+
/* @__PURE__ */ jsxs17(Box18, { marginLeft: space.sm, children: [
|
|
1962
|
+
/* @__PURE__ */ jsx23(Text16, { color: prevColor, children: "\u2039" }),
|
|
1963
|
+
/* @__PURE__ */ jsxs17(Text16, { color: colors.text.dim, children: [
|
|
1927
1964
|
" ",
|
|
1928
1965
|
"page",
|
|
1929
1966
|
" ",
|
|
@@ -1934,13 +1971,13 @@ function Pagination({ page, total, focused = false, onPrev, onNext }) {
|
|
|
1934
1971
|
total,
|
|
1935
1972
|
" "
|
|
1936
1973
|
] }),
|
|
1937
|
-
/* @__PURE__ */
|
|
1974
|
+
/* @__PURE__ */ jsx23(Text16, { color: nextColor, children: "\u203A" })
|
|
1938
1975
|
] })
|
|
1939
1976
|
] });
|
|
1940
1977
|
}
|
|
1941
1978
|
|
|
1942
|
-
// src/screens/run/Agents.tsx
|
|
1943
|
-
import { jsx as
|
|
1979
|
+
// src/tui/screens/run/Agents.tsx
|
|
1980
|
+
import { jsx as jsx24, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
1944
1981
|
var CHROME_ROWS3 = 13;
|
|
1945
1982
|
var REFRESH_INTERVAL_MS2 = 5e3;
|
|
1946
1983
|
function statusGlyph3(status) {
|
|
@@ -2071,9 +2108,9 @@ function RunAgents() {
|
|
|
2071
2108
|
}
|
|
2072
2109
|
});
|
|
2073
2110
|
if (!run) {
|
|
2074
|
-
return /* @__PURE__ */
|
|
2075
|
-
/* @__PURE__ */
|
|
2076
|
-
/* @__PURE__ */
|
|
2111
|
+
return /* @__PURE__ */ jsx24(Frame, { breadcrumb: ["ReevesAgents", "Runs"], statusContext: "Run not found", children: /* @__PURE__ */ jsxs18(Box19, { flexDirection: "column", children: [
|
|
2112
|
+
/* @__PURE__ */ jsx24(Text17, { color: colors.text.dim, children: "Run not found." }),
|
|
2113
|
+
/* @__PURE__ */ jsx24(Box19, { marginTop: 1, children: /* @__PURE__ */ jsx24(Row, { selected: true, primary: "Back", hint: "return to all runs" }) })
|
|
2077
2114
|
] }) });
|
|
2078
2115
|
}
|
|
2079
2116
|
const isRunEnded = run.status === "ended" || run.ended_at !== null;
|
|
@@ -2088,7 +2125,7 @@ function RunAgents() {
|
|
|
2088
2125
|
if (selected?.type === "pagination") statusContext = `page ${page} of ${totalPages} \xB7 \u2190 \u2192 turn page`;
|
|
2089
2126
|
if (selected?.type === "action" && selected.action === "AddWorker") statusContext = isRunEnded ? "run is ended" : "add an agent to this run";
|
|
2090
2127
|
if (selected?.type === "action" && selected.action === "Back") statusContext = "return to run hub";
|
|
2091
|
-
return /* @__PURE__ */
|
|
2128
|
+
return /* @__PURE__ */ jsx24(
|
|
2092
2129
|
Frame,
|
|
2093
2130
|
{
|
|
2094
2131
|
breadcrumb: ["ReevesAgents", "Runs", run.name, "Agents"],
|
|
@@ -2099,12 +2136,12 @@ function RunAgents() {
|
|
|
2099
2136
|
tagline: "Agents in this run.",
|
|
2100
2137
|
statusContext,
|
|
2101
2138
|
statusKeys: "enter open \xB7 \u2191\u2193 move \xB7 esc back",
|
|
2102
|
-
children: compactBody ? /* @__PURE__ */
|
|
2103
|
-
/* @__PURE__ */
|
|
2104
|
-
agents.length === 0 && compactFirstEntry === 0 && /* @__PURE__ */
|
|
2139
|
+
children: compactBody ? /* @__PURE__ */ jsxs18(Box19, { flexDirection: "column", children: [
|
|
2140
|
+
/* @__PURE__ */ jsx24(Section, { label: selected?.type === "agent" ? "Agents" : "Actions" }),
|
|
2141
|
+
agents.length === 0 && compactFirstEntry === 0 && /* @__PURE__ */ jsx24(Row, { selected: false, primary: "No agents", trailing: "add an agent", disabled: true }),
|
|
2105
2142
|
visibleCompactItems.map(({ itemIdx, item }) => {
|
|
2106
2143
|
if (item.type === "pagination") {
|
|
2107
|
-
return /* @__PURE__ */
|
|
2144
|
+
return /* @__PURE__ */ jsx24(
|
|
2108
2145
|
Pagination,
|
|
2109
2146
|
{
|
|
2110
2147
|
page,
|
|
@@ -2123,7 +2160,7 @@ function RunAgents() {
|
|
|
2123
2160
|
);
|
|
2124
2161
|
}
|
|
2125
2162
|
if (item.type === "action") {
|
|
2126
|
-
return /* @__PURE__ */
|
|
2163
|
+
return /* @__PURE__ */ jsx24(
|
|
2127
2164
|
Row,
|
|
2128
2165
|
{
|
|
2129
2166
|
selected: selectedIdx === itemIdx,
|
|
@@ -2141,7 +2178,7 @@ function RunAgents() {
|
|
|
2141
2178
|
{ label: providerLabel, color: providerColor(agent.provider), width: providerBadgeWidth },
|
|
2142
2179
|
{ label: modelBadgeLabel(agent.model), color: modelColor(agent.model, agent.provider), width: modelBadgeWidth }
|
|
2143
2180
|
];
|
|
2144
|
-
return /* @__PURE__ */
|
|
2181
|
+
return /* @__PURE__ */ jsx24(
|
|
2145
2182
|
Row,
|
|
2146
2183
|
{
|
|
2147
2184
|
selected: selectedIdx === itemIdx,
|
|
@@ -2154,10 +2191,10 @@ function RunAgents() {
|
|
|
2154
2191
|
agent.id
|
|
2155
2192
|
);
|
|
2156
2193
|
}),
|
|
2157
|
-
/* @__PURE__ */
|
|
2158
|
-
] }) : /* @__PURE__ */
|
|
2159
|
-
/* @__PURE__ */
|
|
2160
|
-
agents.length === 0 && /* @__PURE__ */
|
|
2194
|
+
/* @__PURE__ */ jsx24(SectionEnd, {})
|
|
2195
|
+
] }) : /* @__PURE__ */ jsxs18(Box19, { flexDirection: "column", children: [
|
|
2196
|
+
/* @__PURE__ */ jsx24(Section, { label: "Agents" }),
|
|
2197
|
+
agents.length === 0 && /* @__PURE__ */ jsx24(Row, { selected: false, primary: "No agents", trailing: "add an agent below", disabled: true }),
|
|
2161
2198
|
pagedData.map((item, idx) => {
|
|
2162
2199
|
const isSelected = selectedIdx === idx;
|
|
2163
2200
|
if (item.type === "agent" && item.agent) {
|
|
@@ -2167,7 +2204,7 @@ function RunAgents() {
|
|
|
2167
2204
|
{ label: providerLabel, color: providerColor(agent.provider), width: providerBadgeWidth },
|
|
2168
2205
|
{ label: modelBadgeLabel(agent.model), color: modelColor(agent.model, agent.provider), width: modelBadgeWidth }
|
|
2169
2206
|
];
|
|
2170
|
-
return /* @__PURE__ */
|
|
2207
|
+
return /* @__PURE__ */ jsx24(
|
|
2171
2208
|
Row,
|
|
2172
2209
|
{
|
|
2173
2210
|
selected: isSelected,
|
|
@@ -2182,7 +2219,7 @@ function RunAgents() {
|
|
|
2182
2219
|
}
|
|
2183
2220
|
return null;
|
|
2184
2221
|
}),
|
|
2185
|
-
totalPages > 1 && /* @__PURE__ */
|
|
2222
|
+
totalPages > 1 && /* @__PURE__ */ jsx24(
|
|
2186
2223
|
Pagination,
|
|
2187
2224
|
{
|
|
2188
2225
|
page,
|
|
@@ -2198,9 +2235,9 @@ function RunAgents() {
|
|
|
2198
2235
|
}
|
|
2199
2236
|
}
|
|
2200
2237
|
),
|
|
2201
|
-
/* @__PURE__ */
|
|
2202
|
-
/* @__PURE__ */
|
|
2203
|
-
/* @__PURE__ */
|
|
2238
|
+
/* @__PURE__ */ jsx24(SectionEnd, {}),
|
|
2239
|
+
/* @__PURE__ */ jsx24(Section, { label: "Actions" }),
|
|
2240
|
+
/* @__PURE__ */ jsx24(
|
|
2204
2241
|
Row,
|
|
2205
2242
|
{
|
|
2206
2243
|
selected: selectedIdx === pagedData.length + paginOffset + 1,
|
|
@@ -2210,7 +2247,7 @@ function RunAgents() {
|
|
|
2210
2247
|
disabled: isRunEnded
|
|
2211
2248
|
}
|
|
2212
2249
|
),
|
|
2213
|
-
/* @__PURE__ */
|
|
2250
|
+
/* @__PURE__ */ jsx24(
|
|
2214
2251
|
Row,
|
|
2215
2252
|
{
|
|
2216
2253
|
selected: selectedIdx === pagedData.length + paginOffset + 2,
|
|
@@ -2219,16 +2256,16 @@ function RunAgents() {
|
|
|
2219
2256
|
hint: "return to run hub"
|
|
2220
2257
|
}
|
|
2221
2258
|
),
|
|
2222
|
-
/* @__PURE__ */
|
|
2259
|
+
/* @__PURE__ */ jsx24(SectionEnd, {})
|
|
2223
2260
|
] })
|
|
2224
2261
|
}
|
|
2225
2262
|
);
|
|
2226
2263
|
}
|
|
2227
2264
|
|
|
2228
|
-
// src/screens/run/Output.tsx
|
|
2265
|
+
// src/tui/screens/run/Output.tsx
|
|
2229
2266
|
import { useEffect as useEffect7, useState as useState13 } from "react";
|
|
2230
|
-
import { Box as
|
|
2231
|
-
import { jsx as
|
|
2267
|
+
import { Box as Box20, Text as Text18, useInput as useInput9, useWindowSize as useWindowSize8 } from "ink";
|
|
2268
|
+
import { jsx as jsx25, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
2232
2269
|
var PEEK_INTERVAL_MS = 5e3;
|
|
2233
2270
|
var PREVIEW_LINES = 5;
|
|
2234
2271
|
var CHROME_ROWS4 = 16;
|
|
@@ -2400,14 +2437,14 @@ function RunOutput() {
|
|
|
2400
2437
|
}
|
|
2401
2438
|
});
|
|
2402
2439
|
if (!run) {
|
|
2403
|
-
return /* @__PURE__ */
|
|
2440
|
+
return /* @__PURE__ */ jsx25(
|
|
2404
2441
|
Frame,
|
|
2405
2442
|
{
|
|
2406
2443
|
breadcrumb: ["ReevesAgents", "Runs"],
|
|
2407
2444
|
statusContext: "Run not found",
|
|
2408
|
-
children: /* @__PURE__ */
|
|
2409
|
-
/* @__PURE__ */
|
|
2410
|
-
/* @__PURE__ */
|
|
2445
|
+
children: /* @__PURE__ */ jsxs19(Box20, { flexDirection: "column", children: [
|
|
2446
|
+
/* @__PURE__ */ jsx25(Text18, { color: colors.text.dim, children: "Run not found." }),
|
|
2447
|
+
/* @__PURE__ */ jsx25(Box20, { marginTop: 1, children: /* @__PURE__ */ jsx25(Row, { selected: true, primary: "Back", hint: "return to run" }) })
|
|
2411
2448
|
] })
|
|
2412
2449
|
}
|
|
2413
2450
|
);
|
|
@@ -2417,7 +2454,7 @@ function RunOutput() {
|
|
|
2417
2454
|
let statusContext = agents.length > 0 ? `${agents.length} agent${agents.length === 1 ? "" : "s"}` : "no agents";
|
|
2418
2455
|
if (selected?.type === "agent" && selected.agent) statusContext = `${selected.agent.nickname} \xB7 enter opens output`;
|
|
2419
2456
|
if (selected?.type === "pagination") statusContext = `page ${activePage} of ${totalPages} \xB7 \u2190 \u2192 turn page`;
|
|
2420
|
-
return /* @__PURE__ */
|
|
2457
|
+
return /* @__PURE__ */ jsx25(
|
|
2421
2458
|
Frame,
|
|
2422
2459
|
{
|
|
2423
2460
|
breadcrumb: ["ReevesAgents", "Runs", run.name, "Output"],
|
|
@@ -2428,12 +2465,12 @@ function RunOutput() {
|
|
|
2428
2465
|
tagline: "Recent output from each agent in this run. Refreshes every 5 seconds.",
|
|
2429
2466
|
statusContext,
|
|
2430
2467
|
statusKeys: "\u2191\u2193 move \xB7 \u2190\u2192 page \xB7 enter open/refresh \xB7 esc back",
|
|
2431
|
-
children: compactBody ? /* @__PURE__ */
|
|
2432
|
-
/* @__PURE__ */
|
|
2433
|
-
agents.length === 0 && compactFirstEntry === 0 && /* @__PURE__ */
|
|
2468
|
+
children: compactBody ? /* @__PURE__ */ jsxs19(Box20, { flexDirection: "column", children: [
|
|
2469
|
+
/* @__PURE__ */ jsx25(Section, { label: selected?.type === "agent" ? "Output" : "Actions" }),
|
|
2470
|
+
agents.length === 0 && compactFirstEntry === 0 && /* @__PURE__ */ jsx25(Row, { selected: false, primary: "No agents", trailing: "return to run", disabled: true }),
|
|
2434
2471
|
visibleCompactItems.map(({ itemIdx, item }) => {
|
|
2435
2472
|
if (item.type === "pagination") {
|
|
2436
|
-
return /* @__PURE__ */
|
|
2473
|
+
return /* @__PURE__ */ jsx25(
|
|
2437
2474
|
Pagination,
|
|
2438
2475
|
{
|
|
2439
2476
|
page: activePage,
|
|
@@ -2453,7 +2490,7 @@ function RunOutput() {
|
|
|
2453
2490
|
}
|
|
2454
2491
|
if (item.type === "action") {
|
|
2455
2492
|
const hint = item.action === "Refresh" ? "peek all agents now" : "return to run hub";
|
|
2456
|
-
return /* @__PURE__ */
|
|
2493
|
+
return /* @__PURE__ */ jsx25(
|
|
2457
2494
|
Row,
|
|
2458
2495
|
{
|
|
2459
2496
|
selected: selectedIdx === itemIdx,
|
|
@@ -2466,7 +2503,7 @@ function RunOutput() {
|
|
|
2466
2503
|
}
|
|
2467
2504
|
const agent = item.agent;
|
|
2468
2505
|
const providerLabel = providerDisplayName(agent.provider);
|
|
2469
|
-
return /* @__PURE__ */
|
|
2506
|
+
return /* @__PURE__ */ jsx25(
|
|
2470
2507
|
Row,
|
|
2471
2508
|
{
|
|
2472
2509
|
selected: selectedIdx === itemIdx,
|
|
@@ -2480,29 +2517,29 @@ function RunOutput() {
|
|
|
2480
2517
|
agent.id
|
|
2481
2518
|
);
|
|
2482
2519
|
}),
|
|
2483
|
-
/* @__PURE__ */
|
|
2484
|
-
] }) : /* @__PURE__ */
|
|
2485
|
-
agents.length === 0 ? /* @__PURE__ */
|
|
2520
|
+
/* @__PURE__ */ jsx25(SectionEnd, {})
|
|
2521
|
+
] }) : /* @__PURE__ */ jsxs19(Box20, { flexDirection: "column", children: [
|
|
2522
|
+
agents.length === 0 ? /* @__PURE__ */ jsx25(Text18, { color: colors.text.dim, children: "No agents in this run." }) : pagedAgents.map((agent) => {
|
|
2486
2523
|
const peek = peeks[agent.id] || "";
|
|
2487
2524
|
const lines = peek ? peek.split("\n").slice(-PREVIEW_LINES) : [];
|
|
2488
2525
|
const isSelected = selected?.type === "agent" && selected.agent?.id === agent.id;
|
|
2489
2526
|
const providerHue = providerColor(agent.provider);
|
|
2490
2527
|
const modelHue = modelColor(agent.model, agent.provider);
|
|
2491
2528
|
const providerLabel = providerDisplayName(agent.provider);
|
|
2492
|
-
return /* @__PURE__ */
|
|
2493
|
-
/* @__PURE__ */
|
|
2494
|
-
/* @__PURE__ */
|
|
2495
|
-
/* @__PURE__ */
|
|
2496
|
-
/* @__PURE__ */
|
|
2497
|
-
/* @__PURE__ */
|
|
2498
|
-
/* @__PURE__ */
|
|
2499
|
-
/* @__PURE__ */
|
|
2500
|
-
/* @__PURE__ */
|
|
2529
|
+
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: [
|
|
2530
|
+
/* @__PURE__ */ jsxs19(Text18, { bold: true, children: [
|
|
2531
|
+
/* @__PURE__ */ jsx25(Text18, { color: isSelected ? colors.accent.bright : colors.text.primary, children: agent.nickname }),
|
|
2532
|
+
/* @__PURE__ */ jsx25(Text18, { color: colors.text.dim, children: " " }),
|
|
2533
|
+
/* @__PURE__ */ jsx25(Text18, { color: colors.surface.border, children: "[" }),
|
|
2534
|
+
/* @__PURE__ */ jsx25(Text18, { color: providerHue, children: providerLabel }),
|
|
2535
|
+
/* @__PURE__ */ jsx25(Text18, { color: colors.surface.border, children: "] [" }),
|
|
2536
|
+
/* @__PURE__ */ jsx25(Text18, { color: modelHue, children: modelBadgeLabel(agent.model) }),
|
|
2537
|
+
/* @__PURE__ */ jsx25(Text18, { color: colors.surface.border, children: "]" })
|
|
2501
2538
|
] }),
|
|
2502
|
-
/* @__PURE__ */
|
|
2539
|
+
/* @__PURE__ */ jsx25(Box20, { marginTop: space.sm, children: lines.length === 0 ? /* @__PURE__ */ jsx25(Text18, { color: colors.text.dim, children: "(no output yet)" }) : /* @__PURE__ */ jsx25(Box20, { flexDirection: "column", children: lines.map((line, lineIdx) => /* @__PURE__ */ jsx25(Text18, { color: colors.text.dim, children: line }, lineIdx)) }) })
|
|
2503
2540
|
] }) }) }, agent.id);
|
|
2504
2541
|
}),
|
|
2505
|
-
totalPages > 1 && /* @__PURE__ */
|
|
2542
|
+
totalPages > 1 && /* @__PURE__ */ jsx25(
|
|
2506
2543
|
Pagination,
|
|
2507
2544
|
{
|
|
2508
2545
|
page: activePage,
|
|
@@ -2518,12 +2555,12 @@ function RunOutput() {
|
|
|
2518
2555
|
}
|
|
2519
2556
|
}
|
|
2520
2557
|
),
|
|
2521
|
-
/* @__PURE__ */
|
|
2558
|
+
/* @__PURE__ */ jsx25(Section, { label: "Actions" }),
|
|
2522
2559
|
["Refresh", "Back"].map((action, idx) => {
|
|
2523
2560
|
const actionRowIdx = pagedAgents.length + paginOffset + 1 + idx;
|
|
2524
2561
|
const isSelected = selectedIdx === actionRowIdx;
|
|
2525
2562
|
const hint = action === "Refresh" ? "peek all agents now" : "return to run hub";
|
|
2526
|
-
return /* @__PURE__ */
|
|
2563
|
+
return /* @__PURE__ */ jsx25(
|
|
2527
2564
|
Row,
|
|
2528
2565
|
{
|
|
2529
2566
|
selected: isSelected,
|
|
@@ -2534,16 +2571,16 @@ function RunOutput() {
|
|
|
2534
2571
|
action
|
|
2535
2572
|
);
|
|
2536
2573
|
}),
|
|
2537
|
-
/* @__PURE__ */
|
|
2574
|
+
/* @__PURE__ */ jsx25(SectionEnd, {})
|
|
2538
2575
|
] })
|
|
2539
2576
|
}
|
|
2540
2577
|
);
|
|
2541
2578
|
}
|
|
2542
2579
|
|
|
2543
|
-
// src/screens/AgentDetail.tsx
|
|
2544
|
-
import
|
|
2545
|
-
import { Box as
|
|
2546
|
-
import { jsx as
|
|
2580
|
+
// src/tui/screens/AgentDetail.tsx
|
|
2581
|
+
import React18, { useState as useState14 } from "react";
|
|
2582
|
+
import { Box as Box21, Text as Text19, useInput as useInput10, useWindowSize as useWindowSize9 } from "ink";
|
|
2583
|
+
import { jsx as jsx26, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
2547
2584
|
var LABELS2 = {
|
|
2548
2585
|
Output: "Output",
|
|
2549
2586
|
Task: "Prompt",
|
|
@@ -2561,6 +2598,7 @@ var ACTION_LABEL_WIDTH5 = Math.max(
|
|
|
2561
2598
|
function AgentDetail() {
|
|
2562
2599
|
const { selectedAgentId, push, pop } = useRouter();
|
|
2563
2600
|
const { toast } = useToast();
|
|
2601
|
+
const { t } = useLanguage();
|
|
2564
2602
|
const { rows: termRows } = useWindowSize9();
|
|
2565
2603
|
const bodyRows = frameBodyRows(termRows, true, true);
|
|
2566
2604
|
const compactBody = bodyRows <= 8;
|
|
@@ -2657,14 +2695,14 @@ function AgentDetail() {
|
|
|
2657
2695
|
}
|
|
2658
2696
|
});
|
|
2659
2697
|
if (!agent || !run) {
|
|
2660
|
-
return /* @__PURE__ */
|
|
2698
|
+
return /* @__PURE__ */ jsx26(
|
|
2661
2699
|
Frame,
|
|
2662
2700
|
{
|
|
2663
2701
|
breadcrumb: ["ReevesAgents", "Runs"],
|
|
2664
2702
|
statusContext: "Agent not found",
|
|
2665
|
-
children: /* @__PURE__ */
|
|
2666
|
-
/* @__PURE__ */
|
|
2667
|
-
/* @__PURE__ */
|
|
2703
|
+
children: /* @__PURE__ */ jsxs20(Box21, { flexDirection: "column", children: [
|
|
2704
|
+
/* @__PURE__ */ jsx26(Text19, { color: colors.text.dim, children: "Agent not found." }),
|
|
2705
|
+
/* @__PURE__ */ jsx26(Box21, { marginTop: 1, children: /* @__PURE__ */ jsx26(
|
|
2668
2706
|
Row,
|
|
2669
2707
|
{
|
|
2670
2708
|
selected: selectedIdx === 0,
|
|
@@ -2700,7 +2738,7 @@ function AgentDetail() {
|
|
|
2700
2738
|
};
|
|
2701
2739
|
statusContext = actionLabels[selected.action] || "";
|
|
2702
2740
|
}
|
|
2703
|
-
return /* @__PURE__ */
|
|
2741
|
+
return /* @__PURE__ */ jsx26(
|
|
2704
2742
|
Frame,
|
|
2705
2743
|
{
|
|
2706
2744
|
breadcrumb: ["ReevesAgents", "Runs", run.name, "Agents", agent.nickname],
|
|
@@ -2708,11 +2746,11 @@ function AgentDetail() {
|
|
|
2708
2746
|
{ label: "provider", value: providerLabel },
|
|
2709
2747
|
{ label: "status", value: agent.task_status }
|
|
2710
2748
|
],
|
|
2711
|
-
tagline:
|
|
2749
|
+
tagline: t("agentDetail.tagline", { provider: providerLabel, name: run.name }),
|
|
2712
2750
|
statusContext,
|
|
2713
2751
|
statusKeys: "\u2191\u2193 move \xB7 enter select \xB7 esc back",
|
|
2714
|
-
children: compactBody ? /* @__PURE__ */
|
|
2715
|
-
/* @__PURE__ */
|
|
2752
|
+
children: compactBody ? /* @__PURE__ */ jsxs20(Box21, { flexDirection: "column", children: [
|
|
2753
|
+
/* @__PURE__ */ jsx26(Section, { label: selectedIdx < 2 ? "Agent" : "Actions" }),
|
|
2716
2754
|
visibleCompactItems.map(({ item, itemIdx }) => {
|
|
2717
2755
|
const hints = {
|
|
2718
2756
|
Output: isHeadless ? "no output" : "live peek of the tmux pane",
|
|
@@ -2723,7 +2761,7 @@ function AgentDetail() {
|
|
|
2723
2761
|
"__section__": ""
|
|
2724
2762
|
};
|
|
2725
2763
|
const primary = item.action === "AgentLifecycle" && isAgentEnded ? "Delete Agent" : LABELS2[item.action];
|
|
2726
|
-
return /* @__PURE__ */
|
|
2764
|
+
return /* @__PURE__ */ jsx26(
|
|
2727
2765
|
Row,
|
|
2728
2766
|
{
|
|
2729
2767
|
selected: selectedIdx === itemIdx,
|
|
@@ -2736,25 +2774,25 @@ function AgentDetail() {
|
|
|
2736
2774
|
item.action
|
|
2737
2775
|
);
|
|
2738
2776
|
}),
|
|
2739
|
-
/* @__PURE__ */
|
|
2740
|
-
] }) : /* @__PURE__ */
|
|
2741
|
-
/* @__PURE__ */
|
|
2742
|
-
/* @__PURE__ */
|
|
2743
|
-
/* @__PURE__ */
|
|
2744
|
-
/* @__PURE__ */
|
|
2745
|
-
/* @__PURE__ */
|
|
2746
|
-
/* @__PURE__ */
|
|
2747
|
-
/* @__PURE__ */
|
|
2777
|
+
/* @__PURE__ */ jsx26(SectionEnd, {})
|
|
2778
|
+
] }) : /* @__PURE__ */ jsxs20(Box21, { flexDirection: "column", children: [
|
|
2779
|
+
/* @__PURE__ */ jsxs20(Box21, { flexDirection: "column", marginBottom: 1, children: [
|
|
2780
|
+
/* @__PURE__ */ jsxs20(Text19, { wrap: "truncate-end", children: [
|
|
2781
|
+
/* @__PURE__ */ jsx26(Text19, { color: colors.surface.border, children: "[" }),
|
|
2782
|
+
/* @__PURE__ */ jsx26(Text19, { color: providerColor(agent.provider), children: providerLabel }),
|
|
2783
|
+
/* @__PURE__ */ jsx26(Text19, { color: colors.surface.border, children: "] [" }),
|
|
2784
|
+
/* @__PURE__ */ jsx26(Text19, { color: modelColor(agent.model, agent.provider), children: modelBadgeLabel(agent.model) }),
|
|
2785
|
+
/* @__PURE__ */ jsx26(Text19, { color: colors.surface.border, children: "]" })
|
|
2748
2786
|
] }),
|
|
2749
|
-
/* @__PURE__ */
|
|
2787
|
+
/* @__PURE__ */ jsx26(Text19, { color: colors.text.dim, wrap: "truncate-end", children: summaryLine })
|
|
2750
2788
|
] }),
|
|
2751
|
-
/* @__PURE__ */
|
|
2789
|
+
/* @__PURE__ */ jsx26(Section, { label: "Agent" }),
|
|
2752
2790
|
items.map((item, idx) => {
|
|
2753
2791
|
const isSelected = selectedIdx === idx;
|
|
2754
2792
|
if (item.action === "__section__") {
|
|
2755
|
-
return /* @__PURE__ */
|
|
2756
|
-
/* @__PURE__ */
|
|
2757
|
-
/* @__PURE__ */
|
|
2793
|
+
return /* @__PURE__ */ jsxs20(React18.Fragment, { children: [
|
|
2794
|
+
/* @__PURE__ */ jsx26(SectionEnd, {}),
|
|
2795
|
+
/* @__PURE__ */ jsx26(Section, { label: "Actions" })
|
|
2758
2796
|
] }, "__section__");
|
|
2759
2797
|
}
|
|
2760
2798
|
const hints = {
|
|
@@ -2766,7 +2804,7 @@ function AgentDetail() {
|
|
|
2766
2804
|
"__section__": ""
|
|
2767
2805
|
};
|
|
2768
2806
|
const primary = item.action === "AgentLifecycle" && isAgentEnded ? "Delete Agent" : LABELS2[item.action];
|
|
2769
|
-
return /* @__PURE__ */
|
|
2807
|
+
return /* @__PURE__ */ jsx26(
|
|
2770
2808
|
Row,
|
|
2771
2809
|
{
|
|
2772
2810
|
selected: isSelected,
|
|
@@ -2779,16 +2817,16 @@ function AgentDetail() {
|
|
|
2779
2817
|
item.action
|
|
2780
2818
|
);
|
|
2781
2819
|
}),
|
|
2782
|
-
/* @__PURE__ */
|
|
2820
|
+
/* @__PURE__ */ jsx26(SectionEnd, {})
|
|
2783
2821
|
] })
|
|
2784
2822
|
}
|
|
2785
2823
|
);
|
|
2786
2824
|
}
|
|
2787
2825
|
|
|
2788
|
-
// src/screens/run/
|
|
2826
|
+
// src/tui/screens/run/AgentOutput.tsx
|
|
2789
2827
|
import { useEffect as useEffect8, useState as useState15 } from "react";
|
|
2790
|
-
import { Box as
|
|
2791
|
-
import { Fragment as Fragment4, jsx as
|
|
2828
|
+
import { Box as Box22, Text as Text20, useInput as useInput11, useWindowSize as useWindowSize10 } from "ink";
|
|
2829
|
+
import { Fragment as Fragment4, jsx as jsx27, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
2792
2830
|
var PEEK_INTERVAL_MS2 = 5e3;
|
|
2793
2831
|
var DETAIL_LINES = 50;
|
|
2794
2832
|
var ACTION_LABEL_WIDTH6 = Math.max("Refresh Now".length, "Open Agent".length, "Back".length);
|
|
@@ -2916,14 +2954,14 @@ function AgentOutput() {
|
|
|
2916
2954
|
}
|
|
2917
2955
|
});
|
|
2918
2956
|
if (!agent || !run) {
|
|
2919
|
-
return /* @__PURE__ */
|
|
2957
|
+
return /* @__PURE__ */ jsx27(
|
|
2920
2958
|
Frame,
|
|
2921
2959
|
{
|
|
2922
2960
|
breadcrumb: ["ReevesAgents", "Runs"],
|
|
2923
2961
|
statusContext: "Agent not found",
|
|
2924
|
-
children: /* @__PURE__ */
|
|
2925
|
-
/* @__PURE__ */
|
|
2926
|
-
/* @__PURE__ */
|
|
2962
|
+
children: /* @__PURE__ */ jsxs21(Box22, { flexDirection: "column", children: [
|
|
2963
|
+
/* @__PURE__ */ jsx27(Text20, { color: colors.text.dim, children: "Agent not found." }),
|
|
2964
|
+
/* @__PURE__ */ jsx27(Box22, { marginTop: 1, children: /* @__PURE__ */ jsx27(
|
|
2927
2965
|
Row,
|
|
2928
2966
|
{
|
|
2929
2967
|
selected: true,
|
|
@@ -2955,7 +2993,7 @@ function AgentOutput() {
|
|
|
2955
2993
|
const providerHue = providerColor(agent.provider);
|
|
2956
2994
|
const modelHue = modelColor(agent.model, agent.provider);
|
|
2957
2995
|
const providerLabel = providerDisplayName(agent.provider);
|
|
2958
|
-
return /* @__PURE__ */
|
|
2996
|
+
return /* @__PURE__ */ jsxs21(
|
|
2959
2997
|
Frame,
|
|
2960
2998
|
{
|
|
2961
2999
|
breadcrumb: ["ReevesAgents", "Runs", run.name, "Agents", agent.nickname, "Output"],
|
|
@@ -2967,19 +3005,19 @@ function AgentOutput() {
|
|
|
2967
3005
|
statusContext,
|
|
2968
3006
|
statusKeys: "\u2191\u2193 move \xB7 \u2190\u2192 output pages \xB7 enter select \xB7 esc back",
|
|
2969
3007
|
children: [
|
|
2970
|
-
!compactBody && /* @__PURE__ */
|
|
2971
|
-
/* @__PURE__ */
|
|
2972
|
-
/* @__PURE__ */
|
|
2973
|
-
/* @__PURE__ */
|
|
2974
|
-
/* @__PURE__ */
|
|
2975
|
-
/* @__PURE__ */
|
|
2976
|
-
/* @__PURE__ */
|
|
2977
|
-
/* @__PURE__ */
|
|
2978
|
-
/* @__PURE__ */
|
|
2979
|
-
/* @__PURE__ */
|
|
3008
|
+
!compactBody && /* @__PURE__ */ jsxs21(Fragment4, { children: [
|
|
3009
|
+
/* @__PURE__ */ jsxs21(Box22, { flexDirection: "column", marginBottom: 2, children: [
|
|
3010
|
+
/* @__PURE__ */ jsx27(Box22, { marginBottom: 1, children: /* @__PURE__ */ jsxs21(Text20, { wrap: "truncate-end", children: [
|
|
3011
|
+
/* @__PURE__ */ jsx27(Text20, { color: colors.text.primary, bold: true, children: agent.nickname }),
|
|
3012
|
+
/* @__PURE__ */ jsx27(Text20, { color: colors.text.dim, children: " " }),
|
|
3013
|
+
/* @__PURE__ */ jsx27(Text20, { color: colors.surface.border, children: "[" }),
|
|
3014
|
+
/* @__PURE__ */ jsx27(Text20, { color: providerHue, children: providerLabel }),
|
|
3015
|
+
/* @__PURE__ */ jsx27(Text20, { color: colors.surface.border, children: "] [" }),
|
|
3016
|
+
/* @__PURE__ */ jsx27(Text20, { color: modelHue, children: modelBadgeLabel(agent.model) }),
|
|
3017
|
+
/* @__PURE__ */ jsx27(Text20, { color: colors.surface.border, children: "]" })
|
|
2980
3018
|
] }) }),
|
|
2981
|
-
/* @__PURE__ */
|
|
2982
|
-
|
|
3019
|
+
/* @__PURE__ */ jsxs21(
|
|
3020
|
+
Box22,
|
|
2983
3021
|
{
|
|
2984
3022
|
borderStyle: "round",
|
|
2985
3023
|
borderColor: providerHue,
|
|
@@ -2988,13 +3026,13 @@ function AgentOutput() {
|
|
|
2988
3026
|
height: visibleLineCount + 2,
|
|
2989
3027
|
overflow: "hidden",
|
|
2990
3028
|
children: [
|
|
2991
|
-
visibleOutputLines.map((line, idx) => /* @__PURE__ */
|
|
2992
|
-
visibleOutputLines.length === 0 && /* @__PURE__ */
|
|
3029
|
+
visibleOutputLines.map((line, idx) => /* @__PURE__ */ jsx27(Text20, { color: colors.text.dim, children: line }, idx)),
|
|
3030
|
+
visibleOutputLines.length === 0 && /* @__PURE__ */ jsx27(Text20, { color: colors.text.muted, children: "(no output yet)" })
|
|
2993
3031
|
]
|
|
2994
3032
|
}
|
|
2995
3033
|
)
|
|
2996
3034
|
] }),
|
|
2997
|
-
showPagination && /* @__PURE__ */
|
|
3035
|
+
showPagination && /* @__PURE__ */ jsx27(
|
|
2998
3036
|
Pagination,
|
|
2999
3037
|
{
|
|
3000
3038
|
page: activePage,
|
|
@@ -3005,8 +3043,8 @@ function AgentOutput() {
|
|
|
3005
3043
|
}
|
|
3006
3044
|
)
|
|
3007
3045
|
] }),
|
|
3008
|
-
/* @__PURE__ */
|
|
3009
|
-
/* @__PURE__ */
|
|
3046
|
+
/* @__PURE__ */ jsx27(Section, { label: "Actions" }),
|
|
3047
|
+
/* @__PURE__ */ jsxs21(Box22, { flexDirection: "column", children: [
|
|
3010
3048
|
actionItems.map((item, idx) => {
|
|
3011
3049
|
const rowIdx = idx + paginOffset;
|
|
3012
3050
|
const isSelected = selectedIdx === rowIdx;
|
|
@@ -3020,7 +3058,7 @@ function AgentOutput() {
|
|
|
3020
3058
|
OpenCLI: "Open Agent",
|
|
3021
3059
|
Back: "Back"
|
|
3022
3060
|
};
|
|
3023
|
-
return /* @__PURE__ */
|
|
3061
|
+
return /* @__PURE__ */ jsx27(
|
|
3024
3062
|
Row,
|
|
3025
3063
|
{
|
|
3026
3064
|
selected: isSelected,
|
|
@@ -3032,17 +3070,17 @@ function AgentOutput() {
|
|
|
3032
3070
|
item.action
|
|
3033
3071
|
);
|
|
3034
3072
|
}),
|
|
3035
|
-
/* @__PURE__ */
|
|
3073
|
+
/* @__PURE__ */ jsx27(SectionEnd, {})
|
|
3036
3074
|
] })
|
|
3037
3075
|
]
|
|
3038
3076
|
}
|
|
3039
3077
|
);
|
|
3040
3078
|
}
|
|
3041
3079
|
|
|
3042
|
-
// src/screens/run/
|
|
3080
|
+
// src/tui/screens/run/AgentTask.tsx
|
|
3043
3081
|
import { useState as useState16 } from "react";
|
|
3044
|
-
import { Box as
|
|
3045
|
-
import { jsx as
|
|
3082
|
+
import { Box as Box23, Text as Text21, useInput as useInput12 } from "ink";
|
|
3083
|
+
import { jsx as jsx28, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
3046
3084
|
function AgentTask() {
|
|
3047
3085
|
const { selectedAgentId, pop } = useRouter();
|
|
3048
3086
|
const [agent] = useState16(
|
|
@@ -3069,24 +3107,24 @@ function AgentTask() {
|
|
|
3069
3107
|
}
|
|
3070
3108
|
});
|
|
3071
3109
|
if (!agent || !run) {
|
|
3072
|
-
return /* @__PURE__ */
|
|
3073
|
-
/* @__PURE__ */
|
|
3074
|
-
/* @__PURE__ */
|
|
3110
|
+
return /* @__PURE__ */ jsx28(Frame, { breadcrumb: ["ReevesAgents", "Runs"], statusContext: "Agent not found", children: /* @__PURE__ */ jsxs22(Box23, { flexDirection: "column", children: [
|
|
3111
|
+
/* @__PURE__ */ jsx28(Text21, { color: colors.text.dim, children: "Agent not found." }),
|
|
3112
|
+
/* @__PURE__ */ jsx28(Box23, { marginTop: 1, children: /* @__PURE__ */ jsx28(Row, { selected: true, primary: "Back", hint: "return to agent detail" }) })
|
|
3075
3113
|
] }) });
|
|
3076
3114
|
}
|
|
3077
|
-
return /* @__PURE__ */
|
|
3115
|
+
return /* @__PURE__ */ jsx28(
|
|
3078
3116
|
Frame,
|
|
3079
3117
|
{
|
|
3080
3118
|
breadcrumb: ["ReevesAgents", "Runs", run.name, "Agents", agent.nickname, "Prompt"],
|
|
3081
3119
|
meta: [{ label: "status", value: agent.task_status }],
|
|
3082
3120
|
tagline: "Read-only view of this agent's initial prompt and current status.",
|
|
3083
3121
|
statusKeys: "enter/esc back",
|
|
3084
|
-
children: /* @__PURE__ */
|
|
3085
|
-
/* @__PURE__ */
|
|
3086
|
-
/* @__PURE__ */
|
|
3087
|
-
/* @__PURE__ */
|
|
3088
|
-
/* @__PURE__ */
|
|
3089
|
-
/* @__PURE__ */
|
|
3122
|
+
children: /* @__PURE__ */ jsxs22(Box23, { flexDirection: "column", children: [
|
|
3123
|
+
/* @__PURE__ */ jsx28(Section, { label: "Prompt" }),
|
|
3124
|
+
/* @__PURE__ */ jsx28(Row, { selected: false, primary: "Prompt", trailing: agent.task || "(no prompt)" }),
|
|
3125
|
+
/* @__PURE__ */ jsx28(Row, { selected: false, primary: "Status", trailing: agent.task_status }),
|
|
3126
|
+
/* @__PURE__ */ jsx28(Row, { selected: false, primary: "Note", trailing: agent.task_note || "(no note)" }),
|
|
3127
|
+
/* @__PURE__ */ jsx28(
|
|
3090
3128
|
Row,
|
|
3091
3129
|
{
|
|
3092
3130
|
selected: false,
|
|
@@ -3094,19 +3132,19 @@ function AgentTask() {
|
|
|
3094
3132
|
trailing: agent.last_seen ? `${Math.round((Date.now() - agent.last_seen) / 1e3)}s ago` : "never"
|
|
3095
3133
|
}
|
|
3096
3134
|
),
|
|
3097
|
-
/* @__PURE__ */
|
|
3098
|
-
/* @__PURE__ */
|
|
3099
|
-
/* @__PURE__ */
|
|
3100
|
-
/* @__PURE__ */
|
|
3135
|
+
/* @__PURE__ */ jsx28(SectionEnd, {}),
|
|
3136
|
+
/* @__PURE__ */ jsx28(Section, { label: "Actions" }),
|
|
3137
|
+
/* @__PURE__ */ jsx28(Row, { selected: true, primary: "Back", hint: "return to agent detail" }),
|
|
3138
|
+
/* @__PURE__ */ jsx28(SectionEnd, {})
|
|
3101
3139
|
] })
|
|
3102
3140
|
}
|
|
3103
3141
|
);
|
|
3104
3142
|
}
|
|
3105
3143
|
|
|
3106
|
-
// src/screens/run/
|
|
3144
|
+
// src/tui/screens/run/AgentKill.tsx
|
|
3107
3145
|
import { useState as useState17 } from "react";
|
|
3108
|
-
import { Box as
|
|
3109
|
-
import { jsx as
|
|
3146
|
+
import { Box as Box24, Text as Text22, useInput as useInput13 } from "ink";
|
|
3147
|
+
import { jsx as jsx29, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
3110
3148
|
function AgentKill() {
|
|
3111
3149
|
const { selectedAgentId, pop, resetStack } = useRouter();
|
|
3112
3150
|
const { language, t } = useLanguage();
|
|
@@ -3152,14 +3190,14 @@ function AgentKill() {
|
|
|
3152
3190
|
}
|
|
3153
3191
|
});
|
|
3154
3192
|
if (!agent || !run) {
|
|
3155
|
-
return /* @__PURE__ */
|
|
3193
|
+
return /* @__PURE__ */ jsx29(
|
|
3156
3194
|
Frame,
|
|
3157
3195
|
{
|
|
3158
3196
|
breadcrumb: ["ReevesAgents", "Runs"],
|
|
3159
3197
|
statusContext: "Agent not found",
|
|
3160
|
-
children: /* @__PURE__ */
|
|
3161
|
-
/* @__PURE__ */
|
|
3162
|
-
/* @__PURE__ */
|
|
3198
|
+
children: /* @__PURE__ */ jsxs23(Box24, { flexDirection: "column", children: [
|
|
3199
|
+
/* @__PURE__ */ jsx29(Text22, { color: colors.text.dim, children: "Agent not found." }),
|
|
3200
|
+
/* @__PURE__ */ jsx29(Box24, { marginTop: 1, children: /* @__PURE__ */ jsx29(
|
|
3163
3201
|
Row,
|
|
3164
3202
|
{
|
|
3165
3203
|
selected: true,
|
|
@@ -3173,12 +3211,12 @@ function AgentKill() {
|
|
|
3173
3211
|
}
|
|
3174
3212
|
const isAgentEnded = agent.ended_at !== null;
|
|
3175
3213
|
const isLastLiveAgent = !isAgentEnded && listAgents(agent.run_id).filter((item) => !item.ended_at).length <= 1;
|
|
3176
|
-
return /* @__PURE__ */
|
|
3214
|
+
return /* @__PURE__ */ jsx29(
|
|
3177
3215
|
Frame,
|
|
3178
3216
|
{
|
|
3179
3217
|
breadcrumb: ["ReevesAgents", "Runs", run.name, "Agents", agent.nickname, isAgentEnded ? "Delete" : "Stop"],
|
|
3180
3218
|
statusKeys: "\u2190\u2192 switch \xB7 enter select \xB7 esc cancel",
|
|
3181
|
-
children: /* @__PURE__ */
|
|
3219
|
+
children: /* @__PURE__ */ jsx29(
|
|
3182
3220
|
Dialog,
|
|
3183
3221
|
{
|
|
3184
3222
|
title: t(isAgentEnded ? "agentKill.deleteTitle" : "agentKill.stopTitle", { name: agent.nickname }),
|
|
@@ -3194,44 +3232,44 @@ function AgentKill() {
|
|
|
3194
3232
|
);
|
|
3195
3233
|
}
|
|
3196
3234
|
|
|
3197
|
-
// src/screens/NewRun.tsx
|
|
3235
|
+
// src/tui/screens/NewRun.tsx
|
|
3198
3236
|
import { useEffect as useEffect9 } from "react";
|
|
3199
|
-
import { Text as
|
|
3200
|
-
import { jsx as
|
|
3237
|
+
import { Text as Text23 } from "ink";
|
|
3238
|
+
import { jsx as jsx30 } from "react/jsx-runtime";
|
|
3201
3239
|
function NewRunInner() {
|
|
3202
3240
|
const { replace } = useRouter();
|
|
3203
3241
|
useEffect9(() => {
|
|
3204
3242
|
replace("NewRunBasics");
|
|
3205
3243
|
}, [replace]);
|
|
3206
|
-
return /* @__PURE__ */
|
|
3244
|
+
return /* @__PURE__ */ jsx30(Frame, { breadcrumb: ["ReevesAgents", "New Run"], children: /* @__PURE__ */ jsx30(Text23, { children: "Starting wizard..." }) });
|
|
3207
3245
|
}
|
|
3208
3246
|
function NewRun() {
|
|
3209
|
-
return /* @__PURE__ */
|
|
3247
|
+
return /* @__PURE__ */ jsx30(WizardProvider, { children: /* @__PURE__ */ jsx30(NewRunInner, {}) });
|
|
3210
3248
|
}
|
|
3211
3249
|
|
|
3212
|
-
// src/screens/newrun/02Basics.tsx
|
|
3250
|
+
// src/tui/screens/newrun/02Basics.tsx
|
|
3213
3251
|
import { useState as useState19, useMemo as useMemo4 } from "react";
|
|
3214
3252
|
import { useInput as useInput15, useWindowSize as useWindowSize11 } from "ink";
|
|
3215
3253
|
|
|
3216
|
-
// src/components/StepIndicator.tsx
|
|
3217
|
-
import { Box as
|
|
3218
|
-
import { jsx as
|
|
3254
|
+
// src/tui/components/StepIndicator.tsx
|
|
3255
|
+
import { Box as Box25, Text as Text24 } from "ink";
|
|
3256
|
+
import { jsx as jsx31, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
3219
3257
|
function StepIndicator({ step, total, name }) {
|
|
3220
3258
|
const { language } = useLanguage();
|
|
3221
3259
|
const displayName = translatePhrase(language, name);
|
|
3222
|
-
return /* @__PURE__ */
|
|
3223
|
-
/* @__PURE__ */
|
|
3224
|
-
/* @__PURE__ */
|
|
3225
|
-
/* @__PURE__ */
|
|
3226
|
-
/* @__PURE__ */
|
|
3227
|
-
/* @__PURE__ */
|
|
3260
|
+
return /* @__PURE__ */ jsxs24(Box25, { children: [
|
|
3261
|
+
/* @__PURE__ */ jsx31(Text24, { color: colors.accent.bright, children: step }),
|
|
3262
|
+
/* @__PURE__ */ jsx31(Text24, { children: " / " }),
|
|
3263
|
+
/* @__PURE__ */ jsx31(Text24, { color: colors.text.muted, children: total }),
|
|
3264
|
+
/* @__PURE__ */ jsx31(Text24, { children: " \xB7 " }),
|
|
3265
|
+
/* @__PURE__ */ jsx31(Text24, { color: colors.accent.primary, bold: true, children: displayName })
|
|
3228
3266
|
] });
|
|
3229
3267
|
}
|
|
3230
3268
|
|
|
3231
|
-
// src/components/TextField.tsx
|
|
3269
|
+
// src/tui/components/TextField.tsx
|
|
3232
3270
|
import { useState as useState18, useEffect as useEffect10 } from "react";
|
|
3233
|
-
import { Box as
|
|
3234
|
-
import { jsx as
|
|
3271
|
+
import { Box as Box26, Text as Text25, useInput as useInput14 } from "ink";
|
|
3272
|
+
import { jsx as jsx32, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
3235
3273
|
function TextField({
|
|
3236
3274
|
label,
|
|
3237
3275
|
value,
|
|
@@ -3301,18 +3339,18 @@ function TextField({
|
|
|
3301
3339
|
const labelWidth = Math.max(1, Math.min(Math.max(12, labelText.length), Math.floor(contentWidth * 0.35)));
|
|
3302
3340
|
const valueWidth = Math.max(1, contentWidth - labelWidth - sep.pipe.length);
|
|
3303
3341
|
const lines = multiline ? wrapLines(displayValue, valueWidth) : [displayValue];
|
|
3304
|
-
return /* @__PURE__ */
|
|
3305
|
-
lines.map((line, idx) => /* @__PURE__ */
|
|
3306
|
-
/* @__PURE__ */
|
|
3307
|
-
/* @__PURE__ */
|
|
3308
|
-
/* @__PURE__ */
|
|
3309
|
-
/* @__PURE__ */
|
|
3310
|
-
/* @__PURE__ */
|
|
3311
|
-
/* @__PURE__ */
|
|
3342
|
+
return /* @__PURE__ */ jsxs25(Box26, { flexDirection: "column", width, children: [
|
|
3343
|
+
lines.map((line, idx) => /* @__PURE__ */ jsxs25(Box26, { flexDirection: "row", width, children: [
|
|
3344
|
+
/* @__PURE__ */ jsx32(Box26, { width: 1, flexShrink: 0, children: /* @__PURE__ */ jsx32(Text25, { color: cursorColor, bold: selected && !editing, children: idx === 0 ? cursorChar : " " }) }),
|
|
3345
|
+
/* @__PURE__ */ jsx32(Box26, { width: 2, flexShrink: 0, children: /* @__PURE__ */ jsx32(Text25, { color: railColor, children: " \u2502" }) }),
|
|
3346
|
+
/* @__PURE__ */ jsxs25(Box26, { marginLeft: space.sm, flexDirection: "row", width: contentWidth, flexShrink: 1, children: [
|
|
3347
|
+
/* @__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: " " }) }),
|
|
3348
|
+
/* @__PURE__ */ jsx32(Text25, { color: colors.text.faint, children: sep.pipe }),
|
|
3349
|
+
/* @__PURE__ */ jsx32(Box26, { width: valueWidth, flexShrink: 1, children: /* @__PURE__ */ jsx32(Text25, { color: valueColor, wrap: "truncate-end", children: line }) })
|
|
3312
3350
|
] }),
|
|
3313
|
-
/* @__PURE__ */
|
|
3351
|
+
/* @__PURE__ */ jsx32(Box26, { width: 2, flexShrink: 0, children: /* @__PURE__ */ jsx32(Text25, { color: railColor, children: " \u2502" }) })
|
|
3314
3352
|
] }, `${idx}-${line}`)),
|
|
3315
|
-
selected && displayHelpText && /* @__PURE__ */
|
|
3353
|
+
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
3354
|
] });
|
|
3317
3355
|
}
|
|
3318
3356
|
function wrapLines(value, width) {
|
|
@@ -3330,12 +3368,13 @@ function wrapLines(value, width) {
|
|
|
3330
3368
|
return lines.length > 0 ? lines : [""];
|
|
3331
3369
|
}
|
|
3332
3370
|
|
|
3333
|
-
// src/screens/newrun/02Basics.tsx
|
|
3334
|
-
import { jsx as
|
|
3371
|
+
// src/tui/screens/newrun/02Basics.tsx
|
|
3372
|
+
import { jsx as jsx33, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
3335
3373
|
var ACTION_LABEL_WIDTH7 = Math.max("Continue".length, "Back".length, "Reset Wizard".length);
|
|
3336
3374
|
function NewRunBasics() {
|
|
3337
3375
|
const { push, pop } = useRouter();
|
|
3338
3376
|
const { toast } = useToast();
|
|
3377
|
+
const { t } = useLanguage();
|
|
3339
3378
|
const { state, update, reset } = useWizard();
|
|
3340
3379
|
const { rows: termRows } = useWindowSize11();
|
|
3341
3380
|
const bodyRows = frameBodyRows(termRows, true, false);
|
|
@@ -3374,7 +3413,7 @@ function NewRunBasics() {
|
|
|
3374
3413
|
function handleAction(id) {
|
|
3375
3414
|
if (id === "continue") {
|
|
3376
3415
|
if (!state.name.trim()) {
|
|
3377
|
-
toast("
|
|
3416
|
+
toast(t("newRun.nameRequired"), "error");
|
|
3378
3417
|
return;
|
|
3379
3418
|
}
|
|
3380
3419
|
push("NewRunRoot");
|
|
@@ -3407,19 +3446,19 @@ function NewRunBasics() {
|
|
|
3407
3446
|
}
|
|
3408
3447
|
}
|
|
3409
3448
|
});
|
|
3410
|
-
return /* @__PURE__ */
|
|
3449
|
+
return /* @__PURE__ */ jsxs26(
|
|
3411
3450
|
Frame,
|
|
3412
3451
|
{
|
|
3413
3452
|
breadcrumb: ["ReevesAgents", "New Run", "Basics"],
|
|
3414
3453
|
tagline: "Name the run and choose where its agents start.",
|
|
3415
3454
|
statusKeys: "enter edit \xB7 \u2191\u2193 move \xB7 esc back",
|
|
3416
3455
|
children: [
|
|
3417
|
-
!compactBody && /* @__PURE__ */
|
|
3418
|
-
compactBody && /* @__PURE__ */
|
|
3456
|
+
!compactBody && /* @__PURE__ */ jsx33(StepIndicator, { step: 1, total: 4, name: "Basics" }),
|
|
3457
|
+
compactBody && /* @__PURE__ */ jsx33(Section, { label: selectedIdx < fields.length ? "Basics" : "Actions" }),
|
|
3419
3458
|
(compactBody ? visibleRows : fields.map((_field, idx) => idx)).map((idx) => {
|
|
3420
3459
|
if (idx < fields.length) {
|
|
3421
3460
|
const field = fields[idx];
|
|
3422
|
-
return /* @__PURE__ */
|
|
3461
|
+
return /* @__PURE__ */ jsx33(
|
|
3423
3462
|
TextField,
|
|
3424
3463
|
{
|
|
3425
3464
|
label: field.label,
|
|
@@ -3436,7 +3475,7 @@ function NewRunBasics() {
|
|
|
3436
3475
|
);
|
|
3437
3476
|
}
|
|
3438
3477
|
const action = actions[idx - fields.length];
|
|
3439
|
-
return /* @__PURE__ */
|
|
3478
|
+
return /* @__PURE__ */ jsx33(
|
|
3440
3479
|
Row,
|
|
3441
3480
|
{
|
|
3442
3481
|
selected: selectedIdx === idx,
|
|
@@ -3447,8 +3486,8 @@ function NewRunBasics() {
|
|
|
3447
3486
|
action.id
|
|
3448
3487
|
);
|
|
3449
3488
|
}),
|
|
3450
|
-
!compactBody && /* @__PURE__ */
|
|
3451
|
-
!compactBody && actions.map((action, idx) => /* @__PURE__ */
|
|
3489
|
+
!compactBody && /* @__PURE__ */ jsx33(Section, { label: "Actions" }),
|
|
3490
|
+
!compactBody && actions.map((action, idx) => /* @__PURE__ */ jsx33(
|
|
3452
3491
|
Row,
|
|
3453
3492
|
{
|
|
3454
3493
|
selected: selectedIdx === fields.length + idx,
|
|
@@ -3458,18 +3497,18 @@ function NewRunBasics() {
|
|
|
3458
3497
|
},
|
|
3459
3498
|
action.id
|
|
3460
3499
|
)),
|
|
3461
|
-
/* @__PURE__ */
|
|
3500
|
+
/* @__PURE__ */ jsx33(SectionEnd, {})
|
|
3462
3501
|
]
|
|
3463
3502
|
}
|
|
3464
3503
|
);
|
|
3465
3504
|
}
|
|
3466
3505
|
|
|
3467
|
-
// src/screens/newrun/03Root.tsx
|
|
3506
|
+
// src/tui/screens/newrun/03Root.tsx
|
|
3468
3507
|
import { useState as useState20, useMemo as useMemo5 } from "react";
|
|
3469
3508
|
import { useInput as useInput16, useWindowSize as useWindowSize12 } from "ink";
|
|
3470
3509
|
|
|
3471
|
-
// src/components/ModelOptionList.tsx
|
|
3472
|
-
import { Fragment as Fragment5, jsx as
|
|
3510
|
+
// src/tui/components/ModelOptionList.tsx
|
|
3511
|
+
import { Fragment as Fragment5, jsx as jsx34, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
3473
3512
|
function ModelOptionList({ provider, values, current, selectedIdx, visibleCount }) {
|
|
3474
3513
|
const rowCount = Math.max(1, visibleCount ?? values.length);
|
|
3475
3514
|
const firstVisible = Math.min(
|
|
@@ -3477,11 +3516,11 @@ function ModelOptionList({ provider, values, current, selectedIdx, visibleCount
|
|
|
3477
3516
|
Math.max(0, values.length - rowCount)
|
|
3478
3517
|
);
|
|
3479
3518
|
const visibleValues = values.slice(firstVisible, firstVisible + rowCount);
|
|
3480
|
-
return /* @__PURE__ */
|
|
3481
|
-
/* @__PURE__ */
|
|
3519
|
+
return /* @__PURE__ */ jsxs27(Fragment5, { children: [
|
|
3520
|
+
/* @__PURE__ */ jsx34(Section, { label: "Model Options" }),
|
|
3482
3521
|
visibleValues.map((model, localIdx) => {
|
|
3483
3522
|
const idx = firstVisible + localIdx;
|
|
3484
|
-
return /* @__PURE__ */
|
|
3523
|
+
return /* @__PURE__ */ jsx34(
|
|
3485
3524
|
Row,
|
|
3486
3525
|
{
|
|
3487
3526
|
selected: selectedIdx === idx,
|
|
@@ -3492,7 +3531,7 @@ function ModelOptionList({ provider, values, current, selectedIdx, visibleCount
|
|
|
3492
3531
|
model || "provider-default"
|
|
3493
3532
|
);
|
|
3494
3533
|
}),
|
|
3495
|
-
values.length > rowCount && /* @__PURE__ */
|
|
3534
|
+
values.length > rowCount && /* @__PURE__ */ jsx34(
|
|
3496
3535
|
Row,
|
|
3497
3536
|
{
|
|
3498
3537
|
selected: false,
|
|
@@ -3501,17 +3540,21 @@ function ModelOptionList({ provider, values, current, selectedIdx, visibleCount
|
|
|
3501
3540
|
disabled: true
|
|
3502
3541
|
}
|
|
3503
3542
|
),
|
|
3504
|
-
/* @__PURE__ */
|
|
3543
|
+
/* @__PURE__ */ jsx34(SectionEnd, {})
|
|
3505
3544
|
] });
|
|
3506
3545
|
}
|
|
3507
3546
|
|
|
3508
|
-
// src/screens/newrun/03Root.tsx
|
|
3509
|
-
import { Fragment as Fragment6, jsx as
|
|
3547
|
+
// src/tui/screens/newrun/03Root.tsx
|
|
3548
|
+
import { Fragment as Fragment6, jsx as jsx35, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
3510
3549
|
var PERMISSIONS_VALUES = ["ask", "skip"];
|
|
3511
3550
|
var EFFORT_VALUES = ["default", "low", "medium", "high", "xhigh", "max"];
|
|
3551
|
+
var AUTH_MODE_VALUES = ["default", "api-key"];
|
|
3512
3552
|
function permissionDisplay(value) {
|
|
3513
3553
|
return value === "skip" ? "Skip prompts" : "Ask first";
|
|
3514
3554
|
}
|
|
3555
|
+
function authModeDisplay(value) {
|
|
3556
|
+
return value === "api-key" ? "API key" : "Default login";
|
|
3557
|
+
}
|
|
3515
3558
|
var ACTION_LABEL_WIDTH8 = Math.max("Continue".length, "Back".length, "Reset Wizard".length);
|
|
3516
3559
|
function cycle(values, current, dir) {
|
|
3517
3560
|
if (values.length === 0) return current;
|
|
@@ -3549,11 +3592,14 @@ function NewRunRoot() {
|
|
|
3549
3592
|
hint: state.root.permissions === "skip" ? "trusted workspaces only" : "provider asks before sensitive actions"
|
|
3550
3593
|
}
|
|
3551
3594
|
];
|
|
3595
|
+
if (state.root.provider === "cc") {
|
|
3596
|
+
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" });
|
|
3597
|
+
}
|
|
3552
3598
|
if (state.root.provider === "cc" || state.root.provider === "codex") {
|
|
3553
3599
|
list.push({ kind: "picker", id: "effort", label: "Effort", current: state.root.effort, values: EFFORT_VALUES });
|
|
3554
3600
|
}
|
|
3555
3601
|
return list;
|
|
3556
|
-
}, [state.root.provider, state.root.model, state.root.prompt, state.root.permissions, state.root.effort]);
|
|
3602
|
+
}, [state.root.provider, state.root.model, state.root.prompt, state.root.permissions, state.root.authMode, state.root.effort]);
|
|
3557
3603
|
const actions = [
|
|
3558
3604
|
{ id: "continue", label: "Continue", hint: "to additional agents" },
|
|
3559
3605
|
{ id: "back", label: "Back", hint: "return to basics" },
|
|
@@ -3608,6 +3654,8 @@ function NewRunRoot() {
|
|
|
3608
3654
|
updateRoot({ model: cycle(modelValuesForProvider(state.root.provider), state.root.model, dir) });
|
|
3609
3655
|
} else if (id === "permissions") {
|
|
3610
3656
|
updateRoot({ permissions: cycle(PERMISSIONS_VALUES, state.root.permissions, dir) });
|
|
3657
|
+
} else if (id === "authMode") {
|
|
3658
|
+
updateRoot({ authMode: cycle(AUTH_MODE_VALUES, state.root.authMode, dir) });
|
|
3611
3659
|
} else if (id === "effort") {
|
|
3612
3660
|
updateRoot({ effort: cycle(EFFORT_VALUES, state.root.effort, dir) });
|
|
3613
3661
|
}
|
|
@@ -3675,15 +3723,15 @@ function NewRunRoot() {
|
|
|
3675
3723
|
}
|
|
3676
3724
|
}
|
|
3677
3725
|
});
|
|
3678
|
-
return /* @__PURE__ */
|
|
3726
|
+
return /* @__PURE__ */ jsxs28(
|
|
3679
3727
|
Frame,
|
|
3680
3728
|
{
|
|
3681
3729
|
breadcrumb: ["ReevesAgents", "New Run", "First Agent"],
|
|
3682
3730
|
tagline: "Choose the provider, model, permissions, and first prompt.",
|
|
3683
3731
|
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
3732
|
children: [
|
|
3685
|
-
!compactBody && /* @__PURE__ */
|
|
3686
|
-
compactBody && modelPickerOpen ? /* @__PURE__ */
|
|
3733
|
+
!compactBody && /* @__PURE__ */ jsx35(StepIndicator, { step: 2, total: 4, name: "First Agent" }),
|
|
3734
|
+
compactBody && modelPickerOpen ? /* @__PURE__ */ jsx35(
|
|
3687
3735
|
ModelOptionList,
|
|
3688
3736
|
{
|
|
3689
3737
|
provider: state.root.provider,
|
|
@@ -3692,12 +3740,12 @@ function NewRunRoot() {
|
|
|
3692
3740
|
selectedIdx: modelPickerIdx,
|
|
3693
3741
|
visibleCount: Math.max(1, bodyRows - 3)
|
|
3694
3742
|
}
|
|
3695
|
-
) : /* @__PURE__ */
|
|
3696
|
-
compactBody && /* @__PURE__ */
|
|
3743
|
+
) : /* @__PURE__ */ jsxs28(Fragment6, { children: [
|
|
3744
|
+
compactBody && /* @__PURE__ */ jsx35(Section, { label: selectedIdx < fields.length ? "First Agent" : "Actions" }),
|
|
3697
3745
|
(compactBody ? visibleRows.filter((idx) => idx < fields.length) : fields.map((_field, idx) => idx)).map((idx) => {
|
|
3698
3746
|
const field = fields[idx];
|
|
3699
3747
|
if (field.kind === "text") {
|
|
3700
|
-
return /* @__PURE__ */
|
|
3748
|
+
return /* @__PURE__ */ jsx35(
|
|
3701
3749
|
TextField,
|
|
3702
3750
|
{
|
|
3703
3751
|
label: field.label,
|
|
@@ -3715,7 +3763,7 @@ function NewRunRoot() {
|
|
|
3715
3763
|
);
|
|
3716
3764
|
}
|
|
3717
3765
|
const badge = pickerBadge(field, state.root.provider);
|
|
3718
|
-
return /* @__PURE__ */
|
|
3766
|
+
return /* @__PURE__ */ jsx35(
|
|
3719
3767
|
Row,
|
|
3720
3768
|
{
|
|
3721
3769
|
selected: selectedIdx === idx,
|
|
@@ -3727,7 +3775,7 @@ function NewRunRoot() {
|
|
|
3727
3775
|
field.id
|
|
3728
3776
|
);
|
|
3729
3777
|
}),
|
|
3730
|
-
modelPickerOpen && !compactBody && /* @__PURE__ */
|
|
3778
|
+
modelPickerOpen && !compactBody && /* @__PURE__ */ jsx35(
|
|
3731
3779
|
ModelOptionList,
|
|
3732
3780
|
{
|
|
3733
3781
|
provider: state.root.provider,
|
|
@@ -3736,10 +3784,10 @@ function NewRunRoot() {
|
|
|
3736
3784
|
selectedIdx: modelPickerIdx
|
|
3737
3785
|
}
|
|
3738
3786
|
),
|
|
3739
|
-
!compactBody && /* @__PURE__ */
|
|
3787
|
+
!compactBody && /* @__PURE__ */ jsx35(Section, { label: "Actions" }),
|
|
3740
3788
|
compactBody ? visibleRows.filter((idx) => idx >= fields.length).map((idx) => {
|
|
3741
3789
|
const action = actions[idx - fields.length];
|
|
3742
|
-
return /* @__PURE__ */
|
|
3790
|
+
return /* @__PURE__ */ jsx35(
|
|
3743
3791
|
Row,
|
|
3744
3792
|
{
|
|
3745
3793
|
selected: selectedIdx === idx,
|
|
@@ -3749,7 +3797,7 @@ function NewRunRoot() {
|
|
|
3749
3797
|
},
|
|
3750
3798
|
action.id
|
|
3751
3799
|
);
|
|
3752
|
-
}) : actions.map((action, idx) => /* @__PURE__ */
|
|
3800
|
+
}) : actions.map((action, idx) => /* @__PURE__ */ jsx35(
|
|
3753
3801
|
Row,
|
|
3754
3802
|
{
|
|
3755
3803
|
selected: selectedIdx === fields.length + idx,
|
|
@@ -3759,7 +3807,7 @@ function NewRunRoot() {
|
|
|
3759
3807
|
},
|
|
3760
3808
|
action.id
|
|
3761
3809
|
)),
|
|
3762
|
-
/* @__PURE__ */
|
|
3810
|
+
/* @__PURE__ */ jsx35(SectionEnd, {})
|
|
3763
3811
|
] })
|
|
3764
3812
|
]
|
|
3765
3813
|
}
|
|
@@ -3771,10 +3819,10 @@ function pickerBadge(field, provider) {
|
|
|
3771
3819
|
return void 0;
|
|
3772
3820
|
}
|
|
3773
3821
|
|
|
3774
|
-
// src/screens/newrun/04Workers.tsx
|
|
3822
|
+
// src/tui/screens/newrun/04Workers.tsx
|
|
3775
3823
|
import { useState as useState21 } from "react";
|
|
3776
3824
|
import { useInput as useInput17, useWindowSize as useWindowSize13 } from "ink";
|
|
3777
|
-
import { Fragment as Fragment7, jsx as
|
|
3825
|
+
import { Fragment as Fragment7, jsx as jsx36, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
3778
3826
|
var ACTION_LABEL_WIDTH9 = Math.max("Add Agent".length, "Continue".length, "Back".length, "Reset Wizard".length);
|
|
3779
3827
|
function NewRunWorkers() {
|
|
3780
3828
|
const { push, pop, setSelectedWorkerIdx } = useRouter();
|
|
@@ -3845,21 +3893,21 @@ function NewRunWorkers() {
|
|
|
3845
3893
|
}
|
|
3846
3894
|
}
|
|
3847
3895
|
});
|
|
3848
|
-
return /* @__PURE__ */
|
|
3896
|
+
return /* @__PURE__ */ jsxs29(
|
|
3849
3897
|
Frame,
|
|
3850
3898
|
{
|
|
3851
3899
|
breadcrumb: ["ReevesAgents", "New Run", "Agents"],
|
|
3852
3900
|
tagline: "Add optional extra agents for the same run.",
|
|
3853
3901
|
statusKeys: "enter select \xB7 \u2191\u2193 move \xB7 esc back",
|
|
3854
3902
|
children: [
|
|
3855
|
-
!compactBody && /* @__PURE__ */
|
|
3856
|
-
compactBody ? /* @__PURE__ */
|
|
3857
|
-
/* @__PURE__ */
|
|
3858
|
-
workers.length === 0 && firstVisible === 0 && /* @__PURE__ */
|
|
3903
|
+
!compactBody && /* @__PURE__ */ jsx36(StepIndicator, { step: 3, total: 4, name: "Agents" }),
|
|
3904
|
+
compactBody ? /* @__PURE__ */ jsxs29(Fragment7, { children: [
|
|
3905
|
+
/* @__PURE__ */ jsx36(Section, { label: selectedIdx < workers.length ? "Additional Agents" : "Actions" }),
|
|
3906
|
+
workers.length === 0 && firstVisible === 0 && /* @__PURE__ */ jsx36(Row, { selected: false, primary: "No extra agents yet.", trailing: "choose Add Agent", disabled: true }),
|
|
3859
3907
|
visibleRows.map((idx) => {
|
|
3860
3908
|
if (idx >= workers.length) {
|
|
3861
3909
|
const action = actions[idx - workers.length];
|
|
3862
|
-
return /* @__PURE__ */
|
|
3910
|
+
return /* @__PURE__ */ jsx36(
|
|
3863
3911
|
Row,
|
|
3864
3912
|
{
|
|
3865
3913
|
selected: selectedIdx === idx,
|
|
@@ -3872,7 +3920,7 @@ function NewRunWorkers() {
|
|
|
3872
3920
|
}
|
|
3873
3921
|
const worker = workers[idx];
|
|
3874
3922
|
const providerLabel = providerDisplayName(worker.provider);
|
|
3875
|
-
return /* @__PURE__ */
|
|
3923
|
+
return /* @__PURE__ */ jsx36(
|
|
3876
3924
|
Row,
|
|
3877
3925
|
{
|
|
3878
3926
|
selected: selectedIdx === idx,
|
|
@@ -3887,12 +3935,12 @@ function NewRunWorkers() {
|
|
|
3887
3935
|
`worker-${idx}`
|
|
3888
3936
|
);
|
|
3889
3937
|
}),
|
|
3890
|
-
/* @__PURE__ */
|
|
3891
|
-
] }) : /* @__PURE__ */
|
|
3892
|
-
/* @__PURE__ */
|
|
3893
|
-
workers.length === 0 ? /* @__PURE__ */
|
|
3938
|
+
/* @__PURE__ */ jsx36(SectionEnd, {})
|
|
3939
|
+
] }) : /* @__PURE__ */ jsxs29(Fragment7, { children: [
|
|
3940
|
+
/* @__PURE__ */ jsx36(Section, { label: "Additional Agents" }),
|
|
3941
|
+
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
3942
|
const providerLabel = providerDisplayName(worker.provider);
|
|
3895
|
-
return /* @__PURE__ */
|
|
3943
|
+
return /* @__PURE__ */ jsx36(
|
|
3896
3944
|
Row,
|
|
3897
3945
|
{
|
|
3898
3946
|
selected: selectedIdx === idx,
|
|
@@ -3907,9 +3955,9 @@ function NewRunWorkers() {
|
|
|
3907
3955
|
`worker-${idx}`
|
|
3908
3956
|
);
|
|
3909
3957
|
}),
|
|
3910
|
-
/* @__PURE__ */
|
|
3911
|
-
/* @__PURE__ */
|
|
3912
|
-
actions.map((action, idx) => /* @__PURE__ */
|
|
3958
|
+
/* @__PURE__ */ jsx36(SectionEnd, {}),
|
|
3959
|
+
/* @__PURE__ */ jsx36(Section, { label: "Actions" }),
|
|
3960
|
+
actions.map((action, idx) => /* @__PURE__ */ jsx36(
|
|
3913
3961
|
Row,
|
|
3914
3962
|
{
|
|
3915
3963
|
selected: selectedIdx === workers.length + idx,
|
|
@@ -3919,22 +3967,26 @@ function NewRunWorkers() {
|
|
|
3919
3967
|
},
|
|
3920
3968
|
action.id
|
|
3921
3969
|
)),
|
|
3922
|
-
/* @__PURE__ */
|
|
3970
|
+
/* @__PURE__ */ jsx36(SectionEnd, {})
|
|
3923
3971
|
] })
|
|
3924
3972
|
]
|
|
3925
3973
|
}
|
|
3926
3974
|
);
|
|
3927
3975
|
}
|
|
3928
3976
|
|
|
3929
|
-
// src/screens/newrun/04Worker.tsx
|
|
3977
|
+
// src/tui/screens/newrun/04Worker.tsx
|
|
3930
3978
|
import { useState as useState22, useMemo as useMemo6 } from "react";
|
|
3931
3979
|
import { useInput as useInput18, useWindowSize as useWindowSize14 } from "ink";
|
|
3932
|
-
import { Fragment as Fragment8, jsx as
|
|
3980
|
+
import { Fragment as Fragment8, jsx as jsx37, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
3933
3981
|
var PERMISSIONS_VALUES2 = ["ask", "skip"];
|
|
3934
3982
|
var EFFORT_VALUES2 = ["default", "low", "medium", "high", "xhigh", "max"];
|
|
3983
|
+
var AUTH_MODE_VALUES2 = ["default", "api-key"];
|
|
3935
3984
|
function permissionDisplay2(value) {
|
|
3936
3985
|
return value === "skip" ? "Skip prompts" : "Ask first";
|
|
3937
3986
|
}
|
|
3987
|
+
function authModeDisplay2(value) {
|
|
3988
|
+
return value === "api-key" ? "API key" : "Default login";
|
|
3989
|
+
}
|
|
3938
3990
|
var ACTION_LABEL_WIDTH10 = Math.max("Done".length, "Remove This Agent".length, "Back".length);
|
|
3939
3991
|
function cycle2(values, current, dir) {
|
|
3940
3992
|
if (values.length === 0) return current;
|
|
@@ -3977,6 +4029,9 @@ function NewRunWorker() {
|
|
|
3977
4029
|
hint: worker.permissions === "skip" ? "trusted workspaces only" : "provider asks before sensitive actions"
|
|
3978
4030
|
}
|
|
3979
4031
|
];
|
|
4032
|
+
if (worker.provider === "cc") {
|
|
4033
|
+
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" });
|
|
4034
|
+
}
|
|
3980
4035
|
if (worker.provider === "cc" || worker.provider === "codex") {
|
|
3981
4036
|
list.push({ kind: "picker", id: "effort", label: "Effort", current: worker.effort, values: EFFORT_VALUES2 });
|
|
3982
4037
|
}
|
|
@@ -4039,6 +4094,7 @@ function NewRunWorker() {
|
|
|
4039
4094
|
if (id === "provider") updateWorker(idx, { provider: cycle2(PROVIDERS, worker.provider, dir), model: "" });
|
|
4040
4095
|
else if (id === "model") updateWorker(idx, { model: cycle2(modelValuesForProvider(worker.provider), worker.model, dir) });
|
|
4041
4096
|
else if (id === "permissions") updateWorker(idx, { permissions: cycle2(PERMISSIONS_VALUES2, worker.permissions, dir) });
|
|
4097
|
+
else if (id === "authMode") updateWorker(idx, { authMode: cycle2(AUTH_MODE_VALUES2, worker.authMode, dir) });
|
|
4042
4098
|
else if (id === "effort") updateWorker(idx, { effort: cycle2(EFFORT_VALUES2, worker.effort, dir) });
|
|
4043
4099
|
}
|
|
4044
4100
|
function handleAction(id) {
|
|
@@ -4098,17 +4154,17 @@ function NewRunWorker() {
|
|
|
4098
4154
|
}
|
|
4099
4155
|
});
|
|
4100
4156
|
if (!worker) {
|
|
4101
|
-
return /* @__PURE__ */
|
|
4157
|
+
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
4158
|
}
|
|
4103
|
-
return /* @__PURE__ */
|
|
4159
|
+
return /* @__PURE__ */ jsxs30(
|
|
4104
4160
|
Frame,
|
|
4105
4161
|
{
|
|
4106
4162
|
breadcrumb: ["ReevesAgents", "New Run", "Agents", worker.nickname || `agent-${idx + 2}`],
|
|
4107
4163
|
tagline: "Configure this additional agent.",
|
|
4108
4164
|
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
4165
|
children: [
|
|
4110
|
-
!compactBody && /* @__PURE__ */
|
|
4111
|
-
compactBody && modelPickerOpen ? /* @__PURE__ */
|
|
4166
|
+
!compactBody && /* @__PURE__ */ jsx37(StepIndicator, { step: 3, total: 4, name: "Agent" }),
|
|
4167
|
+
compactBody && modelPickerOpen ? /* @__PURE__ */ jsx37(
|
|
4112
4168
|
ModelOptionList,
|
|
4113
4169
|
{
|
|
4114
4170
|
provider: worker.provider,
|
|
@@ -4117,12 +4173,12 @@ function NewRunWorker() {
|
|
|
4117
4173
|
selectedIdx: modelPickerIdx,
|
|
4118
4174
|
visibleCount: Math.max(1, bodyRows - 3)
|
|
4119
4175
|
}
|
|
4120
|
-
) : /* @__PURE__ */
|
|
4121
|
-
compactBody && /* @__PURE__ */
|
|
4176
|
+
) : /* @__PURE__ */ jsxs30(Fragment8, { children: [
|
|
4177
|
+
compactBody && /* @__PURE__ */ jsx37(Section, { label: selectedIdx < fields.length ? "Agent" : "Actions" }),
|
|
4122
4178
|
(compactBody ? visibleRows.filter((rowIdx) => rowIdx < fields.length) : fields.map((_field, rowIdx) => rowIdx)).map((fIdx) => {
|
|
4123
4179
|
const field = fields[fIdx];
|
|
4124
4180
|
if (field.kind === "text") {
|
|
4125
|
-
return /* @__PURE__ */
|
|
4181
|
+
return /* @__PURE__ */ jsx37(
|
|
4126
4182
|
TextField,
|
|
4127
4183
|
{
|
|
4128
4184
|
label: field.label,
|
|
@@ -4140,7 +4196,7 @@ function NewRunWorker() {
|
|
|
4140
4196
|
);
|
|
4141
4197
|
}
|
|
4142
4198
|
const badge = pickerBadge2(field, worker.provider);
|
|
4143
|
-
return /* @__PURE__ */
|
|
4199
|
+
return /* @__PURE__ */ jsx37(
|
|
4144
4200
|
Row,
|
|
4145
4201
|
{
|
|
4146
4202
|
selected: selectedIdx === fIdx,
|
|
@@ -4152,7 +4208,7 @@ function NewRunWorker() {
|
|
|
4152
4208
|
field.id
|
|
4153
4209
|
);
|
|
4154
4210
|
}),
|
|
4155
|
-
modelPickerOpen && !compactBody && /* @__PURE__ */
|
|
4211
|
+
modelPickerOpen && !compactBody && /* @__PURE__ */ jsx37(
|
|
4156
4212
|
ModelOptionList,
|
|
4157
4213
|
{
|
|
4158
4214
|
provider: worker.provider,
|
|
@@ -4161,10 +4217,10 @@ function NewRunWorker() {
|
|
|
4161
4217
|
selectedIdx: modelPickerIdx
|
|
4162
4218
|
}
|
|
4163
4219
|
),
|
|
4164
|
-
!compactBody && /* @__PURE__ */
|
|
4220
|
+
!compactBody && /* @__PURE__ */ jsx37(Section, { label: "Actions" }),
|
|
4165
4221
|
compactBody ? visibleRows.filter((rowIdx) => rowIdx >= fields.length).map((rowIdx) => {
|
|
4166
4222
|
const action = actions[rowIdx - fields.length];
|
|
4167
|
-
return /* @__PURE__ */
|
|
4223
|
+
return /* @__PURE__ */ jsx37(
|
|
4168
4224
|
Row,
|
|
4169
4225
|
{
|
|
4170
4226
|
selected: selectedIdx === rowIdx,
|
|
@@ -4174,7 +4230,7 @@ function NewRunWorker() {
|
|
|
4174
4230
|
},
|
|
4175
4231
|
action.id
|
|
4176
4232
|
);
|
|
4177
|
-
}) : actions.map((action, aIdx) => /* @__PURE__ */
|
|
4233
|
+
}) : actions.map((action, aIdx) => /* @__PURE__ */ jsx37(
|
|
4178
4234
|
Row,
|
|
4179
4235
|
{
|
|
4180
4236
|
selected: selectedIdx === fields.length + aIdx,
|
|
@@ -4184,7 +4240,7 @@ function NewRunWorker() {
|
|
|
4184
4240
|
},
|
|
4185
4241
|
action.id
|
|
4186
4242
|
)),
|
|
4187
|
-
/* @__PURE__ */
|
|
4243
|
+
/* @__PURE__ */ jsx37(SectionEnd, {})
|
|
4188
4244
|
] })
|
|
4189
4245
|
]
|
|
4190
4246
|
}
|
|
@@ -4196,10 +4252,10 @@ function pickerBadge2(field, provider) {
|
|
|
4196
4252
|
return void 0;
|
|
4197
4253
|
}
|
|
4198
4254
|
|
|
4199
|
-
// src/screens/newrun/05Review.tsx
|
|
4255
|
+
// src/tui/screens/newrun/05Review.tsx
|
|
4200
4256
|
import { useState as useState23 } from "react";
|
|
4201
4257
|
import { useInput as useInput19, useWindowSize as useWindowSize15 } from "ink";
|
|
4202
|
-
import { Fragment as Fragment9, jsx as
|
|
4258
|
+
import { Fragment as Fragment9, jsx as jsx38, jsxs as jsxs31 } from "react/jsx-runtime";
|
|
4203
4259
|
var ACTION_LABEL_WIDTH11 = Math.max("Start Run".length, "Back to Edit".length, "Reset Wizard".length);
|
|
4204
4260
|
function permissionDisplay3(value) {
|
|
4205
4261
|
return value === "skip" ? "Skip prompts" : "Ask first";
|
|
@@ -4245,18 +4301,18 @@ function NewRunReview() {
|
|
|
4245
4301
|
const promptPreview = state.root.prompt.length > 40 ? state.root.prompt.slice(0, 40) + "..." : state.root.prompt;
|
|
4246
4302
|
const showEffort = state.root.provider === "cc" || state.root.provider === "codex";
|
|
4247
4303
|
const permissionsSummary = showEffort ? `${permissionDisplay3(state.root.permissions)} \xB7 ${state.root.effort}` : permissionDisplay3(state.root.permissions);
|
|
4248
|
-
return /* @__PURE__ */
|
|
4304
|
+
return /* @__PURE__ */ jsxs31(
|
|
4249
4305
|
Frame,
|
|
4250
4306
|
{
|
|
4251
4307
|
breadcrumb: ["ReevesAgents", "New Run", "Review"],
|
|
4252
4308
|
tagline: "Review the run and agents before starting.",
|
|
4253
4309
|
statusKeys: "enter select \xB7 \u2191\u2193 move \xB7 esc back",
|
|
4254
4310
|
children: [
|
|
4255
|
-
!compactBody && /* @__PURE__ */
|
|
4256
|
-
compactBody ? /* @__PURE__ */
|
|
4257
|
-
/* @__PURE__ */
|
|
4258
|
-
showCompactSummary && /* @__PURE__ */
|
|
4259
|
-
actions.map((action, idx) => /* @__PURE__ */
|
|
4311
|
+
!compactBody && /* @__PURE__ */ jsx38(StepIndicator, { step: 4, total: 4, name: "Review" }),
|
|
4312
|
+
compactBody ? /* @__PURE__ */ jsxs31(Fragment9, { children: [
|
|
4313
|
+
/* @__PURE__ */ jsx38(Section, { label: "Review" }),
|
|
4314
|
+
showCompactSummary && /* @__PURE__ */ jsx38(Row, { selected: false, primary: state.name || "(unset)", trailing: `${state.workers.length + 1} agents`, alwaysShowTrailing: true, disabled: true }),
|
|
4315
|
+
actions.map((action, idx) => /* @__PURE__ */ jsx38(
|
|
4260
4316
|
Row,
|
|
4261
4317
|
{
|
|
4262
4318
|
selected: selectedIdx === idx,
|
|
@@ -4266,21 +4322,21 @@ function NewRunReview() {
|
|
|
4266
4322
|
},
|
|
4267
4323
|
action.id
|
|
4268
4324
|
)),
|
|
4269
|
-
/* @__PURE__ */
|
|
4270
|
-
] }) : /* @__PURE__ */
|
|
4271
|
-
/* @__PURE__ */
|
|
4272
|
-
/* @__PURE__ */
|
|
4273
|
-
/* @__PURE__ */
|
|
4274
|
-
/* @__PURE__ */
|
|
4275
|
-
/* @__PURE__ */
|
|
4276
|
-
/* @__PURE__ */
|
|
4277
|
-
/* @__PURE__ */
|
|
4278
|
-
/* @__PURE__ */
|
|
4279
|
-
/* @__PURE__ */
|
|
4280
|
-
/* @__PURE__ */
|
|
4281
|
-
state.workers.length > 0 && /* @__PURE__ */
|
|
4282
|
-
/* @__PURE__ */
|
|
4283
|
-
state.workers.map((worker, idx) => /* @__PURE__ */
|
|
4325
|
+
/* @__PURE__ */ jsx38(SectionEnd, {})
|
|
4326
|
+
] }) : /* @__PURE__ */ jsxs31(Fragment9, { children: [
|
|
4327
|
+
/* @__PURE__ */ jsx38(Section, { label: "Run" }),
|
|
4328
|
+
/* @__PURE__ */ jsx38(Row, { selected: false, primary: "Name", trailing: state.name || "(unset)" }),
|
|
4329
|
+
/* @__PURE__ */ jsx38(Row, { selected: false, primary: "Working Dir", trailing: state.workingDir || "(none)" }),
|
|
4330
|
+
/* @__PURE__ */ jsx38(SectionEnd, {}),
|
|
4331
|
+
/* @__PURE__ */ jsx38(Section, { label: "First Agent" }),
|
|
4332
|
+
/* @__PURE__ */ jsx38(Row, { selected: false, primary: "Provider", badge: { label: providerDisplayName(state.root.provider), color: providerColor(state.root.provider) } }),
|
|
4333
|
+
/* @__PURE__ */ jsx38(Row, { selected: false, primary: "Model", badge: { label: modelBadgeLabel(state.root.model), color: modelColor(state.root.model, state.root.provider) } }),
|
|
4334
|
+
/* @__PURE__ */ jsx38(Row, { selected: false, primary: "Prompt", trailing: promptPreview || "(none)" }),
|
|
4335
|
+
/* @__PURE__ */ jsx38(Row, { selected: false, primary: showEffort ? "Permissions / Effort" : "Permissions", trailing: permissionsSummary }),
|
|
4336
|
+
/* @__PURE__ */ jsx38(SectionEnd, {}),
|
|
4337
|
+
state.workers.length > 0 && /* @__PURE__ */ jsxs31(Fragment9, { children: [
|
|
4338
|
+
/* @__PURE__ */ jsx38(Section, { label: `Additional Agents (${state.workers.length})` }),
|
|
4339
|
+
state.workers.map((worker, idx) => /* @__PURE__ */ jsx38(
|
|
4284
4340
|
Row,
|
|
4285
4341
|
{
|
|
4286
4342
|
selected: false,
|
|
@@ -4293,11 +4349,11 @@ function NewRunReview() {
|
|
|
4293
4349
|
},
|
|
4294
4350
|
`worker-${idx}`
|
|
4295
4351
|
)),
|
|
4296
|
-
/* @__PURE__ */
|
|
4352
|
+
/* @__PURE__ */ jsx38(SectionEnd, {})
|
|
4297
4353
|
] }),
|
|
4298
|
-
/* @__PURE__ */
|
|
4299
|
-
/* @__PURE__ */
|
|
4300
|
-
state.workers.map((worker, idx) => /* @__PURE__ */
|
|
4354
|
+
/* @__PURE__ */ jsx38(Section, { label: "Planned Tmux Windows" }),
|
|
4355
|
+
/* @__PURE__ */ jsx38(Row, { selected: false, primary: "agent 1", trailing: providerDisplayName(state.root.provider) }),
|
|
4356
|
+
state.workers.map((worker, idx) => /* @__PURE__ */ jsx38(
|
|
4301
4357
|
Row,
|
|
4302
4358
|
{
|
|
4303
4359
|
selected: false,
|
|
@@ -4306,11 +4362,11 @@ function NewRunReview() {
|
|
|
4306
4362
|
},
|
|
4307
4363
|
`tmux-${idx}`
|
|
4308
4364
|
)),
|
|
4309
|
-
/* @__PURE__ */
|
|
4365
|
+
/* @__PURE__ */ jsx38(SectionEnd, {})
|
|
4310
4366
|
] }),
|
|
4311
|
-
!compactBody && /* @__PURE__ */
|
|
4312
|
-
/* @__PURE__ */
|
|
4313
|
-
actions.map((action, idx) => /* @__PURE__ */
|
|
4367
|
+
!compactBody && /* @__PURE__ */ jsxs31(Fragment9, { children: [
|
|
4368
|
+
/* @__PURE__ */ jsx38(Section, { label: "Actions" }),
|
|
4369
|
+
actions.map((action, idx) => /* @__PURE__ */ jsx38(
|
|
4314
4370
|
Row,
|
|
4315
4371
|
{
|
|
4316
4372
|
selected: selectedIdx === idx,
|
|
@@ -4320,21 +4376,21 @@ function NewRunReview() {
|
|
|
4320
4376
|
},
|
|
4321
4377
|
action.id
|
|
4322
4378
|
)),
|
|
4323
|
-
/* @__PURE__ */
|
|
4379
|
+
/* @__PURE__ */ jsx38(SectionEnd, {})
|
|
4324
4380
|
] })
|
|
4325
4381
|
]
|
|
4326
4382
|
}
|
|
4327
4383
|
);
|
|
4328
4384
|
}
|
|
4329
4385
|
|
|
4330
|
-
// src/screens/newrun/05Starting.tsx
|
|
4386
|
+
// src/tui/screens/newrun/05Starting.tsx
|
|
4331
4387
|
import { useEffect as useEffect12, useState as useState25 } from "react";
|
|
4332
|
-
import { Box as
|
|
4388
|
+
import { Box as Box28, Text as Text27, useInput as useInput20 } from "ink";
|
|
4333
4389
|
|
|
4334
|
-
// src/components/Spinner.tsx
|
|
4390
|
+
// src/tui/components/Spinner.tsx
|
|
4335
4391
|
import { useEffect as useEffect11, useState as useState24 } from "react";
|
|
4336
|
-
import { Box as
|
|
4337
|
-
import { jsx as
|
|
4392
|
+
import { Box as Box27, Text as Text26 } from "ink";
|
|
4393
|
+
import { jsx as jsx39, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
4338
4394
|
var FRAMES = ["\u280B", "\u2819", "\u2839", "\u2838", "\u283C", "\u2834", "\u2826", "\u2827", "\u2807", "\u280F"];
|
|
4339
4395
|
var INTERVAL_MS = 80;
|
|
4340
4396
|
function Spinner({ label, color = colors.accent.primary }) {
|
|
@@ -4345,14 +4401,14 @@ function Spinner({ label, color = colors.accent.primary }) {
|
|
|
4345
4401
|
const t = setInterval(() => setFrame((f) => (f + 1) % FRAMES.length), INTERVAL_MS);
|
|
4346
4402
|
return () => clearInterval(t);
|
|
4347
4403
|
}, [animate]);
|
|
4348
|
-
return /* @__PURE__ */
|
|
4349
|
-
/* @__PURE__ */
|
|
4350
|
-
label && /* @__PURE__ */
|
|
4404
|
+
return /* @__PURE__ */ jsxs32(Box27, { children: [
|
|
4405
|
+
/* @__PURE__ */ jsx39(Text26, { color, children: FRAMES[frame] }),
|
|
4406
|
+
label && /* @__PURE__ */ jsx39(Box27, { marginLeft: space.sm, children: /* @__PURE__ */ jsx39(Text26, { color: colors.text.dim, children: label }) })
|
|
4351
4407
|
] });
|
|
4352
4408
|
}
|
|
4353
4409
|
|
|
4354
|
-
// src/screens/newrun/05Starting.tsx
|
|
4355
|
-
import { jsx as
|
|
4410
|
+
// src/tui/screens/newrun/05Starting.tsx
|
|
4411
|
+
import { jsx as jsx40, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
4356
4412
|
var ACTION_LABEL_WIDTH12 = Math.max("Retry".length, "Back to Review".length);
|
|
4357
4413
|
function NewRunStarting() {
|
|
4358
4414
|
const { pop, resetStack, setSelectedRunId } = useRouter();
|
|
@@ -4362,7 +4418,6 @@ function NewRunStarting() {
|
|
|
4362
4418
|
const [retryCount, setRetryCount] = useState25(0);
|
|
4363
4419
|
useEffect12(() => {
|
|
4364
4420
|
const req = {
|
|
4365
|
-
mode: "spawner",
|
|
4366
4421
|
name: state.name,
|
|
4367
4422
|
working_dir: state.workingDir,
|
|
4368
4423
|
root: {
|
|
@@ -4430,19 +4485,19 @@ function NewRunStarting() {
|
|
|
4430
4485
|
}
|
|
4431
4486
|
});
|
|
4432
4487
|
if (error) {
|
|
4433
|
-
return /* @__PURE__ */
|
|
4488
|
+
return /* @__PURE__ */ jsxs33(
|
|
4434
4489
|
Frame,
|
|
4435
4490
|
{
|
|
4436
4491
|
breadcrumb: ["ReevesAgents", "New Run", "Starting"],
|
|
4437
4492
|
tagline: "Run failed to start.",
|
|
4438
4493
|
statusKeys: "enter select \xB7 \u2191\u2193 move \xB7 esc back",
|
|
4439
4494
|
children: [
|
|
4440
|
-
/* @__PURE__ */
|
|
4495
|
+
/* @__PURE__ */ jsx40(Box28, { flexDirection: "column", marginY: 1, children: /* @__PURE__ */ jsxs33(Text27, { children: [
|
|
4441
4496
|
"Error: ",
|
|
4442
4497
|
error
|
|
4443
4498
|
] }) }),
|
|
4444
|
-
/* @__PURE__ */
|
|
4445
|
-
errorActions.map((action, idx) => /* @__PURE__ */
|
|
4499
|
+
/* @__PURE__ */ jsx40(Section, { label: "Actions" }),
|
|
4500
|
+
errorActions.map((action, idx) => /* @__PURE__ */ jsx40(
|
|
4446
4501
|
Row,
|
|
4447
4502
|
{
|
|
4448
4503
|
selected: actionIdx === idx,
|
|
@@ -4452,19 +4507,19 @@ function NewRunStarting() {
|
|
|
4452
4507
|
},
|
|
4453
4508
|
action.id
|
|
4454
4509
|
)),
|
|
4455
|
-
/* @__PURE__ */
|
|
4510
|
+
/* @__PURE__ */ jsx40(SectionEnd, {})
|
|
4456
4511
|
]
|
|
4457
4512
|
}
|
|
4458
4513
|
);
|
|
4459
4514
|
}
|
|
4460
|
-
return /* @__PURE__ */
|
|
4515
|
+
return /* @__PURE__ */ jsx40(
|
|
4461
4516
|
Frame,
|
|
4462
4517
|
{
|
|
4463
4518
|
breadcrumb: ["ReevesAgents", "New Run", "Starting"],
|
|
4464
4519
|
tagline: "Creating the run and launching its agents.",
|
|
4465
|
-
children: /* @__PURE__ */
|
|
4466
|
-
/* @__PURE__ */
|
|
4467
|
-
/* @__PURE__ */
|
|
4520
|
+
children: /* @__PURE__ */ jsxs33(Box28, { flexDirection: "row", marginY: 1, children: [
|
|
4521
|
+
/* @__PURE__ */ jsx40(Spinner, {}),
|
|
4522
|
+
/* @__PURE__ */ jsxs33(Text27, { children: [
|
|
4468
4523
|
" Launching ",
|
|
4469
4524
|
state.name,
|
|
4470
4525
|
"..."
|
|
@@ -4474,14 +4529,19 @@ function NewRunStarting() {
|
|
|
4474
4529
|
);
|
|
4475
4530
|
}
|
|
4476
4531
|
|
|
4477
|
-
// src/screens/run/AddWorker.tsx
|
|
4532
|
+
// src/tui/screens/run/AddWorker.tsx
|
|
4478
4533
|
import { useState as useState26, useMemo as useMemo7 } from "react";
|
|
4479
4534
|
import { useInput as useInput21, useWindowSize as useWindowSize16 } from "ink";
|
|
4480
|
-
import { Fragment as Fragment10, jsx as
|
|
4535
|
+
import { Fragment as Fragment10, jsx as jsx41, jsxs as jsxs34 } from "react/jsx-runtime";
|
|
4481
4536
|
var PERMISSIONS_VALUES3 = ["ask", "skip"];
|
|
4537
|
+
var EFFORT_VALUES3 = ["default", "low", "medium", "high", "xhigh", "max"];
|
|
4538
|
+
var AUTH_MODE_VALUES3 = ["default", "api-key"];
|
|
4482
4539
|
function permissionDisplay4(value) {
|
|
4483
4540
|
return value === "skip" ? "Skip prompts" : "Ask first";
|
|
4484
4541
|
}
|
|
4542
|
+
function authModeDisplay3(value) {
|
|
4543
|
+
return value === "api-key" ? "API key" : "Default login";
|
|
4544
|
+
}
|
|
4485
4545
|
var ACTION_LABEL_WIDTH13 = Math.max("Add Agent".length, "Cancel".length);
|
|
4486
4546
|
function cycle3(values, current, dir) {
|
|
4487
4547
|
if (values.length === 0) return current;
|
|
@@ -4493,6 +4553,7 @@ function cycle3(values, current, dir) {
|
|
|
4493
4553
|
function AddWorker() {
|
|
4494
4554
|
const { selectedRunId, pop } = useRouter();
|
|
4495
4555
|
const { toast } = useToast();
|
|
4556
|
+
const { t } = useLanguage();
|
|
4496
4557
|
const { draft, update, reset } = useWorkerDraft();
|
|
4497
4558
|
const { rows: termRows } = useWindowSize16();
|
|
4498
4559
|
const bodyRows = frameBodyRows(termRows, true, false);
|
|
@@ -4520,7 +4581,9 @@ function AddWorker() {
|
|
|
4520
4581
|
values: PERMISSIONS_VALUES3,
|
|
4521
4582
|
display: permissionDisplay4(draft.permissions),
|
|
4522
4583
|
hint: draft.permissions === "skip" ? "trusted workspaces only" : "provider asks before sensitive actions"
|
|
4523
|
-
}
|
|
4584
|
+
},
|
|
4585
|
+
{ 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" },
|
|
4586
|
+
{ kind: "picker", id: "effort", label: "Effort", current: draft.effort, values: EFFORT_VALUES3 }
|
|
4524
4587
|
], [draft]);
|
|
4525
4588
|
const actions = [
|
|
4526
4589
|
{ id: "add", label: "Add Agent", hint: "add this agent to the run" },
|
|
@@ -4570,14 +4633,16 @@ function AddWorker() {
|
|
|
4570
4633
|
if (id === "provider") update({ provider: cycle3(PROVIDERS, draft.provider, dir), model: "" });
|
|
4571
4634
|
else if (id === "model") update({ model: cycle3(modelValuesForProvider(draft.provider), draft.model, dir) });
|
|
4572
4635
|
else if (id === "permissions") update({ permissions: cycle3(PERMISSIONS_VALUES3, draft.permissions, dir) });
|
|
4636
|
+
else if (id === "authMode") update({ authMode: cycle3(AUTH_MODE_VALUES3, draft.authMode, dir) });
|
|
4637
|
+
else if (id === "effort") update({ effort: cycle3(EFFORT_VALUES3, draft.effort, dir) });
|
|
4573
4638
|
}
|
|
4574
4639
|
function handleAdd() {
|
|
4575
4640
|
if (!selectedRunId) {
|
|
4576
|
-
toast("
|
|
4641
|
+
toast(t("addWorker.noRunSelected"), "error");
|
|
4577
4642
|
return;
|
|
4578
4643
|
}
|
|
4579
4644
|
if (!draft.provider) {
|
|
4580
|
-
toast("
|
|
4645
|
+
toast(t("addWorker.providerRequired"), "error");
|
|
4581
4646
|
return;
|
|
4582
4647
|
}
|
|
4583
4648
|
try {
|
|
@@ -4588,7 +4653,9 @@ function AddWorker() {
|
|
|
4588
4653
|
model: draft.model,
|
|
4589
4654
|
task: draft.prompt,
|
|
4590
4655
|
working_dir: draft.workingDir || void 0,
|
|
4591
|
-
permissions: draft.permissions
|
|
4656
|
+
permissions: draft.permissions,
|
|
4657
|
+
auth_mode: draft.authMode,
|
|
4658
|
+
effort: draft.effort
|
|
4592
4659
|
});
|
|
4593
4660
|
reset();
|
|
4594
4661
|
pop();
|
|
@@ -4658,15 +4725,15 @@ function AddWorker() {
|
|
|
4658
4725
|
}
|
|
4659
4726
|
});
|
|
4660
4727
|
if (!run) {
|
|
4661
|
-
return /* @__PURE__ */
|
|
4728
|
+
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
4729
|
}
|
|
4663
|
-
return /* @__PURE__ */
|
|
4730
|
+
return /* @__PURE__ */ jsx41(
|
|
4664
4731
|
Frame,
|
|
4665
4732
|
{
|
|
4666
4733
|
breadcrumb: ["ReevesAgents", "Runs", run.name, "Add Agent"],
|
|
4667
|
-
tagline:
|
|
4734
|
+
tagline: t("addWorker.tagline", { name: run.name }),
|
|
4668
4735
|
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__ */
|
|
4736
|
+
children: compactBody && modelPickerOpen ? /* @__PURE__ */ jsx41(
|
|
4670
4737
|
ModelOptionList,
|
|
4671
4738
|
{
|
|
4672
4739
|
provider: draft.provider,
|
|
@@ -4675,12 +4742,12 @@ function AddWorker() {
|
|
|
4675
4742
|
selectedIdx: modelPickerIdx,
|
|
4676
4743
|
visibleCount: Math.max(1, bodyRows - 3)
|
|
4677
4744
|
}
|
|
4678
|
-
) : /* @__PURE__ */
|
|
4679
|
-
compactBody && /* @__PURE__ */
|
|
4745
|
+
) : /* @__PURE__ */ jsxs34(Fragment10, { children: [
|
|
4746
|
+
compactBody && /* @__PURE__ */ jsx41(Section, { label: selectedIdx < fields.length ? "Add Agent" : "Actions" }),
|
|
4680
4747
|
(compactBody ? visibleRows.filter((rowIdx) => rowIdx < fields.length) : fields.map((_field, rowIdx) => rowIdx)).map((fIdx) => {
|
|
4681
4748
|
const field = fields[fIdx];
|
|
4682
4749
|
if (field.kind === "text") {
|
|
4683
|
-
return /* @__PURE__ */
|
|
4750
|
+
return /* @__PURE__ */ jsx41(
|
|
4684
4751
|
TextField,
|
|
4685
4752
|
{
|
|
4686
4753
|
label: field.label,
|
|
@@ -4698,7 +4765,7 @@ function AddWorker() {
|
|
|
4698
4765
|
);
|
|
4699
4766
|
}
|
|
4700
4767
|
const badge = pickerBadge3(field, draft.provider);
|
|
4701
|
-
return /* @__PURE__ */
|
|
4768
|
+
return /* @__PURE__ */ jsx41(
|
|
4702
4769
|
Row,
|
|
4703
4770
|
{
|
|
4704
4771
|
selected: selectedIdx === fIdx,
|
|
@@ -4710,7 +4777,7 @@ function AddWorker() {
|
|
|
4710
4777
|
field.id
|
|
4711
4778
|
);
|
|
4712
4779
|
}),
|
|
4713
|
-
modelPickerOpen && !compactBody && /* @__PURE__ */
|
|
4780
|
+
modelPickerOpen && !compactBody && /* @__PURE__ */ jsx41(
|
|
4714
4781
|
ModelOptionList,
|
|
4715
4782
|
{
|
|
4716
4783
|
provider: draft.provider,
|
|
@@ -4719,10 +4786,10 @@ function AddWorker() {
|
|
|
4719
4786
|
selectedIdx: modelPickerIdx
|
|
4720
4787
|
}
|
|
4721
4788
|
),
|
|
4722
|
-
!compactBody && /* @__PURE__ */
|
|
4789
|
+
!compactBody && /* @__PURE__ */ jsx41(Section, { label: "Actions" }),
|
|
4723
4790
|
compactBody ? visibleRows.filter((rowIdx) => rowIdx >= fields.length).map((rowIdx) => {
|
|
4724
4791
|
const action = actions[rowIdx - fields.length];
|
|
4725
|
-
return /* @__PURE__ */
|
|
4792
|
+
return /* @__PURE__ */ jsx41(
|
|
4726
4793
|
Row,
|
|
4727
4794
|
{
|
|
4728
4795
|
selected: selectedIdx === rowIdx,
|
|
@@ -4732,7 +4799,7 @@ function AddWorker() {
|
|
|
4732
4799
|
},
|
|
4733
4800
|
action.id
|
|
4734
4801
|
);
|
|
4735
|
-
}) : actions.map((action, aIdx) => /* @__PURE__ */
|
|
4802
|
+
}) : actions.map((action, aIdx) => /* @__PURE__ */ jsx41(
|
|
4736
4803
|
Row,
|
|
4737
4804
|
{
|
|
4738
4805
|
selected: selectedIdx === fields.length + aIdx,
|
|
@@ -4742,7 +4809,7 @@ function AddWorker() {
|
|
|
4742
4809
|
},
|
|
4743
4810
|
action.id
|
|
4744
4811
|
)),
|
|
4745
|
-
/* @__PURE__ */
|
|
4812
|
+
/* @__PURE__ */ jsx41(SectionEnd, {})
|
|
4746
4813
|
] })
|
|
4747
4814
|
}
|
|
4748
4815
|
);
|
|
@@ -4760,8 +4827,8 @@ function pickerBadge3(field, provider) {
|
|
|
4760
4827
|
return void 0;
|
|
4761
4828
|
}
|
|
4762
4829
|
|
|
4763
|
-
// src/screens/run/Stop.tsx
|
|
4764
|
-
import { jsx as
|
|
4830
|
+
// src/tui/screens/run/Stop.tsx
|
|
4831
|
+
import { jsx as jsx42 } from "react/jsx-runtime";
|
|
4765
4832
|
function RunStop() {
|
|
4766
4833
|
const { selectedRunId, pop, resetStack } = useRouter();
|
|
4767
4834
|
const { toast } = useToast();
|
|
@@ -4774,12 +4841,12 @@ function RunStop() {
|
|
|
4774
4841
|
}
|
|
4775
4842
|
})() : null;
|
|
4776
4843
|
if (!run) {
|
|
4777
|
-
return /* @__PURE__ */
|
|
4844
|
+
return /* @__PURE__ */ jsx42(
|
|
4778
4845
|
Frame,
|
|
4779
4846
|
{
|
|
4780
4847
|
breadcrumb: ["ReevesAgents", "Runs", "Stop"],
|
|
4781
4848
|
statusKeys: "\u2190\u2192 switch \xB7 enter select \xB7 esc cancel",
|
|
4782
|
-
children: /* @__PURE__ */
|
|
4849
|
+
children: /* @__PURE__ */ jsx42(
|
|
4783
4850
|
Dialog,
|
|
4784
4851
|
{
|
|
4785
4852
|
title: t("runStop.noRunTitle"),
|
|
@@ -4815,12 +4882,12 @@ function RunStop() {
|
|
|
4815
4882
|
}
|
|
4816
4883
|
}
|
|
4817
4884
|
const isRunEnded = run.status === "ended" || run.ended_at !== null;
|
|
4818
|
-
return /* @__PURE__ */
|
|
4885
|
+
return /* @__PURE__ */ jsx42(
|
|
4819
4886
|
Frame,
|
|
4820
4887
|
{
|
|
4821
4888
|
breadcrumb: ["ReevesAgents", "Runs", run.name, isRunEnded ? "Delete" : "Stop"],
|
|
4822
4889
|
statusKeys: "\u2190\u2192 switch \xB7 enter select \xB7 esc cancel",
|
|
4823
|
-
children: /* @__PURE__ */
|
|
4890
|
+
children: /* @__PURE__ */ jsx42(
|
|
4824
4891
|
Dialog,
|
|
4825
4892
|
{
|
|
4826
4893
|
title: t(isRunEnded ? "runStop.deleteTitle" : "runStop.stopTitle", { name: run.name }),
|
|
@@ -4836,10 +4903,10 @@ function RunStop() {
|
|
|
4836
4903
|
);
|
|
4837
4904
|
}
|
|
4838
4905
|
|
|
4839
|
-
// src/screens/Settings.tsx
|
|
4906
|
+
// src/tui/screens/Settings.tsx
|
|
4840
4907
|
import { useMemo as useMemo8, useState as useState27 } from "react";
|
|
4841
|
-
import { Box as
|
|
4842
|
-
import { Fragment as Fragment11, jsx as
|
|
4908
|
+
import { Box as Box29, useInput as useInput22, useWindowSize as useWindowSize17 } from "ink";
|
|
4909
|
+
import { Fragment as Fragment11, jsx as jsx43, jsxs as jsxs35 } from "react/jsx-runtime";
|
|
4843
4910
|
var CONFIG_PATHS = {
|
|
4844
4911
|
cc: "~/.claude/settings.json",
|
|
4845
4912
|
codex: "~/.codex/config.toml",
|
|
@@ -4854,7 +4921,7 @@ var CONFIG_PATHS = {
|
|
|
4854
4921
|
var PROVIDER_LABEL_WIDTH = Math.max(...PROVIDERS.map((provider) => providerDisplayName(provider).length));
|
|
4855
4922
|
var LANGUAGE_LABEL_WIDTH = Math.max(...LANGUAGE_OPTIONS.map((option) => option.nativeName.length + 3));
|
|
4856
4923
|
function Settings() {
|
|
4857
|
-
const { pop } = useRouter();
|
|
4924
|
+
const { pop, push } = useRouter();
|
|
4858
4925
|
const { toast } = useToast();
|
|
4859
4926
|
const { language, setLanguage, t } = useLanguage();
|
|
4860
4927
|
const { rows: termRows } = useWindowSize17();
|
|
@@ -4864,7 +4931,7 @@ function Settings() {
|
|
|
4864
4931
|
const [selectedIdx, setSelectedIdx] = useState27(0);
|
|
4865
4932
|
const [refreshKey, setRefreshKey] = useState27(0);
|
|
4866
4933
|
const available = useMemo8(() => detectAvailable(), [refreshKey]);
|
|
4867
|
-
const actionLabelWidth = Math.max(t("settings.recheck").length, t("settings.showConfig").length, t("common.back").length);
|
|
4934
|
+
const actionLabelWidth = Math.max(t("settings.recheck").length, t("settings.showConfig").length, t("settings.editConfig").length, t("common.back").length);
|
|
4868
4935
|
const rows = [
|
|
4869
4936
|
...PROVIDERS.map((p) => ({ type: "provider", id: p, provider: p, selectable: true })),
|
|
4870
4937
|
...LANGUAGE_OPTIONS.map((option) => ({ type: "language", id: `language-${option.code}`, language: option.code, selectable: true })),
|
|
@@ -4873,6 +4940,7 @@ function Settings() {
|
|
|
4873
4940
|
{ type: "statePath", id: "presets", selectable: false },
|
|
4874
4941
|
{ type: "action", id: "recheck", selectable: true },
|
|
4875
4942
|
{ type: "action", id: "showConfig", selectable: true },
|
|
4943
|
+
{ type: "action", id: "editConfig", selectable: true },
|
|
4876
4944
|
{ type: "action", id: "back", selectable: true }
|
|
4877
4945
|
];
|
|
4878
4946
|
const selectableRows = rows.filter((r) => r.selectable);
|
|
@@ -4900,6 +4968,10 @@ function Settings() {
|
|
|
4900
4968
|
toast(t("settings.configToast", { path: configPath() }), "info");
|
|
4901
4969
|
return;
|
|
4902
4970
|
}
|
|
4971
|
+
if (row.id === "editConfig") {
|
|
4972
|
+
push("Config");
|
|
4973
|
+
return;
|
|
4974
|
+
}
|
|
4903
4975
|
if (row.type === "language" && row.language) {
|
|
4904
4976
|
setLanguage(row.language);
|
|
4905
4977
|
toast(t("language.saved"), "info");
|
|
@@ -4934,7 +5006,7 @@ function Settings() {
|
|
|
4934
5006
|
const installedCount = Object.values(available).filter(Boolean).length;
|
|
4935
5007
|
const totalCount = PROVIDERS.length;
|
|
4936
5008
|
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__ */
|
|
5009
|
+
return /* @__PURE__ */ jsx43(
|
|
4938
5010
|
Frame,
|
|
4939
5011
|
{
|
|
4940
5012
|
breadcrumb: ["ReevesAgents", t("settings.title")],
|
|
@@ -4945,13 +5017,13 @@ function Settings() {
|
|
|
4945
5017
|
tagline: t("settings.tagline"),
|
|
4946
5018
|
statusContext,
|
|
4947
5019
|
statusKeys: t("settings.statusKeys"),
|
|
4948
|
-
children: compactBody ? /* @__PURE__ */
|
|
4949
|
-
/* @__PURE__ */
|
|
5020
|
+
children: compactBody ? /* @__PURE__ */ jsxs35(Box29, { flexDirection: "column", children: [
|
|
5021
|
+
/* @__PURE__ */ jsx43(Section, { label: selectedRow?.type === "language" ? t("common.language") : selectedRow?.type === "action" ? t("common.actions") : t("common.providers") }),
|
|
4950
5022
|
compactRows.map((row) => {
|
|
4951
5023
|
const rowIdx = rows.findIndex((r) => r.id === row.id);
|
|
4952
5024
|
if (row.type === "provider" && row.provider) {
|
|
4953
5025
|
const isInstalled = available[row.provider];
|
|
4954
|
-
return /* @__PURE__ */
|
|
5026
|
+
return /* @__PURE__ */ jsx43(
|
|
4955
5027
|
Row,
|
|
4956
5028
|
{
|
|
4957
5029
|
selected: selectedIdx === rowIdx,
|
|
@@ -4968,7 +5040,7 @@ function Settings() {
|
|
|
4968
5040
|
}
|
|
4969
5041
|
if (row.type === "language" && row.language) {
|
|
4970
5042
|
const option = LANGUAGE_OPTIONS.find((item) => item.code === row.language);
|
|
4971
|
-
return /* @__PURE__ */
|
|
5043
|
+
return /* @__PURE__ */ jsx43(
|
|
4972
5044
|
Row,
|
|
4973
5045
|
{
|
|
4974
5046
|
selected: selectedIdx === rowIdx,
|
|
@@ -4983,10 +5055,11 @@ function Settings() {
|
|
|
4983
5055
|
const actionLabels = {
|
|
4984
5056
|
recheck: { primary: t("settings.recheck"), hint: t("settings.recheckHint") },
|
|
4985
5057
|
showConfig: { primary: t("settings.showConfig"), hint: t("settings.showConfigHint") },
|
|
5058
|
+
editConfig: { primary: t("settings.editConfig"), hint: t("settings.editConfigHint") },
|
|
4986
5059
|
back: { primary: t("common.back"), hint: t("settings.backHint") }
|
|
4987
5060
|
};
|
|
4988
5061
|
const action = actionLabels[row.id];
|
|
4989
|
-
return /* @__PURE__ */
|
|
5062
|
+
return /* @__PURE__ */ jsx43(
|
|
4990
5063
|
Row,
|
|
4991
5064
|
{
|
|
4992
5065
|
selected: selectedIdx === rowIdx,
|
|
@@ -4997,7 +5070,7 @@ function Settings() {
|
|
|
4997
5070
|
row.id
|
|
4998
5071
|
);
|
|
4999
5072
|
}),
|
|
5000
|
-
selectableRows.length > compactRowCount && /* @__PURE__ */
|
|
5073
|
+
selectableRows.length > compactRowCount && /* @__PURE__ */ jsx43(
|
|
5001
5074
|
Row,
|
|
5002
5075
|
{
|
|
5003
5076
|
selected: false,
|
|
@@ -5006,21 +5079,21 @@ function Settings() {
|
|
|
5006
5079
|
disabled: true
|
|
5007
5080
|
}
|
|
5008
5081
|
),
|
|
5009
|
-
/* @__PURE__ */
|
|
5010
|
-
showCompactStatePaths && /* @__PURE__ */
|
|
5011
|
-
/* @__PURE__ */
|
|
5012
|
-
/* @__PURE__ */
|
|
5013
|
-
/* @__PURE__ */
|
|
5014
|
-
/* @__PURE__ */
|
|
5015
|
-
/* @__PURE__ */
|
|
5082
|
+
/* @__PURE__ */ jsx43(SectionEnd, {}),
|
|
5083
|
+
showCompactStatePaths && /* @__PURE__ */ jsxs35(Fragment11, { children: [
|
|
5084
|
+
/* @__PURE__ */ jsx43(Section, { label: t("settings.statePaths") }),
|
|
5085
|
+
/* @__PURE__ */ jsx43(Row, { selected: false, primary: t("settings.state"), trailing: stateRoot(), alwaysShowTrailing: true, disabled: true }),
|
|
5086
|
+
/* @__PURE__ */ jsx43(Row, { selected: false, primary: t("settings.runs"), trailing: runsDir(), alwaysShowTrailing: true, disabled: true }),
|
|
5087
|
+
/* @__PURE__ */ jsx43(Row, { selected: false, primary: t("settings.presets"), trailing: presetsDir(), alwaysShowTrailing: true, disabled: true }),
|
|
5088
|
+
/* @__PURE__ */ jsx43(SectionEnd, {})
|
|
5016
5089
|
] })
|
|
5017
|
-
] }) : /* @__PURE__ */
|
|
5018
|
-
/* @__PURE__ */
|
|
5090
|
+
] }) : /* @__PURE__ */ jsxs35(Box29, { flexDirection: "column", children: [
|
|
5091
|
+
/* @__PURE__ */ jsx43(Section, { label: t("common.providers") }),
|
|
5019
5092
|
PROVIDERS.map((provider, _idx) => {
|
|
5020
5093
|
const rowIdx = rows.findIndex((r) => r.type === "provider" && r.provider === provider);
|
|
5021
5094
|
const isSelected = selectedIdx === rowIdx;
|
|
5022
5095
|
const isInstalled = available[provider];
|
|
5023
|
-
return /* @__PURE__ */
|
|
5096
|
+
return /* @__PURE__ */ jsx43(
|
|
5024
5097
|
Row,
|
|
5025
5098
|
{
|
|
5026
5099
|
selected: isSelected,
|
|
@@ -5035,11 +5108,11 @@ function Settings() {
|
|
|
5035
5108
|
provider
|
|
5036
5109
|
);
|
|
5037
5110
|
}),
|
|
5038
|
-
/* @__PURE__ */
|
|
5039
|
-
/* @__PURE__ */
|
|
5111
|
+
/* @__PURE__ */ jsx43(SectionEnd, {}),
|
|
5112
|
+
/* @__PURE__ */ jsx43(Section, { label: t("common.language") }),
|
|
5040
5113
|
LANGUAGE_OPTIONS.map((option) => {
|
|
5041
5114
|
const rowIdx = rows.findIndex((r) => r.type === "language" && r.language === option.code);
|
|
5042
|
-
return /* @__PURE__ */
|
|
5115
|
+
return /* @__PURE__ */ jsx43(
|
|
5043
5116
|
Row,
|
|
5044
5117
|
{
|
|
5045
5118
|
selected: selectedIdx === rowIdx,
|
|
@@ -5051,9 +5124,9 @@ function Settings() {
|
|
|
5051
5124
|
option.code
|
|
5052
5125
|
);
|
|
5053
5126
|
}),
|
|
5054
|
-
/* @__PURE__ */
|
|
5055
|
-
/* @__PURE__ */
|
|
5056
|
-
/* @__PURE__ */
|
|
5127
|
+
/* @__PURE__ */ jsx43(SectionEnd, {}),
|
|
5128
|
+
/* @__PURE__ */ jsx43(Section, { label: t("settings.statePaths") }),
|
|
5129
|
+
/* @__PURE__ */ jsx43(
|
|
5057
5130
|
Row,
|
|
5058
5131
|
{
|
|
5059
5132
|
selected: selectedIdx === rows.findIndex((r) => r.id === "state"),
|
|
@@ -5061,7 +5134,7 @@ function Settings() {
|
|
|
5061
5134
|
trailing: stateRoot()
|
|
5062
5135
|
}
|
|
5063
5136
|
),
|
|
5064
|
-
/* @__PURE__ */
|
|
5137
|
+
/* @__PURE__ */ jsx43(
|
|
5065
5138
|
Row,
|
|
5066
5139
|
{
|
|
5067
5140
|
selected: selectedIdx === rows.findIndex((r) => r.id === "runs"),
|
|
@@ -5069,7 +5142,7 @@ function Settings() {
|
|
|
5069
5142
|
trailing: runsDir()
|
|
5070
5143
|
}
|
|
5071
5144
|
),
|
|
5072
|
-
/* @__PURE__ */
|
|
5145
|
+
/* @__PURE__ */ jsx43(
|
|
5073
5146
|
Row,
|
|
5074
5147
|
{
|
|
5075
5148
|
selected: selectedIdx === rows.findIndex((r) => r.id === "presets"),
|
|
@@ -5077,9 +5150,9 @@ function Settings() {
|
|
|
5077
5150
|
trailing: presetsDir()
|
|
5078
5151
|
}
|
|
5079
5152
|
),
|
|
5080
|
-
/* @__PURE__ */
|
|
5081
|
-
/* @__PURE__ */
|
|
5082
|
-
/* @__PURE__ */
|
|
5153
|
+
/* @__PURE__ */ jsx43(SectionEnd, {}),
|
|
5154
|
+
/* @__PURE__ */ jsx43(Section, { label: t("common.actions") }),
|
|
5155
|
+
/* @__PURE__ */ jsx43(
|
|
5083
5156
|
Row,
|
|
5084
5157
|
{
|
|
5085
5158
|
selected: selectedIdx === rows.findIndex((r) => r.id === "recheck"),
|
|
@@ -5088,7 +5161,7 @@ function Settings() {
|
|
|
5088
5161
|
hint: t("settings.recheckHint")
|
|
5089
5162
|
}
|
|
5090
5163
|
),
|
|
5091
|
-
/* @__PURE__ */
|
|
5164
|
+
/* @__PURE__ */ jsx43(
|
|
5092
5165
|
Row,
|
|
5093
5166
|
{
|
|
5094
5167
|
selected: selectedIdx === rows.findIndex((r) => r.id === "showConfig"),
|
|
@@ -5097,7 +5170,16 @@ function Settings() {
|
|
|
5097
5170
|
hint: t("settings.showConfigHint")
|
|
5098
5171
|
}
|
|
5099
5172
|
),
|
|
5100
|
-
/* @__PURE__ */
|
|
5173
|
+
/* @__PURE__ */ jsx43(
|
|
5174
|
+
Row,
|
|
5175
|
+
{
|
|
5176
|
+
selected: selectedIdx === rows.findIndex((r) => r.id === "editConfig"),
|
|
5177
|
+
primary: t("settings.editConfig"),
|
|
5178
|
+
primaryWidth: actionLabelWidth,
|
|
5179
|
+
hint: t("settings.editConfigHint")
|
|
5180
|
+
}
|
|
5181
|
+
),
|
|
5182
|
+
/* @__PURE__ */ jsx43(
|
|
5101
5183
|
Row,
|
|
5102
5184
|
{
|
|
5103
5185
|
selected: selectedIdx === rows.findIndex((r) => r.id === "back"),
|
|
@@ -5106,16 +5188,203 @@ function Settings() {
|
|
|
5106
5188
|
hint: t("settings.backHint")
|
|
5107
5189
|
}
|
|
5108
5190
|
),
|
|
5109
|
-
/* @__PURE__ */
|
|
5191
|
+
/* @__PURE__ */ jsx43(SectionEnd, {})
|
|
5110
5192
|
] })
|
|
5111
5193
|
}
|
|
5112
5194
|
);
|
|
5113
5195
|
}
|
|
5114
5196
|
|
|
5115
|
-
// src/screens/
|
|
5116
|
-
import { useState as useState28 } from "react";
|
|
5117
|
-
import { useInput as useInput23, useWindowSize as useWindowSize18 } from "ink";
|
|
5118
|
-
|
|
5197
|
+
// src/tui/screens/AgentControl.tsx
|
|
5198
|
+
import { useMemo as useMemo9, useState as useState28 } from "react";
|
|
5199
|
+
import { Box as Box31, useInput as useInput23, useWindowSize as useWindowSize18 } from "ink";
|
|
5200
|
+
|
|
5201
|
+
// src/tui/components/Primary.tsx
|
|
5202
|
+
import { Box as Box30 } from "ink";
|
|
5203
|
+
import { jsx as jsx44 } from "react/jsx-runtime";
|
|
5204
|
+
function Primary({ children }) {
|
|
5205
|
+
return /* @__PURE__ */ jsx44(Box30, { flexDirection: "column", flexGrow: 1, children });
|
|
5206
|
+
}
|
|
5207
|
+
|
|
5208
|
+
// src/tui/screens/AgentControl.tsx
|
|
5209
|
+
import { jsx as jsx45, jsxs as jsxs36 } from "react/jsx-runtime";
|
|
5210
|
+
function hostGlyph(host) {
|
|
5211
|
+
if (!host.installed) return { char: glyphs.status.fail, color: colors.text.faint };
|
|
5212
|
+
if (host.attached) return { char: glyphs.status.ok, color: colors.status.ok };
|
|
5213
|
+
if (host.manual) return { char: glyphs.status.pending, color: colors.text.faint };
|
|
5214
|
+
return { char: glyphs.status.warn, color: colors.status.warn };
|
|
5215
|
+
}
|
|
5216
|
+
function AgentControl() {
|
|
5217
|
+
const { pop } = useRouter();
|
|
5218
|
+
const { t } = useLanguage();
|
|
5219
|
+
const { rows: termRows } = useWindowSize18();
|
|
5220
|
+
const bodyRows = frameBodyRows(termRows, true, true);
|
|
5221
|
+
const compactBody = bodyRows <= 10;
|
|
5222
|
+
const [selectedIdx, setSelectedIdx] = useState28(0);
|
|
5223
|
+
const [refreshKey, setRefreshKey] = useState28(0);
|
|
5224
|
+
const [result, setResult] = useState28(null);
|
|
5225
|
+
const hosts = useMemo9(() => hostStatus(), [refreshKey]);
|
|
5226
|
+
const attachedCount = hosts.filter((host) => host.attached).length;
|
|
5227
|
+
const actionOffset = hosts.length;
|
|
5228
|
+
const totalItems = actionOffset + 2;
|
|
5229
|
+
const hostLabelWidth = Math.max(
|
|
5230
|
+
...hosts.map((host) => host.label.length),
|
|
5231
|
+
t("agentControl.attachAll").length,
|
|
5232
|
+
t("common.back").length
|
|
5233
|
+
);
|
|
5234
|
+
const compactEntryCount = Math.max(1, bodyRows - 2);
|
|
5235
|
+
const compactFirstEntry = Math.min(
|
|
5236
|
+
Math.max(0, selectedIdx - compactEntryCount + 1),
|
|
5237
|
+
Math.max(0, totalItems - compactEntryCount)
|
|
5238
|
+
);
|
|
5239
|
+
const compactEntryIndexes = Array.from(
|
|
5240
|
+
{ length: Math.min(compactEntryCount, totalItems - compactFirstEntry) },
|
|
5241
|
+
(_, idx) => compactFirstEntry + idx
|
|
5242
|
+
);
|
|
5243
|
+
function hostHint(host) {
|
|
5244
|
+
if (!host.installed) return t("agentControl.notInstalledHint");
|
|
5245
|
+
if (host.manual) return t("agentControl.manualHint");
|
|
5246
|
+
return host.attached ? t("agentControl.detachHint") : t("agentControl.attachHint");
|
|
5247
|
+
}
|
|
5248
|
+
function hostTrailing(host) {
|
|
5249
|
+
if (!host.installed) return t("agentControl.notInstalled");
|
|
5250
|
+
if (host.manual) return t("agentControl.manual");
|
|
5251
|
+
return host.attached ? t("agentControl.attached") : t("agentControl.detached");
|
|
5252
|
+
}
|
|
5253
|
+
function toggleHost(host) {
|
|
5254
|
+
if (host.manual || !host.installed) return;
|
|
5255
|
+
const res = host.attached ? detach(host.key) : attach(host.key);
|
|
5256
|
+
setResult(res);
|
|
5257
|
+
setRefreshKey((k) => k + 1);
|
|
5258
|
+
}
|
|
5259
|
+
function runAttachAll() {
|
|
5260
|
+
const results = attachAll();
|
|
5261
|
+
const ok = results.filter((r) => r.ok).length;
|
|
5262
|
+
setResult({
|
|
5263
|
+
key: "all",
|
|
5264
|
+
label: t("agentControl.attachAll"),
|
|
5265
|
+
ok: results.every((r) => r.ok),
|
|
5266
|
+
message: t("agentControl.attachAllToast", { ok, total: results.length })
|
|
5267
|
+
});
|
|
5268
|
+
setRefreshKey((k) => k + 1);
|
|
5269
|
+
}
|
|
5270
|
+
useInput23((input, key) => {
|
|
5271
|
+
if (key.escape || key.backspace) {
|
|
5272
|
+
pop();
|
|
5273
|
+
return;
|
|
5274
|
+
}
|
|
5275
|
+
if (input === "a") {
|
|
5276
|
+
runAttachAll();
|
|
5277
|
+
return;
|
|
5278
|
+
}
|
|
5279
|
+
if (key.upArrow) {
|
|
5280
|
+
setSelectedIdx((idx) => Math.max(0, idx - 1));
|
|
5281
|
+
return;
|
|
5282
|
+
}
|
|
5283
|
+
if (key.downArrow) {
|
|
5284
|
+
setSelectedIdx((idx) => Math.min(totalItems - 1, idx + 1));
|
|
5285
|
+
return;
|
|
5286
|
+
}
|
|
5287
|
+
if (key.return) {
|
|
5288
|
+
if (selectedIdx < hosts.length) {
|
|
5289
|
+
toggleHost(hosts[selectedIdx]);
|
|
5290
|
+
return;
|
|
5291
|
+
}
|
|
5292
|
+
if (selectedIdx === actionOffset) {
|
|
5293
|
+
runAttachAll();
|
|
5294
|
+
return;
|
|
5295
|
+
}
|
|
5296
|
+
if (selectedIdx === actionOffset + 1) {
|
|
5297
|
+
pop();
|
|
5298
|
+
return;
|
|
5299
|
+
}
|
|
5300
|
+
}
|
|
5301
|
+
});
|
|
5302
|
+
const selectedHost = selectedIdx < hosts.length ? hosts[selectedIdx] : void 0;
|
|
5303
|
+
const statusContext = result ? `${result.label}: ${result.message}` : selectedHost ? `${selectedHost.label} \xB7 ${selectedHost.bin}` : "";
|
|
5304
|
+
function renderHost(host, idx) {
|
|
5305
|
+
return /* @__PURE__ */ jsx45(
|
|
5306
|
+
Row,
|
|
5307
|
+
{
|
|
5308
|
+
selected: idx === selectedIdx,
|
|
5309
|
+
glyph: hostGlyph(host),
|
|
5310
|
+
primary: host.label,
|
|
5311
|
+
primaryWidth: hostLabelWidth,
|
|
5312
|
+
hint: hostHint(host),
|
|
5313
|
+
trailing: hostTrailing(host)
|
|
5314
|
+
},
|
|
5315
|
+
host.key
|
|
5316
|
+
);
|
|
5317
|
+
}
|
|
5318
|
+
function renderAttachAll(idx) {
|
|
5319
|
+
return /* @__PURE__ */ jsx45(
|
|
5320
|
+
Row,
|
|
5321
|
+
{
|
|
5322
|
+
selected: idx === selectedIdx,
|
|
5323
|
+
primary: t("agentControl.attachAll"),
|
|
5324
|
+
primaryWidth: hostLabelWidth,
|
|
5325
|
+
hint: t("agentControl.attachAllHint")
|
|
5326
|
+
},
|
|
5327
|
+
"attach-all"
|
|
5328
|
+
);
|
|
5329
|
+
}
|
|
5330
|
+
function renderBack(idx) {
|
|
5331
|
+
return /* @__PURE__ */ jsx45(
|
|
5332
|
+
Row,
|
|
5333
|
+
{
|
|
5334
|
+
selected: idx === selectedIdx,
|
|
5335
|
+
primary: t("common.back"),
|
|
5336
|
+
primaryWidth: hostLabelWidth,
|
|
5337
|
+
hint: t("agentControl.backHint")
|
|
5338
|
+
},
|
|
5339
|
+
"back"
|
|
5340
|
+
);
|
|
5341
|
+
}
|
|
5342
|
+
return /* @__PURE__ */ jsx45(
|
|
5343
|
+
Frame,
|
|
5344
|
+
{
|
|
5345
|
+
breadcrumb: ["ReevesAgents", t("agentControl.title")],
|
|
5346
|
+
meta: [{ label: t("agentControl.hostsMeta"), value: `${attachedCount}/${hosts.length}` }],
|
|
5347
|
+
tagline: t("agentControl.tagline"),
|
|
5348
|
+
statusContext,
|
|
5349
|
+
statusKeys: t("agentControl.statusKeys"),
|
|
5350
|
+
children: compactBody ? /* @__PURE__ */ jsxs36(Primary, { children: [
|
|
5351
|
+
/* @__PURE__ */ jsx45(Section, { label: selectedIdx < hosts.length ? t("agentControl.hosts") : t("common.actions") }),
|
|
5352
|
+
compactEntryIndexes.map((idx) => {
|
|
5353
|
+
if (idx < hosts.length) return renderHost(hosts[idx], idx);
|
|
5354
|
+
if (idx === actionOffset) return renderAttachAll(idx);
|
|
5355
|
+
return renderBack(idx);
|
|
5356
|
+
}),
|
|
5357
|
+
/* @__PURE__ */ jsx45(SectionEnd, {})
|
|
5358
|
+
] }) : /* @__PURE__ */ jsxs36(Primary, { children: [
|
|
5359
|
+
/* @__PURE__ */ jsx45(Section, { label: t("agentControl.hosts") }),
|
|
5360
|
+
hosts.map((host, idx) => renderHost(host, idx)),
|
|
5361
|
+
/* @__PURE__ */ jsx45(SectionEnd, {}),
|
|
5362
|
+
/* @__PURE__ */ jsx45(Box31, { marginTop: 1 }),
|
|
5363
|
+
/* @__PURE__ */ jsx45(
|
|
5364
|
+
Legend,
|
|
5365
|
+
{
|
|
5366
|
+
items: [
|
|
5367
|
+
{ glyph: glyphs.status.ok, label: t("agentControl.attached"), color: colors.status.ok },
|
|
5368
|
+
{ glyph: glyphs.status.warn, label: t("agentControl.detached"), color: colors.status.warn },
|
|
5369
|
+
{ glyph: glyphs.status.pending, label: t("agentControl.manual"), color: colors.text.faint },
|
|
5370
|
+
{ glyph: glyphs.status.fail, label: t("agentControl.notInstalled"), color: colors.text.faint }
|
|
5371
|
+
]
|
|
5372
|
+
}
|
|
5373
|
+
),
|
|
5374
|
+
/* @__PURE__ */ jsx45(Box31, { marginTop: 1 }),
|
|
5375
|
+
/* @__PURE__ */ jsx45(Section, { label: t("common.actions") }),
|
|
5376
|
+
renderAttachAll(actionOffset),
|
|
5377
|
+
renderBack(actionOffset + 1),
|
|
5378
|
+
/* @__PURE__ */ jsx45(SectionEnd, {})
|
|
5379
|
+
] })
|
|
5380
|
+
}
|
|
5381
|
+
);
|
|
5382
|
+
}
|
|
5383
|
+
|
|
5384
|
+
// src/tui/screens/Reference.tsx
|
|
5385
|
+
import { useState as useState29 } from "react";
|
|
5386
|
+
import { useInput as useInput24, useWindowSize as useWindowSize19 } from "ink";
|
|
5387
|
+
import { Fragment as Fragment12, jsx as jsx46, jsxs as jsxs37 } from "react/jsx-runtime";
|
|
5119
5388
|
var CONTENT = [
|
|
5120
5389
|
{ type: "section", label: "TUI Pages" },
|
|
5121
5390
|
{ type: "row", primary: "Welcome", trailing: "main menu, current run, reference, credits" },
|
|
@@ -5138,13 +5407,13 @@ var CONTENT = [
|
|
|
5138
5407
|
];
|
|
5139
5408
|
function Reference() {
|
|
5140
5409
|
const { pop } = useRouter();
|
|
5141
|
-
const { rows } =
|
|
5410
|
+
const { rows } = useWindowSize19();
|
|
5142
5411
|
const bodyRows = frameBodyRows(rows, true, true);
|
|
5143
5412
|
const compactBody = bodyRows <= 10;
|
|
5144
5413
|
const visibleCount = Math.max(1, compactBody ? bodyRows - 3 : bodyRows - 5);
|
|
5145
5414
|
const maxScroll = Math.max(0, CONTENT.length - visibleCount);
|
|
5146
|
-
const [scroll, setScroll] =
|
|
5147
|
-
|
|
5415
|
+
const [scroll, setScroll] = useState29(0);
|
|
5416
|
+
useInput24((_input, key) => {
|
|
5148
5417
|
if (key.upArrow) {
|
|
5149
5418
|
setScroll((value) => Math.max(0, value - 1));
|
|
5150
5419
|
return;
|
|
@@ -5161,25 +5430,25 @@ function Reference() {
|
|
|
5161
5430
|
let openSection = false;
|
|
5162
5431
|
visible.forEach((item, idx) => {
|
|
5163
5432
|
if (item.type === "section") {
|
|
5164
|
-
if (openSection) contentRows.push(/* @__PURE__ */
|
|
5165
|
-
contentRows.push(/* @__PURE__ */
|
|
5433
|
+
if (openSection) contentRows.push(/* @__PURE__ */ jsx46(SectionEnd, {}, `end-${idx}`));
|
|
5434
|
+
contentRows.push(/* @__PURE__ */ jsx46(Section, { label: item.label }, `${item.label}-${idx}`));
|
|
5166
5435
|
openSection = true;
|
|
5167
5436
|
return;
|
|
5168
5437
|
}
|
|
5169
|
-
contentRows.push(/* @__PURE__ */
|
|
5438
|
+
contentRows.push(/* @__PURE__ */ jsx46(Row, { selected: false, primary: item.primary, trailing: item.trailing }, `${item.primary}-${idx}`));
|
|
5170
5439
|
});
|
|
5171
|
-
if (openSection) contentRows.push(/* @__PURE__ */
|
|
5172
|
-
return /* @__PURE__ */
|
|
5440
|
+
if (openSection) contentRows.push(/* @__PURE__ */ jsx46(SectionEnd, {}, "end-visible"));
|
|
5441
|
+
return /* @__PURE__ */ jsx46(
|
|
5173
5442
|
Frame,
|
|
5174
5443
|
{
|
|
5175
5444
|
breadcrumb: ["ReevesAgents", "Reference"],
|
|
5176
5445
|
tagline: "Quick map of run mode, command line, tmux workflow, and roles.",
|
|
5177
5446
|
statusContext,
|
|
5178
5447
|
statusKeys: maxScroll > 0 ? "\u2191\u2193 scroll \xB7 enter back \xB7 esc back" : "enter back \xB7 esc back",
|
|
5179
|
-
children: compactBody ? /* @__PURE__ */
|
|
5180
|
-
/* @__PURE__ */
|
|
5181
|
-
visible.map((item, idx) => item.type === "section" ? /* @__PURE__ */
|
|
5182
|
-
maxScroll > 0 && /* @__PURE__ */
|
|
5448
|
+
children: compactBody ? /* @__PURE__ */ jsxs37(Fragment12, { children: [
|
|
5449
|
+
/* @__PURE__ */ jsx46(Section, { label: "Reference" }),
|
|
5450
|
+
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}`)),
|
|
5451
|
+
maxScroll > 0 && /* @__PURE__ */ jsx46(
|
|
5183
5452
|
Row,
|
|
5184
5453
|
{
|
|
5185
5454
|
selected: false,
|
|
@@ -5188,24 +5457,24 @@ function Reference() {
|
|
|
5188
5457
|
disabled: true
|
|
5189
5458
|
}
|
|
5190
5459
|
),
|
|
5191
|
-
/* @__PURE__ */
|
|
5192
|
-
] }) : /* @__PURE__ */
|
|
5460
|
+
/* @__PURE__ */ jsx46(SectionEnd, {})
|
|
5461
|
+
] }) : /* @__PURE__ */ jsxs37(Fragment12, { children: [
|
|
5193
5462
|
contentRows,
|
|
5194
|
-
/* @__PURE__ */
|
|
5195
|
-
/* @__PURE__ */
|
|
5196
|
-
/* @__PURE__ */
|
|
5463
|
+
/* @__PURE__ */ jsx46(Section, { label: "Actions" }),
|
|
5464
|
+
/* @__PURE__ */ jsx46(Row, { selected: true, primary: "Back", hint: "return to previous page" }),
|
|
5465
|
+
/* @__PURE__ */ jsx46(SectionEnd, {})
|
|
5197
5466
|
] })
|
|
5198
5467
|
}
|
|
5199
5468
|
);
|
|
5200
5469
|
}
|
|
5201
5470
|
|
|
5202
|
-
// src/screens/Credits.tsx
|
|
5203
|
-
import { useState as
|
|
5204
|
-
import { Box as
|
|
5205
|
-
import { Fragment as Fragment13, jsx as
|
|
5471
|
+
// src/tui/screens/Credits.tsx
|
|
5472
|
+
import { useState as useState30 } from "react";
|
|
5473
|
+
import { Box as Box32, useInput as useInput25, useWindowSize as useWindowSize20 } from "ink";
|
|
5474
|
+
import { Fragment as Fragment13, jsx as jsx47, jsxs as jsxs38 } from "react/jsx-runtime";
|
|
5206
5475
|
function Credits() {
|
|
5207
5476
|
const { pop } = useRouter();
|
|
5208
|
-
const { rows: termRows } =
|
|
5477
|
+
const { rows: termRows } = useWindowSize20();
|
|
5209
5478
|
const bodyRows = frameBodyRows(termRows, true, true);
|
|
5210
5479
|
const compactBody = bodyRows <= 8;
|
|
5211
5480
|
const content = [
|
|
@@ -5219,10 +5488,10 @@ function Credits() {
|
|
|
5219
5488
|
{ primary: "Repository", trailing: "See package metadata" }
|
|
5220
5489
|
];
|
|
5221
5490
|
const visibleCount = Math.max(1, bodyRows - (compactBody ? 3 : 6));
|
|
5222
|
-
const [scroll, setScroll] =
|
|
5491
|
+
const [scroll, setScroll] = useState30(0);
|
|
5223
5492
|
const maxScroll = Math.max(0, content.length - visibleCount);
|
|
5224
5493
|
const visible = content.slice(scroll, scroll + visibleCount);
|
|
5225
|
-
|
|
5494
|
+
useInput25((_input, key) => {
|
|
5226
5495
|
if (key.upArrow) {
|
|
5227
5496
|
setScroll((value) => Math.max(0, value - 1));
|
|
5228
5497
|
return;
|
|
@@ -5233,17 +5502,17 @@ function Credits() {
|
|
|
5233
5502
|
}
|
|
5234
5503
|
if (key.return || key.escape || key.backspace) pop();
|
|
5235
5504
|
});
|
|
5236
|
-
return /* @__PURE__ */
|
|
5505
|
+
return /* @__PURE__ */ jsx47(
|
|
5237
5506
|
Frame,
|
|
5238
5507
|
{
|
|
5239
5508
|
breadcrumb: ["ReevesAgents", "Credits"],
|
|
5240
5509
|
tagline: "About this local tmux-first workspace manager.",
|
|
5241
5510
|
statusContext: `ReevesAgents ${REEVESAGENTS_VERSION}`,
|
|
5242
5511
|
statusKeys: "enter back \xB7 esc back",
|
|
5243
|
-
children: /* @__PURE__ */
|
|
5244
|
-
/* @__PURE__ */
|
|
5245
|
-
visible.map((item) => /* @__PURE__ */
|
|
5246
|
-
maxScroll > 0 && /* @__PURE__ */
|
|
5512
|
+
children: /* @__PURE__ */ jsxs38(Box32, { flexDirection: "column", children: [
|
|
5513
|
+
/* @__PURE__ */ jsx47(Section, { label: "Credits" }),
|
|
5514
|
+
visible.map((item) => /* @__PURE__ */ jsx47(Row, { selected: false, primary: item.primary, trailing: item.trailing }, item.primary)),
|
|
5515
|
+
maxScroll > 0 && /* @__PURE__ */ jsx47(
|
|
5247
5516
|
Row,
|
|
5248
5517
|
{
|
|
5249
5518
|
selected: false,
|
|
@@ -5252,30 +5521,21 @@ function Credits() {
|
|
|
5252
5521
|
disabled: true
|
|
5253
5522
|
}
|
|
5254
5523
|
),
|
|
5255
|
-
/* @__PURE__ */
|
|
5256
|
-
!compactBody && /* @__PURE__ */
|
|
5257
|
-
/* @__PURE__ */
|
|
5258
|
-
/* @__PURE__ */
|
|
5259
|
-
/* @__PURE__ */
|
|
5524
|
+
/* @__PURE__ */ jsx47(SectionEnd, {}),
|
|
5525
|
+
!compactBody && /* @__PURE__ */ jsxs38(Fragment13, { children: [
|
|
5526
|
+
/* @__PURE__ */ jsx47(Section, { label: "Actions" }),
|
|
5527
|
+
/* @__PURE__ */ jsx47(Row, { selected: true, primary: "Back", hint: "return to main menu" }),
|
|
5528
|
+
/* @__PURE__ */ jsx47(SectionEnd, {})
|
|
5260
5529
|
] })
|
|
5261
5530
|
] })
|
|
5262
5531
|
}
|
|
5263
5532
|
);
|
|
5264
5533
|
}
|
|
5265
5534
|
|
|
5266
|
-
// src/screens/Doctor.tsx
|
|
5267
|
-
import { useEffect as useEffect13, useMemo as
|
|
5268
|
-
import { Box as
|
|
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";
|
|
5535
|
+
// src/tui/screens/Doctor.tsx
|
|
5536
|
+
import { useEffect as useEffect13, useMemo as useMemo10, useState as useState31 } from "react";
|
|
5537
|
+
import { Box as Box33, useInput as useInput26, useWindowSize as useWindowSize21 } from "ink";
|
|
5538
|
+
import { Fragment as Fragment14, jsx as jsx48, jsxs as jsxs39 } from "react/jsx-runtime";
|
|
5279
5539
|
var CHROME_ROWS5 = 17;
|
|
5280
5540
|
function statusGlyph4(status) {
|
|
5281
5541
|
if (status === "ok") return { char: glyphs.status.ok, color: colors.status.ok };
|
|
@@ -5284,15 +5544,15 @@ function statusGlyph4(status) {
|
|
|
5284
5544
|
}
|
|
5285
5545
|
function Doctor() {
|
|
5286
5546
|
const { pop, push, setSelectedCheckName } = useRouter();
|
|
5287
|
-
const { rows: termRows } =
|
|
5547
|
+
const { rows: termRows } = useWindowSize21();
|
|
5288
5548
|
const bodyRows = frameBodyRows(termRows, true, true);
|
|
5289
5549
|
const compactBody = bodyRows <= 10;
|
|
5290
5550
|
const pageSize = Math.max(1, compactBody ? bodyRows - 3 : Math.min(termRows - CHROME_ROWS5, bodyRows - 7));
|
|
5291
|
-
const [selectedIdx, setSelectedIdx] =
|
|
5292
|
-
const [refreshKey, setRefreshKey] =
|
|
5293
|
-
const [isSpinning, setIsSpinning] =
|
|
5294
|
-
const [page, setPage] =
|
|
5295
|
-
const result =
|
|
5551
|
+
const [selectedIdx, setSelectedIdx] = useState31(0);
|
|
5552
|
+
const [refreshKey, setRefreshKey] = useState31(0);
|
|
5553
|
+
const [isSpinning, setIsSpinning] = useState31(false);
|
|
5554
|
+
const [page, setPage] = useState31(1);
|
|
5555
|
+
const result = useMemo10(() => runDoctor(), [refreshKey]);
|
|
5296
5556
|
const checks = result.checks;
|
|
5297
5557
|
const counts = {
|
|
5298
5558
|
ok: checks.filter((c) => c.status === "ok").length,
|
|
@@ -5329,7 +5589,7 @@ function Doctor() {
|
|
|
5329
5589
|
setIsSpinning(false);
|
|
5330
5590
|
}, 200);
|
|
5331
5591
|
};
|
|
5332
|
-
|
|
5592
|
+
useInput26((_input, key) => {
|
|
5333
5593
|
if (key.escape || key.backspace) {
|
|
5334
5594
|
pop();
|
|
5335
5595
|
return;
|
|
@@ -5359,7 +5619,7 @@ function Doctor() {
|
|
|
5359
5619
|
}
|
|
5360
5620
|
}
|
|
5361
5621
|
});
|
|
5362
|
-
return /* @__PURE__ */
|
|
5622
|
+
return /* @__PURE__ */ jsx48(
|
|
5363
5623
|
Frame,
|
|
5364
5624
|
{
|
|
5365
5625
|
breadcrumb: ["ReevesAgents", "Doctor"],
|
|
@@ -5370,12 +5630,12 @@ function Doctor() {
|
|
|
5370
5630
|
],
|
|
5371
5631
|
tagline: "Setup and environment health for TUI, CLI, Web UI, and tmux.",
|
|
5372
5632
|
statusContext: selectedCheck ? `${selectedCheck.name}: ${selectedCheck.detail}` : "",
|
|
5373
|
-
children: compactBody ? /* @__PURE__ */
|
|
5374
|
-
/* @__PURE__ */
|
|
5375
|
-
isSpinning ? /* @__PURE__ */
|
|
5633
|
+
children: compactBody ? /* @__PURE__ */ jsxs39(Primary, { children: [
|
|
5634
|
+
/* @__PURE__ */ jsx48(Section, { label: selectedIdx < pagedChecks.length ? "Checks" : "Actions" }),
|
|
5635
|
+
isSpinning ? /* @__PURE__ */ jsx48(Spinner, { label: "checking...", color: colors.accent.bright }) : compactEntryIndexes.map((idx) => {
|
|
5376
5636
|
if (idx < pagedChecks.length) {
|
|
5377
5637
|
const check = pagedChecks[idx];
|
|
5378
|
-
return /* @__PURE__ */
|
|
5638
|
+
return /* @__PURE__ */ jsx48(
|
|
5379
5639
|
Row,
|
|
5380
5640
|
{
|
|
5381
5641
|
selected: idx === selectedIdx,
|
|
@@ -5388,7 +5648,7 @@ function Doctor() {
|
|
|
5388
5648
|
);
|
|
5389
5649
|
}
|
|
5390
5650
|
if (totalPages > 1 && idx === pagedChecks.length) {
|
|
5391
|
-
return /* @__PURE__ */
|
|
5651
|
+
return /* @__PURE__ */ jsx48(
|
|
5392
5652
|
Pagination,
|
|
5393
5653
|
{
|
|
5394
5654
|
page,
|
|
@@ -5401,14 +5661,14 @@ function Doctor() {
|
|
|
5401
5661
|
);
|
|
5402
5662
|
}
|
|
5403
5663
|
if (idx === actionOffset) {
|
|
5404
|
-
return /* @__PURE__ */
|
|
5664
|
+
return /* @__PURE__ */ jsx48(Row, { selected: selectedIdx === actionOffset, primary: "Recheck", primaryWidth: checkLabelWidth, hint: "run doctor again" }, "recheck");
|
|
5405
5665
|
}
|
|
5406
|
-
return /* @__PURE__ */
|
|
5666
|
+
return /* @__PURE__ */ jsx48(Row, { selected: selectedIdx === actionOffset + 1, primary: "Back", primaryWidth: checkLabelWidth, hint: "return to previous page" }, "back");
|
|
5407
5667
|
}),
|
|
5408
|
-
/* @__PURE__ */
|
|
5409
|
-
] }) : /* @__PURE__ */
|
|
5410
|
-
isSpinning && /* @__PURE__ */
|
|
5411
|
-
!isSpinning && pagedChecks.map((check, idx) => /* @__PURE__ */
|
|
5668
|
+
/* @__PURE__ */ jsx48(SectionEnd, {})
|
|
5669
|
+
] }) : /* @__PURE__ */ jsxs39(Primary, { children: [
|
|
5670
|
+
isSpinning && /* @__PURE__ */ jsx48(Spinner, { label: "checking...", color: colors.accent.bright }),
|
|
5671
|
+
!isSpinning && pagedChecks.map((check, idx) => /* @__PURE__ */ jsx48(
|
|
5412
5672
|
Row,
|
|
5413
5673
|
{
|
|
5414
5674
|
selected: idx === selectedIdx,
|
|
@@ -5419,7 +5679,7 @@ function Doctor() {
|
|
|
5419
5679
|
},
|
|
5420
5680
|
check.name
|
|
5421
5681
|
)),
|
|
5422
|
-
!isSpinning && totalPages > 1 && /* @__PURE__ */
|
|
5682
|
+
!isSpinning && totalPages > 1 && /* @__PURE__ */ jsx48(
|
|
5423
5683
|
Pagination,
|
|
5424
5684
|
{
|
|
5425
5685
|
page,
|
|
@@ -5429,9 +5689,9 @@ function Doctor() {
|
|
|
5429
5689
|
onNext: () => setPage((p) => Math.min(totalPages, p + 1))
|
|
5430
5690
|
}
|
|
5431
5691
|
),
|
|
5432
|
-
!isSpinning && /* @__PURE__ */
|
|
5433
|
-
/* @__PURE__ */
|
|
5434
|
-
/* @__PURE__ */
|
|
5692
|
+
!isSpinning && /* @__PURE__ */ jsxs39(Fragment14, { children: [
|
|
5693
|
+
/* @__PURE__ */ jsx48(Box33, { marginTop: 1 }),
|
|
5694
|
+
/* @__PURE__ */ jsx48(
|
|
5435
5695
|
Legend,
|
|
5436
5696
|
{
|
|
5437
5697
|
items: [
|
|
@@ -5442,20 +5702,20 @@ function Doctor() {
|
|
|
5442
5702
|
}
|
|
5443
5703
|
)
|
|
5444
5704
|
] }),
|
|
5445
|
-
/* @__PURE__ */
|
|
5446
|
-
/* @__PURE__ */
|
|
5447
|
-
/* @__PURE__ */
|
|
5448
|
-
/* @__PURE__ */
|
|
5449
|
-
/* @__PURE__ */
|
|
5705
|
+
/* @__PURE__ */ jsx48(Box33, { marginTop: 1 }),
|
|
5706
|
+
/* @__PURE__ */ jsx48(Section, { label: "Actions" }),
|
|
5707
|
+
/* @__PURE__ */ jsx48(Row, { selected: selectedIdx === actionOffset, primary: "Recheck", primaryWidth: checkLabelWidth, hint: "run doctor again" }),
|
|
5708
|
+
/* @__PURE__ */ jsx48(Row, { selected: selectedIdx === actionOffset + 1, primary: "Back", primaryWidth: checkLabelWidth, hint: "return to previous page" }),
|
|
5709
|
+
/* @__PURE__ */ jsx48(SectionEnd, {})
|
|
5450
5710
|
] })
|
|
5451
5711
|
}
|
|
5452
5712
|
);
|
|
5453
5713
|
}
|
|
5454
5714
|
|
|
5455
|
-
// src/screens/
|
|
5456
|
-
import { useEffect as useEffect14, useMemo as
|
|
5457
|
-
import { Box as
|
|
5458
|
-
import { Fragment as Fragment15, jsx as
|
|
5715
|
+
// src/tui/screens/DoctorCheck.tsx
|
|
5716
|
+
import { useEffect as useEffect14, useMemo as useMemo11, useState as useState32 } from "react";
|
|
5717
|
+
import { Box as Box34, Text as Text28, useInput as useInput27 } from "ink";
|
|
5718
|
+
import { Fragment as Fragment15, jsx as jsx49, jsxs as jsxs40 } from "react/jsx-runtime";
|
|
5459
5719
|
function statusGlyph5(status) {
|
|
5460
5720
|
if (status === "ok") return { char: glyphs.status.ok, color: colors.status.ok };
|
|
5461
5721
|
if (status === "warn") return { char: glyphs.status.warn, color: colors.status.warn };
|
|
@@ -5469,14 +5729,14 @@ function findFixHint(check) {
|
|
|
5469
5729
|
}
|
|
5470
5730
|
function DoctorCheck() {
|
|
5471
5731
|
const { pop, selectedCheckName } = useRouter();
|
|
5472
|
-
const [selectedIdx, setSelectedIdx] =
|
|
5473
|
-
const result =
|
|
5732
|
+
const [selectedIdx, setSelectedIdx] = useState32(0);
|
|
5733
|
+
const result = useMemo11(() => runDoctor(), []);
|
|
5474
5734
|
const check = result.checks.find((c) => c.name === selectedCheckName);
|
|
5475
5735
|
const backIdx = check ? 1 : 0;
|
|
5476
5736
|
useEffect14(() => {
|
|
5477
5737
|
setSelectedIdx(backIdx);
|
|
5478
5738
|
}, [backIdx]);
|
|
5479
|
-
|
|
5739
|
+
useInput27((_input, key) => {
|
|
5480
5740
|
if (key.escape || key.backspace) {
|
|
5481
5741
|
pop();
|
|
5482
5742
|
return;
|
|
@@ -5490,54 +5750,500 @@ function DoctorCheck() {
|
|
|
5490
5750
|
}
|
|
5491
5751
|
});
|
|
5492
5752
|
if (!check) {
|
|
5493
|
-
return /* @__PURE__ */
|
|
5753
|
+
return /* @__PURE__ */ jsx49(
|
|
5494
5754
|
Frame,
|
|
5495
5755
|
{
|
|
5496
5756
|
breadcrumb: ["ReevesAgents", "Doctor", "Check"],
|
|
5497
5757
|
tagline: "Check not found.",
|
|
5498
|
-
children: /* @__PURE__ */
|
|
5758
|
+
children: /* @__PURE__ */ jsx49(Primary, { children: /* @__PURE__ */ jsx49(Row, { selected: selectedIdx === backIdx, primary: "Back" }) })
|
|
5499
5759
|
}
|
|
5500
5760
|
);
|
|
5501
5761
|
}
|
|
5502
5762
|
const fixHint = findFixHint(check);
|
|
5503
|
-
return /* @__PURE__ */
|
|
5763
|
+
return /* @__PURE__ */ jsx49(
|
|
5504
5764
|
Frame,
|
|
5505
5765
|
{
|
|
5506
5766
|
breadcrumb: ["ReevesAgents", "Doctor", check.name],
|
|
5507
5767
|
meta: [{ label: "status", value: check.status }],
|
|
5508
5768
|
tagline: "Check details and suggested fix.",
|
|
5509
|
-
children: /* @__PURE__ */
|
|
5510
|
-
/* @__PURE__ */
|
|
5511
|
-
/* @__PURE__ */
|
|
5512
|
-
/* @__PURE__ */
|
|
5513
|
-
/* @__PURE__ */
|
|
5769
|
+
children: /* @__PURE__ */ jsxs40(Primary, { children: [
|
|
5770
|
+
/* @__PURE__ */ jsxs40(Box34, { flexDirection: "column", children: [
|
|
5771
|
+
/* @__PURE__ */ jsx49(Row, { selected: false, primary: "Name", trailing: check.name }),
|
|
5772
|
+
/* @__PURE__ */ jsx49(Row, { selected: false, primary: "Status", trailing: check.status, glyph: statusGlyph5(check.status) }),
|
|
5773
|
+
/* @__PURE__ */ jsx49(Row, { selected: false, primary: "Detail", trailing: check.detail })
|
|
5514
5774
|
] }),
|
|
5515
|
-
fixHint && /* @__PURE__ */
|
|
5516
|
-
/* @__PURE__ */
|
|
5517
|
-
/* @__PURE__ */
|
|
5518
|
-
/* @__PURE__ */
|
|
5519
|
-
/* @__PURE__ */
|
|
5520
|
-
/* @__PURE__ */
|
|
5775
|
+
fixHint && /* @__PURE__ */ jsxs40(Fragment15, { children: [
|
|
5776
|
+
/* @__PURE__ */ jsx49(Box34, { marginY: 1 }),
|
|
5777
|
+
/* @__PURE__ */ jsx49(Section, { label: "Fix" }),
|
|
5778
|
+
/* @__PURE__ */ jsxs40(Box34, { marginY: 1, marginLeft: 2, flexDirection: "column", children: [
|
|
5779
|
+
/* @__PURE__ */ jsx49(Text28, { color: colors.text.dim, children: "Suggested fix:" }),
|
|
5780
|
+
/* @__PURE__ */ jsx49(Text28, { color: colors.accent.primary, children: fixHint })
|
|
5521
5781
|
] }),
|
|
5522
|
-
/* @__PURE__ */
|
|
5782
|
+
/* @__PURE__ */ jsx49(SectionEnd, {})
|
|
5523
5783
|
] }),
|
|
5524
|
-
!fixHint && /* @__PURE__ */
|
|
5525
|
-
/* @__PURE__ */
|
|
5526
|
-
/* @__PURE__ */
|
|
5527
|
-
/* @__PURE__ */
|
|
5528
|
-
/* @__PURE__ */
|
|
5784
|
+
!fixHint && /* @__PURE__ */ jsxs40(Fragment15, { children: [
|
|
5785
|
+
/* @__PURE__ */ jsx49(Box34, { marginY: 1 }),
|
|
5786
|
+
/* @__PURE__ */ jsx49(Section, { label: "Fix" }),
|
|
5787
|
+
/* @__PURE__ */ jsx49(Box34, { marginY: 1, marginLeft: 2, children: /* @__PURE__ */ jsx49(Text28, { color: colors.text.dim, children: "No suggested fix. Check the source code or open an issue." }) }),
|
|
5788
|
+
/* @__PURE__ */ jsx49(SectionEnd, {})
|
|
5529
5789
|
] }),
|
|
5530
|
-
/* @__PURE__ */
|
|
5531
|
-
/* @__PURE__ */
|
|
5532
|
-
/* @__PURE__ */
|
|
5533
|
-
/* @__PURE__ */
|
|
5790
|
+
/* @__PURE__ */ jsx49(Box34, { marginY: 1 }),
|
|
5791
|
+
/* @__PURE__ */ jsx49(Section, { label: "Actions" }),
|
|
5792
|
+
/* @__PURE__ */ jsx49(Row, { selected: selectedIdx === backIdx, primary: "Back" }),
|
|
5793
|
+
/* @__PURE__ */ jsx49(SectionEnd, {})
|
|
5794
|
+
] })
|
|
5795
|
+
}
|
|
5796
|
+
);
|
|
5797
|
+
}
|
|
5798
|
+
|
|
5799
|
+
// src/tui/screens/Approvals.tsx
|
|
5800
|
+
import { useEffect as useEffect15, useState as useState33 } from "react";
|
|
5801
|
+
import { Box as Box35, useInput as useInput28 } from "ink";
|
|
5802
|
+
import { jsx as jsx50, jsxs as jsxs41 } from "react/jsx-runtime";
|
|
5803
|
+
var ACTIONS3 = ["Approve", "Deny", "Back", "Main Menu"];
|
|
5804
|
+
var ACTION_COPY3 = {
|
|
5805
|
+
Approve: { label: "Approve", hint: "approve the selected request" },
|
|
5806
|
+
Deny: { label: "Deny", hint: "deny the selected request" },
|
|
5807
|
+
Back: { label: "Back", hint: "return to the previous screen" },
|
|
5808
|
+
"Main Menu": { label: "Main Menu", hint: "settings, doctor, reference, credits" }
|
|
5809
|
+
};
|
|
5810
|
+
var ACTION_LABEL_WIDTH14 = Math.max(...ACTIONS3.map((action) => ACTION_COPY3[action].label.length));
|
|
5811
|
+
function riskBadge(risk) {
|
|
5812
|
+
if (risk === "high") return { label: "high", color: colors.status.error };
|
|
5813
|
+
if (risk === "low") return { label: "low", color: colors.status.ok };
|
|
5814
|
+
return { label: "medium", color: colors.status.warn };
|
|
5815
|
+
}
|
|
5816
|
+
function Approvals() {
|
|
5817
|
+
const { pop, resetStack } = useRouter();
|
|
5818
|
+
const { toast } = useToast();
|
|
5819
|
+
const { t } = useLanguage();
|
|
5820
|
+
const [approvals, setApprovals] = useState33(() => listRunApprovals(void 0, "pending"));
|
|
5821
|
+
const [selectedIdx, setSelectedIdx] = useState33(0);
|
|
5822
|
+
const [selectedApprovalId, setSelectedApprovalId] = useState33(() => approvals[0]?.id ?? null);
|
|
5823
|
+
const [pending, setPending] = useState33(null);
|
|
5824
|
+
useEffect15(() => {
|
|
5825
|
+
const timer = setInterval(() => setApprovals(listRunApprovals(void 0, "pending")), 5e3);
|
|
5826
|
+
return () => clearInterval(timer);
|
|
5827
|
+
}, []);
|
|
5828
|
+
const itemCount = approvals.length + ACTIONS3.length;
|
|
5829
|
+
const clampedIdx = Math.min(Math.max(0, selectedIdx), Math.max(0, itemCount - 1));
|
|
5830
|
+
const onApproval = clampedIdx < approvals.length;
|
|
5831
|
+
const selectedApproval = onApproval ? approvals[clampedIdx] ?? null : null;
|
|
5832
|
+
const selectedAction = onApproval ? null : ACTIONS3[clampedIdx - approvals.length] ?? null;
|
|
5833
|
+
const actionTarget = approvals.find((item) => item.id === selectedApprovalId) ?? approvals[0] ?? null;
|
|
5834
|
+
useEffect15(() => {
|
|
5835
|
+
if (selectedApproval) setSelectedApprovalId(selectedApproval.id);
|
|
5836
|
+
}, [selectedApproval]);
|
|
5837
|
+
function refresh() {
|
|
5838
|
+
const next = listRunApprovals(void 0, "pending");
|
|
5839
|
+
setApprovals(next);
|
|
5840
|
+
setSelectedApprovalId((current) => current && next.some((item) => item.id === current) ? current : next[0]?.id ?? null);
|
|
5841
|
+
}
|
|
5842
|
+
function resolve(approval, decision) {
|
|
5843
|
+
resolveRunApproval(approval.id, decision);
|
|
5844
|
+
setPending(null);
|
|
5845
|
+
refresh();
|
|
5846
|
+
toast(
|
|
5847
|
+
decision === "approved" ? t("approvals.approvedToast", { action: approval.action }) : t("approvals.deniedToast", { action: approval.action }),
|
|
5848
|
+
"info"
|
|
5849
|
+
);
|
|
5850
|
+
}
|
|
5851
|
+
function handleActivate() {
|
|
5852
|
+
if (!selectedAction) return;
|
|
5853
|
+
switch (selectedAction) {
|
|
5854
|
+
case "Approve":
|
|
5855
|
+
if (actionTarget) setPending({ approval: actionTarget, decision: "approved" });
|
|
5856
|
+
break;
|
|
5857
|
+
case "Deny":
|
|
5858
|
+
if (actionTarget) setPending({ approval: actionTarget, decision: "denied" });
|
|
5859
|
+
break;
|
|
5860
|
+
case "Back":
|
|
5861
|
+
pop();
|
|
5862
|
+
break;
|
|
5863
|
+
case "Main Menu":
|
|
5864
|
+
resetStack("Welcome", ["Welcome"]);
|
|
5865
|
+
break;
|
|
5866
|
+
}
|
|
5867
|
+
}
|
|
5868
|
+
useInput28((_input, key) => {
|
|
5869
|
+
if (pending) return;
|
|
5870
|
+
if (key.upArrow) {
|
|
5871
|
+
setSelectedIdx((idx) => Math.max(0, Math.min(idx, itemCount - 1) - 1));
|
|
5872
|
+
return;
|
|
5873
|
+
}
|
|
5874
|
+
if (key.downArrow) {
|
|
5875
|
+
setSelectedIdx((idx) => Math.min(itemCount - 1, idx + 1));
|
|
5876
|
+
return;
|
|
5877
|
+
}
|
|
5878
|
+
if (key.return) {
|
|
5879
|
+
handleActivate();
|
|
5880
|
+
return;
|
|
5881
|
+
}
|
|
5882
|
+
if (key.escape || key.backspace) {
|
|
5883
|
+
pop();
|
|
5884
|
+
return;
|
|
5885
|
+
}
|
|
5886
|
+
});
|
|
5887
|
+
if (pending) {
|
|
5888
|
+
return /* @__PURE__ */ jsx50(Frame, { breadcrumb: ["ReevesAgents", "Approvals"], statusKeys: "\u2190\u2192 switch \xB7 enter select \xB7 esc cancel", children: /* @__PURE__ */ jsx50(
|
|
5889
|
+
Dialog,
|
|
5890
|
+
{
|
|
5891
|
+
title: pending.decision === "approved" ? "Approve this request?" : "Deny this request?",
|
|
5892
|
+
body: pending.approval.summary || pending.approval.action,
|
|
5893
|
+
intent: pending.decision === "denied" ? "danger" : "default",
|
|
5894
|
+
confirmLabel: pending.decision === "approved" ? "Approve" : "Deny",
|
|
5895
|
+
cancelLabel: "Cancel",
|
|
5896
|
+
onConfirm: () => resolve(pending.approval, pending.decision),
|
|
5897
|
+
onCancel: () => setPending(null)
|
|
5898
|
+
}
|
|
5899
|
+
) });
|
|
5900
|
+
}
|
|
5901
|
+
let statusContext = "";
|
|
5902
|
+
if (selectedApproval) {
|
|
5903
|
+
statusContext = `${selectedApproval.action} \xB7 ${selectedApproval.risk} \xB7 ${selectedApproval.summary}`;
|
|
5904
|
+
} else if (selectedAction) {
|
|
5905
|
+
statusContext = (selectedAction === "Approve" || selectedAction === "Deny") && actionTarget ? `${ACTION_COPY3[selectedAction].hint} \xB7 ${actionTarget.action}` : ACTION_COPY3[selectedAction].hint;
|
|
5906
|
+
}
|
|
5907
|
+
return /* @__PURE__ */ jsx50(
|
|
5908
|
+
Frame,
|
|
5909
|
+
{
|
|
5910
|
+
breadcrumb: ["ReevesAgents", "Approvals"],
|
|
5911
|
+
meta: [{ label: "pending", value: String(approvals.length) }],
|
|
5912
|
+
tagline: "Pending approval requests raised by agents. Approve or deny them here.",
|
|
5913
|
+
statusContext,
|
|
5914
|
+
statusKeys: "enter action \xB7 \u2191\u2193 move \xB7 esc back",
|
|
5915
|
+
children: /* @__PURE__ */ jsxs41(Box35, { flexDirection: "column", children: [
|
|
5916
|
+
/* @__PURE__ */ jsx50(Section, { label: "Pending" }),
|
|
5917
|
+
approvals.length === 0 ? /* @__PURE__ */ jsx50(Row, { selected: false, primary: "No pending approvals", trailing: "requests appear here", disabled: true }) : approvals.map((approval, idx) => /* @__PURE__ */ jsx50(
|
|
5918
|
+
Row,
|
|
5919
|
+
{
|
|
5920
|
+
selected: clampedIdx === idx,
|
|
5921
|
+
primary: approval.action,
|
|
5922
|
+
glyph: { char: glyphs.status.warn, color: colors.status.warn },
|
|
5923
|
+
badges: [riskBadge(approval.risk)],
|
|
5924
|
+
hint: approval.summary,
|
|
5925
|
+
trailing: approval.agent_id.slice(0, 8)
|
|
5926
|
+
},
|
|
5927
|
+
approval.id
|
|
5928
|
+
)),
|
|
5929
|
+
/* @__PURE__ */ jsx50(SectionEnd, {}),
|
|
5930
|
+
/* @__PURE__ */ jsx50(Section, { label: "Actions" }),
|
|
5931
|
+
ACTIONS3.map((action, idx) => /* @__PURE__ */ jsx50(
|
|
5932
|
+
Row,
|
|
5933
|
+
{
|
|
5934
|
+
selected: clampedIdx === approvals.length + idx,
|
|
5935
|
+
primary: ACTION_COPY3[action].label,
|
|
5936
|
+
primaryWidth: ACTION_LABEL_WIDTH14,
|
|
5937
|
+
hint: ACTION_COPY3[action].hint,
|
|
5938
|
+
disabled: (action === "Approve" || action === "Deny") && !actionTarget,
|
|
5939
|
+
danger: action === "Deny"
|
|
5940
|
+
},
|
|
5941
|
+
action
|
|
5942
|
+
)),
|
|
5943
|
+
/* @__PURE__ */ jsx50(SectionEnd, {})
|
|
5944
|
+
] })
|
|
5945
|
+
}
|
|
5946
|
+
);
|
|
5947
|
+
}
|
|
5948
|
+
|
|
5949
|
+
// src/tui/screens/Config.tsx
|
|
5950
|
+
import { useState as useState34 } from "react";
|
|
5951
|
+
import { Box as Box36, useInput as useInput29 } from "ink";
|
|
5952
|
+
import { jsx as jsx51, jsxs as jsxs42 } from "react/jsx-runtime";
|
|
5953
|
+
var EDITABLE_FIELDS = CONFIG_FIELDS.filter((field) => field.kind !== "language");
|
|
5954
|
+
function isNumeric(field) {
|
|
5955
|
+
return field.kind === "posint" || field.kind === "nonneg-int";
|
|
5956
|
+
}
|
|
5957
|
+
function Config() {
|
|
5958
|
+
const { pop } = useRouter();
|
|
5959
|
+
const { toast } = useToast();
|
|
5960
|
+
const [global, setGlobal] = useState34(() => loadConfig().global);
|
|
5961
|
+
const [selectedIdx, setSelectedIdx] = useState34(0);
|
|
5962
|
+
const [editingKey, setEditingKey] = useState34(null);
|
|
5963
|
+
const [draft, setDraft] = useState34("");
|
|
5964
|
+
const totalRows = EDITABLE_FIELDS.length + 1;
|
|
5965
|
+
function applyValue(key, value) {
|
|
5966
|
+
try {
|
|
5967
|
+
setGlobal(setConfigValues({ [key]: value }).global);
|
|
5968
|
+
} catch (err) {
|
|
5969
|
+
toast(err instanceof Error ? err.message : String(err), "error");
|
|
5970
|
+
}
|
|
5971
|
+
}
|
|
5972
|
+
function commitEdit(field) {
|
|
5973
|
+
setEditingKey(null);
|
|
5974
|
+
try {
|
|
5975
|
+
applyValue(field.key, parseConfigValue(field.key, draft));
|
|
5976
|
+
} catch (err) {
|
|
5977
|
+
toast(err instanceof Error ? err.message : String(err), "error");
|
|
5978
|
+
}
|
|
5979
|
+
}
|
|
5980
|
+
useInput29((_input, key) => {
|
|
5981
|
+
if (editingKey) return;
|
|
5982
|
+
if (key.escape || key.backspace) {
|
|
5983
|
+
pop();
|
|
5984
|
+
return;
|
|
5985
|
+
}
|
|
5986
|
+
if (key.upArrow) {
|
|
5987
|
+
setSelectedIdx((i) => Math.max(0, i - 1));
|
|
5988
|
+
return;
|
|
5989
|
+
}
|
|
5990
|
+
if (key.downArrow) {
|
|
5991
|
+
setSelectedIdx((i) => Math.min(totalRows - 1, i + 1));
|
|
5992
|
+
return;
|
|
5993
|
+
}
|
|
5994
|
+
if (selectedIdx >= EDITABLE_FIELDS.length) {
|
|
5995
|
+
if (key.return) pop();
|
|
5996
|
+
return;
|
|
5997
|
+
}
|
|
5998
|
+
const field = EDITABLE_FIELDS[selectedIdx];
|
|
5999
|
+
if (field.kind === "permissions") {
|
|
6000
|
+
if (key.leftArrow || key.rightArrow || key.return) {
|
|
6001
|
+
applyValue(field.key, global[field.key] === "ask" ? "skip" : "ask");
|
|
6002
|
+
}
|
|
6003
|
+
return;
|
|
6004
|
+
}
|
|
6005
|
+
if (key.return && isNumeric(field)) {
|
|
6006
|
+
setDraft(String(global[field.key]));
|
|
6007
|
+
setEditingKey(field.key);
|
|
6008
|
+
}
|
|
6009
|
+
});
|
|
6010
|
+
return /* @__PURE__ */ jsx51(
|
|
6011
|
+
Frame,
|
|
6012
|
+
{
|
|
6013
|
+
breadcrumb: ["ReevesAgents", "Settings", "Config"],
|
|
6014
|
+
tagline: "Edit global settings. Numbers edit inline; permissions cycle.",
|
|
6015
|
+
statusKeys: "enter edit/cycle \xB7 \u2190\u2192 cycle \xB7 esc back",
|
|
6016
|
+
children: /* @__PURE__ */ jsxs42(Box36, { flexDirection: "column", children: [
|
|
6017
|
+
/* @__PURE__ */ jsx51(Section, { label: "Config" }),
|
|
6018
|
+
EDITABLE_FIELDS.map((field, idx) => {
|
|
6019
|
+
const value = global[field.key];
|
|
6020
|
+
if (isNumeric(field)) {
|
|
6021
|
+
return /* @__PURE__ */ jsx51(
|
|
6022
|
+
TextField,
|
|
6023
|
+
{
|
|
6024
|
+
label: field.label,
|
|
6025
|
+
value: editingKey === field.key ? draft : String(value),
|
|
6026
|
+
helpText: "enter edit \xB7 esc cancel",
|
|
6027
|
+
required: false,
|
|
6028
|
+
selected: selectedIdx === idx,
|
|
6029
|
+
editing: editingKey === field.key,
|
|
6030
|
+
onChange: setDraft,
|
|
6031
|
+
onCommit: () => commitEdit(field),
|
|
6032
|
+
onCancel: () => setEditingKey(null)
|
|
6033
|
+
},
|
|
6034
|
+
field.key
|
|
6035
|
+
);
|
|
6036
|
+
}
|
|
6037
|
+
return /* @__PURE__ */ jsx51(
|
|
6038
|
+
Row,
|
|
6039
|
+
{
|
|
6040
|
+
selected: selectedIdx === idx,
|
|
6041
|
+
primary: field.label,
|
|
6042
|
+
trailing: `\u2039 ${String(value)} \u203A`,
|
|
6043
|
+
hint: selectedIdx === idx ? "\u2190 \u2192 cycle" : void 0
|
|
6044
|
+
},
|
|
6045
|
+
field.key
|
|
6046
|
+
);
|
|
6047
|
+
}),
|
|
6048
|
+
/* @__PURE__ */ jsx51(SectionEnd, {}),
|
|
6049
|
+
/* @__PURE__ */ jsx51(Section, { label: "Actions" }),
|
|
6050
|
+
/* @__PURE__ */ jsx51(Row, { selected: selectedIdx === EDITABLE_FIELDS.length, primary: "Back", hint: "return to settings" }),
|
|
6051
|
+
/* @__PURE__ */ jsx51(SectionEnd, {})
|
|
5534
6052
|
] })
|
|
5535
6053
|
}
|
|
5536
6054
|
);
|
|
5537
6055
|
}
|
|
5538
6056
|
|
|
5539
|
-
// src/
|
|
5540
|
-
import {
|
|
6057
|
+
// src/tui/screens/Presets.tsx
|
|
6058
|
+
import { useEffect as useEffect16, useState as useState35 } from "react";
|
|
6059
|
+
import { Box as Box37, useInput as useInput30 } from "ink";
|
|
6060
|
+
import { jsx as jsx52, jsxs as jsxs43 } from "react/jsx-runtime";
|
|
6061
|
+
var ACTIONS4 = ["Start", "SaveCurrentRun", "Delete", "Back", "Main Menu"];
|
|
6062
|
+
var ACTION_COPY4 = {
|
|
6063
|
+
Start: { label: "Start", hint: "launch a run from the selected preset" },
|
|
6064
|
+
SaveCurrentRun: { label: "Save Current Run", hint: "save the active run as a preset" },
|
|
6065
|
+
Delete: { label: "Delete", hint: "delete the selected preset" },
|
|
6066
|
+
Back: { label: "Back", hint: "return" },
|
|
6067
|
+
"Main Menu": { label: "Main Menu", hint: "return to the main menu" }
|
|
6068
|
+
};
|
|
6069
|
+
var ACTION_LABEL_WIDTH15 = Math.max(...ACTIONS4.map((action) => ACTION_COPY4[action].label.length));
|
|
6070
|
+
function Presets() {
|
|
6071
|
+
const { pop, resetStack, selectedRunId, setSelectedRunId } = useRouter();
|
|
6072
|
+
const { toast } = useToast();
|
|
6073
|
+
const { t } = useLanguage();
|
|
6074
|
+
const [presets, setPresets] = useState35(() => listPresets());
|
|
6075
|
+
const [selectedIdx, setSelectedIdx] = useState35(0);
|
|
6076
|
+
const [actOnName, setActOnName] = useState35(() => presets[0]?.name ?? null);
|
|
6077
|
+
const [pendingDelete, setPendingDelete] = useState35(null);
|
|
6078
|
+
const [saving, setSaving] = useState35(false);
|
|
6079
|
+
const [draftName, setDraftName] = useState35("");
|
|
6080
|
+
const total = presets.length + ACTIONS4.length;
|
|
6081
|
+
const clampedIdx = Math.min(selectedIdx, Math.max(0, total - 1));
|
|
6082
|
+
const onPreset = clampedIdx < presets.length;
|
|
6083
|
+
const targetPreset = onPreset ? presets[clampedIdx] : presets.find((preset) => preset.name === actOnName) ?? presets[0] ?? null;
|
|
6084
|
+
useEffect16(() => {
|
|
6085
|
+
if (onPreset && presets[clampedIdx]) setActOnName(presets[clampedIdx].name);
|
|
6086
|
+
}, [onPreset, clampedIdx, presets]);
|
|
6087
|
+
function refresh() {
|
|
6088
|
+
const next = listPresets();
|
|
6089
|
+
setPresets(next);
|
|
6090
|
+
setActOnName((current) => current && next.some((p) => p.name === current) ? current : next[0]?.name ?? null);
|
|
6091
|
+
}
|
|
6092
|
+
function confirmDelete(preset) {
|
|
6093
|
+
deletePreset(preset.name);
|
|
6094
|
+
setPendingDelete(null);
|
|
6095
|
+
refresh();
|
|
6096
|
+
toast(t("presets.deletedToast", { name: preset.name }), "info");
|
|
6097
|
+
}
|
|
6098
|
+
function commitSave() {
|
|
6099
|
+
setSaving(false);
|
|
6100
|
+
if (!selectedRunId) return;
|
|
6101
|
+
try {
|
|
6102
|
+
const preset = savePresetFromRun(selectedRunId, draftName);
|
|
6103
|
+
refresh();
|
|
6104
|
+
toast(t("presets.savedToast", { name: preset.name }), "info");
|
|
6105
|
+
} catch (err) {
|
|
6106
|
+
toast(err instanceof Error ? err.message : String(err), "error");
|
|
6107
|
+
}
|
|
6108
|
+
}
|
|
6109
|
+
function handleAction(action) {
|
|
6110
|
+
if (action === "Back") {
|
|
6111
|
+
pop();
|
|
6112
|
+
return;
|
|
6113
|
+
}
|
|
6114
|
+
if (action === "Main Menu") {
|
|
6115
|
+
resetStack("Welcome", ["Welcome"]);
|
|
6116
|
+
return;
|
|
6117
|
+
}
|
|
6118
|
+
if (action === "Start") {
|
|
6119
|
+
if (!targetPreset) {
|
|
6120
|
+
toast(t("presets.noStartTarget"), "error");
|
|
6121
|
+
return;
|
|
6122
|
+
}
|
|
6123
|
+
try {
|
|
6124
|
+
const result = startRunFromPreset(targetPreset.name);
|
|
6125
|
+
setSelectedRunId(result.run.id);
|
|
6126
|
+
resetStack("Run");
|
|
6127
|
+
} catch (err) {
|
|
6128
|
+
toast(err instanceof Error ? err.message : String(err), "error");
|
|
6129
|
+
}
|
|
6130
|
+
return;
|
|
6131
|
+
}
|
|
6132
|
+
if (action === "Delete") {
|
|
6133
|
+
if (targetPreset) setPendingDelete(targetPreset);
|
|
6134
|
+
return;
|
|
6135
|
+
}
|
|
6136
|
+
if (action === "SaveCurrentRun") {
|
|
6137
|
+
if (!selectedRunId) {
|
|
6138
|
+
toast(t("presets.openRunFirst"), "error");
|
|
6139
|
+
return;
|
|
6140
|
+
}
|
|
6141
|
+
setDraftName("");
|
|
6142
|
+
setSaving(true);
|
|
6143
|
+
}
|
|
6144
|
+
}
|
|
6145
|
+
useInput30((_input, key) => {
|
|
6146
|
+
if (saving) return;
|
|
6147
|
+
if (key.upArrow) {
|
|
6148
|
+
setSelectedIdx(() => Math.max(0, clampedIdx - 1));
|
|
6149
|
+
return;
|
|
6150
|
+
}
|
|
6151
|
+
if (key.downArrow) {
|
|
6152
|
+
setSelectedIdx(() => Math.min(total - 1, clampedIdx + 1));
|
|
6153
|
+
return;
|
|
6154
|
+
}
|
|
6155
|
+
if (key.escape || key.backspace) {
|
|
6156
|
+
pop();
|
|
6157
|
+
return;
|
|
6158
|
+
}
|
|
6159
|
+
if (key.return) {
|
|
6160
|
+
if (onPreset) handleAction("Start");
|
|
6161
|
+
else handleAction(ACTIONS4[clampedIdx - presets.length]);
|
|
6162
|
+
}
|
|
6163
|
+
});
|
|
6164
|
+
if (saving) {
|
|
6165
|
+
return /* @__PURE__ */ jsx52(
|
|
6166
|
+
Frame,
|
|
6167
|
+
{
|
|
6168
|
+
breadcrumb: ["ReevesAgents", "Presets", "Save"],
|
|
6169
|
+
tagline: "Name the preset captured from the current run.",
|
|
6170
|
+
statusKeys: "enter save \xB7 esc cancel",
|
|
6171
|
+
children: /* @__PURE__ */ jsxs43(Box37, { flexDirection: "column", children: [
|
|
6172
|
+
/* @__PURE__ */ jsx52(Section, { label: "Save Current Run as Preset" }),
|
|
6173
|
+
/* @__PURE__ */ jsx52(
|
|
6174
|
+
TextField,
|
|
6175
|
+
{
|
|
6176
|
+
label: "Preset name",
|
|
6177
|
+
value: draftName,
|
|
6178
|
+
helpText: "letters, digits, dashes \xB7 enter save \xB7 esc cancel",
|
|
6179
|
+
required: true,
|
|
6180
|
+
selected: true,
|
|
6181
|
+
editing: true,
|
|
6182
|
+
onChange: setDraftName,
|
|
6183
|
+
onCommit: commitSave,
|
|
6184
|
+
onCancel: () => setSaving(false)
|
|
6185
|
+
}
|
|
6186
|
+
),
|
|
6187
|
+
/* @__PURE__ */ jsx52(SectionEnd, {})
|
|
6188
|
+
] })
|
|
6189
|
+
}
|
|
6190
|
+
);
|
|
6191
|
+
}
|
|
6192
|
+
if (pendingDelete) {
|
|
6193
|
+
return /* @__PURE__ */ jsx52(Frame, { breadcrumb: ["ReevesAgents", "Presets"], statusKeys: "enter select \xB7 esc cancel", children: /* @__PURE__ */ jsx52(
|
|
6194
|
+
Dialog,
|
|
6195
|
+
{
|
|
6196
|
+
title: t("presets.deleteTitle", { name: pendingDelete.name }),
|
|
6197
|
+
body: "This removes the saved preset. Running runs are not affected.",
|
|
6198
|
+
intent: "danger",
|
|
6199
|
+
confirmLabel: "Delete",
|
|
6200
|
+
cancelLabel: "Cancel",
|
|
6201
|
+
onConfirm: () => confirmDelete(pendingDelete),
|
|
6202
|
+
onCancel: () => setPendingDelete(null)
|
|
6203
|
+
}
|
|
6204
|
+
) });
|
|
6205
|
+
}
|
|
6206
|
+
return /* @__PURE__ */ jsx52(
|
|
6207
|
+
Frame,
|
|
6208
|
+
{
|
|
6209
|
+
breadcrumb: ["ReevesAgents", "Presets"],
|
|
6210
|
+
meta: [{ label: "presets", value: String(presets.length) }],
|
|
6211
|
+
tagline: "Saved agent-team templates. Start one, save the current run, or delete.",
|
|
6212
|
+
statusKeys: "enter start/select \xB7 \u2191\u2193 move \xB7 esc back",
|
|
6213
|
+
children: /* @__PURE__ */ jsxs43(Box37, { flexDirection: "column", children: [
|
|
6214
|
+
/* @__PURE__ */ jsx52(Section, { label: "Presets" }),
|
|
6215
|
+
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(
|
|
6216
|
+
Row,
|
|
6217
|
+
{
|
|
6218
|
+
selected: clampedIdx === idx,
|
|
6219
|
+
primary: preset.name,
|
|
6220
|
+
hint: `${1 + preset.workers.length} agents`,
|
|
6221
|
+
trailing: preset.description || void 0
|
|
6222
|
+
},
|
|
6223
|
+
preset.name
|
|
6224
|
+
)),
|
|
6225
|
+
/* @__PURE__ */ jsx52(SectionEnd, {}),
|
|
6226
|
+
/* @__PURE__ */ jsx52(Section, { label: "Actions" }),
|
|
6227
|
+
ACTIONS4.map((action, idx) => /* @__PURE__ */ jsx52(
|
|
6228
|
+
Row,
|
|
6229
|
+
{
|
|
6230
|
+
selected: clampedIdx === presets.length + idx,
|
|
6231
|
+
primary: ACTION_COPY4[action].label,
|
|
6232
|
+
primaryWidth: ACTION_LABEL_WIDTH15,
|
|
6233
|
+
hint: ACTION_COPY4[action].hint,
|
|
6234
|
+
disabled: action === "Start" || action === "Delete" ? presets.length === 0 : action === "SaveCurrentRun" ? !selectedRunId : false,
|
|
6235
|
+
danger: action === "Delete"
|
|
6236
|
+
},
|
|
6237
|
+
action
|
|
6238
|
+
)),
|
|
6239
|
+
/* @__PURE__ */ jsx52(SectionEnd, {})
|
|
6240
|
+
] })
|
|
6241
|
+
}
|
|
6242
|
+
);
|
|
6243
|
+
}
|
|
6244
|
+
|
|
6245
|
+
// src/tui/router.tsx
|
|
6246
|
+
import { jsx as jsx53 } from "react/jsx-runtime";
|
|
5541
6247
|
var RouterContext = createContext6(null);
|
|
5542
6248
|
function useRouter() {
|
|
5543
6249
|
const ctx = useContext6(RouterContext);
|
|
@@ -5550,57 +6256,65 @@ function normalizeScreen(screen) {
|
|
|
5550
6256
|
function renderScreen(screen) {
|
|
5551
6257
|
switch (normalizeScreen(screen)) {
|
|
5552
6258
|
case "LanguageSelect":
|
|
5553
|
-
return /* @__PURE__ */
|
|
6259
|
+
return /* @__PURE__ */ jsx53(LanguageSelect, {});
|
|
5554
6260
|
case "Welcome":
|
|
5555
|
-
return /* @__PURE__ */
|
|
6261
|
+
return /* @__PURE__ */ jsx53(Welcome, {});
|
|
5556
6262
|
case "Runs":
|
|
5557
|
-
return /* @__PURE__ */
|
|
6263
|
+
return /* @__PURE__ */ jsx53(Runs, {});
|
|
5558
6264
|
case "RunHistory":
|
|
5559
|
-
return /* @__PURE__ */
|
|
6265
|
+
return /* @__PURE__ */ jsx53(RunHistory, {});
|
|
5560
6266
|
case "Run":
|
|
5561
|
-
return /* @__PURE__ */
|
|
6267
|
+
return /* @__PURE__ */ jsx53(Run, {});
|
|
5562
6268
|
case "RunAgents":
|
|
5563
|
-
return /* @__PURE__ */
|
|
6269
|
+
return /* @__PURE__ */ jsx53(RunAgents, {});
|
|
5564
6270
|
case "RunOutput":
|
|
5565
|
-
return /* @__PURE__ */
|
|
6271
|
+
return /* @__PURE__ */ jsx53(RunOutput, {});
|
|
5566
6272
|
case "RunStop":
|
|
5567
|
-
return /* @__PURE__ */
|
|
6273
|
+
return /* @__PURE__ */ jsx53(RunStop, {});
|
|
5568
6274
|
case "AgentDetail":
|
|
5569
|
-
return /* @__PURE__ */
|
|
6275
|
+
return /* @__PURE__ */ jsx53(AgentDetail, {});
|
|
5570
6276
|
case "AgentOutput":
|
|
5571
|
-
return /* @__PURE__ */
|
|
6277
|
+
return /* @__PURE__ */ jsx53(AgentOutput, {});
|
|
5572
6278
|
case "AgentTask":
|
|
5573
|
-
return /* @__PURE__ */
|
|
6279
|
+
return /* @__PURE__ */ jsx53(AgentTask, {});
|
|
5574
6280
|
case "AgentKill":
|
|
5575
|
-
return /* @__PURE__ */
|
|
6281
|
+
return /* @__PURE__ */ jsx53(AgentKill, {});
|
|
5576
6282
|
case "NewRun":
|
|
5577
|
-
return /* @__PURE__ */
|
|
6283
|
+
return /* @__PURE__ */ jsx53(NewRun, {});
|
|
5578
6284
|
case "NewRunBasics":
|
|
5579
|
-
return /* @__PURE__ */
|
|
6285
|
+
return /* @__PURE__ */ jsx53(NewRunBasics, {});
|
|
5580
6286
|
case "NewRunRoot":
|
|
5581
|
-
return /* @__PURE__ */
|
|
6287
|
+
return /* @__PURE__ */ jsx53(NewRunRoot, {});
|
|
5582
6288
|
case "NewRunWorkers":
|
|
5583
|
-
return /* @__PURE__ */
|
|
6289
|
+
return /* @__PURE__ */ jsx53(NewRunWorkers, {});
|
|
5584
6290
|
case "NewRunWorker":
|
|
5585
|
-
return /* @__PURE__ */
|
|
6291
|
+
return /* @__PURE__ */ jsx53(NewRunWorker, {});
|
|
5586
6292
|
case "NewRunReview":
|
|
5587
|
-
return /* @__PURE__ */
|
|
6293
|
+
return /* @__PURE__ */ jsx53(NewRunReview, {});
|
|
5588
6294
|
case "NewRunStarting":
|
|
5589
|
-
return /* @__PURE__ */
|
|
6295
|
+
return /* @__PURE__ */ jsx53(NewRunStarting, {});
|
|
5590
6296
|
case "AddWorker":
|
|
5591
|
-
return /* @__PURE__ */
|
|
6297
|
+
return /* @__PURE__ */ jsx53(AddWorker, {});
|
|
5592
6298
|
case "Settings":
|
|
5593
|
-
return /* @__PURE__ */
|
|
6299
|
+
return /* @__PURE__ */ jsx53(Settings, {});
|
|
6300
|
+
case "AgentControl":
|
|
6301
|
+
return /* @__PURE__ */ jsx53(AgentControl, {});
|
|
5594
6302
|
case "Reference":
|
|
5595
|
-
return /* @__PURE__ */
|
|
6303
|
+
return /* @__PURE__ */ jsx53(Reference, {});
|
|
5596
6304
|
case "Credits":
|
|
5597
|
-
return /* @__PURE__ */
|
|
6305
|
+
return /* @__PURE__ */ jsx53(Credits, {});
|
|
5598
6306
|
case "Doctor":
|
|
5599
|
-
return /* @__PURE__ */
|
|
6307
|
+
return /* @__PURE__ */ jsx53(Doctor, {});
|
|
5600
6308
|
case "DoctorCheck":
|
|
5601
|
-
return /* @__PURE__ */
|
|
6309
|
+
return /* @__PURE__ */ jsx53(DoctorCheck, {});
|
|
6310
|
+
case "Approvals":
|
|
6311
|
+
return /* @__PURE__ */ jsx53(Approvals, {});
|
|
6312
|
+
case "Config":
|
|
6313
|
+
return /* @__PURE__ */ jsx53(Config, {});
|
|
6314
|
+
case "Presets":
|
|
6315
|
+
return /* @__PURE__ */ jsx53(Presets, {});
|
|
5602
6316
|
default:
|
|
5603
|
-
return /* @__PURE__ */
|
|
6317
|
+
return /* @__PURE__ */ jsx53(Runs, {});
|
|
5604
6318
|
}
|
|
5605
6319
|
}
|
|
5606
6320
|
function nextHistoryOnPush(prev, screen) {
|
|
@@ -5623,16 +6337,16 @@ function Router({ initialScreen } = {}) {
|
|
|
5623
6337
|
const { exit } = useApp3();
|
|
5624
6338
|
const envRunId = process.env.REEVES_RUN_ID ?? null;
|
|
5625
6339
|
const openTokenRef = useRef4(readTuiOpenToken());
|
|
5626
|
-
const [selectedRunId, setSelectedRunId] =
|
|
5627
|
-
const [selectedAgentId, setSelectedAgentId] =
|
|
5628
|
-
const [selectedCheckName, setSelectedCheckName] =
|
|
5629
|
-
const [selectedWorkerIdx, setSelectedWorkerIdx] =
|
|
6340
|
+
const [selectedRunId, setSelectedRunId] = useState36(envRunId);
|
|
6341
|
+
const [selectedAgentId, setSelectedAgentId] = useState36(null);
|
|
6342
|
+
const [selectedCheckName, setSelectedCheckName] = useState36(null);
|
|
6343
|
+
const [selectedWorkerIdx, setSelectedWorkerIdx] = useState36(null);
|
|
5630
6344
|
const firstRunNeedsLanguage = !initialScreen && !configExists();
|
|
5631
|
-
const [history, setHistory] =
|
|
6345
|
+
const [history, setHistory] = useState36(() => ({
|
|
5632
6346
|
entries: [initialScreen ? normalizeScreen(initialScreen) : firstRunNeedsLanguage ? "LanguageSelect" : "Welcome"],
|
|
5633
6347
|
index: 0
|
|
5634
6348
|
}));
|
|
5635
|
-
|
|
6349
|
+
useEffect17(() => {
|
|
5636
6350
|
if (initialScreen) return;
|
|
5637
6351
|
const timer = setInterval(() => {
|
|
5638
6352
|
const token = readTuiOpenToken();
|
|
@@ -5671,7 +6385,7 @@ function Router({ initialScreen } = {}) {
|
|
|
5671
6385
|
const current = normalizeScreen(history.entries[history.index] ?? "Runs");
|
|
5672
6386
|
const canBack = history.index > 0;
|
|
5673
6387
|
const canForward = history.index < history.entries.length - 1;
|
|
5674
|
-
return /* @__PURE__ */
|
|
6388
|
+
return /* @__PURE__ */ jsx53(RouterContext.Provider, { value: {
|
|
5675
6389
|
screen: current,
|
|
5676
6390
|
push,
|
|
5677
6391
|
pop,
|
|
@@ -5688,7 +6402,7 @@ function Router({ initialScreen } = {}) {
|
|
|
5688
6402
|
setSelectedWorkerIdx,
|
|
5689
6403
|
canBack,
|
|
5690
6404
|
canForward
|
|
5691
|
-
}, children: /* @__PURE__ */
|
|
6405
|
+
}, children: /* @__PURE__ */ jsx53(LanguageProvider, { children: /* @__PURE__ */ jsx53(WizardProvider, { children: /* @__PURE__ */ jsx53(WorkerDraftProvider, { children: /* @__PURE__ */ jsx53(ToastProvider, { children: /* @__PURE__ */ jsx53(ErrorBoundary, { children: renderScreen(current) }) }) }) }) }) });
|
|
5692
6406
|
}
|
|
5693
6407
|
export {
|
|
5694
6408
|
Router,
|
|
@@ -5697,4 +6411,4 @@ export {
|
|
|
5697
6411
|
nextHistoryOnReset,
|
|
5698
6412
|
useRouter
|
|
5699
6413
|
};
|
|
5700
|
-
//# sourceMappingURL=router-
|
|
6414
|
+
//# sourceMappingURL=router-I4WDR7CD.js.map
|