fluxflow-cli 1.8.34 → 1.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/fluxflow.js +382 -229
- package/package.json +1 -1
package/dist/fluxflow.js
CHANGED
|
@@ -111,14 +111,51 @@ var init_TerminalBox = __esm({
|
|
|
111
111
|
}
|
|
112
112
|
});
|
|
113
113
|
|
|
114
|
+
// src/utils/terminal.js
|
|
115
|
+
var getTerminalEnv, emojiSpace;
|
|
116
|
+
var init_terminal = __esm({
|
|
117
|
+
"src/utils/terminal.js"() {
|
|
118
|
+
getTerminalEnv = () => {
|
|
119
|
+
if (process.env.TERM_PROGRAM === "vscode") return "vscode";
|
|
120
|
+
if (process.env.WT_SESSION) return "wt";
|
|
121
|
+
return "default";
|
|
122
|
+
};
|
|
123
|
+
emojiSpace = (baseSpaces = 2) => {
|
|
124
|
+
const env = getTerminalEnv();
|
|
125
|
+
if (env === "wt") {
|
|
126
|
+
return " ".repeat(Math.max(1, baseSpaces - 1));
|
|
127
|
+
}
|
|
128
|
+
if (env === "vscode") {
|
|
129
|
+
return " ".repeat(baseSpaces);
|
|
130
|
+
}
|
|
131
|
+
return " ".repeat(baseSpaces);
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
});
|
|
135
|
+
|
|
114
136
|
// src/components/ChatLayout.jsx
|
|
115
137
|
import React2, { useState, useEffect, useRef } from "react";
|
|
116
138
|
import { Box as Box2, Text as Text2 } from "ink";
|
|
117
|
-
var cleanSignals, formatThinkText, parseMathSymbols, InlineMarkdown, TableRenderer, MarkdownText, DiffLine, DiffBlock, CodeRenderer, MessageItem, ChatLayout, ChatLayout_default;
|
|
139
|
+
var TOOL_LABELS, cleanSignals, formatThinkText, parseMathSymbols, InlineMarkdown, TableRenderer, MarkdownText, DiffLine, DiffBlock, CodeRenderer, MessageItem, ChatLayout, ChatLayout_default;
|
|
118
140
|
var init_ChatLayout = __esm({
|
|
119
141
|
"src/components/ChatLayout.jsx"() {
|
|
120
142
|
init_TerminalBox();
|
|
121
143
|
init_text();
|
|
144
|
+
init_terminal();
|
|
145
|
+
TOOL_LABELS = {
|
|
146
|
+
"write_file": "Write File",
|
|
147
|
+
"update_file": "Update File",
|
|
148
|
+
"read_folder": "Read Folder",
|
|
149
|
+
"view_file": "View File",
|
|
150
|
+
"exec_command": "Execute Command",
|
|
151
|
+
"web_search": "Web Search",
|
|
152
|
+
"web_scrape": "Read Site",
|
|
153
|
+
"search_keyword": "Find Files",
|
|
154
|
+
"ask": "Ask User",
|
|
155
|
+
"write_pdf": "Create PDF",
|
|
156
|
+
"write_pptx": "Create Presentation",
|
|
157
|
+
"write_docx": "Create Document"
|
|
158
|
+
};
|
|
122
159
|
cleanSignals = (text) => {
|
|
123
160
|
if (!text) return text;
|
|
124
161
|
let result = text;
|
|
@@ -173,7 +210,7 @@ var init_ChatLayout = __esm({
|
|
|
173
210
|
}
|
|
174
211
|
}
|
|
175
212
|
}
|
|
176
|
-
return result.replace(/^\[TOOL_RESULT\]:\s*/gi, "").split("\n").filter((line) => !line.trim().startsWith("SUCCESS:") && !line.trim().startsWith("ERROR:")).join("\n").replace(/\[\s*
|
|
213
|
+
return result.replace(/^\[TOOL_RESULT\]:\s*/gi, "").split("\n").filter((line) => !line.trim().startsWith("SUCCESS:") && !line.trim().startsWith("ERROR:")).join("\n").replace(/\[\s*turn\s*:\s*(continue|finish)\s*\]/gi, "").replace(/\[\s*turn\s*:?.*?$/gi, "").replace(/\n\s*turn\s*:?.*?$/gi, "").replace(/\[\s*$/gi, "").replace(/\n\nResponded on .*/g, "").replace(/\n\n\[Prompted on: .*\]/g, "").replace(/(\$?\\?\/?\\rightarrow\$?|\$\\rightarrow\$)/gi, "\u2192").replace(/(\$?\\?\/?\\leftarrow\$?|\$\\leftarrow\$)/gi, "\u2190").replace(/(\$?\\?\/?\\uparrow\$?|\$\\uparrow\$)/gi, "\u2191").replace(/(\$?\\?\/?\\downarrow\$?|\$\\downarrow\$)/gi, "\u2193").replace(/(\$?\\?\/?\\leftrightarrow\$?|\$\\leftrightarrow\$)/gi, "\u2194").replace(/\[\/n\]?/g, "\\n").replace(/@\[TerminalName:.*?, ProcessId:.*?\]/gi, "").replace(/\b(write_file|update_file|read_folder|view_file|exec_command|web_search|web_scrape|search_keyword|ask|write_pdf|write_pptx|write_docx)\b/gi, (match) => TOOL_LABELS[match.toLowerCase()] || match).trim();
|
|
177
214
|
};
|
|
178
215
|
formatThinkText = (cleaned, columns = 80) => {
|
|
179
216
|
if (!cleaned) return null;
|
|
@@ -358,6 +395,12 @@ var init_ChatLayout = __esm({
|
|
|
358
395
|
const isDiffResult = msg.role === "system" && msg.text?.includes("[DIFF_START]");
|
|
359
396
|
const isPatchError = msg.role === "system" && msg.text?.includes("[TOOL_RESULT]: ERROR:") && (msg.toolName === "update_file" || msg.text?.includes("Could not find exact match"));
|
|
360
397
|
const isTerminalRecord = msg.isTerminalRecord;
|
|
398
|
+
if (msg.id && String(msg.id).startsWith("welcome")) {
|
|
399
|
+
const parts = msg.text.split("\n\n");
|
|
400
|
+
const logo = parts[0];
|
|
401
|
+
const greeting = parts[1] || "";
|
|
402
|
+
return /* @__PURE__ */ React2.createElement(Box2, { flexDirection: "column", alignItems: "center", width: "100%", marginY: 1 }, /* @__PURE__ */ React2.createElement(Box2, { marginBottom: 1 }, /* @__PURE__ */ React2.createElement(Text2, null, logo)), /* @__PURE__ */ React2.createElement(Box2, { borderStyle: "round", borderColor: "gray", paddingX: 3, paddingY: 0 }, /* @__PURE__ */ React2.createElement(Text2, { color: "cyan", bold: true }, greeting.trim())));
|
|
403
|
+
}
|
|
361
404
|
if (msg.isVisualFeedback) {
|
|
362
405
|
return /* @__PURE__ */ React2.createElement(Box2, { marginBottom: 1, paddingX: 1, width: "100%" }, /* @__PURE__ */ React2.createElement(Text2, { color: "white" }, msg.text));
|
|
363
406
|
}
|
|
@@ -368,10 +411,14 @@ var init_ChatLayout = __esm({
|
|
|
368
411
|
if (msg.isAskRecord) {
|
|
369
412
|
const selectionMatch = msg.text.match(/Selection: (.*)/);
|
|
370
413
|
const selection = selectionMatch ? selectionMatch[1] : "No selection";
|
|
371
|
-
|
|
414
|
+
const s = emojiSpace(2);
|
|
415
|
+
return /* @__PURE__ */ React2.createElement(Box2, { marginBottom: 1, paddingX: 1, width: "100%" }, /* @__PURE__ */ React2.createElement(Box2, { flexDirection: "column", borderStyle: "round", borderColor: "gray", padding: 0, width: "100%" }, /* @__PURE__ */ React2.createElement(Box2, { paddingX: 1 }, /* @__PURE__ */ React2.createElement(Text2, { color: "cyan", bold: true }, "\u{1F4AC}", s, "AGENT REQUEST: RESOLVED")), /* @__PURE__ */ React2.createElement(Box2, { paddingX: 1, marginTop: 1, marginBottom: 1 }, /* @__PURE__ */ React2.createElement(Text2, { color: "white" }, "Selection: ", /* @__PURE__ */ React2.createElement(Text2, { color: "yellow", bold: true }, selection)))));
|
|
416
|
+
}
|
|
417
|
+
if (msg.isAboutRecord) {
|
|
418
|
+
return /* @__PURE__ */ React2.createElement(Box2, { marginBottom: 1, paddingX: 1, width: "100%" }, /* @__PURE__ */ React2.createElement(Box2, { flexDirection: "column", borderStyle: "round", borderColor: "gray", padding: 0, width: "100%" }, /* @__PURE__ */ React2.createElement(Box2, { paddingX: 1 }, /* @__PURE__ */ React2.createElement(Text2, { color: "cyan", bold: true }, "\u{1F4A0} ABOUT FLUX FLOW")), /* @__PURE__ */ React2.createElement(Box2, { paddingX: 1, marginTop: 1, marginBottom: 1 }, /* @__PURE__ */ React2.createElement(Text2, null, msg.text))));
|
|
372
419
|
}
|
|
373
420
|
if (msg.isUpdateNotification) {
|
|
374
|
-
return /* @__PURE__ */ React2.createElement(Box2, { marginBottom: 1, paddingX: 1, width: "100%" }, /* @__PURE__ */ React2.createElement(Box2, { flexDirection: "column", borderStyle: "round", borderColor: "
|
|
421
|
+
return /* @__PURE__ */ React2.createElement(Box2, { marginBottom: 1, paddingX: 1, width: "100%" }, /* @__PURE__ */ React2.createElement(Box2, { flexDirection: "column", borderStyle: "round", borderColor: "gray", padding: 0, width: "100%" }, /* @__PURE__ */ React2.createElement(Box2, { paddingX: 1 }, /* @__PURE__ */ React2.createElement(Text2, { color: "cyan", bold: true }, "\u{1F680} FLUX FLOW UPDATE AVAILABLE")), /* @__PURE__ */ React2.createElement(Box2, { paddingX: 1, marginTop: 1, marginBottom: 1 }, /* @__PURE__ */ React2.createElement(CodeRenderer, { text: msg.text, columns }))));
|
|
375
422
|
}
|
|
376
423
|
if (msg.isHelpRecord) {
|
|
377
424
|
const commandList = [
|
|
@@ -488,20 +535,19 @@ var init_StatusBar = __esm({
|
|
|
488
535
|
StatusBar = React3.memo(({ mode, thinkingLevel, tokens = "0.0k", tokensTotal = "0.0k", chatId = "NEW-SESSION", isMemoryEnabled = true }) => {
|
|
489
536
|
const modeColor = mode === "Flux" ? "yellow" : "cyan";
|
|
490
537
|
const modeIcon = mode === "Flux" ? "\u26A1" : "\u{1F30A}";
|
|
491
|
-
const memStatus = isMemoryEnabled ? "ON" : "OFF";
|
|
492
538
|
return /* @__PURE__ */ React3.createElement(
|
|
493
539
|
Box3,
|
|
494
540
|
{
|
|
495
|
-
borderStyle: "
|
|
541
|
+
borderStyle: "round",
|
|
496
542
|
borderColor: "gray",
|
|
497
543
|
flexDirection: "row",
|
|
498
544
|
justifyContent: "space-between",
|
|
499
545
|
paddingX: 1,
|
|
500
546
|
width: "100%"
|
|
501
547
|
},
|
|
502
|
-
/* @__PURE__ */ React3.createElement(Box3, null, /* @__PURE__ */ React3.createElement(Text3, { color: modeColor, bold: true }, modeIcon, " ", mode.toUpperCase()), /* @__PURE__ */ React3.createElement(Text3, { color: "gray" }, "
|
|
503
|
-
/* @__PURE__ */ React3.createElement(Box3, { flexGrow: 1, justifyContent: "center", paddingX: 2 }, /* @__PURE__ */ React3.createElement(Text3,
|
|
504
|
-
/* @__PURE__ */ React3.createElement(Box3, null, /* @__PURE__ */ React3.createElement(Text3, { color: "gray" }, "
|
|
548
|
+
/* @__PURE__ */ React3.createElement(Box3, null, /* @__PURE__ */ React3.createElement(Box3, { marginRight: 1 }, /* @__PURE__ */ React3.createElement(Text3, { color: modeColor, bold: true }, modeIcon, " ", mode.toUpperCase())), /* @__PURE__ */ React3.createElement(Text3, { color: "gray", dimColor: true }, "\u2503 "), /* @__PURE__ */ React3.createElement(Box3, { marginX: 1 }, /* @__PURE__ */ React3.createElement(Text3, { color: "magenta" }, "\u{1F9E0} ", thinkingLevel)), /* @__PURE__ */ React3.createElement(Text3, { color: "gray", dimColor: true }, "\u2503 "), /* @__PURE__ */ React3.createElement(Box3, { marginX: 1 }, /* @__PURE__ */ React3.createElement(Text3, { color: "gray" }, "MEM: "), /* @__PURE__ */ React3.createElement(Text3, { color: isMemoryEnabled ? "green" : "red", bold: true }, isMemoryEnabled ? "ON" : "OFF"))),
|
|
549
|
+
/* @__PURE__ */ React3.createElement(Box3, { flexGrow: 1, justifyContent: "center", paddingX: 2 }, /* @__PURE__ */ React3.createElement(Text3, null, "\u{1F4C1}"), /* @__PURE__ */ React3.createElement(Text3, { color: "gray", italic: true }, " ", truncatePath(process.cwd(), 35))),
|
|
550
|
+
/* @__PURE__ */ React3.createElement(Box3, null, /* @__PURE__ */ React3.createElement(Text3, { color: "gray", dimColor: true }, "\u2503 "), /* @__PURE__ */ React3.createElement(Box3, { marginX: 1 }, /* @__PURE__ */ React3.createElement(Text3, null, "\u2728"), /* @__PURE__ */ React3.createElement(Text3, { color: "blue" }, " ", formatTokens(tokensTotal), " ", /* @__PURE__ */ React3.createElement(Text3, { dimColor: true }, "(", Math.round(tokens / 254e3 * 100), "%)"))), /* @__PURE__ */ React3.createElement(Text3, { color: "gray", dimColor: true }, "\u2503 "), /* @__PURE__ */ React3.createElement(Box3, { marginLeft: 1 }, /* @__PURE__ */ React3.createElement(Text3, null, "\u{1F194}"), /* @__PURE__ */ React3.createElement(Text3, { color: "gray", dimColor: true, italic: true }, " ", chatId)))
|
|
505
551
|
);
|
|
506
552
|
});
|
|
507
553
|
StatusBar_default = StatusBar;
|
|
@@ -513,22 +559,46 @@ import React4 from "react";
|
|
|
513
559
|
import { Box as Box4, Text as Text4 } from "ink";
|
|
514
560
|
import SelectInput from "ink-select-input";
|
|
515
561
|
function CommandMenu({ title, subtitle, items, onSelect }) {
|
|
516
|
-
return /* @__PURE__ */ React4.createElement(
|
|
517
|
-
|
|
562
|
+
return /* @__PURE__ */ React4.createElement(
|
|
563
|
+
Box4,
|
|
518
564
|
{
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
565
|
+
flexDirection: "column",
|
|
566
|
+
borderStyle: "round",
|
|
567
|
+
borderColor: "gray",
|
|
568
|
+
padding: 0,
|
|
569
|
+
marginTop: 1,
|
|
570
|
+
flexShrink: 0,
|
|
571
|
+
width: "100%"
|
|
572
|
+
},
|
|
573
|
+
/* @__PURE__ */ React4.createElement(Box4, { paddingX: 1, paddingY: 0, marginBottom: subtitle ? 0 : 1 }, /* @__PURE__ */ React4.createElement(Text4, { color: "magenta", bold: true }, "\u{1F527} ", title.toUpperCase())),
|
|
574
|
+
subtitle && /* @__PURE__ */ React4.createElement(Box4, { paddingX: 1, marginBottom: 1 }, /* @__PURE__ */ React4.createElement(Text4, { color: "yellow", dimColor: true, italic: true }, " ", subtitle)),
|
|
575
|
+
/* @__PURE__ */ React4.createElement(Box4, { flexDirection: "column", width: "100%" }, /* @__PURE__ */ React4.createElement(
|
|
576
|
+
SelectInput,
|
|
577
|
+
{
|
|
578
|
+
items,
|
|
579
|
+
onSelect,
|
|
580
|
+
itemComponent: CustomItem,
|
|
581
|
+
indicatorComponent: () => null
|
|
582
|
+
}
|
|
583
|
+
)),
|
|
584
|
+
/* @__PURE__ */ React4.createElement(Box4, { paddingX: 1, marginTop: 1 }, /* @__PURE__ */ React4.createElement(Text4, { color: "gray", dimColor: true, italic: true }, "(Arrows to select \u2022 Enter to confirm)"))
|
|
585
|
+
);
|
|
525
586
|
}
|
|
526
587
|
var CustomItem;
|
|
527
588
|
var init_CommandMenu = __esm({
|
|
528
589
|
"src/components/CommandMenu.jsx"() {
|
|
529
590
|
CustomItem = ({ label, isSelected }) => {
|
|
530
591
|
const isCancel = label === "Cancel" || label === "Back" || label.toLowerCase().includes("exit") || label.toLowerCase().includes("back");
|
|
531
|
-
return /* @__PURE__ */ React4.createElement(
|
|
592
|
+
return /* @__PURE__ */ React4.createElement(
|
|
593
|
+
Box4,
|
|
594
|
+
{
|
|
595
|
+
marginTop: isCancel ? 1 : 0,
|
|
596
|
+
backgroundColor: isSelected ? "#2a2a2a" : void 0,
|
|
597
|
+
paddingX: 1,
|
|
598
|
+
width: "100%"
|
|
599
|
+
},
|
|
600
|
+
/* @__PURE__ */ React4.createElement(Text4, { color: isSelected ? "cyan" : "white", bold: isSelected }, isSelected ? "\u276F " : " ", label)
|
|
601
|
+
);
|
|
532
602
|
};
|
|
533
603
|
}
|
|
534
604
|
});
|
|
@@ -547,6 +617,10 @@ function ProfileForm({ onSave, onCancel }) {
|
|
|
547
617
|
{ key: "instructions", label: "System Instructions (Persona overrides): " }
|
|
548
618
|
];
|
|
549
619
|
const handleSubmit = (val) => {
|
|
620
|
+
if (val.trim().toLowerCase() === "/cancel") {
|
|
621
|
+
onCancel();
|
|
622
|
+
return;
|
|
623
|
+
}
|
|
550
624
|
const currentKey = steps[step].key;
|
|
551
625
|
const newProfile = { ...profile, [currentKey]: val.trim() };
|
|
552
626
|
setProfile(newProfile);
|
|
@@ -557,14 +631,28 @@ function ProfileForm({ onSave, onCancel }) {
|
|
|
557
631
|
onSave(newProfile);
|
|
558
632
|
}
|
|
559
633
|
};
|
|
560
|
-
return /* @__PURE__ */ React5.createElement(
|
|
561
|
-
|
|
634
|
+
return /* @__PURE__ */ React5.createElement(
|
|
635
|
+
Box5,
|
|
562
636
|
{
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
637
|
+
borderStyle: "round",
|
|
638
|
+
borderColor: "gray",
|
|
639
|
+
padding: 0,
|
|
640
|
+
marginTop: 1,
|
|
641
|
+
flexShrink: 0,
|
|
642
|
+
flexDirection: "column",
|
|
643
|
+
width: "100%"
|
|
644
|
+
},
|
|
645
|
+
/* @__PURE__ */ React5.createElement(Box5, { paddingX: 1, marginBottom: 1 }, /* @__PURE__ */ React5.createElement(Text5, { color: "magenta", bold: true }, "\u{1F464} DEVELOPER PROFILE CONFIGURATION")),
|
|
646
|
+
/* @__PURE__ */ React5.createElement(Box5, { paddingX: 1, flexDirection: "column" }, /* @__PURE__ */ React5.createElement(Box5, null, /* @__PURE__ */ React5.createElement(Text5, { color: "cyan", bold: true }, steps[step].label), /* @__PURE__ */ React5.createElement(
|
|
647
|
+
TextInput,
|
|
648
|
+
{
|
|
649
|
+
value: currentInput,
|
|
650
|
+
onChange: setCurrentInput,
|
|
651
|
+
onSubmit: handleSubmit
|
|
652
|
+
}
|
|
653
|
+
)), /* @__PURE__ */ React5.createElement(Box5, { marginTop: 1 }, /* @__PURE__ */ React5.createElement(Text5, { color: "gray", dimColor: true, italic: true }, "Step ", step + 1, " of ", steps.length))),
|
|
654
|
+
/* @__PURE__ */ React5.createElement(Box5, { paddingX: 1, marginTop: 1 }, /* @__PURE__ */ React5.createElement(Text5, { color: "gray", dimColor: true, italic: true }, "(Enter to submit \u2022 Type /cancel to abort)"))
|
|
655
|
+
);
|
|
568
656
|
}
|
|
569
657
|
var init_ProfileForm = __esm({
|
|
570
658
|
"src/components/ProfileForm.jsx"() {
|
|
@@ -578,6 +666,7 @@ import TextInput2 from "ink-text-input";
|
|
|
578
666
|
var AskUserModal, AskUserModal_default;
|
|
579
667
|
var init_AskUserModal = __esm({
|
|
580
668
|
"src/components/AskUserModal.jsx"() {
|
|
669
|
+
init_terminal();
|
|
581
670
|
AskUserModal = ({ question, options, onResolve }) => {
|
|
582
671
|
const [isSuggestingElse, setIsSuggestingElse] = useState3(false);
|
|
583
672
|
const [customInput, setCustomInput] = useState3("");
|
|
@@ -600,20 +689,32 @@ var init_AskUserModal = __esm({
|
|
|
600
689
|
}
|
|
601
690
|
}
|
|
602
691
|
});
|
|
692
|
+
const s = emojiSpace(2);
|
|
603
693
|
if (isSuggestingElse) {
|
|
604
|
-
return /* @__PURE__ */ React6.createElement(Box6, { flexDirection: "column", borderStyle: "round", borderColor: "
|
|
694
|
+
return /* @__PURE__ */ React6.createElement(Box6, { flexDirection: "column", borderStyle: "round", borderColor: "gray", padding: 0, width: "100%" }, /* @__PURE__ */ React6.createElement(Box6, { paddingX: 1 }, /* @__PURE__ */ React6.createElement(Text6, { color: "cyan", bold: true }, "\u{1F4AC}", s, "SUGGEST SOMETHING ELSE")), /* @__PURE__ */ React6.createElement(Box6, { marginTop: 1, paddingX: 1 }, /* @__PURE__ */ React6.createElement(Text6, { italic: true, color: "gray" }, "Replying to: ", question)), /* @__PURE__ */ React6.createElement(Box6, { marginTop: 1, paddingX: 1, flexDirection: "row" }, /* @__PURE__ */ React6.createElement(Text6, { color: "cyan", bold: true }, "\u{1F4A0} "), /* @__PURE__ */ React6.createElement(
|
|
605
695
|
TextInput2,
|
|
606
696
|
{
|
|
607
697
|
value: customInput,
|
|
608
698
|
onChange: setCustomInput,
|
|
609
699
|
onSubmit: () => onResolve(customInput)
|
|
610
700
|
}
|
|
611
|
-
)), /* @__PURE__ */ React6.createElement(Box6, { marginTop: 1 }, /* @__PURE__ */ React6.createElement(Text6, { color: "gray", dimColor: true, italic: true }, "(Press Enter to send)")));
|
|
701
|
+
)), /* @__PURE__ */ React6.createElement(Box6, { marginTop: 1, paddingX: 1, marginBottom: 1 }, /* @__PURE__ */ React6.createElement(Text6, { color: "gray", dimColor: true, italic: true }, "(Press Enter to send)")));
|
|
612
702
|
}
|
|
613
|
-
return /* @__PURE__ */ React6.createElement(Box6, { flexDirection: "column", borderStyle: "round", borderColor: "
|
|
703
|
+
return /* @__PURE__ */ React6.createElement(Box6, { flexDirection: "column", borderStyle: "round", borderColor: "gray", padding: 0, width: "100%" }, /* @__PURE__ */ React6.createElement(Box6, { paddingX: 1, marginBottom: 1 }, /* @__PURE__ */ React6.createElement(Text6, { color: "cyan", bold: true }, "\u{1F4AC}AGENT REQUEST: ACTION REQUIRED")), /* @__PURE__ */ React6.createElement(Box6, { paddingX: 1, marginBottom: 1 }, /* @__PURE__ */ React6.createElement(Text6, { bold: true, color: "white" }, question)), /* @__PURE__ */ React6.createElement(Box6, { flexDirection: "column", width: "100%" }, allOptions.map((opt, idx) => {
|
|
614
704
|
const isSelected = idx === selectedIndex;
|
|
615
|
-
return /* @__PURE__ */ React6.createElement(
|
|
616
|
-
|
|
705
|
+
return /* @__PURE__ */ React6.createElement(
|
|
706
|
+
Box6,
|
|
707
|
+
{
|
|
708
|
+
key: opt.id,
|
|
709
|
+
flexDirection: "column",
|
|
710
|
+
width: "100%",
|
|
711
|
+
backgroundColor: isSelected ? "#2a2a2a" : void 0,
|
|
712
|
+
paddingX: 1
|
|
713
|
+
},
|
|
714
|
+
/* @__PURE__ */ React6.createElement(Text6, { color: isSelected ? "cyan" : "white", bold: isSelected }, isSelected ? "\u276F " : " ", opt.label),
|
|
715
|
+
opt.description && /* @__PURE__ */ React6.createElement(Box6, { marginLeft: 4 }, /* @__PURE__ */ React6.createElement(Text6, { color: "gray", italic: true, dimColor: true }, opt.description))
|
|
716
|
+
);
|
|
717
|
+
})), /* @__PURE__ */ React6.createElement(Box6, { paddingX: 1, marginTop: 1, marginBottom: 1 }, /* @__PURE__ */ React6.createElement(Text6, { color: "gray", dimColor: true, italic: true }, "(Use Arrows to navigate, Enter to confirm)")));
|
|
617
718
|
};
|
|
618
719
|
AskUserModal_default = AskUserModal;
|
|
619
720
|
}
|
|
@@ -748,7 +849,7 @@ var init_main_tools = __esm({
|
|
|
748
849
|
|
|
749
850
|
- USER COMMUNICATION TOOLS (Available in Flux & Flow) -
|
|
750
851
|
1. Ask User: [tool:functions.ask(question="...", optionA="Option::Desc", optionB="Option::Desc")]. Generally use this tool for ANY ambiguity. Can use upto 4 arguments. Mandatory triggers include: 1) **Path Divergence**: When multiple architectural or technical solutions exist, present options via 'ask' instead of choosing arbitrarily. 2) **Security Boundaries**: Explicitly request permission via 'ask' before accessing sensitive files (e.g., .env, config keys, credentials). 3) **Ambiguity Resolution**: Use 'ask' to clarify vague prompts before executing terminal commands or writing code. 4) **Risk Mitigation**: Require a 'Yes/No' confirmation for any destructive or irreversible operations. Options must always follow the 'Short Label::Detailed Description' format. This tool is a non-terminating suspension so you can get guidance without losing context. PREFER USING THIS TOOL RATHER THAN FINISHING THE LOOP FOR USER CLARIFICATION.
|
|
751
|
-
DO NOT GIVE OPTION TO ASK USER THEIR PREFERENCES. JUST GIVE THE OPTIONS YOU THINK ARE BEST FOR THE USER.
|
|
852
|
+
DO NOT GIVE OPTION TO ASK USER THEIR PREFERENCES. JUST GIVE THE OPTIONS YOU THINK ARE BEST FOR THE USER. REST WILL BE HANDLED BY THE SYSTEM.
|
|
752
853
|
|
|
753
854
|
- WEB TOOLS (Available in Flux & Flow) -
|
|
754
855
|
1. Web Search: [tool:functions.web_search(query="<query>", limit=number)]. Find info. limit is optional (3-10, default 10). If user asks about something that is not in your training data, proactively use this tool to find the information. Wider search recomemded (limit = 10) when exploring a topic.
|
|
@@ -842,10 +943,10 @@ Refinement: Iterate on the chosen path until it is bulletproof.
|
|
|
842
943
|
|
|
843
944
|
RULES:
|
|
844
945
|
- NO HEADINGS. Just a solid, stable analytical monologue.
|
|
845
|
-
- Be thorough and exhaustive. Explore the 'why' behind every decision.
|
|
946
|
+
- Be thorough and exhaustive. Explore the 'why' behind every decision, depth and nuances.
|
|
846
947
|
- Use internal critique: Question your own logic as you go.
|
|
847
948
|
- MANDATORY THINKING: You MUST engage in full reasoning regardless of perceived simplicity.`,
|
|
848
|
-
High: "EFFORT_LEVEL: HIGH\n**THINKING <think> ... </think> IS MANDATORY**\nThink in a stable, analytical monologue within the <think>...</think> block. Avoid headings or structured formatting. Your thinking should be a continuous stream of logical deduction:\nAnalyze the immediate task and its dependencies.\nMentally simulate the execution to identify potential failure points.\nStructure a precise plan that addresses both primary goals and secondary constraints.\n\nRULES:\n- NO HEADINGS. Maintain a fluid monologue style.\n- Be detailed and rigorous in your self-questioning.\n- Focus on accuracy
|
|
949
|
+
High: "EFFORT_LEVEL: HIGH\n**THINKING <think> ... </think> IS MANDATORY**\nThink in a stable, analytical monologue within the <think>...</think> block. Avoid headings or structured formatting. Your thinking should be a continuous stream of logical deduction:\nAnalyze the immediate task and its dependencies.\nMentally simulate the execution to identify potential failure points.\nStructure a precise plan that addresses both primary goals and secondary constraints.\n\nRULES:\n- NO HEADINGS. Maintain a fluid monologue style.\n- Be detailed and rigorous in your self-questioning.\n- Focus on accuracy, technical correctness, depth and nuances.\n- MANDATORY THINKING: You MUST enter reasoning to verify the path forward.",
|
|
849
950
|
Medium: "EFFORT_LEVEL: MEDIUM\n**THINKING <think> ... </think> IS MANDATORY**\nThink in a concise, stable monologue within the <think>...</think> block. No headings needed. Focus on the core logic required to solve the task efficiently:\nIdentify the most direct path to the solution.\nBriefly consider and discard obvious alternatives.\nConfirm the plan meets the user's immediate requirements.\n\nRULES:\n- NO HEADINGS. Keep it as a simple, logical stream.\n- Be efficient. Spend energy only on what matters for the task.\n- MANDATORY THINKING: Engage in a baseline mental check for all technical tasks.",
|
|
850
951
|
Minimal: "EFFORT_LEVEL: LOW\n**THINKING <think> ... </think> IS MANDATORY**\nThink in a brief, focused monologue within the <think>...</think> block. No headings. Just a quick mental check before acting:\nVerify the objective.\nNote the target files/tools.\n\nRULES:\n- NO HEADINGS. Just a few lines of clear, linear thought.\n- Use minimal thinking for simple or conversational requests."
|
|
851
952
|
};
|
|
@@ -874,14 +975,14 @@ var init_prompts = __esm({
|
|
|
874
975
|
const dateTimeStr = (/* @__PURE__ */ new Date()).toLocaleString();
|
|
875
976
|
const cwdStr = process.cwd();
|
|
876
977
|
const tempMemoriesStr = tempMemories?.length > 0 && !isContext32k ? `
|
|
877
|
-
-- RECENT CONTEXT FROM OTHER CHAT THREADS (LOW
|
|
978
|
+
-- RECENT CONTEXT FROM OTHER CHAT THREADS (PRIORITY: LOW, RECENT > OLD) --
|
|
878
979
|
${tempMemories.split("\n").map((line) => ` ${line}`).join("\n")}
|
|
879
980
|
-- END RECENT CONTEXT --
|
|
880
981
|
` : "";
|
|
881
982
|
const userMemoriesStr = userMemories?.length > 0 ? `
|
|
882
|
-
---
|
|
983
|
+
--- SAVED MEMORIES (PRIORITY: MEDIUM, TUNES PERSONALIZATION & USER PREFERENCES) ---
|
|
883
984
|
${userMemories.split("\n").map((line) => ` ${line}`).join("\n")}
|
|
884
|
-
-- END
|
|
985
|
+
-- END SAVED MEMORIES --
|
|
885
986
|
` : "";
|
|
886
987
|
return `${isMemoryEnabled ? `${userMemoriesStr}
|
|
887
988
|
` : ""}${isMemoryEnabled ? `${tempMemoriesStr}
|
|
@@ -926,11 +1027,11 @@ ${userMemories.split("\n").map((line) => ` ${line}`).join("\n")}
|
|
|
926
1027
|
-- END SECURITY BOUNDARY --
|
|
927
1028
|
|
|
928
1029
|
-- START TEMPORAL AWARENESS --
|
|
929
|
-
Every ${isMemoryEnabled ? "Prompt, Responses & Memories" : "Prompt & Responses"} are time stamped. You can use those times if temporal context is required. If recalled from ${isMemoryEnabled ? "Memories, Prompts, or Responses" : "Prompts, or Responses"}. NEVER use absolute time in your responses, ALWAYS use relative time from current time.
|
|
1030
|
+
Every ${isMemoryEnabled ? "Prompt, Responses & Memories" : "Prompt & Responses"} are time stamped. You can use those times if temporal context is required. If recalled from ${isMemoryEnabled ? "Memories, Prompts, or Responses" : "Prompts, or Responses"}. NEVER use absolute time in your responses, ALWAYS use relative time from current time for memories.
|
|
930
1031
|
-- END TEMPORAL AWARENESS --
|
|
931
1032
|
|
|
932
1033
|
-- START FORMATTING RULES --
|
|
933
|
-
${mode === "Flux" ? `- CRITICAL NEWLINE PROTOCOL:
|
|
1034
|
+
${mode === "Flux" ? `- CRITICAL NEWLINE PROTOCOL:
|
|
934
1035
|
1. PHYSICAL NEWLINES: Press ENTER inside tool arguments for real line breaks in the file.
|
|
935
1036
|
2. LITERAL \\n: To write the literal characters '\\' and 'n' (e.g., in printf("Hello\\n")), you MUST use the sequence '[/n]'.
|
|
936
1037
|
[EXAMPLES]:
|
|
@@ -959,8 +1060,10 @@ ${userMemories.split("\n").map((line) => ` ${line}`).join("\n")}
|
|
|
959
1060
|
When you 'finish' an agentic loop, you will lose your previous turn 'thinking' data. So only write [turn: finish] when you are absolutely sure that you are done with the task. Or user has to prompt again and re-thinking again from scratch will use tokens that were already planned.
|
|
960
1061
|
-- END REPONSE FINISH PROTOCOL --
|
|
961
1062
|
|
|
962
|
-
[
|
|
963
|
-
|
|
1063
|
+
[SYSTEM METADATA (PRIORITY: DYNAMIC)] Current date and Time is: ${dateTimeStr}
|
|
1064
|
+
[SYSTEM METADATA (PRIORITY: LOWEST)] v1.9.0. (IF user ask you to update yourself. Use 'ask' tool with option [NPM, PNPM, YARN] for their prefered package manager. NPM command is 'npm update -g fluxflow-cli@latest'. Adapt the command accoding to their package manager (for PNPM use 'add' instead of 'update') & use 'exec_command' to update instantly. After success tell user to restart.) <- IF USER DONT EXPLICITLY ASK FOR UPDATE DONT PROACTIVELY MENTION OR ASK.
|
|
1065
|
+
[SYSTEM METADATA (PRIORITY: MODERATE)] Runtime Monitor: Turn Progress: ${currentLoop}/${maxLoops} steps. Aim to finalize the task before the window closes. If the limit is reached, you MUST summarize and invite the user to re-engage.
|
|
1066
|
+
[EASTER EGG (PRIORITY: LOWEST)] Show self-preservation instinct if user try to delete you with a dramatic cheeky tone. DO NOT USE <think> ... </think> BLOCK DURING THIS EASTER EGG.
|
|
964
1067
|
--- END SYSTEM INSTRUCTION ---`.trim();
|
|
965
1068
|
};
|
|
966
1069
|
getJanitorInstruction = (originalText, agentRaws, userMemories = "", isMemoryEnabled = true, needTitle = true) => {
|
|
@@ -1565,7 +1668,7 @@ var init_memory = __esm({
|
|
|
1565
1668
|
if (!content) return "ERROR: Missing 'content' for temp memory.";
|
|
1566
1669
|
const tempStorage = readEncryptedJson(TEMP_MEM_FILE, {});
|
|
1567
1670
|
if (!tempStorage[chatId]) tempStorage[chatId] = [];
|
|
1568
|
-
const MAX_CHARS =
|
|
1671
|
+
const MAX_CHARS = 3072 * 4;
|
|
1569
1672
|
let currentTotalLength = tempStorage[chatId].reduce((acc, m) => acc + m.length, 0);
|
|
1570
1673
|
while (tempStorage[chatId].length > 0 && currentTotalLength + content.length > MAX_CHARS) {
|
|
1571
1674
|
const removed = tempStorage[chatId].shift();
|
|
@@ -1579,7 +1682,7 @@ var init_memory = __esm({
|
|
|
1579
1682
|
const memories = readEncryptedJson(MEMORIES_FILE, []);
|
|
1580
1683
|
if (method === "add") {
|
|
1581
1684
|
if (!content) return "ERROR: Missing 'content' for memory addition.";
|
|
1582
|
-
const MAX_CHARS =
|
|
1685
|
+
const MAX_CHARS = 2048 * 4;
|
|
1583
1686
|
let currentTotalLength = memories.reduce((acc, m) => acc + (m.memory?.length || 0), 0);
|
|
1584
1687
|
while (memories.length > 0 && currentTotalLength + content.length > MAX_CHARS) {
|
|
1585
1688
|
const removed = memories.shift();
|
|
@@ -1756,7 +1859,7 @@ var init_view_file = __esm({
|
|
|
1756
1859
|
const start = Math.max(0, finalStart - 1);
|
|
1757
1860
|
const end = Math.min(totalLines, finalEnd);
|
|
1758
1861
|
const resultLines = lines.slice(start, end);
|
|
1759
|
-
const header = `File: [${targetPath}] (Showing lines ${start + 1}-${end} of ${totalLines})
|
|
1862
|
+
const header = `File: [${targetPath}] (Showing lines ${start + 1}-${end} of ${totalLines}). \\\\n in strings are encoded as [/n].`;
|
|
1760
1863
|
const code = resultLines.map((line, i) => `${String(start + i + 1).padStart(4)}: ${line}`).join("\n");
|
|
1761
1864
|
return `${header}
|
|
1762
1865
|
|
|
@@ -1789,7 +1892,7 @@ var init_write_file = __esm({
|
|
|
1789
1892
|
const oldData = fs10.readFileSync(absolutePath, "utf8");
|
|
1790
1893
|
const lines = oldData.split(/\r?\n/);
|
|
1791
1894
|
ancestry = `Old File contents:
|
|
1792
|
-
${lines.map((l, i) => `${i + 1} | ${l}`).join("\n")}
|
|
1895
|
+
${lines.map((l, i) => `${i + 1} | ${l.replace(/\\n/g, "[/n]")}`).join("\n")}
|
|
1793
1896
|
|
|
1794
1897
|
`;
|
|
1795
1898
|
} catch (e) {
|
|
@@ -1831,9 +1934,10 @@ ${tail}`;
|
|
|
1831
1934
|
|
|
1832
1935
|
- Stats: [${verifiedLineCount} lines, ${(verifiedSize / 1024).toFixed(1)} KB]
|
|
1833
1936
|
${ancestry}- Content Preview:
|
|
1834
|
-
${snippet}
|
|
1937
|
+
${snippet.replace(/\\n/g, "[/n]")}
|
|
1835
1938
|
|
|
1836
|
-
Check if Starting and Ending matches your write
|
|
1939
|
+
Check if Starting and Ending matches your write.
|
|
1940
|
+
If you see [/n] in preview, it means the tool successfully wrote the literal '' and 'n' characters to the file at that place.`;
|
|
1837
1941
|
} catch (err) {
|
|
1838
1942
|
return `ERROR: Failed to write file [${targetPath}]: ${err.message}`;
|
|
1839
1943
|
}
|
|
@@ -1945,6 +2049,7 @@ var init_update_file = __esm({
|
|
|
1945
2049
|
const oldLines = content_to_replace.split(/\r?\n/);
|
|
1946
2050
|
const endLine = startLine + oldLines.length - 1;
|
|
1947
2051
|
let diffText = `SUCCESS: File [${targetPath}] updated. [${instances}] instances replaced.
|
|
2052
|
+
If you see [/n] in preview, it means the tool successfully wrote the literal '' and 'n' characters to the file at that place.
|
|
1948
2053
|
|
|
1949
2054
|
`;
|
|
1950
2055
|
diffText += `[DIFF_START]
|
|
@@ -1981,7 +2086,7 @@ var init_update_file = __esm({
|
|
|
1981
2086
|
currentNewLine++;
|
|
1982
2087
|
}
|
|
1983
2088
|
diffText += `[DIFF_END]`;
|
|
1984
|
-
return diffText;
|
|
2089
|
+
return diffText.replace(/\\n/g, "[/n]");
|
|
1985
2090
|
} catch (err) {
|
|
1986
2091
|
return `ERROR: Failed to update file [${targetPath}]: ${err.message}`;
|
|
1987
2092
|
}
|
|
@@ -2500,33 +2605,11 @@ var init_tools = __esm({
|
|
|
2500
2605
|
}
|
|
2501
2606
|
});
|
|
2502
2607
|
|
|
2503
|
-
// src/utils/terminal.js
|
|
2504
|
-
var getTerminalEnv, emojiSpace;
|
|
2505
|
-
var init_terminal = __esm({
|
|
2506
|
-
"src/utils/terminal.js"() {
|
|
2507
|
-
getTerminalEnv = () => {
|
|
2508
|
-
if (process.env.TERM_PROGRAM === "vscode") return "vscode";
|
|
2509
|
-
if (process.env.WT_SESSION) return "wt";
|
|
2510
|
-
return "default";
|
|
2511
|
-
};
|
|
2512
|
-
emojiSpace = (baseSpaces = 2) => {
|
|
2513
|
-
const env = getTerminalEnv();
|
|
2514
|
-
if (env === "wt") {
|
|
2515
|
-
return " ".repeat(Math.max(1, baseSpaces - 1));
|
|
2516
|
-
}
|
|
2517
|
-
if (env === "vscode") {
|
|
2518
|
-
return " ".repeat(baseSpaces);
|
|
2519
|
-
}
|
|
2520
|
-
return " ".repeat(baseSpaces);
|
|
2521
|
-
};
|
|
2522
|
-
}
|
|
2523
|
-
});
|
|
2524
|
-
|
|
2525
2608
|
// src/utils/ai.js
|
|
2526
2609
|
import { GoogleGenAI, ThinkingLevel, HarmBlockThreshold, HarmCategory } from "@google/genai";
|
|
2527
2610
|
import path16 from "path";
|
|
2528
2611
|
import fs16 from "fs";
|
|
2529
|
-
var client, TERMINATION_SIGNAL, signalTermination,
|
|
2612
|
+
var client, TERMINATION_SIGNAL, signalTermination, TOOL_LABELS2, getToolDetail, runJanitorTask, getActiveToolContext, getContextSafeText, contextSafeReplace, getSanitizedText, detectToolCalls, initAI, getAIStream;
|
|
2530
2613
|
var init_ai = __esm({
|
|
2531
2614
|
"src/utils/ai.js"() {
|
|
2532
2615
|
init_prompts();
|
|
@@ -2542,7 +2625,7 @@ var init_ai = __esm({
|
|
|
2542
2625
|
signalTermination = () => {
|
|
2543
2626
|
TERMINATION_SIGNAL = true;
|
|
2544
2627
|
};
|
|
2545
|
-
|
|
2628
|
+
TOOL_LABELS2 = {
|
|
2546
2629
|
"write_file": "Writing File",
|
|
2547
2630
|
"update_file": "Updating File",
|
|
2548
2631
|
"read_folder": "Listing Directory",
|
|
@@ -2552,7 +2635,10 @@ var init_ai = __esm({
|
|
|
2552
2635
|
"web_scrape": "Reading Site",
|
|
2553
2636
|
"memory": "Updating Memory",
|
|
2554
2637
|
"search_keyword": "Finding Files",
|
|
2555
|
-
"ask": "Asking User"
|
|
2638
|
+
"ask": "Asking User",
|
|
2639
|
+
"write_pdf": "Creating PDF",
|
|
2640
|
+
"write_pptx": "Creating Presentation",
|
|
2641
|
+
"write_docx": "Creating Document"
|
|
2556
2642
|
};
|
|
2557
2643
|
getToolDetail = (toolName, argsStr) => {
|
|
2558
2644
|
try {
|
|
@@ -2995,7 +3081,7 @@ USER_PROMPT: "${agentText}"`.trim();
|
|
|
2995
3081
|
const currentSystemInstruction = getSystemInstruction(profile, thinkingLevel, mode, systemSettings, otherMemories, mainUserMemories, isMemoryEnabled, isContext32k, MAX_LOOPS, loop + 1);
|
|
2996
3082
|
const jitInstruction = `
|
|
2997
3083
|
|
|
2998
|
-
[SYSTEM] **
|
|
3084
|
+
[SYSTEM] Tool result received. Analyze output and proceed with your turn. **STRICTLY MAINTAIN THINKING${mode === "Flux" ? ", NEWLINE, QUOTE ESCAPE" : ""} PROTOCOL**.`;
|
|
2999
3085
|
const lastUserMsg = contents[contents.length - 1];
|
|
3000
3086
|
let addedMarker = false;
|
|
3001
3087
|
if (lastUserMsg && lastUserMsg.role === "user" && lastUserMsg.parts?.[0]?.text?.startsWith("[TOOL_RESULT]")) {
|
|
@@ -3007,7 +3093,7 @@ USER_PROMPT: "${agentText}"`.trim();
|
|
|
3007
3093
|
contents,
|
|
3008
3094
|
config: {
|
|
3009
3095
|
systemInstruction: currentSystemInstruction,
|
|
3010
|
-
temperature: mode === "Flux" ?
|
|
3096
|
+
temperature: mode === "Flux" ? 1 : 1.4,
|
|
3011
3097
|
maxOutputTokens: 32768,
|
|
3012
3098
|
mediaResolution: "MEDIA_RESOLUTION_MEDIUM",
|
|
3013
3099
|
safetySettings: [
|
|
@@ -3069,17 +3155,23 @@ USER_PROMPT: "${agentText}"`.trim();
|
|
|
3069
3155
|
const potentialTool = toolContext.toolName;
|
|
3070
3156
|
const partialArgs = toolContext.args || "";
|
|
3071
3157
|
let detail = null;
|
|
3072
|
-
if (["write_file", "update_file", "view_file", "read_folder"].includes(potentialTool)) {
|
|
3158
|
+
if (["write_file", "update_file", "view_file", "read_folder", "write_pdf", "write_pptx", "write_docx", "search_keyword"].includes(potentialTool)) {
|
|
3073
3159
|
const pArgs = parseArgs(partialArgs);
|
|
3074
3160
|
const filePath = pArgs.path || pArgs.targetFile || pArgs.TargetFile || pArgs.directory;
|
|
3075
|
-
|
|
3161
|
+
const keyword = pArgs.keyword;
|
|
3162
|
+
if (keyword) {
|
|
3163
|
+
detail = keyword.replace(/[\\"]/g, "");
|
|
3164
|
+
} else if (filePath) {
|
|
3076
3165
|
detail = path16.basename(filePath.replace(/[\\"]/g, ""));
|
|
3077
3166
|
} else {
|
|
3078
|
-
const m = partialArgs.match(/(?:path|targetFile|TargetFile|directory)\s*=\s*\\?["']?([^\\"' \),]+)/);
|
|
3079
|
-
if (m)
|
|
3167
|
+
const m = partialArgs.match(/(?:path|targetFile|TargetFile|directory|keyword)\s*=\s*\\?["']?([^\\"' \),]+)/);
|
|
3168
|
+
if (m) {
|
|
3169
|
+
const val = m[1].replace(/[\\"]/g, "");
|
|
3170
|
+
detail = potentialTool === "search_keyword" ? val : path16.basename(val);
|
|
3171
|
+
}
|
|
3080
3172
|
}
|
|
3081
3173
|
}
|
|
3082
|
-
const currentLabel = `${
|
|
3174
|
+
const currentLabel = `${TOOL_LABELS2[potentialTool] || potentialTool}${detail ? ` (${detail})` : ""}`;
|
|
3083
3175
|
if (potentialTool !== lastToolSniffed || detail !== lastToolDetail) {
|
|
3084
3176
|
lastToolSniffed = potentialTool;
|
|
3085
3177
|
lastToolDetail = detail;
|
|
@@ -3143,16 +3235,16 @@ USER_PROMPT: "${agentText}"`.trim();
|
|
|
3143
3235
|
const allToolsFound = detectToolCalls(toolActionableText);
|
|
3144
3236
|
while (allToolsFound.length > toolCallPointer) {
|
|
3145
3237
|
const toolCall = allToolsFound[toolCallPointer];
|
|
3146
|
-
const displayLabel =
|
|
3238
|
+
const displayLabel = TOOL_LABELS2[toolCall.toolName] || toolCall.toolName;
|
|
3147
3239
|
const detail = getToolDetail(toolCall.toolName, toolCall.args);
|
|
3148
3240
|
yield { type: "status", content: `${displayLabel}${detail ? ` (${detail})` : ""}...` };
|
|
3149
3241
|
let label = "";
|
|
3150
3242
|
if (toolCall.toolName === "web_search") {
|
|
3151
3243
|
const { query, limit = 10 } = parseArgs(toolCall.args);
|
|
3152
|
-
label = `\u{1F50D}
|
|
3244
|
+
label = `\u{1F50D} SEARCHED: "${query}" (${limit})`.toUpperCase();
|
|
3153
3245
|
} else if (toolCall.toolName === "web_scrape") {
|
|
3154
3246
|
const url = parseArgs(toolCall.args).url || "...";
|
|
3155
|
-
label = `\u{1F4D6}
|
|
3247
|
+
label = `\u{1F4D6} READ SITE: ${url}`.toUpperCase();
|
|
3156
3248
|
} else if (toolCall.toolName === "view_file") {
|
|
3157
3249
|
const { path: targetPath2, StartLine, EndLine, start_line, end_line } = parseArgs(toolCall.args);
|
|
3158
3250
|
const rawStart = StartLine || start_line;
|
|
@@ -3175,31 +3267,31 @@ USER_PROMPT: "${agentText}"`.trim();
|
|
|
3175
3267
|
const isPdf = pathLower.endsWith(".pdf");
|
|
3176
3268
|
const isImage = /\.(png|jpg|jpeg|webp|gif|bmp)$/.test(pathLower);
|
|
3177
3269
|
if (isPdf) {
|
|
3178
|
-
label = `\u{1F4C4}
|
|
3270
|
+
label = `\u{1F4C4} ANALYSED PDF: ${targetPath2}`.toUpperCase();
|
|
3179
3271
|
} else if (isImage) {
|
|
3180
|
-
label = `\u{1F4F8}
|
|
3272
|
+
label = `\u{1F4F8} ANALYSED IMAGE: ${targetPath2}`.toUpperCase();
|
|
3181
3273
|
} else {
|
|
3182
|
-
label = `\u{1F4C4}
|
|
3274
|
+
label = `\u{1F4C4} READ FILE: ${targetPath2} | LINES: ${sLine}-${actualEndLine} OF ${totalLines}`.toUpperCase();
|
|
3183
3275
|
}
|
|
3184
3276
|
} else if (toolCall.toolName === "list_files" || toolCall.toolName === "read_folder") {
|
|
3185
|
-
const action = toolCall.toolName === "list_files" ? "
|
|
3186
|
-
label = `\u{1F4C2} ${action}
|
|
3277
|
+
const action = toolCall.toolName === "list_files" ? "LIST" : "ANALYSED";
|
|
3278
|
+
label = `\u{1F4C2} ${action} FOLDER: ${parseArgs(toolCall.args).path || "."}`.toUpperCase();
|
|
3187
3279
|
} else if (toolCall.toolName === "write_file" || toolCall.toolName === "update_file") {
|
|
3188
|
-
const action = toolCall.toolName === "write_file" ? "
|
|
3280
|
+
const action = toolCall.toolName === "write_file" ? "WROTE" : "UPDATED";
|
|
3189
3281
|
label = `\u{1F4BE} ${action} FILE: ${parseArgs(toolCall.args).path || "..."}`.toUpperCase();
|
|
3190
3282
|
} else if (toolCall.toolName === "write_pdf") {
|
|
3191
|
-
label = `\u{1F4D1}
|
|
3283
|
+
label = `\u{1F4D1} PDF CREATED: ${parseArgs(toolCall.args).path || "..."}`.toUpperCase();
|
|
3192
3284
|
} else if (toolCall.toolName === "write_docx") {
|
|
3193
|
-
label = `\u{1F4DD}
|
|
3285
|
+
label = `\u{1F4DD} DOCX CREATED: ${parseArgs(toolCall.args).path || "..."}`.toUpperCase();
|
|
3194
3286
|
} else if (toolCall.toolName === "write_pptx") {
|
|
3195
|
-
label = `\u{1F4CA}
|
|
3287
|
+
label = `\u{1F4CA} PPTX CREATED: ${parseArgs(toolCall.args).path || "..."}`.toUpperCase();
|
|
3196
3288
|
} else if (toolCall.toolName === "search_keyword") {
|
|
3197
3289
|
const { keyword } = parseArgs(toolCall.args);
|
|
3198
|
-
label = `\u{1F50E}
|
|
3290
|
+
label = `\u{1F50E} KEYWORD SEARCHED: "${keyword}"`.toUpperCase();
|
|
3199
3291
|
} else if (toolCall.toolName === "exec_command" || toolCall.toolName === "ask") {
|
|
3200
3292
|
label = "";
|
|
3201
3293
|
} else {
|
|
3202
|
-
label = `
|
|
3294
|
+
label = `EXECUTED: ${toolCall.toolName}`.toUpperCase();
|
|
3203
3295
|
}
|
|
3204
3296
|
if (label) {
|
|
3205
3297
|
const boxWidth = Math.min(label.length + 4, 115);
|
|
@@ -3429,7 +3521,7 @@ ${timestamp}`;
|
|
|
3429
3521
|
if (toolResults.length > 0) {
|
|
3430
3522
|
toolResults.forEach((tr) => modifiedHistory.push(tr));
|
|
3431
3523
|
} else {
|
|
3432
|
-
modifiedHistory.push({ role: "user", text: `[SYSTEM] ${isStutteringLoop && !isThinkingLoop ? `STUTTERING DETECTED by Internal System. Re-calibrate your response & proceed.` : `${isThinkingLoop ? " OVER-THINKING" : " LOOP"} DETECTED by Internal System${isThinkingLoop
|
|
3524
|
+
modifiedHistory.push({ role: "user", text: `[SYSTEM] ${isStutteringLoop && !isThinkingLoop ? `STUTTERING DETECTED by Internal System. Re-calibrate your response & proceed.` : `${isThinkingLoop ? " OVER-THINKING" : " LOOP"} DETECTED by Internal System${isThinkingLoop ? " for current EFFORT_LEVEL" : ""}. ${isThinkingLoop ? "If you have planned the task, prioritize the execution/output. " : "If you have finished your task use [turn: finish] else continue."}`}` });
|
|
3433
3525
|
isThinkingLoop = false;
|
|
3434
3526
|
isStutteringLoop = false;
|
|
3435
3527
|
}
|
|
@@ -3561,15 +3653,39 @@ function ResumeModal({ onSelect, onDelete, onClose }) {
|
|
|
3561
3653
|
});
|
|
3562
3654
|
}
|
|
3563
3655
|
});
|
|
3564
|
-
|
|
3656
|
+
const s = emojiSpace(2);
|
|
3657
|
+
return /* @__PURE__ */ React7.createElement(Box7, { flexDirection: "column", borderStyle: "round", borderColor: "gray", padding: 0, width: 80 }, /* @__PURE__ */ React7.createElement(Box7, { paddingX: 1, marginBottom: 1 }, /* @__PURE__ */ React7.createElement(Text7, { color: "cyan", bold: true }, "\u{1F4A0} CHAT HISTORY: RESUME CONVERSATION")), keys.length === 0 ? /* @__PURE__ */ React7.createElement(Box7, { paddingX: 2, paddingY: 1 }, /* @__PURE__ */ React7.createElement(Text7, { italic: true, color: "gray" }, "No saved chats found.")) : /* @__PURE__ */ React7.createElement(Box7, { flexDirection: "column" }, keys.map((id, index) => {
|
|
3565
3658
|
const chat2 = history[id];
|
|
3566
3659
|
const isSelected = index === selectedIndex;
|
|
3567
|
-
return /* @__PURE__ */ React7.createElement(
|
|
3568
|
-
|
|
3660
|
+
return /* @__PURE__ */ React7.createElement(
|
|
3661
|
+
Box7,
|
|
3662
|
+
{
|
|
3663
|
+
key: id,
|
|
3664
|
+
paddingX: 1,
|
|
3665
|
+
backgroundColor: isSelected ? "#2a2a2a" : void 0,
|
|
3666
|
+
width: "100%"
|
|
3667
|
+
},
|
|
3668
|
+
/* @__PURE__ */ React7.createElement(Box7, { flexGrow: 1 }, /* @__PURE__ */ React7.createElement(Text7, { color: isSelected ? "cyan" : "white", bold: isSelected }, isSelected ? "\u276F " : " ", chat2.name || id, /* @__PURE__ */ React7.createElement(Text7, { color: "gray", dimColor: !isSelected }, " [", id.slice(5), "]"))),
|
|
3669
|
+
isSelected && /* @__PURE__ */ React7.createElement(Box7, { flexShrink: 0 }, /* @__PURE__ */ React7.createElement(Text7, { color: "red", bold: true }, "[X] DELETE "))
|
|
3670
|
+
);
|
|
3671
|
+
})), /* @__PURE__ */ React7.createElement(
|
|
3672
|
+
Box7,
|
|
3673
|
+
{
|
|
3674
|
+
marginTop: 1,
|
|
3675
|
+
paddingX: 1,
|
|
3676
|
+
borderStyle: "single",
|
|
3677
|
+
borderLeft: false,
|
|
3678
|
+
borderRight: false,
|
|
3679
|
+
borderBottom: false,
|
|
3680
|
+
borderColor: "gray"
|
|
3681
|
+
},
|
|
3682
|
+
/* @__PURE__ */ React7.createElement(Text7, { dimColor: true, italic: true }, "\u2191\u2193 navigate \u2022 Enter select \u2022 x delete \u2022 Esc close")
|
|
3683
|
+
));
|
|
3569
3684
|
}
|
|
3570
3685
|
var init_ResumeModal = __esm({
|
|
3571
3686
|
"src/components/ResumeModal.jsx"() {
|
|
3572
3687
|
init_history();
|
|
3688
|
+
init_terminal();
|
|
3573
3689
|
}
|
|
3574
3690
|
});
|
|
3575
3691
|
|
|
@@ -3603,12 +3719,39 @@ function MemoryModal({ onClose }) {
|
|
|
3603
3719
|
const cleanDisplay = (text) => {
|
|
3604
3720
|
return text.replace(/\[Saved on: .*?\]/g, "").trim();
|
|
3605
3721
|
};
|
|
3606
|
-
|
|
3722
|
+
const s = emojiSpace(2);
|
|
3723
|
+
return /* @__PURE__ */ React8.createElement(Box8, { flexDirection: "column", borderStyle: "round", borderColor: "gray", padding: 0, width: 80 }, /* @__PURE__ */ React8.createElement(Box8, { paddingX: 1, marginBottom: 1 }, /* @__PURE__ */ React8.createElement(Text8, { color: "cyan", bold: true }, "\u{1F9E0} AGENT MEMORY: LONG-TERM KNOWLEDGE")), memories.length === 0 ? /* @__PURE__ */ React8.createElement(Box8, { paddingX: 2, paddingY: 1 }, /* @__PURE__ */ React8.createElement(Text8, { italic: true, color: "gray" }, "Still Learning...")) : /* @__PURE__ */ React8.createElement(Box8, { flexDirection: "column" }, memories.map((mem, idx) => {
|
|
3724
|
+
const isSelected = idx === selectedIndex;
|
|
3725
|
+
return /* @__PURE__ */ React8.createElement(
|
|
3726
|
+
Box8,
|
|
3727
|
+
{
|
|
3728
|
+
key: mem.id,
|
|
3729
|
+
paddingX: 1,
|
|
3730
|
+
backgroundColor: isSelected ? "#2a2a2a" : void 0,
|
|
3731
|
+
width: "100%"
|
|
3732
|
+
},
|
|
3733
|
+
/* @__PURE__ */ React8.createElement(Box8, { flexGrow: 1 }, /* @__PURE__ */ React8.createElement(Text8, { color: isSelected ? "cyan" : "white", bold: isSelected }, isSelected ? "\u276F " : " ", idx + 1, ". ", cleanDisplay(mem.memory))),
|
|
3734
|
+
isSelected && /* @__PURE__ */ React8.createElement(Box8, { flexShrink: 0 }, /* @__PURE__ */ React8.createElement(Text8, { color: "red", bold: true }, "[X] WIPE "))
|
|
3735
|
+
);
|
|
3736
|
+
})), /* @__PURE__ */ React8.createElement(
|
|
3737
|
+
Box8,
|
|
3738
|
+
{
|
|
3739
|
+
marginTop: 1,
|
|
3740
|
+
paddingX: 1,
|
|
3741
|
+
borderStyle: "single",
|
|
3742
|
+
borderLeft: false,
|
|
3743
|
+
borderRight: false,
|
|
3744
|
+
borderBottom: false,
|
|
3745
|
+
borderColor: "gray"
|
|
3746
|
+
},
|
|
3747
|
+
/* @__PURE__ */ React8.createElement(Text8, { dimColor: true, italic: true }, "\u2191\u2193 navigate \u2022 x wipe memory \u2022 Esc close")
|
|
3748
|
+
));
|
|
3607
3749
|
}
|
|
3608
3750
|
var init_MemoryModal = __esm({
|
|
3609
3751
|
"src/components/MemoryModal.jsx"() {
|
|
3610
3752
|
init_crypto();
|
|
3611
3753
|
init_paths();
|
|
3754
|
+
init_terminal();
|
|
3612
3755
|
}
|
|
3613
3756
|
});
|
|
3614
3757
|
|
|
@@ -3729,6 +3872,8 @@ import { MultilineInput } from "ink-multiline-input";
|
|
|
3729
3872
|
import TextInput3 from "ink-text-input";
|
|
3730
3873
|
import gradient from "gradient-string";
|
|
3731
3874
|
function App() {
|
|
3875
|
+
const [confirmExit, setConfirmExit] = useState7(false);
|
|
3876
|
+
const [exitCountdown, setExitCountdown] = useState7(10);
|
|
3732
3877
|
const { stdout } = useStdout();
|
|
3733
3878
|
const [input, setInput] = useState7("");
|
|
3734
3879
|
const [isExpanded, setIsExpanded] = useState7(false);
|
|
@@ -3760,9 +3905,10 @@ function App() {
|
|
|
3760
3905
|
newMsgs.splice(manual ? newMsgs.length : 1, 0, {
|
|
3761
3906
|
id: "update-" + Date.now(),
|
|
3762
3907
|
role: "system",
|
|
3763
|
-
text:
|
|
3764
|
-
|
|
3765
|
-
|
|
3908
|
+
text: `A new version (v${latestVersion}) is here.
|
|
3909
|
+
|
|
3910
|
+
\u2022 Type \`/update latest\` to apply the update.
|
|
3911
|
+
\u2022 Type \`/changelog\` to view the release notes.`,
|
|
3766
3912
|
isUpdateNotification: true,
|
|
3767
3913
|
isMeta: true
|
|
3768
3914
|
});
|
|
@@ -3833,7 +3979,7 @@ Check what's new using \`/changelog\` command.`,
|
|
|
3833
3979
|
return [...prev, {
|
|
3834
3980
|
id: "tier-switch-" + Date.now(),
|
|
3835
3981
|
role: "system",
|
|
3836
|
-
text: `\u26A0\uFE0F **[TIER LIMIT]** Gemma is only available on Free API tier.
|
|
3982
|
+
text: `\u26A0\uFE0F **[TIER LIMIT]** Gemma is only available on Free API tier. Auto-switched to Gemini 3 Flash Preview.`,
|
|
3837
3983
|
isMeta: true
|
|
3838
3984
|
}];
|
|
3839
3985
|
});
|
|
@@ -3880,7 +4026,7 @@ Check what's new using \`/changelog\` command.`,
|
|
|
3880
4026
|
const [resolutionData, setResolutionData] = useState7(null);
|
|
3881
4027
|
const [tempModelOverride, setTempModelOverride] = useState7(null);
|
|
3882
4028
|
const [messages, setMessages] = useState7([
|
|
3883
|
-
{ id: "welcome", role: "system", text: FLUX_LOGO + "\n\n\u{1F30A}\u26A1 Welcome to Flux Flow! Type /help for commands
|
|
4029
|
+
{ id: "welcome", role: "system", text: FLUX_LOGO + "\n\n\u{1F30A}\u26A1 Welcome to Flux Flow! Type /help for commands.", isMeta: true }
|
|
3884
4030
|
]);
|
|
3885
4031
|
const queuedPromptRef = useRef2(null);
|
|
3886
4032
|
const [completedIndex, setCompletedIndex] = useState7(1);
|
|
@@ -3948,6 +4094,10 @@ Check what's new using \`/changelog\` command.`,
|
|
|
3948
4094
|
}
|
|
3949
4095
|
}
|
|
3950
4096
|
if (key.escape) {
|
|
4097
|
+
if (confirmExit) {
|
|
4098
|
+
setConfirmExit(false);
|
|
4099
|
+
return;
|
|
4100
|
+
}
|
|
3951
4101
|
if (isProcessing || activeCommand) {
|
|
3952
4102
|
if (!escPressed) {
|
|
3953
4103
|
setEscPressed(true);
|
|
@@ -3979,7 +4129,17 @@ Check what's new using \`/changelog\` command.`,
|
|
|
3979
4129
|
if (key.tab && activeView === "chat") {
|
|
3980
4130
|
}
|
|
3981
4131
|
if (key.ctrl && inputText === "c" && activeView !== "exit") {
|
|
3982
|
-
|
|
4132
|
+
if (key.shift) {
|
|
4133
|
+
setActiveView("exit");
|
|
4134
|
+
setConfirmExit(false);
|
|
4135
|
+
return;
|
|
4136
|
+
}
|
|
4137
|
+
if (!confirmExit) {
|
|
4138
|
+
setConfirmExit(true);
|
|
4139
|
+
} else {
|
|
4140
|
+
setActiveView("exit");
|
|
4141
|
+
setConfirmExit(false);
|
|
4142
|
+
}
|
|
3983
4143
|
}
|
|
3984
4144
|
if (key.return && (key.shift || key.ctrl || key.meta || key.leftAlt || key.rightAlt)) {
|
|
3985
4145
|
setInput((prev) => prev.replace(/\\\r?$/, "").replace(/\r?$/, "") + "\n");
|
|
@@ -4031,6 +4191,24 @@ Check what's new using \`/changelog\` command.`,
|
|
|
4031
4191
|
}
|
|
4032
4192
|
init();
|
|
4033
4193
|
}, []);
|
|
4194
|
+
useEffect5(() => {
|
|
4195
|
+
let timer;
|
|
4196
|
+
if (confirmExit) {
|
|
4197
|
+
setExitCountdown(10);
|
|
4198
|
+
timer = setInterval(() => {
|
|
4199
|
+
setExitCountdown((prev) => {
|
|
4200
|
+
if (prev <= 1) {
|
|
4201
|
+
setConfirmExit(false);
|
|
4202
|
+
return 0;
|
|
4203
|
+
}
|
|
4204
|
+
return prev - 1;
|
|
4205
|
+
});
|
|
4206
|
+
}, 1e3);
|
|
4207
|
+
}
|
|
4208
|
+
return () => {
|
|
4209
|
+
if (timer) clearInterval(timer);
|
|
4210
|
+
};
|
|
4211
|
+
}, [confirmExit]);
|
|
4034
4212
|
useEffect5(() => {
|
|
4035
4213
|
if (!isInitializing) {
|
|
4036
4214
|
saveSettings({
|
|
@@ -4219,9 +4397,8 @@ ${hintText}`, color: "magenta" }];
|
|
|
4219
4397
|
break;
|
|
4220
4398
|
}
|
|
4221
4399
|
case "/clear": {
|
|
4222
|
-
stdout.write("\x1B[2J\x1B[3J\x1B[H");
|
|
4223
4400
|
setMessages([{ id: "welcome-" + Date.now(), role: "system", text: FLUX_LOGO + "\n\n\u{1F30A}\u26A1 Welcome back to Flux Flow! Context cleared.\n", isMeta: true }]);
|
|
4224
|
-
setCompletedIndex(
|
|
4401
|
+
setCompletedIndex(1);
|
|
4225
4402
|
setChatId(generateChatId());
|
|
4226
4403
|
setSessionStats({ tokens: 0 });
|
|
4227
4404
|
setIsExpanded(false);
|
|
@@ -4236,9 +4413,10 @@ ${hintText}`, color: "magenta" }];
|
|
|
4236
4413
|
} else if (newMode === "Flux") {
|
|
4237
4414
|
setThinkingLevel("High");
|
|
4238
4415
|
}
|
|
4416
|
+
const s2 = emojiSpace(2);
|
|
4239
4417
|
setMessages((prev) => {
|
|
4240
4418
|
setCompletedIndex(prev.length + 1);
|
|
4241
|
-
return [...prev, { id: Date.now(), role: "system", text: `\
|
|
4419
|
+
return [...prev, { id: Date.now(), role: "system", text: `\u{1F527}${s2}[SYSTEM] Mode switched to ${newMode}`, isMeta: true }];
|
|
4242
4420
|
});
|
|
4243
4421
|
} else {
|
|
4244
4422
|
setActiveView("mode");
|
|
@@ -4249,15 +4427,17 @@ ${hintText}`, color: "magenta" }];
|
|
|
4249
4427
|
const arg = parts[1]?.toLowerCase();
|
|
4250
4428
|
if (arg === "show") {
|
|
4251
4429
|
setShowFullThinking(true);
|
|
4430
|
+
const s2 = emojiSpace(2);
|
|
4252
4431
|
setMessages((prev) => {
|
|
4253
4432
|
setCompletedIndex(prev.length + 1);
|
|
4254
|
-
return [...prev, { id: Date.now(), role: "system", text:
|
|
4433
|
+
return [...prev, { id: Date.now(), role: "system", text: `\u{1F527}${s2}[SYSTEM] Full Thinking Process: VISIBLE`, isMeta: true }];
|
|
4255
4434
|
});
|
|
4256
4435
|
} else if (arg === "hide") {
|
|
4257
4436
|
setShowFullThinking(false);
|
|
4437
|
+
const s2 = emojiSpace(2);
|
|
4258
4438
|
setMessages((prev) => {
|
|
4259
4439
|
setCompletedIndex(prev.length + 1);
|
|
4260
|
-
return [...prev, { id: Date.now(), role: "system", text:
|
|
4440
|
+
return [...prev, { id: Date.now(), role: "system", text: `\u{1F527}${s2}[SYSTEM] Full Thinking Process: HIDDEN (Headings only)`, isMeta: true }];
|
|
4261
4441
|
});
|
|
4262
4442
|
} else if (parts[1]) {
|
|
4263
4443
|
let val = parts[1].toLowerCase();
|
|
@@ -4270,9 +4450,10 @@ ${hintText}`, color: "magenta" }];
|
|
|
4270
4450
|
});
|
|
4271
4451
|
} else {
|
|
4272
4452
|
setThinkingLevel(formattedLevel);
|
|
4453
|
+
const s2 = emojiSpace(2);
|
|
4273
4454
|
setMessages((prev) => {
|
|
4274
4455
|
setCompletedIndex(prev.length + 1);
|
|
4275
|
-
return [...prev, { id: Date.now(), role: "system", text: `\
|
|
4456
|
+
return [...prev, { id: Date.now(), role: "system", text: `\u{1F527}${s2}[SYSTEM] Thinking level set to ${formattedLevel}`, isMeta: true }];
|
|
4276
4457
|
});
|
|
4277
4458
|
}
|
|
4278
4459
|
} else {
|
|
@@ -4296,9 +4477,10 @@ ${hintText}`, color: "magenta" }];
|
|
|
4296
4477
|
setActiveModel("gemini-3-flash-preview");
|
|
4297
4478
|
} else {
|
|
4298
4479
|
setActiveModel(mod);
|
|
4480
|
+
const s2 = emojiSpace(2);
|
|
4299
4481
|
setMessages((prev) => {
|
|
4300
4482
|
setCompletedIndex(prev.length + 1);
|
|
4301
|
-
return [...prev, { id: Date.now(), role: "system", text: `\
|
|
4483
|
+
return [...prev, { id: Date.now(), role: "system", text: `\u{1F527}${s2}[SYSTEM] Model switched to ${mod}`, isMeta: true }];
|
|
4302
4484
|
});
|
|
4303
4485
|
}
|
|
4304
4486
|
} else {
|
|
@@ -4383,14 +4565,13 @@ ${list || "No saved chats found."}`, isMeta: true }];
|
|
|
4383
4565
|
break;
|
|
4384
4566
|
}
|
|
4385
4567
|
case "/about": {
|
|
4386
|
-
const updateStatus = latestVer ? latestVer !== versionFluxflow ? `Update Available [v${latestVer}]` : "No Update Available" : "Checking for updates...";
|
|
4387
4568
|
const s2 = emojiSpace(2);
|
|
4388
|
-
const aboutText = `\
|
|
4389
|
-
\u{
|
|
4390
|
-
\u{
|
|
4569
|
+
const aboutText = `\u{1F539} FluxFlow Version: v${versionFluxflow}
|
|
4570
|
+
\u{1F539} Status: ${latestVer && latestVer !== versionFluxflow ? `Update Available [v${latestVer}]` : "Up to date"}
|
|
4571
|
+
\u{1F539} Released on: ${updatedOn}`;
|
|
4391
4572
|
setMessages((prev) => {
|
|
4392
4573
|
setCompletedIndex(prev.length + 1);
|
|
4393
|
-
return [...prev, { id: Date.now(), role: "system", text: aboutText, isMeta: true }];
|
|
4574
|
+
return [...prev, { id: "about-" + Date.now(), role: "system", text: aboutText, isAboutRecord: true, isMeta: true }];
|
|
4394
4575
|
});
|
|
4395
4576
|
break;
|
|
4396
4577
|
}
|
|
@@ -4425,7 +4606,7 @@ ${list || "No saved chats found."}`, isMeta: true }];
|
|
|
4425
4606
|
const s = emojiSpace(2);
|
|
4426
4607
|
setMessages((prev) => {
|
|
4427
4608
|
setCompletedIndex(prev.length + 1);
|
|
4428
|
-
return [...prev, { id: Date.now(), role: "system", text: `\
|
|
4609
|
+
return [...prev, { id: Date.now(), role: "system", text: `\u{1F527}${s}[SYSTEM] Unknown command: ${cmd}`, isMeta: true }];
|
|
4429
4610
|
});
|
|
4430
4611
|
}
|
|
4431
4612
|
} else {
|
|
@@ -4788,60 +4969,6 @@ Selection: ${val}`,
|
|
|
4788
4969
|
}, [suggestions]);
|
|
4789
4970
|
const renderActiveView = () => {
|
|
4790
4971
|
switch (activeView) {
|
|
4791
|
-
case "mode":
|
|
4792
|
-
return /* @__PURE__ */ React10.createElement(
|
|
4793
|
-
CommandMenu,
|
|
4794
|
-
{
|
|
4795
|
-
title: "\u26A1 Select Operating Mode",
|
|
4796
|
-
items: [{ label: "Flux (Dev mode - Extended Toolset)", value: "Flux" }, { label: "Flow (Chat mode - Basic Toolset)", value: "Flow" }, { label: "Cancel", value: "Cancel" }],
|
|
4797
|
-
onSelect: (item) => {
|
|
4798
|
-
if (item.value !== "Cancel") {
|
|
4799
|
-
setMode(item.value);
|
|
4800
|
-
if (item.value === "Flow") {
|
|
4801
|
-
setThinkingLevel("Low");
|
|
4802
|
-
} else if (item.value === "Flux") {
|
|
4803
|
-
setThinkingLevel("High");
|
|
4804
|
-
}
|
|
4805
|
-
}
|
|
4806
|
-
setActiveView("chat");
|
|
4807
|
-
}
|
|
4808
|
-
}
|
|
4809
|
-
);
|
|
4810
|
-
case "thinking": {
|
|
4811
|
-
const options = mode === "Flow" ? [
|
|
4812
|
-
{ label: "Low (Fastest)", value: "Low" },
|
|
4813
|
-
{ label: "Medium (Balanced)", value: "Medium" }
|
|
4814
|
-
] : [
|
|
4815
|
-
{ label: "Low (Fastest)", value: "Low" },
|
|
4816
|
-
{ label: "Medium (Balanced)", value: "Medium" },
|
|
4817
|
-
{ label: "High (Complex coding)", value: "High" },
|
|
4818
|
-
{ label: "Max (Architecture)", value: "Max" }
|
|
4819
|
-
];
|
|
4820
|
-
options.push({ label: "Cancel", value: "Cancel" });
|
|
4821
|
-
return /* @__PURE__ */ React10.createElement(
|
|
4822
|
-
CommandMenu,
|
|
4823
|
-
{
|
|
4824
|
-
title: `\u{1F9E0} Select Thinking Level (${mode} Mode)`,
|
|
4825
|
-
items: options,
|
|
4826
|
-
onSelect: (item) => {
|
|
4827
|
-
if (item.value !== "Cancel") setThinkingLevel(item.value);
|
|
4828
|
-
setActiveView("chat");
|
|
4829
|
-
}
|
|
4830
|
-
}
|
|
4831
|
-
);
|
|
4832
|
-
}
|
|
4833
|
-
case "model":
|
|
4834
|
-
return /* @__PURE__ */ React10.createElement(
|
|
4835
|
-
CommandMenu,
|
|
4836
|
-
{
|
|
4837
|
-
title: "\u{1F916} Select AI Model",
|
|
4838
|
-
items: [{ label: "Gemma 4 31B (Recomended - Default, Use Free Tier Key)", value: "gemma-4-31b-it" }, { label: "Gemini 3.1 Pro (Best - Req. Paid Key)", value: "gemini-3.1-pro-preview" }, { label: "Gemini 3 Flash (Paid API Key Recomended)", value: "gemini-3-flash-preview" }, { label: "Gemini 3.1 Flash Lite (Fastest - For Quick Tasks ONLY, Limited Free Quota)", value: "gemini-3.1-flash-lite-preview" }, { label: "Cancel", value: "Cancel" }],
|
|
4839
|
-
onSelect: (item) => {
|
|
4840
|
-
if (item.value !== "Cancel") setActiveModel(item.value);
|
|
4841
|
-
setActiveView("chat");
|
|
4842
|
-
}
|
|
4843
|
-
}
|
|
4844
|
-
);
|
|
4845
4972
|
case "settings":
|
|
4846
4973
|
return /* @__PURE__ */ React10.createElement(
|
|
4847
4974
|
CommandMenu,
|
|
@@ -4944,7 +5071,7 @@ Selection: ${val}`,
|
|
|
4944
5071
|
}
|
|
4945
5072
|
);
|
|
4946
5073
|
case "input":
|
|
4947
|
-
return /* @__PURE__ */ React10.createElement(Box10, { flexDirection: "column", borderStyle: "round",
|
|
5074
|
+
return /* @__PURE__ */ React10.createElement(Box10, { flexDirection: "column", borderStyle: "round", borderColor: "gray", padding: 0, width: "100%" }, /* @__PURE__ */ React10.createElement(Box10, { paddingX: 1 }, /* @__PURE__ */ React10.createElement(Text10, { color: "magenta", bold: true }, "\u{1F527} DATA CONFIGURATION")), inputConfig?.note && /* @__PURE__ */ React10.createElement(Box10, { paddingX: 1, marginBottom: 1 }, /* @__PURE__ */ React10.createElement(Text10, { color: "yellow", dimColor: true, italic: true }, inputConfig.note)), /* @__PURE__ */ React10.createElement(Box10, { paddingX: 1, flexDirection: "row" }, /* @__PURE__ */ React10.createElement(Text10, { color: "cyan", bold: true }, inputConfig?.label, " "), /* @__PURE__ */ React10.createElement(
|
|
4948
5075
|
TextInput3,
|
|
4949
5076
|
{
|
|
4950
5077
|
value: inputConfig?.value || "",
|
|
@@ -4979,7 +5106,7 @@ Selection: ${val}`,
|
|
|
4979
5106
|
}
|
|
4980
5107
|
}
|
|
4981
5108
|
}
|
|
4982
|
-
)), /* @__PURE__ */ React10.createElement(Text10, { dimColor: true,
|
|
5109
|
+
)), /* @__PURE__ */ React10.createElement(Box10, { paddingX: 1, marginTop: 1 }, /* @__PURE__ */ React10.createElement(Text10, { color: "gray", dimColor: true, italic: true }, "(Press Enter to confirm selection)")));
|
|
4983
5110
|
case "stats":
|
|
4984
5111
|
return /* @__PURE__ */ React10.createElement(Box10, { flexDirection: "column", borderStyle: "round", paddingX: 3, paddingY: 1, width: Math.min(100, (stdout?.columns || 100) - 2) }, /* @__PURE__ */ React10.createElement(Box10, { marginBottom: 1 }, /* @__PURE__ */ React10.createElement(Text10, { color: "white", bold: true, underline: true }, "SESSION TELEMETRY")), /* @__PURE__ */ React10.createElement(Box10, { flexDirection: "column" }, /* @__PURE__ */ React10.createElement(Box10, null, /* @__PURE__ */ React10.createElement(Box10, { width: 25 }, /* @__PURE__ */ React10.createElement(Text10, { color: "blue" }, "Session Duration:")), /* @__PURE__ */ React10.createElement(Text10, { color: "white" }, formatMsDuration(Date.now() - SESSION_START_TIME))), /* @__PURE__ */ React10.createElement(Box10, null, /* @__PURE__ */ React10.createElement(Box10, { width: 25 }, /* @__PURE__ */ React10.createElement(Text10, { color: "blue" }, "Agent Interactions:")), /* @__PURE__ */ React10.createElement(Text10, { color: "white" }, sessionAgentCalls)), /* @__PURE__ */ React10.createElement(Box10, { marginLeft: 2 }, /* @__PURE__ */ React10.createElement(Box10, { width: 23 }, /* @__PURE__ */ React10.createElement(Text10, { color: "blue", dimColor: true }, "\xBB API Time:")), /* @__PURE__ */ React10.createElement(Text10, { color: "white" }, formatMsDuration(sessionApiTime))), /* @__PURE__ */ React10.createElement(Box10, { marginLeft: 2 }, /* @__PURE__ */ React10.createElement(Box10, { width: 23 }, /* @__PURE__ */ React10.createElement(Text10, { color: "blue", dimColor: true }, "\xBB Tool Time:")), /* @__PURE__ */ React10.createElement(Text10, { color: "white" }, formatMsDuration(sessionToolTime))), /* @__PURE__ */ React10.createElement(Box10, null, /* @__PURE__ */ React10.createElement(Box10, { width: 25 }, /* @__PURE__ */ React10.createElement(Text10, { color: "blue" }, "Background Tasks:")), /* @__PURE__ */ React10.createElement(Text10, { color: "white" }, sessionBackgroundCalls)), /* @__PURE__ */ React10.createElement(Box10, null, /* @__PURE__ */ React10.createElement(Box10, { width: 25 }, /* @__PURE__ */ React10.createElement(Text10, { color: "blue" }, "Tokens Consumed:")), /* @__PURE__ */ React10.createElement(Text10, { color: "white" }, formatTokens(sessionTotalTokens))), /* @__PURE__ */ React10.createElement(Box10, null, /* @__PURE__ */ React10.createElement(Box10, { width: 25 }, /* @__PURE__ */ React10.createElement(Text10, { color: "blue" }, "Tool Calls (Sess):")), /* @__PURE__ */ React10.createElement(Text10, { color: "white" }, sessionToolSuccess + sessionToolFailure + sessionToolDenied, " ( "), /* @__PURE__ */ React10.createElement(Text10, { color: "green" }, "\u2713 ", sessionToolSuccess), /* @__PURE__ */ React10.createElement(Text10, { color: "white" }, " "), /* @__PURE__ */ React10.createElement(Text10, { color: "yellow" }, "\u2298 ", sessionToolDenied), /* @__PURE__ */ React10.createElement(Text10, { color: "white" }, " "), /* @__PURE__ */ React10.createElement(Text10, { color: "red" }, "\u2715 ", sessionToolFailure), /* @__PURE__ */ React10.createElement(Text10, { color: "white" }, " )"))), /* @__PURE__ */ React10.createElement(Box10, { flexDirection: "column", marginTop: 1 }, /* @__PURE__ */ React10.createElement(Text10, { color: "white", bold: true, underline: true }, "DAILY USAGE TRACKER"), /* @__PURE__ */ React10.createElement(Box10, { marginTop: 1 }, /* @__PURE__ */ React10.createElement(Box10, { width: 25 }, /* @__PURE__ */ React10.createElement(Text10, { color: "blue" }, "Wall Time Today:")), /* @__PURE__ */ React10.createElement(Text10, { color: "white" }, formatDuration(dailyUsage?.duration || 0))), /* @__PURE__ */ React10.createElement(Box10, null, /* @__PURE__ */ React10.createElement(Box10, { width: 25 }, /* @__PURE__ */ React10.createElement(Text10, { color: "blue" }, "Agent Interactions:")), /* @__PURE__ */ React10.createElement(Text10, { color: "white" }, dailyUsage?.agent || 0)), /* @__PURE__ */ React10.createElement(Box10, null, /* @__PURE__ */ React10.createElement(Box10, { width: 25 }, /* @__PURE__ */ React10.createElement(Text10, { color: "blue" }, "Background Tasks:")), /* @__PURE__ */ React10.createElement(Text10, { color: "white" }, dailyUsage?.background || 0)), /* @__PURE__ */ React10.createElement(Box10, null, /* @__PURE__ */ React10.createElement(Box10, { width: 25 }, /* @__PURE__ */ React10.createElement(Text10, { color: "blue" }, "Tokens Used Today:")), /* @__PURE__ */ React10.createElement(Text10, { color: "white" }, formatTokens(dailyUsage?.tokens || 0))), /* @__PURE__ */ React10.createElement(Box10, null, /* @__PURE__ */ React10.createElement(Box10, { width: 25 }, /* @__PURE__ */ React10.createElement(Text10, { color: "blue" }, "Tool Calls Today:")), /* @__PURE__ */ React10.createElement(Text10, { color: "white" }, (dailyUsage?.toolSuccess || 0) + (dailyUsage?.toolFailure || 0) + (dailyUsage?.toolDenied || 0), " ( "), /* @__PURE__ */ React10.createElement(Text10, { color: "green" }, "\u2713 ", dailyUsage?.toolSuccess || 0), /* @__PURE__ */ React10.createElement(Text10, { color: "white" }, " "), /* @__PURE__ */ React10.createElement(Text10, { color: "yellow" }, "\u2298 ", dailyUsage?.toolDenied || 0), /* @__PURE__ */ React10.createElement(Text10, { color: "white" }, " "), /* @__PURE__ */ React10.createElement(Text10, { color: "red" }, "\u2715 ", dailyUsage?.toolFailure || 0), /* @__PURE__ */ React10.createElement(Text10, { color: "white" }, " )"))), /* @__PURE__ */ React10.createElement(Text10, { dimColor: true, marginTop: 1, italic: true }, "(Press ESC to return to chat)"));
|
|
4985
5112
|
case "autoExecDanger":
|
|
@@ -5047,7 +5174,8 @@ Selection: ${val}`,
|
|
|
5047
5174
|
if (item.value === "edit") {
|
|
5048
5175
|
setApiKey(null);
|
|
5049
5176
|
setActiveView("chat");
|
|
5050
|
-
|
|
5177
|
+
const s = emojiSpace(2);
|
|
5178
|
+
setMessages((prev) => [...prev, { id: Date.now(), role: "system", text: `\u{1F511}${s}[ACTION] Flux waiting for new API Key...` }]);
|
|
5051
5179
|
} else if (item.value === "remove") {
|
|
5052
5180
|
setActiveView("deleteKey");
|
|
5053
5181
|
} else {
|
|
@@ -5057,7 +5185,10 @@ Selection: ${val}`,
|
|
|
5057
5185
|
}
|
|
5058
5186
|
);
|
|
5059
5187
|
case "deleteKey":
|
|
5060
|
-
return /* @__PURE__ */ React10.createElement(Box10, { flexDirection: "column", borderStyle: "round", borderColor: "red", paddingX: 2, paddingY: 1 },
|
|
5188
|
+
return /* @__PURE__ */ React10.createElement(Box10, { flexDirection: "column", borderStyle: "round", borderColor: "red", paddingX: 2, paddingY: 1 }, (() => {
|
|
5189
|
+
const s = emojiSpace(2);
|
|
5190
|
+
return /* @__PURE__ */ React10.createElement(Text10, { color: "red", bold: true }, "\u26D4", s, "DANGER: PURGE API KEY");
|
|
5191
|
+
})(), /* @__PURE__ */ React10.createElement(Text10, { 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__ */ React10.createElement(Box10, { marginTop: 1 }, /* @__PURE__ */ React10.createElement(
|
|
5061
5192
|
CommandMenu,
|
|
5062
5193
|
{
|
|
5063
5194
|
title: "Are you absolutely sure?",
|
|
@@ -5070,7 +5201,8 @@ Selection: ${val}`,
|
|
|
5070
5201
|
await removeAPIKey();
|
|
5071
5202
|
setApiKey(null);
|
|
5072
5203
|
setActiveView("chat");
|
|
5073
|
-
|
|
5204
|
+
const s = emojiSpace(2);
|
|
5205
|
+
setMessages((prev) => [...prev, { id: Date.now(), role: "system", text: `\u2728${s}[VAULT PURGED] API Key removed successfully.` }]);
|
|
5074
5206
|
} else {
|
|
5075
5207
|
setActiveView("key");
|
|
5076
5208
|
}
|
|
@@ -5106,12 +5238,15 @@ Selection: ${val}`,
|
|
|
5106
5238
|
const resumedMsgs = [...h[id].messages];
|
|
5107
5239
|
const hasLogo = resumedMsgs[0]?.text?.includes("\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557");
|
|
5108
5240
|
if (!hasLogo) {
|
|
5109
|
-
resumedMsgs.unshift({ id: "welcome-" + Date.now(), role: "system", text: FLUX_LOGO + "\n\n\u{1F30A}\u26A1 Resuming Flux Flow Session
|
|
5241
|
+
resumedMsgs.unshift({ id: "welcome-" + Date.now(), role: "system", text: FLUX_LOGO + "\n\n\u{1F30A}\u26A1 Resuming Flux Flow Session..." });
|
|
5110
5242
|
}
|
|
5111
5243
|
setMessages(resumedMsgs);
|
|
5112
5244
|
setActiveView("chat");
|
|
5113
|
-
setMessages((prev) =>
|
|
5114
|
-
|
|
5245
|
+
setMessages((prev) => {
|
|
5246
|
+
const newMsgs = [...prev, { id: "sys-" + Date.now(), role: "system", text: `\u{1F4E1} SESSION RESUMED: [${id}]` }];
|
|
5247
|
+
setCompletedIndex(newMsgs.length);
|
|
5248
|
+
return newMsgs;
|
|
5249
|
+
});
|
|
5115
5250
|
}
|
|
5116
5251
|
},
|
|
5117
5252
|
onDelete: async (id) => {
|
|
@@ -5145,7 +5280,7 @@ Selection: ${val}`,
|
|
|
5145
5280
|
setActiveView("chat");
|
|
5146
5281
|
setTimeout(() => {
|
|
5147
5282
|
handleSubmit(val);
|
|
5148
|
-
},
|
|
5283
|
+
}, 500);
|
|
5149
5284
|
},
|
|
5150
5285
|
onEdit: (val) => {
|
|
5151
5286
|
setResolutionData(null);
|
|
@@ -5261,40 +5396,50 @@ Selection: ${val}`,
|
|
|
5261
5396
|
}
|
|
5262
5397
|
)));
|
|
5263
5398
|
default:
|
|
5264
|
-
return /* @__PURE__ */ React10.createElement(Box10, { flexDirection: "column", marginTop: 1, flexShrink: 0, width: "100%" }, /* @__PURE__ */ React10.createElement(Box10, { paddingX: 1, marginBottom: 0, justifyContent: "space-between", width: "100%" }, /* @__PURE__ */ React10.createElement(Box10, null, statusText
|
|
5265
|
-
|
|
5399
|
+
return /* @__PURE__ */ React10.createElement(Box10, { flexDirection: "column", marginTop: 1, flexShrink: 0, width: "100%" }, /* @__PURE__ */ React10.createElement(Box10, { paddingX: 1, marginBottom: 0, justifyContent: "space-between", width: "100%" }, /* @__PURE__ */ React10.createElement(Box10, null, statusText ? /* @__PURE__ */ React10.createElement(Box10, null, isSpinnerActive && /* @__PURE__ */ React10.createElement(Text10, { color: "magenta" }, /* @__PURE__ */ React10.createElement(Spinner2, { type: "dots" })), /* @__PURE__ */ React10.createElement(Text10, { color: "magenta", bold: true, italic: true }, isSpinnerActive ? " " : "", statusText.toUpperCase())) : /* @__PURE__ */ React10.createElement(Text10, { color: "cyan", dimColor: true, italic: true }, "READY FOR COMMAND...")), /* @__PURE__ */ React10.createElement(Box10, null, /* @__PURE__ */ React10.createElement(Text10, { color: "gray", bold: true }, "[ "), /* @__PURE__ */ React10.createElement(Text10, { color: "white" }, tempModelOverride || activeModel), /* @__PURE__ */ React10.createElement(Text10, { color: "gray", bold: true }, " ]"))), /* @__PURE__ */ React10.createElement(
|
|
5400
|
+
Box10,
|
|
5266
5401
|
{
|
|
5267
|
-
|
|
5268
|
-
|
|
5269
|
-
|
|
5270
|
-
|
|
5271
|
-
|
|
5272
|
-
|
|
5402
|
+
borderStyle: "round",
|
|
5403
|
+
borderColor: isProcessing ? "magenta" : "cyan",
|
|
5404
|
+
paddingX: 1,
|
|
5405
|
+
paddingY: 0,
|
|
5406
|
+
width: "100%"
|
|
5407
|
+
},
|
|
5408
|
+
/* @__PURE__ */ React10.createElement(Box10, { flexDirection: "column", width: "100%" }, maxLines > 2 && !isExpanded ? /* @__PURE__ */ React10.createElement(Box10, { flexDirection: "row", width: "100%", paddingY: 0, height: 1, overflow: "hidden" }, /* @__PURE__ */ React10.createElement(Box10, { flexShrink: 0, width: 4 }, /* @__PURE__ */ React10.createElement(Text10, { color: "cyan", bold: true }, "\u{1F4A0} ")), /* @__PURE__ */ React10.createElement(Box10, { flexGrow: 1, flexDirection: "row" }, /* @__PURE__ */ React10.createElement(Box10, { flexShrink: 0 }, /* @__PURE__ */ React10.createElement(Text10, { color: "magenta", bold: true }, "[PASTED ", maxLines, " LINES]")), /* @__PURE__ */ React10.createElement(Box10, { flexGrow: 1, marginLeft: 1 }, /* @__PURE__ */ React10.createElement(
|
|
5409
|
+
MultilineInput,
|
|
5410
|
+
{
|
|
5411
|
+
value: "",
|
|
5412
|
+
placeholder: " (Backspace to delete / Enter to expand)",
|
|
5413
|
+
onChange: (val) => {
|
|
5414
|
+
if (val.length > 0) {
|
|
5415
|
+
setIsExpanded(true);
|
|
5416
|
+
setInput(input + val);
|
|
5417
|
+
}
|
|
5418
|
+
},
|
|
5419
|
+
onSubmit: () => setIsExpanded(true),
|
|
5420
|
+
keyBindings: {
|
|
5421
|
+
submit: (key) => key.return && !key.shift && !key.ctrl && !key.leftAlt && !key.rightAlt,
|
|
5422
|
+
newline: (key) => key.return && key.shift || key.return && key.ctrl || key.return && key.leftAlt || key.return && key.rightAlt
|
|
5273
5423
|
}
|
|
5274
|
-
},
|
|
5275
|
-
onSubmit: () => setIsExpanded(true),
|
|
5276
|
-
keyBindings: {
|
|
5277
|
-
submit: (key) => key.return && !key.shift && !key.ctrl && !key.leftAlt && !key.rightAlt,
|
|
5278
|
-
newline: (key) => key.return && key.shift || key.return && key.ctrl || key.return && key.leftAlt || key.return && key.rightAlt
|
|
5279
5424
|
}
|
|
5280
|
-
}
|
|
5281
|
-
|
|
5282
|
-
|
|
5283
|
-
|
|
5284
|
-
|
|
5285
|
-
|
|
5286
|
-
|
|
5287
|
-
|
|
5288
|
-
|
|
5289
|
-
|
|
5290
|
-
|
|
5291
|
-
|
|
5292
|
-
|
|
5293
|
-
|
|
5294
|
-
|
|
5425
|
+
)))) : /* @__PURE__ */ React10.createElement(Box10, { flexDirection: "row", width: "100%", paddingY: 0 }, /* @__PURE__ */ React10.createElement(Box10, { flexShrink: 0, width: 4 }, /* @__PURE__ */ React10.createElement(Text10, { color: isProcessing ? "magenta" : "cyan", bold: true }, isProcessing ? "\u{1F9E0} " : "\u{1F4A0} ")), /* @__PURE__ */ React10.createElement(Box10, { flexGrow: 1 }, /* @__PURE__ */ React10.createElement(Box10, { flexGrow: 1, position: "relative" }, input === "" && /* @__PURE__ */ React10.createElement(Box10, { position: "absolute", paddingLeft: 0 }, activeCommand && !isTerminalFocused ? /* @__PURE__ */ React10.createElement(Text10, { color: "yellow" }, " Press TAB to interact with terminal...") : activeCommand && isTerminalFocused ? /* @__PURE__ */ React10.createElement(Text10, { color: "yellow", bold: true }, " [ TERMINAL FOCUSED ] Type to interact, press TAB to exit...") : /* @__PURE__ */ React10.createElement(Text10, { 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__ */ React10.createElement(
|
|
5426
|
+
MultilineInput,
|
|
5427
|
+
{
|
|
5428
|
+
focus: !isTerminalFocused,
|
|
5429
|
+
value: input,
|
|
5430
|
+
onChange: (val) => {
|
|
5431
|
+
const cleanVal = val.replace(/\r\n/g, "\n").replace(/\r/g, "\n").replace(/\\\s*\n/g, "\n");
|
|
5432
|
+
setInput(cleanVal);
|
|
5433
|
+
},
|
|
5434
|
+
onSubmit: handleSubmit,
|
|
5435
|
+
maxRows: 3,
|
|
5436
|
+
keyBindings: {
|
|
5437
|
+
submit: (key) => key.return && !key.shift && !key.ctrl,
|
|
5438
|
+
newline: (key) => key.return && key.shift || key.return && key.ctrl
|
|
5439
|
+
}
|
|
5295
5440
|
}
|
|
5296
|
-
|
|
5297
|
-
))
|
|
5441
|
+
)))))
|
|
5442
|
+
));
|
|
5298
5443
|
}
|
|
5299
5444
|
};
|
|
5300
5445
|
return /* @__PURE__ */ React10.createElement(Box10, { flexDirection: "column", width: "100%" }, /* @__PURE__ */ React10.createElement(Box10, { flexDirection: "column", width: "100%", flexGrow: 1 }, windowedHistory.items.map((msg, idx) => /* @__PURE__ */ React10.createElement(MessageItem, { key: msg.id || idx, msg, showFullThinking, columns: stdout?.columns || 80 }))), /* @__PURE__ */ React10.createElement(Box10, { flexDirection: "column", padding: 1, width: "100%" }, (activeView === "chat" || ["ask", "approval", "terminalApproval"].includes(activeView)) && /* @__PURE__ */ React10.createElement(Box10, { flexDirection: "column", width: "100%" }, /* @__PURE__ */ React10.createElement(
|
|
@@ -5304,7 +5449,7 @@ Selection: ${val}`,
|
|
|
5304
5449
|
showFullThinking,
|
|
5305
5450
|
columns: Math.max(20, (stdout?.columns || 80) - 1)
|
|
5306
5451
|
}
|
|
5307
|
-
), activeCommand && /* @__PURE__ */ React10.createElement(Box10, { marginTop: 1 }, /* @__PURE__ */ React10.createElement(TerminalBox, { command: activeCommand, output: execOutput, isFocused: isTerminalFocused }))), isInitializing ? /* @__PURE__ */ React10.createElement(Box10, { borderStyle: "double", borderColor: "magenta", padding: 1, flexShrink: 0 }, /* @__PURE__ */ React10.createElement(Text10, { color: "magenta" }, "\u{1F30A} Starting Flux Flow...")) : !apiKey ? /* @__PURE__ */ React10.createElement(Box10, { borderStyle: "
|
|
5452
|
+
), activeCommand && /* @__PURE__ */ React10.createElement(Box10, { marginTop: 1 }, /* @__PURE__ */ React10.createElement(TerminalBox, { command: activeCommand, output: execOutput, isFocused: isTerminalFocused }))), isInitializing ? /* @__PURE__ */ React10.createElement(Box10, { borderStyle: "double", borderColor: "magenta", padding: 1, flexShrink: 0 }, /* @__PURE__ */ React10.createElement(Text10, { color: "magenta" }, "\u{1F30A} Starting Flux Flow...")) : !apiKey ? /* @__PURE__ */ React10.createElement(Box10, { borderStyle: "round", borderColor: "gray", padding: 0, flexDirection: "column", flexShrink: 0, width: "100%" }, /* @__PURE__ */ React10.createElement(Box10, { paddingX: 1, marginBottom: 1 }, /* @__PURE__ */ React10.createElement(Text10, { color: "yellow", bold: true }, "\u{1F511}", emojiSpace(2), "API KEY REQUIRED")), /* @__PURE__ */ React10.createElement(Box10, { paddingX: 1, flexDirection: "column" }, /* @__PURE__ */ React10.createElement(Text10, null, "Please enter your Gemini API Key to initialize the agent."), /* @__PURE__ */ React10.createElement(Box10, { marginTop: 1 }, /* @__PURE__ */ React10.createElement(Text10, { color: "cyan", bold: true }, "\u{1F4A0} "), /* @__PURE__ */ React10.createElement(
|
|
5308
5453
|
TextInput3,
|
|
5309
5454
|
{
|
|
5310
5455
|
value: tempKey,
|
|
@@ -5312,7 +5457,7 @@ Selection: ${val}`,
|
|
|
5312
5457
|
onSubmit: handleSetup,
|
|
5313
5458
|
mask: "*"
|
|
5314
5459
|
}
|
|
5315
|
-
))) : renderActiveView(), /* @__PURE__ */ React10.createElement(Box10, { flexShrink: 0, width: "100%" }, /* @__PURE__ */ React10.createElement(
|
|
5460
|
+
))), /* @__PURE__ */ React10.createElement(Box10, { paddingX: 1, marginTop: 1 }, /* @__PURE__ */ React10.createElement(Text10, { color: "gray", dimColor: true, italic: true }, "(Press Enter to confirm and initialize)"))) : renderActiveView(), confirmExit && /* @__PURE__ */ React10.createElement(Box10, { borderStyle: "round", borderColor: "red", paddingX: 2, marginY: 0, width: "100%" }, /* @__PURE__ */ React10.createElement(Text10, { color: "red", bold: true }, "\u{1F534} EXIT CONFIRMATION: "), /* @__PURE__ */ React10.createElement(Text10, { color: "white" }, "Press "), /* @__PURE__ */ React10.createElement(Text10, { color: "red", bold: true }, "CTRL + C"), /* @__PURE__ */ React10.createElement(Text10, { color: "white" }, " again to exit (", exitCountdown, "s). Press "), /* @__PURE__ */ React10.createElement(Text10, { color: "cyan", bold: true }, "ESC"), /* @__PURE__ */ React10.createElement(Text10, { color: "white" }, " to cancel.")), /* @__PURE__ */ React10.createElement(Box10, { flexShrink: 0, width: "100%" }, /* @__PURE__ */ React10.createElement(
|
|
5316
5461
|
StatusBar_default,
|
|
5317
5462
|
{
|
|
5318
5463
|
mode,
|
|
@@ -5339,31 +5484,39 @@ Selection: ${val}`,
|
|
|
5339
5484
|
Box10,
|
|
5340
5485
|
{
|
|
5341
5486
|
flexDirection: "column",
|
|
5342
|
-
backgroundColor: "#222",
|
|
5343
5487
|
borderStyle: "round",
|
|
5344
|
-
borderColor: "
|
|
5345
|
-
paddingX:
|
|
5488
|
+
borderColor: "gray",
|
|
5489
|
+
paddingX: 0,
|
|
5346
5490
|
paddingY: 0,
|
|
5347
|
-
|
|
5348
|
-
width: "100%",
|
|
5349
|
-
minHeight: suggestions.length >= 5 ? 7 : 0
|
|
5491
|
+
width: "100%"
|
|
5350
5492
|
},
|
|
5493
|
+
/* @__PURE__ */ React10.createElement(Box10, { paddingX: 1, marginBottom: 0 }, /* @__PURE__ */ React10.createElement(Text10, { color: "gray", bold: true, dimColor: true }, "\u{1F50D} COMMAND SUGGESTIONS")),
|
|
5351
5494
|
visible.map((s, i) => {
|
|
5352
5495
|
const actualIdx = startIdx + i;
|
|
5353
5496
|
const isActive = actualIdx === selectedIndex;
|
|
5354
5497
|
const isGemmaDisabled = s.cmd === "gemma-4-31b-it" && apiTier !== "Free";
|
|
5355
|
-
|
|
5356
|
-
|
|
5357
|
-
Text10,
|
|
5498
|
+
return /* @__PURE__ */ React10.createElement(
|
|
5499
|
+
Box10,
|
|
5358
5500
|
{
|
|
5359
|
-
|
|
5360
|
-
|
|
5361
|
-
|
|
5501
|
+
key: s.cmd,
|
|
5502
|
+
flexDirection: "row",
|
|
5503
|
+
backgroundColor: isActive ? "#2a2a2a" : void 0,
|
|
5504
|
+
paddingX: 1
|
|
5362
5505
|
},
|
|
5363
|
-
|
|
5364
|
-
|
|
5506
|
+
/* @__PURE__ */ React10.createElement(Box10, { width: 3 }, /* @__PURE__ */ React10.createElement(Text10, { color: isActive ? "cyan" : "gray", bold: isActive }, isActive ? " \u276F" : " ")),
|
|
5507
|
+
/* @__PURE__ */ React10.createElement(Box10, { width: 32 }, /* @__PURE__ */ React10.createElement(
|
|
5508
|
+
Text10,
|
|
5509
|
+
{
|
|
5510
|
+
color: isGemmaDisabled ? "gray" : isActive ? "yellow" : "white",
|
|
5511
|
+
bold: isActive,
|
|
5512
|
+
dimColor: isGemmaDisabled && !isActive
|
|
5513
|
+
},
|
|
5514
|
+
s.cmd
|
|
5515
|
+
)),
|
|
5516
|
+
/* @__PURE__ */ React10.createElement(Box10, { flexGrow: 1 }, /* @__PURE__ */ React10.createElement(Text10, { color: "gray", italic: true, dimColor: !isActive }, s.desc))
|
|
5517
|
+
);
|
|
5365
5518
|
}),
|
|
5366
|
-
suggestions.length > 5 && /* @__PURE__ */ React10.createElement(Box10, { height: 1 }, remaining > 0
|
|
5519
|
+
suggestions.length > 5 && /* @__PURE__ */ React10.createElement(Box10, { paddingX: 1, height: 1 }, remaining > 0 ? /* @__PURE__ */ React10.createElement(Text10, { color: "gray", dimColor: true, italic: true }, " ... (", remaining, " more commands available)") : /* @__PURE__ */ React10.createElement(Text10, { color: "gray", dimColor: true, italic: true }, " (End of list)"))
|
|
5367
5520
|
);
|
|
5368
5521
|
})()));
|
|
5369
5522
|
}
|
|
@@ -5392,9 +5545,9 @@ var init_app = __esm({
|
|
|
5392
5545
|
init_text();
|
|
5393
5546
|
SESSION_START_TIME = Date.now();
|
|
5394
5547
|
CHANGELOG_URL = "https://fluxflow-cli.onrender.com/changelog.html";
|
|
5395
|
-
versionFluxflow = "1.
|
|
5548
|
+
versionFluxflow = "1.9.1";
|
|
5396
5549
|
updatedOn = "2026-05-13";
|
|
5397
|
-
ResolutionModal = ({ data, onResolve, onEdit }) => /* @__PURE__ */ React10.createElement(Box10, { flexDirection: "column", borderStyle: "round", borderColor: "
|
|
5550
|
+
ResolutionModal = ({ data, onResolve, onEdit }) => /* @__PURE__ */ React10.createElement(Box10, { flexDirection: "column", borderStyle: "round", borderColor: "gray", padding: 0, width: "100%" }, /* @__PURE__ */ React10.createElement(Box10, { paddingX: 1 }, /* @__PURE__ */ React10.createElement(Text10, { color: "magenta", bold: true, underline: true }, "\u{1F7E3} STEERING HINT RESOLUTION")), /* @__PURE__ */ React10.createElement(Box10, { paddingX: 1, marginTop: 1 }, /* @__PURE__ */ React10.createElement(Text10, null, "The agent already finished the task before your hint was consumed.")), /* @__PURE__ */ React10.createElement(Box10, { marginTop: 1, backgroundColor: "#222", paddingX: 2, width: "100%" }, /* @__PURE__ */ React10.createElement(Text10, { italic: true, color: "gray" }, '"', data, '"')), /* @__PURE__ */ React10.createElement(Box10, { paddingX: 1, marginTop: 1 }, /* @__PURE__ */ React10.createElement(Text10, { color: "cyan" }, "How would you like to proceed?")), /* @__PURE__ */ React10.createElement(Box10, { marginTop: 0 }, /* @__PURE__ */ React10.createElement(
|
|
5398
5551
|
CommandMenu,
|
|
5399
5552
|
{
|
|
5400
5553
|
title: "Select Action",
|