fluxflow-cli 1.15.5 → 1.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -2
- package/dist/fluxflow.js +552 -252
- package/package.json +1 -1
package/dist/fluxflow.js
CHANGED
|
@@ -225,7 +225,7 @@ var init_ChatLayout = __esm({
|
|
|
225
225
|
}
|
|
226
226
|
}
|
|
227
227
|
}
|
|
228
|
-
return result.replace(
|
|
228
|
+
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(/@\[TerminalName:.*?, ProcessId:.*?\]/gi, "").replace(/\b(write_file|update_file|read_folder|view_file|exec_command|web_search|web_scrape|search_keyword|write_pdf|write_docx|generate_image)\b/gi, (match) => TOOL_LABELS[match.toLowerCase()] || match).trim();
|
|
229
229
|
};
|
|
230
230
|
formatThinkText = (cleaned, columns = 80) => {
|
|
231
231
|
if (!cleaned) return null;
|
|
@@ -616,14 +616,273 @@ var init_CommandMenu = __esm({
|
|
|
616
616
|
}
|
|
617
617
|
});
|
|
618
618
|
|
|
619
|
+
// src/components/SettingsMenu.jsx
|
|
620
|
+
import React5, { useState as useState2 } from "react";
|
|
621
|
+
import { Box as Box5, Text as Text5, useInput } from "ink";
|
|
622
|
+
function SettingsMenu({
|
|
623
|
+
systemSettings,
|
|
624
|
+
setSystemSettings,
|
|
625
|
+
apiTier,
|
|
626
|
+
setActiveView,
|
|
627
|
+
setInputConfig,
|
|
628
|
+
saveSettings: saveSettings2,
|
|
629
|
+
quotas,
|
|
630
|
+
setMessages
|
|
631
|
+
}) {
|
|
632
|
+
const [activeColumn, setActiveColumn] = useState2("categories");
|
|
633
|
+
const [selectedCategoryIndex, setSelectedCategoryIndex] = useState2(0);
|
|
634
|
+
const [selectedItemIndex, setSelectedItemIndex] = useState2(0);
|
|
635
|
+
const getCategoryItems = (catId) => {
|
|
636
|
+
switch (catId) {
|
|
637
|
+
case "memory":
|
|
638
|
+
return [
|
|
639
|
+
{ label: "Toggle Memory", value: "memory", status: systemSettings.memory ? "ON" : "OFF" }
|
|
640
|
+
];
|
|
641
|
+
case "security":
|
|
642
|
+
const activePreset = getActivePreset(systemSettings);
|
|
643
|
+
return [
|
|
644
|
+
{ label: "Sandbox Preset", value: "sandboxPreset", status: activePreset, section: "Sandbox" },
|
|
645
|
+
{ label: "Auto Execute", value: "autoExec", status: systemSettings.autoExec ? "ON" : "OFF", section: "Sandbox" },
|
|
646
|
+
{ label: "External Workspace Access", value: "externalAccess", status: systemSettings.allowExternalAccess ? "ON" : "OFF", section: "Sandbox" },
|
|
647
|
+
{ label: "Network Access (Terminal)", value: "networkAccess", status: systemSettings.networkAccess !== false ? "ON" : "OFF", section: "Sandbox" },
|
|
648
|
+
{ label: "Auto Approve Commands", value: "autoApprove", status: systemSettings.autoApproveCommands || "Read-Only", section: "Sandbox" },
|
|
649
|
+
{ label: "Auto Disallow Commands", value: "autoDisallow", status: systemSettings.autoDisallowCommands || "Destructive", section: "Sandbox" },
|
|
650
|
+
{ label: "Auto Approve Git Commits", value: "autoApproveGit", status: systemSettings.autoApproveGit ? "ON" : "OFF", section: "Sandbox" },
|
|
651
|
+
{ label: "Auto-Delete History", value: "autoDelete", status: systemSettings.autoDeleteHistory || "30d", section: "Other" },
|
|
652
|
+
{ label: "Save AppData Externally", value: "externalData", status: systemSettings.useExternalData ? "ON" : "OFF", section: "Other" }
|
|
653
|
+
];
|
|
654
|
+
case "updater":
|
|
655
|
+
return [
|
|
656
|
+
{ label: "Auto-Update", value: "autoUpdate", status: systemSettings.autoUpdate ? "ON" : "OFF" },
|
|
657
|
+
{ label: "Preferred Updater", value: "updateManager", status: (systemSettings.updateManager || "npm") === "custom" ? "Custom" : (systemSettings.updateManager || "npm").toUpperCase() }
|
|
658
|
+
];
|
|
659
|
+
case "other":
|
|
660
|
+
return [
|
|
661
|
+
{ label: "API Tier", value: "apiTier", status: apiTier }
|
|
662
|
+
];
|
|
663
|
+
default:
|
|
664
|
+
return [];
|
|
665
|
+
}
|
|
666
|
+
};
|
|
667
|
+
const currentCatId = CATEGORIES[selectedCategoryIndex].id;
|
|
668
|
+
const currentItems = getCategoryItems(currentCatId);
|
|
669
|
+
useInput((input, key) => {
|
|
670
|
+
if (activeColumn === "categories") {
|
|
671
|
+
if (key.upArrow) {
|
|
672
|
+
setSelectedCategoryIndex((prev) => (prev - 1 + CATEGORIES.length) % CATEGORIES.length);
|
|
673
|
+
} else if (key.downArrow) {
|
|
674
|
+
setSelectedCategoryIndex((prev) => (prev + 1) % CATEGORIES.length);
|
|
675
|
+
} else if (key.return || key.rightArrow) {
|
|
676
|
+
const targetCat = CATEGORIES[selectedCategoryIndex];
|
|
677
|
+
if (targetCat.id === "exit") {
|
|
678
|
+
setActiveView("chat");
|
|
679
|
+
} else {
|
|
680
|
+
setActiveColumn("items");
|
|
681
|
+
setSelectedItemIndex(0);
|
|
682
|
+
}
|
|
683
|
+
}
|
|
684
|
+
} else if (activeColumn === "items") {
|
|
685
|
+
if (key.upArrow) {
|
|
686
|
+
setSelectedItemIndex((prev) => (prev - 1 + currentItems.length) % currentItems.length);
|
|
687
|
+
} else if (key.downArrow) {
|
|
688
|
+
setSelectedItemIndex((prev) => (prev + 1) % currentItems.length);
|
|
689
|
+
} else if (key.leftArrow || key.escape) {
|
|
690
|
+
setActiveColumn("categories");
|
|
691
|
+
} else if (key.return) {
|
|
692
|
+
const item = currentItems[selectedItemIndex];
|
|
693
|
+
handleSelect(item);
|
|
694
|
+
}
|
|
695
|
+
}
|
|
696
|
+
});
|
|
697
|
+
const handleSelect = (item) => {
|
|
698
|
+
if (item.value === "memory") {
|
|
699
|
+
setSystemSettings((s) => ({ ...s, memory: !s.memory }));
|
|
700
|
+
} else if (item.value === "sandboxPreset") {
|
|
701
|
+
const activePreset = getActivePreset(systemSettings);
|
|
702
|
+
const presets = ["Autonomous", "Balanced", "Strict"];
|
|
703
|
+
const curIndex = presets.indexOf(activePreset);
|
|
704
|
+
const nextIndex = (curIndex + 1) % presets.length;
|
|
705
|
+
const nextPreset = presets[nextIndex];
|
|
706
|
+
setSystemSettings((s) => {
|
|
707
|
+
const updated = { ...s, sandboxPreset: nextPreset };
|
|
708
|
+
if (nextPreset === "Strict") {
|
|
709
|
+
updated.autoExec = false;
|
|
710
|
+
updated.allowExternalAccess = false;
|
|
711
|
+
updated.networkAccess = false;
|
|
712
|
+
updated.autoApproveCommands = "None";
|
|
713
|
+
updated.autoDisallowCommands = "Auto";
|
|
714
|
+
updated.autoApproveGit = false;
|
|
715
|
+
} else if (nextPreset === "Balanced") {
|
|
716
|
+
updated.autoExec = true;
|
|
717
|
+
updated.allowExternalAccess = false;
|
|
718
|
+
updated.networkAccess = true;
|
|
719
|
+
updated.autoApproveCommands = "Read-Only";
|
|
720
|
+
updated.autoDisallowCommands = "Destructive";
|
|
721
|
+
updated.autoApproveGit = false;
|
|
722
|
+
} else if (nextPreset === "Autonomous") {
|
|
723
|
+
updated.autoExec = true;
|
|
724
|
+
updated.allowExternalAccess = true;
|
|
725
|
+
updated.networkAccess = true;
|
|
726
|
+
updated.autoApproveCommands = "Auto";
|
|
727
|
+
updated.autoDisallowCommands = "None";
|
|
728
|
+
updated.autoApproveGit = true;
|
|
729
|
+
}
|
|
730
|
+
return updated;
|
|
731
|
+
});
|
|
732
|
+
} else if (item.value === "autoExec") {
|
|
733
|
+
if (!systemSettings.autoExec) {
|
|
734
|
+
if (systemSettings.allowExternalAccess) {
|
|
735
|
+
setActiveView("doubleDanger");
|
|
736
|
+
} else {
|
|
737
|
+
setActiveView("autoExecDanger");
|
|
738
|
+
}
|
|
739
|
+
} else {
|
|
740
|
+
setSystemSettings((s) => ({ ...s, autoExec: false, sandboxPreset: "Custom" }));
|
|
741
|
+
}
|
|
742
|
+
} else if (item.value === "externalAccess") {
|
|
743
|
+
if (!systemSettings.allowExternalAccess) {
|
|
744
|
+
if (systemSettings.autoExec) {
|
|
745
|
+
setActiveView("doubleDanger");
|
|
746
|
+
} else {
|
|
747
|
+
setActiveView("externalDanger");
|
|
748
|
+
}
|
|
749
|
+
} else {
|
|
750
|
+
setSystemSettings((s) => ({ ...s, allowExternalAccess: false, sandboxPreset: "Custom" }));
|
|
751
|
+
}
|
|
752
|
+
} else if (item.value === "networkAccess") {
|
|
753
|
+
setSystemSettings((s) => ({ ...s, networkAccess: s.networkAccess === false, sandboxPreset: "Custom" }));
|
|
754
|
+
} else if (item.value === "autoApprove") {
|
|
755
|
+
const approveOptions = ["Auto", "None", "Read-Only"];
|
|
756
|
+
const curIndex = approveOptions.indexOf(systemSettings.autoApproveCommands || "Read-Only");
|
|
757
|
+
const nextIndex = (curIndex + 1) % approveOptions.length;
|
|
758
|
+
setSystemSettings((s) => ({ ...s, autoApproveCommands: approveOptions[nextIndex], sandboxPreset: "Custom" }));
|
|
759
|
+
} else if (item.value === "autoApproveGit") {
|
|
760
|
+
setSystemSettings((s) => ({ ...s, autoApproveGit: !s.autoApproveGit, sandboxPreset: "Custom" }));
|
|
761
|
+
} else if (item.value === "autoDisallow") {
|
|
762
|
+
const disallowOptions = ["Auto", "None", "Destructive"];
|
|
763
|
+
const curIndex = disallowOptions.indexOf(systemSettings.autoDisallowCommands || "Destructive");
|
|
764
|
+
const nextIndex = (curIndex + 1) % disallowOptions.length;
|
|
765
|
+
setSystemSettings((s) => ({ ...s, autoDisallowCommands: disallowOptions[nextIndex], sandboxPreset: "Custom" }));
|
|
766
|
+
} else if (item.value === "apiTier") {
|
|
767
|
+
setActiveView("apiTier");
|
|
768
|
+
} else if (item.value === "autoDelete") {
|
|
769
|
+
const options = ["1d", "7d", "30d"];
|
|
770
|
+
const currentIndex = options.indexOf(systemSettings.autoDeleteHistory || "30d");
|
|
771
|
+
const nextIndex = (currentIndex + 1) % options.length;
|
|
772
|
+
setSystemSettings((s) => ({ ...s, autoDeleteHistory: options[nextIndex] }));
|
|
773
|
+
} else if (item.value === "autoUpdate") {
|
|
774
|
+
setSystemSettings((s) => ({ ...s, autoUpdate: !s.autoUpdate }));
|
|
775
|
+
} else if (item.value === "externalData") {
|
|
776
|
+
if (!systemSettings.useExternalData) {
|
|
777
|
+
setInputConfig({
|
|
778
|
+
label: "Enter absolute path for External AppData:",
|
|
779
|
+
note: "All history, logs and secrets will be stored here. ~/.fluxflow/settings.json stays as anchor.",
|
|
780
|
+
key: "externalDataPath",
|
|
781
|
+
value: systemSettings.externalDataPath || ""
|
|
782
|
+
});
|
|
783
|
+
setActiveView("input");
|
|
784
|
+
} else {
|
|
785
|
+
const newSettings = { ...systemSettings, useExternalData: false };
|
|
786
|
+
setSystemSettings(newSettings);
|
|
787
|
+
saveSettings2({ systemSettings: newSettings, apiTier, quotas });
|
|
788
|
+
setMessages((prev) => [...prev, { id: Date.now(), role: "system", text: "\u{1F3E0} [STORAGE RESET] Flux Flow will return to default ~/.fluxflow after restart." }]);
|
|
789
|
+
setActiveView("chat");
|
|
790
|
+
}
|
|
791
|
+
} else if (item.value === "updateManager") {
|
|
792
|
+
setActiveView("updateManager");
|
|
793
|
+
}
|
|
794
|
+
};
|
|
795
|
+
return /* @__PURE__ */ React5.createElement(Box5, { flexDirection: "column", borderStyle: "round", borderColor: "gray", padding: 0, width: "100%" }, /* @__PURE__ */ React5.createElement(Box5, { paddingX: 1, paddingY: 0, marginBottom: 1, borderStyle: "single", borderColor: "magenta", width: "100%" }, /* @__PURE__ */ React5.createElement(Text5, { color: "magenta", bold: true }, "\u{1F527} SYSTEM CONFIGURATION")), /* @__PURE__ */ React5.createElement(Box5, { flexDirection: "row", width: "100%", minHeight: 8 }, /* @__PURE__ */ React5.createElement(Box5, { flexDirection: "column", width: "30%", borderStyle: "round", borderColor: activeColumn === "categories" ? "cyan" : "gray", padding: 1 }, /* @__PURE__ */ React5.createElement(Box5, { marginBottom: 1 }, /* @__PURE__ */ React5.createElement(Text5, { color: activeColumn === "categories" ? "cyan" : "white", bold: true, underline: true }, "CATEGORIES")), CATEGORIES.map((cat, index) => {
|
|
796
|
+
const isSelected = selectedCategoryIndex === index;
|
|
797
|
+
const isExit = cat.id === "exit";
|
|
798
|
+
return /* @__PURE__ */ React5.createElement(
|
|
799
|
+
Box5,
|
|
800
|
+
{
|
|
801
|
+
key: cat.id,
|
|
802
|
+
marginTop: isExit ? 1 : 0,
|
|
803
|
+
backgroundColor: isSelected ? activeColumn === "categories" ? "#2a2a2a" : "#1e1e1e" : void 0,
|
|
804
|
+
paddingX: 1
|
|
805
|
+
},
|
|
806
|
+
/* @__PURE__ */ React5.createElement(
|
|
807
|
+
Text5,
|
|
808
|
+
{
|
|
809
|
+
color: isSelected ? activeColumn === "categories" ? "cyan" : "yellow" : "white",
|
|
810
|
+
bold: isSelected
|
|
811
|
+
},
|
|
812
|
+
isSelected ? "\u276F " : " ",
|
|
813
|
+
cat.label
|
|
814
|
+
)
|
|
815
|
+
);
|
|
816
|
+
})), /* @__PURE__ */ React5.createElement(Box5, { flexDirection: "column", width: "70%", borderStyle: "round", borderColor: activeColumn === "items" ? "cyan" : "gray", padding: 1, marginLeft: 1 }, /* @__PURE__ */ React5.createElement(Box5, { marginBottom: 1 }, /* @__PURE__ */ React5.createElement(Text5, { color: activeColumn === "items" ? "cyan" : "white", bold: true, underline: true }, CATEGORIES[selectedCategoryIndex].label.toUpperCase(), " SETTINGS")), currentItems.length > 0 ? (() => {
|
|
817
|
+
let lastSection = null;
|
|
818
|
+
const elements = [];
|
|
819
|
+
currentItems.forEach((item, index) => {
|
|
820
|
+
const isSelected = activeColumn === "items" && selectedItemIndex === index;
|
|
821
|
+
const labelLength = item.label.length;
|
|
822
|
+
const dotsCount = Math.max(2, 35 - labelLength);
|
|
823
|
+
const dots = ".".repeat(dotsCount);
|
|
824
|
+
const getStatusColor = (item2) => {
|
|
825
|
+
if (currentCatId === "security") {
|
|
826
|
+
if ((item2.value === "autoExec" || item2.value === "externalAccess") && item2.status === "ON") {
|
|
827
|
+
return "red";
|
|
828
|
+
}
|
|
829
|
+
return "yellow";
|
|
830
|
+
}
|
|
831
|
+
return item2.status === "ON" ? "green" : item2.status === "OFF" ? "red" : "yellow";
|
|
832
|
+
};
|
|
833
|
+
if (item.section && item.section !== lastSection) {
|
|
834
|
+
lastSection = item.section;
|
|
835
|
+
elements.push(
|
|
836
|
+
/* @__PURE__ */ React5.createElement(Box5, { key: `sec-hdr-${item.section}`, marginTop: elements.length > 0 ? 1 : 0, marginBottom: 0, paddingX: 1 }, /* @__PURE__ */ React5.createElement(Text5, { color: "magenta", bold: true, underline: true }, "\u{1F4C2} ", item.section.toUpperCase()))
|
|
837
|
+
);
|
|
838
|
+
}
|
|
839
|
+
elements.push(
|
|
840
|
+
/* @__PURE__ */ React5.createElement(Box5, { key: item.value, backgroundColor: isSelected ? "#2a2a2a" : void 0, paddingX: 2 }, /* @__PURE__ */ React5.createElement(
|
|
841
|
+
Text5,
|
|
842
|
+
{
|
|
843
|
+
color: isSelected ? "cyan" : "white",
|
|
844
|
+
bold: isSelected
|
|
845
|
+
},
|
|
846
|
+
isSelected ? "\u276F " : " ",
|
|
847
|
+
item.label
|
|
848
|
+
), /* @__PURE__ */ React5.createElement(Text5, { color: "gray", dimColor: true }, dots), /* @__PURE__ */ React5.createElement(Text5, { color: getStatusColor(item), bold: true }, "[ ", item.status, " ]"))
|
|
849
|
+
);
|
|
850
|
+
});
|
|
851
|
+
return elements;
|
|
852
|
+
})() : /* @__PURE__ */ React5.createElement(Box5, { paddingX: 1 }, /* @__PURE__ */ React5.createElement(Text5, { color: "gray", italic: true }, CATEGORIES[selectedCategoryIndex].desc)))), /* @__PURE__ */ React5.createElement(Box5, { paddingX: 1, marginTop: 1, flexDirection: "row", justifyContent: "space-between" }, /* @__PURE__ */ React5.createElement(Text5, { 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__ */ React5.createElement(Text5, { color: "gray", dimColor: true }, CATEGORIES[selectedCategoryIndex].desc)));
|
|
853
|
+
}
|
|
854
|
+
var CATEGORIES, getActivePreset;
|
|
855
|
+
var init_SettingsMenu = __esm({
|
|
856
|
+
"src/components/SettingsMenu.jsx"() {
|
|
857
|
+
CATEGORIES = [
|
|
858
|
+
{ id: "memory", label: "\u{1F9E0} Memory", desc: "Manage system context & agent's memory" },
|
|
859
|
+
{ id: "security", label: "\u{1F512} Security", desc: "Configure permissions & data safety" },
|
|
860
|
+
{ id: "updater", label: "\u{1F504} Updater", desc: "Manage application updates" },
|
|
861
|
+
{ id: "other", label: "\u{1F4CB} Other", desc: "Miscellaneous preferences" },
|
|
862
|
+
{ id: "exit", label: "\u{1F6AA} Exit Settings", desc: "Return to chat view" }
|
|
863
|
+
];
|
|
864
|
+
getActivePreset = (settings) => {
|
|
865
|
+
const approve = settings.autoApproveCommands || "Read-Only";
|
|
866
|
+
const disallow = settings.autoDisallowCommands || "Destructive";
|
|
867
|
+
const isStrict = settings.autoExec === false && settings.allowExternalAccess === false && settings.networkAccess === false && approve === "None" && disallow === "Auto" && settings.autoApproveGit === false;
|
|
868
|
+
const isBalanced = settings.autoExec === true && settings.allowExternalAccess === false && settings.networkAccess !== false && approve === "Read-Only" && disallow === "Destructive" && settings.autoApproveGit === false;
|
|
869
|
+
const isAutonomous = settings.autoExec === true && settings.allowExternalAccess === true && settings.networkAccess !== false && approve === "Auto" && disallow === "None" && settings.autoApproveGit === true;
|
|
870
|
+
if (isStrict) return "Strict";
|
|
871
|
+
if (isBalanced) return "Balanced";
|
|
872
|
+
if (isAutonomous) return "Autonomous";
|
|
873
|
+
return settings.sandboxPreset || "Balanced";
|
|
874
|
+
};
|
|
875
|
+
}
|
|
876
|
+
});
|
|
877
|
+
|
|
619
878
|
// src/components/ProfileForm.jsx
|
|
620
|
-
import
|
|
621
|
-
import { Box as
|
|
879
|
+
import React6, { useState as useState3, useEffect as useEffect2 } from "react";
|
|
880
|
+
import { Box as Box6, Text as Text6 } from "ink";
|
|
622
881
|
import TextInput from "ink-text-input";
|
|
623
882
|
function ProfileForm({ initialData, onSave, onCancel }) {
|
|
624
|
-
const [step, setStep] =
|
|
625
|
-
const [currentInput, setCurrentInput] =
|
|
626
|
-
const [profile, setProfile] =
|
|
883
|
+
const [step, setStep] = useState3(0);
|
|
884
|
+
const [currentInput, setCurrentInput] = useState3("");
|
|
885
|
+
const [profile, setProfile] = useState3(() => ({
|
|
627
886
|
name: initialData?.name || "",
|
|
628
887
|
nickname: initialData?.nickname || "",
|
|
629
888
|
instructions: initialData?.instructions || ""
|
|
@@ -652,8 +911,8 @@ function ProfileForm({ initialData, onSave, onCancel }) {
|
|
|
652
911
|
onSave(newProfile);
|
|
653
912
|
}
|
|
654
913
|
};
|
|
655
|
-
return /* @__PURE__ */
|
|
656
|
-
|
|
914
|
+
return /* @__PURE__ */ React6.createElement(
|
|
915
|
+
Box6,
|
|
657
916
|
{
|
|
658
917
|
borderStyle: "round",
|
|
659
918
|
borderColor: "gray",
|
|
@@ -663,16 +922,16 @@ function ProfileForm({ initialData, onSave, onCancel }) {
|
|
|
663
922
|
flexDirection: "column",
|
|
664
923
|
width: "100%"
|
|
665
924
|
},
|
|
666
|
-
/* @__PURE__ */
|
|
667
|
-
/* @__PURE__ */
|
|
925
|
+
/* @__PURE__ */ React6.createElement(Box6, { paddingX: 1, marginBottom: 1 }, /* @__PURE__ */ React6.createElement(Text6, { color: "magenta", bold: true }, "\u{1F464} DEVELOPER PROFILE CONFIGURATION")),
|
|
926
|
+
/* @__PURE__ */ React6.createElement(Box6, { paddingX: 1, flexDirection: "column" }, /* @__PURE__ */ React6.createElement(Box6, null, /* @__PURE__ */ React6.createElement(Text6, { color: "cyan", bold: true }, steps[step].label), /* @__PURE__ */ React6.createElement(
|
|
668
927
|
TextInput,
|
|
669
928
|
{
|
|
670
929
|
value: currentInput,
|
|
671
930
|
onChange: setCurrentInput,
|
|
672
931
|
onSubmit: handleSubmit
|
|
673
932
|
}
|
|
674
|
-
)), /* @__PURE__ */
|
|
675
|
-
/* @__PURE__ */
|
|
933
|
+
)), /* @__PURE__ */ React6.createElement(Box6, { marginTop: 1 }, /* @__PURE__ */ React6.createElement(Text6, { color: "gray", dimColor: true, italic: true }, "Step ", step + 1, " of ", steps.length))),
|
|
934
|
+
/* @__PURE__ */ React6.createElement(Box6, { paddingX: 1, marginTop: 1 }, /* @__PURE__ */ React6.createElement(Text6, { color: "gray", dimColor: true, italic: true }, "(Enter to submit \u2022 Type /cancel to abort)"))
|
|
676
935
|
);
|
|
677
936
|
}
|
|
678
937
|
var init_ProfileForm = __esm({
|
|
@@ -681,19 +940,19 @@ var init_ProfileForm = __esm({
|
|
|
681
940
|
});
|
|
682
941
|
|
|
683
942
|
// src/components/AskUserModal.jsx
|
|
684
|
-
import
|
|
685
|
-
import { Box as
|
|
943
|
+
import React7, { useState as useState4 } from "react";
|
|
944
|
+
import { Box as Box7, Text as Text7, useInput as useInput2 } from "ink";
|
|
686
945
|
import TextInput2 from "ink-text-input";
|
|
687
946
|
var AskUserModal, AskUserModal_default;
|
|
688
947
|
var init_AskUserModal = __esm({
|
|
689
948
|
"src/components/AskUserModal.jsx"() {
|
|
690
949
|
init_terminal();
|
|
691
950
|
AskUserModal = ({ question, options, onResolve }) => {
|
|
692
|
-
const [isSuggestingElse, setIsSuggestingElse] =
|
|
693
|
-
const [customInput, setCustomInput] =
|
|
694
|
-
const [selectedIndex, setSelectedIndex] =
|
|
951
|
+
const [isSuggestingElse, setIsSuggestingElse] = useState4(false);
|
|
952
|
+
const [customInput, setCustomInput] = useState4("");
|
|
953
|
+
const [selectedIndex, setSelectedIndex] = useState4(0);
|
|
695
954
|
const allOptions = [...options, { id: "CUSTOM", label: "Suggest something else...", description: "Provide a custom response" }];
|
|
696
|
-
|
|
955
|
+
useInput2((input, key) => {
|
|
697
956
|
if (isSuggestingElse) return;
|
|
698
957
|
if (key.leftArrow || key.upArrow) {
|
|
699
958
|
setSelectedIndex((prev) => Math.max(0, prev - 1));
|
|
@@ -712,19 +971,19 @@ var init_AskUserModal = __esm({
|
|
|
712
971
|
});
|
|
713
972
|
const s = emojiSpace(2);
|
|
714
973
|
if (isSuggestingElse) {
|
|
715
|
-
return /* @__PURE__ */
|
|
974
|
+
return /* @__PURE__ */ React7.createElement(Box7, { flexDirection: "column", borderStyle: "round", borderColor: "gray", padding: 0, width: "100%" }, /* @__PURE__ */ React7.createElement(Box7, { paddingX: 1 }, /* @__PURE__ */ React7.createElement(Text7, { color: "cyan", bold: true }, "\u{1F4AC} SUGGEST SOMETHING ELSE")), /* @__PURE__ */ React7.createElement(Box7, { marginTop: 1, paddingX: 1 }, /* @__PURE__ */ React7.createElement(Text7, { italic: true, color: "gray" }, "Replying to: ", question)), /* @__PURE__ */ React7.createElement(Box7, { marginTop: 1, paddingX: 1, flexDirection: "row" }, /* @__PURE__ */ React7.createElement(Text7, { color: "cyan", bold: true }, "\u{1F4A0} "), /* @__PURE__ */ React7.createElement(
|
|
716
975
|
TextInput2,
|
|
717
976
|
{
|
|
718
977
|
value: customInput,
|
|
719
978
|
onChange: setCustomInput,
|
|
720
979
|
onSubmit: () => onResolve(customInput)
|
|
721
980
|
}
|
|
722
|
-
)), /* @__PURE__ */
|
|
981
|
+
)), /* @__PURE__ */ React7.createElement(Box7, { marginTop: 1, paddingX: 1, marginBottom: 1 }, /* @__PURE__ */ React7.createElement(Text7, { color: "gray", dimColor: true, italic: true }, "(Press Enter to send)")));
|
|
723
982
|
}
|
|
724
|
-
return /* @__PURE__ */
|
|
983
|
+
return /* @__PURE__ */ React7.createElement(Box7, { flexDirection: "column", borderStyle: "round", borderColor: "gray", padding: 0, width: "100%" }, /* @__PURE__ */ React7.createElement(Box7, { paddingX: 1, marginBottom: 1 }, /* @__PURE__ */ React7.createElement(Text7, { color: "cyan", bold: true }, "\u{1F4AC} AGENT REQUEST: ACTION REQUIRED")), /* @__PURE__ */ React7.createElement(Box7, { paddingX: 1, marginBottom: 1 }, /* @__PURE__ */ React7.createElement(Text7, { bold: true, color: "white" }, question)), /* @__PURE__ */ React7.createElement(Box7, { flexDirection: "column", width: "100%" }, allOptions.map((opt, idx) => {
|
|
725
984
|
const isSelected = idx === selectedIndex;
|
|
726
|
-
return /* @__PURE__ */
|
|
727
|
-
|
|
985
|
+
return /* @__PURE__ */ React7.createElement(
|
|
986
|
+
Box7,
|
|
728
987
|
{
|
|
729
988
|
key: opt.id,
|
|
730
989
|
flexDirection: "column",
|
|
@@ -733,10 +992,10 @@ var init_AskUserModal = __esm({
|
|
|
733
992
|
paddingX: 1,
|
|
734
993
|
marginBottom: idx === allOptions.length - 1 ? 0 : 1
|
|
735
994
|
},
|
|
736
|
-
/* @__PURE__ */
|
|
737
|
-
opt.description && /* @__PURE__ */
|
|
995
|
+
/* @__PURE__ */ React7.createElement(Text7, { color: isSelected ? "cyan" : "white", bold: isSelected }, isSelected ? "\u276F " : " ", opt.label),
|
|
996
|
+
opt.description && /* @__PURE__ */ React7.createElement(Box7, { marginLeft: 4 }, /* @__PURE__ */ React7.createElement(Text7, { color: "gray", italic: true, dimColor: true }, opt.description))
|
|
738
997
|
);
|
|
739
|
-
})), /* @__PURE__ */
|
|
998
|
+
})), /* @__PURE__ */ React7.createElement(Box7, { paddingX: 1, marginTop: 1, marginBottom: 1 }, /* @__PURE__ */ React7.createElement(Text7, { color: "gray", dimColor: true, italic: true }, "(Use Arrows to navigate, Enter to confirm)")));
|
|
740
999
|
};
|
|
741
1000
|
AskUserModal_default = AskUserModal;
|
|
742
1001
|
}
|
|
@@ -2821,6 +3080,17 @@ var init_exec_command = __esm({
|
|
|
2821
3080
|
const { onChunk } = options;
|
|
2822
3081
|
if (!rawCommand) return 'ERROR: Missing "command" argument for exec_command.';
|
|
2823
3082
|
const command = adjustWindowsCommand(rawCommand);
|
|
3083
|
+
const systemSettings = options.systemSettings || {};
|
|
3084
|
+
const netEnv = {};
|
|
3085
|
+
if (systemSettings.networkAccess === false) {
|
|
3086
|
+
netEnv.HTTP_PROXY = "http://127.0.0.1:9999";
|
|
3087
|
+
netEnv.HTTPS_PROXY = "http://127.0.0.1:9999";
|
|
3088
|
+
netEnv.ALL_PROXY = "socks5://127.0.0.1:9999";
|
|
3089
|
+
netEnv.http_proxy = "http://127.0.0.1:9999";
|
|
3090
|
+
netEnv.https_proxy = "http://127.0.0.1:9999";
|
|
3091
|
+
netEnv.all_proxy = "socks5://127.0.0.1:9999";
|
|
3092
|
+
netEnv.NO_PROXY = "localhost,127.0.0.1";
|
|
3093
|
+
}
|
|
2824
3094
|
return new Promise((resolve) => {
|
|
2825
3095
|
const child = spawn(command, {
|
|
2826
3096
|
shell: true,
|
|
@@ -2829,7 +3099,8 @@ var init_exec_command = __esm({
|
|
|
2829
3099
|
...process.env,
|
|
2830
3100
|
CI: "false",
|
|
2831
3101
|
TERM: "xterm-256color",
|
|
2832
|
-
FORCE_COLOR: "1"
|
|
3102
|
+
FORCE_COLOR: "1",
|
|
3103
|
+
...netEnv
|
|
2833
3104
|
}
|
|
2834
3105
|
});
|
|
2835
3106
|
activeChildProcess = child;
|
|
@@ -4722,15 +4993,6 @@ ${thinkingLevel != "Fast" ? "[SYSTEM] **STRICTLY FOLLOW THINKING POLICY AS CORE
|
|
|
4722
4993
|
} else {
|
|
4723
4994
|
label = `EXECUTED: ${toolCall.toolName}`.toUpperCase();
|
|
4724
4995
|
}
|
|
4725
|
-
if (label) {
|
|
4726
|
-
const boxWidth = Math.min(label.length + 4, 115);
|
|
4727
|
-
const boxTop = `\u256D${"\u2500".repeat(boxWidth)}\u256E`;
|
|
4728
|
-
const boxMid = `\u2502 ${label.padEnd(boxWidth - 2).substring(0, boxWidth - 2)} \u2502`;
|
|
4729
|
-
const boxBottom = `\u2570${"\u2500".repeat(boxWidth)}\u256F`;
|
|
4730
|
-
yield { type: "visual_feedback", content: `${boxTop}
|
|
4731
|
-
${boxMid}
|
|
4732
|
-
${boxBottom}` };
|
|
4733
|
-
}
|
|
4734
4996
|
if (normToolName === "exec_command") {
|
|
4735
4997
|
const { command } = parseArgs(toolCall.args);
|
|
4736
4998
|
if (command && settings.systemSettings && settings.systemSettings.allowExternalAccess === false) {
|
|
@@ -4745,6 +5007,12 @@ ${boxBottom}` };
|
|
|
4745
5007
|
});
|
|
4746
5008
|
if (isViolating) {
|
|
4747
5009
|
const denyMsg = `Access Denied. Terminal is prohibited from accessing system drives (C://) or external directories while "External Workspace Access" is disabled.`;
|
|
5010
|
+
if (settings.onExecStart) settings.onExecStart(command || "Unknown");
|
|
5011
|
+
yield { type: "exec_start" };
|
|
5012
|
+
await new Promise((resolve) => setTimeout(resolve, 50));
|
|
5013
|
+
if (settings.onExecChunk) settings.onExecChunk(`ERROR: ${denyMsg}`);
|
|
5014
|
+
await new Promise((resolve) => setTimeout(resolve, 50));
|
|
5015
|
+
if (settings.onExecEnd) settings.onExecEnd();
|
|
4748
5016
|
toolResults.push({ role: "user", text: `[TOOL RESULT]: ERROR: ${denyMsg}` });
|
|
4749
5017
|
yield { type: "tool_result", content: `[TOOL RESULT]: ERROR: ${denyMsg}` };
|
|
4750
5018
|
toolCallPointer++;
|
|
@@ -4762,6 +5030,17 @@ ${boxBottom}` };
|
|
|
4762
5030
|
const absoluteCwd = path15.resolve(process.cwd());
|
|
4763
5031
|
if (isExternalOff && !absoluteTarget.startsWith(absoluteCwd)) {
|
|
4764
5032
|
const denyMsg = `Access Denied. You are not allowed to access files outside the current workspace. To enable this, ask the user to turn on "External Workspace Access" in /settings.`;
|
|
5033
|
+
if (normToolName === "write_file" || normToolName === "update_file") {
|
|
5034
|
+
const action = normToolName === "write_file" ? "WRITE DENIED" : "UPDATE DENIED";
|
|
5035
|
+
const deniedLabel = `\u{1F4BE} ${action}: ${parsedArgs.path || "..."}`.toUpperCase();
|
|
5036
|
+
const boxWidth = Math.min(deniedLabel.length + 4, 115);
|
|
5037
|
+
const boxTop = `\u256D${"\u2500".repeat(boxWidth)}\u256E`;
|
|
5038
|
+
const boxMid = `\u2502 ${deniedLabel.padEnd(boxWidth - 2).substring(0, boxWidth - 2)} \u2502`;
|
|
5039
|
+
const boxBottom = `\u2570${"\u2500".repeat(boxWidth)}\u256F`;
|
|
5040
|
+
yield { type: "visual_feedback", content: `${boxTop}
|
|
5041
|
+
${boxMid}
|
|
5042
|
+
${boxBottom}` };
|
|
5043
|
+
}
|
|
4765
5044
|
toolResults.push({ role: "user", text: `[TOOL RESULT]: ERROR: ${denyMsg}` });
|
|
4766
5045
|
yield { type: "tool_result", content: `[TOOL RESULT]: ERROR: ${denyMsg}` };
|
|
4767
5046
|
toolCallPointer++;
|
|
@@ -4771,10 +5050,73 @@ ${boxBottom}` };
|
|
|
4771
5050
|
if (settings.onToolApproval) {
|
|
4772
5051
|
let shouldPrompt = normToolName === "write_file" || normToolName === "update_file" || normToolName === "exec_command";
|
|
4773
5052
|
if (shouldPrompt) {
|
|
4774
|
-
const
|
|
5053
|
+
const systemSettings2 = settings.systemSettings || {};
|
|
5054
|
+
const autoExec = systemSettings2.autoExec;
|
|
5055
|
+
const autoApprove = systemSettings2.autoApproveCommands || "Read-Only";
|
|
5056
|
+
const autoDisallow = systemSettings2.autoDisallowCommands || "Destructive";
|
|
5057
|
+
let decision = null;
|
|
5058
|
+
if (normToolName === "exec_command") {
|
|
5059
|
+
const { command } = parseArgs(toolCall.args);
|
|
5060
|
+
const cmdTrimmed = (command || "").trim();
|
|
5061
|
+
const safeRegex = /^(echo|ls|dir|pwd|cd|git status|git log|git diff|type|cat|help)\b/i;
|
|
5062
|
+
const destructiveRegex = /\b(rm\s+-rf|rm\s+-f|del\s+\/f|rd\s+\/s|rmdir\s+\/s|format)\b/i;
|
|
5063
|
+
const creationRegex = /^(mkdir|touch|md|ni|New-Item)\b/i;
|
|
5064
|
+
const isReadOnly = safeRegex.test(cmdTrimmed);
|
|
5065
|
+
const isDestructive = destructiveRegex.test(cmdTrimmed);
|
|
5066
|
+
const isCreation = creationRegex.test(cmdTrimmed);
|
|
5067
|
+
if (autoApprove === "Auto") {
|
|
5068
|
+
decision = "allow";
|
|
5069
|
+
} else if (autoApprove === "Read-Only" && isReadOnly) {
|
|
5070
|
+
decision = "allow";
|
|
5071
|
+
} else if (systemSettings2.autoApproveGit && /^git\s+commit\b/i.test(cmdTrimmed)) {
|
|
5072
|
+
decision = "allow";
|
|
5073
|
+
}
|
|
5074
|
+
if (!decision) {
|
|
5075
|
+
if (systemSettings2.networkAccess === false) {
|
|
5076
|
+
const networkCmdRegex = /\b(curl|wget|npm|yarn|pnpm|pip|pip3|ssh|docker|git\s+(clone|push|pull|fetch))\b/i;
|
|
5077
|
+
if (networkCmdRegex.test(cmdTrimmed)) {
|
|
5078
|
+
decision = "deny";
|
|
5079
|
+
}
|
|
5080
|
+
}
|
|
5081
|
+
if (!decision) {
|
|
5082
|
+
if (autoDisallow === "Auto" && (isDestructive || !isReadOnly && !isCreation)) {
|
|
5083
|
+
decision = "deny";
|
|
5084
|
+
} else if (autoDisallow === "Destructive" && isDestructive) {
|
|
5085
|
+
decision = "deny";
|
|
5086
|
+
}
|
|
5087
|
+
}
|
|
5088
|
+
}
|
|
5089
|
+
if (!decision && autoExec) {
|
|
5090
|
+
decision = "allow";
|
|
5091
|
+
}
|
|
5092
|
+
} else {
|
|
5093
|
+
if (autoExec) {
|
|
5094
|
+
decision = "allow";
|
|
5095
|
+
}
|
|
5096
|
+
}
|
|
5097
|
+
let approval = decision;
|
|
5098
|
+
if (!approval) {
|
|
5099
|
+
approval = await settings.onToolApproval(normToolName, toolCall.args);
|
|
5100
|
+
}
|
|
4775
5101
|
if (approval === "deny") {
|
|
4776
|
-
|
|
4777
|
-
|
|
5102
|
+
const denyMsg = `Permission Denied: Prohibited ${normToolName === "exec_command" ? "command" : "file edit"}.`;
|
|
5103
|
+
if (normToolName === "write_file" || normToolName === "update_file") {
|
|
5104
|
+
const action = normToolName === "write_file" ? "WRITE DENIED" : "UPDATE DENIED";
|
|
5105
|
+
const deniedLabel = `\u{1F4BE} ${action}: ${parseArgs(toolCall.args).path || "..."}`.toUpperCase();
|
|
5106
|
+
const boxWidth = Math.min(deniedLabel.length + 4, 115);
|
|
5107
|
+
const boxTop = `\u256D${"\u2500".repeat(boxWidth)}\u256E`;
|
|
5108
|
+
const boxMid = `\u2502 ${deniedLabel.padEnd(boxWidth - 2).substring(0, boxWidth - 2)} \u2502`;
|
|
5109
|
+
const boxBottom = `\u2570${"\u2500".repeat(boxWidth)}\u256F`;
|
|
5110
|
+
yield { type: "visual_feedback", content: `${boxTop}
|
|
5111
|
+
${boxMid}
|
|
5112
|
+
${boxBottom}` };
|
|
5113
|
+
}
|
|
5114
|
+
if (normToolName === "exec_command") {
|
|
5115
|
+
await new Promise((resolve) => setTimeout(resolve, 50));
|
|
5116
|
+
if (settings.onExecChunk) settings.onExecChunk(`ERROR: ${denyMsg}`);
|
|
5117
|
+
await new Promise((resolve) => setTimeout(resolve, 50));
|
|
5118
|
+
if (settings.onExecEnd) settings.onExecEnd();
|
|
5119
|
+
}
|
|
4778
5120
|
toolResults.push({ role: "user", text: `[TOOL RESULT]: DENIED: ${denyMsg}` });
|
|
4779
5121
|
yield { type: "tool_result", content: `[TOOL RESULT]: DENIED: ${denyMsg}` };
|
|
4780
5122
|
await incrementUsage("toolDenied");
|
|
@@ -4784,6 +5126,15 @@ ${boxBottom}` };
|
|
|
4784
5126
|
}
|
|
4785
5127
|
}
|
|
4786
5128
|
}
|
|
5129
|
+
if (label) {
|
|
5130
|
+
const boxWidth = Math.min(label.length + 4, 115);
|
|
5131
|
+
const boxTop = `\u256D${"\u2500".repeat(boxWidth)}\u256E`;
|
|
5132
|
+
const boxMid = `\u2502 ${label.padEnd(boxWidth - 2).substring(0, boxWidth - 2)} \u2502`;
|
|
5133
|
+
const boxBottom = `\u2570${"\u2500".repeat(boxWidth)}\u256F`;
|
|
5134
|
+
yield { type: "visual_feedback", content: `${boxTop}
|
|
5135
|
+
${boxMid}
|
|
5136
|
+
${boxBottom}` };
|
|
5137
|
+
}
|
|
4787
5138
|
if (lastToolFinishedAt > 0) {
|
|
4788
5139
|
const timeSinceLastTool = Date.now() - lastToolFinishedAt;
|
|
4789
5140
|
if (timeSinceLastTool < 1e3) {
|
|
@@ -4796,7 +5147,8 @@ ${boxBottom}` };
|
|
|
4796
5147
|
chatId,
|
|
4797
5148
|
history,
|
|
4798
5149
|
onChunk: (chunk2) => settings.onExecChunk ? settings.onExecChunk(chunk2) : null,
|
|
4799
|
-
onAskUser: settings.onAskUser
|
|
5150
|
+
onAskUser: settings.onAskUser,
|
|
5151
|
+
systemSettings: settings.systemSettings
|
|
4800
5152
|
});
|
|
4801
5153
|
yield { type: "spinner", content: true };
|
|
4802
5154
|
if (process.stdout.isTTY) {
|
|
@@ -5036,12 +5388,12 @@ ${timestamp}`;
|
|
|
5036
5388
|
});
|
|
5037
5389
|
|
|
5038
5390
|
// src/components/ResumeModal.jsx
|
|
5039
|
-
import
|
|
5040
|
-
import { Box as
|
|
5391
|
+
import React8, { useState as useState5, useEffect as useEffect3 } from "react";
|
|
5392
|
+
import { Box as Box8, Text as Text8, useInput as useInput3 } from "ink";
|
|
5041
5393
|
function ResumeModal({ onSelect, onDelete, onClose }) {
|
|
5042
|
-
const [history, setHistory] =
|
|
5043
|
-
const [keys, setKeys] =
|
|
5044
|
-
const [selectedIndex, setSelectedIndex] =
|
|
5394
|
+
const [history, setHistory] = useState5({});
|
|
5395
|
+
const [keys, setKeys] = useState5([]);
|
|
5396
|
+
const [selectedIndex, setSelectedIndex] = useState5(0);
|
|
5045
5397
|
useEffect3(() => {
|
|
5046
5398
|
const fetchHistory = async () => {
|
|
5047
5399
|
const h = await loadHistory();
|
|
@@ -5050,7 +5402,7 @@ function ResumeModal({ onSelect, onDelete, onClose }) {
|
|
|
5050
5402
|
};
|
|
5051
5403
|
fetchHistory();
|
|
5052
5404
|
}, []);
|
|
5053
|
-
|
|
5405
|
+
useInput3((input, key) => {
|
|
5054
5406
|
if (key.escape) onClose();
|
|
5055
5407
|
if (key.upArrow) setSelectedIndex((prev) => Math.max(0, prev - 1));
|
|
5056
5408
|
if (key.downArrow) setSelectedIndex((prev) => Math.min(keys.length - 1, prev + 1));
|
|
@@ -5079,24 +5431,24 @@ function ResumeModal({ onSelect, onDelete, onClose }) {
|
|
|
5079
5431
|
}
|
|
5080
5432
|
}
|
|
5081
5433
|
const visibleKeys = keys.slice(startIndex, startIndex + MAX_VISIBLE);
|
|
5082
|
-
return /* @__PURE__ */
|
|
5434
|
+
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{1F4A0} CHAT HISTORY: RESUME CONVERSATION")), keys.length === 0 ? /* @__PURE__ */ React8.createElement(Box8, { paddingX: 2, paddingY: 1 }, /* @__PURE__ */ React8.createElement(Text8, { italic: true, color: "gray" }, "No saved chats found.")) : /* @__PURE__ */ React8.createElement(Box8, { flexDirection: "column", width: "100%" }, startIndex > 0 && /* @__PURE__ */ React8.createElement(Box8, { paddingX: 2, marginBottom: 1 }, /* @__PURE__ */ React8.createElement(Text8, { color: "gray", dimColor: true }, "\u25B2 (+", startIndex, " more chats above)")), visibleKeys.map((id, index) => {
|
|
5083
5435
|
const chat2 = history[id];
|
|
5084
5436
|
const actualIndex = startIndex + index;
|
|
5085
5437
|
const isSelected = actualIndex === selectedIndex;
|
|
5086
5438
|
const dateStr = formatDate(chat2?.updatedAt);
|
|
5087
|
-
return /* @__PURE__ */
|
|
5088
|
-
|
|
5439
|
+
return /* @__PURE__ */ React8.createElement(
|
|
5440
|
+
Box8,
|
|
5089
5441
|
{
|
|
5090
5442
|
key: id,
|
|
5091
5443
|
paddingX: 1,
|
|
5092
5444
|
backgroundColor: isSelected ? "#2a2a2a" : void 0,
|
|
5093
5445
|
width: "100%"
|
|
5094
5446
|
},
|
|
5095
|
-
/* @__PURE__ */
|
|
5096
|
-
isSelected && /* @__PURE__ */
|
|
5447
|
+
/* @__PURE__ */ React8.createElement(Box8, { flexGrow: 1 }, /* @__PURE__ */ React8.createElement(Text8, { color: isSelected ? "cyan" : "white", bold: isSelected }, isSelected ? "\u276F " : " ", chat2?.name || id, /* @__PURE__ */ React8.createElement(Text8, { color: "gray", dimColor: !isSelected }, " [", dateStr, " \u2022 ", id.slice(5), "]"))),
|
|
5448
|
+
isSelected && /* @__PURE__ */ React8.createElement(Box8, { flexShrink: 0 }, /* @__PURE__ */ React8.createElement(Text8, { color: "red", bold: true }, "[X] DELETE "))
|
|
5097
5449
|
);
|
|
5098
|
-
}), startIndex + MAX_VISIBLE < keys.length && /* @__PURE__ */
|
|
5099
|
-
|
|
5450
|
+
}), startIndex + MAX_VISIBLE < keys.length && /* @__PURE__ */ React8.createElement(Box8, { paddingX: 2, marginTop: 1 }, /* @__PURE__ */ React8.createElement(Text8, { color: "gray", dimColor: true }, "\u25BC (+", keys.length - (startIndex + MAX_VISIBLE), " more chats below)"))), /* @__PURE__ */ React8.createElement(
|
|
5451
|
+
Box8,
|
|
5100
5452
|
{
|
|
5101
5453
|
marginTop: 1,
|
|
5102
5454
|
paddingX: 1,
|
|
@@ -5106,7 +5458,7 @@ function ResumeModal({ onSelect, onDelete, onClose }) {
|
|
|
5106
5458
|
borderBottom: false,
|
|
5107
5459
|
borderColor: "gray"
|
|
5108
5460
|
},
|
|
5109
|
-
/* @__PURE__ */
|
|
5461
|
+
/* @__PURE__ */ React8.createElement(Text8, { dimColor: true, italic: true }, "\u2191\u2193 navigate \u2022 Enter select \u2022 x delete \u2022 Esc close")
|
|
5110
5462
|
));
|
|
5111
5463
|
}
|
|
5112
5464
|
function formatDate(timestamp) {
|
|
@@ -5128,12 +5480,12 @@ var init_ResumeModal = __esm({
|
|
|
5128
5480
|
});
|
|
5129
5481
|
|
|
5130
5482
|
// src/components/MemoryModal.jsx
|
|
5131
|
-
import
|
|
5132
|
-
import { Box as
|
|
5483
|
+
import React9, { useState as useState6, useEffect as useEffect4 } from "react";
|
|
5484
|
+
import { Box as Box9, Text as Text9, useInput as useInput4 } from "ink";
|
|
5133
5485
|
function MemoryModal({ onClose }) {
|
|
5134
|
-
const [memories, setMemories] =
|
|
5135
|
-
const [selectedIndex, setSelectedIndex] =
|
|
5136
|
-
const [isMemoryOn, setIsMemoryOn] =
|
|
5486
|
+
const [memories, setMemories] = useState6([]);
|
|
5487
|
+
const [selectedIndex, setSelectedIndex] = useState6(0);
|
|
5488
|
+
const [isMemoryOn, setIsMemoryOn] = useState6(true);
|
|
5137
5489
|
const loadMemories = () => {
|
|
5138
5490
|
const data = readEncryptedJson(MEMORIES_FILE, []);
|
|
5139
5491
|
setMemories(data);
|
|
@@ -5148,7 +5500,7 @@ function MemoryModal({ onClose }) {
|
|
|
5148
5500
|
useEffect4(() => {
|
|
5149
5501
|
loadMemories();
|
|
5150
5502
|
}, []);
|
|
5151
|
-
|
|
5503
|
+
useInput4((input, key) => {
|
|
5152
5504
|
if (key.escape) onClose();
|
|
5153
5505
|
if (key.upArrow) setSelectedIndex((prev) => Math.max(0, prev - 1));
|
|
5154
5506
|
if (key.downArrow) setSelectedIndex((prev) => Math.min(memories.length - 1, prev + 1));
|
|
@@ -5178,21 +5530,21 @@ function MemoryModal({ onClose }) {
|
|
|
5178
5530
|
return "red";
|
|
5179
5531
|
};
|
|
5180
5532
|
const s = emojiSpace(2);
|
|
5181
|
-
return /* @__PURE__ */
|
|
5533
|
+
return /* @__PURE__ */ React9.createElement(Box9, { flexDirection: "column", borderStyle: "round", borderColor: "gray", padding: 0, width: "100%" }, /* @__PURE__ */ React9.createElement(Box9, { paddingX: 1, marginBottom: 1, justifyContent: "space-between" }, /* @__PURE__ */ React9.createElement(Text9, { color: "cyan", bold: true }, "\u{1F9E0} AGENT MEMORY: LONG-TERM KNOWLEDGE"), /* @__PURE__ */ React9.createElement(Box9, null, /* @__PURE__ */ React9.createElement(Text9, { color: "gray" }, "Vault: "), /* @__PURE__ */ React9.createElement(Text9, { color: getBarColor() }, barStr), /* @__PURE__ */ React9.createElement(Text9, { color: "white", bold: true }, " ", usagePercent, "%"))), !isMemoryOn && memories.length > 0 ? /* @__PURE__ */ React9.createElement(Box9, { paddingX: 2, paddingY: 1 }, /* @__PURE__ */ React9.createElement(Text9, { italic: true, color: "gray" }, "Memory is currently Off...")) : memories.length === 0 ? /* @__PURE__ */ React9.createElement(Box9, { paddingX: 2, paddingY: 1 }, /* @__PURE__ */ React9.createElement(Text9, { italic: true, color: "gray" }, isMemoryOn ? "Learning..." : "Memory not available...")) : /* @__PURE__ */ React9.createElement(Box9, { flexDirection: "column" }, memories.map((mem, idx) => {
|
|
5182
5534
|
const isSelected = idx === selectedIndex;
|
|
5183
|
-
return /* @__PURE__ */
|
|
5184
|
-
|
|
5535
|
+
return /* @__PURE__ */ React9.createElement(
|
|
5536
|
+
Box9,
|
|
5185
5537
|
{
|
|
5186
5538
|
key: mem.id,
|
|
5187
5539
|
paddingX: 1,
|
|
5188
5540
|
backgroundColor: isSelected ? "#2a2a2a" : void 0,
|
|
5189
5541
|
width: "100%"
|
|
5190
5542
|
},
|
|
5191
|
-
/* @__PURE__ */
|
|
5192
|
-
isSelected && /* @__PURE__ */
|
|
5543
|
+
/* @__PURE__ */ React9.createElement(Box9, { flexGrow: 1 }, /* @__PURE__ */ React9.createElement(Text9, { color: isSelected ? "cyan" : "white", bold: isSelected }, isSelected ? "\u276F " : " ", idx + 1, ". ", cleanDisplay(mem.memory))),
|
|
5544
|
+
isSelected && /* @__PURE__ */ React9.createElement(Box9, { flexShrink: 0 }, /* @__PURE__ */ React9.createElement(Text9, { color: "red", bold: true }, "[X] WIPE "))
|
|
5193
5545
|
);
|
|
5194
|
-
})), /* @__PURE__ */
|
|
5195
|
-
|
|
5546
|
+
})), /* @__PURE__ */ React9.createElement(
|
|
5547
|
+
Box9,
|
|
5196
5548
|
{
|
|
5197
5549
|
marginTop: 1,
|
|
5198
5550
|
paddingX: 1,
|
|
@@ -5202,7 +5554,7 @@ function MemoryModal({ onClose }) {
|
|
|
5202
5554
|
borderBottom: false,
|
|
5203
5555
|
borderColor: "gray"
|
|
5204
5556
|
},
|
|
5205
|
-
/* @__PURE__ */
|
|
5557
|
+
/* @__PURE__ */ React9.createElement(Text9, { dimColor: true, italic: true }, "\u2191\u2193 navigate \u2022 x wipe memory \u2022 Esc close")
|
|
5206
5558
|
));
|
|
5207
5559
|
}
|
|
5208
5560
|
var init_MemoryModal = __esm({
|
|
@@ -5214,17 +5566,17 @@ var init_MemoryModal = __esm({
|
|
|
5214
5566
|
});
|
|
5215
5567
|
|
|
5216
5568
|
// src/components/UpdateProcessor.jsx
|
|
5217
|
-
import
|
|
5218
|
-
import { Box as
|
|
5569
|
+
import React10, { useState as useState7, useEffect as useEffect5 } from "react";
|
|
5570
|
+
import { Box as Box10, Text as Text10 } from "ink";
|
|
5219
5571
|
import Spinner from "ink-spinner";
|
|
5220
5572
|
import { exec as exec2 } from "child_process";
|
|
5221
5573
|
var UpdateProcessor, UpdateProcessor_default;
|
|
5222
5574
|
var init_UpdateProcessor = __esm({
|
|
5223
5575
|
"src/components/UpdateProcessor.jsx"() {
|
|
5224
5576
|
UpdateProcessor = ({ latest, current, settings, onClose, onUpdateSettings, onSuccess }) => {
|
|
5225
|
-
const [status, setStatus] =
|
|
5226
|
-
const [log, setLog] =
|
|
5227
|
-
const [error, setError] =
|
|
5577
|
+
const [status, setStatus] = useState7("initializing");
|
|
5578
|
+
const [log, setLog] = useState7("");
|
|
5579
|
+
const [error, setError] = useState7(null);
|
|
5228
5580
|
useEffect5(() => {
|
|
5229
5581
|
let child;
|
|
5230
5582
|
const runUpdate = async () => {
|
|
@@ -5265,13 +5617,13 @@ var init_UpdateProcessor = __esm({
|
|
|
5265
5617
|
};
|
|
5266
5618
|
}, []);
|
|
5267
5619
|
if (status === "initializing" || status === "downloading") {
|
|
5268
|
-
return /* @__PURE__ */
|
|
5620
|
+
return /* @__PURE__ */ React10.createElement(Box10, { flexDirection: "column", borderStyle: "round", borderColor: "cyan", paddingX: 2, paddingY: 1 }, /* @__PURE__ */ React10.createElement(Box10, null, /* @__PURE__ */ React10.createElement(Text10, { color: "cyan" }, /* @__PURE__ */ React10.createElement(Spinner, { type: "dots" })), /* @__PURE__ */ React10.createElement(Text10, { marginLeft: 1, bold: true }, " Updating Flux Flow to v", latest, "...")), /* @__PURE__ */ React10.createElement(Box10, { marginTop: 1, paddingX: 1, borderStyle: "single", borderColor: "#333" }, /* @__PURE__ */ React10.createElement(Text10, { color: "gray", dimColor: true, italic: true }, log || "Preparing environment...")), /* @__PURE__ */ React10.createElement(Text10, { marginTop: 1, dimColor: true }, "(Please do not close the terminal)"));
|
|
5269
5621
|
}
|
|
5270
5622
|
if (status === "success") {
|
|
5271
|
-
return /* @__PURE__ */
|
|
5623
|
+
return /* @__PURE__ */ React10.createElement(Box10, { flexDirection: "column", borderStyle: "round", borderColor: "green", paddingX: 2, paddingY: 1 }, /* @__PURE__ */ React10.createElement(Text10, { color: "green", bold: true }, "\u2705 UPDATE SUCCESSFUL!"), /* @__PURE__ */ React10.createElement(Text10, { marginTop: 1 }, "Flux Flow has been updated to ", /* @__PURE__ */ React10.createElement(Text10, { color: "cyan" }, "v", latest), "."), /* @__PURE__ */ React10.createElement(Text10, { marginTop: 1, color: "yellow", bold: true }, "CRITICAL: Please restart your terminal session to apply changes."), /* @__PURE__ */ React10.createElement(Box10, { marginTop: 1 }, /* @__PURE__ */ React10.createElement(Text10, { dimColor: true }, "(Press ESC to return to chat)")));
|
|
5272
5624
|
}
|
|
5273
5625
|
if (status === "error") {
|
|
5274
|
-
return /* @__PURE__ */
|
|
5626
|
+
return /* @__PURE__ */ React10.createElement(Box10, { flexDirection: "column", borderStyle: "round", borderColor: "red", paddingX: 2, paddingY: 1 }, /* @__PURE__ */ React10.createElement(Text10, { color: "red", bold: true }, "\u274C UPDATE FAILED"), /* @__PURE__ */ React10.createElement(Box10, { marginTop: 1, paddingX: 1, borderStyle: "single", borderColor: "red" }, /* @__PURE__ */ React10.createElement(Text10, { color: "red" }, error)), /* @__PURE__ */ React10.createElement(Text10, { marginTop: 1 }, "Possible causes:"), /* @__PURE__ */ React10.createElement(Text10, null, "\u2022 Missing permissions (Try running as Administrator/Sudo)"), /* @__PURE__ */ React10.createElement(Text10, null, "\u2022 Package manager (", settings.updateManager, ") not found"), /* @__PURE__ */ React10.createElement(Text10, null, "\u2022 Network failure"), /* @__PURE__ */ React10.createElement(Box10, { marginTop: 1 }, /* @__PURE__ */ React10.createElement(Text10, { dimColor: true }, "(Press ESC to return to chat)")));
|
|
5275
5627
|
}
|
|
5276
5628
|
return null;
|
|
5277
5629
|
};
|
|
@@ -5280,11 +5632,11 @@ var init_UpdateProcessor = __esm({
|
|
|
5280
5632
|
});
|
|
5281
5633
|
|
|
5282
5634
|
// src/components/RevertModal.jsx
|
|
5283
|
-
import
|
|
5284
|
-
import { Box as
|
|
5635
|
+
import React11, { useState as useState8 } from "react";
|
|
5636
|
+
import { Box as Box11, Text as Text11, useInput as useInput5 } from "ink";
|
|
5285
5637
|
function RevertModal({ prompts, onSelect, onClose }) {
|
|
5286
|
-
const [selectedIndex, setSelectedIndex] =
|
|
5287
|
-
|
|
5638
|
+
const [selectedIndex, setSelectedIndex] = useState8(0);
|
|
5639
|
+
useInput5((input, key) => {
|
|
5288
5640
|
if (key.escape) onClose();
|
|
5289
5641
|
if (key.upArrow) setSelectedIndex((prev) => Math.max(0, prev - 1));
|
|
5290
5642
|
if (key.downArrow) setSelectedIndex((prev) => Math.min(prompts.length - 1, prev + 1));
|
|
@@ -5303,23 +5655,23 @@ function RevertModal({ prompts, onSelect, onClose }) {
|
|
|
5303
5655
|
}
|
|
5304
5656
|
}
|
|
5305
5657
|
const visiblePrompts = prompts.slice(startIndex, startIndex + MAX_VISIBLE);
|
|
5306
|
-
return /* @__PURE__ */
|
|
5658
|
+
return /* @__PURE__ */ React11.createElement(Box11, { flexDirection: "column", borderStyle: "round", borderColor: "cyan", padding: 0, width: "100%" }, /* @__PURE__ */ React11.createElement(Box11, { paddingX: 1, marginBottom: 1 }, /* @__PURE__ */ React11.createElement(Text11, { color: "cyan", bold: true }, "\u{1F504} CODEBASE TIME TRAVEL: SELECT UNDO POINT")), /* @__PURE__ */ React11.createElement(Box11, { paddingX: 2, marginBottom: 1 }, /* @__PURE__ */ React11.createElement(Text11, null, "Select a prompt to revert the codebase back to the state ", /* @__PURE__ */ React11.createElement(Text11, { bold: true, color: "blue" }, "immediately before"), " it was executed:")), prompts.length === 0 ? /* @__PURE__ */ React11.createElement(Box11, { paddingX: 2, paddingY: 1 }, /* @__PURE__ */ React11.createElement(Text11, { italic: true, color: "gray" }, "No prompt checkpoints found for this session.")) : /* @__PURE__ */ React11.createElement(Box11, { flexDirection: "column", width: "100%" }, startIndex > 0 && /* @__PURE__ */ React11.createElement(Box11, { paddingX: 2, marginBottom: 1 }, /* @__PURE__ */ React11.createElement(Text11, { color: "gray", dimColor: true }, "\u25B2 (+", startIndex, " more prompts above)")), visiblePrompts.map((p, index) => {
|
|
5307
5659
|
const actualIndex = startIndex + index;
|
|
5308
5660
|
const isSelected = actualIndex === selectedIndex;
|
|
5309
5661
|
const dateStr = formatDate2(p.timestamp);
|
|
5310
5662
|
const fileCount = p.changes ? p.changes.length : 0;
|
|
5311
|
-
return /* @__PURE__ */
|
|
5312
|
-
|
|
5663
|
+
return /* @__PURE__ */ React11.createElement(
|
|
5664
|
+
Box11,
|
|
5313
5665
|
{
|
|
5314
5666
|
key: p.id,
|
|
5315
5667
|
paddingX: 1,
|
|
5316
5668
|
backgroundColor: isSelected ? "#1a2a3a" : void 0,
|
|
5317
5669
|
width: "100%"
|
|
5318
5670
|
},
|
|
5319
|
-
/* @__PURE__ */
|
|
5671
|
+
/* @__PURE__ */ React11.createElement(Box11, { flexGrow: 1 }, /* @__PURE__ */ React11.createElement(Text11, { color: isSelected ? "cyan" : "white", bold: isSelected }, isSelected ? "\u276F " : " ", '"', formatPromptPreview(p.prompt), '"', /* @__PURE__ */ React11.createElement(Text11, { color: "gray", dimColor: !isSelected }, " [", dateStr, " \u2022 ", fileCount, " file(s) changed]")))
|
|
5320
5672
|
);
|
|
5321
|
-
}), startIndex + MAX_VISIBLE < prompts.length && /* @__PURE__ */
|
|
5322
|
-
|
|
5673
|
+
}), startIndex + MAX_VISIBLE < prompts.length && /* @__PURE__ */ React11.createElement(Box11, { paddingX: 2, marginTop: 1 }, /* @__PURE__ */ React11.createElement(Text11, { color: "gray", dimColor: true }, "\u25BC (+", prompts.length - (startIndex + MAX_VISIBLE), " more prompts below)"))), /* @__PURE__ */ React11.createElement(
|
|
5674
|
+
Box11,
|
|
5323
5675
|
{
|
|
5324
5676
|
marginTop: 1,
|
|
5325
5677
|
paddingX: 1,
|
|
@@ -5329,7 +5681,7 @@ function RevertModal({ prompts, onSelect, onClose }) {
|
|
|
5329
5681
|
borderBottom: false,
|
|
5330
5682
|
borderColor: "cyan"
|
|
5331
5683
|
},
|
|
5332
|
-
/* @__PURE__ */
|
|
5684
|
+
/* @__PURE__ */ React11.createElement(Text11, { dimColor: true, italic: true }, "\u2191\u2193 navigate \u2022 Enter select undo point \u2022 Esc close")
|
|
5333
5685
|
));
|
|
5334
5686
|
}
|
|
5335
5687
|
function formatPromptPreview(prompt) {
|
|
@@ -5403,8 +5755,8 @@ __export(app_exports, {
|
|
|
5403
5755
|
default: () => App
|
|
5404
5756
|
});
|
|
5405
5757
|
import os4 from "os";
|
|
5406
|
-
import
|
|
5407
|
-
import { Box as
|
|
5758
|
+
import React12, { useState as useState9, useEffect as useEffect6, useRef as useRef2, useMemo } from "react";
|
|
5759
|
+
import { Box as Box12, Text as Text12, useInput as useInput6, useStdout } from "ink";
|
|
5408
5760
|
import Spinner2 from "ink-spinner";
|
|
5409
5761
|
import fs18 from "fs-extra";
|
|
5410
5762
|
import path16 from "path";
|
|
@@ -5414,17 +5766,17 @@ import { MultilineInput } from "ink-multiline-input";
|
|
|
5414
5766
|
import TextInput3 from "ink-text-input";
|
|
5415
5767
|
import gradient from "gradient-string";
|
|
5416
5768
|
function App({ args = [] }) {
|
|
5417
|
-
const [confirmExit, setConfirmExit] =
|
|
5418
|
-
const [exitCountdown, setExitCountdown] =
|
|
5769
|
+
const [confirmExit, setConfirmExit] = useState9(false);
|
|
5770
|
+
const [exitCountdown, setExitCountdown] = useState9(10);
|
|
5419
5771
|
const { stdout } = useStdout();
|
|
5420
|
-
const [input, setInput] =
|
|
5421
|
-
const [isExpanded, setIsExpanded] =
|
|
5422
|
-
const [mode, setMode] =
|
|
5423
|
-
const [terminalSize, setTerminalSize] =
|
|
5772
|
+
const [input, setInput] = useState9("");
|
|
5773
|
+
const [isExpanded, setIsExpanded] = useState9(false);
|
|
5774
|
+
const [mode, setMode] = useState9("Flux");
|
|
5775
|
+
const [terminalSize, setTerminalSize] = useState9({
|
|
5424
5776
|
columns: stdout?.columns || 80,
|
|
5425
5777
|
rows: stdout?.rows || 24
|
|
5426
5778
|
});
|
|
5427
|
-
const [selectedIndex, setSelectedIndex] =
|
|
5779
|
+
const [selectedIndex, setSelectedIndex] = useState9(0);
|
|
5428
5780
|
const persistedModelRef = useRef2(null);
|
|
5429
5781
|
const parsedArgs = useMemo(() => {
|
|
5430
5782
|
const parsed = {};
|
|
@@ -5528,37 +5880,37 @@ function App({ args = [] }) {
|
|
|
5528
5880
|
stdout.off("resize", handleResize);
|
|
5529
5881
|
};
|
|
5530
5882
|
}, [stdout]);
|
|
5531
|
-
const [thinkingLevel, setThinkingLevel] =
|
|
5532
|
-
const [latestVer, setLatestVer] =
|
|
5533
|
-
const [showFullThinking, setShowFullThinking] =
|
|
5534
|
-
const [activeModel, setActiveModel] =
|
|
5535
|
-
const [janitorModel, setJanitorModel] =
|
|
5536
|
-
const [isInitializing, setIsInitializing] =
|
|
5537
|
-
const [apiKey, setApiKey] =
|
|
5538
|
-
const [tempKey, setTempKey] =
|
|
5539
|
-
const [activeView, setActiveView] =
|
|
5540
|
-
const [apiTier, setApiTier] =
|
|
5541
|
-
const [quotas, setQuotas] =
|
|
5542
|
-
const [inputConfig, setInputConfig] =
|
|
5543
|
-
const [systemSettings, setSystemSettings] =
|
|
5544
|
-
const [profileData, setProfileData] =
|
|
5545
|
-
const [imageSettings, setImageSettings] =
|
|
5546
|
-
const [sessionStats, setSessionStats] =
|
|
5547
|
-
const [sessionAgentCalls, setSessionAgentCalls] =
|
|
5548
|
-
const [sessionBackgroundCalls, setSessionBackgroundCalls] =
|
|
5549
|
-
const [sessionTotalTokens, setSessionTotalTokens] =
|
|
5550
|
-
const [sessionToolSuccess, setSessionToolSuccess] =
|
|
5551
|
-
const [sessionToolFailure, setSessionToolFailure] =
|
|
5552
|
-
const [sessionToolDenied, setSessionToolDenied] =
|
|
5553
|
-
const [sessionApiTime, setSessionApiTime] =
|
|
5554
|
-
const [sessionToolTime, setSessionToolTime] =
|
|
5555
|
-
const [sessionImageCount, setSessionImageCount] =
|
|
5556
|
-
const [sessionImageCredits, setSessionImageCredits] =
|
|
5557
|
-
const [dailyUsage, setDailyUsage] =
|
|
5558
|
-
const [chatId, setChatId] =
|
|
5559
|
-
const [activeCommand, setActiveCommand] =
|
|
5560
|
-
const [execOutput, setExecOutput] =
|
|
5561
|
-
const [isTerminalFocused, setIsTerminalFocused] =
|
|
5883
|
+
const [thinkingLevel, setThinkingLevel] = useState9("Medium");
|
|
5884
|
+
const [latestVer, setLatestVer] = useState9(null);
|
|
5885
|
+
const [showFullThinking, setShowFullThinking] = useState9(false);
|
|
5886
|
+
const [activeModel, setActiveModel] = useState9("gemma-4-31b-it");
|
|
5887
|
+
const [janitorModel, setJanitorModel] = useState9("gemma-4-26b-a4b-it");
|
|
5888
|
+
const [isInitializing, setIsInitializing] = useState9(true);
|
|
5889
|
+
const [apiKey, setApiKey] = useState9(null);
|
|
5890
|
+
const [tempKey, setTempKey] = useState9("");
|
|
5891
|
+
const [activeView, setActiveView] = useState9("chat");
|
|
5892
|
+
const [apiTier, setApiTier] = useState9("Free");
|
|
5893
|
+
const [quotas, setQuotas] = useState9({ agentLimit: 1500, backgroundLimit: 1500, searchLimit: 100, customModelId: "", customLimit: 0 });
|
|
5894
|
+
const [inputConfig, setInputConfig] = useState9(null);
|
|
5895
|
+
const [systemSettings, setSystemSettings] = useState9({ memory: true, compression: 0, autoExec: false, autoDeleteHistory: "7d", autoUpdate: false, updateManager: "npm", customUpdateCommand: "" });
|
|
5896
|
+
const [profileData, setProfileData] = useState9({ name: null, nickname: null, instructions: null });
|
|
5897
|
+
const [imageSettings, setImageSettings] = useState9({ keyType: "Default", quality: "Low-High", apiKey: "" });
|
|
5898
|
+
const [sessionStats, setSessionStats] = useState9({ tokens: 0 });
|
|
5899
|
+
const [sessionAgentCalls, setSessionAgentCalls] = useState9(0);
|
|
5900
|
+
const [sessionBackgroundCalls, setSessionBackgroundCalls] = useState9(0);
|
|
5901
|
+
const [sessionTotalTokens, setSessionTotalTokens] = useState9(0);
|
|
5902
|
+
const [sessionToolSuccess, setSessionToolSuccess] = useState9(0);
|
|
5903
|
+
const [sessionToolFailure, setSessionToolFailure] = useState9(0);
|
|
5904
|
+
const [sessionToolDenied, setSessionToolDenied] = useState9(0);
|
|
5905
|
+
const [sessionApiTime, setSessionApiTime] = useState9(0);
|
|
5906
|
+
const [sessionToolTime, setSessionToolTime] = useState9(0);
|
|
5907
|
+
const [sessionImageCount, setSessionImageCount] = useState9(0);
|
|
5908
|
+
const [sessionImageCredits, setSessionImageCredits] = useState9(0);
|
|
5909
|
+
const [dailyUsage, setDailyUsage] = useState9(null);
|
|
5910
|
+
const [chatId, setChatId] = useState9(generateChatId());
|
|
5911
|
+
const [activeCommand, setActiveCommand] = useState9(null);
|
|
5912
|
+
const [execOutput, setExecOutput] = useState9("");
|
|
5913
|
+
const [isTerminalFocused, setIsTerminalFocused] = useState9(false);
|
|
5562
5914
|
useEffect6(() => {
|
|
5563
5915
|
if (apiTier !== "Free" && activeModel === "gemma-4-31b-it") {
|
|
5564
5916
|
setActiveModel("gemini-3-flash-preview");
|
|
@@ -5588,9 +5940,9 @@ function App({ args = [] }) {
|
|
|
5588
5940
|
useEffect6(() => {
|
|
5589
5941
|
execOutputRef.current = execOutput;
|
|
5590
5942
|
}, [execOutput]);
|
|
5591
|
-
const [autoAcceptWrites, setAutoAcceptWrites] =
|
|
5592
|
-
const [pendingApproval, setPendingApproval] =
|
|
5593
|
-
const [pendingAsk, setPendingAsk] =
|
|
5943
|
+
const [autoAcceptWrites, setAutoAcceptWrites] = useState9(false);
|
|
5944
|
+
const [pendingApproval, setPendingApproval] = useState9(null);
|
|
5945
|
+
const [pendingAsk, setPendingAsk] = useState9(null);
|
|
5594
5946
|
const formatDuration = (totalSecs) => {
|
|
5595
5947
|
const h = Math.floor(totalSecs / 3600);
|
|
5596
5948
|
const m = Math.floor(totalSecs % 3600 / 60);
|
|
@@ -5605,18 +5957,18 @@ function App({ args = [] }) {
|
|
|
5605
5957
|
if (ms < 1e3) return `${ms}ms`;
|
|
5606
5958
|
return formatDuration(Math.floor(ms / 1e3));
|
|
5607
5959
|
};
|
|
5608
|
-
const [statusText, setStatusText] =
|
|
5609
|
-
const [isSpinnerActive, setIsSpinnerActive] =
|
|
5610
|
-
const [isProcessing, setIsProcessing] =
|
|
5611
|
-
const [escPressed, setEscPressed] =
|
|
5612
|
-
const [escTimer, setEscTimer] =
|
|
5613
|
-
const [escPressCount, setEscPressCount] =
|
|
5614
|
-
const [recentPrompts, setRecentPrompts] =
|
|
5960
|
+
const [statusText, setStatusText] = useState9(null);
|
|
5961
|
+
const [isSpinnerActive, setIsSpinnerActive] = useState9(true);
|
|
5962
|
+
const [isProcessing, setIsProcessing] = useState9(false);
|
|
5963
|
+
const [escPressed, setEscPressed] = useState9(false);
|
|
5964
|
+
const [escTimer, setEscTimer] = useState9(null);
|
|
5965
|
+
const [escPressCount, setEscPressCount] = useState9(0);
|
|
5966
|
+
const [recentPrompts, setRecentPrompts] = useState9([]);
|
|
5615
5967
|
const escDoubleTimerRef = useRef2(null);
|
|
5616
|
-
const [queuedPrompt, setQueuedPrompt] =
|
|
5617
|
-
const [resolutionData, setResolutionData] =
|
|
5618
|
-
const [tempModelOverride, setTempModelOverride] =
|
|
5619
|
-
const [messages, setMessages] =
|
|
5968
|
+
const [queuedPrompt, setQueuedPrompt] = useState9(null);
|
|
5969
|
+
const [resolutionData, setResolutionData] = useState9(null);
|
|
5970
|
+
const [tempModelOverride, setTempModelOverride] = useState9(null);
|
|
5971
|
+
const [messages, setMessages] = useState9(() => {
|
|
5620
5972
|
const logoMsg = { id: "logo-" + Date.now(), role: "system", text: FLUX_LOGO, isLogo: true, isMeta: true };
|
|
5621
5973
|
const welcomeMsg = { id: "welcome", role: "system", text: "\u{1F30A}\u26A1 Welcome to Flux Flow! Type /help for commands.", isMeta: true };
|
|
5622
5974
|
const isHomeDir = process.cwd() === os4.homedir();
|
|
@@ -5655,7 +6007,7 @@ function App({ args = [] }) {
|
|
|
5655
6007
|
return msgs;
|
|
5656
6008
|
});
|
|
5657
6009
|
const queuedPromptRef = useRef2(null);
|
|
5658
|
-
const [completedIndex, setCompletedIndex] =
|
|
6010
|
+
const [completedIndex, setCompletedIndex] = useState9(messages.length);
|
|
5659
6011
|
const windowedHistory = useMemo(() => {
|
|
5660
6012
|
const MAX_HISTORY_LINES = 2e3;
|
|
5661
6013
|
const width = terminalSize.columns || 80;
|
|
@@ -5690,7 +6042,7 @@ function App({ args = [] }) {
|
|
|
5690
6042
|
return acc + Math.max(1, Math.ceil(line.length / wrapWidth));
|
|
5691
6043
|
}, 0);
|
|
5692
6044
|
const maxLines = Math.max(1, wrappedLinesCount);
|
|
5693
|
-
|
|
6045
|
+
useInput6((inputText, key) => {
|
|
5694
6046
|
if (key.tab && activeCommand) {
|
|
5695
6047
|
setIsTerminalFocused((prev) => !prev);
|
|
5696
6048
|
return;
|
|
@@ -6653,6 +7005,7 @@ ${timestamp}` };
|
|
|
6653
7005
|
},
|
|
6654
7006
|
onExecEnd: () => {
|
|
6655
7007
|
setMessages((prev) => {
|
|
7008
|
+
if (!activeCommandRef.current) return prev;
|
|
6656
7009
|
const finalStatus = `[TERMINAL_RECORD]
|
|
6657
7010
|
COMMAND: ${activeCommandRef.current}
|
|
6658
7011
|
OUTPUT: ${execOutputRef.current}`;
|
|
@@ -7003,75 +7356,21 @@ Selection: ${val}`,
|
|
|
7003
7356
|
const renderActiveView = () => {
|
|
7004
7357
|
switch (activeView) {
|
|
7005
7358
|
case "settings":
|
|
7006
|
-
return /* @__PURE__ */
|
|
7007
|
-
|
|
7359
|
+
return /* @__PURE__ */ React12.createElement(
|
|
7360
|
+
SettingsMenu,
|
|
7008
7361
|
{
|
|
7009
|
-
|
|
7010
|
-
|
|
7011
|
-
|
|
7012
|
-
|
|
7013
|
-
|
|
7014
|
-
|
|
7015
|
-
|
|
7016
|
-
|
|
7017
|
-
{ label: `Preferred Updater [ ${(systemSettings.updateManager || "npm") === "custom" ? "Custom" : (systemSettings.updateManager || "npm").toUpperCase()} ]`, value: "updateManager" },
|
|
7018
|
-
{ label: `Save AppData Externally [ ${systemSettings.useExternalData ? "ON" : "OFF"} ]`, value: "externalData" },
|
|
7019
|
-
{ label: "Exit Settings", value: "Cancel" }
|
|
7020
|
-
],
|
|
7021
|
-
onSelect: (item) => {
|
|
7022
|
-
if (item.value === "memory") setSystemSettings((s) => ({ ...s, memory: !s.memory }));
|
|
7023
|
-
else if (item.value === "autoExec") {
|
|
7024
|
-
if (!systemSettings.autoExec) {
|
|
7025
|
-
if (systemSettings.allowExternalAccess) {
|
|
7026
|
-
setActiveView("doubleDanger");
|
|
7027
|
-
} else {
|
|
7028
|
-
setActiveView("autoExecDanger");
|
|
7029
|
-
}
|
|
7030
|
-
} else {
|
|
7031
|
-
setSystemSettings((s) => ({ ...s, autoExec: false }));
|
|
7032
|
-
}
|
|
7033
|
-
} else if (item.value === "externalAccess") {
|
|
7034
|
-
if (!systemSettings.allowExternalAccess) {
|
|
7035
|
-
if (systemSettings.autoExec) {
|
|
7036
|
-
setActiveView("doubleDanger");
|
|
7037
|
-
} else {
|
|
7038
|
-
setActiveView("externalDanger");
|
|
7039
|
-
}
|
|
7040
|
-
} else {
|
|
7041
|
-
setSystemSettings((s) => ({ ...s, allowExternalAccess: false }));
|
|
7042
|
-
}
|
|
7043
|
-
} else if (item.value === "apiTier") setActiveView("apiTier");
|
|
7044
|
-
else if (item.value === "autoDelete") {
|
|
7045
|
-
const options = ["1d", "7d", "30d"];
|
|
7046
|
-
const currentIndex = options.indexOf(systemSettings.autoDeleteHistory || "30d");
|
|
7047
|
-
const nextIndex = (currentIndex + 1) % options.length;
|
|
7048
|
-
setSystemSettings((s) => ({ ...s, autoDeleteHistory: options[nextIndex] }));
|
|
7049
|
-
} else if (item.value === "autoUpdate") {
|
|
7050
|
-
setSystemSettings((s) => ({ ...s, autoUpdate: !s.autoUpdate }));
|
|
7051
|
-
} else if (item.value === "externalData") {
|
|
7052
|
-
if (!systemSettings.useExternalData) {
|
|
7053
|
-
setInputConfig({
|
|
7054
|
-
label: "Enter absolute path for External AppData:",
|
|
7055
|
-
note: "All history, logs and secrets will be stored here. ~/.fluxflow/settings.json stays as anchor.",
|
|
7056
|
-
key: "externalDataPath",
|
|
7057
|
-
value: systemSettings.externalDataPath || ""
|
|
7058
|
-
});
|
|
7059
|
-
setActiveView("input");
|
|
7060
|
-
} else {
|
|
7061
|
-
const newSettings = { ...systemSettings, useExternalData: false };
|
|
7062
|
-
setSystemSettings(newSettings);
|
|
7063
|
-
saveSettings({ systemSettings: newSettings, apiTier, quotas });
|
|
7064
|
-
setMessages((prev) => [...prev, { id: Date.now(), role: "system", text: "\u{1F3E0} [STORAGE RESET] Flux Flow will return to default ~/.fluxflow after restart." }]);
|
|
7065
|
-
setActiveView("chat");
|
|
7066
|
-
}
|
|
7067
|
-
} else if (item.value === "updateManager") {
|
|
7068
|
-
setActiveView("updateManager");
|
|
7069
|
-
} else if (item.value === "Cancel") setActiveView("chat");
|
|
7070
|
-
}
|
|
7362
|
+
systemSettings,
|
|
7363
|
+
setSystemSettings,
|
|
7364
|
+
apiTier,
|
|
7365
|
+
setActiveView,
|
|
7366
|
+
setInputConfig,
|
|
7367
|
+
saveSettings,
|
|
7368
|
+
quotas,
|
|
7369
|
+
setMessages
|
|
7071
7370
|
}
|
|
7072
7371
|
);
|
|
7073
7372
|
case "apiTier":
|
|
7074
|
-
return /* @__PURE__ */
|
|
7373
|
+
return /* @__PURE__ */ React12.createElement(
|
|
7075
7374
|
CommandMenu,
|
|
7076
7375
|
{
|
|
7077
7376
|
title: `API Tier: ${apiTier}`,
|
|
@@ -7104,7 +7403,7 @@ Selection: ${val}`,
|
|
|
7104
7403
|
}
|
|
7105
7404
|
);
|
|
7106
7405
|
case "input":
|
|
7107
|
-
return /* @__PURE__ */
|
|
7406
|
+
return /* @__PURE__ */ React12.createElement(Box12, { flexDirection: "column", borderStyle: "round", borderColor: "gray", padding: 0, width: "100%" }, /* @__PURE__ */ React12.createElement(Box12, { paddingX: 1 }, /* @__PURE__ */ React12.createElement(Text12, { color: "magenta", bold: true }, "\u{1F527} DATA CONFIGURATION")), inputConfig?.note && /* @__PURE__ */ React12.createElement(Box12, { paddingX: 1, marginBottom: 1 }, /* @__PURE__ */ React12.createElement(Text12, { color: "yellow", dimColor: true, italic: true }, inputConfig.note)), /* @__PURE__ */ React12.createElement(Box12, { paddingX: 1, flexDirection: "row" }, /* @__PURE__ */ React12.createElement(Text12, { color: "cyan", bold: true }, inputConfig?.label, " "), /* @__PURE__ */ React12.createElement(
|
|
7108
7407
|
TextInput3,
|
|
7109
7408
|
{
|
|
7110
7409
|
value: inputConfig?.value || "",
|
|
@@ -7157,11 +7456,11 @@ Selection: ${val}`,
|
|
|
7157
7456
|
}
|
|
7158
7457
|
}
|
|
7159
7458
|
}
|
|
7160
|
-
)), /* @__PURE__ */
|
|
7459
|
+
)), /* @__PURE__ */ React12.createElement(Box12, { paddingX: 1, marginTop: 1 }, /* @__PURE__ */ React12.createElement(Text12, { color: "gray", dimColor: true, italic: true }, "(Press Enter to confirm selection)")));
|
|
7161
7460
|
case "stats":
|
|
7162
|
-
return /* @__PURE__ */
|
|
7461
|
+
return /* @__PURE__ */ React12.createElement(Box12, { flexDirection: "column", borderStyle: "round", paddingX: 3, paddingY: 1, width: Math.min(100, (stdout?.columns || 100) - 2) }, /* @__PURE__ */ React12.createElement(Box12, { marginBottom: 1 }, /* @__PURE__ */ React12.createElement(Text12, { color: "white", bold: true, underline: true }, "SESSION TELEMETRY")), /* @__PURE__ */ React12.createElement(Box12, { flexDirection: "column" }, /* @__PURE__ */ React12.createElement(Box12, null, /* @__PURE__ */ React12.createElement(Box12, { width: 25 }, /* @__PURE__ */ React12.createElement(Text12, { color: "blue" }, "Session Duration:")), /* @__PURE__ */ React12.createElement(Text12, { color: "white" }, formatMsDuration(Date.now() - SESSION_START_TIME))), /* @__PURE__ */ React12.createElement(Box12, null, /* @__PURE__ */ React12.createElement(Box12, { width: 25 }, /* @__PURE__ */ React12.createElement(Text12, { color: "blue" }, "Agent Interactions:")), /* @__PURE__ */ React12.createElement(Text12, { color: "white" }, sessionAgentCalls)), /* @__PURE__ */ React12.createElement(Box12, { marginLeft: 2 }, /* @__PURE__ */ React12.createElement(Box12, { width: 23 }, /* @__PURE__ */ React12.createElement(Text12, { color: "blue", dimColor: true }, "\xBB API Time:")), /* @__PURE__ */ React12.createElement(Text12, { color: "white" }, formatMsDuration(sessionApiTime))), /* @__PURE__ */ React12.createElement(Box12, { marginLeft: 2 }, /* @__PURE__ */ React12.createElement(Box12, { width: 23 }, /* @__PURE__ */ React12.createElement(Text12, { color: "blue", dimColor: true }, "\xBB Tool Time:")), /* @__PURE__ */ React12.createElement(Text12, { color: "white" }, formatMsDuration(sessionToolTime))), /* @__PURE__ */ React12.createElement(Box12, null, /* @__PURE__ */ React12.createElement(Box12, { width: 25 }, /* @__PURE__ */ React12.createElement(Text12, { color: "blue" }, "Background Tasks:")), /* @__PURE__ */ React12.createElement(Text12, { color: "white" }, sessionBackgroundCalls)), /* @__PURE__ */ React12.createElement(Box12, null, /* @__PURE__ */ React12.createElement(Box12, { width: 25 }, /* @__PURE__ */ React12.createElement(Text12, { color: "blue" }, "Tokens Consumed:")), /* @__PURE__ */ React12.createElement(Text12, { color: "white" }, formatTokens(sessionTotalTokens))), /* @__PURE__ */ React12.createElement(Box12, null, /* @__PURE__ */ React12.createElement(Box12, { width: 25 }, /* @__PURE__ */ React12.createElement(Text12, { color: "blue" }, "Images Made:")), /* @__PURE__ */ React12.createElement(Text12, { color: "white" }, sessionImageCount || 0)), /* @__PURE__ */ React12.createElement(Box12, null, /* @__PURE__ */ React12.createElement(Box12, { width: 25 }, /* @__PURE__ */ React12.createElement(Text12, { color: "blue" }, "Image Credits:")), /* @__PURE__ */ React12.createElement(Text12, { color: "white" }, Number(((sessionImageCredits || 0) * 1e3).toFixed(0)), " credits")), /* @__PURE__ */ React12.createElement(Box12, null, /* @__PURE__ */ React12.createElement(Box12, { width: 25 }, /* @__PURE__ */ React12.createElement(Text12, { color: "blue" }, "Tool Calls (Sess):")), /* @__PURE__ */ React12.createElement(Text12, { color: "white" }, sessionToolSuccess + sessionToolFailure + sessionToolDenied, " ( "), /* @__PURE__ */ React12.createElement(Text12, { color: "green" }, "\u2713 ", sessionToolSuccess), /* @__PURE__ */ React12.createElement(Text12, { color: "white" }, " "), /* @__PURE__ */ React12.createElement(Text12, { color: "yellow" }, "\u2298 ", sessionToolDenied), /* @__PURE__ */ React12.createElement(Text12, { color: "white" }, " "), /* @__PURE__ */ React12.createElement(Text12, { color: "red" }, "\u2715 ", sessionToolFailure), /* @__PURE__ */ React12.createElement(Text12, { color: "white" }, " )"))), /* @__PURE__ */ React12.createElement(Box12, { flexDirection: "column", marginTop: 1 }, /* @__PURE__ */ React12.createElement(Text12, { color: "white", bold: true, underline: true }, "DAILY USAGE TRACKER"), /* @__PURE__ */ React12.createElement(Box12, { marginTop: 1 }, /* @__PURE__ */ React12.createElement(Box12, { width: 25 }, /* @__PURE__ */ React12.createElement(Text12, { color: "blue" }, "Wall Time Today:")), /* @__PURE__ */ React12.createElement(Text12, { color: "white" }, formatDuration(dailyUsage?.duration || 0))), /* @__PURE__ */ React12.createElement(Box12, null, /* @__PURE__ */ React12.createElement(Box12, { width: 25 }, /* @__PURE__ */ React12.createElement(Text12, { color: "blue" }, "Agent Interactions:")), /* @__PURE__ */ React12.createElement(Text12, { color: "white" }, dailyUsage?.agent || 0)), /* @__PURE__ */ React12.createElement(Box12, null, /* @__PURE__ */ React12.createElement(Box12, { width: 25 }, /* @__PURE__ */ React12.createElement(Text12, { color: "blue" }, "Background Tasks:")), /* @__PURE__ */ React12.createElement(Text12, { color: "white" }, dailyUsage?.background || 0)), /* @__PURE__ */ React12.createElement(Box12, null, /* @__PURE__ */ React12.createElement(Box12, { width: 25 }, /* @__PURE__ */ React12.createElement(Text12, { color: "blue" }, "Tokens Used Today:")), /* @__PURE__ */ React12.createElement(Text12, { color: "white" }, formatTokens(dailyUsage?.tokens || 0))), /* @__PURE__ */ React12.createElement(Box12, null, /* @__PURE__ */ React12.createElement(Box12, { width: 25 }, /* @__PURE__ */ React12.createElement(Text12, { color: "blue" }, "Images Made Today:")), /* @__PURE__ */ React12.createElement(Text12, { color: "white" }, dailyUsage?.imageCalls?.length || 0)), /* @__PURE__ */ React12.createElement(Box12, null, /* @__PURE__ */ React12.createElement(Box12, { width: 25 }, /* @__PURE__ */ React12.createElement(Text12, { color: "blue" }, "Image Credits Today:")), /* @__PURE__ */ React12.createElement(Text12, { color: "white" }, Number(((dailyUsage?.imageCalls?.reduce((sum, c) => sum + c.cost, 0) || 0) * 1e3).toFixed(0)), " credits")), /* @__PURE__ */ React12.createElement(Box12, null, /* @__PURE__ */ React12.createElement(Box12, { width: 25 }, /* @__PURE__ */ React12.createElement(Text12, { color: "blue" }, "Tool Calls Today:")), /* @__PURE__ */ React12.createElement(Text12, { color: "white" }, (dailyUsage?.toolSuccess || 0) + (dailyUsage?.toolFailure || 0) + (dailyUsage?.toolDenied || 0), " ( "), /* @__PURE__ */ React12.createElement(Text12, { color: "green" }, "\u2713 ", dailyUsage?.toolSuccess || 0), /* @__PURE__ */ React12.createElement(Text12, { color: "white" }, " "), /* @__PURE__ */ React12.createElement(Text12, { color: "yellow" }, "\u2298 ", dailyUsage?.toolDenied || 0), /* @__PURE__ */ React12.createElement(Text12, { color: "white" }, " "), /* @__PURE__ */ React12.createElement(Text12, { color: "red" }, "\u2715 ", dailyUsage?.toolFailure || 0), /* @__PURE__ */ React12.createElement(Text12, { color: "white" }, " )"))), /* @__PURE__ */ React12.createElement(Text12, { dimColor: true, marginTop: 1, italic: true }, "(Press ESC to return to chat)"));
|
|
7163
7462
|
case "autoExecDanger":
|
|
7164
|
-
return /* @__PURE__ */
|
|
7463
|
+
return /* @__PURE__ */ React12.createElement(Box12, { flexDirection: "column", borderStyle: "round", borderColor: "yellow", paddingX: 2, paddingY: 1, width: "100%" }, /* @__PURE__ */ React12.createElement(Text12, { color: "yellow", bold: true, underline: true }, "\u26A0\uFE0F SECURITY WARNING: AUTO EXECUTE MODE"), /* @__PURE__ */ React12.createElement(Text12, { marginTop: 1 }, "Turning this ON allows the agent to execute terminal commands automatically without requiring your approval for each step."), /* @__PURE__ */ React12.createElement(Text12, { marginTop: 1, color: "yellow" }, "RISKS INVOLVED:"), /* @__PURE__ */ React12.createElement(Text12, null, "\u2022 The agent may execute destructive commands (rm -rf, etc.) by mistake."), /* @__PURE__ */ React12.createElement(Text12, null, "\u2022 Unintended system changes if the agent hallucinates a path or command."), /* @__PURE__ */ React12.createElement(Text12, null, "\u2022 Reduced control over the agent's step-by-step decision making."), /* @__PURE__ */ React12.createElement(Box12, { marginTop: 1 }, /* @__PURE__ */ React12.createElement(
|
|
7165
7464
|
CommandMenu,
|
|
7166
7465
|
{
|
|
7167
7466
|
title: "Confirm Intent",
|
|
@@ -7178,7 +7477,7 @@ Selection: ${val}`,
|
|
|
7178
7477
|
}
|
|
7179
7478
|
)));
|
|
7180
7479
|
case "externalDanger":
|
|
7181
|
-
return /* @__PURE__ */
|
|
7480
|
+
return /* @__PURE__ */ React12.createElement(Box12, { flexDirection: "column", borderStyle: "round", borderColor: "red", paddingX: 2, paddingY: 1, width: "100%" }, /* @__PURE__ */ React12.createElement(Text12, { color: "red", bold: true, underline: true }, "\u26A0\uFE0F SECURITY WARNING: EXTERNAL WORKSPACE ACCESS"), /* @__PURE__ */ React12.createElement(Text12, { marginTop: 1 }, "Turning this ON allows the agent to execute tools (Read/Write/Exec) outside of the current active workspace directory."), /* @__PURE__ */ React12.createElement(Text12, { marginTop: 1, color: "yellow" }, "RISKS INVOLVED:"), /* @__PURE__ */ React12.createElement(Text12, null, "\u2022 Access to sensitive system files (SSH keys, Browser data, etc.)"), /* @__PURE__ */ React12.createElement(Text12, null, "\u2022 Potential for accidental or malicious deletion of OS-critical files."), /* @__PURE__ */ React12.createElement(Text12, null, "\u2022 Unauthorized script execution across your entire file system."), /* @__PURE__ */ React12.createElement(Box12, { marginTop: 1 }, /* @__PURE__ */ React12.createElement(
|
|
7182
7481
|
CommandMenu,
|
|
7183
7482
|
{
|
|
7184
7483
|
title: "Confirm Intent",
|
|
@@ -7195,7 +7494,7 @@ Selection: ${val}`,
|
|
|
7195
7494
|
}
|
|
7196
7495
|
)));
|
|
7197
7496
|
case "doubleDanger":
|
|
7198
|
-
return /* @__PURE__ */
|
|
7497
|
+
return /* @__PURE__ */ React12.createElement(Box12, { flexDirection: "column", borderStyle: "round", borderColor: "red", paddingX: 2, paddingY: 1, width: "100%" }, /* @__PURE__ */ React12.createElement(Text12, { color: "red", bold: true, underline: true }, "\u26D4 CRITICAL SECURITY WARNING: COMBINED SYSTEM RISK"), /* @__PURE__ */ React12.createElement(Text12, { marginTop: 1 }, "You are attempting to enable BOTH [Auto Execute] and [External Workspace Access] simultaneously."), /* @__PURE__ */ React12.createElement(Text12, { marginTop: 1, color: "red", bold: true }, "THIS IS NOT RECOMMENDED."), /* @__PURE__ */ React12.createElement(Text12, { marginTop: 1, color: "yellow" }, "THE CRITICAL RISK:"), /* @__PURE__ */ React12.createElement(Text12, null, "The agent will have the power to execute any command across your entire system WITHOUT your approval or supervision."), /* @__PURE__ */ React12.createElement(Text12, { color: "red", italic: true, marginTop: 1 }, "A single hallucination or error could result in full system wipe or data theft."), /* @__PURE__ */ React12.createElement(Box12, { marginTop: 1 }, /* @__PURE__ */ React12.createElement(
|
|
7199
7498
|
CommandMenu,
|
|
7200
7499
|
{
|
|
7201
7500
|
title: "Final Confirmation",
|
|
@@ -7212,7 +7511,7 @@ Selection: ${val}`,
|
|
|
7212
7511
|
}
|
|
7213
7512
|
)));
|
|
7214
7513
|
case "key":
|
|
7215
|
-
return /* @__PURE__ */
|
|
7514
|
+
return /* @__PURE__ */ React12.createElement(
|
|
7216
7515
|
CommandMenu,
|
|
7217
7516
|
{
|
|
7218
7517
|
title: "\u{1F511} API KEY MANAGEMENT",
|
|
@@ -7236,10 +7535,10 @@ Selection: ${val}`,
|
|
|
7236
7535
|
}
|
|
7237
7536
|
);
|
|
7238
7537
|
case "deleteKey":
|
|
7239
|
-
return /* @__PURE__ */
|
|
7538
|
+
return /* @__PURE__ */ React12.createElement(Box12, { flexDirection: "column", borderStyle: "round", borderColor: "red", paddingX: 2, paddingY: 1 }, (() => {
|
|
7240
7539
|
const s = emojiSpace(2);
|
|
7241
|
-
return /* @__PURE__ */
|
|
7242
|
-
})(), /* @__PURE__ */
|
|
7540
|
+
return /* @__PURE__ */ React12.createElement(Text12, { color: "red", bold: true }, "\u26D4", s, "DANGER: PURGE API KEY");
|
|
7541
|
+
})(), /* @__PURE__ */ React12.createElement(Text12, { 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__ */ React12.createElement(Box12, { marginTop: 1 }, /* @__PURE__ */ React12.createElement(
|
|
7243
7542
|
CommandMenu,
|
|
7244
7543
|
{
|
|
7245
7544
|
title: "Are you absolutely sure?",
|
|
@@ -7263,7 +7562,7 @@ Selection: ${val}`,
|
|
|
7263
7562
|
case "exit":
|
|
7264
7563
|
return null;
|
|
7265
7564
|
case "ask":
|
|
7266
|
-
return /* @__PURE__ */
|
|
7565
|
+
return /* @__PURE__ */ React12.createElement(Box12, { width: "100%" }, /* @__PURE__ */ React12.createElement(
|
|
7267
7566
|
AskUserModal_default,
|
|
7268
7567
|
{
|
|
7269
7568
|
question: pendingAsk?.question,
|
|
@@ -7278,7 +7577,7 @@ Selection: ${val}`,
|
|
|
7278
7577
|
}
|
|
7279
7578
|
));
|
|
7280
7579
|
case "revert":
|
|
7281
|
-
return /* @__PURE__ */
|
|
7580
|
+
return /* @__PURE__ */ React12.createElement(Box12, { width: "100%", alignItems: "center", justifyContent: "center" }, /* @__PURE__ */ React12.createElement(
|
|
7282
7581
|
RevertModal,
|
|
7283
7582
|
{
|
|
7284
7583
|
prompts: recentPrompts,
|
|
@@ -7332,7 +7631,7 @@ Selection: ${val}`,
|
|
|
7332
7631
|
}
|
|
7333
7632
|
));
|
|
7334
7633
|
case "resume":
|
|
7335
|
-
return /* @__PURE__ */
|
|
7634
|
+
return /* @__PURE__ */ React12.createElement(Box12, { width: "100%", alignItems: "center", justifyContent: "center" }, /* @__PURE__ */ React12.createElement(
|
|
7336
7635
|
ResumeModal,
|
|
7337
7636
|
{
|
|
7338
7637
|
onSelect: async (id) => {
|
|
@@ -7362,9 +7661,9 @@ Selection: ${val}`,
|
|
|
7362
7661
|
}
|
|
7363
7662
|
));
|
|
7364
7663
|
case "memory":
|
|
7365
|
-
return /* @__PURE__ */
|
|
7664
|
+
return /* @__PURE__ */ React12.createElement(Box12, { width: "100%", alignItems: "center", justifyContent: "center" }, /* @__PURE__ */ React12.createElement(MemoryModal, { onClose: () => setActiveView("chat") }));
|
|
7366
7665
|
case "profile":
|
|
7367
|
-
return /* @__PURE__ */
|
|
7666
|
+
return /* @__PURE__ */ React12.createElement(
|
|
7368
7667
|
ProfileForm,
|
|
7369
7668
|
{
|
|
7370
7669
|
initialData: profileData,
|
|
@@ -7377,7 +7676,7 @@ Selection: ${val}`,
|
|
|
7377
7676
|
}
|
|
7378
7677
|
);
|
|
7379
7678
|
case "resolution":
|
|
7380
|
-
return /* @__PURE__ */
|
|
7679
|
+
return /* @__PURE__ */ React12.createElement(Box12, { width: "100%", alignItems: "center", justifyContent: "center" }, /* @__PURE__ */ React12.createElement(
|
|
7381
7680
|
ResolutionModal,
|
|
7382
7681
|
{
|
|
7383
7682
|
data: resolutionData,
|
|
@@ -7396,15 +7695,15 @@ Selection: ${val}`,
|
|
|
7396
7695
|
}
|
|
7397
7696
|
));
|
|
7398
7697
|
case "approval":
|
|
7399
|
-
return /* @__PURE__ */
|
|
7698
|
+
return /* @__PURE__ */ React12.createElement(Box12, { flexDirection: "column", borderStyle: "round", borderColor: "yellow", paddingX: 2, paddingY: 1, width: "100%" }, /* @__PURE__ */ React12.createElement(Text12, { color: "yellow", bold: true, underline: true }, "\u{1F510} SECURITY GATE: FILE WRITE PERMISSION"), /* @__PURE__ */ React12.createElement(Text12, { marginTop: 1 }, "The agent is attempting to modify: ", /* @__PURE__ */ React12.createElement(Text12, { color: "cyan" }, parseArgs(pendingApproval?.args || "{}").path || "Unknown File")), /* @__PURE__ */ React12.createElement(Box12, { marginTop: 1, borderStyle: "single", borderColor: "#333", paddingX: 1, flexDirection: "column" }, /* @__PURE__ */ React12.createElement(Text12, { color: "gray" }, "--- PROPOSED CONTENT / DIFF ---"), (() => {
|
|
7400
7699
|
const args2 = parseArgs(pendingApproval?.args || "{}");
|
|
7401
7700
|
const oldVal = args2.TargetContent || args2.content_to_replace || args2.replaceContent || null;
|
|
7402
7701
|
const newVal = args2.content || args2.ReplacementContent || args2.content_to_add || args2.replacementContent || args2.newContent || null;
|
|
7403
7702
|
if (oldVal && newVal) {
|
|
7404
|
-
return /* @__PURE__ */
|
|
7703
|
+
return /* @__PURE__ */ React12.createElement(Box12, { flexDirection: "column", marginTop: 1 }, /* @__PURE__ */ React12.createElement(Box12, null, /* @__PURE__ */ React12.createElement(Text12, { color: "red", wrap: "anywhere", bold: true }, "- ", oldVal)), /* @__PURE__ */ React12.createElement(Box12, { marginTop: 1 }, /* @__PURE__ */ React12.createElement(Text12, { color: "green", wrap: "anywhere", bold: true }, "+ ", newVal.replace(/\[\/n\]?/g, "\\n"))));
|
|
7405
7704
|
}
|
|
7406
|
-
return /* @__PURE__ */
|
|
7407
|
-
})()), /* @__PURE__ */
|
|
7705
|
+
return /* @__PURE__ */ React12.createElement(Text12, { color: "white", wrap: "anywhere" }, (newVal ? newVal.replace(/\[\/n\]?/g, "\\n") : null) || "Updating file content...");
|
|
7706
|
+
})()), /* @__PURE__ */ React12.createElement(Box12, { marginTop: 1 }, /* @__PURE__ */ React12.createElement(
|
|
7408
7707
|
CommandMenu,
|
|
7409
7708
|
{
|
|
7410
7709
|
title: "Action Required",
|
|
@@ -7423,7 +7722,7 @@ Selection: ${val}`,
|
|
|
7423
7722
|
}
|
|
7424
7723
|
)));
|
|
7425
7724
|
case "updateManager":
|
|
7426
|
-
return /* @__PURE__ */
|
|
7725
|
+
return /* @__PURE__ */ React12.createElement(
|
|
7427
7726
|
CommandMenu,
|
|
7428
7727
|
{
|
|
7429
7728
|
title: "Select Preferred Update Manager",
|
|
@@ -7460,7 +7759,7 @@ Selection: ${val}`,
|
|
|
7460
7759
|
}
|
|
7461
7760
|
);
|
|
7462
7761
|
case "update":
|
|
7463
|
-
return /* @__PURE__ */
|
|
7762
|
+
return /* @__PURE__ */ React12.createElement(
|
|
7464
7763
|
UpdateProcessor_default,
|
|
7465
7764
|
{
|
|
7466
7765
|
latest: latestVer,
|
|
@@ -7486,7 +7785,7 @@ Selection: ${val}`,
|
|
|
7486
7785
|
}
|
|
7487
7786
|
);
|
|
7488
7787
|
case "terminalApproval":
|
|
7489
|
-
return /* @__PURE__ */
|
|
7788
|
+
return /* @__PURE__ */ React12.createElement(Box12, { flexDirection: "column", borderStyle: "round", borderColor: "red", paddingX: 2, paddingY: 1, width: "100%" }, /* @__PURE__ */ React12.createElement(Text12, { color: "red", bold: true, underline: true }, "\u{1F510} SECURITY GATE: TERMINAL COMMAND OVERSIGHT"), /* @__PURE__ */ React12.createElement(Box12, { marginTop: 1 }, /* @__PURE__ */ React12.createElement(Text12, null, "Agent requested to run: ", /* @__PURE__ */ React12.createElement(Text12, { color: "yellow", bold: true }, parseArgs(pendingApproval?.args || "{}").command || "Unknown Command"))), /* @__PURE__ */ React12.createElement(Box12, { marginTop: 1 }, /* @__PURE__ */ React12.createElement(
|
|
7490
7789
|
CommandMenu,
|
|
7491
7790
|
{
|
|
7492
7791
|
title: "Risk Assessment Required",
|
|
@@ -7502,8 +7801,8 @@ Selection: ${val}`,
|
|
|
7502
7801
|
}
|
|
7503
7802
|
)));
|
|
7504
7803
|
default:
|
|
7505
|
-
return /* @__PURE__ */
|
|
7506
|
-
|
|
7804
|
+
return /* @__PURE__ */ React12.createElement(Box12, { flexDirection: "column", marginTop: 1, flexShrink: 0, width: "100%" }, /* @__PURE__ */ React12.createElement(Box12, { paddingX: 1, marginBottom: 0, justifyContent: "space-between", width: "100%" }, /* @__PURE__ */ React12.createElement(Box12, null, statusText ? /* @__PURE__ */ React12.createElement(Box12, null, isSpinnerActive && /* @__PURE__ */ React12.createElement(Text12, { color: "magenta" }, /* @__PURE__ */ React12.createElement(Spinner2, { type: "dots" })), /* @__PURE__ */ React12.createElement(Text12, { color: "magenta", bold: true, italic: true }, isSpinnerActive ? " " : "", statusText.toUpperCase())) : /* @__PURE__ */ React12.createElement(Text12, { color: "cyan", dimColor: true, italic: true }, "READY FOR COMMAND...")), /* @__PURE__ */ React12.createElement(Box12, null, /* @__PURE__ */ React12.createElement(Text12, { color: "gray", bold: true }, "[ "), /* @__PURE__ */ React12.createElement(Text12, { color: "white" }, tempModelOverride || activeModel), /* @__PURE__ */ React12.createElement(Text12, { color: "gray", bold: true }, " ]"))), /* @__PURE__ */ React12.createElement(
|
|
7805
|
+
Box12,
|
|
7507
7806
|
{
|
|
7508
7807
|
borderStyle: "round",
|
|
7509
7808
|
borderColor: isProcessing ? "magenta" : "cyan",
|
|
@@ -7511,7 +7810,7 @@ Selection: ${val}`,
|
|
|
7511
7810
|
paddingY: 0,
|
|
7512
7811
|
width: "100%"
|
|
7513
7812
|
},
|
|
7514
|
-
/* @__PURE__ */
|
|
7813
|
+
/* @__PURE__ */ React12.createElement(Box12, { flexDirection: "column", width: "100%" }, maxLines > 2 && !isExpanded ? /* @__PURE__ */ React12.createElement(Box12, { flexDirection: "row", width: "100%", paddingY: 0, height: 1, overflow: "hidden" }, /* @__PURE__ */ React12.createElement(Box12, { flexShrink: 0, width: 4 }, /* @__PURE__ */ React12.createElement(Text12, { color: "cyan", bold: true }, "\u{1F4A0} ")), /* @__PURE__ */ React12.createElement(Box12, { flexGrow: 1, flexDirection: "row" }, /* @__PURE__ */ React12.createElement(Box12, { flexShrink: 0 }, /* @__PURE__ */ React12.createElement(Text12, { color: "magenta", bold: true }, "[PASTED ", maxLines, " LINES]")), /* @__PURE__ */ React12.createElement(Box12, { flexGrow: 1, marginLeft: 1 }, /* @__PURE__ */ React12.createElement(
|
|
7515
7814
|
MultilineInput,
|
|
7516
7815
|
{
|
|
7517
7816
|
value: "",
|
|
@@ -7528,7 +7827,7 @@ Selection: ${val}`,
|
|
|
7528
7827
|
newline: (key) => key.return && key.shift || key.return && key.ctrl || key.return && key.leftAlt || key.return && key.rightAlt
|
|
7529
7828
|
}
|
|
7530
7829
|
}
|
|
7531
|
-
)))) : /* @__PURE__ */
|
|
7830
|
+
)))) : /* @__PURE__ */ React12.createElement(Box12, { flexDirection: "row", width: "100%", paddingY: 0 }, /* @__PURE__ */ React12.createElement(Box12, { flexShrink: 0, width: 4 }, /* @__PURE__ */ React12.createElement(Text12, { color: isProcessing ? "magenta" : "cyan", bold: true }, isProcessing ? "\u2726 " : "\u{1F4A0} ")), /* @__PURE__ */ React12.createElement(Box12, { flexGrow: 1 }, /* @__PURE__ */ React12.createElement(Box12, { flexGrow: 1, position: "relative" }, input === "" && /* @__PURE__ */ React12.createElement(Box12, { position: "absolute", paddingLeft: 0 }, activeCommand && !isTerminalFocused ? /* @__PURE__ */ React12.createElement(Text12, { color: "yellow" }, " Press TAB to interact with terminal...") : activeCommand && isTerminalFocused ? /* @__PURE__ */ React12.createElement(Text12, { color: "yellow", bold: true }, " [ TERMINAL FOCUSED ] Type to interact, press TAB to exit...") : escPressCount === 1 ? /* @__PURE__ */ React12.createElement(Text12, { color: "cyan", bold: true }, " Press ESC again to revert codebase to checkpoint...") : /* @__PURE__ */ React12.createElement(Text12, { 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__ */ React12.createElement(
|
|
7532
7831
|
MultilineInput,
|
|
7533
7832
|
{
|
|
7534
7833
|
focus: !isTerminalFocused,
|
|
@@ -7548,14 +7847,14 @@ Selection: ${val}`,
|
|
|
7548
7847
|
));
|
|
7549
7848
|
}
|
|
7550
7849
|
};
|
|
7551
|
-
return /* @__PURE__ */
|
|
7850
|
+
return /* @__PURE__ */ React12.createElement(Box12, { flexDirection: "column", width: "100%" }, /* @__PURE__ */ React12.createElement(Box12, { flexDirection: "column", width: "100%", flexGrow: 1 }, windowedHistory.items.map((msg, idx) => /* @__PURE__ */ React12.createElement(MessageItem, { key: msg.id || idx, msg, showFullThinking, columns: stdout?.columns || 80 }))), /* @__PURE__ */ React12.createElement(Box12, { flexDirection: "column", padding: 1, width: "100%" }, (activeView === "chat" || ["ask", "approval", "terminalApproval"].includes(activeView)) && /* @__PURE__ */ React12.createElement(Box12, { flexDirection: "column", width: "100%" }, /* @__PURE__ */ React12.createElement(
|
|
7552
7851
|
ChatLayout_default,
|
|
7553
7852
|
{
|
|
7554
7853
|
messages: messages.slice(completedIndex),
|
|
7555
7854
|
showFullThinking,
|
|
7556
7855
|
columns: Math.max(20, (stdout?.columns || 80) - 1)
|
|
7557
7856
|
}
|
|
7558
|
-
), activeCommand && /* @__PURE__ */
|
|
7857
|
+
), activeCommand && /* @__PURE__ */ React12.createElement(Box12, { marginTop: 1 }, /* @__PURE__ */ React12.createElement(TerminalBox, { command: activeCommand, output: execOutput, isFocused: isTerminalFocused }))), isInitializing ? /* @__PURE__ */ React12.createElement(Box12, { borderStyle: "double", borderColor: "magenta", padding: 1, flexShrink: 0 }, /* @__PURE__ */ React12.createElement(Text12, { color: "magenta" }, "\u{1F30A} Starting Flux Flow...")) : !apiKey ? /* @__PURE__ */ React12.createElement(Box12, { borderStyle: "round", borderColor: "gray", padding: 0, flexDirection: "column", flexShrink: 0, width: "100%" }, /* @__PURE__ */ React12.createElement(Box12, { paddingX: 1, marginBottom: 1 }, /* @__PURE__ */ React12.createElement(Text12, { color: "yellow", bold: true }, "\u{1F511}", emojiSpace(2), "API KEY REQUIRED")), /* @__PURE__ */ React12.createElement(Box12, { paddingX: 1, flexDirection: "column" }, /* @__PURE__ */ React12.createElement(Text12, null, "Please enter your Gemini API Key to initialize the agent."), /* @__PURE__ */ React12.createElement(Box12, { marginTop: 1 }, /* @__PURE__ */ React12.createElement(Text12, { color: "cyan", bold: true }, "\u{1F4A0} "), /* @__PURE__ */ React12.createElement(
|
|
7559
7858
|
TextInput3,
|
|
7560
7859
|
{
|
|
7561
7860
|
value: tempKey,
|
|
@@ -7563,7 +7862,7 @@ Selection: ${val}`,
|
|
|
7563
7862
|
onSubmit: handleSetup,
|
|
7564
7863
|
mask: "*"
|
|
7565
7864
|
}
|
|
7566
|
-
))), /* @__PURE__ */
|
|
7865
|
+
))), /* @__PURE__ */ React12.createElement(Box12, { paddingX: 1, marginTop: 1 }, /* @__PURE__ */ React12.createElement(Text12, { color: "gray", dimColor: true, italic: true }, "(Press Enter to confirm and initialize)"))) : renderActiveView(), confirmExit && /* @__PURE__ */ React12.createElement(Box12, { borderStyle: "round", borderColor: "red", paddingX: 2, marginY: 0, width: "100%" }, /* @__PURE__ */ React12.createElement(Text12, { color: "red", bold: true }, "\u{1F534} EXIT CONFIRMATION: "), /* @__PURE__ */ React12.createElement(Text12, { color: "white" }, "Press "), /* @__PURE__ */ React12.createElement(Text12, { color: "red", bold: true }, "CTRL + C"), /* @__PURE__ */ React12.createElement(Text12, { color: "white" }, " again to exit (", exitCountdown, "s). Press "), /* @__PURE__ */ React12.createElement(Text12, { color: "cyan", bold: true }, "ESC"), /* @__PURE__ */ React12.createElement(Text12, { color: "white" }, " to cancel.")), /* @__PURE__ */ React12.createElement(Box12, { flexShrink: 0, width: "100%" }, /* @__PURE__ */ React12.createElement(
|
|
7567
7866
|
StatusBar_default,
|
|
7568
7867
|
{
|
|
7569
7868
|
mode,
|
|
@@ -7580,14 +7879,14 @@ Selection: ${val}`,
|
|
|
7580
7879
|
const agentActiveMs = sessionApiTime + sessionToolTime;
|
|
7581
7880
|
const apiPercent = agentActiveMs > 0 ? (sessionApiTime / agentActiveMs * 100).toFixed(1) : "0.0";
|
|
7582
7881
|
const toolPercent = agentActiveMs > 0 ? (sessionToolTime / agentActiveMs * 100).toFixed(1) : "0.0";
|
|
7583
|
-
return /* @__PURE__ */
|
|
7882
|
+
return /* @__PURE__ */ React12.createElement(Box12, { flexDirection: "column", borderStyle: "round", paddingX: 3, paddingY: 1, borderColor: "red", width: Math.min(100, (stdout?.columns || 100) - 2), marginTop: 1 }, /* @__PURE__ */ React12.createElement(Box12, { marginBottom: 1 }, /* @__PURE__ */ React12.createElement(Text12, { color: "cyan", bold: true }, "Agent powering down. ", /* @__PURE__ */ React12.createElement(Text12, { color: "magenta" }, "Goodbye!"))), /* @__PURE__ */ React12.createElement(Box12, { flexDirection: "column" }, /* @__PURE__ */ React12.createElement(Text12, { color: "white", bold: true, underline: true }, "Interaction Summary"), /* @__PURE__ */ React12.createElement(Box12, { marginTop: 1 }, /* @__PURE__ */ React12.createElement(Box12, { width: 20 }, /* @__PURE__ */ React12.createElement(Text12, { color: "blue" }, "Session ID:")), /* @__PURE__ */ React12.createElement(Text12, { color: "white" }, chatId)), /* @__PURE__ */ React12.createElement(Box12, null, /* @__PURE__ */ React12.createElement(Box12, { width: 20 }, /* @__PURE__ */ React12.createElement(Text12, { color: "blue" }, "Tool Calls:")), /* @__PURE__ */ React12.createElement(Text12, { color: "white" }, sessionToolSuccess + sessionToolFailure + sessionToolDenied, " ( ", /* @__PURE__ */ React12.createElement(Text12, { color: "green" }, "\u2713 ", sessionToolSuccess), " ", /* @__PURE__ */ React12.createElement(Text12, { color: "yellow" }, "\u2298 ", sessionToolDenied), " ", /* @__PURE__ */ React12.createElement(Text12, { color: "red" }, "\u2715 ", sessionToolFailure), " )")), /* @__PURE__ */ React12.createElement(Box12, null, /* @__PURE__ */ React12.createElement(Box12, { width: 20 }, /* @__PURE__ */ React12.createElement(Text12, { color: "blue" }, "Success Rate:")), /* @__PURE__ */ React12.createElement(Text12, { color: "white" }, successRate, "%")), /* @__PURE__ */ React12.createElement(Box12, null, /* @__PURE__ */ React12.createElement(Box12, { width: 20 }, /* @__PURE__ */ React12.createElement(Text12, { color: "blue" }, "Tokens Consumed:")), /* @__PURE__ */ React12.createElement(Text12, { color: "white" }, formatTokens(sessionTotalTokens))), /* @__PURE__ */ React12.createElement(Box12, null, /* @__PURE__ */ React12.createElement(Box12, { width: 20 }, /* @__PURE__ */ React12.createElement(Text12, { color: "blue" }, "Images Made:")), /* @__PURE__ */ React12.createElement(Text12, { color: "white" }, sessionImageCount || 0)), /* @__PURE__ */ React12.createElement(Box12, null, /* @__PURE__ */ React12.createElement(Box12, { width: 20 }, /* @__PURE__ */ React12.createElement(Text12, { color: "blue" }, "Image Credits:")), /* @__PURE__ */ React12.createElement(Text12, { color: "white" }, Number(((sessionImageCredits || 0) * 1e3).toFixed(0)), " credits"))), /* @__PURE__ */ React12.createElement(Box12, { flexDirection: "column", marginTop: 1 }, /* @__PURE__ */ React12.createElement(Text12, { color: "white", bold: true, underline: true }, "Performance"), /* @__PURE__ */ React12.createElement(Box12, { marginTop: 1 }, /* @__PURE__ */ React12.createElement(Box12, { width: 20 }, /* @__PURE__ */ React12.createElement(Text12, { color: "blue" }, "Wall Time:")), /* @__PURE__ */ React12.createElement(Text12, { color: "white" }, formatMsDuration(wallTimeMs))), /* @__PURE__ */ React12.createElement(Box12, null, /* @__PURE__ */ React12.createElement(Box12, { width: 20 }, /* @__PURE__ */ React12.createElement(Text12, { color: "blue" }, "Agent Active:")), /* @__PURE__ */ React12.createElement(Text12, { color: "white" }, formatMsDuration(agentActiveMs))), /* @__PURE__ */ React12.createElement(Box12, { marginLeft: 2 }, /* @__PURE__ */ React12.createElement(Box12, { width: 18 }, /* @__PURE__ */ React12.createElement(Text12, { color: "blue", dimColor: true }, "\xBB API Time:")), /* @__PURE__ */ React12.createElement(Text12, { color: "white" }, formatMsDuration(sessionApiTime), " (", apiPercent, "%)")), /* @__PURE__ */ React12.createElement(Box12, { marginLeft: 2 }, /* @__PURE__ */ React12.createElement(Box12, { width: 18 }, /* @__PURE__ */ React12.createElement(Text12, { color: "blue", dimColor: true }, "\xBB Tool Time:")), /* @__PURE__ */ React12.createElement(Text12, { color: "white" }, formatMsDuration(sessionToolTime), " (", toolPercent, "%)"))));
|
|
7584
7883
|
})(), suggestions.length > 0 && (() => {
|
|
7585
7884
|
const windowSize = 5;
|
|
7586
7885
|
const startIdx = Math.max(0, Math.min(selectedIndex - 2, suggestions.length - windowSize));
|
|
7587
7886
|
const visible = suggestions.slice(startIdx, startIdx + windowSize);
|
|
7588
7887
|
const remaining = suggestions.length - (startIdx + visible.length);
|
|
7589
|
-
return /* @__PURE__ */
|
|
7590
|
-
|
|
7888
|
+
return /* @__PURE__ */ React12.createElement(
|
|
7889
|
+
Box12,
|
|
7591
7890
|
{
|
|
7592
7891
|
flexDirection: "column",
|
|
7593
7892
|
borderStyle: "round",
|
|
@@ -7596,22 +7895,22 @@ Selection: ${val}`,
|
|
|
7596
7895
|
paddingY: 0,
|
|
7597
7896
|
width: "100%"
|
|
7598
7897
|
},
|
|
7599
|
-
/* @__PURE__ */
|
|
7898
|
+
/* @__PURE__ */ React12.createElement(Box12, { paddingX: 1, marginBottom: 0 }, /* @__PURE__ */ React12.createElement(Text12, { color: "gray", bold: true, dimColor: true }, "\u{1F50D} COMMAND SUGGESTIONS")),
|
|
7600
7899
|
visible.map((s, i) => {
|
|
7601
7900
|
const actualIdx = startIdx + i;
|
|
7602
7901
|
const isActive = actualIdx === selectedIndex;
|
|
7603
7902
|
const isGemmaDisabled = s.cmd === "gemma-4-31b-it" && apiTier !== "Free";
|
|
7604
|
-
return /* @__PURE__ */
|
|
7605
|
-
|
|
7903
|
+
return /* @__PURE__ */ React12.createElement(
|
|
7904
|
+
Box12,
|
|
7606
7905
|
{
|
|
7607
7906
|
key: s.cmd,
|
|
7608
7907
|
flexDirection: "row",
|
|
7609
7908
|
backgroundColor: isActive ? "#2a2a2a" : void 0,
|
|
7610
7909
|
paddingX: 1
|
|
7611
7910
|
},
|
|
7612
|
-
/* @__PURE__ */
|
|
7613
|
-
/* @__PURE__ */
|
|
7614
|
-
|
|
7911
|
+
/* @__PURE__ */ React12.createElement(Box12, { width: 3 }, /* @__PURE__ */ React12.createElement(Text12, { color: isActive ? "cyan" : "gray", bold: isActive }, isActive ? " \u276F" : " ")),
|
|
7912
|
+
/* @__PURE__ */ React12.createElement(Box12, { width: 32 }, /* @__PURE__ */ React12.createElement(
|
|
7913
|
+
Text12,
|
|
7615
7914
|
{
|
|
7616
7915
|
color: isGemmaDisabled ? "gray" : isActive ? "yellow" : "white",
|
|
7617
7916
|
bold: isActive,
|
|
@@ -7619,10 +7918,10 @@ Selection: ${val}`,
|
|
|
7619
7918
|
},
|
|
7620
7919
|
s.cmd
|
|
7621
7920
|
)),
|
|
7622
|
-
/* @__PURE__ */
|
|
7921
|
+
/* @__PURE__ */ React12.createElement(Box12, { flexGrow: 1 }, /* @__PURE__ */ React12.createElement(Text12, { color: "gray", italic: true, dimColor: !isActive }, s.desc))
|
|
7623
7922
|
);
|
|
7624
7923
|
}),
|
|
7625
|
-
suggestions.length > 5 && /* @__PURE__ */
|
|
7924
|
+
suggestions.length > 5 && /* @__PURE__ */ React12.createElement(Box12, { paddingX: 1, height: 1 }, remaining > 0 ? /* @__PURE__ */ React12.createElement(Text12, { color: "gray", dimColor: true, italic: true }, " ... (", remaining, " more commands available)") : /* @__PURE__ */ React12.createElement(Text12, { color: "gray", dimColor: true, italic: true }, " (End of list)"))
|
|
7626
7925
|
);
|
|
7627
7926
|
})()));
|
|
7628
7927
|
}
|
|
@@ -7632,6 +7931,7 @@ var init_app = __esm({
|
|
|
7632
7931
|
init_ChatLayout();
|
|
7633
7932
|
init_StatusBar();
|
|
7634
7933
|
init_CommandMenu();
|
|
7934
|
+
init_SettingsMenu();
|
|
7635
7935
|
init_ProfileForm();
|
|
7636
7936
|
init_AskUserModal();
|
|
7637
7937
|
init_secrets();
|
|
@@ -7657,7 +7957,7 @@ var init_app = __esm({
|
|
|
7657
7957
|
packageJson = JSON.parse(fs18.readFileSync(packageJsonPath, "utf8"));
|
|
7658
7958
|
versionFluxflow = packageJson.version;
|
|
7659
7959
|
updatedOn = packageJson.date || "2026-05-20";
|
|
7660
|
-
ResolutionModal = ({ data, onResolve, onEdit }) => /* @__PURE__ */
|
|
7960
|
+
ResolutionModal = ({ data, onResolve, onEdit }) => /* @__PURE__ */ React12.createElement(Box12, { flexDirection: "column", borderStyle: "round", borderColor: "gray", padding: 0, width: "100%" }, /* @__PURE__ */ React12.createElement(Box12, { paddingX: 1 }, /* @__PURE__ */ React12.createElement(Text12, { color: "magenta", bold: true, underline: true }, "\u{1F7E3} STEERING HINT RESOLUTION")), /* @__PURE__ */ React12.createElement(Box12, { paddingX: 1, marginTop: 1 }, /* @__PURE__ */ React12.createElement(Text12, null, "The agent already finished the task before your hint was consumed.")), /* @__PURE__ */ React12.createElement(Box12, { marginTop: 1, backgroundColor: "#222", paddingX: 2, width: "100%" }, /* @__PURE__ */ React12.createElement(Text12, { italic: true, color: "gray" }, '"', data, '"')), /* @__PURE__ */ React12.createElement(Box12, { paddingX: 1, marginTop: 1 }, /* @__PURE__ */ React12.createElement(Text12, { color: "cyan" }, "How would you like to proceed?")), /* @__PURE__ */ React12.createElement(Box12, { marginTop: 0 }, /* @__PURE__ */ React12.createElement(
|
|
7661
7961
|
CommandMenu,
|
|
7662
7962
|
{
|
|
7663
7963
|
title: "Select Action",
|
|
@@ -7760,7 +8060,7 @@ if (isBundled && !process.execArgv.some((arg) => arg.includes("max-old-space-siz
|
|
|
7760
8060
|
], { stdio: "inherit" });
|
|
7761
8061
|
cp.on("exit", (code) => process.exit(code || 0));
|
|
7762
8062
|
} else {
|
|
7763
|
-
const { default:
|
|
8063
|
+
const { default: React13 } = await import("react");
|
|
7764
8064
|
const { render } = await import("ink");
|
|
7765
8065
|
const { default: App2 } = await Promise.resolve().then(() => (init_app(), app_exports));
|
|
7766
8066
|
process.env.NODE_NO_WARNINGS = "1";
|
|
@@ -7783,5 +8083,5 @@ if (isBundled && !process.execArgv.some((arg) => arg.includes("max-old-space-siz
|
|
|
7783
8083
|
console.warn = (...args) => !isNoise(args) && originalWarn(...args);
|
|
7784
8084
|
console.error = (...args) => !isNoise(args) && originalError(...args);
|
|
7785
8085
|
process.stdout.write("\x1Bc");
|
|
7786
|
-
render(/* @__PURE__ */
|
|
8086
|
+
render(/* @__PURE__ */ React13.createElement(App2, { args: process.argv.slice(2) }), { exitOnCtrlC: false });
|
|
7787
8087
|
}
|