fluxflow-cli 1.16.0 → 1.16.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/fluxflow.js +211 -65
- package/package.json +2 -2
package/dist/fluxflow.js
CHANGED
|
@@ -138,7 +138,7 @@ var init_terminal = __esm({
|
|
|
138
138
|
// src/components/ChatLayout.jsx
|
|
139
139
|
import React2, { useState, useEffect, useRef } from "react";
|
|
140
140
|
import { Box as Box2, Text as Text2 } from "ink";
|
|
141
|
-
var TOOL_LABELS, cleanSignals, formatThinkText, parseMathSymbols, InlineMarkdown, TableRenderer, MarkdownText, DiffLine, DiffBlock, CodeRenderer, MessageItem, ChatLayout, ChatLayout_default;
|
|
141
|
+
var TOOL_LABELS, cleanSignals, formatThinkText, parseMathSymbols, InlineMarkdown, TableRenderer, MarkdownText, DiffLine, DiffBlock, CodeRenderer, formatThinkingDuration, MessageItem, ChatLayout, ChatLayout_default;
|
|
142
142
|
var init_ChatLayout = __esm({
|
|
143
143
|
"src/components/ChatLayout.jsx"() {
|
|
144
144
|
init_TerminalBox();
|
|
@@ -421,6 +421,16 @@ var init_ChatLayout = __esm({
|
|
|
421
421
|
}
|
|
422
422
|
return /* @__PURE__ */ React2.createElement(MarkdownText, { text, columns });
|
|
423
423
|
});
|
|
424
|
+
formatThinkingDuration = (ms) => {
|
|
425
|
+
const totalSecs = Math.round(ms / 1e3);
|
|
426
|
+
if (totalSecs <= 0) return "0s";
|
|
427
|
+
const m = Math.floor(totalSecs / 60);
|
|
428
|
+
const s = totalSecs % 60;
|
|
429
|
+
if (m > 0) {
|
|
430
|
+
return `${m}m ${s}s`;
|
|
431
|
+
}
|
|
432
|
+
return `${totalSecs}s`;
|
|
433
|
+
};
|
|
424
434
|
MessageItem = React2.memo(({ msg, showFullThinking, columns = 80 }) => {
|
|
425
435
|
const isDiffResult = msg.role === "system" && (msg.text?.includes("[DIFF_START]") || msg.text?.includes("- Content Preview:"));
|
|
426
436
|
const isPatchError = msg.role === "system" && msg.text?.includes("[TOOL RESULT]: ERROR:") && (msg.toolName === "update_file" || msg.text?.includes("Could not find exact match"));
|
|
@@ -520,7 +530,7 @@ var init_ChatLayout = __esm({
|
|
|
520
530
|
finalContent.replace(/\r\n/g, "\n").replace(/\r/g, "\n").replace(/\\\n/g, "\n").replace(/\\$/, ""),
|
|
521
531
|
columns - 6
|
|
522
532
|
).split("\n").map((line, lineIdx) => /* @__PURE__ */ React2.createElement(Box2, { key: lineIdx, flexDirection: "row", width: "100%" }, /* @__PURE__ */ React2.createElement(Box2, { flexShrink: 0, width: 2 }, /* @__PURE__ */ React2.createElement(Text2, { bold: true, color: "white" }, lineIdx === 0 ? "\u276F" : " ")), /* @__PURE__ */ React2.createElement(Box2, { flexGrow: 1, marginLeft: 1 }, /* @__PURE__ */ React2.createElement(Text2, { color: msg.color || "white", wrap: "anywhere" }, line))))
|
|
523
|
-
) : msg.role === "think" ? /* @__PURE__ */ React2.createElement(Box2, { flexDirection: "column", marginTop: 0, marginBottom: 0, paddingX: 1, width: "100%" }, /* @__PURE__ */ React2.createElement(Text2, { bold: true, color: "white" }, "Thinking..."), /* @__PURE__ */ React2.createElement(Box2, { borderStyle: "single", borderLeft: true, borderRight: false, borderTop: false, borderBottom: false, paddingLeft: 2, paddingTop: 1, paddingBottom: 1, flexDirection: "column", width: "100%" }, formatThinkText(finalContent, columns))) : /* @__PURE__ */ React2.createElement(Box2, { flexDirection: "column", paddingX: 1, marginTop: 0, width: "100%" }, /* @__PURE__ */ React2.createElement(CodeRenderer, { text: finalContent.replace(/ \|\n\n/g, " |\n"), columns }), msg.memoryUpdated && /* @__PURE__ */ React2.createElement(Box2, { marginTop: 1, width: "100%" }, /* @__PURE__ */ React2.createElement(Text2, { color: "yellow", italic: true }, "\u2728 [Memory Updated]"))))
|
|
533
|
+
) : msg.role === "think" ? /* @__PURE__ */ React2.createElement(Box2, { flexDirection: "column", marginTop: 0, marginBottom: 0, paddingX: 1, width: "100%" }, msg.isStreaming && !msg.duration ? /* @__PURE__ */ React2.createElement(Text2, { bold: true, color: "white" }, "\u2727 Thinking...") : /* @__PURE__ */ React2.createElement(Text2, { bold: true, color: "white" }, "\u2726 Thought", msg.duration ? /* @__PURE__ */ React2.createElement(Text2, { dimColor: true, color: "gray" }, " for ", /* @__PURE__ */ React2.createElement(Text2, { bold: true, color: "cyan" }, formatThinkingDuration(msg.duration))) : ""), /* @__PURE__ */ React2.createElement(Box2, { borderStyle: "single", borderLeft: true, borderRight: false, borderTop: false, borderBottom: false, paddingLeft: 2, paddingTop: 1, paddingBottom: 1, flexDirection: "column", width: "100%" }, formatThinkText(finalContent, columns))) : /* @__PURE__ */ React2.createElement(Box2, { flexDirection: "column", paddingX: 1, marginTop: 0, width: "100%" }, /* @__PURE__ */ React2.createElement(CodeRenderer, { text: finalContent.replace(/ \|\n\n/g, " |\n"), columns }), msg.memoryUpdated && /* @__PURE__ */ React2.createElement(Box2, { marginTop: 1, width: "100%" }, /* @__PURE__ */ React2.createElement(Text2, { color: "yellow", italic: true }, "\u2728 [Memory Updated]"))))
|
|
524
534
|
);
|
|
525
535
|
});
|
|
526
536
|
ChatLayout = React2.memo(({ messages, showFullThinking, columns = 80 }) => {
|
|
@@ -619,6 +629,7 @@ var init_CommandMenu = __esm({
|
|
|
619
629
|
// src/components/SettingsMenu.jsx
|
|
620
630
|
import React5, { useState as useState2 } from "react";
|
|
621
631
|
import { Box as Box5, Text as Text5, useInput } from "ink";
|
|
632
|
+
import TextInput from "ink-text-input";
|
|
622
633
|
function SettingsMenu({
|
|
623
634
|
systemSettings,
|
|
624
635
|
setSystemSettings,
|
|
@@ -632,6 +643,8 @@ function SettingsMenu({
|
|
|
632
643
|
const [activeColumn, setActiveColumn] = useState2("categories");
|
|
633
644
|
const [selectedCategoryIndex, setSelectedCategoryIndex] = useState2(0);
|
|
634
645
|
const [selectedItemIndex, setSelectedItemIndex] = useState2(0);
|
|
646
|
+
const [editingItem, setEditingItem] = useState2(null);
|
|
647
|
+
const [editValue, setEditValue] = useState2("");
|
|
635
648
|
const getCategoryItems = (catId) => {
|
|
636
649
|
switch (catId) {
|
|
637
650
|
case "memory":
|
|
@@ -645,8 +658,9 @@ function SettingsMenu({
|
|
|
645
658
|
{ label: "Auto Execute", value: "autoExec", status: systemSettings.autoExec ? "ON" : "OFF", section: "Sandbox" },
|
|
646
659
|
{ label: "External Workspace Access", value: "externalAccess", status: systemSettings.allowExternalAccess ? "ON" : "OFF", section: "Sandbox" },
|
|
647
660
|
{ label: "Network Access (Terminal)", value: "networkAccess", status: systemSettings.networkAccess !== false ? "ON" : "OFF", section: "Sandbox" },
|
|
648
|
-
{ label: "
|
|
649
|
-
{ label: "Auto
|
|
661
|
+
{ label: "Always Ask Commands", value: "alwaysAsk", status: truncateCSV(systemSettings.alwaysAskCommands), section: "Sandbox" },
|
|
662
|
+
{ label: "Auto Approve Commands", value: "autoApprove", status: truncateCSV(systemSettings.autoApproveCommands), section: "Sandbox" },
|
|
663
|
+
{ label: "Auto Disapprove Commands", value: "autoDisallow", status: truncateCSV(systemSettings.autoDisallowCommands), section: "Sandbox" },
|
|
650
664
|
{ label: "Auto Approve Git Commits", value: "autoApproveGit", status: systemSettings.autoApproveGit ? "ON" : "OFF", section: "Sandbox" },
|
|
651
665
|
{ label: "Auto-Delete History", value: "autoDelete", status: systemSettings.autoDeleteHistory || "30d", section: "Other" },
|
|
652
666
|
{ label: "Save AppData Externally", value: "externalData", status: systemSettings.useExternalData ? "ON" : "OFF", section: "Other" }
|
|
@@ -667,6 +681,12 @@ function SettingsMenu({
|
|
|
667
681
|
const currentCatId = CATEGORIES[selectedCategoryIndex].id;
|
|
668
682
|
const currentItems = getCategoryItems(currentCatId);
|
|
669
683
|
useInput((input, key) => {
|
|
684
|
+
if (editingItem) {
|
|
685
|
+
if (key.escape) {
|
|
686
|
+
setEditingItem(null);
|
|
687
|
+
}
|
|
688
|
+
return;
|
|
689
|
+
}
|
|
670
690
|
if (activeColumn === "categories") {
|
|
671
691
|
if (key.upArrow) {
|
|
672
692
|
setSelectedCategoryIndex((prev) => (prev - 1 + CATEGORIES.length) % CATEGORIES.length);
|
|
@@ -680,6 +700,8 @@ function SettingsMenu({
|
|
|
680
700
|
setActiveColumn("items");
|
|
681
701
|
setSelectedItemIndex(0);
|
|
682
702
|
}
|
|
703
|
+
} else if (key.escape) {
|
|
704
|
+
setActiveView("chat");
|
|
683
705
|
}
|
|
684
706
|
} else if (activeColumn === "items") {
|
|
685
707
|
if (key.upArrow) {
|
|
@@ -709,22 +731,25 @@ function SettingsMenu({
|
|
|
709
731
|
updated.autoExec = false;
|
|
710
732
|
updated.allowExternalAccess = false;
|
|
711
733
|
updated.networkAccess = false;
|
|
712
|
-
updated.autoApproveCommands = "
|
|
713
|
-
updated.autoDisallowCommands = "
|
|
734
|
+
updated.autoApproveCommands = "";
|
|
735
|
+
updated.autoDisallowCommands = "rm -rf, rm -f, del /f, rd /s, rmdir /s, format";
|
|
736
|
+
updated.alwaysAskCommands = "";
|
|
714
737
|
updated.autoApproveGit = false;
|
|
715
738
|
} else if (nextPreset === "Balanced") {
|
|
716
739
|
updated.autoExec = true;
|
|
717
740
|
updated.allowExternalAccess = false;
|
|
718
741
|
updated.networkAccess = true;
|
|
719
|
-
updated.autoApproveCommands = "
|
|
720
|
-
updated.autoDisallowCommands = "
|
|
742
|
+
updated.autoApproveCommands = "ls, dir, cat, type, echo, pwd, cd, git status, git log, git diff, help, mkdir, touch, md";
|
|
743
|
+
updated.autoDisallowCommands = "rm -rf, rm -f, del /f, rd /s, rmdir /s, format";
|
|
744
|
+
updated.alwaysAskCommands = "";
|
|
721
745
|
updated.autoApproveGit = false;
|
|
722
746
|
} else if (nextPreset === "Autonomous") {
|
|
723
747
|
updated.autoExec = true;
|
|
724
748
|
updated.allowExternalAccess = true;
|
|
725
749
|
updated.networkAccess = true;
|
|
726
|
-
updated.autoApproveCommands = "
|
|
727
|
-
updated.autoDisallowCommands = "
|
|
750
|
+
updated.autoApproveCommands = "";
|
|
751
|
+
updated.autoDisallowCommands = "";
|
|
752
|
+
updated.alwaysAskCommands = "";
|
|
728
753
|
updated.autoApproveGit = true;
|
|
729
754
|
}
|
|
730
755
|
return updated;
|
|
@@ -751,18 +776,17 @@ function SettingsMenu({
|
|
|
751
776
|
}
|
|
752
777
|
} else if (item.value === "networkAccess") {
|
|
753
778
|
setSystemSettings((s) => ({ ...s, networkAccess: s.networkAccess === false, sandboxPreset: "Custom" }));
|
|
779
|
+
} else if (item.value === "alwaysAsk") {
|
|
780
|
+
setEditingItem("alwaysAskCommands");
|
|
781
|
+
setEditValue(systemSettings.alwaysAskCommands || "");
|
|
754
782
|
} else if (item.value === "autoApprove") {
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
const nextIndex = (curIndex + 1) % approveOptions.length;
|
|
758
|
-
setSystemSettings((s) => ({ ...s, autoApproveCommands: approveOptions[nextIndex], sandboxPreset: "Custom" }));
|
|
783
|
+
setEditingItem("autoApproveCommands");
|
|
784
|
+
setEditValue(systemSettings.autoApproveCommands || "");
|
|
759
785
|
} else if (item.value === "autoApproveGit") {
|
|
760
786
|
setSystemSettings((s) => ({ ...s, autoApproveGit: !s.autoApproveGit, sandboxPreset: "Custom" }));
|
|
761
787
|
} else if (item.value === "autoDisallow") {
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
const nextIndex = (curIndex + 1) % disallowOptions.length;
|
|
765
|
-
setSystemSettings((s) => ({ ...s, autoDisallowCommands: disallowOptions[nextIndex], sandboxPreset: "Custom" }));
|
|
788
|
+
setEditingItem("autoDisallowCommands");
|
|
789
|
+
setEditValue(systemSettings.autoDisallowCommands || "");
|
|
766
790
|
} else if (item.value === "apiTier") {
|
|
767
791
|
setActiveView("apiTier");
|
|
768
792
|
} else if (item.value === "autoDelete") {
|
|
@@ -816,6 +840,13 @@ function SettingsMenu({
|
|
|
816
840
|
})), /* @__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
841
|
let lastSection = null;
|
|
818
842
|
const elements = [];
|
|
843
|
+
const getListItems = (val) => (val || "").split(",").map((s) => s.trim().toLowerCase()).filter(Boolean);
|
|
844
|
+
const approveList = getListItems(systemSettings.autoApproveCommands);
|
|
845
|
+
const disallowList = getListItems(systemSettings.autoDisallowCommands);
|
|
846
|
+
const askList = getListItems(systemSettings.alwaysAskCommands);
|
|
847
|
+
const allLists = [...approveList, ...disallowList, ...askList];
|
|
848
|
+
const uniqueLists = new Set(allLists);
|
|
849
|
+
const hasConflict = currentCatId === "security" && allLists.length !== uniqueLists.size;
|
|
819
850
|
currentItems.forEach((item, index) => {
|
|
820
851
|
const isSelected = activeColumn === "items" && selectedItemIndex === index;
|
|
821
852
|
const labelLength = item.label.length;
|
|
@@ -836,8 +867,10 @@ function SettingsMenu({
|
|
|
836
867
|
/* @__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
868
|
);
|
|
838
869
|
}
|
|
870
|
+
const isEditingThis = isSelected && editingItem && (editingItem === "alwaysAskCommands" && item.value === "alwaysAsk" || editingItem === "autoApproveCommands" && item.value === "autoApprove" || editingItem === "autoDisallowCommands" && item.value === "autoDisallow");
|
|
871
|
+
const isCommandListItem = item.value === "alwaysAsk" || item.value === "autoApprove" || item.value === "autoDisallow";
|
|
839
872
|
elements.push(
|
|
840
|
-
/* @__PURE__ */ React5.createElement(Box5, { key: item.value, backgroundColor: isSelected ? "#2a2a2a" : void 0, paddingX: 2 }, /* @__PURE__ */ React5.createElement(
|
|
873
|
+
/* @__PURE__ */ React5.createElement(Box5, { key: item.value, flexDirection: "column" }, /* @__PURE__ */ React5.createElement(Box5, { backgroundColor: isSelected && !isEditingThis ? "#2a2a2a" : void 0, paddingX: 2 }, /* @__PURE__ */ React5.createElement(
|
|
841
874
|
Text5,
|
|
842
875
|
{
|
|
843
876
|
color: isSelected ? "cyan" : "white",
|
|
@@ -845,13 +878,30 @@ function SettingsMenu({
|
|
|
845
878
|
},
|
|
846
879
|
isSelected ? "\u276F " : " ",
|
|
847
880
|
item.label
|
|
848
|
-
), /* @__PURE__ */ React5.createElement(Text5, { color: "gray", dimColor: true }, dots), /* @__PURE__ */ React5.createElement(Text5, { color: getStatusColor(item), bold: true }, "[ ", item.status, " ]"))
|
|
881
|
+
), !isCommandListItem && /* @__PURE__ */ React5.createElement(React5.Fragment, null, /* @__PURE__ */ React5.createElement(Text5, { color: "gray", dimColor: true }, dots), /* @__PURE__ */ React5.createElement(Text5, { color: getStatusColor(item), bold: true }, "[ ", item.status, " ]"))), isCommandListItem && !isEditingThis && item.status !== "None" && /* @__PURE__ */ React5.createElement(Box5, { paddingX: 4, marginBottom: 1 }, /* @__PURE__ */ React5.createElement(Text5, { color: "gray", dimColor: true }, "\u21B3 ", item.status)), isEditingThis && /* @__PURE__ */ React5.createElement(Box5, { flexDirection: "column", marginLeft: 4, marginBottom: 1 }, /* @__PURE__ */ React5.createElement(Box5, { paddingX: 1, borderStyle: "single", borderColor: "cyan", flexDirection: "row" }, /* @__PURE__ */ React5.createElement(Text5, { color: "cyan", bold: true }, "> ", " "), /* @__PURE__ */ React5.createElement(
|
|
882
|
+
TextInput,
|
|
883
|
+
{
|
|
884
|
+
value: editValue,
|
|
885
|
+
onChange: setEditValue,
|
|
886
|
+
onSubmit: (val) => {
|
|
887
|
+
const newSysSettings = { ...systemSettings, [editingItem]: val.trim(), sandboxPreset: "Custom" };
|
|
888
|
+
setSystemSettings(newSysSettings);
|
|
889
|
+
saveSettings2({ systemSettings: newSysSettings, apiTier, quotas });
|
|
890
|
+
setEditingItem(null);
|
|
891
|
+
}
|
|
892
|
+
}
|
|
893
|
+
)), /* @__PURE__ */ React5.createElement(Text5, { color: "gray", dimColor: true, italic: true }, " Comma separated \u2022 Press Enter to save, Esc to cancel")))
|
|
849
894
|
);
|
|
850
895
|
});
|
|
896
|
+
if (hasConflict) {
|
|
897
|
+
elements.push(
|
|
898
|
+
/* @__PURE__ */ React5.createElement(Box5, { key: "conflict-warning", marginTop: 1, paddingX: 1 }, /* @__PURE__ */ React5.createElement(Text5, { color: "red", dimColor: true, italic: true }, "* Conflicting commands will be ignored and defaulted to highest priority"))
|
|
899
|
+
);
|
|
900
|
+
}
|
|
851
901
|
return elements;
|
|
852
902
|
})() : /* @__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
903
|
}
|
|
854
|
-
var CATEGORIES, getActivePreset;
|
|
904
|
+
var CATEGORIES, getActivePreset, truncateCSV;
|
|
855
905
|
var init_SettingsMenu = __esm({
|
|
856
906
|
"src/components/SettingsMenu.jsx"() {
|
|
857
907
|
CATEGORIES = [
|
|
@@ -862,15 +912,21 @@ var init_SettingsMenu = __esm({
|
|
|
862
912
|
{ id: "exit", label: "\u{1F6AA} Exit Settings", desc: "Return to chat view" }
|
|
863
913
|
];
|
|
864
914
|
getActivePreset = (settings) => {
|
|
865
|
-
const approve = settings.autoApproveCommands || "
|
|
866
|
-
const disallow = settings.autoDisallowCommands || "
|
|
867
|
-
const
|
|
868
|
-
const
|
|
869
|
-
const
|
|
915
|
+
const approve = settings.autoApproveCommands || "";
|
|
916
|
+
const disallow = settings.autoDisallowCommands || "";
|
|
917
|
+
const alwaysAsk = settings.alwaysAskCommands || "";
|
|
918
|
+
const isStrict = settings.autoExec === false && settings.allowExternalAccess === false && settings.networkAccess === false && approve === "" && disallow === "rm -rf, rm -f, del /f, rd /s, rmdir /s, format" && alwaysAsk === "" && settings.autoApproveGit === false;
|
|
919
|
+
const isBalanced = settings.autoExec === true && settings.allowExternalAccess === false && settings.networkAccess !== false && approve === "ls, dir, cat, type, echo, pwd, cd, git status, git log, git diff, help, mkdir, touch, md" && disallow === "rm -rf, rm -f, del /f, rd /s, rmdir /s, format" && alwaysAsk === "" && settings.autoApproveGit === false;
|
|
920
|
+
const isAutonomous = settings.autoExec === true && settings.allowExternalAccess === true && settings.networkAccess !== false && approve === "" && disallow === "" && alwaysAsk === "" && settings.autoApproveGit === true;
|
|
870
921
|
if (isStrict) return "Strict";
|
|
871
922
|
if (isBalanced) return "Balanced";
|
|
872
923
|
if (isAutonomous) return "Autonomous";
|
|
873
|
-
return settings.sandboxPreset || "
|
|
924
|
+
return settings.sandboxPreset || "Custom";
|
|
925
|
+
};
|
|
926
|
+
truncateCSV = (val) => {
|
|
927
|
+
if (!val || val.trim() === "") return "None";
|
|
928
|
+
if (val.length > 20) return val.substring(0, 17) + "...";
|
|
929
|
+
return val;
|
|
874
930
|
};
|
|
875
931
|
}
|
|
876
932
|
});
|
|
@@ -878,7 +934,7 @@ var init_SettingsMenu = __esm({
|
|
|
878
934
|
// src/components/ProfileForm.jsx
|
|
879
935
|
import React6, { useState as useState3, useEffect as useEffect2 } from "react";
|
|
880
936
|
import { Box as Box6, Text as Text6 } from "ink";
|
|
881
|
-
import
|
|
937
|
+
import TextInput2 from "ink-text-input";
|
|
882
938
|
function ProfileForm({ initialData, onSave, onCancel }) {
|
|
883
939
|
const [step, setStep] = useState3(0);
|
|
884
940
|
const [currentInput, setCurrentInput] = useState3("");
|
|
@@ -924,7 +980,7 @@ function ProfileForm({ initialData, onSave, onCancel }) {
|
|
|
924
980
|
},
|
|
925
981
|
/* @__PURE__ */ React6.createElement(Box6, { paddingX: 1, marginBottom: 1 }, /* @__PURE__ */ React6.createElement(Text6, { color: "magenta", bold: true }, "\u{1F464} DEVELOPER PROFILE CONFIGURATION")),
|
|
926
982
|
/* @__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(
|
|
927
|
-
|
|
983
|
+
TextInput2,
|
|
928
984
|
{
|
|
929
985
|
value: currentInput,
|
|
930
986
|
onChange: setCurrentInput,
|
|
@@ -942,7 +998,7 @@ var init_ProfileForm = __esm({
|
|
|
942
998
|
// src/components/AskUserModal.jsx
|
|
943
999
|
import React7, { useState as useState4 } from "react";
|
|
944
1000
|
import { Box as Box7, Text as Text7, useInput as useInput2 } from "ink";
|
|
945
|
-
import
|
|
1001
|
+
import TextInput3 from "ink-text-input";
|
|
946
1002
|
var AskUserModal, AskUserModal_default;
|
|
947
1003
|
var init_AskUserModal = __esm({
|
|
948
1004
|
"src/components/AskUserModal.jsx"() {
|
|
@@ -972,7 +1028,7 @@ var init_AskUserModal = __esm({
|
|
|
972
1028
|
const s = emojiSpace(2);
|
|
973
1029
|
if (isSuggestingElse) {
|
|
974
1030
|
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(
|
|
975
|
-
|
|
1031
|
+
TextInput3,
|
|
976
1032
|
{
|
|
977
1033
|
value: customInput,
|
|
978
1034
|
onChange: setCustomInput,
|
|
@@ -1831,6 +1887,8 @@ var init_usage = __esm({
|
|
|
1831
1887
|
toolDenied: 0,
|
|
1832
1888
|
duration: 0,
|
|
1833
1889
|
tokens: 0,
|
|
1890
|
+
linesAdded: 0,
|
|
1891
|
+
linesRemoved: 0,
|
|
1834
1892
|
imageCalls: []
|
|
1835
1893
|
};
|
|
1836
1894
|
loadUsageFromFile = async () => {
|
|
@@ -4976,7 +5034,7 @@ ${thinkingLevel != "Fast" ? "[SYSTEM] **STRICTLY FOLLOW THINKING POLICY AS CORE
|
|
|
4976
5034
|
const action = normToolName === "list_files" ? "LIST" : "ANALYSED";
|
|
4977
5035
|
label = `\u{1F4C2} ${action} FOLDER: ${parseArgs(toolCall.args).path || "."}`.toUpperCase();
|
|
4978
5036
|
} else if (normToolName === "write_file" || normToolName === "update_file") {
|
|
4979
|
-
const action = normToolName === "write_file" ? "WRITTEN" : "
|
|
5037
|
+
const action = normToolName === "write_file" ? "WRITTEN" : "PATCHED";
|
|
4980
5038
|
label = `\u{1F4BE} ${action}: ${parseArgs(toolCall.args).path || "..."}`.toUpperCase();
|
|
4981
5039
|
} else if (normToolName === "write_pdf") {
|
|
4982
5040
|
label = `\u{1F4D1} PDF CREATED: ${parseArgs(toolCall.args).path || "..."}`.toUpperCase();
|
|
@@ -5029,7 +5087,7 @@ ${thinkingLevel != "Fast" ? "[SYSTEM] **STRICTLY FOLLOW THINKING POLICY AS CORE
|
|
|
5029
5087
|
const absoluteTarget = path15.resolve(targetPath);
|
|
5030
5088
|
const absoluteCwd = path15.resolve(process.cwd());
|
|
5031
5089
|
if (isExternalOff && !absoluteTarget.startsWith(absoluteCwd)) {
|
|
5032
|
-
const denyMsg = `Access Denied. You are not allowed to access files outside the current workspace
|
|
5090
|
+
const denyMsg = `Access Denied. You are not allowed to access files outside the current workspace.`;
|
|
5033
5091
|
if (normToolName === "write_file" || normToolName === "update_file") {
|
|
5034
5092
|
const action = normToolName === "write_file" ? "WRITE DENIED" : "UPDATE DENIED";
|
|
5035
5093
|
const deniedLabel = `\u{1F4BE} ${action}: ${parsedArgs.path || "..."}`.toUpperCase();
|
|
@@ -5052,41 +5110,42 @@ ${boxBottom}` };
|
|
|
5052
5110
|
if (shouldPrompt) {
|
|
5053
5111
|
const systemSettings2 = settings.systemSettings || {};
|
|
5054
5112
|
const autoExec = systemSettings2.autoExec;
|
|
5055
|
-
const autoApprove = systemSettings2.autoApproveCommands || "Read-Only";
|
|
5056
|
-
const autoDisallow = systemSettings2.autoDisallowCommands || "Destructive";
|
|
5057
5113
|
let decision = null;
|
|
5114
|
+
let forcePrompt = false;
|
|
5115
|
+
let disallowMatch = false;
|
|
5116
|
+
let isNetworkDeny = false;
|
|
5058
5117
|
if (normToolName === "exec_command") {
|
|
5059
5118
|
const { command } = parseArgs(toolCall.args);
|
|
5060
5119
|
const cmdTrimmed = (command || "").trim();
|
|
5061
|
-
const
|
|
5062
|
-
|
|
5063
|
-
|
|
5064
|
-
|
|
5065
|
-
|
|
5066
|
-
|
|
5067
|
-
|
|
5068
|
-
|
|
5069
|
-
|
|
5120
|
+
const matchesList = (cmd, csv) => {
|
|
5121
|
+
if (!csv) return false;
|
|
5122
|
+
const list = csv.split(",").map((s) => s.trim().toLowerCase()).filter(Boolean);
|
|
5123
|
+
const lowerCmd = cmd.toLowerCase();
|
|
5124
|
+
return list.some((item) => lowerCmd.startsWith(item));
|
|
5125
|
+
};
|
|
5126
|
+
const askMatch = matchesList(cmdTrimmed, systemSettings2.alwaysAskCommands);
|
|
5127
|
+
const approveMatch = matchesList(cmdTrimmed, systemSettings2.autoApproveCommands);
|
|
5128
|
+
disallowMatch = matchesList(cmdTrimmed, systemSettings2.autoDisallowCommands);
|
|
5129
|
+
if (askMatch) {
|
|
5130
|
+
forcePrompt = true;
|
|
5131
|
+
} else if (approveMatch) {
|
|
5070
5132
|
decision = "allow";
|
|
5071
5133
|
} else if (systemSettings2.autoApproveGit && /^git\s+commit\b/i.test(cmdTrimmed)) {
|
|
5072
5134
|
decision = "allow";
|
|
5073
5135
|
}
|
|
5074
|
-
if (!decision) {
|
|
5136
|
+
if (!forcePrompt && !decision) {
|
|
5075
5137
|
if (systemSettings2.networkAccess === false) {
|
|
5076
5138
|
const networkCmdRegex = /\b(curl|wget|npm|yarn|pnpm|pip|pip3|ssh|docker|git\s+(clone|push|pull|fetch))\b/i;
|
|
5077
5139
|
if (networkCmdRegex.test(cmdTrimmed)) {
|
|
5078
5140
|
decision = "deny";
|
|
5141
|
+
isNetworkDeny = true;
|
|
5079
5142
|
}
|
|
5080
5143
|
}
|
|
5081
|
-
if (!decision) {
|
|
5082
|
-
|
|
5083
|
-
decision = "deny";
|
|
5084
|
-
} else if (autoDisallow === "Destructive" && isDestructive) {
|
|
5085
|
-
decision = "deny";
|
|
5086
|
-
}
|
|
5144
|
+
if (!decision && disallowMatch) {
|
|
5145
|
+
decision = "deny";
|
|
5087
5146
|
}
|
|
5088
5147
|
}
|
|
5089
|
-
if (!decision && autoExec) {
|
|
5148
|
+
if (!forcePrompt && !decision && autoExec) {
|
|
5090
5149
|
decision = "allow";
|
|
5091
5150
|
}
|
|
5092
5151
|
} else {
|
|
@@ -5095,11 +5154,33 @@ ${boxBottom}` };
|
|
|
5095
5154
|
}
|
|
5096
5155
|
}
|
|
5097
5156
|
let approval = decision;
|
|
5157
|
+
let denyReason = "";
|
|
5158
|
+
if (decision === "deny") {
|
|
5159
|
+
if (isNetworkDeny) {
|
|
5160
|
+
denyReason = "network";
|
|
5161
|
+
} else if (disallowMatch) {
|
|
5162
|
+
denyReason = "settings";
|
|
5163
|
+
} else {
|
|
5164
|
+
denyReason = "prohibited";
|
|
5165
|
+
}
|
|
5166
|
+
}
|
|
5098
5167
|
if (!approval) {
|
|
5099
5168
|
approval = await settings.onToolApproval(normToolName, toolCall.args);
|
|
5169
|
+
if (approval === "deny") {
|
|
5170
|
+
denyReason = "user";
|
|
5171
|
+
}
|
|
5100
5172
|
}
|
|
5101
5173
|
if (approval === "deny") {
|
|
5102
|
-
|
|
5174
|
+
let denyMsg = `Permission Denied: Prohibited ${normToolName === "exec_command" ? "Command" : "file edit"}.`;
|
|
5175
|
+
if (denyReason === "user") {
|
|
5176
|
+
denyMsg = "Permission Denied by User";
|
|
5177
|
+
} else if (denyReason === "settings") {
|
|
5178
|
+
denyMsg = "Permission Denied by User Policy";
|
|
5179
|
+
} else if (denyReason === "network") {
|
|
5180
|
+
denyMsg = "Permission Denied: Sandbox Network Access Disabled by User Policy.";
|
|
5181
|
+
} else if (denyReason === "prohibited" && normToolName === "exec_command") {
|
|
5182
|
+
denyMsg = "Permission Denied: Prohibited Command";
|
|
5183
|
+
}
|
|
5103
5184
|
if (normToolName === "write_file" || normToolName === "update_file") {
|
|
5104
5185
|
const action = normToolName === "write_file" ? "WRITE DENIED" : "UPDATE DENIED";
|
|
5105
5186
|
const deniedLabel = `\u{1F4BE} ${action}: ${parseArgs(toolCall.args).path || "..."}`.toUpperCase();
|
|
@@ -5763,7 +5844,7 @@ import path16 from "path";
|
|
|
5763
5844
|
import { exec as exec4 } from "child_process";
|
|
5764
5845
|
import { fileURLToPath } from "url";
|
|
5765
5846
|
import { MultilineInput } from "ink-multiline-input";
|
|
5766
|
-
import
|
|
5847
|
+
import TextInput4 from "ink-text-input";
|
|
5767
5848
|
import gradient from "gradient-string";
|
|
5768
5849
|
function App({ args = [] }) {
|
|
5769
5850
|
const [confirmExit, setConfirmExit] = useState9(false);
|
|
@@ -6091,7 +6172,7 @@ function App({ args = [] }) {
|
|
|
6091
6172
|
if (activeView === "revert") {
|
|
6092
6173
|
setActiveView("chat");
|
|
6093
6174
|
setEscPressCount(0);
|
|
6094
|
-
} else if (activeView !== "chat") {
|
|
6175
|
+
} else if (activeView !== "chat" && activeView !== "settings") {
|
|
6095
6176
|
setActiveView("chat");
|
|
6096
6177
|
} else {
|
|
6097
6178
|
setEscPressCount((prev) => {
|
|
@@ -7193,6 +7274,58 @@ Selection: ${val}`,
|
|
|
7193
7274
|
// v1.5.0 Multimodal Support
|
|
7194
7275
|
toolName: packet.toolName
|
|
7195
7276
|
}]);
|
|
7277
|
+
if (packet.toolName === "update_file" && packet.aiContent) {
|
|
7278
|
+
const diffLines = packet.aiContent.split("\n");
|
|
7279
|
+
let added = 0;
|
|
7280
|
+
let removed = 0;
|
|
7281
|
+
let insideDiff = false;
|
|
7282
|
+
for (const line of diffLines) {
|
|
7283
|
+
if (line.includes("[DIFF_START]")) {
|
|
7284
|
+
insideDiff = true;
|
|
7285
|
+
continue;
|
|
7286
|
+
}
|
|
7287
|
+
if (line.includes("[DIFF_END]")) {
|
|
7288
|
+
insideDiff = false;
|
|
7289
|
+
continue;
|
|
7290
|
+
}
|
|
7291
|
+
if (insideDiff) {
|
|
7292
|
+
if (/^\+\d+/.test(line)) {
|
|
7293
|
+
added++;
|
|
7294
|
+
} else if (/^\-\d+/.test(line)) {
|
|
7295
|
+
removed++;
|
|
7296
|
+
}
|
|
7297
|
+
}
|
|
7298
|
+
}
|
|
7299
|
+
linesAdded += added;
|
|
7300
|
+
linesRemoved += removed;
|
|
7301
|
+
addToUsage("linesAdded", added);
|
|
7302
|
+
addToUsage("linesRemoved", removed);
|
|
7303
|
+
} else if (packet.toolName === "write_file" && packet.aiContent) {
|
|
7304
|
+
const statsMatch = packet.aiContent.match(/- Stats: \[(\d+) lines/);
|
|
7305
|
+
const verifiedLinesCount = statsMatch ? parseInt(statsMatch[1]) : 0;
|
|
7306
|
+
let oldLinesCount = 0;
|
|
7307
|
+
if (packet.aiContent.includes("Old File contents:")) {
|
|
7308
|
+
const ancestryLines = packet.aiContent.split("\n");
|
|
7309
|
+
let insideOldFile = false;
|
|
7310
|
+
for (const line of ancestryLines) {
|
|
7311
|
+
if (line.includes("Old File contents:")) {
|
|
7312
|
+
insideOldFile = true;
|
|
7313
|
+
continue;
|
|
7314
|
+
}
|
|
7315
|
+
if (insideOldFile) {
|
|
7316
|
+
if (line.trim() === "") {
|
|
7317
|
+
insideOldFile = false;
|
|
7318
|
+
} else if (/^\d+ \|/.test(line)) {
|
|
7319
|
+
oldLinesCount++;
|
|
7320
|
+
}
|
|
7321
|
+
}
|
|
7322
|
+
}
|
|
7323
|
+
}
|
|
7324
|
+
linesAdded += verifiedLinesCount;
|
|
7325
|
+
linesRemoved += oldLinesCount;
|
|
7326
|
+
addToUsage("linesAdded", verifiedLinesCount);
|
|
7327
|
+
addToUsage("linesRemoved", oldLinesCount);
|
|
7328
|
+
}
|
|
7196
7329
|
continue;
|
|
7197
7330
|
}
|
|
7198
7331
|
let chunkText = packet.content;
|
|
@@ -7228,16 +7361,21 @@ Selection: ${val}`,
|
|
|
7228
7361
|
thinkConsumedInTurn = true;
|
|
7229
7362
|
chunkText = chunkText.replace(/<(think|thought)>[\s\S]*?<\/(think|thought)>/gi, "").replace(/<(think|thought)>/gi, "");
|
|
7230
7363
|
currentThinkId = "think-" + Date.now();
|
|
7231
|
-
setMessages((prev) => [...prev, { id: currentThinkId, role: "think", text: "", isStreaming: true }]);
|
|
7364
|
+
setMessages((prev) => [...prev, { id: currentThinkId, role: "think", text: "", isStreaming: true, startTime: Date.now() }]);
|
|
7232
7365
|
}
|
|
7233
7366
|
if (chunkLower.includes("</think>") || chunkLower.includes("</thought>")) {
|
|
7234
7367
|
const parts = chunkText.split(/<\/(think|thought)>/gi);
|
|
7235
7368
|
const thinkPart = parts[0] || "";
|
|
7236
7369
|
const agentPart = parts.slice(2).join("").replace(/<\/?(think|thought)>/gi, "");
|
|
7237
7370
|
setMessages((prev) => {
|
|
7238
|
-
const newMsgs = prev.map(
|
|
7239
|
-
(m
|
|
7240
|
-
|
|
7371
|
+
const newMsgs = prev.map((m) => {
|
|
7372
|
+
if (m.id === currentThinkId) {
|
|
7373
|
+
const startTime = m.startTime || parseInt(m.id.split("-")[1]) || Date.now();
|
|
7374
|
+
const duration = Date.now() - startTime;
|
|
7375
|
+
return { ...m, text: m.text + thinkPart, isStreaming: false, duration };
|
|
7376
|
+
}
|
|
7377
|
+
return m;
|
|
7378
|
+
});
|
|
7241
7379
|
inThinkMode = false;
|
|
7242
7380
|
currentAgentId = "agent-" + Date.now();
|
|
7243
7381
|
return [...newMsgs, { id: currentAgentId, role: "agent", text: agentPart, isStreaming: true }];
|
|
@@ -7255,7 +7393,9 @@ Selection: ${val}`,
|
|
|
7255
7393
|
transitioning = true;
|
|
7256
7394
|
const parts = newText.split(/<\/think>/gi);
|
|
7257
7395
|
transitionContent = parts.slice(1).join("</think>") || "";
|
|
7258
|
-
|
|
7396
|
+
const startTime = m.startTime || parseInt(m.id.split("-")[1]) || Date.now();
|
|
7397
|
+
const duration = Date.now() - startTime;
|
|
7398
|
+
return { ...m, text: parts[0], isStreaming: false, duration };
|
|
7259
7399
|
}
|
|
7260
7400
|
return { ...m, text: newText, isStreaming: true };
|
|
7261
7401
|
}
|
|
@@ -7404,7 +7544,7 @@ Selection: ${val}`,
|
|
|
7404
7544
|
);
|
|
7405
7545
|
case "input":
|
|
7406
7546
|
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(
|
|
7407
|
-
|
|
7547
|
+
TextInput4,
|
|
7408
7548
|
{
|
|
7409
7549
|
value: inputConfig?.value || "",
|
|
7410
7550
|
onChange: (val) => setInputConfig((prev) => ({ ...prev, value: val })),
|
|
@@ -7423,6 +7563,10 @@ Selection: ${val}`,
|
|
|
7423
7563
|
} else if (key === "janitorModel") {
|
|
7424
7564
|
setJanitorModel(val);
|
|
7425
7565
|
newSettings.janitorModel = val;
|
|
7566
|
+
} else if (key === "autoApproveCommands" || key === "autoDisallowCommands" || key === "alwaysAskCommands") {
|
|
7567
|
+
const newSysSettings = { ...systemSettings, [key]: val.trim(), sandboxPreset: "Custom" };
|
|
7568
|
+
setSystemSettings(newSysSettings);
|
|
7569
|
+
newSettings.systemSettings = newSysSettings;
|
|
7426
7570
|
} else if (key === "externalDataPath") {
|
|
7427
7571
|
const newSysSettings = { ...systemSettings, useExternalData: true, externalDataPath: val.trim() };
|
|
7428
7572
|
setSystemSettings(newSysSettings);
|
|
@@ -7458,7 +7602,7 @@ Selection: ${val}`,
|
|
|
7458
7602
|
}
|
|
7459
7603
|
)), /* @__PURE__ */ React12.createElement(Box12, { paddingX: 1, marginTop: 1 }, /* @__PURE__ */ React12.createElement(Text12, { color: "gray", dimColor: true, italic: true }, "(Press Enter to confirm selection)")));
|
|
7460
7604
|
case "stats":
|
|
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)"));
|
|
7605
|
+
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" }, "Code Changes (Sess):")), /* @__PURE__ */ React12.createElement(Text12, { color: "white" }, /* @__PURE__ */ React12.createElement(Text12, { color: "green" }, "+", linesAdded), " ", /* @__PURE__ */ React12.createElement(Text12, { color: "red" }, "-", linesRemoved))), /* @__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" }, "Code Changes Today:")), /* @__PURE__ */ React12.createElement(Text12, { color: "white" }, /* @__PURE__ */ React12.createElement(Text12, { color: "green" }, "+", dailyUsage?.linesAdded || 0), " ", /* @__PURE__ */ React12.createElement(Text12, { color: "red" }, "-", dailyUsage?.linesRemoved || 0))), /* @__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)"));
|
|
7462
7606
|
case "autoExecDanger":
|
|
7463
7607
|
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(
|
|
7464
7608
|
CommandMenu,
|
|
@@ -7855,7 +7999,7 @@ Selection: ${val}`,
|
|
|
7855
7999
|
columns: Math.max(20, (stdout?.columns || 80) - 1)
|
|
7856
8000
|
}
|
|
7857
8001
|
), 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(
|
|
7858
|
-
|
|
8002
|
+
TextInput4,
|
|
7859
8003
|
{
|
|
7860
8004
|
value: tempKey,
|
|
7861
8005
|
onChange: setTempKey,
|
|
@@ -7879,7 +8023,7 @@ Selection: ${val}`,
|
|
|
7879
8023
|
const agentActiveMs = sessionApiTime + sessionToolTime;
|
|
7880
8024
|
const apiPercent = agentActiveMs > 0 ? (sessionApiTime / agentActiveMs * 100).toFixed(1) : "0.0";
|
|
7881
8025
|
const toolPercent = agentActiveMs > 0 ? (sessionToolTime / agentActiveMs * 100).toFixed(1) : "0.0";
|
|
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, "%)"))));
|
|
8026
|
+
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" }, "Code Changes:")), /* @__PURE__ */ React12.createElement(Text12, { color: "white" }, /* @__PURE__ */ React12.createElement(Text12, { color: "green" }, "+", linesAdded), " ", /* @__PURE__ */ React12.createElement(Text12, { color: "red" }, "-", linesRemoved))), /* @__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, "%)"))));
|
|
7883
8027
|
})(), suggestions.length > 0 && (() => {
|
|
7884
8028
|
const windowSize = 5;
|
|
7885
8029
|
const startIdx = Math.max(0, Math.min(selectedIndex - 2, suggestions.length - windowSize));
|
|
@@ -7925,7 +8069,7 @@ Selection: ${val}`,
|
|
|
7925
8069
|
);
|
|
7926
8070
|
})()));
|
|
7927
8071
|
}
|
|
7928
|
-
var SESSION_START_TIME, CHANGELOG_URL, packageJsonPath, packageJson, versionFluxflow, updatedOn, ResolutionModal, FLUX_LOGO, parseAgentText;
|
|
8072
|
+
var SESSION_START_TIME, CHANGELOG_URL, linesAdded, linesRemoved, packageJsonPath, packageJson, versionFluxflow, updatedOn, ResolutionModal, FLUX_LOGO, parseAgentText;
|
|
7929
8073
|
var init_app = __esm({
|
|
7930
8074
|
"src/app.jsx"() {
|
|
7931
8075
|
init_ChatLayout();
|
|
@@ -7953,6 +8097,8 @@ var init_app = __esm({
|
|
|
7953
8097
|
init_text();
|
|
7954
8098
|
SESSION_START_TIME = Date.now();
|
|
7955
8099
|
CHANGELOG_URL = "https://fluxflow-cli.onrender.com/changelog.html";
|
|
8100
|
+
linesAdded = 0;
|
|
8101
|
+
linesRemoved = 0;
|
|
7956
8102
|
packageJsonPath = path16.join(path16.dirname(fileURLToPath(import.meta.url)), "../package.json");
|
|
7957
8103
|
packageJson = JSON.parse(fs18.readFileSync(packageJsonPath, "utf8"));
|
|
7958
8104
|
versionFluxflow = packageJson.version;
|