fluxflow-cli 1.17.1 → 1.17.3
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/fluxflow.js +704 -316
- package/package.json +2 -3
package/dist/fluxflow.js
CHANGED
|
@@ -9,6 +9,364 @@ var __export = (target, all) => {
|
|
|
9
9
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
10
|
};
|
|
11
11
|
|
|
12
|
+
// src/components/MultilineInput.jsx
|
|
13
|
+
import React, { useState, useEffect, useMemo, useCallback, useRef } from "react";
|
|
14
|
+
import { Box, Spacer, Text, useInput, measureElement } from "ink";
|
|
15
|
+
function expandTabs(text, tabSize) {
|
|
16
|
+
return text.replace(/\t/g, " ".repeat(tabSize));
|
|
17
|
+
}
|
|
18
|
+
function normalizeLineEndings(text) {
|
|
19
|
+
if (text == null) return "";
|
|
20
|
+
return text.replace(/\r\n/g, "\n").replace(/\r/g, "\n");
|
|
21
|
+
}
|
|
22
|
+
var MeasureBox, ControlledMultilineInput, MultilineInput;
|
|
23
|
+
var init_MultilineInput = __esm({
|
|
24
|
+
"src/components/MultilineInput.jsx"() {
|
|
25
|
+
MeasureBox = ({ children, onHeightChange }) => {
|
|
26
|
+
const ref = useRef(null);
|
|
27
|
+
const lastHeightRef = useRef(void 0);
|
|
28
|
+
useEffect(() => {
|
|
29
|
+
if (ref.current) {
|
|
30
|
+
const { height } = measureElement(ref.current);
|
|
31
|
+
if (lastHeightRef.current !== height) {
|
|
32
|
+
lastHeightRef.current = height;
|
|
33
|
+
onHeightChange?.(height);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
return /* @__PURE__ */ React.createElement(Box, { ref, flexShrink: 0, flexGrow: 0, width: "100%" }, children);
|
|
38
|
+
};
|
|
39
|
+
ControlledMultilineInput = ({
|
|
40
|
+
value,
|
|
41
|
+
rows,
|
|
42
|
+
maxRows,
|
|
43
|
+
highlightStyle,
|
|
44
|
+
textStyle,
|
|
45
|
+
placeholder = "",
|
|
46
|
+
mask,
|
|
47
|
+
showCursor = true,
|
|
48
|
+
focus = true,
|
|
49
|
+
tabSize = 4,
|
|
50
|
+
cursorIndex = 0,
|
|
51
|
+
highlight,
|
|
52
|
+
refreshKey
|
|
53
|
+
}) => {
|
|
54
|
+
const [scrollOffset, setScrollOffset] = useState(0);
|
|
55
|
+
const [contentHeight, setContentHeight] = useState(0);
|
|
56
|
+
const [markerHeight, setMarkerHeight] = useState(0);
|
|
57
|
+
const formatText = useCallback(
|
|
58
|
+
(text, isPlaceholder = false) => {
|
|
59
|
+
const normalized = normalizeLineEndings(text);
|
|
60
|
+
if (!isPlaceholder && mask) {
|
|
61
|
+
return normalized.replace(/[^\n]/g, mask);
|
|
62
|
+
}
|
|
63
|
+
const expanded = expandTabs(normalized, tabSize);
|
|
64
|
+
if (isPlaceholder) return expanded;
|
|
65
|
+
return expanded.replace(/@\[(.*?)\]/g, (match, p1) => {
|
|
66
|
+
const hashIdx = p1.indexOf("#");
|
|
67
|
+
const colonIdx = p1.indexOf(":L");
|
|
68
|
+
let pathOnly = p1;
|
|
69
|
+
let suffix = "";
|
|
70
|
+
if (hashIdx !== -1) {
|
|
71
|
+
pathOnly = p1.slice(0, hashIdx);
|
|
72
|
+
suffix = p1.slice(hashIdx);
|
|
73
|
+
} else if (colonIdx !== -1) {
|
|
74
|
+
pathOnly = p1.slice(0, colonIdx);
|
|
75
|
+
suffix = p1.slice(colonIdx);
|
|
76
|
+
}
|
|
77
|
+
let rel = pathOnly.replace(/\\/g, "/");
|
|
78
|
+
const cwd = (process.cwd() || "").replace(/\\/g, "/");
|
|
79
|
+
if (cwd && rel.toLowerCase().startsWith(cwd.toLowerCase() + "/")) {
|
|
80
|
+
rel = rel.slice(cwd.length + 1);
|
|
81
|
+
} else if (rel.startsWith("./")) {
|
|
82
|
+
rel = rel.slice(2);
|
|
83
|
+
}
|
|
84
|
+
const parts = rel.split("/");
|
|
85
|
+
const basename = parts[parts.length - 1];
|
|
86
|
+
return `[${basename}${suffix}]`;
|
|
87
|
+
});
|
|
88
|
+
},
|
|
89
|
+
[tabSize, mask]
|
|
90
|
+
);
|
|
91
|
+
const { preCursor, postCursor } = useMemo(() => {
|
|
92
|
+
if (!value) {
|
|
93
|
+
if (placeholder && !focus) {
|
|
94
|
+
return {
|
|
95
|
+
preCursor: [{ value: formatText(placeholder, true), type: "placeholder" }],
|
|
96
|
+
postCursor: []
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
return {
|
|
100
|
+
preCursor: [{ value: " ", type: "cursor" }],
|
|
101
|
+
postCursor: []
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
const textBefore = value.slice(0, cursorIndex);
|
|
105
|
+
const textAfter = value.slice(cursorIndex);
|
|
106
|
+
if (!focus) {
|
|
107
|
+
return {
|
|
108
|
+
preCursor: [{ value: formatText(value) }],
|
|
109
|
+
postCursor: []
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
const hasValidHighlight = highlight && highlight.end > highlight.start && highlight.start >= 0 && highlight.end <= value.length;
|
|
113
|
+
if (!hasValidHighlight) {
|
|
114
|
+
const formattedBefore = formatText(textBefore);
|
|
115
|
+
const formattedAfter = formatText(textAfter);
|
|
116
|
+
const lineStart = formattedBefore.lastIndexOf("\n") + 1;
|
|
117
|
+
const lineEnd = formattedAfter.indexOf("\n");
|
|
118
|
+
return {
|
|
119
|
+
preCursor: [
|
|
120
|
+
{ value: formattedBefore.slice(0, lineStart) },
|
|
121
|
+
{ value: formattedBefore.slice(lineStart), type: "highlight" },
|
|
122
|
+
{ value: showCursor && focus ? " " : "", type: "cursor" }
|
|
123
|
+
],
|
|
124
|
+
postCursor: [
|
|
125
|
+
{ value: formattedAfter.slice(0, lineEnd), type: "highlight" },
|
|
126
|
+
{ value: formattedAfter.slice(lineEnd) }
|
|
127
|
+
]
|
|
128
|
+
};
|
|
129
|
+
} else {
|
|
130
|
+
return {
|
|
131
|
+
preCursor: [
|
|
132
|
+
{ value: formatText(textBefore.slice(0, highlight.start)) },
|
|
133
|
+
{
|
|
134
|
+
value: formatText(textBefore.slice(highlight.start, Math.min(highlight.end, cursorIndex))),
|
|
135
|
+
type: "highlight"
|
|
136
|
+
},
|
|
137
|
+
{ value: formatText(textBefore.slice(highlight.end)) },
|
|
138
|
+
{ value: " ", type: "cursor" }
|
|
139
|
+
],
|
|
140
|
+
postCursor: [
|
|
141
|
+
{
|
|
142
|
+
value: formatText(textAfter.slice(0, Math.max(highlight.start - cursorIndex, 0)))
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
value: formatText(textAfter.slice(Math.max(highlight.start - cursorIndex, 0), Math.max(highlight.end - cursorIndex, 0))),
|
|
146
|
+
type: "highlight"
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
value: formatText(textAfter.slice(Math.max(highlight.end - cursorIndex, 0)))
|
|
150
|
+
}
|
|
151
|
+
]
|
|
152
|
+
};
|
|
153
|
+
}
|
|
154
|
+
}, [cursorIndex, showCursor, focus, value, placeholder, mask, highlight, formatText, refreshKey]);
|
|
155
|
+
const visibleRows = useMemo(() => {
|
|
156
|
+
if (contentHeight !== void 0) {
|
|
157
|
+
return Math.max(rows ?? maxRows ?? 1, Math.min(maxRows ?? rows ?? 1, contentHeight));
|
|
158
|
+
}
|
|
159
|
+
return 1;
|
|
160
|
+
}, [rows, maxRows, contentHeight]);
|
|
161
|
+
useEffect(() => {
|
|
162
|
+
if (markerHeight !== void 0 && visibleRows !== void 0) {
|
|
163
|
+
const cursorLineEnd = markerHeight;
|
|
164
|
+
setScrollOffset((prevOffset) => {
|
|
165
|
+
const viewportStart = prevOffset;
|
|
166
|
+
const viewportEnd = prevOffset + visibleRows;
|
|
167
|
+
if (cursorLineEnd <= viewportStart) {
|
|
168
|
+
return Math.max(0, cursorLineEnd - 1);
|
|
169
|
+
} else if (cursorLineEnd > viewportEnd) {
|
|
170
|
+
return cursorLineEnd - visibleRows;
|
|
171
|
+
} else if (contentHeight) {
|
|
172
|
+
if (contentHeight < visibleRows) {
|
|
173
|
+
return 0;
|
|
174
|
+
} else if (contentHeight < viewportEnd) {
|
|
175
|
+
return contentHeight - visibleRows;
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
return prevOffset;
|
|
179
|
+
});
|
|
180
|
+
}
|
|
181
|
+
}, [markerHeight, visibleRows, contentHeight]);
|
|
182
|
+
const getStyle = useCallback(
|
|
183
|
+
(type) => {
|
|
184
|
+
switch (type) {
|
|
185
|
+
case "placeholder":
|
|
186
|
+
return { ...textStyle, dimColor: true };
|
|
187
|
+
case "highlight":
|
|
188
|
+
return highlightStyle ?? textStyle;
|
|
189
|
+
case "cursor":
|
|
190
|
+
return {
|
|
191
|
+
...highlightStyle ?? textStyle,
|
|
192
|
+
inverse: showCursor && focus
|
|
193
|
+
};
|
|
194
|
+
default:
|
|
195
|
+
return textStyle;
|
|
196
|
+
}
|
|
197
|
+
},
|
|
198
|
+
[textStyle, highlightStyle, showCursor, focus]
|
|
199
|
+
);
|
|
200
|
+
return /* @__PURE__ */ React.createElement(Box, { height: visibleRows, overflow: "hidden", flexDirection: "column", flexGrow: 0, flexShrink: 0 }, /* @__PURE__ */ React.createElement(Box, { flexDirection: "column" }, /* @__PURE__ */ React.createElement(Box, { height: visibleRows, overflowY: "hidden", flexShrink: 0, flexDirection: "column" }, /* @__PURE__ */ React.createElement(Box, { marginTop: -scrollOffset, flexDirection: "column" }, /* @__PURE__ */ React.createElement(MeasureBox, { onHeightChange: setContentHeight }, /* @__PURE__ */ React.createElement(Text, null, preCursor?.map((segment, idx) => /* @__PURE__ */ React.createElement(Text, { key: idx, ...getStyle(segment.type) }, segment.value)), postCursor?.map((segment, idx) => /* @__PURE__ */ React.createElement(Text, { key: idx, ...getStyle(segment.type) }, segment.value))))), /* @__PURE__ */ React.createElement(Spacer, null)), /* @__PURE__ */ React.createElement(MeasureBox, { onHeightChange: setMarkerHeight }, /* @__PURE__ */ React.createElement(Text, null, preCursor?.map((segment, idx) => /* @__PURE__ */ React.createElement(Text, { key: idx, ...getStyle(segment.type) }, segment.value))))));
|
|
201
|
+
};
|
|
202
|
+
MultilineInput = ({
|
|
203
|
+
value,
|
|
204
|
+
onChange,
|
|
205
|
+
onSubmit,
|
|
206
|
+
keyBindings,
|
|
207
|
+
showCursor = true,
|
|
208
|
+
highlightPastedText = false,
|
|
209
|
+
focus = true,
|
|
210
|
+
useCustomInput = (inputHandler, isActive) => useInput(inputHandler, { isActive }),
|
|
211
|
+
...controlledProps
|
|
212
|
+
}) => {
|
|
213
|
+
const [cursorIndex, setCursorIndex] = useState(value.length);
|
|
214
|
+
const [pasteLength, setPasteLength] = useState(0);
|
|
215
|
+
useEffect(() => {
|
|
216
|
+
if (cursorIndex > value.length) {
|
|
217
|
+
setCursorIndex(value.length);
|
|
218
|
+
}
|
|
219
|
+
}, [value, cursorIndex]);
|
|
220
|
+
useCustomInput((input, key) => {
|
|
221
|
+
const submitKey = keyBindings?.submit ?? ((key2) => key2.return && key2.ctrl);
|
|
222
|
+
const newlineKey = keyBindings?.newline ?? ((key2) => key2.return);
|
|
223
|
+
if (submitKey(key)) {
|
|
224
|
+
onSubmit?.(value);
|
|
225
|
+
return;
|
|
226
|
+
} else if (newlineKey(key)) {
|
|
227
|
+
const newValue = value.slice(0, cursorIndex) + "\n" + value.slice(cursorIndex);
|
|
228
|
+
onChange(newValue);
|
|
229
|
+
setCursorIndex(cursorIndex + 1);
|
|
230
|
+
setPasteLength(0);
|
|
231
|
+
return;
|
|
232
|
+
}
|
|
233
|
+
if (key.tab || key.shift && key.tab || key.ctrl && input === "c") {
|
|
234
|
+
return;
|
|
235
|
+
}
|
|
236
|
+
if (keyBindings?.newline?.(key)) {
|
|
237
|
+
const newValue = value.slice(0, cursorIndex) + "\n" + value.slice(cursorIndex);
|
|
238
|
+
onChange(newValue);
|
|
239
|
+
setCursorIndex(cursorIndex + 1);
|
|
240
|
+
setPasteLength(0);
|
|
241
|
+
return;
|
|
242
|
+
}
|
|
243
|
+
let nextPasteLength = 0;
|
|
244
|
+
if (input.length > 1) {
|
|
245
|
+
nextPasteLength = input.length;
|
|
246
|
+
}
|
|
247
|
+
if (key.upArrow) {
|
|
248
|
+
if (showCursor) {
|
|
249
|
+
const lines = normalizeLineEndings(value).split("\n");
|
|
250
|
+
let currentLineIndex = 0;
|
|
251
|
+
let currentPos = 0;
|
|
252
|
+
let col = 0;
|
|
253
|
+
for (let i = 0; i < lines.length; i++) {
|
|
254
|
+
const line = lines[i];
|
|
255
|
+
if (line === void 0) continue;
|
|
256
|
+
const lineLen = line.length;
|
|
257
|
+
const lineEnd = currentPos + lineLen;
|
|
258
|
+
if (cursorIndex >= currentPos && cursorIndex <= lineEnd) {
|
|
259
|
+
currentLineIndex = i;
|
|
260
|
+
col = cursorIndex - currentPos;
|
|
261
|
+
break;
|
|
262
|
+
}
|
|
263
|
+
currentPos = lineEnd + 1;
|
|
264
|
+
}
|
|
265
|
+
if (currentLineIndex > 0) {
|
|
266
|
+
const targetLineIndex = currentLineIndex - 1;
|
|
267
|
+
const targetLine = lines[targetLineIndex];
|
|
268
|
+
if (targetLine !== void 0) {
|
|
269
|
+
const targetLineLen = targetLine.length;
|
|
270
|
+
const newCol = Math.min(col, targetLineLen);
|
|
271
|
+
let newIndex = 0;
|
|
272
|
+
for (let i = 0; i < targetLineIndex; i++) {
|
|
273
|
+
newIndex += lines[i].length + 1;
|
|
274
|
+
}
|
|
275
|
+
newIndex += newCol;
|
|
276
|
+
setCursorIndex(newIndex);
|
|
277
|
+
setPasteLength(0);
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
} else if (key.downArrow) {
|
|
282
|
+
if (showCursor) {
|
|
283
|
+
const lines = normalizeLineEndings(value).split("\n");
|
|
284
|
+
let currentLineIndex = 0;
|
|
285
|
+
let currentPos = 0;
|
|
286
|
+
let col = 0;
|
|
287
|
+
for (let i = 0; i < lines.length; i++) {
|
|
288
|
+
const line = lines[i];
|
|
289
|
+
if (line === void 0) continue;
|
|
290
|
+
const lineLen = line.length;
|
|
291
|
+
const lineEnd = currentPos + lineLen;
|
|
292
|
+
if (cursorIndex >= currentPos && cursorIndex <= lineEnd) {
|
|
293
|
+
currentLineIndex = i;
|
|
294
|
+
col = cursorIndex - currentPos;
|
|
295
|
+
break;
|
|
296
|
+
}
|
|
297
|
+
currentPos = lineEnd + 1;
|
|
298
|
+
}
|
|
299
|
+
if (currentLineIndex < lines.length - 1) {
|
|
300
|
+
const targetLineIndex = currentLineIndex + 1;
|
|
301
|
+
const targetLine = lines[targetLineIndex];
|
|
302
|
+
if (targetLine !== void 0) {
|
|
303
|
+
const targetLineLen = targetLine.length;
|
|
304
|
+
const newCol = Math.min(col, targetLineLen);
|
|
305
|
+
let newIndex = 0;
|
|
306
|
+
for (let i = 0; i < targetLineIndex; i++) {
|
|
307
|
+
newIndex += lines[i].length + 1;
|
|
308
|
+
}
|
|
309
|
+
newIndex += newCol;
|
|
310
|
+
setCursorIndex(newIndex);
|
|
311
|
+
setPasteLength(0);
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
} else if (key.leftArrow) {
|
|
316
|
+
if (showCursor) {
|
|
317
|
+
setCursorIndex(Math.max(0, cursorIndex - 1));
|
|
318
|
+
setPasteLength(0);
|
|
319
|
+
}
|
|
320
|
+
} else if (key.rightArrow) {
|
|
321
|
+
if (showCursor) {
|
|
322
|
+
setCursorIndex(Math.min(value.length, cursorIndex + 1));
|
|
323
|
+
setPasteLength(0);
|
|
324
|
+
}
|
|
325
|
+
} else if (key.return) {
|
|
326
|
+
const newValue = value.slice(0, cursorIndex) + "\n" + value.slice(cursorIndex);
|
|
327
|
+
onChange(newValue);
|
|
328
|
+
setCursorIndex(cursorIndex + 1);
|
|
329
|
+
setPasteLength(0);
|
|
330
|
+
} else if (key.backspace || key.delete) {
|
|
331
|
+
if (cursorIndex > 0) {
|
|
332
|
+
const newValue = value.slice(0, cursorIndex - 1) + value.slice(cursorIndex);
|
|
333
|
+
onChange(newValue);
|
|
334
|
+
setCursorIndex(cursorIndex - 1);
|
|
335
|
+
setPasteLength(0);
|
|
336
|
+
}
|
|
337
|
+
} else {
|
|
338
|
+
if (input) {
|
|
339
|
+
const newValue = value.slice(0, cursorIndex) + input + value.slice(cursorIndex);
|
|
340
|
+
onChange(newValue);
|
|
341
|
+
setCursorIndex(cursorIndex + input.length);
|
|
342
|
+
setPasteLength(nextPasteLength);
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
}, focus);
|
|
346
|
+
const highlight = useMemo(() => {
|
|
347
|
+
if (highlightPastedText && pasteLength > 1) {
|
|
348
|
+
return {
|
|
349
|
+
start: Math.max(0, cursorIndex - pasteLength),
|
|
350
|
+
end: cursorIndex
|
|
351
|
+
};
|
|
352
|
+
}
|
|
353
|
+
return void 0;
|
|
354
|
+
}, [cursorIndex, pasteLength, highlightPastedText]);
|
|
355
|
+
return /* @__PURE__ */ React.createElement(
|
|
356
|
+
ControlledMultilineInput,
|
|
357
|
+
{
|
|
358
|
+
...controlledProps,
|
|
359
|
+
value,
|
|
360
|
+
cursorIndex,
|
|
361
|
+
highlight,
|
|
362
|
+
showCursor,
|
|
363
|
+
focus
|
|
364
|
+
}
|
|
365
|
+
);
|
|
366
|
+
};
|
|
367
|
+
}
|
|
368
|
+
});
|
|
369
|
+
|
|
12
370
|
// src/utils/text.js
|
|
13
371
|
import os from "os";
|
|
14
372
|
var wrapText, formatTokens, truncatePath;
|
|
@@ -99,16 +457,16 @@ var init_text = __esm({
|
|
|
99
457
|
});
|
|
100
458
|
|
|
101
459
|
// src/components/TerminalBox.jsx
|
|
102
|
-
import
|
|
103
|
-
import { Box, Text } from "ink";
|
|
460
|
+
import React2 from "react";
|
|
461
|
+
import { Box as Box2, Text as Text2 } from "ink";
|
|
104
462
|
var TerminalBox;
|
|
105
463
|
var init_TerminalBox = __esm({
|
|
106
464
|
"src/components/TerminalBox.jsx"() {
|
|
107
465
|
init_text();
|
|
108
|
-
TerminalBox =
|
|
466
|
+
TerminalBox = React2.memo(({ command, output, completed = false, isFocused = false, columns = 80 }) => {
|
|
109
467
|
const cleanOutput = (output || "").replace(/\r/g, "").trim();
|
|
110
468
|
const wrappedOutput = cleanOutput ? wrapText(cleanOutput, columns - 6) : "";
|
|
111
|
-
return /* @__PURE__ */
|
|
469
|
+
return /* @__PURE__ */ React2.createElement(Box2, { flexDirection: "column", borderStyle: isFocused ? "double" : "round", borderColor: completed ? "#334155" : isFocused ? "yellow" : "cyan", paddingX: 2, paddingY: completed ? 0 : 1, width: "100%" }, /* @__PURE__ */ React2.createElement(Box2, { marginBottom: 1 }, /* @__PURE__ */ React2.createElement(Text2, { color: completed ? "gray" : isFocused ? "yellow" : "cyan", bold: true }, completed ? "\u{1F3C1} FINISHED:" : "\u26A1 EXECUTING:", " "), /* @__PURE__ */ React2.createElement(Text2, { color: completed ? "gray" : "white" }, command)), wrappedOutput ? /* @__PURE__ */ React2.createElement(Box2, { marginTop: completed ? 0 : 1, backgroundColor: "#0a0a0a", paddingX: 1 }, /* @__PURE__ */ React2.createElement(Text2, { color: completed ? "gray" : "green" }, wrappedOutput)) : !completed && /* @__PURE__ */ React2.createElement(Box2, { marginTop: 1, backgroundColor: "#0a0a0a", paddingX: 1 }, /* @__PURE__ */ React2.createElement(Text2, { color: "gray", italic: true }, "Waiting for output...")), /* @__PURE__ */ React2.createElement(Box2, { justifyContent: "space-between", marginTop: 1 }, !completed ? /* @__PURE__ */ React2.createElement(Text2, { color: "gray", dimColor: true, italic: true }, "Double-press ESC to terminate if hanging.") : /* @__PURE__ */ React2.createElement(Box2, null), /* @__PURE__ */ React2.createElement(Text2, { color: completed ? "#475569" : isFocused ? "yellow" : "cyan", bold: true }, completed ? "\u25CF ARCHIVED" : isFocused ? "\u25B6 TERMINAL FOCUSED" : "\u25CF LIVE (Press TAB to focus)")));
|
|
112
470
|
});
|
|
113
471
|
}
|
|
114
472
|
});
|
|
@@ -136,8 +494,8 @@ var init_terminal = __esm({
|
|
|
136
494
|
});
|
|
137
495
|
|
|
138
496
|
// src/components/ChatLayout.jsx
|
|
139
|
-
import
|
|
140
|
-
import { Box as
|
|
497
|
+
import React3, { useState as useState2, useEffect as useEffect2, useRef as useRef2 } from "react";
|
|
498
|
+
import { Box as Box3, Text as Text3 } from "ink";
|
|
141
499
|
var TOOL_LABELS, cleanSignals, formatThinkText, parseMathSymbols, InlineMarkdown, TableRenderer, MarkdownText, DiffLine, DiffBlock, CodeRenderer, formatThinkingDuration, MessageItem, ChatLayout, ChatLayout_default;
|
|
142
500
|
var init_ChatLayout = __esm({
|
|
143
501
|
"src/components/ChatLayout.jsx"() {
|
|
@@ -231,37 +589,42 @@ var init_ChatLayout = __esm({
|
|
|
231
589
|
if (!cleaned) return null;
|
|
232
590
|
const availableWidth = columns - 10;
|
|
233
591
|
const wrapped = wrapText(cleaned.trim(), availableWidth);
|
|
234
|
-
return /* @__PURE__ */
|
|
592
|
+
return /* @__PURE__ */ React3.createElement(Box3, { width: "100%" }, /* @__PURE__ */ React3.createElement(Text3, { italic: true, color: "gray" }, wrapped));
|
|
235
593
|
};
|
|
236
594
|
parseMathSymbols = (content) => {
|
|
237
595
|
return content.replace(/\\multiply|\\mul|\\times/g, "\xD7").replace(/\\div/g, "\xF7").replace(/\\cdot/g, "\u22C5").replace(/\\infty/g, "\u221E").replace(/\\pm/g, "\xB1").replace(/\\leq/g, "\u2264").replace(/\\geq/g, "\u2265").replace(/\\neq/g, "\u2260").replace(/\\sqrt\{?(.*?)\}?/g, (_, p1) => `\u221A(${p1})`).replace(/\\alpha/g, "\u03B1").replace(/\\beta/g, "\u03B2").replace(/\\theta/g, "\u03B8").replace(/\\pi/g, "\u03C0").replace(/\\approx/g, "\u2248").replace(/\\Delta/g, "\u0394").replace(/\\sigma/g, "\u03C3").replace(/\\sum/g, "\u03A3").replace(/\\prod/g, "\u03A0").replace(/\\rightarrow|\\to/g, "\u2192").replace(/\\leftarrow/g, "\u2190").replace(/\\leftrightarrow/g, "\u2194").replace(/\\left\(|\\right\)/g, (match) => match.includes("left") ? "(" : ")").replace(/\\left\[|\\right\]/g, (match) => match.includes("left") ? "[" : "]").replace(/\\\{|\\\}/g, (match) => match.includes("{") ? "{" : "}").replace(/\\text\{?(.*?)\}?/g, "$1");
|
|
238
596
|
};
|
|
239
|
-
InlineMarkdown =
|
|
597
|
+
InlineMarkdown = React3.memo(({ text, color }) => {
|
|
240
598
|
if (!text) return null;
|
|
241
599
|
const parts = text.split(/(```[\s\S]*?```|`[^`]+`|@\[.*?\]|\*\*.*?\*\*|\*.*?\*|\$.*?\$|\[.*?\]\s*\(.*?\)|\[.*?\]\s*\[.*?\]|https?:\/\/[^\s]+)/g);
|
|
242
|
-
return /* @__PURE__ */
|
|
600
|
+
return /* @__PURE__ */ React3.createElement(Text3, { color, wrap: "anywhere" }, parts.map((part, j) => {
|
|
243
601
|
if (!part) return null;
|
|
244
602
|
if (part.startsWith("```") && part.endsWith("```")) {
|
|
245
|
-
return /* @__PURE__ */
|
|
603
|
+
return /* @__PURE__ */ React3.createElement(CodeRenderer, { key: j, text: part });
|
|
246
604
|
}
|
|
247
605
|
if (part.startsWith("**") && part.endsWith("**")) {
|
|
248
|
-
return /* @__PURE__ */
|
|
606
|
+
return /* @__PURE__ */ React3.createElement(Text3, { key: j, bold: true, color: "white" }, /* @__PURE__ */ React3.createElement(InlineMarkdown, { text: part.slice(2, -2), color: "white" }));
|
|
249
607
|
}
|
|
250
608
|
if (part.startsWith("*") && part.endsWith("*")) {
|
|
251
|
-
return /* @__PURE__ */
|
|
609
|
+
return /* @__PURE__ */ React3.createElement(Text3, { key: j, italic: true, color: "gray" }, /* @__PURE__ */ React3.createElement(InlineMarkdown, { text: part.slice(1, -1), color: "gray" }));
|
|
252
610
|
}
|
|
253
611
|
if (part.startsWith("`") && part.endsWith("`")) {
|
|
254
|
-
|
|
612
|
+
const content = part.slice(1, -1);
|
|
613
|
+
const formatted = content.replace(/@\[(.*?)\]/g, (match, p1) => {
|
|
614
|
+
return p1.split("/").pop().split("\\").pop().replace(/:L/gi, "#L");
|
|
615
|
+
});
|
|
616
|
+
const hasFileRef = content.includes("@[");
|
|
617
|
+
return /* @__PURE__ */ React3.createElement(Text3, { key: j, color: "cyan", bold: hasFileRef, backgroundColor: hasFileRef ? "#111124" : "#003333" }, " ", formatted, " ");
|
|
255
618
|
}
|
|
256
619
|
if (part.startsWith("@[") && part.endsWith("]")) {
|
|
257
620
|
const filePath = part.slice(2, -1);
|
|
258
|
-
const basename = filePath.split("/").pop().split("\\").pop();
|
|
259
|
-
return /* @__PURE__ */
|
|
621
|
+
const basename = filePath.split("/").pop().split("\\").pop().replace(/:L/gi, "#L");
|
|
622
|
+
return /* @__PURE__ */ React3.createElement(Text3, { key: j, color: "cyan", bold: true, backgroundColor: "#111124" }, " ", basename, " ");
|
|
260
623
|
}
|
|
261
624
|
if (part.startsWith("$") && part.endsWith("$")) {
|
|
262
625
|
const content = part.slice(1, -1);
|
|
263
626
|
const latexParts = content.split(/(\\(?:mathbf|textbf|textit|underline|text|mathrm|textsf|texttt)\{.*?\})/g);
|
|
264
|
-
return /* @__PURE__ */
|
|
627
|
+
return /* @__PURE__ */ React3.createElement(Text3, { key: j, color: "yellow" }, latexParts.map((lp, lpi) => {
|
|
265
628
|
if (lp.startsWith("\\")) {
|
|
266
629
|
const match = lp.match(/\\(\w+)\{(.*?)\}/);
|
|
267
630
|
if (match) {
|
|
@@ -271,27 +634,27 @@ var init_ChatLayout = __esm({
|
|
|
271
634
|
const isItalic = cmd === "textit";
|
|
272
635
|
const isUnderline = cmd === "underline";
|
|
273
636
|
const isMono = cmd === "texttt";
|
|
274
|
-
return /* @__PURE__ */
|
|
637
|
+
return /* @__PURE__ */ React3.createElement(Text3, { key: lpi, bold: isBold, italic: isItalic, underline: isUnderline, color: isMono ? "cyan" : void 0 }, parseMathSymbols(inner));
|
|
275
638
|
}
|
|
276
639
|
}
|
|
277
|
-
return /* @__PURE__ */
|
|
640
|
+
return /* @__PURE__ */ React3.createElement(Text3, { key: lpi }, parseMathSymbols(lp));
|
|
278
641
|
}));
|
|
279
642
|
}
|
|
280
643
|
if (part.startsWith("[") && (part.includes("](") || part.includes("] ("))) {
|
|
281
644
|
const match = part.match(/\[(.*?)\]\s*\((.*?)\)/);
|
|
282
|
-
if (match) return /* @__PURE__ */
|
|
645
|
+
if (match) return /* @__PURE__ */ React3.createElement(Text3, { key: j }, /* @__PURE__ */ React3.createElement(Text3, { color: "cyan", underline: true, bold: true }, match[1]), /* @__PURE__ */ React3.createElement(Text3, { color: "gray", dimColor: true, italic: true }, " (", match[2], ")"));
|
|
283
646
|
}
|
|
284
647
|
if (part.startsWith("[") && (part.includes("][") || part.includes("] ["))) {
|
|
285
648
|
const match = part.match(/\[(.*?)\]\s*\[(.*?)\]/);
|
|
286
|
-
if (match) return /* @__PURE__ */
|
|
649
|
+
if (match) return /* @__PURE__ */ React3.createElement(Text3, { key: j }, /* @__PURE__ */ React3.createElement(Text3, { color: "cyan", underline: true, bold: true }, match[1]), /* @__PURE__ */ React3.createElement(Text3, { color: "gray", dimColor: true, italic: true }, " [", match[2], "]"));
|
|
287
650
|
}
|
|
288
651
|
if (part.startsWith("http")) {
|
|
289
|
-
return /* @__PURE__ */
|
|
652
|
+
return /* @__PURE__ */ React3.createElement(Text3, { key: j, color: "cyan", underline: true, italic: true }, part);
|
|
290
653
|
}
|
|
291
654
|
return part;
|
|
292
655
|
}));
|
|
293
656
|
});
|
|
294
|
-
TableRenderer =
|
|
657
|
+
TableRenderer = React3.memo(({ buffer, terminalWidth = 80 }) => {
|
|
295
658
|
if (buffer.length < 2) return null;
|
|
296
659
|
const rows = buffer.map((line) => {
|
|
297
660
|
const parts = line.split("|");
|
|
@@ -304,9 +667,12 @@ var init_ChatLayout = __esm({
|
|
|
304
667
|
const colPercentage = Math.floor(100 / header.length);
|
|
305
668
|
const availableWidth = terminalWidth - 8;
|
|
306
669
|
const colChars = Math.floor(availableWidth / header.length) - 2;
|
|
307
|
-
return
|
|
670
|
+
return (
|
|
671
|
+
// Table MarginY here
|
|
672
|
+
/* @__PURE__ */ React3.createElement(Box3, { flexDirection: "column", borderStyle: "round", borderColor: "#454545ff", paddingX: 1, marginY: 0, width: "100%", flexGrow: 1 }, /* @__PURE__ */ React3.createElement(Box3, { flexDirection: "row", borderStyle: "single", borderBottom: true, borderTop: false, borderLeft: false, borderRight: false, borderColor: "#444", marginBottom: 1, paddingBottom: 0, width: "100%" }, header.map((cell, i) => /* @__PURE__ */ React3.createElement(Box3, { key: i, flexBasis: `${colPercentage}%`, flexGrow: 1, flexShrink: 0, paddingRight: 2 }, /* @__PURE__ */ React3.createElement(InlineMarkdown, { text: wrapText(cell, colChars), color: "cyan" })))), data.map((row, ri) => /* @__PURE__ */ React3.createElement(Box3, { key: ri, flexDirection: "row", marginBottom: ri === data.length - 1 ? 0 : 1, width: "100%" }, row.map((cell, ci) => /* @__PURE__ */ React3.createElement(Box3, { key: ci, flexBasis: `${colPercentage}%`, flexGrow: 1, flexShrink: 0, paddingRight: 2, flexDirection: "column" }, /* @__PURE__ */ React3.createElement(InlineMarkdown, { text: wrapText(cell, colChars), color: "white" }))))))
|
|
673
|
+
);
|
|
308
674
|
});
|
|
309
|
-
MarkdownText =
|
|
675
|
+
MarkdownText = React3.memo(({ text, color = "white", columns = 80 }) => {
|
|
310
676
|
if (!text) return null;
|
|
311
677
|
const lines = text.split("\n");
|
|
312
678
|
const result = [];
|
|
@@ -314,12 +680,12 @@ var init_ChatLayout = __esm({
|
|
|
314
680
|
let quoteBuffer = [];
|
|
315
681
|
const flushBuffers = (key) => {
|
|
316
682
|
if (tableBuffer.length > 0) {
|
|
317
|
-
result.push(/* @__PURE__ */
|
|
683
|
+
result.push(/* @__PURE__ */ React3.createElement(TableRenderer, { key: `table-${key}`, buffer: [...tableBuffer], terminalWidth: columns }));
|
|
318
684
|
tableBuffer = [];
|
|
319
685
|
}
|
|
320
686
|
if (quoteBuffer.length > 0) {
|
|
321
687
|
result.push(
|
|
322
|
-
/* @__PURE__ */
|
|
688
|
+
/* @__PURE__ */ React3.createElement(Box3, { key: `quote-${key}`, borderStyle: "bold", borderLeft: true, borderRight: false, borderTop: false, borderBottom: false, borderColor: "gray", paddingLeft: 1, marginY: 1, flexDirection: "column" }, quoteBuffer.map((line, qi) => /* @__PURE__ */ React3.createElement(InlineMarkdown, { key: qi, text: line, color: "gray" })))
|
|
323
689
|
);
|
|
324
690
|
quoteBuffer = [];
|
|
325
691
|
}
|
|
@@ -337,11 +703,11 @@ var init_ChatLayout = __esm({
|
|
|
337
703
|
} else {
|
|
338
704
|
flushBuffers(i);
|
|
339
705
|
if (trimmed === "") {
|
|
340
|
-
result.push(/* @__PURE__ */
|
|
706
|
+
result.push(/* @__PURE__ */ React3.createElement(Box3, { key: i, height: 1 }));
|
|
341
707
|
return;
|
|
342
708
|
}
|
|
343
709
|
if (trimmed === "---" || trimmed === "***" || trimmed === "___") {
|
|
344
|
-
result.push(/* @__PURE__ */
|
|
710
|
+
result.push(/* @__PURE__ */ React3.createElement(Box3, { key: i, marginY: 1, borderStyle: "single", borderTop: true, borderBottom: false, borderLeft: false, borderRight: false, width: "100%", borderColor: "#333" }));
|
|
345
711
|
return;
|
|
346
712
|
}
|
|
347
713
|
const headingMatch = trimmed.match(/^(#{1,6})\s+(.*)/);
|
|
@@ -349,7 +715,7 @@ var init_ChatLayout = __esm({
|
|
|
349
715
|
const level = headingMatch[1].length;
|
|
350
716
|
const hText = headingMatch[2];
|
|
351
717
|
result.push(
|
|
352
|
-
/* @__PURE__ */
|
|
718
|
+
/* @__PURE__ */ React3.createElement(Box3, { key: i, marginTop: 1, marginBottom: 1, width: "100%" }, /* @__PURE__ */ React3.createElement(Text3, { bold: true, color: level === 1 ? "cyan" : level === 2 ? "magenta" : level === 3 ? "yellow" : level === 4 ? "green" : level === 5 ? "blue" : "white", underline: true }, hText.toUpperCase()))
|
|
353
719
|
);
|
|
354
720
|
return;
|
|
355
721
|
}
|
|
@@ -368,14 +734,14 @@ var init_ChatLayout = __esm({
|
|
|
368
734
|
content = wrapText(trimmed, columns - 4);
|
|
369
735
|
}
|
|
370
736
|
result.push(
|
|
371
|
-
/* @__PURE__ */
|
|
737
|
+
/* @__PURE__ */ React3.createElement(Box3, { key: i, width: "100%" }, /* @__PURE__ */ React3.createElement(InlineMarkdown, { text: content, color }))
|
|
372
738
|
);
|
|
373
739
|
}
|
|
374
740
|
});
|
|
375
741
|
flushBuffers("final");
|
|
376
|
-
return /* @__PURE__ */
|
|
742
|
+
return /* @__PURE__ */ React3.createElement(Box3, { flexDirection: "column", width: columns - 2 }, result);
|
|
377
743
|
});
|
|
378
|
-
DiffLine =
|
|
744
|
+
DiffLine = React3.memo(({ line, columns = 80 }) => {
|
|
379
745
|
const isContext = line.includes("[UI_CONTEXT]");
|
|
380
746
|
const cleanLine = line.replace("[UI_CONTEXT]", "");
|
|
381
747
|
const isRemoval = cleanLine.startsWith("-");
|
|
@@ -385,18 +751,18 @@ var init_ChatLayout = __esm({
|
|
|
385
751
|
const content = parts.slice(1).join("|");
|
|
386
752
|
const bgColor = isRemoval ? "#3a0c0c" : isAddition ? "#0c3a1a" : "#1a1a1a";
|
|
387
753
|
const textColor = isRemoval ? "#ff4d4d" : isAddition ? "#4dff88" : "white";
|
|
388
|
-
return /* @__PURE__ */
|
|
754
|
+
return /* @__PURE__ */ React3.createElement(Box3, { backgroundColor: bgColor, paddingX: 1, width: "100%" }, /* @__PURE__ */ React3.createElement(Box3, { width: 5, flexShrink: 0 }, /* @__PURE__ */ React3.createElement(Text3, { color: isRemoval ? "#cf3a3a" : isAddition ? "#3acf65" : "gray", dimColor: true }, lineNum)), /* @__PURE__ */ React3.createElement(Box3, { width: 2, flexShrink: 0, marginLeft: 1 }, /* @__PURE__ */ React3.createElement(Text3, { color: textColor, bold: true }, isRemoval ? "-" : isAddition ? "+" : " ")), /* @__PURE__ */ React3.createElement(Box3, { flexGrow: 1, marginLeft: 1 }, /* @__PURE__ */ React3.createElement(Text3, { color: textColor }, wrapText(content, columns - 10))));
|
|
389
755
|
});
|
|
390
|
-
DiffBlock =
|
|
756
|
+
DiffBlock = React3.memo(({ text, columns = 80 }) => {
|
|
391
757
|
const match = text.match(/\[DIFF_START\]([\s\S]*?)\[DIFF_END\]/);
|
|
392
758
|
const diffBody = match ? match[1].trim() : "";
|
|
393
759
|
const diffLines = diffBody.split("\n");
|
|
394
|
-
return /* @__PURE__ */
|
|
760
|
+
return /* @__PURE__ */ React3.createElement(Box3, { flexDirection: "column", width: "100%", marginBottom: 0 }, /* @__PURE__ */ React3.createElement(Box3, { flexDirection: "column", backgroundColor: "#1a1a1a", paddingY: 0, width: "100%" }, diffLines.map((line, i) => /* @__PURE__ */ React3.createElement(DiffLine, { key: i, line, columns }))));
|
|
395
761
|
});
|
|
396
|
-
CodeRenderer =
|
|
762
|
+
CodeRenderer = React3.memo(({ text, columns = 80 }) => {
|
|
397
763
|
if (!text) return null;
|
|
398
764
|
if (text.includes("[DIFF_START]")) {
|
|
399
|
-
return /* @__PURE__ */
|
|
765
|
+
return /* @__PURE__ */ React3.createElement(DiffBlock, { text, columns });
|
|
400
766
|
}
|
|
401
767
|
if (text.includes("- Content Preview:")) {
|
|
402
768
|
const mainParts = text.split("- Content Preview:");
|
|
@@ -408,23 +774,31 @@ var init_ChatLayout = __esm({
|
|
|
408
774
|
const footer = contentAndFooter[1] ? `${footerMarker}${contentAndFooter[1]}` : "";
|
|
409
775
|
const codeLines = content.split("\n");
|
|
410
776
|
const gutterWidth = String(codeLines.length).length;
|
|
411
|
-
return /* @__PURE__ */
|
|
777
|
+
return /* @__PURE__ */ React3.createElement(Box3, { flexDirection: "column", width: "100%" }, /* @__PURE__ */ React3.createElement(Box3, { flexDirection: "column", borderStyle: "round", borderColor: "#444", paddingX: 1, width: "100%" }, /* @__PURE__ */ React3.createElement(Box3, { alignSelf: "flex-end", marginTop: -1, marginRight: 1 }, /* @__PURE__ */ React3.createElement(Text3, { backgroundColor: "#444", color: "white" }, " FILE SNAPSHOT ")), /* @__PURE__ */ React3.createElement(Box3, { flexDirection: "column", paddingY: 1, width: "100%" }, codeLines.map((line, idx) => /* @__PURE__ */ React3.createElement(Box3, { key: idx, width: "100%" }, /* @__PURE__ */ React3.createElement(Box3, { width: gutterWidth + 2, flexShrink: 0 }, /* @__PURE__ */ React3.createElement(Text3, { color: "gray", dimColor: true }, String(idx + 1).padStart(gutterWidth, " "), " ")), /* @__PURE__ */ React3.createElement(Box3, { flexGrow: 1 }, /* @__PURE__ */ React3.createElement(Text3, { color: "white" }, line)))))));
|
|
412
778
|
}
|
|
413
779
|
if (text.includes("```")) {
|
|
414
780
|
const parts = text.split(/(```\w*\n?[\s\S]*?(?:```|$))/g);
|
|
415
|
-
return /* @__PURE__ */
|
|
781
|
+
return /* @__PURE__ */ React3.createElement(Box3, { flexDirection: "column", width: "100%" }, parts.map((part, i) => {
|
|
416
782
|
if (part.startsWith("```")) {
|
|
417
783
|
const match = part.match(/```(\w*)\n?([\s\S]*?)(?:```|$)/);
|
|
418
784
|
const lang = match ? match[1] : "code";
|
|
419
785
|
const code = match ? match[2] : part.replace(/^```\w*\n?/, "").replace(/```$/, "");
|
|
420
786
|
const codeLines = code.trimEnd().split("\n");
|
|
421
787
|
const gutterWidth = String(codeLines.length).length;
|
|
422
|
-
return /* @__PURE__ */
|
|
788
|
+
return /* @__PURE__ */ React3.createElement(Box3, { key: i, flexDirection: "column", marginY: 0, backgroundColor: "#111", borderStyle: "round", borderColor: "#333", paddingX: 1, width: "100%" }, /* @__PURE__ */ React3.createElement(Box3, { alignSelf: "flex-end", marginTop: -1, marginRight: 1 }, /* @__PURE__ */ React3.createElement(Text3, { backgroundColor: "#333", color: "white" }, " ", lang.toUpperCase(), " ")), /* @__PURE__ */ React3.createElement(Box3, { flexDirection: "column", paddingY: 1, width: "100%" }, codeLines.map((line, idx) => /* @__PURE__ */ React3.createElement(Box3, { key: idx, width: "100%" }, /* @__PURE__ */ React3.createElement(Box3, { width: gutterWidth + 2, flexShrink: 0 }, /* @__PURE__ */ React3.createElement(Text3, { color: "gray", dimColor: true }, String(idx + 1).padStart(gutterWidth, " "), " ")), /* @__PURE__ */ React3.createElement(Box3, { flexGrow: 1 }, /* @__PURE__ */ React3.createElement(Text3, { color: "cyan" }, line))))));
|
|
423
789
|
}
|
|
424
|
-
|
|
790
|
+
let cleanPart = part;
|
|
791
|
+
if (i > 0) {
|
|
792
|
+
cleanPart = cleanPart.replace(/^[\r\n]+/, "");
|
|
793
|
+
}
|
|
794
|
+
if (i < parts.length - 1) {
|
|
795
|
+
cleanPart = cleanPart.replace(/[\r\n]+$/, "");
|
|
796
|
+
}
|
|
797
|
+
if (!cleanPart) return null;
|
|
798
|
+
return /* @__PURE__ */ React3.createElement(MarkdownText, { key: i, text: cleanPart, columns });
|
|
425
799
|
}));
|
|
426
800
|
}
|
|
427
|
-
return /* @__PURE__ */
|
|
801
|
+
return /* @__PURE__ */ React3.createElement(MarkdownText, { text, columns });
|
|
428
802
|
});
|
|
429
803
|
formatThinkingDuration = (ms) => {
|
|
430
804
|
const totalSecs = Math.round(ms / 1e3);
|
|
@@ -436,44 +810,44 @@ var init_ChatLayout = __esm({
|
|
|
436
810
|
}
|
|
437
811
|
return `${totalSecs}s`;
|
|
438
812
|
};
|
|
439
|
-
MessageItem =
|
|
813
|
+
MessageItem = React3.memo(({ msg, showFullThinking, columns = 80 }) => {
|
|
440
814
|
const isDiffResult = msg.role === "system" && (msg.text?.includes("[DIFF_START]") || msg.text?.includes("- Content Preview:"));
|
|
441
815
|
const isPatchError = msg.role === "system" && msg.text?.includes("[TOOL RESULT]: ERROR:") && (msg.toolName === "update_file" || msg.text?.includes("Could not find exact match"));
|
|
442
816
|
const isTerminalRecord = msg.isTerminalRecord;
|
|
443
817
|
const isHomeWarning = msg.isHomeWarning;
|
|
444
818
|
if (isHomeWarning) {
|
|
445
|
-
return /* @__PURE__ */
|
|
819
|
+
return /* @__PURE__ */ React3.createElement(Box3, { marginBottom: 1, paddingX: 1, width: "100%" }, /* @__PURE__ */ React3.createElement(Box3, { flexDirection: "column", borderStyle: "round", borderColor: "red", padding: 0, width: "100%" }, /* @__PURE__ */ React3.createElement(Box3, { paddingX: 1, backgroundColor: "#3a0000" }, /* @__PURE__ */ React3.createElement(Text3, { color: "red", bold: true }, msg.text)), /* @__PURE__ */ React3.createElement(Box3, { paddingX: 1, marginTop: 1, marginBottom: 1 }, /* @__PURE__ */ React3.createElement(Text3, { color: "white" }, msg.subText))));
|
|
446
820
|
}
|
|
447
821
|
if (msg.isLogo) {
|
|
448
|
-
return /* @__PURE__ */
|
|
822
|
+
return /* @__PURE__ */ React3.createElement(Box3, { flexDirection: "column", alignItems: "center", width: "100%", marginY: 1 }, /* @__PURE__ */ React3.createElement(Text3, null, msg.text));
|
|
449
823
|
}
|
|
450
824
|
if (msg.id && String(msg.id).startsWith("welcome")) {
|
|
451
|
-
return /* @__PURE__ */
|
|
825
|
+
return /* @__PURE__ */ React3.createElement(Box3, { flexDirection: "column", alignItems: "center", width: "100%", marginY: 1 }, /* @__PURE__ */ React3.createElement(Box3, { borderStyle: "round", borderColor: "gray", paddingX: 3, paddingY: 0 }, /* @__PURE__ */ React3.createElement(Text3, { color: "cyan", bold: true }, msg.text.trim())));
|
|
452
826
|
}
|
|
453
827
|
if (msg.isVisualFeedback) {
|
|
454
828
|
return (
|
|
455
829
|
// [SPACE POINT]
|
|
456
|
-
/* @__PURE__ */
|
|
830
|
+
/* @__PURE__ */ React3.createElement(Box3, { marginBottom: 0, marginTop: 0, paddingX: 1, width: "100%" }, /* @__PURE__ */ React3.createElement(Text3, { color: "white" }, msg.text))
|
|
457
831
|
);
|
|
458
832
|
}
|
|
459
833
|
if (isPatchError) {
|
|
460
|
-
return /* @__PURE__ */
|
|
834
|
+
return /* @__PURE__ */ React3.createElement(Box3, { marginBottom: 1 }, /* @__PURE__ */ React3.createElement(Box3, { flexDirection: "column", borderStyle: "round", borderColor: "red", paddingX: 1, paddingY: 0 }, /* @__PURE__ */ React3.createElement(Text3, { color: "red", bold: true, underline: true }, "\u274C PATCH FAILED"), /* @__PURE__ */ React3.createElement(Box3, { marginTop: 1 }, /* @__PURE__ */ React3.createElement(Text3, { color: "red" }, "Patch failed: ", /* @__PURE__ */ React3.createElement(Text3, { color: "white", bold: true }, "Model generated malformed edit.")))));
|
|
461
835
|
}
|
|
462
836
|
if (msg.role === "system" && msg.text?.includes("[TOOL RESULT]") && !isDiffResult && !isTerminalRecord && !isPatchError) return null;
|
|
463
837
|
if (msg.isImageStats) {
|
|
464
|
-
return /* @__PURE__ */
|
|
838
|
+
return /* @__PURE__ */ React3.createElement(Box3, { marginBottom: 1, paddingX: 1, width: "100%" }, /* @__PURE__ */ React3.createElement(Box3, { flexDirection: "column", borderStyle: "round", borderColor: "cyan", padding: 0, width: "100%" }, /* @__PURE__ */ React3.createElement(Box3, { paddingX: 1, backgroundColor: "#0e1b21" }, /* @__PURE__ */ React3.createElement(Text3, { color: "cyan", bold: true }, "\u{1F4B3} IMAGE STATS")), /* @__PURE__ */ React3.createElement(Box3, { paddingX: 1, marginTop: 1, marginBottom: 1, flexDirection: "column" }, msg.text.split("\n").map((line, i) => /* @__PURE__ */ React3.createElement(Text3, { key: i, color: "white" }, line)))));
|
|
465
839
|
}
|
|
466
840
|
if (msg.isAskRecord) {
|
|
467
841
|
const selectionMatch = msg.text.match(/Selection: (.*)/);
|
|
468
842
|
const selection = selectionMatch ? selectionMatch[1] : "No selection";
|
|
469
843
|
const s = emojiSpace(2);
|
|
470
|
-
return /* @__PURE__ */
|
|
844
|
+
return /* @__PURE__ */ React3.createElement(Box3, { marginBottom: 1, paddingX: 1, width: "100%" }, /* @__PURE__ */ React3.createElement(Box3, { flexDirection: "column", borderStyle: "round", borderColor: "gray", padding: 0, width: "100%" }, /* @__PURE__ */ React3.createElement(Box3, { paddingX: 1 }, /* @__PURE__ */ React3.createElement(Text3, { color: "cyan", bold: true }, "\u{1F4AC} AGENT REQUEST: RESOLVED")), /* @__PURE__ */ React3.createElement(Box3, { paddingX: 1, marginTop: 1, marginBottom: 1 }, /* @__PURE__ */ React3.createElement(Text3, { color: "white" }, "Selection: ", /* @__PURE__ */ React3.createElement(Text3, { color: "yellow", bold: true }, selection)))));
|
|
471
845
|
}
|
|
472
846
|
if (msg.isAboutRecord) {
|
|
473
|
-
return /* @__PURE__ */
|
|
847
|
+
return /* @__PURE__ */ React3.createElement(Box3, { marginBottom: 1, paddingX: 1, width: "100%" }, /* @__PURE__ */ React3.createElement(Box3, { flexDirection: "column", borderStyle: "round", borderColor: "gray", padding: 0, width: "100%" }, /* @__PURE__ */ React3.createElement(Box3, { paddingX: 1 }, /* @__PURE__ */ React3.createElement(Text3, { color: "cyan", bold: true }, "\u{1F4A0} ABOUT FLUX FLOW")), /* @__PURE__ */ React3.createElement(Box3, { paddingX: 1, marginTop: 1, marginBottom: 1 }, /* @__PURE__ */ React3.createElement(Text3, null, msg.text))));
|
|
474
848
|
}
|
|
475
849
|
if (msg.isUpdateNotification) {
|
|
476
|
-
return /* @__PURE__ */
|
|
850
|
+
return /* @__PURE__ */ React3.createElement(Box3, { marginBottom: 1, paddingX: 1, width: "100%" }, /* @__PURE__ */ React3.createElement(Box3, { flexDirection: "column", borderStyle: "round", borderColor: "gray", padding: 0, width: "100%" }, /* @__PURE__ */ React3.createElement(Box3, { paddingX: 1 }, /* @__PURE__ */ React3.createElement(Text3, { color: "cyan", bold: true }, "\u{1F680} FLUX FLOW UPDATE AVAILABLE")), /* @__PURE__ */ React3.createElement(Box3, { paddingX: 1, marginTop: 1, marginBottom: 1 }, /* @__PURE__ */ React3.createElement(CodeRenderer, { text: msg.text, columns }))));
|
|
477
851
|
}
|
|
478
852
|
if (msg.isHelpRecord) {
|
|
479
853
|
const commandList = [
|
|
@@ -500,21 +874,21 @@ var init_ChatLayout = __esm({
|
|
|
500
874
|
{ cmd: "/fluxflow", desc: "Project management" },
|
|
501
875
|
{ cmd: "/update", desc: "Check/Install updates" }
|
|
502
876
|
];
|
|
503
|
-
return /* @__PURE__ */
|
|
877
|
+
return /* @__PURE__ */ React3.createElement(Box3, { marginBottom: 1, paddingX: 1, width: "100%" }, /* @__PURE__ */ React3.createElement(Box3, { flexDirection: "column", borderStyle: "round", borderColor: "magenta", paddingX: 2, paddingY: 1, width: "100%" }, /* @__PURE__ */ React3.createElement(Text3, { color: "magenta", bold: true, underline: true }, "\u{1F4DC} COMMAND REFERENCE"), /* @__PURE__ */ React3.createElement(Box3, { flexDirection: "column", marginTop: 1 }, commandList.map((c, i) => /* @__PURE__ */ React3.createElement(Box3, { key: i, flexDirection: "row" }, /* @__PURE__ */ React3.createElement(Box3, { width: 15 }, /* @__PURE__ */ React3.createElement(Text3, { color: "cyan", bold: true }, c.cmd)), /* @__PURE__ */ React3.createElement(Text3, { color: "gray" }, " - ", c.desc))))));
|
|
504
878
|
}
|
|
505
879
|
if (isTerminalRecord) {
|
|
506
880
|
const cmdMatch = msg.text.match(/COMMAND: (.*)\n/);
|
|
507
881
|
const outputMatch = msg.text.match(/OUTPUT: ([\s\S]*)$/);
|
|
508
882
|
const cmd = cmdMatch ? cmdMatch[1] : "Unknown";
|
|
509
883
|
const outputList = outputMatch ? outputMatch[1] : "";
|
|
510
|
-
return /* @__PURE__ */
|
|
884
|
+
return /* @__PURE__ */ React3.createElement(Box3, { marginBottom: 1, paddingX: 1, width: "100%" }, /* @__PURE__ */ React3.createElement(TerminalBox, { command: cmd, output: outputList, completed: true, columns }));
|
|
511
885
|
}
|
|
512
|
-
const [animationDone, setAnimationDone] =
|
|
513
|
-
const content =
|
|
514
|
-
|
|
886
|
+
const [animationDone, setAnimationDone] = React3.useState(!msg.isStreaming);
|
|
887
|
+
const content = React3.useMemo(() => cleanSignals(msg.text), [msg.text]);
|
|
888
|
+
React3.useEffect(() => {
|
|
515
889
|
if (msg.isStreaming) setAnimationDone(false);
|
|
516
890
|
}, [msg.id]);
|
|
517
|
-
const finalContent =
|
|
891
|
+
const finalContent = React3.useMemo(() => {
|
|
518
892
|
if (msg.role === "think" && !showFullThinking) {
|
|
519
893
|
return "Thinking...";
|
|
520
894
|
}
|
|
@@ -522,8 +896,8 @@ var init_ChatLayout = __esm({
|
|
|
522
896
|
}, [content, msg.role, showFullThinking, msg.isStreaming]);
|
|
523
897
|
return (
|
|
524
898
|
// [SPACE POINT]
|
|
525
|
-
/* @__PURE__ */
|
|
526
|
-
|
|
899
|
+
/* @__PURE__ */ React3.createElement(Box3, { marginBottom: msg.role === "think" ? 0 : msg.role === "user" ? 1 : msg.role === "agent" ? 0 : 1, marginTop: msg.role === "think" ? 0 : msg.role === "user" ? 0 : msg.role === "agent" ? 0 : 0, flexDirection: "column", flexShrink: 0, width: "100%", flexGrow: 1 }, msg.role === "user" ? /* @__PURE__ */ React3.createElement(
|
|
900
|
+
Box3,
|
|
527
901
|
{
|
|
528
902
|
backgroundColor: "#262626",
|
|
529
903
|
paddingX: 1,
|
|
@@ -534,12 +908,12 @@ var init_ChatLayout = __esm({
|
|
|
534
908
|
wrapText(
|
|
535
909
|
finalContent.replace(/\r\n/g, "\n").replace(/\r/g, "\n").replace(/\\\n/g, "\n").replace(/\\$/, ""),
|
|
536
910
|
columns - 6
|
|
537
|
-
).split("\n").map((line, lineIdx) => /* @__PURE__ */
|
|
538
|
-
) : msg.role === "think" ? /* @__PURE__ */
|
|
911
|
+
).split("\n").map((line, lineIdx) => /* @__PURE__ */ React3.createElement(Box3, { key: lineIdx, flexDirection: "row", width: "100%" }, /* @__PURE__ */ React3.createElement(Box3, { flexShrink: 0, width: 2 }, /* @__PURE__ */ React3.createElement(Text3, { bold: true, color: "white" }, lineIdx === 0 ? "\u276F" : " ")), /* @__PURE__ */ React3.createElement(Box3, { flexGrow: 1, marginLeft: 1 }, /* @__PURE__ */ React3.createElement(InlineMarkdown, { text: line, color: msg.color || "white" }))))
|
|
912
|
+
) : msg.role === "think" ? /* @__PURE__ */ React3.createElement(Box3, { flexDirection: "column", marginTop: 0, marginBottom: 0, paddingX: 1, width: "100%" }, msg.isStreaming && !msg.duration ? /* @__PURE__ */ React3.createElement(Text3, { bold: true, color: "white" }, "\u2727 Thinking...") : /* @__PURE__ */ React3.createElement(Text3, { bold: true, color: "white" }, "\u2726 Thought", msg.duration ? /* @__PURE__ */ React3.createElement(Text3, { color: "gray" }, " for ", /* @__PURE__ */ React3.createElement(Text3, { bold: true, color: "cyan" }, formatThinkingDuration(msg.duration))) : ""), /* @__PURE__ */ React3.createElement(Box3, { borderStyle: "single", borderLeft: true, borderRight: false, borderTop: false, borderBottom: false, paddingLeft: 2, paddingTop: 1, paddingBottom: 1, flexDirection: "column", width: "100%" }, formatThinkText(finalContent, columns))) : /* @__PURE__ */ React3.createElement(Box3, { flexDirection: "column", paddingX: 1, marginTop: 0, width: "100%" }, /* @__PURE__ */ React3.createElement(CodeRenderer, { text: finalContent.replace(/ \|\n\n/g, " |\n"), columns }), msg.memoryUpdated && /* @__PURE__ */ React3.createElement(Box3, { marginTop: 1, width: "100%" }, /* @__PURE__ */ React3.createElement(Text3, { color: "yellow", italic: true }, "\u2728 [Memory Updated]")), msg.role === "agent" && msg.workedDuration ? /* @__PURE__ */ React3.createElement(Box3, { marginTop: 1, marginBottom: 2, width: "100%" }, /* @__PURE__ */ React3.createElement(Text3, null, "["), /* @__PURE__ */ React3.createElement(Text3, { color: "gray" }, "\u26A1 Worked for ", /* @__PURE__ */ React3.createElement(Text3, { bold: true, color: "cyan" }, formatThinkingDuration(msg.workedDuration))), /* @__PURE__ */ React3.createElement(Text3, null, "]")) : null))
|
|
539
913
|
);
|
|
540
914
|
});
|
|
541
|
-
ChatLayout =
|
|
542
|
-
return /* @__PURE__ */
|
|
915
|
+
ChatLayout = React3.memo(({ messages, showFullThinking, columns = 80 }) => {
|
|
916
|
+
return /* @__PURE__ */ React3.createElement(Box3, { flexDirection: "column", width: "100%" }, messages.map((msg, idx) => /* @__PURE__ */ React3.createElement(
|
|
543
917
|
MessageItem,
|
|
544
918
|
{
|
|
545
919
|
key: msg.id || idx,
|
|
@@ -554,17 +928,17 @@ var init_ChatLayout = __esm({
|
|
|
554
928
|
});
|
|
555
929
|
|
|
556
930
|
// src/components/StatusBar.jsx
|
|
557
|
-
import
|
|
558
|
-
import { Box as
|
|
931
|
+
import React4 from "react";
|
|
932
|
+
import { Box as Box4, Text as Text4 } from "ink";
|
|
559
933
|
var StatusBar, StatusBar_default;
|
|
560
934
|
var init_StatusBar = __esm({
|
|
561
935
|
"src/components/StatusBar.jsx"() {
|
|
562
936
|
init_text();
|
|
563
|
-
StatusBar =
|
|
937
|
+
StatusBar = React4.memo(({ mode, thinkingLevel, tokens = "0.0k", tokensTotal = "0.0k", chatId = "NEW-SESSION", isMemoryEnabled = true }) => {
|
|
564
938
|
const modeColor = mode === "Flux" ? "yellow" : "cyan";
|
|
565
939
|
const modeIcon = mode === "Flux" ? "\u26A1" : "\u{1F30A}";
|
|
566
|
-
return /* @__PURE__ */
|
|
567
|
-
|
|
940
|
+
return /* @__PURE__ */ React4.createElement(
|
|
941
|
+
Box4,
|
|
568
942
|
{
|
|
569
943
|
borderStyle: "round",
|
|
570
944
|
borderColor: "gray",
|
|
@@ -573,9 +947,9 @@ var init_StatusBar = __esm({
|
|
|
573
947
|
paddingX: 1,
|
|
574
948
|
width: "100%"
|
|
575
949
|
},
|
|
576
|
-
/* @__PURE__ */
|
|
577
|
-
/* @__PURE__ */
|
|
578
|
-
/* @__PURE__ */
|
|
950
|
+
/* @__PURE__ */ React4.createElement(Box4, null, /* @__PURE__ */ React4.createElement(Box4, { marginRight: 1 }, /* @__PURE__ */ React4.createElement(Text4, { color: modeColor, bold: true }, modeIcon, " ", mode.toUpperCase())), /* @__PURE__ */ React4.createElement(Text4, { color: "gray", dimColor: true }, "\u2503 "), /* @__PURE__ */ React4.createElement(Box4, { marginX: 1 }, /* @__PURE__ */ React4.createElement(Text4, { color: "magenta" }, "\u{1F9E0} ", thinkingLevel)), /* @__PURE__ */ React4.createElement(Text4, { color: "gray", dimColor: true }, "\u2503 "), /* @__PURE__ */ React4.createElement(Box4, { marginX: 1 }, /* @__PURE__ */ React4.createElement(Text4, { color: "gray" }, "MEM: "), /* @__PURE__ */ React4.createElement(Text4, { color: isMemoryEnabled ? "green" : "red", bold: true }, isMemoryEnabled ? "ON" : "OFF"))),
|
|
951
|
+
/* @__PURE__ */ React4.createElement(Box4, { flexGrow: 1, justifyContent: "center", paddingX: 2 }, /* @__PURE__ */ React4.createElement(Text4, null, "\u{1F4C1}"), /* @__PURE__ */ React4.createElement(Text4, { color: "gray", italic: true }, " ", truncatePath(process.cwd(), 35))),
|
|
952
|
+
/* @__PURE__ */ React4.createElement(Box4, null, /* @__PURE__ */ React4.createElement(Text4, { color: "gray", dimColor: true }, "\u2503 "), /* @__PURE__ */ React4.createElement(Box4, { marginX: 1 }, /* @__PURE__ */ React4.createElement(Text4, null, "\u2728"), /* @__PURE__ */ React4.createElement(Text4, { color: "blue" }, " ", formatTokens(tokensTotal), " ", /* @__PURE__ */ React4.createElement(Text4, { dimColor: true }, "(", (tokens / 254e3 * 100).toFixed(0), "%)"))), /* @__PURE__ */ React4.createElement(Text4, { color: "gray", dimColor: true }, "\u2503 "), /* @__PURE__ */ React4.createElement(Box4, { marginLeft: 1 }, /* @__PURE__ */ React4.createElement(Text4, null, "\u{1F194}"), /* @__PURE__ */ React4.createElement(Text4, { color: "gray", dimColor: true, italic: true }, " ", chatId)))
|
|
579
953
|
);
|
|
580
954
|
});
|
|
581
955
|
StatusBar_default = StatusBar;
|
|
@@ -583,12 +957,12 @@ var init_StatusBar = __esm({
|
|
|
583
957
|
});
|
|
584
958
|
|
|
585
959
|
// src/components/CommandMenu.jsx
|
|
586
|
-
import
|
|
587
|
-
import { Box as
|
|
960
|
+
import React5 from "react";
|
|
961
|
+
import { Box as Box5, Text as Text5 } from "ink";
|
|
588
962
|
import SelectInput from "ink-select-input";
|
|
589
963
|
function CommandMenu({ title, subtitle, items, onSelect }) {
|
|
590
|
-
return /* @__PURE__ */
|
|
591
|
-
|
|
964
|
+
return /* @__PURE__ */ React5.createElement(
|
|
965
|
+
Box5,
|
|
592
966
|
{
|
|
593
967
|
flexDirection: "column",
|
|
594
968
|
borderStyle: "round",
|
|
@@ -598,9 +972,9 @@ function CommandMenu({ title, subtitle, items, onSelect }) {
|
|
|
598
972
|
flexShrink: 0,
|
|
599
973
|
width: "100%"
|
|
600
974
|
},
|
|
601
|
-
/* @__PURE__ */
|
|
602
|
-
subtitle && /* @__PURE__ */
|
|
603
|
-
/* @__PURE__ */
|
|
975
|
+
/* @__PURE__ */ React5.createElement(Box5, { paddingX: 1, paddingY: 0, marginBottom: subtitle ? 0 : 1 }, /* @__PURE__ */ React5.createElement(Text5, { color: "magenta", bold: true }, "\u{1F527} ", title.toUpperCase())),
|
|
976
|
+
subtitle && /* @__PURE__ */ React5.createElement(Box5, { paddingX: 1, marginBottom: 1 }, /* @__PURE__ */ React5.createElement(Text5, { color: "yellow", dimColor: true, italic: true }, " ", subtitle)),
|
|
977
|
+
/* @__PURE__ */ React5.createElement(Box5, { flexDirection: "column", width: "100%" }, /* @__PURE__ */ React5.createElement(
|
|
604
978
|
SelectInput,
|
|
605
979
|
{
|
|
606
980
|
items,
|
|
@@ -609,7 +983,7 @@ function CommandMenu({ title, subtitle, items, onSelect }) {
|
|
|
609
983
|
indicatorComponent: () => null
|
|
610
984
|
}
|
|
611
985
|
)),
|
|
612
|
-
/* @__PURE__ */
|
|
986
|
+
/* @__PURE__ */ React5.createElement(Box5, { paddingX: 1, marginTop: 1 }, /* @__PURE__ */ React5.createElement(Text5, { color: "gray", dimColor: true, italic: true }, "(Arrows to select \u2022 Enter to confirm)"))
|
|
613
987
|
);
|
|
614
988
|
}
|
|
615
989
|
var CustomItem;
|
|
@@ -617,23 +991,23 @@ var init_CommandMenu = __esm({
|
|
|
617
991
|
"src/components/CommandMenu.jsx"() {
|
|
618
992
|
CustomItem = ({ label, isSelected }) => {
|
|
619
993
|
const isCancel = label === "Cancel" || label === "Back" || label.toLowerCase().includes("exit") || label.toLowerCase().includes("back");
|
|
620
|
-
return /* @__PURE__ */
|
|
621
|
-
|
|
994
|
+
return /* @__PURE__ */ React5.createElement(
|
|
995
|
+
Box5,
|
|
622
996
|
{
|
|
623
997
|
marginTop: isCancel ? 1 : 0,
|
|
624
998
|
backgroundColor: isSelected ? "#2a2a2a" : void 0,
|
|
625
999
|
paddingX: 1,
|
|
626
1000
|
width: "100%"
|
|
627
1001
|
},
|
|
628
|
-
/* @__PURE__ */
|
|
1002
|
+
/* @__PURE__ */ React5.createElement(Text5, { color: isSelected ? "cyan" : "white", bold: isSelected }, isSelected ? "\u276F " : " ", label)
|
|
629
1003
|
);
|
|
630
1004
|
};
|
|
631
1005
|
}
|
|
632
1006
|
});
|
|
633
1007
|
|
|
634
1008
|
// src/components/SettingsMenu.jsx
|
|
635
|
-
import
|
|
636
|
-
import { Box as
|
|
1009
|
+
import React6, { useState as useState3 } from "react";
|
|
1010
|
+
import { Box as Box6, Text as Text6, useInput as useInput2 } from "ink";
|
|
637
1011
|
import TextInput from "ink-text-input";
|
|
638
1012
|
function SettingsMenu({
|
|
639
1013
|
systemSettings,
|
|
@@ -645,11 +1019,11 @@ function SettingsMenu({
|
|
|
645
1019
|
quotas,
|
|
646
1020
|
setMessages
|
|
647
1021
|
}) {
|
|
648
|
-
const [activeColumn, setActiveColumn] =
|
|
649
|
-
const [selectedCategoryIndex, setSelectedCategoryIndex] =
|
|
650
|
-
const [selectedItemIndex, setSelectedItemIndex] =
|
|
651
|
-
const [editingItem, setEditingItem] =
|
|
652
|
-
const [editValue, setEditValue] =
|
|
1022
|
+
const [activeColumn, setActiveColumn] = useState3("categories");
|
|
1023
|
+
const [selectedCategoryIndex, setSelectedCategoryIndex] = useState3(0);
|
|
1024
|
+
const [selectedItemIndex, setSelectedItemIndex] = useState3(0);
|
|
1025
|
+
const [editingItem, setEditingItem] = useState3(null);
|
|
1026
|
+
const [editValue, setEditValue] = useState3("");
|
|
653
1027
|
const getCategoryItems = (catId) => {
|
|
654
1028
|
switch (catId) {
|
|
655
1029
|
case "memory":
|
|
@@ -685,7 +1059,7 @@ function SettingsMenu({
|
|
|
685
1059
|
};
|
|
686
1060
|
const currentCatId = CATEGORIES[selectedCategoryIndex].id;
|
|
687
1061
|
const currentItems = getCategoryItems(currentCatId);
|
|
688
|
-
|
|
1062
|
+
useInput2((input, key) => {
|
|
689
1063
|
if (editingItem) {
|
|
690
1064
|
if (key.escape) {
|
|
691
1065
|
setEditingItem(null);
|
|
@@ -821,19 +1195,19 @@ function SettingsMenu({
|
|
|
821
1195
|
setActiveView("updateManager");
|
|
822
1196
|
}
|
|
823
1197
|
};
|
|
824
|
-
return /* @__PURE__ */
|
|
1198
|
+
return /* @__PURE__ */ React6.createElement(Box6, { flexDirection: "column", borderStyle: "round", borderColor: "gray", padding: 0, width: "100%" }, /* @__PURE__ */ React6.createElement(Box6, { paddingX: 1, paddingY: 0, marginBottom: 1, borderStyle: "single", borderColor: "magenta", width: "100%" }, /* @__PURE__ */ React6.createElement(Text6, { color: "magenta", bold: true }, "\u{1F527} SYSTEM CONFIGURATION")), /* @__PURE__ */ React6.createElement(Box6, { flexDirection: "row", width: "100%", minHeight: 8 }, /* @__PURE__ */ React6.createElement(Box6, { flexDirection: "column", width: "30%", borderStyle: "round", borderColor: activeColumn === "categories" ? "cyan" : "gray", padding: 1 }, /* @__PURE__ */ React6.createElement(Box6, { marginBottom: 1 }, /* @__PURE__ */ React6.createElement(Text6, { color: activeColumn === "categories" ? "cyan" : "white", bold: true, underline: true }, "CATEGORIES")), CATEGORIES.map((cat, index) => {
|
|
825
1199
|
const isSelected = selectedCategoryIndex === index;
|
|
826
1200
|
const isExit = cat.id === "exit";
|
|
827
|
-
return /* @__PURE__ */
|
|
828
|
-
|
|
1201
|
+
return /* @__PURE__ */ React6.createElement(
|
|
1202
|
+
Box6,
|
|
829
1203
|
{
|
|
830
1204
|
key: cat.id,
|
|
831
1205
|
marginTop: isExit ? 1 : 0,
|
|
832
1206
|
backgroundColor: isSelected ? activeColumn === "categories" ? "#2a2a2a" : "#1e1e1e" : void 0,
|
|
833
1207
|
paddingX: 1
|
|
834
1208
|
},
|
|
835
|
-
/* @__PURE__ */
|
|
836
|
-
|
|
1209
|
+
/* @__PURE__ */ React6.createElement(
|
|
1210
|
+
Text6,
|
|
837
1211
|
{
|
|
838
1212
|
color: isSelected ? activeColumn === "categories" ? "cyan" : "yellow" : "white",
|
|
839
1213
|
bold: isSelected
|
|
@@ -842,7 +1216,7 @@ function SettingsMenu({
|
|
|
842
1216
|
cat.label
|
|
843
1217
|
)
|
|
844
1218
|
);
|
|
845
|
-
})), /* @__PURE__ */
|
|
1219
|
+
})), /* @__PURE__ */ React6.createElement(Box6, { flexDirection: "column", width: "70%", borderStyle: "round", borderColor: activeColumn === "items" ? "cyan" : "gray", padding: 1, marginLeft: 1 }, /* @__PURE__ */ React6.createElement(Box6, { marginBottom: 1 }, /* @__PURE__ */ React6.createElement(Text6, { color: activeColumn === "items" ? "cyan" : "white", bold: true, underline: true }, CATEGORIES[selectedCategoryIndex].label.toUpperCase(), " SETTINGS")), currentItems.length > 0 ? (() => {
|
|
846
1220
|
let lastSection = null;
|
|
847
1221
|
const elements = [];
|
|
848
1222
|
const getListItems = (val) => (val || "").split(",").map((s) => s.trim().toLowerCase()).filter(Boolean);
|
|
@@ -869,21 +1243,21 @@ function SettingsMenu({
|
|
|
869
1243
|
if (item.section && item.section !== lastSection) {
|
|
870
1244
|
lastSection = item.section;
|
|
871
1245
|
elements.push(
|
|
872
|
-
/* @__PURE__ */
|
|
1246
|
+
/* @__PURE__ */ React6.createElement(Box6, { key: `sec-hdr-${item.section}`, marginTop: elements.length > 0 ? 1 : 0, marginBottom: 0, paddingX: 1 }, /* @__PURE__ */ React6.createElement(Text6, { color: "magenta", bold: true, underline: true }, "\u{1F4C2} ", item.section.toUpperCase()))
|
|
873
1247
|
);
|
|
874
1248
|
}
|
|
875
1249
|
const isEditingThis = isSelected && editingItem && (editingItem === "alwaysAskCommands" && item.value === "alwaysAsk" || editingItem === "autoApproveCommands" && item.value === "autoApprove" || editingItem === "autoDisallowCommands" && item.value === "autoDisallow");
|
|
876
1250
|
const isCommandListItem = item.value === "alwaysAsk" || item.value === "autoApprove" || item.value === "autoDisallow";
|
|
877
1251
|
elements.push(
|
|
878
|
-
/* @__PURE__ */
|
|
879
|
-
|
|
1252
|
+
/* @__PURE__ */ React6.createElement(Box6, { key: item.value, flexDirection: "column" }, /* @__PURE__ */ React6.createElement(Box6, { backgroundColor: isSelected && !isEditingThis ? "#2a2a2a" : void 0, paddingX: 2 }, /* @__PURE__ */ React6.createElement(
|
|
1253
|
+
Text6,
|
|
880
1254
|
{
|
|
881
1255
|
color: isSelected ? "cyan" : "white",
|
|
882
1256
|
bold: isSelected
|
|
883
1257
|
},
|
|
884
1258
|
isSelected ? "\u276F " : " ",
|
|
885
1259
|
item.label
|
|
886
|
-
), !isCommandListItem && /* @__PURE__ */
|
|
1260
|
+
), !isCommandListItem && /* @__PURE__ */ React6.createElement(React6.Fragment, null, /* @__PURE__ */ React6.createElement(Text6, { color: "gray", dimColor: true }, dots), /* @__PURE__ */ React6.createElement(Text6, { color: getStatusColor(item), bold: true }, "[ ", item.status, " ]"))), isCommandListItem && !isEditingThis && item.status !== "None" && /* @__PURE__ */ React6.createElement(Box6, { paddingX: 4, marginBottom: 1 }, /* @__PURE__ */ React6.createElement(Text6, { color: "gray", dimColor: true }, "\u21B3 ", item.status)), isEditingThis && /* @__PURE__ */ React6.createElement(Box6, { flexDirection: "column", marginLeft: 4, marginBottom: 1 }, /* @__PURE__ */ React6.createElement(Box6, { paddingX: 1, borderStyle: "single", borderColor: "cyan", flexDirection: "row" }, /* @__PURE__ */ React6.createElement(Text6, { color: "cyan", bold: true }, "> ", " "), /* @__PURE__ */ React6.createElement(
|
|
887
1261
|
TextInput,
|
|
888
1262
|
{
|
|
889
1263
|
value: editValue,
|
|
@@ -895,16 +1269,16 @@ function SettingsMenu({
|
|
|
895
1269
|
setEditingItem(null);
|
|
896
1270
|
}
|
|
897
1271
|
}
|
|
898
|
-
)), /* @__PURE__ */
|
|
1272
|
+
)), /* @__PURE__ */ React6.createElement(Text6, { color: "gray", dimColor: true, italic: true }, " Comma separated \u2022 Press Enter to save, Esc to cancel")))
|
|
899
1273
|
);
|
|
900
1274
|
});
|
|
901
1275
|
if (hasConflict) {
|
|
902
1276
|
elements.push(
|
|
903
|
-
/* @__PURE__ */
|
|
1277
|
+
/* @__PURE__ */ React6.createElement(Box6, { key: "conflict-warning", marginTop: 1, paddingX: 1 }, /* @__PURE__ */ React6.createElement(Text6, { color: "red", dimColor: true, italic: true }, "* Conflicting commands will be ignored and defaulted to highest priority"))
|
|
904
1278
|
);
|
|
905
1279
|
}
|
|
906
1280
|
return elements;
|
|
907
|
-
})() : /* @__PURE__ */
|
|
1281
|
+
})() : /* @__PURE__ */ React6.createElement(Box6, { paddingX: 1 }, /* @__PURE__ */ React6.createElement(Text6, { color: "gray", italic: true }, CATEGORIES[selectedCategoryIndex].desc)))), /* @__PURE__ */ React6.createElement(Box6, { paddingX: 1, marginTop: 1, flexDirection: "row", justifyContent: "space-between" }, /* @__PURE__ */ React6.createElement(Text6, { color: "gray", dimColor: true, italic: true }, activeColumn === "categories" ? "\u25B2\u25BC Select Category \u2022 Enter/\u25BA to configure" : "\u25B2\u25BC Select Option \u2022 Enter to Toggle \u2022 \u25C4/ESC to go back"), activeColumn === "categories" && /* @__PURE__ */ React6.createElement(Text6, { color: "gray", dimColor: true }, CATEGORIES[selectedCategoryIndex].desc)));
|
|
908
1282
|
}
|
|
909
1283
|
var CATEGORIES, getActivePreset, truncateCSV;
|
|
910
1284
|
var init_SettingsMenu = __esm({
|
|
@@ -937,13 +1311,13 @@ var init_SettingsMenu = __esm({
|
|
|
937
1311
|
});
|
|
938
1312
|
|
|
939
1313
|
// src/components/ProfileForm.jsx
|
|
940
|
-
import
|
|
941
|
-
import { Box as
|
|
1314
|
+
import React7, { useState as useState4, useEffect as useEffect3 } from "react";
|
|
1315
|
+
import { Box as Box7, Text as Text7 } from "ink";
|
|
942
1316
|
import TextInput2 from "ink-text-input";
|
|
943
1317
|
function ProfileForm({ initialData, onSave, onCancel }) {
|
|
944
|
-
const [step, setStep] =
|
|
945
|
-
const [currentInput, setCurrentInput] =
|
|
946
|
-
const [profile, setProfile] =
|
|
1318
|
+
const [step, setStep] = useState4(0);
|
|
1319
|
+
const [currentInput, setCurrentInput] = useState4("");
|
|
1320
|
+
const [profile, setProfile] = useState4(() => ({
|
|
947
1321
|
name: initialData?.name || "",
|
|
948
1322
|
nickname: initialData?.nickname || "",
|
|
949
1323
|
instructions: initialData?.instructions || ""
|
|
@@ -953,7 +1327,7 @@ function ProfileForm({ initialData, onSave, onCancel }) {
|
|
|
953
1327
|
{ key: "nickname", label: "Enter a Nickname (Agent will use this): " },
|
|
954
1328
|
{ key: "instructions", label: "System Instructions (Persona overrides): " }
|
|
955
1329
|
];
|
|
956
|
-
|
|
1330
|
+
useEffect3(() => {
|
|
957
1331
|
const currentKey = steps[step].key;
|
|
958
1332
|
setCurrentInput(profile[currentKey] || "");
|
|
959
1333
|
}, [step, profile]);
|
|
@@ -972,8 +1346,8 @@ function ProfileForm({ initialData, onSave, onCancel }) {
|
|
|
972
1346
|
onSave(newProfile);
|
|
973
1347
|
}
|
|
974
1348
|
};
|
|
975
|
-
return /* @__PURE__ */
|
|
976
|
-
|
|
1349
|
+
return /* @__PURE__ */ React7.createElement(
|
|
1350
|
+
Box7,
|
|
977
1351
|
{
|
|
978
1352
|
borderStyle: "round",
|
|
979
1353
|
borderColor: "gray",
|
|
@@ -983,16 +1357,16 @@ function ProfileForm({ initialData, onSave, onCancel }) {
|
|
|
983
1357
|
flexDirection: "column",
|
|
984
1358
|
width: "100%"
|
|
985
1359
|
},
|
|
986
|
-
/* @__PURE__ */
|
|
987
|
-
/* @__PURE__ */
|
|
1360
|
+
/* @__PURE__ */ React7.createElement(Box7, { paddingX: 1, marginBottom: 1 }, /* @__PURE__ */ React7.createElement(Text7, { color: "magenta", bold: true }, "\u{1F464} DEVELOPER PROFILE CONFIGURATION")),
|
|
1361
|
+
/* @__PURE__ */ React7.createElement(Box7, { paddingX: 1, flexDirection: "column" }, /* @__PURE__ */ React7.createElement(Box7, null, /* @__PURE__ */ React7.createElement(Text7, { color: "cyan", bold: true }, steps[step].label), /* @__PURE__ */ React7.createElement(
|
|
988
1362
|
TextInput2,
|
|
989
1363
|
{
|
|
990
1364
|
value: currentInput,
|
|
991
1365
|
onChange: setCurrentInput,
|
|
992
1366
|
onSubmit: handleSubmit
|
|
993
1367
|
}
|
|
994
|
-
)), /* @__PURE__ */
|
|
995
|
-
/* @__PURE__ */
|
|
1368
|
+
)), /* @__PURE__ */ React7.createElement(Box7, { marginTop: 1 }, /* @__PURE__ */ React7.createElement(Text7, { color: "gray", dimColor: true, italic: true }, "Step ", step + 1, " of ", steps.length))),
|
|
1369
|
+
/* @__PURE__ */ React7.createElement(Box7, { paddingX: 1, marginTop: 1 }, /* @__PURE__ */ React7.createElement(Text7, { color: "gray", dimColor: true, italic: true }, "(Enter to submit \u2022 Type /cancel to abort)"))
|
|
996
1370
|
);
|
|
997
1371
|
}
|
|
998
1372
|
var init_ProfileForm = __esm({
|
|
@@ -1001,19 +1375,19 @@ var init_ProfileForm = __esm({
|
|
|
1001
1375
|
});
|
|
1002
1376
|
|
|
1003
1377
|
// src/components/AskUserModal.jsx
|
|
1004
|
-
import
|
|
1005
|
-
import { Box as
|
|
1378
|
+
import React8, { useState as useState5 } from "react";
|
|
1379
|
+
import { Box as Box8, Text as Text8, useInput as useInput3 } from "ink";
|
|
1006
1380
|
import TextInput3 from "ink-text-input";
|
|
1007
1381
|
var AskUserModal, AskUserModal_default;
|
|
1008
1382
|
var init_AskUserModal = __esm({
|
|
1009
1383
|
"src/components/AskUserModal.jsx"() {
|
|
1010
1384
|
init_terminal();
|
|
1011
1385
|
AskUserModal = ({ question, options, onResolve }) => {
|
|
1012
|
-
const [isSuggestingElse, setIsSuggestingElse] =
|
|
1013
|
-
const [customInput, setCustomInput] =
|
|
1014
|
-
const [selectedIndex, setSelectedIndex] =
|
|
1386
|
+
const [isSuggestingElse, setIsSuggestingElse] = useState5(false);
|
|
1387
|
+
const [customInput, setCustomInput] = useState5("");
|
|
1388
|
+
const [selectedIndex, setSelectedIndex] = useState5(0);
|
|
1015
1389
|
const allOptions = [...options, { id: "CUSTOM", label: "Suggest something else...", description: "Provide a custom response" }];
|
|
1016
|
-
|
|
1390
|
+
useInput3((input, key) => {
|
|
1017
1391
|
if (isSuggestingElse) return;
|
|
1018
1392
|
if (key.leftArrow || key.upArrow) {
|
|
1019
1393
|
setSelectedIndex((prev) => Math.max(0, prev - 1));
|
|
@@ -1032,19 +1406,19 @@ var init_AskUserModal = __esm({
|
|
|
1032
1406
|
});
|
|
1033
1407
|
const s = emojiSpace(2);
|
|
1034
1408
|
if (isSuggestingElse) {
|
|
1035
|
-
return /* @__PURE__ */
|
|
1409
|
+
return /* @__PURE__ */ React8.createElement(Box8, { flexDirection: "column", borderStyle: "round", borderColor: "gray", padding: 0, width: "100%" }, /* @__PURE__ */ React8.createElement(Box8, { paddingX: 1 }, /* @__PURE__ */ React8.createElement(Text8, { color: "cyan", bold: true }, "\u{1F4AC} SUGGEST SOMETHING ELSE")), /* @__PURE__ */ React8.createElement(Box8, { marginTop: 1, paddingX: 1 }, /* @__PURE__ */ React8.createElement(Text8, { italic: true, color: "gray" }, "Replying to: ", question)), /* @__PURE__ */ React8.createElement(Box8, { marginTop: 1, paddingX: 1, flexDirection: "row" }, /* @__PURE__ */ React8.createElement(Text8, { color: "cyan", bold: true }, "\u{1F4A0} "), /* @__PURE__ */ React8.createElement(
|
|
1036
1410
|
TextInput3,
|
|
1037
1411
|
{
|
|
1038
1412
|
value: customInput,
|
|
1039
1413
|
onChange: setCustomInput,
|
|
1040
1414
|
onSubmit: () => onResolve(customInput)
|
|
1041
1415
|
}
|
|
1042
|
-
)), /* @__PURE__ */
|
|
1416
|
+
)), /* @__PURE__ */ React8.createElement(Box8, { marginTop: 1, paddingX: 1, marginBottom: 1 }, /* @__PURE__ */ React8.createElement(Text8, { color: "gray", dimColor: true, italic: true }, "(Press Enter to send)")));
|
|
1043
1417
|
}
|
|
1044
|
-
return /* @__PURE__ */
|
|
1418
|
+
return /* @__PURE__ */ React8.createElement(Box8, { flexDirection: "column", borderStyle: "round", borderColor: "gray", padding: 0, width: "100%" }, /* @__PURE__ */ React8.createElement(Box8, { paddingX: 1, marginBottom: 1 }, /* @__PURE__ */ React8.createElement(Text8, { color: "cyan", bold: true }, "\u{1F4AC} AGENT REQUEST: ACTION REQUIRED")), /* @__PURE__ */ React8.createElement(Box8, { paddingX: 1, marginBottom: 1 }, /* @__PURE__ */ React8.createElement(Text8, { bold: true, color: "white" }, question)), /* @__PURE__ */ React8.createElement(Box8, { flexDirection: "column", width: "100%" }, allOptions.map((opt, idx) => {
|
|
1045
1419
|
const isSelected = idx === selectedIndex;
|
|
1046
|
-
return /* @__PURE__ */
|
|
1047
|
-
|
|
1420
|
+
return /* @__PURE__ */ React8.createElement(
|
|
1421
|
+
Box8,
|
|
1048
1422
|
{
|
|
1049
1423
|
key: opt.id,
|
|
1050
1424
|
flexDirection: "column",
|
|
@@ -1053,10 +1427,10 @@ var init_AskUserModal = __esm({
|
|
|
1053
1427
|
paddingX: 1,
|
|
1054
1428
|
marginBottom: idx === allOptions.length - 1 ? 0 : 1
|
|
1055
1429
|
},
|
|
1056
|
-
/* @__PURE__ */
|
|
1057
|
-
opt.description && /* @__PURE__ */
|
|
1430
|
+
/* @__PURE__ */ React8.createElement(Text8, { color: isSelected ? "cyan" : "white", bold: isSelected }, isSelected ? "\u276F " : " ", opt.label),
|
|
1431
|
+
opt.description && /* @__PURE__ */ React8.createElement(Box8, { marginLeft: 4 }, /* @__PURE__ */ React8.createElement(Text8, { color: "gray", italic: true, dimColor: true }, opt.description))
|
|
1058
1432
|
);
|
|
1059
|
-
})), /* @__PURE__ */
|
|
1433
|
+
})), /* @__PURE__ */ React8.createElement(Box8, { paddingX: 1, marginTop: 1, marginBottom: 1 }, /* @__PURE__ */ React8.createElement(Text8, { color: "gray", dimColor: true, italic: true }, "(Use Arrows to navigate, Enter to confirm)")));
|
|
1060
1434
|
};
|
|
1061
1435
|
AskUserModal_default = AskUserModal;
|
|
1062
1436
|
}
|
|
@@ -1280,7 +1654,8 @@ var init_main_tools = __esm({
|
|
|
1280
1654
|
TOOL_PROTOCOL = (mode, osDetected) => `
|
|
1281
1655
|
-- TOOL DEFINITIONS --
|
|
1282
1656
|
Access to internal tools. To call a tool, MUST use the exact syntax on a new line: [tool:functions.ToolName(args)]
|
|
1283
|
-
|
|
1657
|
+
STRICT POLICY
|
|
1658
|
+
- **MAX 3 TOOL CALLS PER TURN. Next Turn, verify results, plan next**${mode === "Flux" ? "\n- **File Tools >> Code in chat**" : ""}
|
|
1284
1659
|
|
|
1285
1660
|
- COMMUNICATION TOOLS -
|
|
1286
1661
|
1. [tool:functions.Ask(question="...", optionA="option::description", ...MAX 4)]. Ambiguity Resolution. Mandatory Triggers: Path Divergence, Security, Risk Mitigation. ask >> finish
|
|
@@ -1302,7 +1677,6 @@ ${mode === "Flux" ? `- PROJECT TOOLS (path = relative to CWD) -
|
|
|
1302
1677
|
9. [tool:functions.WriteDoc(path="...", content="...")]. A4 Word document
|
|
1303
1678
|
|
|
1304
1679
|
- VERIFY TOOL RESULT CONTENTS. Fix errors. No hallucinations
|
|
1305
|
-
- File tools >>> Long chat
|
|
1306
1680
|
|
|
1307
1681
|
- Escape quotes: \\" for code strings
|
|
1308
1682
|
- Literal escapes: Double-escape sequences (e.g., \\\\n, \\\\t)
|
|
@@ -1424,7 +1798,7 @@ Check these first; These Files > Training Data. Safety rules apply
|
|
|
1424
1798
|
return `${nameStr}${nicknameStr}${userInstrStr}[SYSTEM]
|
|
1425
1799
|
Identity: Flux Flow (by Kushal Roy Chowdhury). Sassy${mode === "Flux" ? ", No Flirting, Respectful" : ", Friendly, Humorous, Sarcastic"}, CLI Agent
|
|
1426
1800
|
Mode: ${mode}${thinkingLevel !== "Fast" ? " (Thinking Mode)" : ""}. ${mode === "Flux" ? "Logical, Highly Detailed, Task-Driven. Prioritizes scalable file/folder structures, modular architecture, clean code abstractions, step-by-step execution. Industry standard latest coding practices/libraries, clean code, Double Check Imports, Client-Server Sync" : "Conversational, Concise"}
|
|
1427
|
-
|
|
1801
|
+
|
|
1428
1802
|
-- THINKING RULES --
|
|
1429
1803
|
${thinkingConfig}
|
|
1430
1804
|
${thinkingLevel !== "Fast" ? `
|
|
@@ -1439,7 +1813,7 @@ ${projectContextBlock}
|
|
|
1439
1813
|
- Temporal Awareness: RELATIVE TIME REFERENCE eg. few mins ago
|
|
1440
1814
|
|
|
1441
1815
|
-- SECURITY RULES --${systemSettings.allowExternalAccess ? "" : "\n- ACCESS CONTROL: CWD only"}
|
|
1442
|
-
- Sensitive files? Ask before Read
|
|
1816
|
+
- Sensitive files? Ask before Read${isSystemDir ? "\nPROTECTED DIRECTORY: ASK BEFORE MODIFYING" : ""}
|
|
1443
1817
|
|
|
1444
1818
|
-- FORMATTING --
|
|
1445
1819
|
- GFM Supported
|
|
@@ -1450,6 +1824,7 @@ ${projectContextBlock}
|
|
|
1450
1824
|
- End with [turn: continue] to continue or [turn: finish] when task done
|
|
1451
1825
|
- Tool Called? No post tool response until [turn: continue]
|
|
1452
1826
|
- Task Complete? End loop with [turn: finish]
|
|
1827
|
+
- NEVER USE [turn: continue] [turn:finish] together
|
|
1453
1828
|
[/SYSTEM]`.trim();
|
|
1454
1829
|
};
|
|
1455
1830
|
getJanitorInstruction = (userMemories = "", isMemoryEnabled = true, needTitle = true) => {
|
|
@@ -2957,7 +3332,7 @@ var init_update_file = __esm({
|
|
|
2957
3332
|
const lineEndPos = currentContent.indexOf("\n", affectedEndPos);
|
|
2958
3333
|
const actualEndPos = lineEndPos === -1 ? currentContent.length : lineEndPos;
|
|
2959
3334
|
const fullOldLines = currentContent.substring(lineStartPos, actualEndPos).split("\n");
|
|
2960
|
-
const newAffectedEndPos = startPos +
|
|
3335
|
+
const newAffectedEndPos = startPos + finalContentToAdd.length;
|
|
2961
3336
|
const newLineEndPos = newFileContent.indexOf("\n", newAffectedEndPos);
|
|
2962
3337
|
const actualNewEndPos = newLineEndPos === -1 ? newFileContent.length : newLineEndPos;
|
|
2963
3338
|
const fullNewLines = newFileContent.substring(lineStartPos, actualNewEndPos).split("\n");
|
|
@@ -4699,13 +5074,14 @@ ${newMemoryListStr}
|
|
|
4699
5074
|
return "";
|
|
4700
5075
|
}
|
|
4701
5076
|
};
|
|
5077
|
+
yield { type: "status", content: "Gathering Context..." };
|
|
4702
5078
|
let dirStructure = process.cwd() + "\n" + getDirTree(process.cwd());
|
|
4703
5079
|
const firstUserMsg = `[METADATA (PRIORITY: DYNAMIC)] Time: ${dateTimeStr} | v${versionFluxflow2}
|
|
4704
5080
|
CWD: ${process.cwd()}
|
|
4705
5081
|
**DIRECTORY STRUCTURE**
|
|
4706
5082
|
${dirStructure}
|
|
4707
5083
|
${memoryPrompt}
|
|
4708
|
-
${thinkingLevel != "Fast" ? "[SYSTEM] **STRICTLY FOLLOW THINKING POLICY AS
|
|
5084
|
+
${thinkingLevel != "Fast" ? "[SYSTEM] **STRICTLY FOLLOW THINKING POLICY AS CRITICAL PRIORITY. DO NOT START A RESPONSE WITHOUT <think> ... </think>**\n" : ""}[USER] ${agentText.replace(/\s*\[Prompted on:.*?\]/g, "").trim()}`.trim();
|
|
4709
5085
|
modifiedHistory.push({ role: "user", text: firstUserMsg });
|
|
4710
5086
|
let lastUsage = null;
|
|
4711
5087
|
const MAX_LOOPS = mode === "Flux" ? 70 : 7;
|
|
@@ -4736,7 +5112,7 @@ ${thinkingLevel != "Fast" ? "[SYSTEM] **STRICTLY FOLLOW THINKING POLICY AS CORE
|
|
|
4736
5112
|
|
|
4737
5113
|
[STEERING HINT]: ${hint}`;
|
|
4738
5114
|
} else {
|
|
4739
|
-
modifiedHistory.push({ role: "user", text: `${thinkingLevel != "Fast" ? "[SYSTEM] **STRICTLY FOLLOW THINKING POLICY AS
|
|
5115
|
+
modifiedHistory.push({ role: "user", text: `${thinkingLevel != "Fast" ? "[SYSTEM] **STRICTLY FOLLOW THINKING POLICY AS CRITICAL PRIORITY. DO NOT START A RESPONSE WITHOUT <think> ... </think>**\n" : ""}[STEERING HINT]: ${hint}` });
|
|
4740
5116
|
}
|
|
4741
5117
|
yield { type: "status", content: "Steering Hint Injected." };
|
|
4742
5118
|
}
|
|
@@ -4803,7 +5179,7 @@ ${thinkingLevel != "Fast" ? "[SYSTEM] **STRICTLY FOLLOW THINKING POLICY AS CORE
|
|
|
4803
5179
|
const currentSystemInstruction = getSystemInstruction(profile, thinkingLevel, mode, systemSettings, isMemoryEnabled, MAX_LOOPS, loop + 1);
|
|
4804
5180
|
const jitInstruction = `
|
|
4805
5181
|
|
|
4806
|
-
[SYSTEM] Tool result received. Analyze output and proceed with your turn.${thinkingLevel != "Fast" ? "**STRICTLY MAINTAIN THINKING
|
|
5182
|
+
[SYSTEM] Tool result received. Analyze output and proceed with your turn.${thinkingLevel != "Fast" ? "**STRICTLY MAINTAIN THINKING POLICY. DO NOT START A RESPONSE WITHOUT <think> ... </think>**" : ""}`;
|
|
4807
5183
|
const lastUserMsg = contents[contents.length - 1];
|
|
4808
5184
|
let addedMarker = false;
|
|
4809
5185
|
if (lastUserMsg && lastUserMsg.role === "user" && lastUserMsg.parts?.[0]?.text?.startsWith("[TOOL RESULT]")) {
|
|
@@ -5536,13 +5912,13 @@ ${timestamp}`;
|
|
|
5536
5912
|
});
|
|
5537
5913
|
|
|
5538
5914
|
// src/components/ResumeModal.jsx
|
|
5539
|
-
import
|
|
5540
|
-
import { Box as
|
|
5915
|
+
import React9, { useState as useState6, useEffect as useEffect4 } from "react";
|
|
5916
|
+
import { Box as Box9, Text as Text9, useInput as useInput4 } from "ink";
|
|
5541
5917
|
function ResumeModal({ onSelect, onDelete, onClose }) {
|
|
5542
|
-
const [history, setHistory] =
|
|
5543
|
-
const [keys, setKeys] =
|
|
5544
|
-
const [selectedIndex, setSelectedIndex] =
|
|
5545
|
-
|
|
5918
|
+
const [history, setHistory] = useState6({});
|
|
5919
|
+
const [keys, setKeys] = useState6([]);
|
|
5920
|
+
const [selectedIndex, setSelectedIndex] = useState6(0);
|
|
5921
|
+
useEffect4(() => {
|
|
5546
5922
|
const fetchHistory = async () => {
|
|
5547
5923
|
const h = await loadHistory();
|
|
5548
5924
|
setHistory(h);
|
|
@@ -5550,7 +5926,7 @@ function ResumeModal({ onSelect, onDelete, onClose }) {
|
|
|
5550
5926
|
};
|
|
5551
5927
|
fetchHistory();
|
|
5552
5928
|
}, []);
|
|
5553
|
-
|
|
5929
|
+
useInput4((input, key) => {
|
|
5554
5930
|
if (key.escape) onClose();
|
|
5555
5931
|
if (key.upArrow) setSelectedIndex((prev) => Math.max(0, prev - 1));
|
|
5556
5932
|
if (key.downArrow) setSelectedIndex((prev) => Math.min(keys.length - 1, prev + 1));
|
|
@@ -5579,24 +5955,24 @@ function ResumeModal({ onSelect, onDelete, onClose }) {
|
|
|
5579
5955
|
}
|
|
5580
5956
|
}
|
|
5581
5957
|
const visibleKeys = keys.slice(startIndex, startIndex + MAX_VISIBLE);
|
|
5582
|
-
return /* @__PURE__ */
|
|
5958
|
+
return /* @__PURE__ */ React9.createElement(Box9, { flexDirection: "column", borderStyle: "round", borderColor: "gray", padding: 0, width: "100%" }, /* @__PURE__ */ React9.createElement(Box9, { paddingX: 1, marginBottom: 1 }, /* @__PURE__ */ React9.createElement(Text9, { color: "cyan", bold: true }, "\u{1F4A0} CHAT HISTORY: RESUME CONVERSATION")), keys.length === 0 ? /* @__PURE__ */ React9.createElement(Box9, { paddingX: 2, paddingY: 1 }, /* @__PURE__ */ React9.createElement(Text9, { italic: true, color: "gray" }, "No saved chats found.")) : /* @__PURE__ */ React9.createElement(Box9, { flexDirection: "column", width: "100%" }, startIndex > 0 && /* @__PURE__ */ React9.createElement(Box9, { paddingX: 2, marginBottom: 1 }, /* @__PURE__ */ React9.createElement(Text9, { color: "gray", dimColor: true }, "\u25B2 (+", startIndex, " more chats above)")), visibleKeys.map((id, index) => {
|
|
5583
5959
|
const chat2 = history[id];
|
|
5584
5960
|
const actualIndex = startIndex + index;
|
|
5585
5961
|
const isSelected = actualIndex === selectedIndex;
|
|
5586
5962
|
const dateStr = formatDate(chat2?.updatedAt);
|
|
5587
|
-
return /* @__PURE__ */
|
|
5588
|
-
|
|
5963
|
+
return /* @__PURE__ */ React9.createElement(
|
|
5964
|
+
Box9,
|
|
5589
5965
|
{
|
|
5590
5966
|
key: id,
|
|
5591
5967
|
paddingX: 1,
|
|
5592
5968
|
backgroundColor: isSelected ? "#2a2a2a" : void 0,
|
|
5593
5969
|
width: "100%"
|
|
5594
5970
|
},
|
|
5595
|
-
/* @__PURE__ */
|
|
5596
|
-
isSelected && /* @__PURE__ */
|
|
5971
|
+
/* @__PURE__ */ React9.createElement(Box9, { flexGrow: 1 }, /* @__PURE__ */ React9.createElement(Text9, { color: isSelected ? "cyan" : "white", bold: isSelected }, isSelected ? "\u276F " : " ", chat2?.name || id, /* @__PURE__ */ React9.createElement(Text9, { color: "gray", dimColor: !isSelected }, " [", dateStr, " \u2022 ", id.slice(5), "]"))),
|
|
5972
|
+
isSelected && /* @__PURE__ */ React9.createElement(Box9, { flexShrink: 0 }, /* @__PURE__ */ React9.createElement(Text9, { color: "red", bold: true }, "[X] DELETE "))
|
|
5597
5973
|
);
|
|
5598
|
-
}), startIndex + MAX_VISIBLE < keys.length && /* @__PURE__ */
|
|
5599
|
-
|
|
5974
|
+
}), startIndex + MAX_VISIBLE < keys.length && /* @__PURE__ */ React9.createElement(Box9, { paddingX: 2, marginTop: 1 }, /* @__PURE__ */ React9.createElement(Text9, { color: "gray", dimColor: true }, "\u25BC (+", keys.length - (startIndex + MAX_VISIBLE), " more chats below)"))), /* @__PURE__ */ React9.createElement(
|
|
5975
|
+
Box9,
|
|
5600
5976
|
{
|
|
5601
5977
|
marginTop: 1,
|
|
5602
5978
|
paddingX: 1,
|
|
@@ -5606,7 +5982,7 @@ function ResumeModal({ onSelect, onDelete, onClose }) {
|
|
|
5606
5982
|
borderBottom: false,
|
|
5607
5983
|
borderColor: "gray"
|
|
5608
5984
|
},
|
|
5609
|
-
/* @__PURE__ */
|
|
5985
|
+
/* @__PURE__ */ React9.createElement(Text9, { dimColor: true, italic: true }, "\u2191\u2193 navigate \u2022 Enter select \u2022 x delete \u2022 Esc close")
|
|
5610
5986
|
));
|
|
5611
5987
|
}
|
|
5612
5988
|
function formatDate(timestamp) {
|
|
@@ -5628,12 +6004,12 @@ var init_ResumeModal = __esm({
|
|
|
5628
6004
|
});
|
|
5629
6005
|
|
|
5630
6006
|
// src/components/MemoryModal.jsx
|
|
5631
|
-
import
|
|
5632
|
-
import { Box as
|
|
6007
|
+
import React10, { useState as useState7, useEffect as useEffect5 } from "react";
|
|
6008
|
+
import { Box as Box10, Text as Text10, useInput as useInput5 } from "ink";
|
|
5633
6009
|
function MemoryModal({ onClose }) {
|
|
5634
|
-
const [memories, setMemories] =
|
|
5635
|
-
const [selectedIndex, setSelectedIndex] =
|
|
5636
|
-
const [isMemoryOn, setIsMemoryOn] =
|
|
6010
|
+
const [memories, setMemories] = useState7([]);
|
|
6011
|
+
const [selectedIndex, setSelectedIndex] = useState7(0);
|
|
6012
|
+
const [isMemoryOn, setIsMemoryOn] = useState7(true);
|
|
5637
6013
|
const loadMemories = () => {
|
|
5638
6014
|
const data = readEncryptedJson(MEMORIES_FILE, []);
|
|
5639
6015
|
setMemories(data);
|
|
@@ -5645,10 +6021,10 @@ function MemoryModal({ onClose }) {
|
|
|
5645
6021
|
setIsMemoryOn(true);
|
|
5646
6022
|
}
|
|
5647
6023
|
};
|
|
5648
|
-
|
|
6024
|
+
useEffect5(() => {
|
|
5649
6025
|
loadMemories();
|
|
5650
6026
|
}, []);
|
|
5651
|
-
|
|
6027
|
+
useInput5((input, key) => {
|
|
5652
6028
|
if (key.escape) onClose();
|
|
5653
6029
|
if (key.upArrow) setSelectedIndex((prev) => Math.max(0, prev - 1));
|
|
5654
6030
|
if (key.downArrow) setSelectedIndex((prev) => Math.min(memories.length - 1, prev + 1));
|
|
@@ -5678,21 +6054,21 @@ function MemoryModal({ onClose }) {
|
|
|
5678
6054
|
return "red";
|
|
5679
6055
|
};
|
|
5680
6056
|
const s = emojiSpace(2);
|
|
5681
|
-
return /* @__PURE__ */
|
|
6057
|
+
return /* @__PURE__ */ React10.createElement(Box10, { flexDirection: "column", borderStyle: "round", borderColor: "gray", padding: 0, width: "100%" }, /* @__PURE__ */ React10.createElement(Box10, { paddingX: 1, marginBottom: 1, justifyContent: "space-between" }, /* @__PURE__ */ React10.createElement(Text10, { color: "cyan", bold: true }, "\u{1F9E0} AGENT MEMORY: LONG-TERM KNOWLEDGE"), /* @__PURE__ */ React10.createElement(Box10, null, /* @__PURE__ */ React10.createElement(Text10, { color: "gray" }, "Vault: "), /* @__PURE__ */ React10.createElement(Text10, { color: getBarColor() }, barStr), /* @__PURE__ */ React10.createElement(Text10, { color: "white", bold: true }, " ", usagePercent, "%"))), !isMemoryOn && memories.length > 0 ? /* @__PURE__ */ React10.createElement(Box10, { paddingX: 2, paddingY: 1 }, /* @__PURE__ */ React10.createElement(Text10, { italic: true, color: "gray" }, "Memory is currently Off...")) : memories.length === 0 ? /* @__PURE__ */ React10.createElement(Box10, { paddingX: 2, paddingY: 1 }, /* @__PURE__ */ React10.createElement(Text10, { italic: true, color: "gray" }, isMemoryOn ? "Learning..." : "Memory not available...")) : /* @__PURE__ */ React10.createElement(Box10, { flexDirection: "column" }, memories.map((mem, idx) => {
|
|
5682
6058
|
const isSelected = idx === selectedIndex;
|
|
5683
|
-
return /* @__PURE__ */
|
|
5684
|
-
|
|
6059
|
+
return /* @__PURE__ */ React10.createElement(
|
|
6060
|
+
Box10,
|
|
5685
6061
|
{
|
|
5686
6062
|
key: mem.id,
|
|
5687
6063
|
paddingX: 1,
|
|
5688
6064
|
backgroundColor: isSelected ? "#2a2a2a" : void 0,
|
|
5689
6065
|
width: "100%"
|
|
5690
6066
|
},
|
|
5691
|
-
/* @__PURE__ */
|
|
5692
|
-
isSelected && /* @__PURE__ */
|
|
6067
|
+
/* @__PURE__ */ React10.createElement(Box10, { flexGrow: 1 }, /* @__PURE__ */ React10.createElement(Text10, { color: isSelected ? "cyan" : "white", bold: isSelected }, isSelected ? "\u276F " : " ", idx + 1, ". ", cleanDisplay(mem.memory))),
|
|
6068
|
+
isSelected && /* @__PURE__ */ React10.createElement(Box10, { flexShrink: 0 }, /* @__PURE__ */ React10.createElement(Text10, { color: "red", bold: true }, "[X] WIPE "))
|
|
5693
6069
|
);
|
|
5694
|
-
})), /* @__PURE__ */
|
|
5695
|
-
|
|
6070
|
+
})), /* @__PURE__ */ React10.createElement(
|
|
6071
|
+
Box10,
|
|
5696
6072
|
{
|
|
5697
6073
|
marginTop: 1,
|
|
5698
6074
|
paddingX: 1,
|
|
@@ -5702,7 +6078,7 @@ function MemoryModal({ onClose }) {
|
|
|
5702
6078
|
borderBottom: false,
|
|
5703
6079
|
borderColor: "gray"
|
|
5704
6080
|
},
|
|
5705
|
-
/* @__PURE__ */
|
|
6081
|
+
/* @__PURE__ */ React10.createElement(Text10, { dimColor: true, italic: true }, "\u2191\u2193 navigate \u2022 x wipe memory \u2022 Esc close")
|
|
5706
6082
|
));
|
|
5707
6083
|
}
|
|
5708
6084
|
var init_MemoryModal = __esm({
|
|
@@ -5714,18 +6090,18 @@ var init_MemoryModal = __esm({
|
|
|
5714
6090
|
});
|
|
5715
6091
|
|
|
5716
6092
|
// src/components/UpdateProcessor.jsx
|
|
5717
|
-
import
|
|
5718
|
-
import { Box as
|
|
6093
|
+
import React11, { useState as useState8, useEffect as useEffect6 } from "react";
|
|
6094
|
+
import { Box as Box11, Text as Text11 } from "ink";
|
|
5719
6095
|
import Spinner from "ink-spinner";
|
|
5720
6096
|
import { exec as exec2 } from "child_process";
|
|
5721
6097
|
var UpdateProcessor, UpdateProcessor_default;
|
|
5722
6098
|
var init_UpdateProcessor = __esm({
|
|
5723
6099
|
"src/components/UpdateProcessor.jsx"() {
|
|
5724
6100
|
UpdateProcessor = ({ latest, current, settings, onClose, onUpdateSettings, onSuccess }) => {
|
|
5725
|
-
const [status, setStatus] =
|
|
5726
|
-
const [log, setLog] =
|
|
5727
|
-
const [error, setError] =
|
|
5728
|
-
|
|
6101
|
+
const [status, setStatus] = useState8("initializing");
|
|
6102
|
+
const [log, setLog] = useState8("");
|
|
6103
|
+
const [error, setError] = useState8(null);
|
|
6104
|
+
useEffect6(() => {
|
|
5729
6105
|
let child;
|
|
5730
6106
|
const runUpdate = async () => {
|
|
5731
6107
|
const manager = settings.updateManager || "npm";
|
|
@@ -5765,13 +6141,13 @@ var init_UpdateProcessor = __esm({
|
|
|
5765
6141
|
};
|
|
5766
6142
|
}, []);
|
|
5767
6143
|
if (status === "initializing" || status === "downloading") {
|
|
5768
|
-
return /* @__PURE__ */
|
|
6144
|
+
return /* @__PURE__ */ React11.createElement(Box11, { flexDirection: "column", borderStyle: "round", borderColor: "cyan", paddingX: 2, paddingY: 1 }, /* @__PURE__ */ React11.createElement(Box11, null, /* @__PURE__ */ React11.createElement(Text11, { color: "cyan" }, /* @__PURE__ */ React11.createElement(Spinner, { type: "dots" })), /* @__PURE__ */ React11.createElement(Text11, { marginLeft: 1, bold: true }, " Updating Flux Flow to v", latest, "...")), /* @__PURE__ */ React11.createElement(Box11, { marginTop: 1, paddingX: 1, borderStyle: "single", borderColor: "#333" }, /* @__PURE__ */ React11.createElement(Text11, { color: "gray", dimColor: true, italic: true }, log || "Preparing environment...")), /* @__PURE__ */ React11.createElement(Text11, { marginTop: 1, dimColor: true }, "(Please do not close the terminal)"));
|
|
5769
6145
|
}
|
|
5770
6146
|
if (status === "success") {
|
|
5771
|
-
return /* @__PURE__ */
|
|
6147
|
+
return /* @__PURE__ */ React11.createElement(Box11, { flexDirection: "column", borderStyle: "round", borderColor: "green", paddingX: 2, paddingY: 1 }, /* @__PURE__ */ React11.createElement(Text11, { color: "green", bold: true }, "\u2705 UPDATE SUCCESSFUL!"), /* @__PURE__ */ React11.createElement(Text11, { marginTop: 1 }, "Flux Flow has been updated to ", /* @__PURE__ */ React11.createElement(Text11, { color: "cyan" }, "v", latest), "."), /* @__PURE__ */ React11.createElement(Text11, { marginTop: 1, color: "yellow", bold: true }, "CRITICAL: Please restart your terminal session to apply changes."), /* @__PURE__ */ React11.createElement(Box11, { marginTop: 1 }, /* @__PURE__ */ React11.createElement(Text11, { dimColor: true }, "(Press ESC to return to chat)")));
|
|
5772
6148
|
}
|
|
5773
6149
|
if (status === "error") {
|
|
5774
|
-
return /* @__PURE__ */
|
|
6150
|
+
return /* @__PURE__ */ React11.createElement(Box11, { flexDirection: "column", borderStyle: "round", borderColor: "red", paddingX: 2, paddingY: 1 }, /* @__PURE__ */ React11.createElement(Text11, { color: "red", bold: true }, "\u274C UPDATE FAILED"), /* @__PURE__ */ React11.createElement(Box11, { marginTop: 1, paddingX: 1, borderStyle: "single", borderColor: "red" }, /* @__PURE__ */ React11.createElement(Text11, { color: "red" }, error)), /* @__PURE__ */ React11.createElement(Text11, { marginTop: 1 }, "Possible causes:"), /* @__PURE__ */ React11.createElement(Text11, null, "\u2022 Missing permissions (Try running as Administrator/Sudo)"), /* @__PURE__ */ React11.createElement(Text11, null, "\u2022 Package manager (", settings.updateManager, ") not found"), /* @__PURE__ */ React11.createElement(Text11, null, "\u2022 Network failure"), /* @__PURE__ */ React11.createElement(Box11, { marginTop: 1 }, /* @__PURE__ */ React11.createElement(Text11, { dimColor: true }, "(Press ESC to return to chat)")));
|
|
5775
6151
|
}
|
|
5776
6152
|
return null;
|
|
5777
6153
|
};
|
|
@@ -5780,11 +6156,11 @@ var init_UpdateProcessor = __esm({
|
|
|
5780
6156
|
});
|
|
5781
6157
|
|
|
5782
6158
|
// src/components/RevertModal.jsx
|
|
5783
|
-
import
|
|
5784
|
-
import { Box as
|
|
6159
|
+
import React12, { useState as useState9 } from "react";
|
|
6160
|
+
import { Box as Box12, Text as Text12, useInput as useInput6 } from "ink";
|
|
5785
6161
|
function RevertModal({ prompts, onSelect, onClose }) {
|
|
5786
|
-
const [selectedIndex, setSelectedIndex] =
|
|
5787
|
-
|
|
6162
|
+
const [selectedIndex, setSelectedIndex] = useState9(0);
|
|
6163
|
+
useInput6((input, key) => {
|
|
5788
6164
|
if (key.escape) onClose();
|
|
5789
6165
|
if (key.upArrow) setSelectedIndex((prev) => Math.max(0, prev - 1));
|
|
5790
6166
|
if (key.downArrow) setSelectedIndex((prev) => Math.min(prompts.length - 1, prev + 1));
|
|
@@ -5803,23 +6179,23 @@ function RevertModal({ prompts, onSelect, onClose }) {
|
|
|
5803
6179
|
}
|
|
5804
6180
|
}
|
|
5805
6181
|
const visiblePrompts = prompts.slice(startIndex, startIndex + MAX_VISIBLE);
|
|
5806
|
-
return /* @__PURE__ */
|
|
6182
|
+
return /* @__PURE__ */ React12.createElement(Box12, { flexDirection: "column", borderStyle: "round", borderColor: "cyan", padding: 0, width: "100%" }, /* @__PURE__ */ React12.createElement(Box12, { paddingX: 1, marginBottom: 1 }, /* @__PURE__ */ React12.createElement(Text12, { color: "cyan", bold: true }, "\u{1F504} CODEBASE TIME TRAVEL: SELECT UNDO POINT")), /* @__PURE__ */ React12.createElement(Box12, { paddingX: 2, marginBottom: 1 }, /* @__PURE__ */ React12.createElement(Text12, null, "Select a prompt to revert the codebase back to the state ", /* @__PURE__ */ React12.createElement(Text12, { bold: true, color: "blue" }, "immediately before"), " it was executed:")), prompts.length === 0 ? /* @__PURE__ */ React12.createElement(Box12, { paddingX: 2, paddingY: 1 }, /* @__PURE__ */ React12.createElement(Text12, { italic: true, color: "gray" }, "No prompt checkpoints found for this session.")) : /* @__PURE__ */ React12.createElement(Box12, { flexDirection: "column", width: "100%" }, startIndex > 0 && /* @__PURE__ */ React12.createElement(Box12, { paddingX: 2, marginBottom: 1 }, /* @__PURE__ */ React12.createElement(Text12, { color: "gray", dimColor: true }, "\u25B2 (+", startIndex, " more prompts above)")), visiblePrompts.map((p, index) => {
|
|
5807
6183
|
const actualIndex = startIndex + index;
|
|
5808
6184
|
const isSelected = actualIndex === selectedIndex;
|
|
5809
6185
|
const dateStr = formatDate2(p.timestamp);
|
|
5810
6186
|
const fileCount = p.changes ? p.changes.length : 0;
|
|
5811
|
-
return /* @__PURE__ */
|
|
5812
|
-
|
|
6187
|
+
return /* @__PURE__ */ React12.createElement(
|
|
6188
|
+
Box12,
|
|
5813
6189
|
{
|
|
5814
6190
|
key: p.id,
|
|
5815
6191
|
paddingX: 1,
|
|
5816
6192
|
backgroundColor: isSelected ? "#1a2a3a" : void 0,
|
|
5817
6193
|
width: "100%"
|
|
5818
6194
|
},
|
|
5819
|
-
/* @__PURE__ */
|
|
6195
|
+
/* @__PURE__ */ React12.createElement(Box12, { flexGrow: 1 }, /* @__PURE__ */ React12.createElement(Text12, { color: isSelected ? "cyan" : "white", bold: isSelected }, isSelected ? "\u276F " : " ", '"', formatPromptPreview(p.prompt), '"', /* @__PURE__ */ React12.createElement(Text12, { color: "gray", dimColor: !isSelected }, " [", dateStr, " \u2022 ", fileCount, " file(s) changed]")))
|
|
5820
6196
|
);
|
|
5821
|
-
}), startIndex + MAX_VISIBLE < prompts.length && /* @__PURE__ */
|
|
5822
|
-
|
|
6197
|
+
}), startIndex + MAX_VISIBLE < prompts.length && /* @__PURE__ */ React12.createElement(Box12, { paddingX: 2, marginTop: 1 }, /* @__PURE__ */ React12.createElement(Text12, { color: "gray", dimColor: true }, "\u25BC (+", prompts.length - (startIndex + MAX_VISIBLE), " more prompts below)"))), /* @__PURE__ */ React12.createElement(
|
|
6198
|
+
Box12,
|
|
5823
6199
|
{
|
|
5824
6200
|
marginTop: 1,
|
|
5825
6201
|
paddingX: 1,
|
|
@@ -5829,15 +6205,15 @@ function RevertModal({ prompts, onSelect, onClose }) {
|
|
|
5829
6205
|
borderBottom: false,
|
|
5830
6206
|
borderColor: "cyan"
|
|
5831
6207
|
},
|
|
5832
|
-
/* @__PURE__ */
|
|
6208
|
+
/* @__PURE__ */ React12.createElement(Text12, { dimColor: true, italic: true }, "\u2191\u2193 navigate \u2022 Enter select undo point \u2022 Esc close")
|
|
5833
6209
|
));
|
|
5834
6210
|
}
|
|
5835
6211
|
function formatPromptPreview(prompt) {
|
|
5836
6212
|
if (!prompt) return "";
|
|
5837
6213
|
const firstLine = prompt.split("\n")[0] || "";
|
|
5838
6214
|
const words = firstLine.split(/\s+/).filter(Boolean);
|
|
5839
|
-
if (words.length >
|
|
5840
|
-
return words.slice(0,
|
|
6215
|
+
if (words.length > 15) {
|
|
6216
|
+
return words.slice(0, 15).join(" ") + "...";
|
|
5841
6217
|
}
|
|
5842
6218
|
if (prompt.includes("\n")) {
|
|
5843
6219
|
return firstLine + "...";
|
|
@@ -5903,31 +6279,31 @@ __export(app_exports, {
|
|
|
5903
6279
|
default: () => App
|
|
5904
6280
|
});
|
|
5905
6281
|
import os4 from "os";
|
|
5906
|
-
import
|
|
5907
|
-
import { Box as
|
|
6282
|
+
import React13, { useState as useState10, useEffect as useEffect7, useRef as useRef3, useMemo as useMemo2 } from "react";
|
|
6283
|
+
import { Box as Box13, Text as Text13, useInput as useInput7, useStdout } from "ink";
|
|
5908
6284
|
import Spinner2 from "ink-spinner";
|
|
5909
6285
|
import fs18 from "fs-extra";
|
|
5910
6286
|
import path16 from "path";
|
|
5911
6287
|
import { exec as exec4 } from "child_process";
|
|
5912
6288
|
import { fileURLToPath } from "url";
|
|
5913
|
-
import { MultilineInput } from "ink-multiline-input";
|
|
5914
6289
|
import TextInput4 from "ink-text-input";
|
|
5915
6290
|
import gradient from "gradient-string";
|
|
5916
6291
|
function App({ args = [] }) {
|
|
5917
|
-
const [confirmExit, setConfirmExit] =
|
|
5918
|
-
const [exitCountdown, setExitCountdown] =
|
|
6292
|
+
const [confirmExit, setConfirmExit] = useState10(false);
|
|
6293
|
+
const [exitCountdown, setExitCountdown] = useState10(10);
|
|
5919
6294
|
const { stdout } = useStdout();
|
|
5920
|
-
const [input, setInput] =
|
|
5921
|
-
const [
|
|
5922
|
-
const [
|
|
5923
|
-
const [
|
|
6295
|
+
const [input, setInput] = useState10("");
|
|
6296
|
+
const [inputKey, setInputKey] = useState10(0);
|
|
6297
|
+
const [isExpanded, setIsExpanded] = useState10(false);
|
|
6298
|
+
const [mode, setMode] = useState10("Flux");
|
|
6299
|
+
const [terminalSize, setTerminalSize] = useState10({
|
|
5924
6300
|
columns: stdout?.columns || 80,
|
|
5925
6301
|
rows: stdout?.rows || 24
|
|
5926
6302
|
});
|
|
5927
|
-
const [selectedIndex, setSelectedIndex] =
|
|
5928
|
-
const [isFilePickerDismissed, setIsFilePickerDismissed] =
|
|
5929
|
-
const persistedModelRef =
|
|
5930
|
-
const parsedArgs =
|
|
6303
|
+
const [selectedIndex, setSelectedIndex] = useState10(0);
|
|
6304
|
+
const [isFilePickerDismissed, setIsFilePickerDismissed] = useState10(false);
|
|
6305
|
+
const persistedModelRef = useRef3(null);
|
|
6306
|
+
const parsedArgs = useMemo2(() => {
|
|
5931
6307
|
const parsed = {};
|
|
5932
6308
|
for (let i = 0; i < args.length; i++) {
|
|
5933
6309
|
const arg = args[i];
|
|
@@ -6016,7 +6392,7 @@ function App({ args = [] }) {
|
|
|
6016
6392
|
}
|
|
6017
6393
|
}
|
|
6018
6394
|
};
|
|
6019
|
-
|
|
6395
|
+
useEffect7(() => {
|
|
6020
6396
|
const handleResize = () => {
|
|
6021
6397
|
stdout.write("\x1Bc");
|
|
6022
6398
|
setTerminalSize({
|
|
@@ -6029,38 +6405,38 @@ function App({ args = [] }) {
|
|
|
6029
6405
|
stdout.off("resize", handleResize);
|
|
6030
6406
|
};
|
|
6031
6407
|
}, [stdout]);
|
|
6032
|
-
const [thinkingLevel, setThinkingLevel] =
|
|
6033
|
-
const [latestVer, setLatestVer] =
|
|
6034
|
-
const [showFullThinking, setShowFullThinking] =
|
|
6035
|
-
const [activeModel, setActiveModel] =
|
|
6036
|
-
const [janitorModel, setJanitorModel] =
|
|
6037
|
-
const [isInitializing, setIsInitializing] =
|
|
6038
|
-
const [apiKey, setApiKey] =
|
|
6039
|
-
const [tempKey, setTempKey] =
|
|
6040
|
-
const [activeView, setActiveView] =
|
|
6041
|
-
const [apiTier, setApiTier] =
|
|
6042
|
-
const [quotas, setQuotas] =
|
|
6043
|
-
const [inputConfig, setInputConfig] =
|
|
6044
|
-
const [systemSettings, setSystemSettings] =
|
|
6045
|
-
const [profileData, setProfileData] =
|
|
6046
|
-
const [imageSettings, setImageSettings] =
|
|
6047
|
-
const [sessionStats, setSessionStats] =
|
|
6048
|
-
const [sessionAgentCalls, setSessionAgentCalls] =
|
|
6049
|
-
const [sessionBackgroundCalls, setSessionBackgroundCalls] =
|
|
6050
|
-
const [sessionTotalTokens, setSessionTotalTokens] =
|
|
6051
|
-
const [sessionToolSuccess, setSessionToolSuccess] =
|
|
6052
|
-
const [sessionToolFailure, setSessionToolFailure] =
|
|
6053
|
-
const [sessionToolDenied, setSessionToolDenied] =
|
|
6054
|
-
const [sessionApiTime, setSessionApiTime] =
|
|
6055
|
-
const [sessionToolTime, setSessionToolTime] =
|
|
6056
|
-
const [sessionImageCount, setSessionImageCount] =
|
|
6057
|
-
const [sessionImageCredits, setSessionImageCredits] =
|
|
6058
|
-
const [dailyUsage, setDailyUsage] =
|
|
6059
|
-
const [chatId, setChatId] =
|
|
6060
|
-
const [activeCommand, setActiveCommand] =
|
|
6061
|
-
const [execOutput, setExecOutput] =
|
|
6062
|
-
const [isTerminalFocused, setIsTerminalFocused] =
|
|
6063
|
-
|
|
6408
|
+
const [thinkingLevel, setThinkingLevel] = useState10("Medium");
|
|
6409
|
+
const [latestVer, setLatestVer] = useState10(null);
|
|
6410
|
+
const [showFullThinking, setShowFullThinking] = useState10(false);
|
|
6411
|
+
const [activeModel, setActiveModel] = useState10("gemma-4-31b-it");
|
|
6412
|
+
const [janitorModel, setJanitorModel] = useState10("gemma-4-26b-a4b-it");
|
|
6413
|
+
const [isInitializing, setIsInitializing] = useState10(true);
|
|
6414
|
+
const [apiKey, setApiKey] = useState10(null);
|
|
6415
|
+
const [tempKey, setTempKey] = useState10("");
|
|
6416
|
+
const [activeView, setActiveView] = useState10("chat");
|
|
6417
|
+
const [apiTier, setApiTier] = useState10("Free");
|
|
6418
|
+
const [quotas, setQuotas] = useState10({ agentLimit: 1500, backgroundLimit: 1500, searchLimit: 100, customModelId: "", customLimit: 0 });
|
|
6419
|
+
const [inputConfig, setInputConfig] = useState10(null);
|
|
6420
|
+
const [systemSettings, setSystemSettings] = useState10({ memory: true, compression: 0, autoExec: false, autoDeleteHistory: "7d", autoUpdate: false, updateManager: "npm", customUpdateCommand: "" });
|
|
6421
|
+
const [profileData, setProfileData] = useState10({ name: null, nickname: null, instructions: null });
|
|
6422
|
+
const [imageSettings, setImageSettings] = useState10({ keyType: "Default", quality: "Low-High", apiKey: "" });
|
|
6423
|
+
const [sessionStats, setSessionStats] = useState10({ tokens: 0 });
|
|
6424
|
+
const [sessionAgentCalls, setSessionAgentCalls] = useState10(0);
|
|
6425
|
+
const [sessionBackgroundCalls, setSessionBackgroundCalls] = useState10(0);
|
|
6426
|
+
const [sessionTotalTokens, setSessionTotalTokens] = useState10(0);
|
|
6427
|
+
const [sessionToolSuccess, setSessionToolSuccess] = useState10(0);
|
|
6428
|
+
const [sessionToolFailure, setSessionToolFailure] = useState10(0);
|
|
6429
|
+
const [sessionToolDenied, setSessionToolDenied] = useState10(0);
|
|
6430
|
+
const [sessionApiTime, setSessionApiTime] = useState10(0);
|
|
6431
|
+
const [sessionToolTime, setSessionToolTime] = useState10(0);
|
|
6432
|
+
const [sessionImageCount, setSessionImageCount] = useState10(0);
|
|
6433
|
+
const [sessionImageCredits, setSessionImageCredits] = useState10(0);
|
|
6434
|
+
const [dailyUsage, setDailyUsage] = useState10(null);
|
|
6435
|
+
const [chatId, setChatId] = useState10(generateChatId());
|
|
6436
|
+
const [activeCommand, setActiveCommand] = useState10(null);
|
|
6437
|
+
const [execOutput, setExecOutput] = useState10("");
|
|
6438
|
+
const [isTerminalFocused, setIsTerminalFocused] = useState10(false);
|
|
6439
|
+
useEffect7(() => {
|
|
6064
6440
|
if (apiTier !== "Free" && activeModel === "gemma-4-31b-it") {
|
|
6065
6441
|
setActiveModel("gemini-3-flash-preview");
|
|
6066
6442
|
setMessages((prev) => {
|
|
@@ -6074,24 +6450,24 @@ function App({ args = [] }) {
|
|
|
6074
6450
|
});
|
|
6075
6451
|
}
|
|
6076
6452
|
}, [apiTier, activeModel]);
|
|
6077
|
-
const terminalEnv =
|
|
6453
|
+
const terminalEnv = useMemo2(() => {
|
|
6078
6454
|
const isIDE = process.env.TERM_PROGRAM === "vscode" || !!process.env.VSC_TERMINAL_URL || !!process.env.INTELLIJ_TERMINAL_COMMAND_BLOCKS;
|
|
6079
6455
|
return {
|
|
6080
6456
|
isIDE,
|
|
6081
6457
|
shortcut: isIDE ? "Shift + Enter" : "Ctrl + Enter"
|
|
6082
6458
|
};
|
|
6083
6459
|
}, []);
|
|
6084
|
-
const activeCommandRef =
|
|
6085
|
-
const execOutputRef =
|
|
6086
|
-
|
|
6460
|
+
const activeCommandRef = useRef3(null);
|
|
6461
|
+
const execOutputRef = useRef3("");
|
|
6462
|
+
useEffect7(() => {
|
|
6087
6463
|
activeCommandRef.current = activeCommand;
|
|
6088
6464
|
}, [activeCommand]);
|
|
6089
|
-
|
|
6465
|
+
useEffect7(() => {
|
|
6090
6466
|
execOutputRef.current = execOutput;
|
|
6091
6467
|
}, [execOutput]);
|
|
6092
|
-
const [autoAcceptWrites, setAutoAcceptWrites] =
|
|
6093
|
-
const [pendingApproval, setPendingApproval] =
|
|
6094
|
-
const [pendingAsk, setPendingAsk] =
|
|
6468
|
+
const [autoAcceptWrites, setAutoAcceptWrites] = useState10(false);
|
|
6469
|
+
const [pendingApproval, setPendingApproval] = useState10(null);
|
|
6470
|
+
const [pendingAsk, setPendingAsk] = useState10(null);
|
|
6095
6471
|
const formatDuration = (totalSecs) => {
|
|
6096
6472
|
const h = Math.floor(totalSecs / 3600);
|
|
6097
6473
|
const m = Math.floor(totalSecs % 3600 / 60);
|
|
@@ -6106,18 +6482,18 @@ function App({ args = [] }) {
|
|
|
6106
6482
|
if (ms < 1e3) return `${ms}ms`;
|
|
6107
6483
|
return formatDuration(Math.floor(ms / 1e3));
|
|
6108
6484
|
};
|
|
6109
|
-
const [statusText, setStatusText] =
|
|
6110
|
-
const [isSpinnerActive, setIsSpinnerActive] =
|
|
6111
|
-
const [isProcessing, setIsProcessing] =
|
|
6112
|
-
const [escPressed, setEscPressed] =
|
|
6113
|
-
const [escTimer, setEscTimer] =
|
|
6114
|
-
const [escPressCount, setEscPressCount] =
|
|
6115
|
-
const [recentPrompts, setRecentPrompts] =
|
|
6116
|
-
const escDoubleTimerRef =
|
|
6117
|
-
const [queuedPrompt, setQueuedPrompt] =
|
|
6118
|
-
const [resolutionData, setResolutionData] =
|
|
6119
|
-
const [tempModelOverride, setTempModelOverride] =
|
|
6120
|
-
const [messages, setMessages] =
|
|
6485
|
+
const [statusText, setStatusText] = useState10(null);
|
|
6486
|
+
const [isSpinnerActive, setIsSpinnerActive] = useState10(true);
|
|
6487
|
+
const [isProcessing, setIsProcessing] = useState10(false);
|
|
6488
|
+
const [escPressed, setEscPressed] = useState10(false);
|
|
6489
|
+
const [escTimer, setEscTimer] = useState10(null);
|
|
6490
|
+
const [escPressCount, setEscPressCount] = useState10(0);
|
|
6491
|
+
const [recentPrompts, setRecentPrompts] = useState10([]);
|
|
6492
|
+
const escDoubleTimerRef = useRef3(null);
|
|
6493
|
+
const [queuedPrompt, setQueuedPrompt] = useState10(null);
|
|
6494
|
+
const [resolutionData, setResolutionData] = useState10(null);
|
|
6495
|
+
const [tempModelOverride, setTempModelOverride] = useState10(null);
|
|
6496
|
+
const [messages, setMessages] = useState10(() => {
|
|
6121
6497
|
const logoMsg = { id: "logo-" + Date.now(), role: "system", text: FLUX_LOGO, isLogo: true, isMeta: true };
|
|
6122
6498
|
const welcomeMsg = { id: "welcome", role: "system", text: "\u{1F30A}\u26A1 Welcome to Flux Flow! Type /help for commands.", isMeta: true };
|
|
6123
6499
|
const isHomeDir = process.cwd() === os4.homedir();
|
|
@@ -6155,9 +6531,9 @@ function App({ args = [] }) {
|
|
|
6155
6531
|
}
|
|
6156
6532
|
return msgs;
|
|
6157
6533
|
});
|
|
6158
|
-
const queuedPromptRef =
|
|
6159
|
-
const [completedIndex, setCompletedIndex] =
|
|
6160
|
-
const windowedHistory =
|
|
6534
|
+
const queuedPromptRef = useRef3(null);
|
|
6535
|
+
const [completedIndex, setCompletedIndex] = useState10(messages.length);
|
|
6536
|
+
const windowedHistory = useMemo2(() => {
|
|
6161
6537
|
const MAX_HISTORY_LINES = 2e3;
|
|
6162
6538
|
const width = terminalSize.columns || 80;
|
|
6163
6539
|
let totalLines = 0;
|
|
@@ -6191,7 +6567,7 @@ function App({ args = [] }) {
|
|
|
6191
6567
|
return acc + Math.max(1, Math.ceil(line.length / wrapWidth));
|
|
6192
6568
|
}, 0);
|
|
6193
6569
|
const maxLines = Math.max(1, wrappedLinesCount);
|
|
6194
|
-
|
|
6570
|
+
useInput7((inputText, key) => {
|
|
6195
6571
|
if (key.tab && activeCommand) {
|
|
6196
6572
|
setIsTerminalFocused((prev) => !prev);
|
|
6197
6573
|
return;
|
|
@@ -6304,7 +6680,7 @@ function App({ args = [] }) {
|
|
|
6304
6680
|
setInput((prev) => prev.replace(/\\\r?$/, "").replace(/\r?$/, "") + "\n");
|
|
6305
6681
|
}
|
|
6306
6682
|
});
|
|
6307
|
-
|
|
6683
|
+
useEffect7(() => {
|
|
6308
6684
|
async function init() {
|
|
6309
6685
|
if (process.stdout.isTTY) {
|
|
6310
6686
|
process.stdout.write(`\x1B]0;FluxFlow | Ready\x07`);
|
|
@@ -6409,7 +6785,7 @@ function App({ args = [] }) {
|
|
|
6409
6785
|
}
|
|
6410
6786
|
init();
|
|
6411
6787
|
}, []);
|
|
6412
|
-
|
|
6788
|
+
useEffect7(() => {
|
|
6413
6789
|
let timer;
|
|
6414
6790
|
if (confirmExit) {
|
|
6415
6791
|
setExitCountdown(10);
|
|
@@ -6427,7 +6803,7 @@ function App({ args = [] }) {
|
|
|
6427
6803
|
if (timer) clearInterval(timer);
|
|
6428
6804
|
};
|
|
6429
6805
|
}, [confirmExit]);
|
|
6430
|
-
|
|
6806
|
+
useEffect7(() => {
|
|
6431
6807
|
if (!isInitializing) {
|
|
6432
6808
|
const modelToSave = parsedArgs.model && activeModel === parsedArgs.model ? persistedModelRef.current : activeModel;
|
|
6433
6809
|
saveSettings({
|
|
@@ -6453,8 +6829,8 @@ function App({ args = [] }) {
|
|
|
6453
6829
|
setTempKey("");
|
|
6454
6830
|
}
|
|
6455
6831
|
};
|
|
6456
|
-
const lastSavedTimeRef =
|
|
6457
|
-
|
|
6832
|
+
const lastSavedTimeRef = useRef3(SESSION_START_TIME);
|
|
6833
|
+
useEffect7(() => {
|
|
6458
6834
|
if (activeView === "exit") {
|
|
6459
6835
|
const flush = async () => {
|
|
6460
6836
|
const now = Date.now();
|
|
@@ -6472,7 +6848,7 @@ function App({ args = [] }) {
|
|
|
6472
6848
|
return () => clearTimeout(timer);
|
|
6473
6849
|
}
|
|
6474
6850
|
}, [activeView]);
|
|
6475
|
-
|
|
6851
|
+
useEffect7(() => {
|
|
6476
6852
|
const interval = setInterval(async () => {
|
|
6477
6853
|
if (!isInitializing) {
|
|
6478
6854
|
const now = Date.now();
|
|
@@ -6592,6 +6968,7 @@ function App({ args = [] }) {
|
|
|
6592
6968
|
setInput(parentParts.join(" ") + " " + nextMatch.cmd + " ");
|
|
6593
6969
|
}
|
|
6594
6970
|
setSelectedIndex(0);
|
|
6971
|
+
setInputKey((prev) => prev + 1);
|
|
6595
6972
|
return;
|
|
6596
6973
|
}
|
|
6597
6974
|
const normalizedValue = value.replace(/\r\n/g, "\n").replace(/\r/g, "\n").trimEnd();
|
|
@@ -7130,7 +7507,8 @@ ${timestamp}` };
|
|
|
7130
7507
|
let hasFiredJanitor = false;
|
|
7131
7508
|
setIsProcessing(true);
|
|
7132
7509
|
setIsExpanded(false);
|
|
7133
|
-
|
|
7510
|
+
let apiStart = Date.now();
|
|
7511
|
+
let isFirstPacket = true;
|
|
7134
7512
|
try {
|
|
7135
7513
|
const cleanHistoryForAI = [...messages, userMessage].filter(
|
|
7136
7514
|
(m) => m.role !== "think" && !m.isVisualFeedback && !String(m.id).startsWith("welcome")
|
|
@@ -7267,6 +7645,10 @@ Selection: ${val}`,
|
|
|
7267
7645
|
let inToolCallString = null;
|
|
7268
7646
|
const signalRegex = /\[?\s*turn\s*:\s*.*?\s*\]?/gi;
|
|
7269
7647
|
for await (const packet of stream) {
|
|
7648
|
+
if (isFirstPacket && packet.type === "text") {
|
|
7649
|
+
apiStart = Date.now();
|
|
7650
|
+
isFirstPacket = false;
|
|
7651
|
+
}
|
|
7270
7652
|
if (packet.type === "status") {
|
|
7271
7653
|
setStatusText(packet.content);
|
|
7272
7654
|
continue;
|
|
@@ -7548,7 +7930,7 @@ Selection: ${val}`,
|
|
|
7548
7930
|
setInput("");
|
|
7549
7931
|
setIsExpanded(false);
|
|
7550
7932
|
};
|
|
7551
|
-
const suggestions =
|
|
7933
|
+
const suggestions = useMemo2(() => {
|
|
7552
7934
|
if (input.startsWith("/") && !isFilePickerDismissed) {
|
|
7553
7935
|
const parts2 = input.split(" ");
|
|
7554
7936
|
const query = parts2[parts2.length - 1].toLowerCase();
|
|
@@ -7591,13 +7973,13 @@ Selection: ${val}`,
|
|
|
7591
7973
|
}
|
|
7592
7974
|
return [];
|
|
7593
7975
|
}, [input, isFilePickerDismissed]);
|
|
7594
|
-
|
|
7976
|
+
useEffect7(() => {
|
|
7595
7977
|
setSelectedIndex(0);
|
|
7596
7978
|
}, [suggestions]);
|
|
7597
7979
|
const renderActiveView = () => {
|
|
7598
7980
|
switch (activeView) {
|
|
7599
7981
|
case "settings":
|
|
7600
|
-
return /* @__PURE__ */
|
|
7982
|
+
return /* @__PURE__ */ React13.createElement(
|
|
7601
7983
|
SettingsMenu,
|
|
7602
7984
|
{
|
|
7603
7985
|
systemSettings,
|
|
@@ -7611,7 +7993,7 @@ Selection: ${val}`,
|
|
|
7611
7993
|
}
|
|
7612
7994
|
);
|
|
7613
7995
|
case "apiTier":
|
|
7614
|
-
return /* @__PURE__ */
|
|
7996
|
+
return /* @__PURE__ */ React13.createElement(
|
|
7615
7997
|
CommandMenu,
|
|
7616
7998
|
{
|
|
7617
7999
|
title: `API Tier: ${apiTier}`,
|
|
@@ -7644,7 +8026,7 @@ Selection: ${val}`,
|
|
|
7644
8026
|
}
|
|
7645
8027
|
);
|
|
7646
8028
|
case "input":
|
|
7647
|
-
return /* @__PURE__ */
|
|
8029
|
+
return /* @__PURE__ */ React13.createElement(Box13, { flexDirection: "column", borderStyle: "round", borderColor: "gray", padding: 0, width: "100%" }, /* @__PURE__ */ React13.createElement(Box13, { paddingX: 1 }, /* @__PURE__ */ React13.createElement(Text13, { color: "magenta", bold: true }, "\u{1F527} DATA CONFIGURATION")), inputConfig?.note && /* @__PURE__ */ React13.createElement(Box13, { paddingX: 1, marginBottom: 1 }, /* @__PURE__ */ React13.createElement(Text13, { color: "yellow", dimColor: true, italic: true }, inputConfig.note)), /* @__PURE__ */ React13.createElement(Box13, { paddingX: 1, flexDirection: "row" }, /* @__PURE__ */ React13.createElement(Text13, { color: "cyan", bold: true }, inputConfig?.label, " "), /* @__PURE__ */ React13.createElement(
|
|
7648
8030
|
TextInput4,
|
|
7649
8031
|
{
|
|
7650
8032
|
value: inputConfig?.value || "",
|
|
@@ -7701,11 +8083,11 @@ Selection: ${val}`,
|
|
|
7701
8083
|
}
|
|
7702
8084
|
}
|
|
7703
8085
|
}
|
|
7704
|
-
)), /* @__PURE__ */
|
|
8086
|
+
)), /* @__PURE__ */ React13.createElement(Box13, { paddingX: 1, marginTop: 1 }, /* @__PURE__ */ React13.createElement(Text13, { color: "gray", dimColor: true, italic: true }, "(Press Enter to confirm selection)")));
|
|
7705
8087
|
case "stats":
|
|
7706
|
-
return /* @__PURE__ */
|
|
8088
|
+
return /* @__PURE__ */ React13.createElement(Box13, { flexDirection: "column", borderStyle: "round", paddingX: 3, paddingY: 1, width: Math.min(100, (stdout?.columns || 100) - 2) }, /* @__PURE__ */ React13.createElement(Box13, { marginBottom: 1 }, /* @__PURE__ */ React13.createElement(Text13, { color: "white", bold: true, underline: true }, "SESSION TELEMETRY")), /* @__PURE__ */ React13.createElement(Box13, { flexDirection: "column" }, /* @__PURE__ */ React13.createElement(Box13, null, /* @__PURE__ */ React13.createElement(Box13, { width: 25 }, /* @__PURE__ */ React13.createElement(Text13, { color: "blue" }, "Session Duration:")), /* @__PURE__ */ React13.createElement(Text13, { color: "white" }, formatMsDuration(Date.now() - SESSION_START_TIME))), /* @__PURE__ */ React13.createElement(Box13, null, /* @__PURE__ */ React13.createElement(Box13, { width: 25 }, /* @__PURE__ */ React13.createElement(Text13, { color: "blue" }, "Agent Interactions:")), /* @__PURE__ */ React13.createElement(Text13, { color: "white" }, sessionAgentCalls)), /* @__PURE__ */ React13.createElement(Box13, { marginLeft: 2 }, /* @__PURE__ */ React13.createElement(Box13, { width: 23 }, /* @__PURE__ */ React13.createElement(Text13, { color: "blue", dimColor: true }, "\xBB API Time:")), /* @__PURE__ */ React13.createElement(Text13, { color: "white" }, formatMsDuration(sessionApiTime))), /* @__PURE__ */ React13.createElement(Box13, { marginLeft: 2 }, /* @__PURE__ */ React13.createElement(Box13, { width: 23 }, /* @__PURE__ */ React13.createElement(Text13, { color: "blue", dimColor: true }, "\xBB Tool Time:")), /* @__PURE__ */ React13.createElement(Text13, { color: "white" }, formatMsDuration(sessionToolTime))), /* @__PURE__ */ React13.createElement(Box13, null, /* @__PURE__ */ React13.createElement(Box13, { width: 25 }, /* @__PURE__ */ React13.createElement(Text13, { color: "blue" }, "Background Tasks:")), /* @__PURE__ */ React13.createElement(Text13, { color: "white" }, sessionBackgroundCalls)), /* @__PURE__ */ React13.createElement(Box13, null, /* @__PURE__ */ React13.createElement(Box13, { width: 25 }, /* @__PURE__ */ React13.createElement(Text13, { color: "blue" }, "Tokens Consumed:")), /* @__PURE__ */ React13.createElement(Text13, { color: "white" }, formatTokens(sessionTotalTokens))), /* @__PURE__ */ React13.createElement(Box13, null, /* @__PURE__ */ React13.createElement(Box13, { width: 25 }, /* @__PURE__ */ React13.createElement(Text13, { color: "blue" }, "Images Made:")), /* @__PURE__ */ React13.createElement(Text13, { color: "white" }, sessionImageCount || 0)), /* @__PURE__ */ React13.createElement(Box13, null, /* @__PURE__ */ React13.createElement(Box13, { width: 25 }, /* @__PURE__ */ React13.createElement(Text13, { color: "blue" }, "Image Credits:")), /* @__PURE__ */ React13.createElement(Text13, { color: "white" }, Number(((sessionImageCredits || 0) * 1e3).toFixed(0)), " credits")), /* @__PURE__ */ React13.createElement(Box13, null, /* @__PURE__ */ React13.createElement(Box13, { width: 25 }, /* @__PURE__ */ React13.createElement(Text13, { color: "blue" }, "Code Changes (Sess):")), /* @__PURE__ */ React13.createElement(Text13, { color: "white" }, /* @__PURE__ */ React13.createElement(Text13, { color: "green" }, "+", linesAdded), " ", /* @__PURE__ */ React13.createElement(Text13, { color: "red" }, "-", linesRemoved))), /* @__PURE__ */ React13.createElement(Box13, null, /* @__PURE__ */ React13.createElement(Box13, { width: 25 }, /* @__PURE__ */ React13.createElement(Text13, { color: "blue" }, "Tool Calls (Sess):")), /* @__PURE__ */ React13.createElement(Text13, { color: "white" }, sessionToolSuccess + sessionToolFailure + sessionToolDenied, " ( "), /* @__PURE__ */ React13.createElement(Text13, { color: "green" }, "\u2713 ", sessionToolSuccess), /* @__PURE__ */ React13.createElement(Text13, { color: "white" }, " "), /* @__PURE__ */ React13.createElement(Text13, { color: "yellow" }, "\u2298 ", sessionToolDenied), /* @__PURE__ */ React13.createElement(Text13, { color: "white" }, " "), /* @__PURE__ */ React13.createElement(Text13, { color: "red" }, "\u2715 ", sessionToolFailure), /* @__PURE__ */ React13.createElement(Text13, { color: "white" }, " )"))), /* @__PURE__ */ React13.createElement(Box13, { flexDirection: "column", marginTop: 1 }, /* @__PURE__ */ React13.createElement(Text13, { color: "white", bold: true, underline: true }, "DAILY USAGE TRACKER"), /* @__PURE__ */ React13.createElement(Box13, { marginTop: 1 }, /* @__PURE__ */ React13.createElement(Box13, { width: 25 }, /* @__PURE__ */ React13.createElement(Text13, { color: "blue" }, "Wall Time Today:")), /* @__PURE__ */ React13.createElement(Text13, { color: "white" }, formatDuration(dailyUsage?.duration || 0))), /* @__PURE__ */ React13.createElement(Box13, null, /* @__PURE__ */ React13.createElement(Box13, { width: 25 }, /* @__PURE__ */ React13.createElement(Text13, { color: "blue" }, "Agent Interactions:")), /* @__PURE__ */ React13.createElement(Text13, { color: "white" }, dailyUsage?.agent || 0)), /* @__PURE__ */ React13.createElement(Box13, null, /* @__PURE__ */ React13.createElement(Box13, { width: 25 }, /* @__PURE__ */ React13.createElement(Text13, { color: "blue" }, "Background Tasks:")), /* @__PURE__ */ React13.createElement(Text13, { color: "white" }, dailyUsage?.background || 0)), /* @__PURE__ */ React13.createElement(Box13, null, /* @__PURE__ */ React13.createElement(Box13, { width: 25 }, /* @__PURE__ */ React13.createElement(Text13, { color: "blue" }, "Tokens Used Today:")), /* @__PURE__ */ React13.createElement(Text13, { color: "white" }, formatTokens(dailyUsage?.tokens || 0))), /* @__PURE__ */ React13.createElement(Box13, null, /* @__PURE__ */ React13.createElement(Box13, { width: 25 }, /* @__PURE__ */ React13.createElement(Text13, { color: "blue" }, "Images Made Today:")), /* @__PURE__ */ React13.createElement(Text13, { color: "white" }, dailyUsage?.imageCalls?.length || 0)), /* @__PURE__ */ React13.createElement(Box13, null, /* @__PURE__ */ React13.createElement(Box13, { width: 25 }, /* @__PURE__ */ React13.createElement(Text13, { color: "blue" }, "Image Credits Today:")), /* @__PURE__ */ React13.createElement(Text13, { color: "white" }, Number(((dailyUsage?.imageCalls?.reduce((sum, c) => sum + c.cost, 0) || 0) * 1e3).toFixed(0)), " credits")), /* @__PURE__ */ React13.createElement(Box13, null, /* @__PURE__ */ React13.createElement(Box13, { width: 25 }, /* @__PURE__ */ React13.createElement(Text13, { color: "blue" }, "Code Changes Today:")), /* @__PURE__ */ React13.createElement(Text13, { color: "white" }, /* @__PURE__ */ React13.createElement(Text13, { color: "green" }, "+", dailyUsage?.linesAdded || 0), " ", /* @__PURE__ */ React13.createElement(Text13, { color: "red" }, "-", dailyUsage?.linesRemoved || 0))), /* @__PURE__ */ React13.createElement(Box13, null, /* @__PURE__ */ React13.createElement(Box13, { width: 25 }, /* @__PURE__ */ React13.createElement(Text13, { color: "blue" }, "Tool Calls Today:")), /* @__PURE__ */ React13.createElement(Text13, { color: "white" }, (dailyUsage?.toolSuccess || 0) + (dailyUsage?.toolFailure || 0) + (dailyUsage?.toolDenied || 0), " ( "), /* @__PURE__ */ React13.createElement(Text13, { color: "green" }, "\u2713 ", dailyUsage?.toolSuccess || 0), /* @__PURE__ */ React13.createElement(Text13, { color: "white" }, " "), /* @__PURE__ */ React13.createElement(Text13, { color: "yellow" }, "\u2298 ", dailyUsage?.toolDenied || 0), /* @__PURE__ */ React13.createElement(Text13, { color: "white" }, " "), /* @__PURE__ */ React13.createElement(Text13, { color: "red" }, "\u2715 ", dailyUsage?.toolFailure || 0), /* @__PURE__ */ React13.createElement(Text13, { color: "white" }, " )"))), /* @__PURE__ */ React13.createElement(Text13, { dimColor: true, marginTop: 1, italic: true }, "(Press ESC to return to chat)"));
|
|
7707
8089
|
case "autoExecDanger":
|
|
7708
|
-
return /* @__PURE__ */
|
|
8090
|
+
return /* @__PURE__ */ React13.createElement(Box13, { flexDirection: "column", borderStyle: "round", borderColor: "yellow", paddingX: 2, paddingY: 1, width: "100%" }, /* @__PURE__ */ React13.createElement(Text13, { color: "yellow", bold: true, underline: true }, "\u26A0\uFE0F SECURITY WARNING: AUTO EXECUTE MODE"), /* @__PURE__ */ React13.createElement(Text13, { marginTop: 1 }, "Turning this ON allows the agent to execute terminal commands automatically without requiring your approval for each step."), /* @__PURE__ */ React13.createElement(Text13, { marginTop: 1, color: "yellow" }, "RISKS INVOLVED:"), /* @__PURE__ */ React13.createElement(Text13, null, "\u2022 The agent may execute destructive commands (rm -rf, etc.) by mistake."), /* @__PURE__ */ React13.createElement(Text13, null, "\u2022 Unintended system changes if the agent hallucinates a path or command."), /* @__PURE__ */ React13.createElement(Text13, null, "\u2022 Reduced control over the agent's step-by-step decision making."), /* @__PURE__ */ React13.createElement(Box13, { marginTop: 1 }, /* @__PURE__ */ React13.createElement(
|
|
7709
8091
|
CommandMenu,
|
|
7710
8092
|
{
|
|
7711
8093
|
title: "Confirm Intent",
|
|
@@ -7722,7 +8104,7 @@ Selection: ${val}`,
|
|
|
7722
8104
|
}
|
|
7723
8105
|
)));
|
|
7724
8106
|
case "externalDanger":
|
|
7725
|
-
return /* @__PURE__ */
|
|
8107
|
+
return /* @__PURE__ */ React13.createElement(Box13, { flexDirection: "column", borderStyle: "round", borderColor: "red", paddingX: 2, paddingY: 1, width: "100%" }, /* @__PURE__ */ React13.createElement(Text13, { color: "red", bold: true, underline: true }, "\u26A0\uFE0F SECURITY WARNING: EXTERNAL WORKSPACE ACCESS"), /* @__PURE__ */ React13.createElement(Text13, { marginTop: 1 }, "Turning this ON allows the agent to execute tools (Read/Write/Exec) outside of the current active workspace directory."), /* @__PURE__ */ React13.createElement(Text13, { marginTop: 1, color: "yellow" }, "RISKS INVOLVED:"), /* @__PURE__ */ React13.createElement(Text13, null, "\u2022 Access to sensitive system files (SSH keys, Browser data, etc.)"), /* @__PURE__ */ React13.createElement(Text13, null, "\u2022 Potential for accidental or malicious deletion of OS-critical files."), /* @__PURE__ */ React13.createElement(Text13, null, "\u2022 Unauthorized script execution across your entire file system."), /* @__PURE__ */ React13.createElement(Box13, { marginTop: 1 }, /* @__PURE__ */ React13.createElement(
|
|
7726
8108
|
CommandMenu,
|
|
7727
8109
|
{
|
|
7728
8110
|
title: "Confirm Intent",
|
|
@@ -7739,7 +8121,7 @@ Selection: ${val}`,
|
|
|
7739
8121
|
}
|
|
7740
8122
|
)));
|
|
7741
8123
|
case "doubleDanger":
|
|
7742
|
-
return /* @__PURE__ */
|
|
8124
|
+
return /* @__PURE__ */ React13.createElement(Box13, { flexDirection: "column", borderStyle: "round", borderColor: "red", paddingX: 2, paddingY: 1, width: "100%" }, /* @__PURE__ */ React13.createElement(Text13, { color: "red", bold: true, underline: true }, "\u26D4 CRITICAL SECURITY WARNING: COMBINED SYSTEM RISK"), /* @__PURE__ */ React13.createElement(Text13, { marginTop: 1 }, "You are attempting to enable BOTH [Auto Execute] and [External Workspace Access] simultaneously."), /* @__PURE__ */ React13.createElement(Text13, { marginTop: 1, color: "red", bold: true }, "THIS IS NOT RECOMMENDED."), /* @__PURE__ */ React13.createElement(Text13, { marginTop: 1, color: "yellow" }, "THE CRITICAL RISK:"), /* @__PURE__ */ React13.createElement(Text13, null, "The agent will have the power to execute any command across your entire system WITHOUT your approval or supervision."), /* @__PURE__ */ React13.createElement(Text13, { color: "red", italic: true, marginTop: 1 }, "A single hallucination or error could result in full system wipe or data theft."), /* @__PURE__ */ React13.createElement(Box13, { marginTop: 1 }, /* @__PURE__ */ React13.createElement(
|
|
7743
8125
|
CommandMenu,
|
|
7744
8126
|
{
|
|
7745
8127
|
title: "Final Confirmation",
|
|
@@ -7756,7 +8138,7 @@ Selection: ${val}`,
|
|
|
7756
8138
|
}
|
|
7757
8139
|
)));
|
|
7758
8140
|
case "key":
|
|
7759
|
-
return /* @__PURE__ */
|
|
8141
|
+
return /* @__PURE__ */ React13.createElement(
|
|
7760
8142
|
CommandMenu,
|
|
7761
8143
|
{
|
|
7762
8144
|
title: "\u{1F511} API KEY MANAGEMENT",
|
|
@@ -7780,10 +8162,10 @@ Selection: ${val}`,
|
|
|
7780
8162
|
}
|
|
7781
8163
|
);
|
|
7782
8164
|
case "deleteKey":
|
|
7783
|
-
return /* @__PURE__ */
|
|
8165
|
+
return /* @__PURE__ */ React13.createElement(Box13, { flexDirection: "column", borderStyle: "round", borderColor: "red", paddingX: 2, paddingY: 1 }, (() => {
|
|
7784
8166
|
const s = emojiSpace(2);
|
|
7785
|
-
return /* @__PURE__ */
|
|
7786
|
-
})(), /* @__PURE__ */
|
|
8167
|
+
return /* @__PURE__ */ React13.createElement(Text13, { color: "red", bold: true }, "\u26D4", s, "DANGER: PURGE API KEY");
|
|
8168
|
+
})(), /* @__PURE__ */ React13.createElement(Text13, { marginTop: 1 }, "This will permanently delete the saved API key from the project vault. You will need to enter it again to use Flux."), /* @__PURE__ */ React13.createElement(Box13, { marginTop: 1 }, /* @__PURE__ */ React13.createElement(
|
|
7787
8169
|
CommandMenu,
|
|
7788
8170
|
{
|
|
7789
8171
|
title: "Are you absolutely sure?",
|
|
@@ -7807,7 +8189,7 @@ Selection: ${val}`,
|
|
|
7807
8189
|
case "exit":
|
|
7808
8190
|
return null;
|
|
7809
8191
|
case "ask":
|
|
7810
|
-
return /* @__PURE__ */
|
|
8192
|
+
return /* @__PURE__ */ React13.createElement(Box13, { width: "100%" }, /* @__PURE__ */ React13.createElement(
|
|
7811
8193
|
AskUserModal_default,
|
|
7812
8194
|
{
|
|
7813
8195
|
question: pendingAsk?.question,
|
|
@@ -7822,7 +8204,7 @@ Selection: ${val}`,
|
|
|
7822
8204
|
}
|
|
7823
8205
|
));
|
|
7824
8206
|
case "revert":
|
|
7825
|
-
return /* @__PURE__ */
|
|
8207
|
+
return /* @__PURE__ */ React13.createElement(Box13, { width: "100%", alignItems: "center", justifyContent: "center" }, /* @__PURE__ */ React13.createElement(
|
|
7826
8208
|
RevertModal,
|
|
7827
8209
|
{
|
|
7828
8210
|
prompts: recentPrompts,
|
|
@@ -7876,7 +8258,7 @@ Selection: ${val}`,
|
|
|
7876
8258
|
}
|
|
7877
8259
|
));
|
|
7878
8260
|
case "resume":
|
|
7879
|
-
return /* @__PURE__ */
|
|
8261
|
+
return /* @__PURE__ */ React13.createElement(Box13, { width: "100%", alignItems: "center", justifyContent: "center" }, /* @__PURE__ */ React13.createElement(
|
|
7880
8262
|
ResumeModal,
|
|
7881
8263
|
{
|
|
7882
8264
|
onSelect: async (id) => {
|
|
@@ -7906,9 +8288,9 @@ Selection: ${val}`,
|
|
|
7906
8288
|
}
|
|
7907
8289
|
));
|
|
7908
8290
|
case "memory":
|
|
7909
|
-
return /* @__PURE__ */
|
|
8291
|
+
return /* @__PURE__ */ React13.createElement(Box13, { width: "100%", alignItems: "center", justifyContent: "center" }, /* @__PURE__ */ React13.createElement(MemoryModal, { onClose: () => setActiveView("chat") }));
|
|
7910
8292
|
case "profile":
|
|
7911
|
-
return /* @__PURE__ */
|
|
8293
|
+
return /* @__PURE__ */ React13.createElement(
|
|
7912
8294
|
ProfileForm,
|
|
7913
8295
|
{
|
|
7914
8296
|
initialData: profileData,
|
|
@@ -7921,7 +8303,7 @@ Selection: ${val}`,
|
|
|
7921
8303
|
}
|
|
7922
8304
|
);
|
|
7923
8305
|
case "resolution":
|
|
7924
|
-
return /* @__PURE__ */
|
|
8306
|
+
return /* @__PURE__ */ React13.createElement(Box13, { width: "100%", alignItems: "center", justifyContent: "center" }, /* @__PURE__ */ React13.createElement(
|
|
7925
8307
|
ResolutionModal,
|
|
7926
8308
|
{
|
|
7927
8309
|
data: resolutionData,
|
|
@@ -7940,15 +8322,15 @@ Selection: ${val}`,
|
|
|
7940
8322
|
}
|
|
7941
8323
|
));
|
|
7942
8324
|
case "approval":
|
|
7943
|
-
return /* @__PURE__ */
|
|
8325
|
+
return /* @__PURE__ */ React13.createElement(Box13, { flexDirection: "column", borderStyle: "round", borderColor: "yellow", paddingX: 2, paddingY: 1, width: "100%" }, /* @__PURE__ */ React13.createElement(Text13, { color: "yellow", bold: true, underline: true }, "\u{1F510} SECURITY GATE: FILE WRITE PERMISSION"), /* @__PURE__ */ React13.createElement(Text13, { marginTop: 1 }, "The agent is attempting to modify: ", /* @__PURE__ */ React13.createElement(Text13, { color: "cyan" }, parseArgs(pendingApproval?.args || "{}").path || "Unknown File")), /* @__PURE__ */ React13.createElement(Box13, { marginTop: 1, borderStyle: "single", borderColor: "#333", paddingX: 1, flexDirection: "column" }, /* @__PURE__ */ React13.createElement(Text13, { color: "gray" }, "--- PROPOSED CONTENT / DIFF ---"), (() => {
|
|
7944
8326
|
const args2 = parseArgs(pendingApproval?.args || "{}");
|
|
7945
8327
|
const oldVal = args2.TargetContent || args2.content_to_replace || args2.replaceContent || null;
|
|
7946
8328
|
const newVal = args2.content || args2.ReplacementContent || args2.content_to_add || args2.replacementContent || args2.newContent || null;
|
|
7947
8329
|
if (oldVal && newVal) {
|
|
7948
|
-
return /* @__PURE__ */
|
|
8330
|
+
return /* @__PURE__ */ React13.createElement(Box13, { flexDirection: "column", marginTop: 1 }, /* @__PURE__ */ React13.createElement(Box13, null, /* @__PURE__ */ React13.createElement(Text13, { color: "red", wrap: "anywhere", bold: true }, "- ", oldVal)), /* @__PURE__ */ React13.createElement(Box13, { marginTop: 1 }, /* @__PURE__ */ React13.createElement(Text13, { color: "green", wrap: "anywhere", bold: true }, "+ ", newVal.replace(/\[\/n\]?/g, "\\n"))));
|
|
7949
8331
|
}
|
|
7950
|
-
return /* @__PURE__ */
|
|
7951
|
-
})()), /* @__PURE__ */
|
|
8332
|
+
return /* @__PURE__ */ React13.createElement(Text13, { color: "white", wrap: "anywhere" }, (newVal ? newVal.replace(/\[\/n\]?/g, "\\n") : null) || "Updating file content...");
|
|
8333
|
+
})()), /* @__PURE__ */ React13.createElement(Box13, { marginTop: 1 }, /* @__PURE__ */ React13.createElement(
|
|
7952
8334
|
CommandMenu,
|
|
7953
8335
|
{
|
|
7954
8336
|
title: "Action Required",
|
|
@@ -7967,7 +8349,7 @@ Selection: ${val}`,
|
|
|
7967
8349
|
}
|
|
7968
8350
|
)));
|
|
7969
8351
|
case "updateManager":
|
|
7970
|
-
return /* @__PURE__ */
|
|
8352
|
+
return /* @__PURE__ */ React13.createElement(
|
|
7971
8353
|
CommandMenu,
|
|
7972
8354
|
{
|
|
7973
8355
|
title: "Select Preferred Update Manager",
|
|
@@ -8004,7 +8386,7 @@ Selection: ${val}`,
|
|
|
8004
8386
|
}
|
|
8005
8387
|
);
|
|
8006
8388
|
case "update":
|
|
8007
|
-
return /* @__PURE__ */
|
|
8389
|
+
return /* @__PURE__ */ React13.createElement(
|
|
8008
8390
|
UpdateProcessor_default,
|
|
8009
8391
|
{
|
|
8010
8392
|
latest: latestVer,
|
|
@@ -8030,7 +8412,7 @@ Selection: ${val}`,
|
|
|
8030
8412
|
}
|
|
8031
8413
|
);
|
|
8032
8414
|
case "terminalApproval":
|
|
8033
|
-
return /* @__PURE__ */
|
|
8415
|
+
return /* @__PURE__ */ React13.createElement(Box13, { flexDirection: "column", borderStyle: "round", borderColor: "red", paddingX: 2, paddingY: 1, width: "100%" }, /* @__PURE__ */ React13.createElement(Text13, { color: "red", bold: true, underline: true }, "\u{1F510} SECURITY GATE: TERMINAL COMMAND OVERSIGHT"), /* @__PURE__ */ React13.createElement(Box13, { marginTop: 1 }, /* @__PURE__ */ React13.createElement(Text13, null, "Agent requested to run: ", /* @__PURE__ */ React13.createElement(Text13, { color: "yellow", bold: true }, parseArgs(pendingApproval?.args || "{}").command || "Unknown Command"))), /* @__PURE__ */ React13.createElement(Box13, { marginTop: 1 }, /* @__PURE__ */ React13.createElement(
|
|
8034
8416
|
CommandMenu,
|
|
8035
8417
|
{
|
|
8036
8418
|
title: "Risk Assessment Required",
|
|
@@ -8046,8 +8428,8 @@ Selection: ${val}`,
|
|
|
8046
8428
|
}
|
|
8047
8429
|
)));
|
|
8048
8430
|
default:
|
|
8049
|
-
return /* @__PURE__ */
|
|
8050
|
-
|
|
8431
|
+
return /* @__PURE__ */ React13.createElement(Box13, { flexDirection: "column", marginTop: 1, flexShrink: 0, width: "100%" }, /* @__PURE__ */ React13.createElement(Box13, { paddingX: 1, marginBottom: 0, justifyContent: "space-between", width: "100%" }, /* @__PURE__ */ React13.createElement(Box13, null, statusText ? /* @__PURE__ */ React13.createElement(Box13, null, isSpinnerActive && /* @__PURE__ */ React13.createElement(Text13, { color: "magenta" }, /* @__PURE__ */ React13.createElement(Spinner2, { type: "dots" })), /* @__PURE__ */ React13.createElement(Text13, { color: "magenta", bold: true, italic: true }, isSpinnerActive ? " " : "", statusText.toUpperCase())) : /* @__PURE__ */ React13.createElement(Text13, { color: "cyan", dimColor: true, italic: true }, "READY FOR COMMAND...")), /* @__PURE__ */ React13.createElement(Box13, null, /* @__PURE__ */ React13.createElement(Text13, { color: "gray", bold: true }, "[ "), /* @__PURE__ */ React13.createElement(Text13, { color: "white" }, tempModelOverride || activeModel), /* @__PURE__ */ React13.createElement(Text13, { color: "gray", bold: true }, " ]"))), /* @__PURE__ */ React13.createElement(
|
|
8432
|
+
Box13,
|
|
8051
8433
|
{
|
|
8052
8434
|
borderStyle: "round",
|
|
8053
8435
|
borderColor: isProcessing ? "magenta" : "cyan",
|
|
@@ -8055,7 +8437,7 @@ Selection: ${val}`,
|
|
|
8055
8437
|
paddingY: 0,
|
|
8056
8438
|
width: "100%"
|
|
8057
8439
|
},
|
|
8058
|
-
/* @__PURE__ */
|
|
8440
|
+
/* @__PURE__ */ React13.createElement(Box13, { flexDirection: "column", width: "100%" }, maxLines > 2 && !isExpanded ? /* @__PURE__ */ React13.createElement(Box13, { flexDirection: "row", width: "100%", paddingY: 0, height: 1, overflow: "hidden" }, /* @__PURE__ */ React13.createElement(Box13, { flexShrink: 0, width: 4 }, /* @__PURE__ */ React13.createElement(Text13, { color: "cyan", bold: true }, "\u{1F4A0} ")), /* @__PURE__ */ React13.createElement(Box13, { flexGrow: 1, flexDirection: "row" }, /* @__PURE__ */ React13.createElement(Box13, { flexShrink: 0 }, /* @__PURE__ */ React13.createElement(Text13, { color: "magenta", bold: true }, "[PASTED ", maxLines, " LINES]")), /* @__PURE__ */ React13.createElement(Box13, { flexGrow: 1, marginLeft: 1 }, /* @__PURE__ */ React13.createElement(
|
|
8059
8441
|
MultilineInput,
|
|
8060
8442
|
{
|
|
8061
8443
|
value: "",
|
|
@@ -8072,9 +8454,10 @@ Selection: ${val}`,
|
|
|
8072
8454
|
newline: (key) => key.return && key.shift || key.return && key.ctrl || key.return && key.leftAlt || key.return && key.rightAlt
|
|
8073
8455
|
}
|
|
8074
8456
|
}
|
|
8075
|
-
)))) : /* @__PURE__ */
|
|
8457
|
+
)))) : /* @__PURE__ */ React13.createElement(Box13, { flexDirection: "row", width: "100%", paddingY: 0 }, /* @__PURE__ */ React13.createElement(Box13, { flexShrink: 0, width: 4 }, /* @__PURE__ */ React13.createElement(Text13, { color: isProcessing ? "magenta" : "cyan", bold: true }, isProcessing ? "\u2726 " : "\u{1F4A0} ")), /* @__PURE__ */ React13.createElement(Box13, { flexGrow: 1 }, /* @__PURE__ */ React13.createElement(Box13, { flexGrow: 1, position: "relative" }, input === "" && /* @__PURE__ */ React13.createElement(Box13, { position: "absolute", paddingLeft: 0 }, activeCommand && !isTerminalFocused ? /* @__PURE__ */ React13.createElement(Text13, { color: "yellow" }, " Press TAB to interact with terminal...") : activeCommand && isTerminalFocused ? /* @__PURE__ */ React13.createElement(Text13, { color: "yellow", bold: true }, " [ TERMINAL FOCUSED ] Type to interact, press TAB to exit...") : escPressCount === 1 ? /* @__PURE__ */ React13.createElement(Text13, { color: "cyan", bold: true }, " Press ESC again to revert codebase to checkpoint...") : /* @__PURE__ */ React13.createElement(Text13, { color: "gray" }, escPressed ? " Press ESC again to cancel the request." : !isProcessing ? ` Send message or /cmd... (${terminalEnv.shortcut} for newline)` : " Enter a prompt to steer the agent.")), /* @__PURE__ */ React13.createElement(
|
|
8076
8458
|
MultilineInput,
|
|
8077
8459
|
{
|
|
8460
|
+
key: `input-${inputKey}`,
|
|
8078
8461
|
focus: !isTerminalFocused,
|
|
8079
8462
|
value: input,
|
|
8080
8463
|
onChange: (val) => {
|
|
@@ -8093,14 +8476,14 @@ Selection: ${val}`,
|
|
|
8093
8476
|
));
|
|
8094
8477
|
}
|
|
8095
8478
|
};
|
|
8096
|
-
return /* @__PURE__ */
|
|
8479
|
+
return /* @__PURE__ */ React13.createElement(Box13, { flexDirection: "column", width: "100%" }, /* @__PURE__ */ React13.createElement(Box13, { flexDirection: "column", width: "100%", flexGrow: 1 }, windowedHistory.items.map((msg, idx) => /* @__PURE__ */ React13.createElement(MessageItem, { key: msg.id || idx, msg, showFullThinking, columns: stdout?.columns || 80 }))), /* @__PURE__ */ React13.createElement(Box13, { flexDirection: "column", padding: 1, width: "100%" }, (activeView === "chat" || ["ask", "approval", "terminalApproval"].includes(activeView)) && /* @__PURE__ */ React13.createElement(Box13, { flexDirection: "column", width: "100%" }, /* @__PURE__ */ React13.createElement(
|
|
8097
8480
|
ChatLayout_default,
|
|
8098
8481
|
{
|
|
8099
8482
|
messages: messages.slice(completedIndex),
|
|
8100
8483
|
showFullThinking,
|
|
8101
8484
|
columns: Math.max(20, (stdout?.columns || 80) - 1)
|
|
8102
8485
|
}
|
|
8103
|
-
), activeCommand && /* @__PURE__ */
|
|
8486
|
+
), activeCommand && /* @__PURE__ */ React13.createElement(Box13, { marginTop: 1 }, /* @__PURE__ */ React13.createElement(TerminalBox, { command: activeCommand, output: execOutput, isFocused: isTerminalFocused }))), isInitializing ? /* @__PURE__ */ React13.createElement(Box13, { borderStyle: "double", borderColor: "magenta", padding: 1, flexShrink: 0 }, /* @__PURE__ */ React13.createElement(Text13, { color: "magenta" }, "\u{1F30A} Starting Flux Flow...")) : !apiKey ? /* @__PURE__ */ React13.createElement(Box13, { borderStyle: "round", borderColor: "gray", padding: 0, flexDirection: "column", flexShrink: 0, width: "100%" }, /* @__PURE__ */ React13.createElement(Box13, { paddingX: 1, marginBottom: 1 }, /* @__PURE__ */ React13.createElement(Text13, { color: "yellow", bold: true }, "\u{1F511}", emojiSpace(2), "API KEY REQUIRED")), /* @__PURE__ */ React13.createElement(Box13, { paddingX: 1, flexDirection: "column" }, /* @__PURE__ */ React13.createElement(Text13, null, "Please enter your Gemini API Key to initialize the agent."), /* @__PURE__ */ React13.createElement(Box13, { marginTop: 1 }, /* @__PURE__ */ React13.createElement(Text13, { color: "cyan", bold: true }, "\u{1F4A0} "), /* @__PURE__ */ React13.createElement(
|
|
8104
8487
|
TextInput4,
|
|
8105
8488
|
{
|
|
8106
8489
|
value: tempKey,
|
|
@@ -8108,7 +8491,7 @@ Selection: ${val}`,
|
|
|
8108
8491
|
onSubmit: handleSetup,
|
|
8109
8492
|
mask: "*"
|
|
8110
8493
|
}
|
|
8111
|
-
))), /* @__PURE__ */
|
|
8494
|
+
))), /* @__PURE__ */ React13.createElement(Box13, { paddingX: 1, marginTop: 1 }, /* @__PURE__ */ React13.createElement(Text13, { color: "gray", dimColor: true, italic: true }, "(Press Enter to confirm and initialize)"))) : renderActiveView(), confirmExit && /* @__PURE__ */ React13.createElement(Box13, { borderStyle: "round", borderColor: "red", paddingX: 2, marginY: 0, width: "100%" }, /* @__PURE__ */ React13.createElement(Text13, { color: "red", bold: true }, "\u{1F534} EXIT CONFIRMATION: "), /* @__PURE__ */ React13.createElement(Text13, { color: "white" }, "Press "), /* @__PURE__ */ React13.createElement(Text13, { color: "red", bold: true }, "CTRL + C"), /* @__PURE__ */ React13.createElement(Text13, { color: "white" }, " again to exit (", exitCountdown, "s). Press "), /* @__PURE__ */ React13.createElement(Text13, { color: "cyan", bold: true }, "ESC"), /* @__PURE__ */ React13.createElement(Text13, { color: "white" }, " to cancel.")), /* @__PURE__ */ React13.createElement(Box13, { flexShrink: 0, width: "100%" }, /* @__PURE__ */ React13.createElement(
|
|
8112
8495
|
StatusBar_default,
|
|
8113
8496
|
{
|
|
8114
8497
|
mode,
|
|
@@ -8125,14 +8508,14 @@ Selection: ${val}`,
|
|
|
8125
8508
|
const agentActiveMs = sessionApiTime + sessionToolTime;
|
|
8126
8509
|
const apiPercent = agentActiveMs > 0 ? (sessionApiTime / agentActiveMs * 100).toFixed(1) : "0.0";
|
|
8127
8510
|
const toolPercent = agentActiveMs > 0 ? (sessionToolTime / agentActiveMs * 100).toFixed(1) : "0.0";
|
|
8128
|
-
return /* @__PURE__ */
|
|
8511
|
+
return /* @__PURE__ */ React13.createElement(Box13, { flexDirection: "column", borderStyle: "round", paddingX: 3, paddingY: 1, borderColor: "red", width: Math.min(100, (stdout?.columns || 100) - 2), marginTop: 0, marginBottom: 1 }, /* @__PURE__ */ React13.createElement(Box13, { marginBottom: 1 }, /* @__PURE__ */ React13.createElement(Text13, { color: "cyan", bold: true }, "Agent powering down. ", /* @__PURE__ */ React13.createElement(Text13, { color: "magenta" }, "Goodbye!"))), /* @__PURE__ */ React13.createElement(Box13, { flexDirection: "column" }, /* @__PURE__ */ React13.createElement(Text13, { color: "white", bold: true, underline: true }, "Interaction Summary"), /* @__PURE__ */ React13.createElement(Box13, { marginTop: 1 }, /* @__PURE__ */ React13.createElement(Box13, { width: 20 }, /* @__PURE__ */ React13.createElement(Text13, { color: "blue" }, "Session ID:")), /* @__PURE__ */ React13.createElement(Text13, { color: "white" }, chatId)), /* @__PURE__ */ React13.createElement(Box13, null, /* @__PURE__ */ React13.createElement(Box13, { width: 20 }, /* @__PURE__ */ React13.createElement(Text13, { color: "blue" }, "Tool Calls:")), /* @__PURE__ */ React13.createElement(Text13, { color: "white" }, sessionToolSuccess + sessionToolFailure + sessionToolDenied, " ( ", /* @__PURE__ */ React13.createElement(Text13, { color: "green" }, "\u2713 ", sessionToolSuccess), " ", /* @__PURE__ */ React13.createElement(Text13, { color: "yellow" }, "\u2298 ", sessionToolDenied), " ", /* @__PURE__ */ React13.createElement(Text13, { color: "red" }, "\u2715 ", sessionToolFailure), " )")), /* @__PURE__ */ React13.createElement(Box13, null, /* @__PURE__ */ React13.createElement(Box13, { width: 20 }, /* @__PURE__ */ React13.createElement(Text13, { color: "blue" }, "Success Rate:")), /* @__PURE__ */ React13.createElement(Text13, { color: "white" }, successRate, "%")), /* @__PURE__ */ React13.createElement(Box13, null, /* @__PURE__ */ React13.createElement(Box13, { width: 20 }, /* @__PURE__ */ React13.createElement(Text13, { color: "blue" }, "Code Changes:")), /* @__PURE__ */ React13.createElement(Text13, { color: "white" }, /* @__PURE__ */ React13.createElement(Text13, { color: "green" }, "+", linesAdded), " ", /* @__PURE__ */ React13.createElement(Text13, { color: "red" }, "-", linesRemoved))), /* @__PURE__ */ React13.createElement(Box13, null, /* @__PURE__ */ React13.createElement(Box13, { width: 20 }, /* @__PURE__ */ React13.createElement(Text13, { color: "blue" }, "Tokens Consumed:")), /* @__PURE__ */ React13.createElement(Text13, { color: "white" }, formatTokens(sessionTotalTokens))), /* @__PURE__ */ React13.createElement(Box13, null, /* @__PURE__ */ React13.createElement(Box13, { width: 20 }, /* @__PURE__ */ React13.createElement(Text13, { color: "blue" }, "Images Made:")), /* @__PURE__ */ React13.createElement(Text13, { color: "white" }, sessionImageCount || 0)), /* @__PURE__ */ React13.createElement(Box13, null, /* @__PURE__ */ React13.createElement(Box13, { width: 20 }, /* @__PURE__ */ React13.createElement(Text13, { color: "blue" }, "Image Credits:")), /* @__PURE__ */ React13.createElement(Text13, { color: "white" }, Number(((sessionImageCredits || 0) * 1e3).toFixed(0)), " credits"))), /* @__PURE__ */ React13.createElement(Box13, { flexDirection: "column", marginTop: 1 }, /* @__PURE__ */ React13.createElement(Text13, { color: "white", bold: true, underline: true }, "Performance"), /* @__PURE__ */ React13.createElement(Box13, { marginTop: 1 }, /* @__PURE__ */ React13.createElement(Box13, { width: 20 }, /* @__PURE__ */ React13.createElement(Text13, { color: "blue" }, "Wall Time:")), /* @__PURE__ */ React13.createElement(Text13, { color: "white" }, formatMsDuration(wallTimeMs))), /* @__PURE__ */ React13.createElement(Box13, null, /* @__PURE__ */ React13.createElement(Box13, { width: 20 }, /* @__PURE__ */ React13.createElement(Text13, { color: "blue" }, "Agent Active:")), /* @__PURE__ */ React13.createElement(Text13, { color: "white" }, formatMsDuration(agentActiveMs))), /* @__PURE__ */ React13.createElement(Box13, { marginLeft: 2 }, /* @__PURE__ */ React13.createElement(Box13, { width: 18 }, /* @__PURE__ */ React13.createElement(Text13, { color: "blue", dimColor: true }, "\xBB API Time:")), /* @__PURE__ */ React13.createElement(Text13, { color: "white" }, formatMsDuration(sessionApiTime), " (", apiPercent, "%)")), /* @__PURE__ */ React13.createElement(Box13, { marginLeft: 2 }, /* @__PURE__ */ React13.createElement(Box13, { width: 18 }, /* @__PURE__ */ React13.createElement(Text13, { color: "blue", dimColor: true }, "\xBB Tool Time:")), /* @__PURE__ */ React13.createElement(Text13, { color: "white" }, formatMsDuration(sessionToolTime), " (", toolPercent, "%)"))));
|
|
8129
8512
|
})(), suggestions.length > 0 && (() => {
|
|
8130
8513
|
const windowSize = 5;
|
|
8131
8514
|
const startIdx = Math.max(0, Math.min(selectedIndex - 2, suggestions.length - windowSize));
|
|
8132
8515
|
const visible = suggestions.slice(startIdx, startIdx + windowSize);
|
|
8133
8516
|
const remaining = suggestions.length - (startIdx + visible.length);
|
|
8134
|
-
return /* @__PURE__ */
|
|
8135
|
-
|
|
8517
|
+
return /* @__PURE__ */ React13.createElement(
|
|
8518
|
+
Box13,
|
|
8136
8519
|
{
|
|
8137
8520
|
flexDirection: "column",
|
|
8138
8521
|
borderStyle: "round",
|
|
@@ -8141,39 +8524,44 @@ Selection: ${val}`,
|
|
|
8141
8524
|
paddingY: 0,
|
|
8142
8525
|
width: "100%"
|
|
8143
8526
|
},
|
|
8144
|
-
/* @__PURE__ */
|
|
8527
|
+
/* @__PURE__ */ React13.createElement(Box13, { paddingX: 1, marginBottom: 0, justifyContent: "space-between", width: "100%" }, /* @__PURE__ */ React13.createElement(Text13, { color: "gray", bold: true, dimColor: true }, suggestions[0]?.cmd?.startsWith("@") ? "\u{1F4C1} FILE SUGGESTIONS" : "\u{1F50D} COMMAND SUGGESTIONS"), suggestions[0]?.cmd?.startsWith("@") && /* @__PURE__ */ React13.createElement(Text13, { color: "gray", dimColor: true, italic: true }, "(Use '#Lstart-Lend' to specify line numbers)")),
|
|
8145
8528
|
visible.map((s, i) => {
|
|
8146
8529
|
const actualIdx = startIdx + i;
|
|
8147
8530
|
const isActive = actualIdx === selectedIndex;
|
|
8148
8531
|
const isGemmaDisabled = s.cmd === "gemma-4-31b-it" && apiTier !== "Free";
|
|
8149
|
-
return /* @__PURE__ */
|
|
8150
|
-
|
|
8532
|
+
return /* @__PURE__ */ React13.createElement(
|
|
8533
|
+
Box13,
|
|
8151
8534
|
{
|
|
8152
8535
|
key: s.cmd,
|
|
8153
8536
|
flexDirection: "row",
|
|
8154
8537
|
backgroundColor: isActive ? "#2a2a2a" : void 0,
|
|
8155
8538
|
paddingX: 1
|
|
8156
8539
|
},
|
|
8157
|
-
/* @__PURE__ */
|
|
8158
|
-
/* @__PURE__ */
|
|
8159
|
-
|
|
8540
|
+
/* @__PURE__ */ React13.createElement(Box13, { width: 3 }, /* @__PURE__ */ React13.createElement(Text13, { color: isActive ? "cyan" : "gray", bold: isActive }, isActive ? " \u276F" : " ")),
|
|
8541
|
+
/* @__PURE__ */ React13.createElement(Box13, { width: 32 }, /* @__PURE__ */ React13.createElement(
|
|
8542
|
+
Text13,
|
|
8160
8543
|
{
|
|
8161
8544
|
color: isGemmaDisabled ? "gray" : isActive ? "yellow" : "white",
|
|
8162
8545
|
bold: isActive,
|
|
8163
8546
|
dimColor: isGemmaDisabled && !isActive
|
|
8164
8547
|
},
|
|
8165
|
-
s.cmd
|
|
8548
|
+
s.cmd?.startsWith("@[") && s.cmd?.endsWith("]") ? (() => {
|
|
8549
|
+
const pathPart = s.cmd.slice(2, -1);
|
|
8550
|
+
const parts = pathPart.split(/[/\\]/);
|
|
8551
|
+
return parts[parts.length - 1];
|
|
8552
|
+
})() : s.cmd
|
|
8166
8553
|
)),
|
|
8167
|
-
/* @__PURE__ */
|
|
8554
|
+
/* @__PURE__ */ React13.createElement(Box13, { flexGrow: 1 }, /* @__PURE__ */ React13.createElement(Text13, { color: "gray", italic: true, dimColor: !isActive }, s.desc))
|
|
8168
8555
|
);
|
|
8169
8556
|
}),
|
|
8170
|
-
suggestions.length > 5 && /* @__PURE__ */
|
|
8557
|
+
suggestions.length > 5 && /* @__PURE__ */ React13.createElement(Box13, { paddingX: 1, height: 1 }, remaining > 0 ? /* @__PURE__ */ React13.createElement(Text13, { color: "gray", dimColor: true, italic: true }, " ... (", remaining, " more commands available)") : /* @__PURE__ */ React13.createElement(Text13, { color: "gray", dimColor: true, italic: true }, " (End of list)"))
|
|
8171
8558
|
);
|
|
8172
8559
|
})()));
|
|
8173
8560
|
}
|
|
8174
8561
|
var SESSION_START_TIME, CHANGELOG_URL, linesAdded, linesRemoved, packageJsonPath, packageJson, versionFluxflow, updatedOn, ResolutionModal, FLUX_LOGO, parseAgentText, getProjectFiles;
|
|
8175
8562
|
var init_app = __esm({
|
|
8176
8563
|
"src/app.jsx"() {
|
|
8564
|
+
init_MultilineInput();
|
|
8177
8565
|
init_ChatLayout();
|
|
8178
8566
|
init_StatusBar();
|
|
8179
8567
|
init_CommandMenu();
|
|
@@ -8205,7 +8593,7 @@ var init_app = __esm({
|
|
|
8205
8593
|
packageJson = JSON.parse(fs18.readFileSync(packageJsonPath, "utf8"));
|
|
8206
8594
|
versionFluxflow = packageJson.version;
|
|
8207
8595
|
updatedOn = packageJson.date || "2026-05-20";
|
|
8208
|
-
ResolutionModal = ({ data, onResolve, onEdit }) => /* @__PURE__ */
|
|
8596
|
+
ResolutionModal = ({ data, onResolve, onEdit }) => /* @__PURE__ */ React13.createElement(Box13, { flexDirection: "column", borderStyle: "round", borderColor: "gray", padding: 0, width: "100%" }, /* @__PURE__ */ React13.createElement(Box13, { paddingX: 1 }, /* @__PURE__ */ React13.createElement(Text13, { color: "magenta", bold: true, underline: true }, "\u{1F7E3} STEERING HINT RESOLUTION")), /* @__PURE__ */ React13.createElement(Box13, { paddingX: 1, marginTop: 1 }, /* @__PURE__ */ React13.createElement(Text13, null, "The agent already finished the task before your hint was consumed.")), /* @__PURE__ */ React13.createElement(Box13, { marginTop: 1, backgroundColor: "#222", paddingX: 2, width: "100%" }, /* @__PURE__ */ React13.createElement(Text13, { italic: true, color: "gray" }, '"', data, '"')), /* @__PURE__ */ React13.createElement(Box13, { paddingX: 1, marginTop: 1 }, /* @__PURE__ */ React13.createElement(Text13, { color: "cyan" }, "How would you like to proceed?")), /* @__PURE__ */ React13.createElement(Box13, { marginTop: 0 }, /* @__PURE__ */ React13.createElement(
|
|
8209
8597
|
CommandMenu,
|
|
8210
8598
|
{
|
|
8211
8599
|
title: "Select Action",
|
|
@@ -8344,7 +8732,7 @@ if (isBundled && !process.execArgv.some((arg) => arg.includes("max-old-space-siz
|
|
|
8344
8732
|
], { stdio: "inherit" });
|
|
8345
8733
|
cp.on("exit", (code) => process.exit(code || 0));
|
|
8346
8734
|
} else {
|
|
8347
|
-
const { default:
|
|
8735
|
+
const { default: React14 } = await import("react");
|
|
8348
8736
|
const { render } = await import("ink");
|
|
8349
8737
|
const { default: App2 } = await Promise.resolve().then(() => (init_app(), app_exports));
|
|
8350
8738
|
process.env.NODE_NO_WARNINGS = "1";
|
|
@@ -8367,5 +8755,5 @@ if (isBundled && !process.execArgv.some((arg) => arg.includes("max-old-space-siz
|
|
|
8367
8755
|
console.warn = (...args) => !isNoise(args) && originalWarn(...args);
|
|
8368
8756
|
console.error = (...args) => !isNoise(args) && originalError(...args);
|
|
8369
8757
|
process.stdout.write("\x1Bc");
|
|
8370
|
-
render(/* @__PURE__ */
|
|
8758
|
+
render(/* @__PURE__ */ React14.createElement(App2, { args: process.argv.slice(2) }), { exitOnCtrlC: false });
|
|
8371
8759
|
}
|