@drisp/cli 0.4.0 → 0.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{WorkflowInstallWizard-5JWVHIVJ.js → WorkflowInstallWizard-NDWLVIFI.js} +5 -3
- package/dist/athena-gateway.js +27 -113
- package/dist/chunk-2HR7FV3M.js +502 -0
- package/dist/{chunk-3FVULBV4.js → chunk-4CRZXLIP.js} +53 -117
- package/dist/chunk-6TJHAUNB.js +161 -0
- package/dist/{chunk-PSD3WBN4.js → chunk-BTKQ67RE.js} +1 -1
- package/dist/{chunk-LPG5WBPV.js → chunk-GE6PPB6Z.js} +11 -511
- package/dist/chunk-HXBCZAP7.js +1 -0
- package/dist/chunk-WHELLVBL.js +12361 -0
- package/dist/cli.js +3232 -13774
- package/dist/dashboard-daemon.js +255 -0
- package/dist/hook-forwarder.js +2 -1
- package/package.json +3 -2
|
@@ -1,311 +1,3 @@
|
|
|
1
|
-
// src/ui/theme/themes.ts
|
|
2
|
-
var darkTheme = {
|
|
3
|
-
name: "dark",
|
|
4
|
-
// ── Text hierarchy ──────────────────────────────────────
|
|
5
|
-
text: "#c9d1d9",
|
|
6
|
-
// Primary text. Warm gray, not pure white.
|
|
7
|
-
textMuted: "#848d97",
|
|
8
|
-
// Dim text. Bumped from #6e7681 for AA compliance (~4.8:1).
|
|
9
|
-
textInverse: "#0d1117",
|
|
10
|
-
// Text on colored backgrounds.
|
|
11
|
-
// ── Accent ──────────────────────────────────────────────
|
|
12
|
-
border: "#2d333b",
|
|
13
|
-
// Bumped from #1e2a38 for visibility (~2.2:1 vs bg).
|
|
14
|
-
accent: "#58a6ff",
|
|
15
|
-
// Blue. Focus bar, branding, selection, links.
|
|
16
|
-
accentSecondary: "#bc8cff",
|
|
17
|
-
// Soft purple. Permission events.
|
|
18
|
-
// ── Status ──────────────────────────────────────────────
|
|
19
|
-
status: {
|
|
20
|
-
success: "#3fb950",
|
|
21
|
-
// Green. Completion, done glyphs.
|
|
22
|
-
error: "#f85149",
|
|
23
|
-
// Red. Failures, blocks, Tool Fail.
|
|
24
|
-
warning: "#d29922",
|
|
25
|
-
// Amber. Active stage, zero-result tint, caution.
|
|
26
|
-
info: "#58a6ff",
|
|
27
|
-
// Blue. Agent messages, Run OK.
|
|
28
|
-
working: "#d29922",
|
|
29
|
-
// Amber. Spinner state (same as warning).
|
|
30
|
-
neutral: "#9da5ae"
|
|
31
|
-
// Mid gray. Bumped from #8b949e for AA (~4.8:1).
|
|
32
|
-
},
|
|
33
|
-
// ── Context bar ─────────────────────────────────────────
|
|
34
|
-
contextBar: {
|
|
35
|
-
track: "#1e2a38",
|
|
36
|
-
// Empty segment track.
|
|
37
|
-
low: "#3fb950",
|
|
38
|
-
// Green. 0–50% budget used.
|
|
39
|
-
medium: "#d29922",
|
|
40
|
-
// Amber. 50–80% budget used.
|
|
41
|
-
high: "#f85149"
|
|
42
|
-
// Red. 80–100% budget used.
|
|
43
|
-
},
|
|
44
|
-
// ── Dialog borders ──────────────────────────────────────
|
|
45
|
-
dialog: {
|
|
46
|
-
borderPermission: "#d29922",
|
|
47
|
-
// Amber border for permission prompts.
|
|
48
|
-
borderQuestion: "#58a6ff"
|
|
49
|
-
// Blue border for question prompts.
|
|
50
|
-
},
|
|
51
|
-
// ── Input ───────────────────────────────────────────────
|
|
52
|
-
inputPrompt: "#388bfd",
|
|
53
|
-
// Blue "input" keyword in prompt.
|
|
54
|
-
inputChevron: "#484f58",
|
|
55
|
-
// Bumped from #30363d for visibility (~2.8:1).
|
|
56
|
-
inputBackground: "#141a21",
|
|
57
|
-
// Slight lift so the input row reads as its own surface.
|
|
58
|
-
// ── Feed ────────────────────────────────────────────────
|
|
59
|
-
feed: {
|
|
60
|
-
headerLabel: "#848d97",
|
|
61
|
-
// Matches textMuted.
|
|
62
|
-
stripeBackground: "#161b22",
|
|
63
|
-
// Bumped from #0d1521 for visible alternation.
|
|
64
|
-
focusBackground: "#1b2a3f"
|
|
65
|
-
// Blue tint for focused row.
|
|
66
|
-
},
|
|
67
|
-
// ── User messages ───────────────────────────────────────
|
|
68
|
-
userMessage: {
|
|
69
|
-
text: "#6e7681",
|
|
70
|
-
// Dimmed text for user messages in the message panel.
|
|
71
|
-
background: "#151d2b",
|
|
72
|
-
// Blue-tinted lift — differentiates user turns from agent.
|
|
73
|
-
border: "#30363d",
|
|
74
|
-
// Subtle border.
|
|
75
|
-
agentBorder: "#2a4a6a",
|
|
76
|
-
// Steel blue left border for agent messages.
|
|
77
|
-
focusBorder: "#58a6ff"
|
|
78
|
-
// Accent blue for focused message indicator.
|
|
79
|
-
},
|
|
80
|
-
// ── Badges ──────────────────────────────────────────────
|
|
81
|
-
badge: {
|
|
82
|
-
error: { bg: "#4b1014", fg: "#ff7b72" },
|
|
83
|
-
running: { bg: "#4a3a0c", fg: "#fbbf24" },
|
|
84
|
-
idle: { bg: "#10321d", fg: "#3fb950" },
|
|
85
|
-
search: { bg: "#1b2a3f" },
|
|
86
|
-
command: { bg: "#2a1b3f" }
|
|
87
|
-
},
|
|
88
|
-
// ── Detail view ─────────────────────────────────────────
|
|
89
|
-
detail: {
|
|
90
|
-
title: "#c9d1d9",
|
|
91
|
-
subject: "#58a6ff"
|
|
92
|
-
},
|
|
93
|
-
// ── Tool pills ──────────────────────────────────────────
|
|
94
|
-
toolPill: {
|
|
95
|
-
safe: { bg: "#0e2233", fg: "#5ba3cc" },
|
|
96
|
-
mutating: { bg: "#2a1d0a", fg: "#d4a44a" },
|
|
97
|
-
browser: { bg: "#0b2625", fg: "#5cc4ba" },
|
|
98
|
-
neutral: { bg: "#141a22", fg: "#7d8590" },
|
|
99
|
-
skill: { bg: "#2a0f24", fg: "#c98ab8" },
|
|
100
|
-
"subagent.spawn": { bg: "#0a2e22", fg: "#5cc4a0" },
|
|
101
|
-
"subagent.return": { bg: "#0a2e22", fg: "#56b492" }
|
|
102
|
-
}
|
|
103
|
-
};
|
|
104
|
-
var lightTheme = {
|
|
105
|
-
name: "light",
|
|
106
|
-
// ── Text hierarchy ──────────────────────────────────────
|
|
107
|
-
text: "#1f2328",
|
|
108
|
-
// Near-black. Strong contrast.
|
|
109
|
-
textMuted: "#656d76",
|
|
110
|
-
// Medium gray. Same role as dark textMuted.
|
|
111
|
-
textInverse: "#ffffff",
|
|
112
|
-
// White on colored backgrounds.
|
|
113
|
-
// ── Accent ──────────────────────────────────────────────
|
|
114
|
-
border: "#8c959f",
|
|
115
|
-
// Darker neutral border so frame lines stay visible on white.
|
|
116
|
-
accent: "#0969da",
|
|
117
|
-
// Darker blue for light backgrounds.
|
|
118
|
-
accentSecondary: "#8250df",
|
|
119
|
-
// Purple, darkened for readability.
|
|
120
|
-
// ── Status ──────────────────────────────────────────────
|
|
121
|
-
status: {
|
|
122
|
-
success: "#1a7f37",
|
|
123
|
-
// Dark green. Readable on white.
|
|
124
|
-
error: "#cf222e",
|
|
125
|
-
// Dark red.
|
|
126
|
-
warning: "#9a6700",
|
|
127
|
-
// Dark amber.
|
|
128
|
-
info: "#0969da",
|
|
129
|
-
// Dark blue. Matches accent.
|
|
130
|
-
working: "#9a6700",
|
|
131
|
-
// Dark amber.
|
|
132
|
-
neutral: "#656d76"
|
|
133
|
-
// Mid gray.
|
|
134
|
-
},
|
|
135
|
-
// ── Context bar ─────────────────────────────────────────
|
|
136
|
-
contextBar: {
|
|
137
|
-
track: "#d0d7de",
|
|
138
|
-
// Light gray track.
|
|
139
|
-
low: "#1a7f37",
|
|
140
|
-
medium: "#9a6700",
|
|
141
|
-
high: "#cf222e"
|
|
142
|
-
},
|
|
143
|
-
// ── Dialog borders ──────────────────────────────────────
|
|
144
|
-
dialog: {
|
|
145
|
-
borderPermission: "#9a6700",
|
|
146
|
-
borderQuestion: "#0969da"
|
|
147
|
-
},
|
|
148
|
-
// ── Input ───────────────────────────────────────────────
|
|
149
|
-
inputPrompt: "#0969da",
|
|
150
|
-
inputChevron: "#656d76",
|
|
151
|
-
inputBackground: "#f3f6f9",
|
|
152
|
-
// ── Feed ────────────────────────────────────────────────
|
|
153
|
-
feed: {
|
|
154
|
-
headerLabel: "#656d76",
|
|
155
|
-
stripeBackground: "#f6f8fa",
|
|
156
|
-
focusBackground: "#ddf4ff"
|
|
157
|
-
// Light blue tint for focused row.
|
|
158
|
-
},
|
|
159
|
-
// ── User messages ───────────────────────────────────────
|
|
160
|
-
userMessage: {
|
|
161
|
-
text: "#8b949e",
|
|
162
|
-
// Dimmed text for user messages in the message panel.
|
|
163
|
-
background: "#edf2fb",
|
|
164
|
-
// Blue-tinted lift — differentiates user turns from agent.
|
|
165
|
-
border: "#8c959f",
|
|
166
|
-
agentBorder: "#6cb0e0",
|
|
167
|
-
// Medium blue on white bg.
|
|
168
|
-
focusBorder: "#0969da"
|
|
169
|
-
// Accent blue for focused message indicator.
|
|
170
|
-
},
|
|
171
|
-
// ── Badges ──────────────────────────────────────────────
|
|
172
|
-
badge: {
|
|
173
|
-
error: { bg: "#ffebe9", fg: "#cf222e" },
|
|
174
|
-
running: { bg: "#fff8c5", fg: "#9a6700" },
|
|
175
|
-
idle: { bg: "#dafbe1", fg: "#1a7f37" },
|
|
176
|
-
search: { bg: "#ddf4ff" },
|
|
177
|
-
command: { bg: "#fbefff" }
|
|
178
|
-
},
|
|
179
|
-
// ── Detail view ─────────────────────────────────────────
|
|
180
|
-
detail: {
|
|
181
|
-
title: "#1f2328",
|
|
182
|
-
subject: "#0969da"
|
|
183
|
-
},
|
|
184
|
-
// ── Tool pills ──────────────────────────────────────────
|
|
185
|
-
toolPill: {
|
|
186
|
-
safe: { bg: "#ddf4ff", fg: "#0550ae" },
|
|
187
|
-
mutating: { bg: "#fff8c5", fg: "#7c5200" },
|
|
188
|
-
browser: { bg: "#dafbe1", fg: "#116329" },
|
|
189
|
-
neutral: { bg: "#f6f8fa", fg: "#424a53" },
|
|
190
|
-
skill: { bg: "#fbefff", fg: "#6639ba" },
|
|
191
|
-
"subagent.spawn": { bg: "#dafbe1", fg: "#116329" },
|
|
192
|
-
"subagent.return": { bg: "#dafbe1", fg: "#1a7f37" }
|
|
193
|
-
}
|
|
194
|
-
};
|
|
195
|
-
var highContrastTheme = {
|
|
196
|
-
name: "high-contrast",
|
|
197
|
-
// ── Text hierarchy ──────────────────────────────────────
|
|
198
|
-
text: "#f0f6fc",
|
|
199
|
-
// Near-white. Maximum brightness.
|
|
200
|
-
textMuted: "#9ea7b3",
|
|
201
|
-
// Bumped from #7d8590 for better contrast (~5.2:1).
|
|
202
|
-
textInverse: "#010409",
|
|
203
|
-
// Near-black.
|
|
204
|
-
// ── Accent ──────────────────────────────────────────────
|
|
205
|
-
border: "#71b7ff",
|
|
206
|
-
accent: "#71b7ff",
|
|
207
|
-
// Brighter blue. Punches through.
|
|
208
|
-
accentSecondary: "#d2a8ff",
|
|
209
|
-
// Bright purple.
|
|
210
|
-
// ── Status ──────────────────────────────────────────────
|
|
211
|
-
status: {
|
|
212
|
-
success: "#56d364",
|
|
213
|
-
// Bright green. Higher saturation.
|
|
214
|
-
error: "#ff7b72",
|
|
215
|
-
// Bright red. Softened for readability.
|
|
216
|
-
warning: "#e3b341",
|
|
217
|
-
// Bright amber.
|
|
218
|
-
info: "#71b7ff",
|
|
219
|
-
// Bright blue.
|
|
220
|
-
working: "#e3b341",
|
|
221
|
-
// Bright amber.
|
|
222
|
-
neutral: "#b1bac4"
|
|
223
|
-
// Bumped from #9ea7b3 for HC (~6.0:1).
|
|
224
|
-
},
|
|
225
|
-
// ── Context bar ─────────────────────────────────────────
|
|
226
|
-
contextBar: {
|
|
227
|
-
track: "#3d444d",
|
|
228
|
-
// HC track — brighter than dark.
|
|
229
|
-
low: "#56d364",
|
|
230
|
-
medium: "#e3b341",
|
|
231
|
-
high: "#ff7b72"
|
|
232
|
-
},
|
|
233
|
-
// ── Dialog borders ──────────────────────────────────────
|
|
234
|
-
dialog: {
|
|
235
|
-
borderPermission: "#e3b341",
|
|
236
|
-
borderQuestion: "#71b7ff"
|
|
237
|
-
},
|
|
238
|
-
// ── Input ───────────────────────────────────────────────
|
|
239
|
-
inputPrompt: "#71b7ff",
|
|
240
|
-
inputChevron: "#9ea7b3",
|
|
241
|
-
// Bumped from #7d8590 for visibility.
|
|
242
|
-
inputBackground: "#16202b",
|
|
243
|
-
// ── Feed ────────────────────────────────────────────────
|
|
244
|
-
feed: {
|
|
245
|
-
headerLabel: "#9ea7b3",
|
|
246
|
-
// Matches textMuted.
|
|
247
|
-
stripeBackground: "#0d1521",
|
|
248
|
-
// Bumped from #0b141f for visible alternation.
|
|
249
|
-
focusBackground: "#1a3350"
|
|
250
|
-
// Brighter blue tint for HC.
|
|
251
|
-
},
|
|
252
|
-
// ── User messages ───────────────────────────────────────
|
|
253
|
-
userMessage: {
|
|
254
|
-
text: "#7d8590",
|
|
255
|
-
// Dimmed text for user messages in the message panel.
|
|
256
|
-
background: "#1a2436",
|
|
257
|
-
// Blue-tinted lift — differentiates user turns from agent.
|
|
258
|
-
border: "#444c56",
|
|
259
|
-
// Bumped from #3d444d for HC visibility.
|
|
260
|
-
agentBorder: "#5599cc",
|
|
261
|
-
// Brighter blue for HC.
|
|
262
|
-
focusBorder: "#71b7ff"
|
|
263
|
-
// Accent blue for focused message indicator.
|
|
264
|
-
},
|
|
265
|
-
// ── Badges ──────────────────────────────────────────────
|
|
266
|
-
badge: {
|
|
267
|
-
error: { bg: "#6e1b16", fg: "#ff7b72" },
|
|
268
|
-
running: { bg: "#5c4813", fg: "#e3b341" },
|
|
269
|
-
idle: { bg: "#154228", fg: "#56d364" },
|
|
270
|
-
search: { bg: "#1a3350" },
|
|
271
|
-
command: { bg: "#301e50" }
|
|
272
|
-
},
|
|
273
|
-
// ── Detail view ─────────────────────────────────────────
|
|
274
|
-
detail: {
|
|
275
|
-
title: "#f0f6fc",
|
|
276
|
-
subject: "#71b7ff"
|
|
277
|
-
},
|
|
278
|
-
// ── Tool pills ──────────────────────────────────────────
|
|
279
|
-
toolPill: {
|
|
280
|
-
safe: { bg: "#122d42", fg: "#a2d2ff" },
|
|
281
|
-
mutating: { bg: "#3a2e10", fg: "#f0d070" },
|
|
282
|
-
browser: { bg: "#0f3520", fg: "#7ee28b" },
|
|
283
|
-
neutral: { bg: "#1c2128", fg: "#b1bac4" },
|
|
284
|
-
skill: { bg: "#2b1a40", fg: "#e0c0ff" },
|
|
285
|
-
"subagent.spawn": { bg: "#0f3520", fg: "#7ee28b" },
|
|
286
|
-
"subagent.return": { bg: "#0f3520", fg: "#6bcc79" }
|
|
287
|
-
}
|
|
288
|
-
};
|
|
289
|
-
var THEMES = {
|
|
290
|
-
dark: darkTheme,
|
|
291
|
-
light: lightTheme,
|
|
292
|
-
"high-contrast": highContrastTheme
|
|
293
|
-
};
|
|
294
|
-
function resolveTheme(name) {
|
|
295
|
-
if (name && name in THEMES) {
|
|
296
|
-
return THEMES[name];
|
|
297
|
-
}
|
|
298
|
-
return darkTheme;
|
|
299
|
-
}
|
|
300
|
-
|
|
301
|
-
// src/ui/theme/ThemeContext.tsx
|
|
302
|
-
import { createContext, useContext } from "react";
|
|
303
|
-
var ThemeContext = createContext(darkTheme);
|
|
304
|
-
var ThemeProvider = ThemeContext.Provider;
|
|
305
|
-
function useTheme() {
|
|
306
|
-
return useContext(ThemeContext);
|
|
307
|
-
}
|
|
308
|
-
|
|
309
1
|
// src/infra/plugins/workflowSourceResolution.ts
|
|
310
2
|
import fs2 from "fs";
|
|
311
3
|
import path2 from "path";
|
|
@@ -1265,190 +957,6 @@ function hasProjectWorkflow(projectDir) {
|
|
|
1265
957
|
return hasActiveWorkflow(projectConfigPath(projectDir));
|
|
1266
958
|
}
|
|
1267
959
|
|
|
1268
|
-
// src/setup/components/StepStatus.tsx
|
|
1269
|
-
import { Text, Box } from "ink";
|
|
1270
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
1271
|
-
function StepStatus({ status, message }) {
|
|
1272
|
-
const theme = useTheme();
|
|
1273
|
-
const icon = status === "success" ? "\u2713" : status === "error" ? "\u2717" : "\u280B";
|
|
1274
|
-
const color = status === "success" ? theme.status.success : status === "error" ? theme.status.error : theme.status.working;
|
|
1275
|
-
return /* @__PURE__ */ jsxs(Box, { flexDirection: "row", marginTop: 1, children: [
|
|
1276
|
-
/* @__PURE__ */ jsxs(Text, { color, bold: true, children: [
|
|
1277
|
-
icon,
|
|
1278
|
-
" "
|
|
1279
|
-
] }),
|
|
1280
|
-
/* @__PURE__ */ jsx(Text, { color, children: message })
|
|
1281
|
-
] });
|
|
1282
|
-
}
|
|
1283
|
-
|
|
1284
|
-
// src/setup/steps/McpOptionsStep.tsx
|
|
1285
|
-
import { useState as useState2, useCallback, useEffect as useEffect2, useRef as useRef2 } from "react";
|
|
1286
|
-
import { Box as Box3, Text as Text3 } from "ink";
|
|
1287
|
-
|
|
1288
|
-
// src/setup/components/StepSelector.tsx
|
|
1289
|
-
import { useEffect, useRef, useState } from "react";
|
|
1290
|
-
import { Box as Box2, Text as Text2, useInput } from "ink";
|
|
1291
|
-
import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
1292
|
-
function getInitialCursor(options, initialValue) {
|
|
1293
|
-
if (initialValue) {
|
|
1294
|
-
const initialIndex = options.findIndex(
|
|
1295
|
-
(option) => option.value === initialValue && !option.disabled
|
|
1296
|
-
);
|
|
1297
|
-
if (initialIndex >= 0) {
|
|
1298
|
-
return initialIndex;
|
|
1299
|
-
}
|
|
1300
|
-
}
|
|
1301
|
-
const firstEnabled = options.findIndex((option) => !option.disabled);
|
|
1302
|
-
return firstEnabled >= 0 ? firstEnabled : 0;
|
|
1303
|
-
}
|
|
1304
|
-
function StepSelector({
|
|
1305
|
-
options,
|
|
1306
|
-
onSelect,
|
|
1307
|
-
isActive = true,
|
|
1308
|
-
initialValue,
|
|
1309
|
-
onHighlight,
|
|
1310
|
-
gap = 0
|
|
1311
|
-
}) {
|
|
1312
|
-
const theme = useTheme();
|
|
1313
|
-
const [cursor, setCursor] = useState(
|
|
1314
|
-
() => getInitialCursor(options, initialValue)
|
|
1315
|
-
);
|
|
1316
|
-
const highlightedRef = useRef(void 0);
|
|
1317
|
-
const moveCursor = (direction) => {
|
|
1318
|
-
setCursor((prev) => {
|
|
1319
|
-
if (options.length <= 1) {
|
|
1320
|
-
return prev;
|
|
1321
|
-
}
|
|
1322
|
-
let next = prev;
|
|
1323
|
-
for (let i = 0; i < options.length; i += 1) {
|
|
1324
|
-
const candidate = Math.max(
|
|
1325
|
-
0,
|
|
1326
|
-
Math.min(next + direction, options.length - 1)
|
|
1327
|
-
);
|
|
1328
|
-
if (candidate === next) {
|
|
1329
|
-
return prev;
|
|
1330
|
-
}
|
|
1331
|
-
next = candidate;
|
|
1332
|
-
if (!options[next]?.disabled) {
|
|
1333
|
-
return next;
|
|
1334
|
-
}
|
|
1335
|
-
}
|
|
1336
|
-
return prev;
|
|
1337
|
-
});
|
|
1338
|
-
};
|
|
1339
|
-
useInput(
|
|
1340
|
-
(_input, key) => {
|
|
1341
|
-
if (key.downArrow) {
|
|
1342
|
-
moveCursor(1);
|
|
1343
|
-
} else if (key.upArrow) {
|
|
1344
|
-
moveCursor(-1);
|
|
1345
|
-
} else if (key.return) {
|
|
1346
|
-
const opt = options[cursor];
|
|
1347
|
-
if (!opt.disabled) {
|
|
1348
|
-
onSelect(opt.value);
|
|
1349
|
-
}
|
|
1350
|
-
}
|
|
1351
|
-
},
|
|
1352
|
-
{ isActive }
|
|
1353
|
-
);
|
|
1354
|
-
useEffect(() => {
|
|
1355
|
-
if (!onHighlight) {
|
|
1356
|
-
return;
|
|
1357
|
-
}
|
|
1358
|
-
const option = options[cursor];
|
|
1359
|
-
if (option.disabled) {
|
|
1360
|
-
return;
|
|
1361
|
-
}
|
|
1362
|
-
if (highlightedRef.current === option.value) {
|
|
1363
|
-
return;
|
|
1364
|
-
}
|
|
1365
|
-
highlightedRef.current = option.value;
|
|
1366
|
-
onHighlight(option.value);
|
|
1367
|
-
}, [cursor, options, onHighlight]);
|
|
1368
|
-
return /* @__PURE__ */ jsx2(Box2, { flexDirection: "column", gap, children: options.map((opt, i) => {
|
|
1369
|
-
const isCursor = i === cursor;
|
|
1370
|
-
return /* @__PURE__ */ jsxs2(Box2, { flexDirection: "column", children: [
|
|
1371
|
-
/* @__PURE__ */ jsxs2(
|
|
1372
|
-
Text2,
|
|
1373
|
-
{
|
|
1374
|
-
color: opt.disabled ? theme.textMuted : isCursor ? theme.accent : theme.text,
|
|
1375
|
-
bold: isCursor && !opt.disabled,
|
|
1376
|
-
inverse: isCursor && !opt.disabled,
|
|
1377
|
-
dimColor: opt.disabled,
|
|
1378
|
-
children: [
|
|
1379
|
-
isCursor ? " > " : " ",
|
|
1380
|
-
opt.label,
|
|
1381
|
-
isCursor ? " " : ""
|
|
1382
|
-
]
|
|
1383
|
-
}
|
|
1384
|
-
),
|
|
1385
|
-
opt.description && !opt.disabled ? /* @__PURE__ */ jsx2(Box2, { paddingLeft: 5, children: /* @__PURE__ */ jsxs2(Text2, { dimColor: true, italic: true, children: [
|
|
1386
|
-
"\u21B3 ",
|
|
1387
|
-
opt.description
|
|
1388
|
-
] }) }) : null
|
|
1389
|
-
] }, opt.value);
|
|
1390
|
-
}) });
|
|
1391
|
-
}
|
|
1392
|
-
|
|
1393
|
-
// src/setup/steps/McpOptionsStep.tsx
|
|
1394
|
-
import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
1395
|
-
function McpOptionsStep({ servers, onComplete }) {
|
|
1396
|
-
const theme = useTheme();
|
|
1397
|
-
const [serverIndex, setServerIndex] = useState2(0);
|
|
1398
|
-
const choicesRef = useRef2({});
|
|
1399
|
-
const autoSkippedRef = useRef2(false);
|
|
1400
|
-
useEffect2(() => {
|
|
1401
|
-
if (servers.length === 0 && !autoSkippedRef.current) {
|
|
1402
|
-
autoSkippedRef.current = true;
|
|
1403
|
-
onComplete({});
|
|
1404
|
-
}
|
|
1405
|
-
}, [servers.length, onComplete]);
|
|
1406
|
-
const handleSelect = useCallback(
|
|
1407
|
-
(value) => {
|
|
1408
|
-
const server = servers[serverIndex];
|
|
1409
|
-
const selectedOption = server.options[Number(value)];
|
|
1410
|
-
choicesRef.current = {
|
|
1411
|
-
...choicesRef.current,
|
|
1412
|
-
[server.serverName]: selectedOption.env
|
|
1413
|
-
};
|
|
1414
|
-
if (serverIndex + 1 < servers.length) {
|
|
1415
|
-
setServerIndex((prev) => prev + 1);
|
|
1416
|
-
} else {
|
|
1417
|
-
onComplete(choicesRef.current);
|
|
1418
|
-
}
|
|
1419
|
-
},
|
|
1420
|
-
[serverIndex, servers, onComplete]
|
|
1421
|
-
);
|
|
1422
|
-
if (servers.length === 0) {
|
|
1423
|
-
return null;
|
|
1424
|
-
}
|
|
1425
|
-
const currentServer = servers[serverIndex];
|
|
1426
|
-
const selectorOptions = currentServer.options.map((opt, i) => ({
|
|
1427
|
-
label: i === 0 ? `${opt.label} (default)` : opt.label,
|
|
1428
|
-
value: String(i)
|
|
1429
|
-
}));
|
|
1430
|
-
return /* @__PURE__ */ jsxs3(Box3, { flexDirection: "column", children: [
|
|
1431
|
-
/* @__PURE__ */ jsx3(Text3, { bold: true, color: theme.accent, children: "Configure MCP servers" }),
|
|
1432
|
-
/* @__PURE__ */ jsxs3(Text3, { color: theme.textMuted, children: [
|
|
1433
|
-
"Server ",
|
|
1434
|
-
serverIndex + 1,
|
|
1435
|
-
" of ",
|
|
1436
|
-
servers.length,
|
|
1437
|
-
":",
|
|
1438
|
-
" ",
|
|
1439
|
-
/* @__PURE__ */ jsx3(Text3, { bold: true, children: currentServer.serverName })
|
|
1440
|
-
] }),
|
|
1441
|
-
/* @__PURE__ */ jsx3(Box3, { marginTop: 1, children: /* @__PURE__ */ jsx3(
|
|
1442
|
-
StepSelector,
|
|
1443
|
-
{
|
|
1444
|
-
options: selectorOptions,
|
|
1445
|
-
onSelect: handleSelect
|
|
1446
|
-
},
|
|
1447
|
-
currentServer.serverName
|
|
1448
|
-
) })
|
|
1449
|
-
] });
|
|
1450
|
-
}
|
|
1451
|
-
|
|
1452
960
|
// src/core/workflows/types.ts
|
|
1453
961
|
function pluginSpecRef(spec) {
|
|
1454
962
|
return typeof spec === "string" ? spec : spec.ref;
|
|
@@ -2236,7 +1744,7 @@ function cleanupWorkflowRun(state) {
|
|
|
2236
1744
|
}
|
|
2237
1745
|
|
|
2238
1746
|
// src/core/workflows/useWorkflowSessionController.ts
|
|
2239
|
-
import { useCallback
|
|
1747
|
+
import { useCallback, useEffect, useRef, useState } from "react";
|
|
2240
1748
|
|
|
2241
1749
|
// src/core/workflows/workflowRunner.ts
|
|
2242
1750
|
import crypto from "crypto";
|
|
@@ -2413,8 +1921,7 @@ function createWorkflowRunner(input) {
|
|
|
2413
1921
|
} else if (loopStop.reason === "max_iterations") {
|
|
2414
1922
|
status = "exhausted";
|
|
2415
1923
|
} else if (loopStop.reason === "skeleton_not_replaced") {
|
|
2416
|
-
status = "
|
|
2417
|
-
stopReason = "Agent did not replace the tracker skeleton. The session completed without engaging with the workflow tracker.";
|
|
1924
|
+
status = "completed";
|
|
2418
1925
|
} else {
|
|
2419
1926
|
status = "failed";
|
|
2420
1927
|
stopReason = `Loop stopped: ${loopStop.reason}`;
|
|
@@ -2456,10 +1963,10 @@ function createWorkflowRunner(input) {
|
|
|
2456
1963
|
|
|
2457
1964
|
// src/core/workflows/useWorkflowSessionController.ts
|
|
2458
1965
|
function useWorkflowSessionController(base, input) {
|
|
2459
|
-
const [isRunning, setIsRunning] =
|
|
2460
|
-
const runnerRef =
|
|
2461
|
-
const activeRunIdRef =
|
|
2462
|
-
const cancelCurrentRun =
|
|
1966
|
+
const [isRunning, setIsRunning] = useState(false);
|
|
1967
|
+
const runnerRef = useRef(null);
|
|
1968
|
+
const activeRunIdRef = useRef(null);
|
|
1969
|
+
const cancelCurrentRun = useCallback(async () => {
|
|
2463
1970
|
const runner = runnerRef.current;
|
|
2464
1971
|
if (runner) {
|
|
2465
1972
|
runner.kill();
|
|
@@ -2469,7 +1976,7 @@ function useWorkflowSessionController(base, input) {
|
|
|
2469
1976
|
activeRunIdRef.current = null;
|
|
2470
1977
|
}
|
|
2471
1978
|
}, []);
|
|
2472
|
-
const interrupt =
|
|
1979
|
+
const interrupt = useCallback(() => {
|
|
2473
1980
|
const runner = runnerRef.current;
|
|
2474
1981
|
if (runner) {
|
|
2475
1982
|
runner.kill();
|
|
@@ -2481,7 +1988,7 @@ function useWorkflowSessionController(base, input) {
|
|
|
2481
1988
|
}
|
|
2482
1989
|
setIsRunning(false);
|
|
2483
1990
|
}, [base]);
|
|
2484
|
-
const kill =
|
|
1991
|
+
const kill = useCallback(async () => {
|
|
2485
1992
|
if (runnerRef.current) {
|
|
2486
1993
|
await cancelCurrentRun();
|
|
2487
1994
|
} else {
|
|
@@ -2489,7 +1996,7 @@ function useWorkflowSessionController(base, input) {
|
|
|
2489
1996
|
}
|
|
2490
1997
|
setIsRunning(false);
|
|
2491
1998
|
}, [base, cancelCurrentRun]);
|
|
2492
|
-
const spawn =
|
|
1999
|
+
const spawn = useCallback(
|
|
2493
2000
|
async (prompt, continuation, _configOverride) => {
|
|
2494
2001
|
await cancelCurrentRun();
|
|
2495
2002
|
setIsRunning(true);
|
|
@@ -2538,7 +2045,7 @@ function useWorkflowSessionController(base, input) {
|
|
|
2538
2045
|
input.persistRunState
|
|
2539
2046
|
]
|
|
2540
2047
|
);
|
|
2541
|
-
|
|
2048
|
+
useEffect(() => {
|
|
2542
2049
|
return () => {
|
|
2543
2050
|
runnerRef.current?.kill();
|
|
2544
2051
|
runnerRef.current = null;
|
|
@@ -2583,10 +2090,6 @@ function collectMcpServersWithOptions(pluginDirs) {
|
|
|
2583
2090
|
}
|
|
2584
2091
|
|
|
2585
2092
|
export {
|
|
2586
|
-
darkTheme,
|
|
2587
|
-
resolveTheme,
|
|
2588
|
-
ThemeProvider,
|
|
2589
|
-
useTheme,
|
|
2590
2093
|
createWorkflowRunner,
|
|
2591
2094
|
useWorkflowSessionController,
|
|
2592
2095
|
isMarketplaceRef,
|
|
@@ -2604,9 +2107,6 @@ export {
|
|
|
2604
2107
|
writeGlobalConfig,
|
|
2605
2108
|
writeProjectConfig,
|
|
2606
2109
|
hasProjectWorkflow,
|
|
2607
|
-
StepSelector,
|
|
2608
|
-
StepStatus,
|
|
2609
|
-
McpOptionsStep,
|
|
2610
2110
|
installWorkflowPlugins,
|
|
2611
2111
|
resolveWorkflowPlugins,
|
|
2612
2112
|
listBuiltinWorkflows,
|
|
@@ -2618,4 +2118,4 @@ export {
|
|
|
2618
2118
|
compileWorkflowPlan,
|
|
2619
2119
|
collectMcpServersWithOptions
|
|
2620
2120
|
};
|
|
2621
|
-
//# sourceMappingURL=chunk-
|
|
2121
|
+
//# sourceMappingURL=chunk-GE6PPB6Z.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=chunk-HXBCZAP7.js.map
|