fluxflow-cli 3.1.8 → 3.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/fluxflow.js +538 -340
  2. package/package.json +2 -2
package/dist/fluxflow.js CHANGED
@@ -324,7 +324,9 @@ var init_settings = __esm({
324
324
  advanceRollback: false,
325
325
  autoDeleteHistory: "7d",
326
326
  useExternalData: false,
327
- externalDataPath: ""
327
+ externalDataPath: "",
328
+ preserveThinking: true,
329
+ loadingPhrases: true
328
330
  },
329
331
  profileData: {
330
332
  name: null,
@@ -3713,7 +3715,7 @@ var init_TerminalBox = __esm({
3713
3715
  setIsExpanded((prev) => !prev);
3714
3716
  }
3715
3717
  }, { isActive: isFocused });
3716
- const limit = Math.max(5, completed ? terminalHeight - 10 : terminalHeight - 20);
3718
+ const limit = Math.max(5, completed ? terminalHeight - 10 : terminalHeight - 25);
3717
3719
  const hasCollapsibleContent = rawLines.length > limit;
3718
3720
  const collapsedCount = rawLines.length - limit;
3719
3721
  const visibleLines = hasCollapsibleContent && !isExpanded ? rawLines.slice(rawLines.length - limit) : rawLines;
@@ -3724,19 +3726,18 @@ var init_TerminalBox = __esm({
3724
3726
  {
3725
3727
  flexDirection: "column",
3726
3728
  borderStyle: isFocused ? "double" : "single",
3727
- borderLeft: true,
3729
+ borderLeft: false,
3728
3730
  borderRight: false,
3729
- borderTop: false,
3730
- borderBottom: false,
3731
- borderColor: "#555555",
3731
+ borderTop: true,
3732
+ borderBottom: true,
3732
3733
  paddingLeft: 2,
3733
3734
  paddingRight: 0,
3734
3735
  paddingY: 1,
3735
- marginTop: 1,
3736
- width: "100%"
3736
+ marginY: 1,
3737
+ width: columns - 2
3737
3738
  },
3738
- /* @__PURE__ */ React3.createElement(Box2, { marginBottom: 1, justifyContent: "space-between", width: "100%" }, /* @__PURE__ */ React3.createElement(Box2, { flexShrink: 1, paddingRight: 2 }, /* @__PURE__ */ React3.createElement(Text3, null, /* @__PURE__ */ React3.createElement(Text3, { color: "gray", bold: true }, completed ? "\u{1F3C1} FINISHED:" : "\u26A1 EXECUTING:", " "), /* @__PURE__ */ React3.createElement(Text3, { color: "white" }, command))), isPty && /* @__PURE__ */ React3.createElement(Box2, { flexShrink: 0, paddingX: 1 }, /* @__PURE__ */ React3.createElement(Text3, { color: "gray", bold: true }, "ADVANCE"))),
3739
- displayOutput ? /* @__PURE__ */ React3.createElement(Box2, { flexDirection: "column", marginTop: 0, backgroundColor: isPty ? void 0 : "#0a0a0a", paddingX: 1 }, hasCollapsibleContent && !isExpanded && /* @__PURE__ */ React3.createElement(Box2, { marginBottom: 1 }, /* @__PURE__ */ React3.createElement(Text3, { color: "magenta" }, "...", collapsedCount, " lines collapsed... Press CTRL + O to expand.")), /* @__PURE__ */ React3.createElement(Text3, { color: completed ? "gray" : void 0 }, renderedOutput)) : !completed && /* @__PURE__ */ React3.createElement(Box2, { marginTop: 1, backgroundColor: isPty ? void 0 : "#0a0a0a", paddingX: 1 }, /* @__PURE__ */ React3.createElement(Text3, { color: "white", italic: true }, "Waiting for output...")),
3739
+ /* @__PURE__ */ React3.createElement(Box2, { marginBottom: 1, justifyContent: "space-between", width: "100%" }, /* @__PURE__ */ React3.createElement(Box2, { flexShrink: 1, paddingRight: 2 }, /* @__PURE__ */ React3.createElement(Text3, null, /* @__PURE__ */ React3.createElement(Text3, { color: "white", bold: true }, completed ? "\u{1F3C1} FINISHED:" : "\u26A1 EXECUTING:", " "), /* @__PURE__ */ React3.createElement(Text3, { color: "white" }, command))), isPty && /* @__PURE__ */ React3.createElement(Box2, { flexShrink: 0, paddingX: 1 }, /* @__PURE__ */ React3.createElement(Text3, { color: "green", bold: true }, "ADVANCE"))),
3740
+ displayOutput ? /* @__PURE__ */ React3.createElement(Box2, { flexDirection: "column", marginTop: 0, backgroundColor: isPty ? void 0 : "#0a0a0a", paddingX: 1, width: "100%" }, hasCollapsibleContent && !isExpanded && /* @__PURE__ */ React3.createElement(Box2, { marginBottom: 1 }, /* @__PURE__ */ React3.createElement(Text3, { color: "magenta" }, "...", collapsedCount, " lines collapsed...")), /* @__PURE__ */ React3.createElement(Text3, { color: completed ? void 0 : void 0 }, renderedOutput)) : !completed && /* @__PURE__ */ React3.createElement(Box2, { marginTop: 1, backgroundColor: isPty ? void 0 : "#0a0a0a", paddingX: 1, width: "100%" }, /* @__PURE__ */ React3.createElement(Text3, { color: "white", italic: true }, "Waiting for output...")),
3740
3741
  /* @__PURE__ */ React3.createElement(Box2, { justifyContent: "space-between", marginTop: 1 }, !completed ? /* @__PURE__ */ React3.createElement(Text3, { color: "gray", italic: true }, isFocused ? "Press TAB to unfocus, then double-press ESC to terminate." : "Double-press ESC to terminate if hanging.") : /* @__PURE__ */ React3.createElement(Box2, null), /* @__PURE__ */ React3.createElement(Text3, { color: "gray", bold: true }, completed ? "\u25CF ARCHIVED" : isFocused ? "\u25B6 TERMINAL FOCUSED" : "\u25CF LIVE (Press TAB to focus)"))
3741
3742
  );
3742
3743
  });
@@ -4030,7 +4031,7 @@ var init_ChatLayout = __esm({
4030
4031
  const availableWidth = columns - 10;
4031
4032
  const trimmed = cleaned.trim();
4032
4033
  if (!trimmed.includes("```")) {
4033
- return /* @__PURE__ */ React4.createElement(Box3, { width: "100%", flexDirection: "column" }, /* @__PURE__ */ React4.createElement(MarkdownText, { text: trimmed, color: "gray", columns: availableWidth, italic: true }));
4034
+ return /* @__PURE__ */ React4.createElement(Box3, { width: "100%", flexDirection: "column" }, /* @__PURE__ */ React4.createElement(MarkdownText, { text: trimmed, color: "#969696", columns: availableWidth, italic: true }));
4034
4035
  }
4035
4036
  const parts = trimmed.split(/(```\w*\n?[\s\S]*?(?:```|$))/g);
4036
4037
  return /* @__PURE__ */ React4.createElement(Box3, { width: "100%", flexDirection: "column" }, parts.map((part, i) => {
@@ -4207,10 +4208,10 @@ var init_ChatLayout = __esm({
4207
4208
  const colChars = Math.floor(availableWidth / header.length) - 2;
4208
4209
  return (
4209
4210
  // Table MarginY here
4210
- /* @__PURE__ */ React4.createElement(Box3, { flexDirection: "column", borderStyle: "round", borderColor: "#454545ff", paddingX: 1, marginY: 0, width: "100%", flexGrow: 1 }, /* @__PURE__ */ React4.createElement(Box3, { flexDirection: "row", borderStyle: "single", borderBottom: true, borderTop: false, borderLeft: false, borderRight: false, borderColor: "#444", marginBottom: 1, paddingBottom: 0, width: "100%" }, header.map((cell, i) => /* @__PURE__ */ React4.createElement(Box3, { key: i, flexBasis: `${colPercentage}%`, flexGrow: 1, flexShrink: 0, paddingRight: 2 }, /* @__PURE__ */ React4.createElement(InlineMarkdown, { text: wrapText(cell, colChars), color: "cyan" })))), data.map((row, ri) => /* @__PURE__ */ React4.createElement(Box3, { key: ri, flexDirection: "row", marginBottom: ri === data.length - 1 ? 0 : 1, width: "100%" }, row.map((cell, ci) => /* @__PURE__ */ React4.createElement(Box3, { key: ci, flexBasis: `${colPercentage}%`, flexGrow: 1, flexShrink: 0, paddingRight: 2, flexDirection: "column" }, /* @__PURE__ */ React4.createElement(InlineMarkdown, { text: wrapText(cell, colChars), color: "white" }))))))
4211
+ /* @__PURE__ */ React4.createElement(Box3, { flexDirection: "column", borderStyle: "round", borderColor: "#454545ff", paddingX: 1, marginY: 0, width: terminalWidth - 2 }, /* @__PURE__ */ React4.createElement(Box3, { flexDirection: "row", borderStyle: "single", borderBottom: true, borderTop: false, borderLeft: false, borderRight: false, borderColor: "#444", marginBottom: 1, paddingBottom: 0, width: "100%" }, header.map((cell, i) => /* @__PURE__ */ React4.createElement(Box3, { key: i, flexBasis: `${colPercentage}%`, flexGrow: 1, flexShrink: 0, paddingRight: 2 }, /* @__PURE__ */ React4.createElement(InlineMarkdown, { text: wrapText(cell, colChars), color: "cyan" })))), data.map((row, ri) => /* @__PURE__ */ React4.createElement(Box3, { key: ri, flexDirection: "row", marginBottom: ri === data.length - 1 ? 0 : 1, width: "100%" }, row.map((cell, ci) => /* @__PURE__ */ React4.createElement(Box3, { key: ci, flexBasis: `${colPercentage}%`, flexGrow: 1, flexShrink: 0, paddingRight: 2, flexDirection: "column" }, /* @__PURE__ */ React4.createElement(InlineMarkdown, { text: wrapText(cell, colChars), color: "white" }))))))
4211
4212
  );
4212
4213
  });
4213
- MarkdownText = React4.memo(({ text, color = "white", columns = 80, italic = false }) => {
4214
+ MarkdownText = React4.memo(({ text, color = "#D6DAE3", columns = 80, italic = false }) => {
4214
4215
  if (!text) return null;
4215
4216
  const lines = text.split("\n");
4216
4217
  const result = [];
@@ -4499,26 +4500,29 @@ var init_ChatLayout = __esm({
4499
4500
  if (msg.isAskRecord) {
4500
4501
  const selectionMatch = msg.text.match(/Selection: (.*)/);
4501
4502
  const selection = selectionMatch ? selectionMatch[1] : "No selection";
4503
+ const questionMatch = msg.text.match(/Question: (.*)/);
4504
+ const question = questionMatch ? questionMatch[1] : null;
4502
4505
  const s = emojiSpace(2);
4503
4506
  return /* @__PURE__ */ React4.createElement(Box3, { marginBottom: 0, paddingX: 1, width: "100%" }, /* @__PURE__ */ React4.createElement(
4504
4507
  Box3,
4505
4508
  {
4506
4509
  flexDirection: "column",
4507
4510
  borderStyle: "single",
4508
- borderLeft: true,
4511
+ borderLeft: false,
4509
4512
  borderRight: false,
4510
- borderTop: false,
4511
- borderBottom: false,
4513
+ borderTop: true,
4514
+ borderBottom: true,
4512
4515
  borderColor: "#444444",
4513
4516
  paddingLeft: 2,
4514
4517
  paddingRight: 0,
4515
4518
  paddingTop: 1,
4516
4519
  paddingBottom: 1,
4517
- backgroundColor: "#1a1a1a",
4518
- width: "100%"
4520
+ marginY: 1,
4521
+ width: columns - 2
4519
4522
  },
4520
- /* @__PURE__ */ React4.createElement(Box3, { paddingX: 1 }, /* @__PURE__ */ React4.createElement(Text4, { color: "white", bold: true }, "AGENT REQUEST: RESOLVED")),
4521
- /* @__PURE__ */ React4.createElement(Box3, { paddingX: 1, marginTop: 1, marginBottom: 1 }, /* @__PURE__ */ React4.createElement(Text4, { color: "white" }, "Selection: ", /* @__PURE__ */ React4.createElement(Text4, { color: "grey", bold: true }, selection)))
4523
+ /* @__PURE__ */ React4.createElement(Box3, { paddingX: 1 }, /* @__PURE__ */ React4.createElement(Text4, { color: "green", bold: true }, "AGENT REQUEST: RESOLVED")),
4524
+ question && /* @__PURE__ */ React4.createElement(Box3, { paddingX: 1, marginTop: 1 }, /* @__PURE__ */ React4.createElement(Text4, { color: "cyan" }, question)),
4525
+ /* @__PURE__ */ React4.createElement(Box3, { paddingX: 1, marginTop: 1, marginBottom: 0 }, /* @__PURE__ */ React4.createElement(Text4, { color: "white" }, "Selection: ", /* @__PURE__ */ React4.createElement(Text4, { color: "grey", bold: true }, selection)))
4522
4526
  ));
4523
4527
  }
4524
4528
  if (msg.isAboutRecord) {
@@ -4631,7 +4635,7 @@ var init_ChatLayout = __esm({
4631
4635
  finalContent.replace(/\r\n/g, "\n").replace(/\r/g, "\n").replace(/\\\n/g, "\n").replace(/\\$/, ""),
4632
4636
  columns - 7
4633
4637
  ).split("\n").map((line, lineIdx) => /* @__PURE__ */ React4.createElement(Box3, { key: lineIdx, flexDirection: "row", width: "100%" }, /* @__PURE__ */ React4.createElement(Box3, { flexShrink: 0, width: 2 }, /* @__PURE__ */ React4.createElement(Text4, { bold: true, color: "white" }, lineIdx === 0 ? ">" : " ")), /* @__PURE__ */ React4.createElement(Box3, { flexGrow: 1, marginLeft: 1 }, /* @__PURE__ */ React4.createElement(InlineMarkdown, { text: line, color: msg.color || "white" }))))
4634
- ), /* @__PURE__ */ React4.createElement(Box3, { width: columns - 1, height: 1, overflow: "hidden" }, /* @__PURE__ */ React4.createElement(Text4, { color: "#444444" }, "\u2580".repeat(Math.max(1, columns - 1))))) : msg.role === "think" ? /* @__PURE__ */ React4.createElement(Box3, { flexDirection: "column", marginTop: 0, marginBottom: 0, paddingX: 1, width: "100%" }, msg.isStreaming && !msg.duration ? /* @__PURE__ */ React4.createElement(Text4, { bold: true, color: "white" }, "\u2727 Thinking...") : /* @__PURE__ */ React4.createElement(Text4, { bold: true, color: "white" }, "\u2726 Thought", msg.duration ? /* @__PURE__ */ React4.createElement(Text4, { color: "gray" }, " for ", /* @__PURE__ */ React4.createElement(Text4, { bold: true, color: "white" }, formatThinkingDuration(msg.duration))) : "..."), /* @__PURE__ */ React4.createElement(Box3, { borderStyle: "single", borderLeft: true, borderRight: false, borderTop: false, borderBottom: false, paddingLeft: 2, paddingTop: 1, paddingBottom: 1, flexDirection: "column", width: "100%" }, formatThinkText(finalContent, columns))) : /* @__PURE__ */ React4.createElement(Box3, { flexDirection: "column", paddingX: 1, marginTop: 0, width: "100%" }, /* @__PURE__ */ React4.createElement(CodeRenderer, { text: finalContent.replace(/ \|\n\n/g, " |\n"), columns }), msg.memoryUpdated && /* @__PURE__ */ React4.createElement(Box3, { marginTop: 1, width: "100%" }, /* @__PURE__ */ React4.createElement(Text4, { color: "white", italic: true }, "[Memory Updated]")), msg.role === "agent" && msg.workedDuration ? /* @__PURE__ */ React4.createElement(Box3, { marginTop: 1, marginBottom: 2, width: "100%" }, /* @__PURE__ */ React4.createElement(Text4, null, "["), /* @__PURE__ */ React4.createElement(Text4, { color: "gray" }, "Worked for ", /* @__PURE__ */ React4.createElement(Text4, { bold: true, color: "white" }, formatThinkingDuration(msg.workedDuration))), /* @__PURE__ */ React4.createElement(Text4, null, "]")) : null))
4638
+ ), /* @__PURE__ */ React4.createElement(Box3, { width: columns - 1, height: 1, overflow: "hidden" }, /* @__PURE__ */ React4.createElement(Text4, { color: "#444444" }, "\u2580".repeat(Math.max(1, columns - 1))))) : msg.role === "think" ? /* @__PURE__ */ React4.createElement(Box3, { flexDirection: "column", marginTop: 0, marginBottom: 0, paddingX: 1, width: "100%" }, msg.isStreaming && !msg.duration ? /* @__PURE__ */ React4.createElement(Text4, { bold: true, color: "#F2F2F2" }, "\u2727 Thinking...") : /* @__PURE__ */ React4.createElement(Text4, { bold: true, color: "#F2F2F2" }, "\u2726 Thought", msg.duration ? /* @__PURE__ */ React4.createElement(Text4, { color: "gray" }, " for ", /* @__PURE__ */ React4.createElement(Text4, { bold: true, color: "white" }, formatThinkingDuration(msg.duration))) : "..."), /* @__PURE__ */ React4.createElement(Box3, { borderStyle: "single", borderLeft: true, borderRight: false, borderTop: false, borderBottom: false, paddingLeft: 2, paddingTop: 1, paddingBottom: 1, flexDirection: "column", width: "100%" }, formatThinkText(finalContent, columns))) : /* @__PURE__ */ React4.createElement(Box3, { flexDirection: "column", paddingX: 1, marginTop: 0, width: "100%" }, /* @__PURE__ */ React4.createElement(CodeRenderer, { text: finalContent.replace(/ \|\n\n/g, " |\n"), columns }), msg.memoryUpdated && /* @__PURE__ */ React4.createElement(Box3, { marginTop: 1, width: "100%" }, /* @__PURE__ */ React4.createElement(Text4, { color: "white", italic: true }, "[Memory Updated]")), msg.role === "agent" && msg.workedDuration ? /* @__PURE__ */ React4.createElement(Box3, { marginTop: 1, marginBottom: 2, width: "100%" }, /* @__PURE__ */ React4.createElement(Text4, null, "["), /* @__PURE__ */ React4.createElement(Text4, { color: "gray" }, "Worked for ", /* @__PURE__ */ React4.createElement(Text4, { bold: true, color: "white" }, formatThinkingDuration(msg.workedDuration))), /* @__PURE__ */ React4.createElement(Text4, null, "]")) : null))
4635
4639
  );
4636
4640
  });
4637
4641
  BlockItem = React4.memo(({ block, columns = 80, showFullThinking, aiProvider, version }) => {
@@ -4662,7 +4666,7 @@ var init_ChatLayout = __esm({
4662
4666
  );
4663
4667
  }
4664
4668
  if (type === "think-header") {
4665
- return /* @__PURE__ */ React4.createElement(Box3, { flexDirection: "column", paddingX: 1, width: "100%", marginTop: 0, marginBottom: 0 }, isStreamingMsg ? /* @__PURE__ */ React4.createElement(Text4, { bold: true, color: "white" }, "\u2727 Thinking...") : /* @__PURE__ */ React4.createElement(Text4, { bold: true, color: "white" }, "\u2726 Thought..."), showFullThinking && /* @__PURE__ */ React4.createElement(Box3, { flexDirection: "row", width: "100%" }, /* @__PURE__ */ React4.createElement(Text4, { color: "gray" }, "\u2502 ")));
4669
+ return /* @__PURE__ */ React4.createElement(Box3, { flexDirection: "column", paddingX: 1, width: "100%", marginTop: 0, marginBottom: 0 }, isStreamingMsg ? /* @__PURE__ */ React4.createElement(Text4, { bold: true, color: "#F2F2F2" }, "\u2727 Thinking...") : /* @__PURE__ */ React4.createElement(Text4, { bold: true, color: "#F2F2F2" }, "\u2726 Thought..."), showFullThinking && /* @__PURE__ */ React4.createElement(Box3, { flexDirection: "row", width: "100%" }, /* @__PURE__ */ React4.createElement(Text4, { color: "gray" }, "\u2502 ")));
4666
4670
  }
4667
4671
  if (type === "think-line") {
4668
4672
  if (!showFullThinking) return null;
@@ -4844,10 +4848,10 @@ var init_StatusBar = __esm({
4844
4848
  init_text();
4845
4849
  activeGetMemoryInfo = null;
4846
4850
  getLatencyColor = (delay) => {
4847
- if (delay <= 400) return "#00a564";
4851
+ if (delay <= 500) return "#00a564";
4848
4852
  if (delay >= 5e3) return "#ff0000";
4849
4853
  const points = [
4850
- { t: 400, r: 0, g: 165, b: 100 },
4854
+ { t: 500, r: 0, g: 165, b: 100 },
4851
4855
  { t: 800, r: 120, g: 220, b: 80 },
4852
4856
  { t: 1500, r: 250, g: 210, b: 40 },
4853
4857
  { t: 3e3, r: 255, g: 120, b: 0 },
@@ -5174,7 +5178,7 @@ Internal tools. **MUST use the EXACT syntax** [tool:functions.ToolName(args)]. *
5174
5178
  - **MAX 3 TOOL CALLS PER TURN${mode === "Flux" ? " (EXCEPTION FOR Todo TOOL: 3+ CALLS ALLOWED, Run TOOL: Limit 1, OR 2 CONSECUTIVE Run TOOL)" : ""}. Next Turn, verify tool results, plan next**
5175
5179
  ${mode === "Flux" ? "- USE multiple search & replace on patch tool if editing same file/path with many changes \u2190 **HIGHLY RECOMMENDED**\n- Tool execution denied? MUST use 'Ask' tool immediately for user reason/changes. NEVER END RESPONSE OR PROCEED BLINDLY \u2190 **MANDATORY**\n- FileMap >>> ReadFile to understand file efficiently\n- Want spefific STRING across project/file? SearchKeyword >> Guessing/ReadFile\n- HUGE FILES? SearchKeyword >> FileMap/Full Read\n- No tool spamming\n- **MUST MARK DONE/APPEND Todos BASED ON REALTIME TASK PROGRESS ON *EVERY TURN***" : ""}
5176
5180
  ${mode === "Flux" ? "- **File Tools >> Code in chat**\n\n" : ""}- COMMUNICATION TOOLS -
5177
- 1. [tool:functions.Ask(question="...", optionA="option::description", ...MAX 4)]. Ambiguity Resolution. Mandatory Triggers: Path Divergence, Security, Risk Mitigation. ask >> finish/guess. Suggest best options; don't ask for preferences
5181
+ 1. [tool:functions.Ask(question="...", optionA="option::description", ...MAX 4)]. Ambiguity Resolution. Mandatory Triggers: Path Divergence, Security, Risk Mitigation. ask >> finish/guess. Suggest best options; don't ask for preferences. 'option' SHOULD be short
5178
5182
 
5179
5183
  - WEB TOOLS -
5180
5184
  1. [tool:functions.WebSearch(query="...", limit=number)]. Limit 3-10. Proactive use for unknown info/docs
@@ -5186,7 +5190,7 @@ ${mode === "Flux" ? `- WORKSPACE TOOLS (path = relative to CWD & WILL BE FIRST A
5186
5190
  3. [tool:functions.FileMap(path="path/file")]. Shows file structure, functions, class, import/export, variable
5187
5191
  4. [tool:functions.PatchFile(path="...", replaceContent1="full line/block", newContent1="...", ...MAX 6)]. Surgical Patch. **Multiple patch on same file/path? Use replaceContent2, newContent2 etc >>> multiple spams**. Unsure? ReadFile >> guessing. **MUST VERIFY DIFF**
5188
5192
  5. [tool:functions.WriteFile(path="...", content="...")]. Creates/Overwrites. File Exist? PatchFile > WriteFile. Verify Imports
5189
- 6. [tool:functions.SearchKeyword(keyword="...", file="optional", subString="true/false optional")]. Global project search. If 'file' is provided, searches only that file. Finds definitions/logic without reading every file. Usage: Can search for relevent lines/logic area to read specifically for edit
5193
+ 6. [tool:functions.SearchKeyword(keyword="...", file="optional", subString="true/false optional", regex="true/false optional")]. Global project search. If 'file' is provided, searches only that file. Finds definitions/logic without reading every file. Usage: Can search for relevent lines/logic area to read specifically for edit. Optional parameters default to false
5190
5194
  7. [tool:functions.Run(command="...")]. Runs ${osDetected === "Windows" ? isPsAvailable() ? `WINDOWS POWERSHELL ONLY` : `WINDOWS CMD ONLY` : `BASH`} command. Destructive/Irreversible ops \u2192 Ask user
5191
5195
  8. [tool:functions.Todo(method="create/append/get", tasks=[ARRAY OF STRINGS], markDone=[ARRAY OF TASK STRINGS])]. Task List, NO Markdown IN ARRAY. USAGE: ANALYZE USER REQUEST **IF** MULTIPLE TASK \u2192 BREAK DOWN TASK \u2192 CREATE TODO **BEFORE** DIVING IN. 'tasks' & 'markDone' OPTIONAL PARAMETERS WITH method 'get'. USE 'get' method WITH 'markDone' to mark task completed. **EVERY TURN UPDATE POLICY**
5192
5196
  9. [tool:functions.Await(time="seconds")]. For waiting without exiting agent loop, 15s - 180s
@@ -5963,6 +5967,8 @@ function SettingsMenu({
5963
5967
  return [
5964
5968
  { label: "Current Provider", value: "aiProvider", status: aiProvider },
5965
5969
  { label: "Key Strategy", value: "apiTier", status: apiTier === "Free" ? "Free" : quotas?.providerBudgets?.__useProvider ? "Paid" : "Paid" },
5970
+ { label: "Preserve Thinking", value: "preserveThinking", status: systemSettings.preserveThinking !== false ? "ON" : "OFF" },
5971
+ { label: "Loading Phrases", value: "loadingPhrases", status: systemSettings.loadingPhrases !== false ? "ON" : "OFF" },
5966
5972
  { label: "Download Language Parsers", value: "parserDownload", status: "ACTION" }
5967
5973
  ];
5968
5974
  default:
@@ -6119,6 +6125,18 @@ function SettingsMenu({
6119
6125
  setActiveView("updateManager");
6120
6126
  } else if (item.value === "parserDownload") {
6121
6127
  setActiveView("parserDownload");
6128
+ } else if (item.value === "preserveThinking") {
6129
+ setSystemSettings((s) => {
6130
+ const newSysSettings = { ...s, preserveThinking: s.preserveThinking === false ? true : false };
6131
+ saveSettings2({ systemSettings: newSysSettings, apiTier, quotas });
6132
+ return newSysSettings;
6133
+ });
6134
+ } else if (item.value === "loadingPhrases") {
6135
+ setSystemSettings((s) => {
6136
+ const newSysSettings = { ...s, loadingPhrases: s.loadingPhrases === false ? true : false };
6137
+ saveSettings2({ systemSettings: newSysSettings, apiTier, quotas });
6138
+ return newSysSettings;
6139
+ });
6122
6140
  }
6123
6141
  };
6124
6142
  return /* @__PURE__ */ React7.createElement(Box6, { flexDirection: "column", borderStyle: "round", borderColor: "white", padding: 0, width: "100%", minHeight: 32 }, /* @__PURE__ */ React7.createElement(Box6, { paddingX: 1, paddingY: 0, marginBottom: 0, borderStyle: "single", borderColor: "gray", width: "100%" }, /* @__PURE__ */ React7.createElement(Text7, { color: "white", bold: true }, "SYSTEM CONFIGURATION")), /* @__PURE__ */ React7.createElement(Box6, { flexDirection: "row", width: "100%", minHeight: 26 }, /* @__PURE__ */ React7.createElement(Box6, { flexDirection: "column", width: "30%", borderStyle: "round", borderColor: activeColumn === "categories" ? "white" : "grey", padding: 1, paddingY: 0 }, /* @__PURE__ */ React7.createElement(Box6, { marginBottom: 1 }, /* @__PURE__ */ React7.createElement(Text7, { color: activeColumn === "categories" ? "white" : "grey", bold: true, underline: true }, "CATEGORIES")), CATEGORIES.map((cat, index) => {
@@ -6203,7 +6221,7 @@ function SettingsMenu({
6203
6221
  });
6204
6222
  if (currentCatId === "other") {
6205
6223
  elements.push(
6206
- /* @__PURE__ */ React7.createElement(Box6, { key: "pty-notice", marginTop: 17, paddingX: 1 }, /* @__PURE__ */ React7.createElement(Text7, { color: "white" }, isPtyAvailable ? "\u2713 Advance Interactive Terminal Supported" : "\u26A0 Interactive Terminal is Limited"))
6224
+ /* @__PURE__ */ React7.createElement(Box6, { key: "pty-notice", marginTop: 15, paddingX: 1 }, /* @__PURE__ */ React7.createElement(Text7, { color: "white" }, isPtyAvailable ? "\u2713 Advance Interactive Terminal Supported" : "\u26A0 Interactive Terminal is Limited"))
6207
6225
  );
6208
6226
  elements.push(
6209
6227
  /* @__PURE__ */ React7.createElement(Box6, { key: "memory-load-2026", paddingX: 1 }, /* @__PURE__ */ React7.createElement(Text7, { color: "gray" }, "Memory Load: ", currentMemory, "/", maxMemory, " ", memoryUnit))
@@ -6324,7 +6342,13 @@ var init_AskUserModal = __esm({
6324
6342
  const [isSuggestingElse, setIsSuggestingElse] = useState8(false);
6325
6343
  const [customInput, setCustomInput] = useState8("");
6326
6344
  const [selectedIndex, setSelectedIndex] = useState8(0);
6327
- const allOptions = [...options, { id: "CUSTOM", label: "Suggest something else...", description: "Provide a custom response" }];
6345
+ let canceled = false;
6346
+ let allOptions = [];
6347
+ try {
6348
+ allOptions = [...options, { id: "CUSTOM", label: "Suggest something else...", description: "Provide a custom response" }];
6349
+ } catch (e) {
6350
+ canceled = true;
6351
+ }
6328
6352
  useInput4((input, key) => {
6329
6353
  if (isSuggestingElse) return;
6330
6354
  if (key.leftArrow || key.upArrow) {
@@ -6335,10 +6359,11 @@ var init_AskUserModal = __esm({
6335
6359
  }
6336
6360
  if (key.return) {
6337
6361
  const selected = allOptions[selectedIndex];
6338
- if (selected.id === "CUSTOM") {
6362
+ if (selected?.id === "CUSTOM") {
6339
6363
  setIsSuggestingElse(true);
6340
6364
  } else {
6341
- onResolve(selected.label);
6365
+ if (canceled) onResolve("Selected Nothing");
6366
+ else onResolve(selected.label);
6342
6367
  }
6343
6368
  }
6344
6369
  });
@@ -6361,9 +6386,9 @@ var init_AskUserModal = __esm({
6361
6386
  backgroundColor: "#1a1a1a",
6362
6387
  width: "100%"
6363
6388
  },
6364
- /* @__PURE__ */ React9.createElement(Box8, { paddingX: 1 }, /* @__PURE__ */ React9.createElement(Text9, { color: "white", bold: true }, "\u{1F4AC} SUGGEST SOMETHING ELSE")),
6389
+ /* @__PURE__ */ React9.createElement(Box8, { paddingX: 1 }, /* @__PURE__ */ React9.createElement(Text9, { color: "white", bold: true }, "SUGGEST SOMETHING ELSE")),
6365
6390
  /* @__PURE__ */ React9.createElement(Box8, { marginTop: 1, paddingX: 1 }, /* @__PURE__ */ React9.createElement(Text9, { italic: true, color: "gray" }, "Replying to: ", question)),
6366
- /* @__PURE__ */ React9.createElement(Box8, { marginTop: 1, paddingX: 1, flexDirection: "row" }, /* @__PURE__ */ React9.createElement(Text9, { color: "white", bold: true }, "\u{1F4A0} "), /* @__PURE__ */ React9.createElement(
6391
+ /* @__PURE__ */ React9.createElement(Box8, { marginTop: 1, paddingX: 1, flexDirection: "row" }, /* @__PURE__ */ React9.createElement(
6367
6392
  TextInput3,
6368
6393
  {
6369
6394
  value: customInput,
@@ -6378,21 +6403,19 @@ var init_AskUserModal = __esm({
6378
6403
  Box8,
6379
6404
  {
6380
6405
  flexDirection: "column",
6381
- borderStyle: "single",
6382
- borderLeft: true,
6383
- borderRight: false,
6384
- borderTop: false,
6385
- borderBottom: false,
6406
+ border: true,
6407
+ borderStyle: "round",
6386
6408
  borderColor: "#444444",
6387
6409
  paddingLeft: 2,
6388
6410
  paddingRight: 0,
6389
6411
  paddingTop: 1,
6390
6412
  paddingBottom: 1,
6391
- backgroundColor: "#1a1a1a",
6413
+ marginY: 1,
6414
+ marginRight: 1,
6392
6415
  width: "100%"
6393
6416
  },
6394
- /* @__PURE__ */ React9.createElement(Box8, { paddingX: 1, marginBottom: 1 }, /* @__PURE__ */ React9.createElement(Text9, { color: "white", bold: true }, "AGENT REQUEST: ACTION REQUIRED")),
6395
- /* @__PURE__ */ React9.createElement(Box8, { paddingX: 1, marginBottom: 1 }, /* @__PURE__ */ React9.createElement(Text9, { bold: true, color: "white" }, question)),
6417
+ /* @__PURE__ */ React9.createElement(Box8, { paddingX: 1, marginBottom: 1 }, /* @__PURE__ */ React9.createElement(Text9, { color: "yellow", bold: true }, "AGENT REQUEST: ACTION REQUIRED")),
6418
+ /* @__PURE__ */ React9.createElement(Box8, { paddingX: 1, marginBottom: 1 }, /* @__PURE__ */ React9.createElement(Text9, { color: "white" }, question)),
6396
6419
  /* @__PURE__ */ React9.createElement(Box8, { flexDirection: "column", width: "100%" }, allOptions.map((opt, idx) => {
6397
6420
  const isSelected = idx === selectedIndex;
6398
6421
  return /* @__PURE__ */ React9.createElement(
@@ -6829,6 +6852,7 @@ var init_history = __esm({
6829
6852
  init_crypto();
6830
6853
  init_paths();
6831
6854
  init_revert();
6855
+ init_settings();
6832
6856
  WRITE_LOCK = Promise.resolve();
6833
6857
  withLock = (op) => {
6834
6858
  const nextLock = WRITE_LOCK.then(async () => {
@@ -6883,9 +6907,16 @@ var init_history = __esm({
6883
6907
  await fs7.ensureDir(HISTORY_DIR);
6884
6908
  const history = await loadHistory();
6885
6909
  const existingChat = history[id];
6886
- const persistentMessages = (messages || []).filter(
6910
+ let persistentMessages = (messages || []).filter(
6887
6911
  (m) => !m.isUpdateNotification && (!m.isMeta || m.text && m.text.includes("Request Cancelled"))
6888
6912
  );
6913
+ try {
6914
+ const settings = await loadSettings();
6915
+ if (settings.systemSettings?.preserveThinking === false) {
6916
+ persistentMessages = persistentMessages.filter((m) => m.role !== "think");
6917
+ }
6918
+ } catch (e) {
6919
+ }
6889
6920
  const finalName = name || (existingChat ? existingChat.name : `Session ${id.slice(-6)}`);
6890
6921
  const chatFile = path6.join(HISTORY_DIR, `${id}.json`);
6891
6922
  writeEncryptedJson(chatFile, persistentMessages);
@@ -7142,7 +7173,7 @@ var init_history = __esm({
7142
7173
  import fs8 from "fs-extra";
7143
7174
  import path7 from "path";
7144
7175
  import os3 from "os";
7145
- var getLocalBackupPath, BACKUP_FILE, generateSaveId, cachedUsage, writeTimeout, lastWriteTime, isDirty, defaultStats, purgeOldHistory, loadUsageFromFile, flushUsage, queueFlush, initUsage, forceFlushUsage, getDailyUsage, getMonthlyUsage, incrementUsage, addToUsage, getCustomPeriodUsage, checkQuota, getImageQuotaBuckets, getImageQuotaLimit, checkImageQuota, getImageQuotaStats, recordImageGeneration;
7176
+ var getLocalBackupPath, BACKUP_FILE, generateSaveId, cachedUsage, writeTimeout, lastWriteTime, isDirty, defaultStats, purgeOldHistory, loadUsageFromFile, flushUsage, queueFlush, initUsage, forceFlushUsage, getDailyUsage, getMonthlyUsage, incrementUsage, runtimeSession, addToUsage, getCustomPeriodUsage, checkQuota, getImageQuotaBuckets, getImageQuotaLimit, checkImageQuota, getImageQuotaStats, recordImageGeneration;
7146
7177
  var init_usage = __esm({
7147
7178
  "src/utils/usage.js"() {
7148
7179
  init_paths();
@@ -7504,6 +7535,9 @@ var init_usage = __esm({
7504
7535
  return summed;
7505
7536
  };
7506
7537
  incrementUsage = async (key, provider) => {
7538
+ if (key === "toolSuccess") runtimeSession.toolSuccess++;
7539
+ else if (key === "toolFailure") runtimeSession.toolFailure++;
7540
+ else if (key === "toolDenied") runtimeSession.toolDenied++;
7507
7541
  const stats = await getDailyUsage();
7508
7542
  if (stats[key] !== void 0) {
7509
7543
  stats[key]++;
@@ -7516,7 +7550,19 @@ var init_usage = __esm({
7516
7550
  }
7517
7551
  queueFlush();
7518
7552
  };
7553
+ runtimeSession = {
7554
+ linesAdded: 0,
7555
+ linesRemoved: 0,
7556
+ toolSuccess: 0,
7557
+ toolFailure: 0,
7558
+ toolDenied: 0
7559
+ };
7519
7560
  addToUsage = async (key, amount, provider, model) => {
7561
+ if (key === "linesAdded") {
7562
+ runtimeSession.linesAdded += amount;
7563
+ } else if (key === "linesRemoved") {
7564
+ runtimeSession.linesRemoved += amount;
7565
+ }
7520
7566
  const stats = await getDailyUsage();
7521
7567
  if (stats[key] !== void 0) {
7522
7568
  stats[key] += Math.floor(amount);
@@ -8859,10 +8905,22 @@ var init_search_keyword = __esm({
8859
8905
  "src/tools/search_keyword.js"() {
8860
8906
  init_arg_parser();
8861
8907
  search_keyword = async (args) => {
8862
- const { keyword, file, subString } = parseArgs(args);
8908
+ const { keyword, file, subString, regex } = parseArgs(args);
8863
8909
  if (!keyword) return 'ERROR: Missing "keyword" argument.';
8864
- const matchSubstring = subString === true || subString === "true" || subString === 1 || subString === "1" || subString === "true" || subString === "yes" || subString === "yes" || false;
8865
- const wordRegex = new RegExp(`(?<![\\w])${keyword.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")}(?![\\w])`, "i");
8910
+ const toBool = (v) => v === true || v === "true" || v === 1 || v === "1" || v === "yes";
8911
+ const matchRegex = toBool(regex);
8912
+ const matchSubstring = !matchRegex && toBool(subString);
8913
+ let regexPattern;
8914
+ let wordRegex;
8915
+ if (matchRegex) {
8916
+ try {
8917
+ regexPattern = new RegExp(keyword, "i");
8918
+ } catch (e) {
8919
+ return `ERROR: Invalid regex pattern "${keyword}": ${e.message}`;
8920
+ }
8921
+ } else {
8922
+ wordRegex = new RegExp(`(?<![\\w])${keyword.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")}(?![\\w])`, "i");
8923
+ }
8866
8924
  const excludes = [
8867
8925
  "node_modules",
8868
8926
  ".git",
@@ -8902,7 +8960,7 @@ var init_search_keyword = __esm({
8902
8960
  const lines = content.split(/\r?\n/);
8903
8961
  const fileMatches = [];
8904
8962
  for (let i = 0; i < lines.length; i++) {
8905
- const matched = matchSubstring ? lines[i].toLowerCase().includes(keyword.toLowerCase()) || fuzzyMatch(lines[i], keyword) : wordRegex.test(lines[i]);
8963
+ const matched = matchRegex ? regexPattern.test(lines[i]) : matchSubstring ? lines[i].toLowerCase().includes(keyword.toLowerCase()) || fuzzyMatch(lines[i], keyword) : wordRegex.test(lines[i]);
8906
8964
  if (matched) {
8907
8965
  fileMatches.push({ line: i + 1, content: lines[i].trim() });
8908
8966
  }
@@ -8928,10 +8986,11 @@ var init_search_keyword = __esm({
8928
8986
  if (typeof global.gc === "function") {
8929
8987
  global.gc();
8930
8988
  }
8989
+ const modeLabel = matchRegex ? "(regex mode)" : matchSubstring ? "(subString mode)" : "";
8931
8990
  if (fileGroups.length === 0) {
8932
- return `Found 0 matches for keyword: "${keyword}"${file ? ` in file: ${file}` : ". Try to specify files"} ${matchSubstring ? "(subString mode)" : ""}`;
8991
+ return `Found 0 matches for keyword: "${keyword}"${file ? ` in file: ${file}` : ". Try to specify files"} ${modeLabel}`;
8933
8992
  }
8934
- let output = `Found ${totalMatches} match${totalMatches === 1 ? "" : "es"} across ${fileGroups.length} file${fileGroups.length === 1 ? "" : "s"} ${matchSubstring ? "(subString mode)" : ""}:
8993
+ let output = `Found ${totalMatches} match${totalMatches === 1 ? "" : "es"} across ${fileGroups.length} file${fileGroups.length === 1 ? "" : "s"} ${modeLabel}:
8935
8994
 
8936
8995
  `;
8937
8996
  for (const group of fileGroups) {
@@ -9744,7 +9803,7 @@ var init_invokeSync = __esm({
9744
9803
  if (context.onVisualFeedback) {
9745
9804
  context.onVisualFeedback(`\x1B[95mSubAgent\x1B[0m: \x1B[32mGeneralist\x1B[0m \u2192 ${title}`);
9746
9805
  }
9747
- const result = await runSubagent2(task, context, model, allowedTools, 20);
9806
+ const result = await runSubagent2(task, context, model, allowedTools, 50);
9748
9807
  if (context.onVisualFeedback) {
9749
9808
  context.onVisualFeedback(`\x1B[95mSubAgent\x1B[0m: \x1B[32mGeneralist\x1B[0m \u2192 ${title} [COMPLETED]
9750
9809
  `);
@@ -9835,7 +9894,7 @@ var init_invoke = __esm({
9835
9894
  }
9836
9895
  }
9837
9896
  };
9838
- runSubagent2(task, subagentContext, model, allowedTools, 20, (logMessage) => {
9897
+ runSubagent2(task, subagentContext, model, allowedTools, 50, (logMessage) => {
9839
9898
  if (taskEntry.status === "cancelled") return;
9840
9899
  if (logMessage.startsWith("[Subagent Turn")) {
9841
9900
  if (currentTurnLogs.length > 0) {
@@ -9990,7 +10049,8 @@ ${task.finalAnswer}
9990
10049
  output += `Failure Error: ${task.error}
9991
10050
  `;
9992
10051
  }
9993
- return output.trim();
10052
+ const sanitized = output.trim().replace(/\[TOOL RESULT\]/gi, "TOOL RESULT:");
10053
+ return sanitized;
9994
10054
  };
9995
10055
  }
9996
10056
  });
@@ -11004,80 +11064,104 @@ var init_ai = __esm({
11004
11064
  body.chat_template_kwargs = { enable_thinking: false };
11005
11065
  }
11006
11066
  }
11007
- const response = await fetchWithBackoff("https://integrate.api.nvidia.com/v1/chat/completions", {
11008
- method: "POST",
11009
- headers: {
11010
- "Content-Type": "application/json",
11011
- "Authorization": `Bearer ${apiKey}`
11012
- },
11013
- body: JSON.stringify(body),
11014
- signal
11015
- });
11016
- if (!response.ok) {
11017
- const err = await response.json();
11018
- const error = new Error(`NVIDIA API Error: ${err.error?.message || response.statusText}`);
11019
- error.status = response.status;
11020
- throw error;
11021
- }
11022
- const reader = response.body.getReader();
11023
- const decoder = new TextDecoder();
11024
- let buffer = "";
11025
- let pendingParts = [];
11026
- let latestUsageMetadata = null;
11027
- let lastFlushTime = Date.now();
11028
- let hasNewData = false;
11029
- while (true) {
11030
- const { done, value } = await reader.read();
11031
- if (done) {
11032
- if (hasNewData && (pendingParts.length > 0 || latestUsageMetadata)) {
11033
- yield {
11034
- candidates: pendingParts.length > 0 ? [{ content: { parts: pendingParts } }] : [],
11035
- usageMetadata: latestUsageMetadata
11036
- };
11067
+ let attempts = 0;
11068
+ const maxAttempts = 6;
11069
+ let hasYielded = false;
11070
+ while (attempts < maxAttempts) {
11071
+ attempts++;
11072
+ try {
11073
+ const response = await fetchWithBackoff("https://integrate.api.nvidia.com/v1/chat/completions", {
11074
+ method: "POST",
11075
+ headers: {
11076
+ "Content-Type": "application/json",
11077
+ "Authorization": `Bearer ${apiKey}`
11078
+ },
11079
+ body: JSON.stringify(body),
11080
+ signal
11081
+ });
11082
+ if (!response.ok) {
11083
+ const err = await response.json();
11084
+ const error = new Error(`NVIDIA API Error: ${err.error?.message || response.statusText}`);
11085
+ error.status = response.status;
11086
+ throw error;
11037
11087
  }
11038
- break;
11039
- }
11040
- buffer += decoder.decode(value, { stream: true });
11041
- const lines = buffer.split("\n");
11042
- buffer = lines.pop();
11043
- for (const line of lines) {
11044
- const trimmed = line.trim();
11045
- if (!trimmed || trimmed === "data: [DONE]") continue;
11046
- if (trimmed.startsWith("data: ")) {
11047
- try {
11048
- const json = JSON.parse(trimmed.substring(6));
11049
- const usage = json.usage;
11050
- if (usage) {
11051
- latestUsageMetadata = {
11052
- totalTokenCount: usage.total_tokens || usage.prompt_tokens + usage.completion_tokens,
11053
- promptTokenCount: usage.prompt_tokens || 0,
11054
- candidatesTokenCount: usage.completion_tokens || 0,
11055
- thoughtsTokenCount: (usage.completion_tokens_details?.reasoning_tokens || 0) + (usage.completion_tokens_details?.thoughts_tokens || 0)
11088
+ const reader = response.body.getReader();
11089
+ const decoder = new TextDecoder();
11090
+ let buffer = "";
11091
+ let pendingParts = [];
11092
+ let latestUsageMetadata = null;
11093
+ let lastFlushTime = Date.now();
11094
+ let hasNewData = false;
11095
+ while (true) {
11096
+ const { done, value } = await reader.read();
11097
+ if (done) {
11098
+ if (hasNewData && (pendingParts.length > 0 || latestUsageMetadata)) {
11099
+ yield {
11100
+ candidates: pendingParts.length > 0 ? [{ content: { parts: pendingParts } }] : [],
11101
+ usageMetadata: latestUsageMetadata
11056
11102
  };
11057
- hasNewData = true;
11058
- }
11059
- const thinking = json.choices?.[0]?.delta?.reasoning || json.choices?.[0]?.delta?.reasoning_content || "";
11060
- const content = json.choices?.[0]?.delta?.content || "";
11061
- if (thinking) {
11062
- pendingParts.push({ text: thinking, thought: true });
11063
- hasNewData = true;
11103
+ hasYielded = true;
11064
11104
  }
11065
- if (content) {
11066
- pendingParts.push({ text: content });
11067
- hasNewData = true;
11105
+ break;
11106
+ }
11107
+ buffer += decoder.decode(value, { stream: true });
11108
+ const lines = buffer.split("\n");
11109
+ buffer = lines.pop();
11110
+ for (const line of lines) {
11111
+ const trimmed = line.trim();
11112
+ if (!trimmed || trimmed === "data: [DONE]") continue;
11113
+ if (trimmed.startsWith("data: ")) {
11114
+ let json;
11115
+ try {
11116
+ json = JSON.parse(trimmed.substring(6));
11117
+ } catch (e) {
11118
+ continue;
11119
+ }
11120
+ if (json.error) {
11121
+ throw new Error(`NVIDIA Stream Error: ${json.error.message || JSON.stringify(json.error)}`);
11122
+ }
11123
+ try {
11124
+ const usage = json.usage;
11125
+ if (usage) {
11126
+ latestUsageMetadata = {
11127
+ totalTokenCount: usage.total_tokens || usage.prompt_tokens + usage.completion_tokens,
11128
+ promptTokenCount: usage.prompt_tokens || 0,
11129
+ candidatesTokenCount: usage.completion_tokens || 0,
11130
+ thoughtsTokenCount: (usage.completion_tokens_details?.reasoning_tokens || 0) + (usage.completion_tokens_details?.thoughts_tokens || 0)
11131
+ };
11132
+ hasNewData = true;
11133
+ }
11134
+ const thinking = json.choices?.[0]?.delta?.reasoning || json.choices?.[0]?.delta?.reasoning_content || "";
11135
+ const content = json.choices?.[0]?.delta?.content || "";
11136
+ if (thinking) {
11137
+ pendingParts.push({ text: thinking, thought: true });
11138
+ hasNewData = true;
11139
+ }
11140
+ if (content) {
11141
+ pendingParts.push({ text: content });
11142
+ hasNewData = true;
11143
+ }
11144
+ } catch (e) {
11145
+ }
11068
11146
  }
11069
- } catch (e) {
11147
+ }
11148
+ if (Date.now() - lastFlushTime >= 350 && hasNewData) {
11149
+ yield {
11150
+ candidates: pendingParts.length > 0 ? [{ content: { parts: [...pendingParts] } }] : [],
11151
+ usageMetadata: latestUsageMetadata
11152
+ };
11153
+ hasYielded = true;
11154
+ pendingParts = [];
11155
+ lastFlushTime = Date.now();
11156
+ hasNewData = false;
11070
11157
  }
11071
11158
  }
11072
- }
11073
- if (Date.now() - lastFlushTime >= 350 && hasNewData) {
11074
- yield {
11075
- candidates: pendingParts.length > 0 ? [{ content: { parts: [...pendingParts] } }] : [],
11076
- usageMetadata: latestUsageMetadata
11077
- };
11078
- pendingParts = [];
11079
- lastFlushTime = Date.now();
11080
- hasNewData = false;
11159
+ break;
11160
+ } catch (error) {
11161
+ if (hasYielded || attempts >= maxAttempts) {
11162
+ throw error;
11163
+ }
11164
+ await new Promise((resolve) => setTimeout(resolve, 3500));
11081
11165
  }
11082
11166
  }
11083
11167
  };
@@ -11106,7 +11190,7 @@ var init_ai = __esm({
11106
11190
  if (data && data.queues && data.queues[0] && typeof data.queues[0].queueDepth === "number") {
11107
11191
  const depth = data.queues[0].queueDepth;
11108
11192
  if (!isStreamingStarted) {
11109
- push({ value: { type: "status", content: `Queue Depth ${depth}...` }, done: false });
11193
+ push({ value: { type: "status", content: `Queue ${depth || 1}` }, done: false });
11110
11194
  }
11111
11195
  }
11112
11196
  }
@@ -12496,7 +12580,7 @@ Provide a consolidated summary of the entire session.`;
12496
12580
  return result;
12497
12581
  };
12498
12582
  yield { type: "status", content: "[start]" };
12499
- yield { type: "status", content: "Gathering Context..." };
12583
+ yield { type: "status", content: "Gathering Context" };
12500
12584
  const totalFolders = countFolders(process.cwd());
12501
12585
  let dynamicMaxDepth = 12;
12502
12586
  if (totalFolders > 4096) dynamicMaxDepth = 1;
@@ -12826,7 +12910,7 @@ ${activeSummaryBlock}${thinkingLevel !== "Fast" && thinkingLevel !== "xHigh" &&
12826
12910
  let lastUsage = null;
12827
12911
  const MAX_LOOPS = mode === "Flux" ? 100 : 10;
12828
12912
  const MAX_RETRIES = 16;
12829
- yield { type: "status", content: "Connecting..." };
12913
+ yield { type: "status", content: "Connecting" };
12830
12914
  TERMINATION_SIGNAL = false;
12831
12915
  let fullAgentResponseChunks = [];
12832
12916
  let wasToolCalledInLastLoop = false;
@@ -12843,7 +12927,7 @@ ${activeSummaryBlock}${thinkingLevel !== "Fast" && thinkingLevel !== "xHigh" &&
12843
12927
  modifiedHistory = getTruncatedHistory(modifiedHistory, 6);
12844
12928
  }
12845
12929
  if (loop > 0) {
12846
- yield { type: "status", content: "Working..." };
12930
+ yield { type: "status", content: "Working" };
12847
12931
  }
12848
12932
  if (TERMINATION_SIGNAL) {
12849
12933
  yield { type: "status", content: "Request Cancelled" };
@@ -12998,15 +13082,15 @@ ${activeSummaryBlock}${thinkingLevel !== "Fast" && thinkingLevel !== "xHigh" &&
12998
13082
  currentSystemInstruction = getSystemInstruction(profile, !(targetModel || "gemma").toLowerCase().startsWith("gemma") ? thinkingLevel : thinkingLevel, mode, systemSettings, isMemoryEnabled, isFirstPrompt, aiProvider, aiProvider === "Google" ? true : isMultiModal, !(targetModel || "gemma").toLowerCase().startsWith("gemma") ? true : false);
12999
13083
  const lastUserMsg = contents[contents.length - 1];
13000
13084
  if (isBridgeConnected() & loop > 0) {
13001
- yield { type: "status", content: "Verifying..." };
13002
13085
  await new Promise((resolve) => setTimeout(resolve, 2500));
13086
+ yield { type: "status", content: "Verifying" };
13003
13087
  const ideCtxJIT = await getIDEContext();
13004
13088
  const ideErr = ideCtxJIT ? ideCtxJIT.diagnostics : null;
13005
13089
  if (ideErr && lastUserMsg && lastUserMsg.role === "user" && lastUserMsg.parts?.[0]?.text) {
13006
13090
  lastUserMsg.parts[0].text += `
13007
13091
  ${ideErr} [/ERROR]`;
13008
13092
  }
13009
- yield { type: "status", content: "Working..." };
13093
+ yield { type: "status", content: "Working" };
13010
13094
  }
13011
13095
  const isGemma = modelName && modelName.toLowerCase().startsWith("gemma") && aiProvider === "Google";
13012
13096
  if (isGemma) {
@@ -13305,7 +13389,7 @@ ${ideErr} [/ERROR]`;
13305
13389
  settings.onTokenChunk();
13306
13390
  }
13307
13391
  if (isFirstChunk) {
13308
- yield { type: "status", content: "Thinking..." };
13392
+ yield { type: "status", content: "Thinking" };
13309
13393
  isFirstChunk = false;
13310
13394
  }
13311
13395
  if (TERMINATION_SIGNAL) {
@@ -13461,11 +13545,11 @@ ${ideErr} [/ERROR]`;
13461
13545
  }
13462
13546
  }
13463
13547
  }
13464
- const currentLabel = `${TOOL_LABELS2[potentialTool] || potentialTool}${detail ? ` (${detail})` : ""}`;
13548
+ const currentLabel = `${TOOL_LABELS2[potentialTool] || potentialTool}${detail ? ` ${detail}` : ""}`;
13465
13549
  if (potentialTool !== lastToolSniffed || detail !== lastToolDetail) {
13466
13550
  lastToolSniffed = potentialTool;
13467
13551
  lastToolDetail = detail;
13468
- yield { type: "status", content: `${currentLabel}...` };
13552
+ yield { type: "status", content: `${currentLabel}` };
13469
13553
  if (process.stdout.isTTY) {
13470
13554
  const TOOL_TITLES = {
13471
13555
  "WebSearch": "Searching",
@@ -13641,7 +13725,7 @@ ${ideErr} [/ERROR]`;
13641
13725
  const normToolName = NORMALIZE_MAP[toolCall.toolName] || toolCall.toolName;
13642
13726
  const displayLabel = TOOL_LABELS2[normToolName] || toolCall.toolName;
13643
13727
  const detail = getToolDetail(normToolName, toolCall.args);
13644
- yield { type: "status", content: `${displayLabel}${detail ? ` (${detail})` : ""}...` };
13728
+ yield { type: "status", content: `${displayLabel}${detail ? ` ${detail}` : ""}` };
13645
13729
  let label = "";
13646
13730
  if (normToolName === "web_search") {
13647
13731
  const { query, limit = 10 } = parseArgs(toolCall.args);
@@ -14144,7 +14228,7 @@ ${boxMid}}`) };
14144
14228
  continue;
14145
14229
  }
14146
14230
  }
14147
- yield { type: "status", content: `Opening Diff in IDE: ${path21.basename(absPath)}...` };
14231
+ yield { type: "status", content: `Opening Diff in IDE: ${path21.basename(absPath)}` };
14148
14232
  showDiffInIDE(absPath, originalContent, modifiedContent);
14149
14233
  diffOpened = true;
14150
14234
  await new Promise((r) => setTimeout(r, 50));
@@ -14156,7 +14240,7 @@ ${boxMid}}`) };
14156
14240
  fs22.mkdirSync(path21.dirname(absPath), { recursive: true });
14157
14241
  fs22.writeFileSync(absPath, "", "utf8");
14158
14242
  }
14159
- yield { type: "status", content: `Opening New File Diff in IDE: ${path21.basename(absPath)}...` };
14243
+ yield { type: "status", content: `Opening New File Diff in IDE: ${path21.basename(absPath)}` };
14160
14244
  showDiffInIDE(absPath, "", modifiedContent);
14161
14245
  diffOpened = true;
14162
14246
  await new Promise((r) => setTimeout(r, 50));
@@ -14666,7 +14750,7 @@ ${colorMainWords(output)}` };
14666
14750
 
14667
14751
  `);
14668
14752
  const status = err.status || err.statusCode || err.code;
14669
- const isRetryable = status && (status >= 500 && status < 600 || status === 408) || !status && (/status[ :]+(5\d\d|408)/i.test(String(err)) || /code[ :]+(5\d\d|408)/i.test(String(err)) || /(500|503|408)/.test(String(err)));
14753
+ const isRetryable = status && (status >= 500 && status < 600 || status === 408 || status === 429) || !status && (/status[ :]+(5\d\d|408|429)/i.test(String(err)) || /code[ :]+(5\d\d|408|429)/i.test(String(err)) || /(500|503|408|429)/.test(String(err)));
14670
14754
  if (!isRetryable) {
14671
14755
  if (retryCount < MAX_RETRIES - 3) {
14672
14756
  throw err;
@@ -14716,13 +14800,13 @@ Error Log can be found in ${path21.join(LOGS_DIR, "agent", "error.log")}`);
14716
14800
  accumulatedContext = "";
14717
14801
  const waitTime = Math.min(1e3 * Math.pow(2, retryCount - 1), 32e3);
14718
14802
  isInitialAttempt = true;
14719
- yield { type: "status", content: `Trying to reach ${modelName} (${retryCount}/${MAX_RETRIES}) [Retrying in ${(waitTime / 1e3).toFixed(0)}s]...` };
14803
+ yield { type: "status", content: `Trying to reach ${modelName} (${retryCount}/${MAX_RETRIES}) [Retrying in ${(waitTime / 1e3).toFixed(0)}s]` };
14720
14804
  for (let i = waitTime / 1e3; i > 0; i--) {
14721
14805
  if (TERMINATION_SIGNAL) break;
14722
- yield { type: "status", content: `Trying to reach ${modelName} (${retryCount}/${MAX_RETRIES}) [Retrying in ${i}s]...` };
14806
+ yield { type: "status", content: `Trying to reach ${modelName} (${retryCount}/${MAX_RETRIES}) [Retrying in ${i}s]` };
14723
14807
  await new Promise((resolve) => setTimeout(resolve, 1e3));
14724
14808
  }
14725
- yield { type: "status", content: `Trying to reach ${modelName}...` };
14809
+ yield { type: "status", content: `Trying to reach ${modelName}` };
14726
14810
  } else {
14727
14811
  throw new Error(`Model ${modelName} cannot be reached. (Failed ${MAX_RETRIES} times)
14728
14812
  Error Log can be found in ${path21.join(LOGS_DIR, "agent", "error.log")}`);
@@ -14753,7 +14837,7 @@ Error Log can be found in ${path21.join(LOGS_DIR, "agent", "error.log")}`);
14753
14837
  const hasFinish = /\[\s*(turn\s*:)?\s*finish\s*\]/i.test(signalSafeText.toLowerCase()) || /\[\[END\]\]/i.test(signalSafeText.toLowerCase()) || true;
14754
14838
  const hasContinue = /\[\s*(turn\s*:)?\s*continue\s*\]/i.test(signalSafeText.toLowerCase());
14755
14839
  const shouldContinue = toolCallPointer > 0;
14756
- yield { type: "status", content: "Thinking..." };
14840
+ yield { type: "status", content: "Thinking" };
14757
14841
  const cleanedTurnText = contextSafeReplace(turnText, /(\[\s*(turn\s*:)?\s*(continue|finish)\s*\]|\[\[END\]\])/gi, "").trim();
14758
14842
  let isActuallyFinished = (hasFinish || toolResults.length === 0) && !isThinkingLoop && !isStutteringLoop && !isGeneralLoop;
14759
14843
  isActuallyFinished = toolResults.length === 0 ? isActuallyFinished : false;
@@ -14855,7 +14939,7 @@ Error Log can be found in ${path21.join(LOGS_DIR, "agent", "error.log")}`);
14855
14939
  }
14856
14940
  yield { type: "status", content: null };
14857
14941
  };
14858
- runSubagent = async (task, settings, model = null, allowedTools = null, maxTurns = 20, logCallback = null) => {
14942
+ runSubagent = async (task, settings, model = null, allowedTools = null, maxTurns = 50, logCallback = null) => {
14859
14943
  const savedSettings = await loadSettings();
14860
14944
  const mergedSettings = { ...savedSettings, ...settings };
14861
14945
  const targetModel = model || settings?.modelName || settings?.activeModel || savedSettings.activeModel;
@@ -14868,7 +14952,7 @@ Error Log can be found in ${path21.join(LOGS_DIR, "agent", "error.log")}`);
14868
14952
  "searchkeyword": '- [tool:functions.SearchKeyword(keyword="...", file="optional", subString="true/false")]. Global project text search',
14869
14953
  "websearch": '- [tool:functions.WebSearch(query="...", limit=number)]. Web Search',
14870
14954
  "webscrape": '- [tool:functions.WebScrape(url="...")]. Web Scrape',
14871
- "ask": `- [tool:functions.Ask(question="...", optionA="option::description", ...MAX 4)]. Ambiguity Resolution. Mandatory Triggers: Path Divergence, Security, Risk Mitigation. ask >> finish/guess. Suggest best options; don't ask for preferences`
14955
+ "ask": `- [tool:functions.Ask(question="...", optionA="option::description", ...MAX 4)]. Ambiguity Resolution. Mandatory Triggers: Path Divergence, Security, Risk Mitigation. ask >> finish/guess. Suggest best options; don't ask for preferences. 'option' SHOULD be short`
14872
14956
  };
14873
14957
  const providedToolsSection = `-- TOOL DEFINITIONS (path = relative to CWD, path separator: '/') --
14874
14958
  To call tools USE THIS EXACT SYNTAX: [tool:functions.ToolName(args)]. **NO OTHER SYNTAX/MARKERS/BOUNDARY ALLOWED**
@@ -14879,6 +14963,7 @@ TOOL POLICY:
14879
14963
  - Want spefific STRING across project/file? SearchKeyword >> Guessing/ReadFile
14880
14964
  - HUGE FILES? SearchKeyword >> FileMap/Full Read
14881
14965
  - NO Terminal Access
14966
+
14882
14967
  -- PROVIDED TOOLS --
14883
14968
  ${Object.values(SUBAGENT_TOOL_DEFINITIONS).join("\n")}
14884
14969
 
@@ -14998,6 +15083,55 @@ ${result}
14998
15083
  toolResultsStr += `[TOOL RESULT for ${toolCall.toolName}]: ${result}
14999
15084
 
15000
15085
  `;
15086
+ await incrementUsage("toolSuccess");
15087
+ if (normalizedToolName === "patchfile" || normalizedToolName === "update_file" || normalizedToolName === "updatefile" || normalizedToolName === "patch_file") {
15088
+ if (result) {
15089
+ const diffLines = result.split("\n");
15090
+ let added = 0, removed = 0, insideDiff = false;
15091
+ for (const line of diffLines) {
15092
+ if (line.includes("[DIFF_START]")) {
15093
+ insideDiff = true;
15094
+ continue;
15095
+ }
15096
+ if (line.includes("[DIFF_END]")) {
15097
+ insideDiff = false;
15098
+ continue;
15099
+ }
15100
+ if (insideDiff) {
15101
+ if (/^\+\d+/.test(line)) added++;
15102
+ else if (/^\-\d+/.test(line)) removed++;
15103
+ }
15104
+ }
15105
+ if (added > 0 || removed > 0) {
15106
+ await addToUsage("linesAdded", added);
15107
+ await addToUsage("linesRemoved", removed);
15108
+ }
15109
+ }
15110
+ } else if (normalizedToolName === "writefile" || normalizedToolName === "write_file") {
15111
+ if (result) {
15112
+ const statsMatch = result.match(/- Stats: \[(\d+) lines/);
15113
+ const verifiedLinesCount = statsMatch ? parseInt(statsMatch[1]) : 0;
15114
+ let oldLinesCount = 0;
15115
+ if (result.includes("Old File contents:")) {
15116
+ let insideOldFile = false;
15117
+ for (const line of result.split("\n")) {
15118
+ if (line.includes("Old File contents:")) {
15119
+ insideOldFile = true;
15120
+ continue;
15121
+ }
15122
+ if (insideOldFile) {
15123
+ if (line.trim() === "") {
15124
+ insideOldFile = false;
15125
+ } else if (/^\d+ \|/.test(line)) oldLinesCount++;
15126
+ }
15127
+ }
15128
+ }
15129
+ if (verifiedLinesCount > 0 || oldLinesCount > 0) {
15130
+ await addToUsage("linesAdded", verifiedLinesCount);
15131
+ await addToUsage("linesRemoved", oldLinesCount);
15132
+ }
15133
+ }
15134
+ }
15001
15135
  } catch (e) {
15002
15136
  const errorMsg = `ERROR: Execution failed for [${toolCall.toolName}]: ${e.message}`;
15003
15137
  if (logCallback) logCallback(`[Tool Error] ${errorMsg}
@@ -15005,6 +15139,7 @@ ${result}
15005
15139
  toolResultsStr += `${errorMsg}
15006
15140
 
15007
15141
  `;
15142
+ await incrementUsage("toolFailure");
15008
15143
  }
15009
15144
  }
15010
15145
  subagentHistory.push({ role: "user", text: toolResultsStr.trim() });
@@ -15868,14 +16003,68 @@ var init_setup = __esm({
15868
16003
  }
15869
16004
  });
15870
16005
 
16006
+ // src/components/GlintText.jsx
16007
+ import React15, { useState as useState14, useEffect as useEffect11 } from "react";
16008
+ import { Text as Text15 } from "ink";
16009
+ var GlintText, GlintText_default;
16010
+ var init_GlintText = __esm({
16011
+ "src/components/GlintText.jsx"() {
16012
+ GlintText = ({
16013
+ text,
16014
+ baseColor = "white",
16015
+ glintColor = "gray",
16016
+ speed = 150,
16017
+ glintWidth = 6,
16018
+ typeSpeed = 30,
16019
+ // 👈 New prop! How fast it backspaces and types! ⌨️
16020
+ ...props
16021
+ }) => {
16022
+ const [position, setPosition] = useState14(-glintWidth);
16023
+ const [displayedText, setDisplayedText] = useState14(text);
16024
+ useEffect11(() => {
16025
+ const timer = setInterval(() => {
16026
+ setPosition((prev) => prev > displayedText.length + glintWidth ? -glintWidth - 40 : prev + 1);
16027
+ }, speed);
16028
+ return () => clearInterval(timer);
16029
+ }, [displayedText.length, speed, glintWidth]);
16030
+ useEffect11(() => {
16031
+ if (text && text.includes("Trying to reach")) {
16032
+ setDisplayedText(text);
16033
+ return;
16034
+ }
16035
+ if (displayedText === text) return;
16036
+ const timer = setTimeout(() => {
16037
+ let commonLen = 0;
16038
+ const minLen = Math.min(displayedText.length, text.length);
16039
+ while (commonLen < minLen && displayedText[commonLen] === text[commonLen]) {
16040
+ commonLen++;
16041
+ }
16042
+ if (displayedText.length > commonLen) {
16043
+ setDisplayedText((prev) => prev.slice(0, -1));
16044
+ } else if (displayedText.length < text.length) {
16045
+ setDisplayedText(text.slice(0, displayedText.length + 1));
16046
+ }
16047
+ }, typeSpeed);
16048
+ return () => clearTimeout(timer);
16049
+ }, [text, displayedText, typeSpeed]);
16050
+ return /* @__PURE__ */ React15.createElement(Text15, null, displayedText.split("").map((char, index) => {
16051
+ const distance = Math.abs(index - position);
16052
+ const color = distance <= glintWidth / 2 ? glintColor : baseColor;
16053
+ return /* @__PURE__ */ React15.createElement(Text15, { key: index, color, ...props }, char);
16054
+ }));
16055
+ };
16056
+ GlintText_default = GlintText;
16057
+ }
16058
+ });
16059
+
15871
16060
  // src/app.jsx
15872
16061
  var app_exports = {};
15873
16062
  __export(app_exports, {
15874
16063
  default: () => App
15875
16064
  });
15876
16065
  import os5 from "os";
15877
- import React15, { useState as useState14, useEffect as useEffect11, useRef as useRef4, useMemo as useMemo2 } from "react";
15878
- import { Box as Box14, Text as Text15, useInput as useInput9, useStdout as useStdout2, Static } from "ink";
16066
+ import React16, { useState as useState15, useEffect as useEffect12, useRef as useRef4, useMemo as useMemo2 } from "react";
16067
+ import { Box as Box14, Text as Text16, useInput as useInput9, useStdout as useStdout2, Static } from "ink";
15879
16068
  import fs24 from "fs-extra";
15880
16069
  import path22 from "path";
15881
16070
  import { exec as exec2 } from "child_process";
@@ -15885,24 +16074,24 @@ import SelectInput2 from "ink-select-input";
15885
16074
  import gradient2 from "gradient-string";
15886
16075
  function App({ args = [] }) {
15887
16076
  let lastGCTime = 1;
15888
- const [confirmExit, setConfirmExit] = useState14(false);
15889
- const [exitCountdown, setExitCountdown] = useState14(10);
16077
+ const [confirmExit, setConfirmExit] = useState15(false);
16078
+ const [exitCountdown, setExitCountdown] = useState15(10);
15890
16079
  const { stdout } = useStdout2();
15891
- const [input, setInput] = useState14("");
15892
- const [inputKey, setInputKey] = useState14(0);
15893
- const [isExpanded, setIsExpanded] = useState14(false);
15894
- const [mode, setMode] = useState14("Flux");
15895
- const [terminalSize, setTerminalSize] = useState14({
16080
+ const [input, setInput] = useState15("");
16081
+ const [inputKey, setInputKey] = useState15(0);
16082
+ const [isExpanded, setIsExpanded] = useState15(false);
16083
+ const [mode, setMode] = useState15("Flux");
16084
+ const [terminalSize, setTerminalSize] = useState15({
15896
16085
  columns: stdout?.columns || 80,
15897
16086
  rows: stdout?.rows || 24
15898
16087
  });
15899
- const [selectedIndex, setSelectedIndex] = useState14(0);
15900
- const [isFilePickerDismissed, setIsFilePickerDismissed] = useState14(false);
15901
- const [showBridgePromo, setShowBridgePromo] = useState14(false);
15902
- const [promoSelectedIndex, setPromoSelectedIndex] = useState14(0);
16088
+ const [selectedIndex, setSelectedIndex] = useState15(0);
16089
+ const [isFilePickerDismissed, setIsFilePickerDismissed] = useState15(false);
16090
+ const [showBridgePromo, setShowBridgePromo] = useState15(false);
16091
+ const [promoSelectedIndex, setPromoSelectedIndex] = useState15(0);
15903
16092
  const suggestionOffsetRef = useRef4(0);
15904
16093
  const persistedModelRef = useRef4(null);
15905
- useEffect11(() => {
16094
+ useEffect12(() => {
15906
16095
  const ideName = getIDEName();
15907
16096
  const isIDE = !["Terminal", "Windows Terminal"].includes(ideName) || !!process.env.VSC_TERMINAL_URL;
15908
16097
  const graceTimer = setTimeout(() => {
@@ -16096,7 +16285,7 @@ function App({ args = [] }) {
16096
16285
  }
16097
16286
  }
16098
16287
  };
16099
- useEffect11(() => {
16288
+ useEffect12(() => {
16100
16289
  const handleResize = () => {
16101
16290
  stdout.write("\x1B[2J\x1B[3J\x1B[H");
16102
16291
  setTerminalSize({
@@ -16109,18 +16298,18 @@ function App({ args = [] }) {
16109
16298
  stdout.off("resize", handleResize);
16110
16299
  };
16111
16300
  }, [stdout]);
16112
- const [thinkingLevel, setThinkingLevel] = useState14("Medium");
16113
- const [aiProvider, setAiProvider] = useState14("Google");
16114
- const [setupStep, setSetupStep] = useState14(0);
16115
- const [latestVer, setLatestVer] = useState14(null);
16116
- const [showFullThinking, setShowFullThinking] = useState14(false);
16117
- const [activeModel, setActiveModel] = useState14("gemma-4-31b-it");
16118
- const [janitorModel, setJanitorModel] = useState14("gemma-4-26b-a4b-it");
16119
- const [isInitializing, setIsInitializing] = useState14(true);
16120
- const [isAppFocused, setIsAppFocused] = useState14(true);
16301
+ const [thinkingLevel, setThinkingLevel] = useState15("Medium");
16302
+ const [aiProvider, setAiProvider] = useState15("Google");
16303
+ const [setupStep, setSetupStep] = useState15(0);
16304
+ const [latestVer, setLatestVer] = useState15(null);
16305
+ const [showFullThinking, setShowFullThinking] = useState15(false);
16306
+ const [activeModel, setActiveModel] = useState15("gemma-4-31b-it");
16307
+ const [janitorModel, setJanitorModel] = useState15("gemma-4-26b-a4b-it");
16308
+ const [isInitializing, setIsInitializing] = useState15(true);
16309
+ const [isAppFocused, setIsAppFocused] = useState15(true);
16121
16310
  const lastFocusEventTime = useRef4(0);
16122
- const [apiKey, setApiKey] = useState14(null);
16123
- const [tempKey, setTempKey] = useState14("");
16311
+ const [apiKey, setApiKey] = useState15(null);
16312
+ const [tempKey, setTempKey] = useState15("");
16124
16313
  const addShiftEnterBinding = async (ideName) => {
16125
16314
  const kbPath = getKeybindingsPath(ideName);
16126
16315
  if (!kbPath) return;
@@ -16171,41 +16360,41 @@ function App({ args = [] }) {
16171
16360
  });
16172
16361
  }
16173
16362
  };
16174
- const [activeView, setActiveView] = useState14("chat");
16175
- const [apiTier, setApiTier] = useState14("Free");
16176
- const [quotas, setQuotas] = useState14({ limitMode: "Daily", agentLimit: 99999999, tokenLimit: 99999999999999, backgroundLimit: 999999, searchLimit: 100, customModelId: "", customLimit: 0, providerBudgets: {} });
16177
- const [inputConfig, setInputConfig] = useState14(null);
16178
- const [budgetReturnView, setBudgetReturnView] = useState14("chat");
16179
- const [providerBudgetQueue, setProviderBudgetQueue] = useState14([]);
16180
- const [providerBudgetCursor, setProviderBudgetCursor] = useState14(0);
16181
- const [pbsCursor, setPbsCursor] = useState14(0);
16182
- const [pbsSelected, setPbsSelected] = useState14({});
16183
- const [systemSettings, setSystemSettings] = useState14({ memory: true, compression: 0, autoExec: false, autoDeleteHistory: "7d", autoUpdate: false, updateManager: "npm", customUpdateCommand: "" });
16184
- const [profileData, setProfileData] = useState14({ name: null, nickname: null, instructions: null });
16185
- const [imageSettings, setImageSettings] = useState14({ keyType: "Default", quality: "Low-High", apiKey: "" });
16186
- const [sessionStats, setSessionStats] = useState14({ tokens: 0 });
16187
- const [lastChunkTime, setLastChunkTime] = useState14(0);
16188
- const [sessionAgentCalls, setSessionAgentCalls] = useState14(0);
16189
- const [sessionBackgroundCalls, setSessionBackgroundCalls] = useState14(0);
16190
- const [sessionTotalTokens, setSessionTotalTokens] = useState14(0);
16191
- const [chatTokens, setChatTokens] = useState14(0);
16363
+ const [activeView, setActiveView] = useState15("chat");
16364
+ const [apiTier, setApiTier] = useState15("Free");
16365
+ const [quotas, setQuotas] = useState15({ limitMode: "Daily", agentLimit: 99999999, tokenLimit: 99999999999999, backgroundLimit: 999999, searchLimit: 100, customModelId: "", customLimit: 0, providerBudgets: {} });
16366
+ const [inputConfig, setInputConfig] = useState15(null);
16367
+ const [budgetReturnView, setBudgetReturnView] = useState15("chat");
16368
+ const [providerBudgetQueue, setProviderBudgetQueue] = useState15([]);
16369
+ const [providerBudgetCursor, setProviderBudgetCursor] = useState15(0);
16370
+ const [pbsCursor, setPbsCursor] = useState15(0);
16371
+ const [pbsSelected, setPbsSelected] = useState15({});
16372
+ const [systemSettings, setSystemSettings] = useState15({ memory: true, compression: 0, autoExec: false, autoDeleteHistory: "7d", autoUpdate: false, updateManager: "npm", customUpdateCommand: "" });
16373
+ const [profileData, setProfileData] = useState15({ name: null, nickname: null, instructions: null });
16374
+ const [imageSettings, setImageSettings] = useState15({ keyType: "Default", quality: "Low-High", apiKey: "" });
16375
+ const [sessionStats, setSessionStats] = useState15({ tokens: 0 });
16376
+ const [lastChunkTime, setLastChunkTime] = useState15(0);
16377
+ const [sessionAgentCalls, setSessionAgentCalls] = useState15(0);
16378
+ const [sessionBackgroundCalls, setSessionBackgroundCalls] = useState15(0);
16379
+ const [sessionTotalTokens, setSessionTotalTokens] = useState15(0);
16380
+ const [chatTokens, setChatTokens] = useState15(0);
16192
16381
  const chatTokenStartRef = useRef4(0);
16193
- const [sessionTotalCachedTokens, setSessionTotalCachedTokens] = useState14(0);
16194
- const [sessionTotalCandidateTokens, setSessionTotalCandidateTokens] = useState14(0);
16195
- const [sessionToolSuccess, setSessionToolSuccess] = useState14(0);
16196
- const [sessionToolFailure, setSessionToolFailure] = useState14(0);
16197
- const [sessionToolDenied, setSessionToolDenied] = useState14(0);
16198
- const [sessionApiTime, setSessionApiTime] = useState14(0);
16199
- const [sessionToolTime, setSessionToolTime] = useState14(0);
16200
- const [sessionImageCount, setSessionImageCount] = useState14(0);
16201
- const [sessionImageCredits, setSessionImageCredits] = useState14(0);
16202
- const [dailyUsage, setDailyUsage] = useState14(null);
16203
- const [monthlyUsage, setMonthlyUsage] = useState14(null);
16204
- const [customPeriodUsage, setCustomPeriodUsage] = useState14(null);
16205
- const [statsMode, setStatsMode] = useState14("daily");
16382
+ const [sessionTotalCachedTokens, setSessionTotalCachedTokens] = useState15(0);
16383
+ const [sessionTotalCandidateTokens, setSessionTotalCandidateTokens] = useState15(0);
16384
+ const [sessionToolSuccess, setSessionToolSuccess] = useState15(0);
16385
+ const [sessionToolFailure, setSessionToolFailure] = useState15(0);
16386
+ const [sessionToolDenied, setSessionToolDenied] = useState15(0);
16387
+ const [sessionApiTime, setSessionApiTime] = useState15(0);
16388
+ const [sessionToolTime, setSessionToolTime] = useState15(0);
16389
+ const [sessionImageCount, setSessionImageCount] = useState15(0);
16390
+ const [sessionImageCredits, setSessionImageCredits] = useState15(0);
16391
+ const [dailyUsage, setDailyUsage] = useState15(null);
16392
+ const [monthlyUsage, setMonthlyUsage] = useState15(null);
16393
+ const [customPeriodUsage, setCustomPeriodUsage] = useState15(null);
16394
+ const [statsMode, setStatsMode] = useState15("daily");
16206
16395
  const PLAYGROUND_CHAT_ID = "flow-playground";
16207
- const [chatId, setChatId] = useState14(args.includes("--playground") ? PLAYGROUND_CHAT_ID : generateChatId());
16208
- useEffect11(() => {
16396
+ const [chatId, setChatId] = useState15(args.includes("--playground") ? PLAYGROUND_CHAT_ID : generateChatId());
16397
+ useEffect12(() => {
16209
16398
  if (chatLoadingRef.current) return;
16210
16399
  const nextTokens = sessionTotalTokens - chatTokenStartRef.current;
16211
16400
  setChatTokens(nextTokens);
@@ -16214,7 +16403,7 @@ function App({ args = [] }) {
16214
16403
  });
16215
16404
  }
16216
16405
  }, [sessionTotalTokens, chatId, sessionStats.tokens]);
16217
- useEffect11(() => {
16406
+ useEffect12(() => {
16218
16407
  if (activeView === "apiTier") {
16219
16408
  const load = async () => {
16220
16409
  const d = await getDailyUsage();
@@ -16227,18 +16416,18 @@ function App({ args = [] }) {
16227
16416
  load();
16228
16417
  }
16229
16418
  }, [activeView, quotas.resetDay]);
16230
- const [activeCommand, setActiveCommand] = useState14(null);
16231
- const [execOutput, setExecOutput] = useState14("");
16232
- const [isTerminalFocused, setIsTerminalFocused] = useState14(false);
16233
- const [activeSubagents, setActiveSubagents] = useState14([]);
16234
- const [tick, setTick] = useState14(0);
16419
+ const [activeCommand, setActiveCommand] = useState15(null);
16420
+ const [execOutput, setExecOutput] = useState15("");
16421
+ const [isTerminalFocused, setIsTerminalFocused] = useState15(false);
16422
+ const [activeSubagents, setActiveSubagents] = useState15([]);
16423
+ const [tick, setTick] = useState15(0);
16235
16424
  const isFirstRender = useRef4(true);
16236
16425
  const isSecondRender = useRef4(true);
16237
16426
  const isThirdRender = useRef4(true);
16238
16427
  const prevProviderRef = useRef4(aiProvider);
16239
16428
  const originalAllowExternalAccessRef = useRef4(false);
16240
16429
  const originalMemoryRef = useRef4(true);
16241
- useEffect11(() => {
16430
+ useEffect12(() => {
16242
16431
  if (prevProviderRef.current !== aiProvider) {
16243
16432
  prevProviderRef.current = aiProvider;
16244
16433
  const hasStandard = aiProvider === "DeepSeek" || aiProvider === "NVIDIA";
@@ -16251,7 +16440,7 @@ function App({ args = [] }) {
16251
16440
  }
16252
16441
  }
16253
16442
  }, [aiProvider, activeModel, thinkingLevel]);
16254
- useEffect11(() => {
16443
+ useEffect12(() => {
16255
16444
  if (!apiKey) return;
16256
16445
  if (isFirstRender.current) {
16257
16446
  isFirstRender.current = false;
@@ -16325,15 +16514,15 @@ function App({ args = [] }) {
16325
16514
  }, []);
16326
16515
  const activeCommandRef = useRef4(null);
16327
16516
  const execOutputRef = useRef4("");
16328
- useEffect11(() => {
16517
+ useEffect12(() => {
16329
16518
  activeCommandRef.current = activeCommand;
16330
16519
  }, [activeCommand]);
16331
- useEffect11(() => {
16520
+ useEffect12(() => {
16332
16521
  execOutputRef.current = execOutput;
16333
16522
  }, [execOutput]);
16334
- const [autoAcceptWrites, setAutoAcceptWrites] = useState14(false);
16335
- const [pendingApproval, setPendingApproval] = useState14(null);
16336
- const [pendingAsk, setPendingAsk] = useState14(null);
16523
+ const [autoAcceptWrites, setAutoAcceptWrites] = useState15(false);
16524
+ const [pendingApproval, setPendingApproval] = useState15(null);
16525
+ const [pendingAsk, setPendingAsk] = useState15(null);
16337
16526
  const resetPendingApproval = (decision) => {
16338
16527
  setPendingApproval(null);
16339
16528
  setActiveView("chat");
@@ -16352,14 +16541,14 @@ function App({ args = [] }) {
16352
16541
  if (ms < 1e3) return `${ms}ms`;
16353
16542
  return formatDuration(Math.floor(ms / 1e3));
16354
16543
  };
16355
- const [statusText, setStatusText] = useState14(null);
16356
- const [wittyPhrase, setWittyPhrase] = useState14("");
16357
- const [hasPasteBlock, setHasPasteBlock] = useState14(false);
16358
- const [activeTime, setActiveTime] = useState14(0);
16544
+ const [statusText, setStatusText] = useState15(null);
16545
+ const [wittyPhrase, setWittyPhrase] = useState15("");
16546
+ const [hasPasteBlock, setHasPasteBlock] = useState15(false);
16547
+ const [activeTime, setActiveTime] = useState15(0);
16359
16548
  let interval_for_timer;
16360
- useEffect11(() => {
16549
+ useEffect12(() => {
16361
16550
  let interval;
16362
- if (statusText) {
16551
+ if (statusText && systemSettings.loadingPhrases !== false) {
16363
16552
  const updatePhrase = () => {
16364
16553
  const randomPhrase = WITTY_LOADING_PHRASES[Math.floor(Math.random() * WITTY_LOADING_PHRASES.length)];
16365
16554
  setWittyPhrase(randomPhrase);
@@ -16372,17 +16561,17 @@ function App({ args = [] }) {
16372
16561
  return () => {
16373
16562
  clearInterval(interval);
16374
16563
  };
16375
- }, [statusText]);
16376
- const [isSpinnerActive, setIsSpinnerActive] = useState14(true);
16377
- const [isProcessing, setIsProcessing] = useState14(false);
16378
- const [isCompressing, setIsCompressing] = useState14(false);
16379
- const [escPressed, setEscPressed] = useState14(false);
16380
- const [escTimer, setEscTimer] = useState14(null);
16381
- const [escPressCount, setEscPressCount] = useState14(0);
16382
- const [recentPrompts, setRecentPrompts] = useState14([]);
16564
+ }, [statusText, systemSettings]);
16565
+ const [isSpinnerActive, setIsSpinnerActive] = useState15(true);
16566
+ const [isProcessing, setIsProcessing] = useState15(false);
16567
+ const [isCompressing, setIsCompressing] = useState15(false);
16568
+ const [escPressed, setEscPressed] = useState15(false);
16569
+ const [escTimer, setEscTimer] = useState15(null);
16570
+ const [escPressCount, setEscPressCount] = useState15(0);
16571
+ const [recentPrompts, setRecentPrompts] = useState15([]);
16383
16572
  const escDoubleTimerRef = useRef4(null);
16384
16573
  const chatLoadingRef = useRef4(false);
16385
- useEffect11(() => {
16574
+ useEffect12(() => {
16386
16575
  return () => {
16387
16576
  if (escDoubleTimerRef.current) {
16388
16577
  clearTimeout(escDoubleTimerRef.current);
@@ -16390,11 +16579,11 @@ function App({ args = [] }) {
16390
16579
  };
16391
16580
  }, []);
16392
16581
  const didSignalTerminationRef = useRef4(false);
16393
- const [queuedPrompt, setQueuedPrompt] = useState14(null);
16394
- const [resolutionData, setResolutionData] = useState14(null);
16395
- const [tempModelOverride, setTempModelOverride] = useState14(null);
16396
- useEffect11(() => setEscPressCount(0), [input]);
16397
- const [messages, rawSetMessages] = useState14(() => {
16582
+ const [queuedPrompt, setQueuedPrompt] = useState15(null);
16583
+ const [resolutionData, setResolutionData] = useState15(null);
16584
+ const [tempModelOverride, setTempModelOverride] = useState15(null);
16585
+ useEffect12(() => setEscPressCount(0), [input]);
16586
+ const [messages, rawSetMessages] = useState15(() => {
16398
16587
  const logoMsg = { id: "logo-" + Date.now(), role: "system", isLogo: true, isMeta: true };
16399
16588
  const isHomeDir = process.cwd() === os5.homedir();
16400
16589
  const isSystemDir = (() => {
@@ -16443,11 +16632,11 @@ function App({ args = [] }) {
16443
16632
  });
16444
16633
  };
16445
16634
  const queuedPromptRef = useRef4(null);
16446
- const [btwResponse, setBtwResponse] = useState14("");
16447
- const [showBtwBox, setShowBtwBox] = useState14(false);
16635
+ const [btwResponse, setBtwResponse] = useState15("");
16636
+ const [showBtwBox, setShowBtwBox] = useState15(false);
16448
16637
  const btwResponseRef = useRef4("");
16449
16638
  const btwClosedRef = useRef4(null);
16450
- useEffect11(() => {
16639
+ useEffect12(() => {
16451
16640
  if (messages.length === 0) return;
16452
16641
  const lastMsg = messages[messages.length - 1];
16453
16642
  if (lastMsg && (lastMsg.role === "agent" || lastMsg.role === "assistant")) {
@@ -16465,8 +16654,8 @@ function App({ args = [] }) {
16465
16654
  }
16466
16655
  }
16467
16656
  }, [messages]);
16468
- const [completedIndex, setCompletedIndex] = useState14(messages.length);
16469
- const [clearKey, setClearKey] = useState14(0);
16657
+ const [completedIndex, setCompletedIndex] = useState15(messages.length);
16658
+ const [clearKey, setClearKey] = useState15(0);
16470
16659
  const lastCompletedBlocksRef = useRef4([]);
16471
16660
  const cachedHistoryRef = useRef4({
16472
16661
  completedIndex: 0,
@@ -16803,7 +16992,7 @@ function App({ args = [] }) {
16803
16992
  setInput((prev) => prev.replace(/\\\r?$/, "").replace(/\r?$/, "") + "\n");
16804
16993
  }
16805
16994
  });
16806
- useEffect11(() => {
16995
+ useEffect12(() => {
16807
16996
  process.stdout.write("\x1B[?1004h");
16808
16997
  const onData = (data) => {
16809
16998
  const str = data.toString();
@@ -16821,7 +17010,7 @@ function App({ args = [] }) {
16821
17010
  process.stdin.off("data", onData);
16822
17011
  };
16823
17012
  }, []);
16824
- useEffect11(() => {
17013
+ useEffect12(() => {
16825
17014
  async function init() {
16826
17015
  try {
16827
17016
  const pkg = JSON.parse(fs24.readFileSync(path22.join(process.cwd(), "package.json"), "utf8"));
@@ -17043,7 +17232,7 @@ function App({ args = [] }) {
17043
17232
  }
17044
17233
  init();
17045
17234
  }, []);
17046
- useEffect11(() => {
17235
+ useEffect12(() => {
17047
17236
  let timer;
17048
17237
  if (confirmExit) {
17049
17238
  setExitCountdown(10);
@@ -17061,7 +17250,7 @@ function App({ args = [] }) {
17061
17250
  if (timer) clearInterval(timer);
17062
17251
  };
17063
17252
  }, [confirmExit]);
17064
- useEffect11(() => {
17253
+ useEffect12(() => {
17065
17254
  if (!isInitializing) {
17066
17255
  const modelToSave = parsedArgs.model && activeModel === parsedArgs.model ? persistedModelRef.current : activeModel;
17067
17256
  let settingsToSave = systemSettings;
@@ -17111,7 +17300,7 @@ function App({ args = [] }) {
17111
17300
  }
17112
17301
  };
17113
17302
  const lastSavedTimeRef = useRef4(SESSION_START_TIME);
17114
- useEffect11(() => {
17303
+ useEffect12(() => {
17115
17304
  if (activeView === "exit") {
17116
17305
  const flush = async () => {
17117
17306
  const now = Date.now();
@@ -17129,7 +17318,7 @@ function App({ args = [] }) {
17129
17318
  return () => clearTimeout(timer);
17130
17319
  }
17131
17320
  }, [activeView]);
17132
- useEffect11(() => {
17321
+ useEffect12(() => {
17133
17322
  const interval = setInterval(async () => {
17134
17323
  if (!isInitializing) {
17135
17324
  const now = Date.now();
@@ -18476,6 +18665,7 @@ ${timestamp}` };
18476
18665
  id: "ask-" + Date.now(),
18477
18666
  role: "system",
18478
18667
  text: `\u{1F4AC} **Ask User**
18668
+ Question: ${question}
18479
18669
  Selection: ${val}`,
18480
18670
  isAskRecord: true
18481
18671
  }
@@ -18555,7 +18745,9 @@ Selection: ${val}`,
18555
18745
  isFirstPacket = false;
18556
18746
  }
18557
18747
  if (packet.type === "status") {
18558
- setStatusText(packet.content);
18748
+ if (!packet.content?.includes("[start]")) {
18749
+ setStatusText(packet.content);
18750
+ }
18559
18751
  if (packet.content?.includes("[start]")) {
18560
18752
  clearInterval(interval_for_timer);
18561
18753
  setActiveTime(0);
@@ -18729,8 +18921,6 @@ Selection: ${val}`,
18729
18921
  }
18730
18922
  }
18731
18923
  }
18732
- linesAdded += added;
18733
- linesRemoved += removed;
18734
18924
  addToUsage("linesAdded", added);
18735
18925
  addToUsage("linesRemoved", removed);
18736
18926
  } else if (packet.toolName === "write_file" && packet.aiContent) {
@@ -18754,8 +18944,6 @@ Selection: ${val}`,
18754
18944
  }
18755
18945
  }
18756
18946
  }
18757
- linesAdded += verifiedLinesCount;
18758
- linesRemoved += oldLinesCount;
18759
18947
  addToUsage("linesAdded", verifiedLinesCount);
18760
18948
  addToUsage("linesRemoved", oldLinesCount);
18761
18949
  }
@@ -19010,10 +19198,10 @@ Selection: ${val}`,
19010
19198
  }
19011
19199
  return [];
19012
19200
  }, [input, isFilePickerDismissed]);
19013
- useEffect11(() => {
19201
+ useEffect12(() => {
19014
19202
  setSelectedIndex(0);
19015
19203
  }, [suggestions]);
19016
- useEffect11(() => {
19204
+ useEffect12(() => {
19017
19205
  if (activeView !== "providerBudgetSelect") return;
19018
19206
  const PBS_PROVIDERS = ["Google", "DeepSeek", "NVIDIA", "OpenRouter"];
19019
19207
  const existingBudgets = quotas.providerBudgets || {};
@@ -19024,7 +19212,7 @@ Selection: ${val}`,
19024
19212
  setPbsSelected(initialSelected);
19025
19213
  setPbsCursor(0);
19026
19214
  }, [activeView]);
19027
- useEffect11(() => {
19215
+ useEffect12(() => {
19028
19216
  if (activeView !== "providerBudgetFlow") return;
19029
19217
  const currentProvider = providerBudgetQueue[providerBudgetCursor];
19030
19218
  if (!currentProvider) {
@@ -19096,7 +19284,7 @@ Selection: ${val}`,
19096
19284
  }, [activeView, providerBudgetCursor]);
19097
19285
  const CustomMenuItem = ({ label, isSelected }) => {
19098
19286
  const isCancel = label === "Cancel" || label === "Back" || label.toLowerCase().includes("exit") || label.toLowerCase().includes("back");
19099
- return /* @__PURE__ */ React15.createElement(
19287
+ return /* @__PURE__ */ React16.createElement(
19100
19288
  Box14,
19101
19289
  {
19102
19290
  marginTop: isCancel ? 1 : 0,
@@ -19104,7 +19292,7 @@ Selection: ${val}`,
19104
19292
  paddingX: 1,
19105
19293
  width: "100%"
19106
19294
  },
19107
- /* @__PURE__ */ React15.createElement(Text15, { color: isSelected ? "white" : "gray", bold: isSelected }, isSelected ? "\u276F " : " ", label)
19295
+ /* @__PURE__ */ React16.createElement(Text16, { color: isSelected ? "white" : "gray", bold: isSelected }, isSelected ? "\u276F " : " ", label)
19108
19296
  );
19109
19297
  };
19110
19298
  const renderProgressBar = (label, current, limit) => {
@@ -19121,12 +19309,12 @@ Selection: ${val}`,
19121
19309
  const isTokens = label.toLowerCase().includes("token");
19122
19310
  const displayLimit = shouldClearValue(limit) ? "\u221E" : isTokens ? formatTokens(limit) : limit;
19123
19311
  const displayCurrent = isTokens ? formatTokens(current) : current;
19124
- return /* @__PURE__ */ React15.createElement(Box14, { flexDirection: "row", paddingLeft: 4, key: label }, /* @__PURE__ */ React15.createElement(Box14, { width: 18 }, /* @__PURE__ */ React15.createElement(Text15, { color: "gray" }, label, ": ")), /* @__PURE__ */ React15.createElement(Text15, { color: barColor }, barStr), /* @__PURE__ */ React15.createElement(Text15, { color: "gray" }, " ", percent, "% (", displayCurrent, "/", displayLimit, ")"));
19312
+ return /* @__PURE__ */ React16.createElement(Box14, { flexDirection: "row", paddingLeft: 4, key: label }, /* @__PURE__ */ React16.createElement(Box14, { width: 18 }, /* @__PURE__ */ React16.createElement(Text16, { color: "gray" }, label, ": ")), /* @__PURE__ */ React16.createElement(Text16, { color: barColor }, barStr), /* @__PURE__ */ React16.createElement(Text16, { color: "gray" }, " ", percent, "% (", displayCurrent, "/", displayLimit, ")"));
19125
19313
  };
19126
19314
  const renderActiveView = () => {
19127
19315
  switch (activeView) {
19128
19316
  case "settings":
19129
- return /* @__PURE__ */ React15.createElement(
19317
+ return /* @__PURE__ */ React16.createElement(
19130
19318
  SettingsMenu,
19131
19319
  {
19132
19320
  systemSettings,
@@ -19141,7 +19329,7 @@ Selection: ${val}`,
19141
19329
  }
19142
19330
  );
19143
19331
  case "selectProvider":
19144
- return /* @__PURE__ */ React15.createElement(
19332
+ return /* @__PURE__ */ React16.createElement(
19145
19333
  CommandMenu,
19146
19334
  {
19147
19335
  title: "SELECT AI PROVIDER",
@@ -19199,7 +19387,7 @@ Selection: ${val}`,
19199
19387
  }
19200
19388
  );
19201
19389
  case "apiTier": {
19202
- return /* @__PURE__ */ React15.createElement(Box14, { flexDirection: "column", borderStyle: "round", borderColor: "white", padding: 0, width: "100%" }, /* @__PURE__ */ React15.createElement(Box14, { paddingX: 1, marginBottom: 1 }, /* @__PURE__ */ React15.createElement(Text15, { color: "white", bold: true }, "SELECT API MODE FOR ", aiProvider.toUpperCase())), /* @__PURE__ */ React15.createElement(
19390
+ return /* @__PURE__ */ React16.createElement(Box14, { flexDirection: "column", borderStyle: "round", borderColor: "white", padding: 0, width: "100%" }, /* @__PURE__ */ React16.createElement(Box14, { paddingX: 1, marginBottom: 1 }, /* @__PURE__ */ React16.createElement(Text16, { color: "white", bold: true }, "SELECT API MODE FOR ", aiProvider.toUpperCase())), /* @__PURE__ */ React16.createElement(
19203
19391
  SelectInput2,
19204
19392
  {
19205
19393
  items: [
@@ -19229,10 +19417,10 @@ Selection: ${val}`,
19229
19417
  itemComponent: CustomMenuItem,
19230
19418
  indicatorComponent: () => null
19231
19419
  }
19232
- ), /* @__PURE__ */ React15.createElement(Box14, { paddingX: 1, marginTop: 1 }, /* @__PURE__ */ React15.createElement(Text15, { color: "gray", italic: true }, "(Arrows to select \u2022 Enter to confirm)")));
19420
+ ), /* @__PURE__ */ React16.createElement(Box14, { paddingX: 1, marginTop: 1 }, /* @__PURE__ */ React16.createElement(Text16, { color: "gray", italic: true }, "(Arrows to select \u2022 Enter to confirm)")));
19233
19421
  }
19234
19422
  case "resetMode":
19235
- return /* @__PURE__ */ React15.createElement(
19423
+ return /* @__PURE__ */ React16.createElement(
19236
19424
  CommandMenu,
19237
19425
  {
19238
19426
  title: "SELECT MONTHLY RESET MODE",
@@ -19267,7 +19455,7 @@ Selection: ${val}`,
19267
19455
  }
19268
19456
  );
19269
19457
  case "budgetTypeSelect":
19270
- return /* @__PURE__ */ React15.createElement(
19458
+ return /* @__PURE__ */ React16.createElement(
19271
19459
  CommandMenu,
19272
19460
  {
19273
19461
  title: "SELECT BUDGET TYPE",
@@ -19334,16 +19522,16 @@ Selection: ${val}`,
19334
19522
  case "providerBudgetSelect": {
19335
19523
  const PROVIDERS_LIST = ["Google", "DeepSeek", "NVIDIA", "OpenRouter"];
19336
19524
  const anySelected = PROVIDERS_LIST.some((p) => pbsSelected[p]);
19337
- return /* @__PURE__ */ React15.createElement(Box14, { flexDirection: "column", borderStyle: "round", borderColor: "white", padding: 0, width: "100%" }, /* @__PURE__ */ React15.createElement(Box14, { paddingX: 1, marginBottom: 1 }, /* @__PURE__ */ React15.createElement(Text15, { color: "gray", bold: true }, "SELECT PROVIDERS TO SET BUDGETS FOR")), PROVIDERS_LIST.map((prov, i) => {
19525
+ return /* @__PURE__ */ React16.createElement(Box14, { flexDirection: "column", borderStyle: "round", borderColor: "white", padding: 0, width: "100%" }, /* @__PURE__ */ React16.createElement(Box14, { paddingX: 1, marginBottom: 1 }, /* @__PURE__ */ React16.createElement(Text16, { color: "gray", bold: true }, "SELECT PROVIDERS TO SET BUDGETS FOR")), PROVIDERS_LIST.map((prov, i) => {
19338
19526
  const isActive = i === pbsCursor;
19339
19527
  const isChecked = !!pbsSelected[prov];
19340
- return /* @__PURE__ */ React15.createElement(Box14, { key: prov, backgroundColor: isActive ? "#2a2a2a" : void 0, paddingX: 1, width: "100%" }, /* @__PURE__ */ React15.createElement(Text15, { color: isActive ? "white" : "gray", bold: isActive }, isActive ? "\u276F " : " ", /* @__PURE__ */ React15.createElement(Text15, { color: isChecked ? "green" : "gray" }, isChecked ? "\u2611" : "\u2610"), " ", prov, isChecked && quotas.providerBudgets?.[prov]?.agentLimit ? /* @__PURE__ */ React15.createElement(Text15, { color: "cyan" }, " (budget set)") : null));
19341
- }), /* @__PURE__ */ React15.createElement(Box14, { paddingX: 1, marginTop: 1, flexDirection: "column" }, /* @__PURE__ */ React15.createElement(Text15, { color: "gray", italic: true }, "\u2191\u2193 Navigate \u2022 Space to toggle \u2022 Enter to confirm \u2022 ESC to go back"), !anySelected && /* @__PURE__ */ React15.createElement(Text15, { color: "yellow", italic: true }, " Select at least one provider to continue")));
19528
+ return /* @__PURE__ */ React16.createElement(Box14, { key: prov, backgroundColor: isActive ? "#2a2a2a" : void 0, paddingX: 1, width: "100%" }, /* @__PURE__ */ React16.createElement(Text16, { color: isActive ? "white" : "gray", bold: isActive }, isActive ? "\u276F " : " ", /* @__PURE__ */ React16.createElement(Text16, { color: isChecked ? "green" : "gray" }, isChecked ? "\u2611" : "\u2610"), " ", prov, isChecked && quotas.providerBudgets?.[prov]?.agentLimit ? /* @__PURE__ */ React16.createElement(Text16, { color: "cyan" }, " (budget set)") : null));
19529
+ }), /* @__PURE__ */ React16.createElement(Box14, { paddingX: 1, marginTop: 1, flexDirection: "column" }, /* @__PURE__ */ React16.createElement(Text16, { color: "gray", italic: true }, "\u2191\u2193 Navigate \u2022 Space to toggle \u2022 Enter to confirm \u2022 ESC to go back"), !anySelected && /* @__PURE__ */ React16.createElement(Text16, { color: "yellow", italic: true }, " Select at least one provider to continue")));
19342
19530
  }
19343
19531
  case "providerBudgetFlow":
19344
19532
  return null;
19345
19533
  case "budgetResetMode":
19346
- return /* @__PURE__ */ React15.createElement(
19534
+ return /* @__PURE__ */ React16.createElement(
19347
19535
  CommandMenu,
19348
19536
  {
19349
19537
  title: "SELECT MONTHLY RESET MODE",
@@ -19403,7 +19591,7 @@ Selection: ${val}`,
19403
19591
  const monthName = resetDate.toLocaleString("default", { month: "short" });
19404
19592
  resetInfo = `Resets on: ${resetDay}-${monthName}`;
19405
19593
  }
19406
- return /* @__PURE__ */ React15.createElement(Box14, { flexDirection: "column", borderStyle: "round", borderColor: "white", padding: 1, width: "100%" }, /* @__PURE__ */ React15.createElement(Box14, { marginBottom: 1, justifyContent: "space-between", width: "100%" }, /* @__PURE__ */ React15.createElement(Text15, { color: "white", bold: true, underline: true }, "BUDGET LIMIT STATUS"), /* @__PURE__ */ React15.createElement(Text15, { color: "gray" }, "[ ESC to Close ]")), limitsNotSet ? /* @__PURE__ */ React15.createElement(Box14, { padding: 1, justifyContent: "center", alignItems: "center", width: "100%" }, /* @__PURE__ */ React15.createElement(Text15, { color: "white", bold: true }, "LIMITS NOT SET")) : usingProviderBudgets && configuredProviders.length > 0 ? /* @__PURE__ */ React15.createElement(Box14, { flexDirection: "column", gap: 1, width: "100%" }, configuredProviders.map((prov) => {
19594
+ return /* @__PURE__ */ React16.createElement(Box14, { flexDirection: "column", borderStyle: "round", borderColor: "white", padding: 1, width: "100%" }, /* @__PURE__ */ React16.createElement(Box14, { marginBottom: 1, justifyContent: "space-between", width: "100%" }, /* @__PURE__ */ React16.createElement(Text16, { color: "white", bold: true, underline: true }, "BUDGET LIMIT STATUS"), /* @__PURE__ */ React16.createElement(Text16, { color: "gray" }, "[ ESC to Close ]")), limitsNotSet ? /* @__PURE__ */ React16.createElement(Box14, { padding: 1, justifyContent: "center", alignItems: "center", width: "100%" }, /* @__PURE__ */ React16.createElement(Text16, { color: "white", bold: true }, "LIMITS NOT SET")) : usingProviderBudgets && configuredProviders.length > 0 ? /* @__PURE__ */ React16.createElement(Box14, { flexDirection: "column", gap: 1, width: "100%" }, configuredProviders.map((prov) => {
19407
19595
  const pb = providerBudgetsMap[prov];
19408
19596
  const provReqCurrent = dailyUsage?.providerRequests?.[prov] || 0;
19409
19597
  let provTokenCurrent = 0;
@@ -19417,11 +19605,11 @@ Selection: ${val}`,
19417
19605
  for (const m in monthlyModels) {
19418
19606
  provMonthlyCurrent += monthlyModels[m]?.tokens || 0;
19419
19607
  }
19420
- return /* @__PURE__ */ React15.createElement(Box14, { key: prov, flexDirection: "column", borderStyle: "single", borderColor: "gray", paddingX: 1, width: "100%" }, /* @__PURE__ */ React15.createElement(Box14, { marginBottom: 0 }, /* @__PURE__ */ React15.createElement(Text15, { color: "cyan", bold: true }, "\u25C6 ", prov)), renderProgressBar("Daily Requests", provReqCurrent, pb.agentLimit || 99999999, "cyan"), renderProgressBar("Daily Tokens", provTokenCurrent, pb.tokenLimit || 99999999999999, "green"), renderProgressBar("Monthly Tokens", provMonthlyCurrent, pb.monthlyTokenLimit || 99999999999999, "yellow"));
19421
- }), resetInfo ? /* @__PURE__ */ React15.createElement(Box14, { marginLeft: 4 }, /* @__PURE__ */ React15.createElement(Text15, { color: "gray" }, "Monthly Reset : "), /* @__PURE__ */ React15.createElement(Text15, { color: "magenta", bold: true }, resetInfo)) : /* @__PURE__ */ React15.createElement(Box14, { marginLeft: 4 }, /* @__PURE__ */ React15.createElement(Text15, { color: "gray" }, "Monthly Reset : "), /* @__PURE__ */ React15.createElement(Text15, { color: "blue", bold: true }, "Rolling 30-Day Window"))) : /* @__PURE__ */ React15.createElement(Box14, { flexDirection: "column", borderStyle: "single", borderColor: "gray", paddingX: 1, width: "100%" }, renderProgressBar("Daily Requests", reqCurrent, reqLimit, "cyan"), renderProgressBar("Daily Tokens", tokenCurrent, tokenLimit, "green"), renderProgressBar("Monthly Tokens", monthlyCurrent, monthlyLimit, "yellow"), resetInfo ? /* @__PURE__ */ React15.createElement(Box14, { marginLeft: 4, marginTop: 1 }, /* @__PURE__ */ React15.createElement(Text15, { color: "gray" }, "Monthly Reset : "), /* @__PURE__ */ React15.createElement(Text15, { color: "magenta", bold: true }, resetInfo)) : /* @__PURE__ */ React15.createElement(Box14, { marginLeft: 4, marginTop: 1 }, /* @__PURE__ */ React15.createElement(Text15, { color: "gray" }, "Monthly Reset : "), /* @__PURE__ */ React15.createElement(Text15, { color: "blue", bold: true }, "Rolling 30-Day Window"))));
19608
+ return /* @__PURE__ */ React16.createElement(Box14, { key: prov, flexDirection: "column", borderStyle: "single", borderColor: "gray", paddingX: 1, width: "100%" }, /* @__PURE__ */ React16.createElement(Box14, { marginBottom: 0 }, /* @__PURE__ */ React16.createElement(Text16, { color: "cyan", bold: true }, "\u25C6 ", prov)), renderProgressBar("Daily Requests", provReqCurrent, pb.agentLimit || 99999999, "cyan"), renderProgressBar("Daily Tokens", provTokenCurrent, pb.tokenLimit || 99999999999999, "green"), renderProgressBar("Monthly Tokens", provMonthlyCurrent, pb.monthlyTokenLimit || 99999999999999, "yellow"));
19609
+ }), resetInfo ? /* @__PURE__ */ React16.createElement(Box14, { marginLeft: 4 }, /* @__PURE__ */ React16.createElement(Text16, { color: "gray" }, "Monthly Reset : "), /* @__PURE__ */ React16.createElement(Text16, { color: "magenta", bold: true }, resetInfo)) : /* @__PURE__ */ React16.createElement(Box14, { marginLeft: 4 }, /* @__PURE__ */ React16.createElement(Text16, { color: "gray" }, "Monthly Reset : "), /* @__PURE__ */ React16.createElement(Text16, { color: "blue", bold: true }, "Rolling 30-Day Window"))) : /* @__PURE__ */ React16.createElement(Box14, { flexDirection: "column", borderStyle: "single", borderColor: "gray", paddingX: 1, width: "100%" }, renderProgressBar("Daily Requests", reqCurrent, reqLimit, "cyan"), renderProgressBar("Daily Tokens", tokenCurrent, tokenLimit, "green"), renderProgressBar("Monthly Tokens", monthlyCurrent, monthlyLimit, "yellow"), resetInfo ? /* @__PURE__ */ React16.createElement(Box14, { marginLeft: 4, marginTop: 1 }, /* @__PURE__ */ React16.createElement(Text16, { color: "gray" }, "Monthly Reset : "), /* @__PURE__ */ React16.createElement(Text16, { color: "magenta", bold: true }, resetInfo)) : /* @__PURE__ */ React16.createElement(Box14, { marginLeft: 4, marginTop: 1 }, /* @__PURE__ */ React16.createElement(Text16, { color: "gray" }, "Monthly Reset : "), /* @__PURE__ */ React16.createElement(Text16, { color: "blue", bold: true }, "Rolling 30-Day Window"))));
19422
19610
  }
19423
19611
  case "input":
19424
- return /* @__PURE__ */ React15.createElement(Box14, { flexDirection: "column", borderStyle: "round", borderColor: "white", padding: 0, width: "100%" }, /* @__PURE__ */ React15.createElement(Box14, { paddingX: 1 }, /* @__PURE__ */ React15.createElement(Text15, { color: "white", bold: true }, "DATA CONFIGURATION")), inputConfig?.note && /* @__PURE__ */ React15.createElement(Box14, { paddingX: 1, marginBottom: 1 }, /* @__PURE__ */ React15.createElement(Text15, { color: "gray", italic: true }, inputConfig.note)), /* @__PURE__ */ React15.createElement(Box14, { paddingX: 1, flexDirection: "row" }, /* @__PURE__ */ React15.createElement(Text15, { color: "white", bold: true }, inputConfig?.label, " "), /* @__PURE__ */ React15.createElement(
19612
+ return /* @__PURE__ */ React16.createElement(Box14, { flexDirection: "column", borderStyle: "round", borderColor: "white", padding: 0, width: "100%" }, /* @__PURE__ */ React16.createElement(Box14, { paddingX: 1 }, /* @__PURE__ */ React16.createElement(Text16, { color: "white", bold: true }, "DATA CONFIGURATION")), inputConfig?.note && /* @__PURE__ */ React16.createElement(Box14, { paddingX: 1, marginBottom: 1 }, /* @__PURE__ */ React16.createElement(Text16, { color: "gray", italic: true }, inputConfig.note)), /* @__PURE__ */ React16.createElement(Box14, { paddingX: 1, flexDirection: "row" }, /* @__PURE__ */ React16.createElement(Text16, { color: "white", bold: true }, inputConfig?.label, " "), /* @__PURE__ */ React16.createElement(
19425
19613
  TextInput4,
19426
19614
  {
19427
19615
  value: inputConfig?.value || "",
@@ -19524,7 +19712,7 @@ Selection: ${val}`,
19524
19712
  }
19525
19713
  }
19526
19714
  }
19527
- )), /* @__PURE__ */ React15.createElement(Box14, { paddingX: 1, marginTop: 1 }, /* @__PURE__ */ React15.createElement(Text15, { color: "gray", dimColor: true, italic: true }, "(Press Enter to confirm selection)")));
19715
+ )), /* @__PURE__ */ React16.createElement(Box14, { paddingX: 1, marginTop: 1 }, /* @__PURE__ */ React16.createElement(Text16, { color: "gray", dimColor: true, italic: true }, "(Press Enter to confirm selection)")));
19528
19716
  case "stats": {
19529
19717
  const u = statsMode === "monthly" ? monthlyUsage : dailyUsage;
19530
19718
  const trackerTitle = statsMode === "monthly" ? "LAST 30 DAYS USAGE" : "TODAY's USAGE";
@@ -19534,13 +19722,13 @@ Selection: ${val}`,
19534
19722
  const imageCreditsLabel = statsMode === "monthly" ? "Image Credits:" : "Image Credits:";
19535
19723
  const codeChangesLabel = statsMode === "monthly" ? "Code Changes:" : "Code Changes:";
19536
19724
  const toolCallsLabel = statsMode === "monthly" ? "Tool Calls:" : "Tool Calls:";
19537
- return /* @__PURE__ */ React15.createElement(Box14, { flexDirection: "column", borderStyle: "round", borderColor: "grey", paddingX: 3, paddingY: 1, paddingBottom: 0, width: Math.min(125, (stdout?.columns || 100) - 2) }, statsMode === "modelBreakdown" ? /* @__PURE__ */ React15.createElement(Box14, { flexDirection: "column" }, /* @__PURE__ */ React15.createElement(Text15, { color: "white", bold: true, underline: true }, "30-DAY MODEL TOKEN BREAKDOWN"), !monthlyUsage?.models || Object.keys(monthlyUsage.models).length === 0 ? /* @__PURE__ */ React15.createElement(Box14, { marginTop: 1 }, /* @__PURE__ */ React15.createElement(Text15, { color: "grey", italic: true }, "No model token usage recorded in the last 30 days.")) : Object.entries(monthlyUsage.models).map(([provider, models]) => {
19725
+ return /* @__PURE__ */ React16.createElement(Box14, { flexDirection: "column", borderStyle: "round", borderColor: "grey", paddingX: 3, paddingY: 1, paddingBottom: 0, width: Math.min(125, (stdout?.columns || 100) - 2) }, statsMode === "modelBreakdown" ? /* @__PURE__ */ React16.createElement(Box14, { flexDirection: "column" }, /* @__PURE__ */ React16.createElement(Text16, { color: "white", bold: true, underline: true }, "30-DAY MODEL TOKEN BREAKDOWN"), !monthlyUsage?.models || Object.keys(monthlyUsage.models).length === 0 ? /* @__PURE__ */ React16.createElement(Box14, { marginTop: 1 }, /* @__PURE__ */ React16.createElement(Text16, { color: "grey", italic: true }, "No model token usage recorded in the last 30 days.")) : Object.entries(monthlyUsage.models).map(([provider, models]) => {
19538
19726
  const providerTotalTokens = Object.values(models).reduce((sum, m) => sum + (m.tokens || 0), 0);
19539
- return /* @__PURE__ */ React15.createElement(Box14, { key: provider, flexDirection: "column", marginTop: 1 }, /* @__PURE__ */ React15.createElement(Box14, null, /* @__PURE__ */ React15.createElement(Box14, { width: 40 }, /* @__PURE__ */ React15.createElement(Text15, { color: "cyan", bold: true }, provider, ":")), /* @__PURE__ */ React15.createElement(Text15, { color: "white", bold: true }, formatTokens(providerTotalTokens))), Object.entries(models).map(([modelName, stats]) => /* @__PURE__ */ React15.createElement(Box14, { key: modelName, flexDirection: "column", marginLeft: 4, marginTop: 1 }, /* @__PURE__ */ React15.createElement(Box14, null, /* @__PURE__ */ React15.createElement(Box14, { width: 36 }, /* @__PURE__ */ React15.createElement(Text15, { color: "blue" }, "\xBB ", modelName, ":")), /* @__PURE__ */ React15.createElement(Text15, { color: "white" }, formatTokens(stats.tokens || 0))), /* @__PURE__ */ React15.createElement(Box14, { marginLeft: 4 }, /* @__PURE__ */ React15.createElement(Box14, { width: 32 }, /* @__PURE__ */ React15.createElement(Text15, { color: "grey" }, "\xBB Input Tokens:")), /* @__PURE__ */ React15.createElement(Text15, { color: "white" }, formatTokens((stats.tokens || 0) - (stats.candidateTokens || 0)))), (stats.cachedTokens || 0) > 0 && /* @__PURE__ */ React15.createElement(Box14, { marginLeft: 5 }, /* @__PURE__ */ React15.createElement(Box14, { width: 31 }, /* @__PURE__ */ React15.createElement(Text15, { color: "grey" }, "\xBB Cached:")), /* @__PURE__ */ React15.createElement(Text15, { color: "white" }, formatTokens(stats.cachedTokens))), /* @__PURE__ */ React15.createElement(Box14, { marginLeft: 4 }, /* @__PURE__ */ React15.createElement(Box14, { width: 32 }, /* @__PURE__ */ React15.createElement(Text15, { color: "grey" }, "\xBB Output Tokens:")), /* @__PURE__ */ React15.createElement(Text15, { color: "white" }, formatTokens(stats.candidateTokens || 0))))));
19540
- })) : /* @__PURE__ */ React15.createElement(React15.Fragment, null, /* @__PURE__ */ React15.createElement(Box14, { marginBottom: 1 }, /* @__PURE__ */ React15.createElement(Text15, { color: "white", bold: true, underline: true }, "SESSION TELEMETRY")), /* @__PURE__ */ React15.createElement(Box14, { flexDirection: "column" }, /* @__PURE__ */ React15.createElement(Box14, null, /* @__PURE__ */ React15.createElement(Box14, { width: 25 }, /* @__PURE__ */ React15.createElement(Text15, { color: "blue" }, "Session Duration:")), /* @__PURE__ */ React15.createElement(Text15, { color: "white" }, formatMsDuration(Date.now() - SESSION_START_TIME))), /* @__PURE__ */ React15.createElement(Box14, null, /* @__PURE__ */ React15.createElement(Box14, { width: 25 }, /* @__PURE__ */ React15.createElement(Text15, { color: "blue" }, "Model Requests:")), /* @__PURE__ */ React15.createElement(Text15, { color: "white" }, sessionAgentCalls)), /* @__PURE__ */ React15.createElement(Box14, { marginLeft: 2 }, /* @__PURE__ */ React15.createElement(Box14, { width: 23 }, /* @__PURE__ */ React15.createElement(Text15, { color: "grey" }, "\xBB API Time:")), /* @__PURE__ */ React15.createElement(Text15, { color: "white" }, formatMsDuration(sessionApiTime))), /* @__PURE__ */ React15.createElement(Box14, { marginLeft: 2 }, /* @__PURE__ */ React15.createElement(Box14, { width: 23 }, /* @__PURE__ */ React15.createElement(Text15, { color: "grey" }, "\xBB Tool Time:")), /* @__PURE__ */ React15.createElement(Text15, { color: "white" }, formatMsDuration(sessionToolTime))), /* @__PURE__ */ React15.createElement(Box14, null, /* @__PURE__ */ React15.createElement(Box14, { width: 25 }, /* @__PURE__ */ React15.createElement(Text15, { color: "blue" }, "Memory Agent:")), /* @__PURE__ */ React15.createElement(Text15, { color: "white" }, sessionBackgroundCalls)), /* @__PURE__ */ React15.createElement(Box14, null, /* @__PURE__ */ React15.createElement(Box14, { width: 25 }, /* @__PURE__ */ React15.createElement(Text15, { color: "blue" }, "Tokens Consumed:")), /* @__PURE__ */ React15.createElement(Text15, { color: "white" }, formatTokens(sessionTotalTokens))), /* @__PURE__ */ React15.createElement(Box14, null, /* @__PURE__ */ React15.createElement(Box14, { width: 25 }, /* @__PURE__ */ React15.createElement(Text15, { color: "blue" }, "Active Context:")), /* @__PURE__ */ React15.createElement(Text15, { color: "white" }, formatTokens(sessionStats.tokens))), sessionTotalTokens > 0 && /* @__PURE__ */ React15.createElement(React15.Fragment, null, /* @__PURE__ */ React15.createElement(Box14, { marginLeft: 2 }, /* @__PURE__ */ React15.createElement(Box14, { width: 23 }, /* @__PURE__ */ React15.createElement(Text15, { color: "grey" }, "\xBB Input Tokens:")), /* @__PURE__ */ React15.createElement(Text15, { color: "white" }, formatTokens(sessionTotalTokens - sessionTotalCandidateTokens))), sessionTotalCachedTokens > 0 && /* @__PURE__ */ React15.createElement(Box14, { marginLeft: 4 }, /* @__PURE__ */ React15.createElement(Box14, { width: 21 }, /* @__PURE__ */ React15.createElement(Text15, { color: "grey" }, "\xBB Cached:")), /* @__PURE__ */ React15.createElement(Text15, { color: "white" }, formatTokens(sessionTotalCachedTokens))), sessionTotalCandidateTokens > 0 && /* @__PURE__ */ React15.createElement(Box14, { marginLeft: 2 }, /* @__PURE__ */ React15.createElement(Box14, { width: 23 }, /* @__PURE__ */ React15.createElement(Text15, { color: "grey" }, "\xBB Output Tokens:")), /* @__PURE__ */ React15.createElement(Text15, { color: "white" }, formatTokens(sessionTotalCandidateTokens)))), sessionImageCount > 0 && /* @__PURE__ */ React15.createElement(React15.Fragment, null, /* @__PURE__ */ React15.createElement(Box14, null, /* @__PURE__ */ React15.createElement(Box14, { width: 25 }, /* @__PURE__ */ React15.createElement(Text15, { color: "blue" }, "Images Made:")), /* @__PURE__ */ React15.createElement(Text15, { color: "white" }, sessionImageCount)), /* @__PURE__ */ React15.createElement(Box14, null, /* @__PURE__ */ React15.createElement(Box14, { width: 25 }, /* @__PURE__ */ React15.createElement(Text15, { color: "blue" }, "Image Credits:")), /* @__PURE__ */ React15.createElement(Text15, { color: "white" }, Number(((sessionImageCredits || 0) * 1e3).toFixed(0)), " credits"))), /* @__PURE__ */ React15.createElement(Box14, null, /* @__PURE__ */ React15.createElement(Box14, { width: 25 }, /* @__PURE__ */ React15.createElement(Text15, { color: "blue" }, "Code Changes (Sess):")), /* @__PURE__ */ React15.createElement(Text15, { color: "white" }, /* @__PURE__ */ React15.createElement(Text15, { color: "green" }, "+", linesAdded), " ", /* @__PURE__ */ React15.createElement(Text15, { color: "red" }, "-", linesRemoved))), /* @__PURE__ */ React15.createElement(Box14, null, /* @__PURE__ */ React15.createElement(Box14, { width: 25 }, /* @__PURE__ */ React15.createElement(Text15, { color: "blue" }, "Tool Calls (Sess):")), /* @__PURE__ */ React15.createElement(Text15, { color: "white" }, sessionToolSuccess + sessionToolFailure + sessionToolDenied, " ( "), /* @__PURE__ */ React15.createElement(Text15, { color: "green" }, "\u2714 ", sessionToolSuccess), /* @__PURE__ */ React15.createElement(Text15, { color: "white" }, " "), /* @__PURE__ */ React15.createElement(Text15, { color: "yellow" }, "\u{1F6C7} ", sessionToolDenied), /* @__PURE__ */ React15.createElement(Text15, { color: "white" }, " "), /* @__PURE__ */ React15.createElement(Text15, { color: "red" }, "\u2718 ", sessionToolFailure), /* @__PURE__ */ React15.createElement(Text15, { color: "white" }, " )"))), /* @__PURE__ */ React15.createElement(Box14, { flexDirection: "column", marginTop: 1 }, /* @__PURE__ */ React15.createElement(Text15, { color: "white", bold: true, underline: true }, trackerTitle), /* @__PURE__ */ React15.createElement(Box14, { marginTop: 1 }, /* @__PURE__ */ React15.createElement(Box14, { width: 25 }, /* @__PURE__ */ React15.createElement(Text15, { color: "blue" }, timeLabel)), /* @__PURE__ */ React15.createElement(Text15, { color: "white" }, formatDuration(u?.duration || 0))), /* @__PURE__ */ React15.createElement(Box14, null, /* @__PURE__ */ React15.createElement(Box14, { width: 25 }, /* @__PURE__ */ React15.createElement(Text15, { color: "blue" }, "Model Requests:")), /* @__PURE__ */ React15.createElement(Text15, { color: "white" }, u?.agent || 0)), /* @__PURE__ */ React15.createElement(Box14, null, /* @__PURE__ */ React15.createElement(Box14, { width: 25 }, /* @__PURE__ */ React15.createElement(Text15, { color: "blue" }, "Memory Agent:")), /* @__PURE__ */ React15.createElement(Text15, { color: "white" }, u?.background || 0)), /* @__PURE__ */ React15.createElement(Box14, null, /* @__PURE__ */ React15.createElement(Box14, { width: 25 }, /* @__PURE__ */ React15.createElement(Text15, { color: "blue" }, tokensLabel)), /* @__PURE__ */ React15.createElement(Text15, { color: "white" }, formatTokens(u?.tokens || 0))), (u?.tokens || 0) > 0 && /* @__PURE__ */ React15.createElement(React15.Fragment, null, /* @__PURE__ */ React15.createElement(Box14, { marginLeft: 2 }, /* @__PURE__ */ React15.createElement(Box14, { width: 23 }, /* @__PURE__ */ React15.createElement(Text15, { color: "grey" }, "\xBB Input Tokens:")), /* @__PURE__ */ React15.createElement(Text15, { color: "white" }, formatTokens((u?.tokens || 0) - (u?.candidateTokens || 0)))), (u?.cachedTokens || 0) > 0 && /* @__PURE__ */ React15.createElement(Box14, { marginLeft: 4 }, /* @__PURE__ */ React15.createElement(Box14, { width: 21 }, /* @__PURE__ */ React15.createElement(Text15, { color: "grey" }, "\xBB Cached:")), /* @__PURE__ */ React15.createElement(Text15, { color: "white" }, formatTokens(u.cachedTokens))), (u?.candidateTokens || 0) > 0 && /* @__PURE__ */ React15.createElement(Box14, { marginLeft: 2 }, /* @__PURE__ */ React15.createElement(Box14, { width: 23 }, /* @__PURE__ */ React15.createElement(Text15, { color: "grey" }, "\xBB Output Tokens:")), /* @__PURE__ */ React15.createElement(Text15, { color: "white" }, formatTokens(u.candidateTokens)))), (u?.imageCalls?.length || 0) > 0 && /* @__PURE__ */ React15.createElement(React15.Fragment, null, /* @__PURE__ */ React15.createElement(Box14, null, /* @__PURE__ */ React15.createElement(Box14, { width: 25 }, /* @__PURE__ */ React15.createElement(Text15, { color: "blue" }, imagesLabel)), /* @__PURE__ */ React15.createElement(Text15, { color: "white" }, u.imageCalls.length)), /* @__PURE__ */ React15.createElement(Box14, null, /* @__PURE__ */ React15.createElement(Box14, { width: 25 }, /* @__PURE__ */ React15.createElement(Text15, { color: "blue" }, imageCreditsLabel)), /* @__PURE__ */ React15.createElement(Text15, { color: "white" }, Number(((u.imageCalls.reduce((sum, c) => sum + c.cost, 0) || 0) * 1e3).toFixed(0)), " credits"))), /* @__PURE__ */ React15.createElement(Box14, null, /* @__PURE__ */ React15.createElement(Box14, { width: 25 }, /* @__PURE__ */ React15.createElement(Text15, { color: "blue" }, codeChangesLabel)), /* @__PURE__ */ React15.createElement(Text15, { color: "white" }, /* @__PURE__ */ React15.createElement(Text15, { color: "green" }, "+", u?.linesAdded || 0), " ", /* @__PURE__ */ React15.createElement(Text15, { color: "red" }, "-", u?.linesRemoved || 0))), /* @__PURE__ */ React15.createElement(Box14, null, /* @__PURE__ */ React15.createElement(Box14, { width: 25 }, /* @__PURE__ */ React15.createElement(Text15, { color: "blue" }, toolCallsLabel)), /* @__PURE__ */ React15.createElement(Text15, { color: "white" }, (u?.toolSuccess || 0) + (u?.toolFailure || 0) + (u?.toolDenied || 0), " ( "), /* @__PURE__ */ React15.createElement(Text15, { color: "green" }, "\u2714 ", u?.toolSuccess || 0), /* @__PURE__ */ React15.createElement(Text15, { color: "white" }, " "), /* @__PURE__ */ React15.createElement(Text15, { color: "yellow" }, "\u{1F6C7} ", u?.toolDenied || 0), /* @__PURE__ */ React15.createElement(Text15, { color: "white" }, " "), /* @__PURE__ */ React15.createElement(Text15, { color: "red" }, "\u2718 ", u?.toolFailure || 0), /* @__PURE__ */ React15.createElement(Text15, { color: "white" }, " )")))), /* @__PURE__ */ React15.createElement(Text15, { dimColor: true, marginTop: 1, italic: true }, "(Press TAB to toggle Daily/Monthly views, SPACE for Model Breakdown, ESC to return)"));
19727
+ return /* @__PURE__ */ React16.createElement(Box14, { key: provider, flexDirection: "column", marginTop: 1 }, /* @__PURE__ */ React16.createElement(Box14, null, /* @__PURE__ */ React16.createElement(Box14, { width: 40 }, /* @__PURE__ */ React16.createElement(Text16, { color: "cyan", bold: true }, provider, ":")), /* @__PURE__ */ React16.createElement(Text16, { color: "white", bold: true }, formatTokens(providerTotalTokens))), Object.entries(models).map(([modelName, stats]) => /* @__PURE__ */ React16.createElement(Box14, { key: modelName, flexDirection: "column", marginLeft: 4, marginTop: 1 }, /* @__PURE__ */ React16.createElement(Box14, null, /* @__PURE__ */ React16.createElement(Box14, { width: 36 }, /* @__PURE__ */ React16.createElement(Text16, { color: "blue" }, "\xBB ", modelName, ":")), /* @__PURE__ */ React16.createElement(Text16, { color: "white" }, formatTokens(stats.tokens || 0))), /* @__PURE__ */ React16.createElement(Box14, { marginLeft: 4 }, /* @__PURE__ */ React16.createElement(Box14, { width: 32 }, /* @__PURE__ */ React16.createElement(Text16, { color: "grey" }, "\xBB Input Tokens:")), /* @__PURE__ */ React16.createElement(Text16, { color: "white" }, formatTokens((stats.tokens || 0) - (stats.candidateTokens || 0)))), (stats.cachedTokens || 0) > 0 && /* @__PURE__ */ React16.createElement(Box14, { marginLeft: 5 }, /* @__PURE__ */ React16.createElement(Box14, { width: 31 }, /* @__PURE__ */ React16.createElement(Text16, { color: "grey" }, "\xBB Cached:")), /* @__PURE__ */ React16.createElement(Text16, { color: "white" }, formatTokens(stats.cachedTokens))), /* @__PURE__ */ React16.createElement(Box14, { marginLeft: 4 }, /* @__PURE__ */ React16.createElement(Box14, { width: 32 }, /* @__PURE__ */ React16.createElement(Text16, { color: "grey" }, "\xBB Output Tokens:")), /* @__PURE__ */ React16.createElement(Text16, { color: "white" }, formatTokens(stats.candidateTokens || 0))))));
19728
+ })) : /* @__PURE__ */ React16.createElement(React16.Fragment, null, /* @__PURE__ */ React16.createElement(Box14, { marginBottom: 1 }, /* @__PURE__ */ React16.createElement(Text16, { color: "white", bold: true, underline: true }, "SESSION TELEMETRY")), /* @__PURE__ */ React16.createElement(Box14, { flexDirection: "column" }, /* @__PURE__ */ React16.createElement(Box14, null, /* @__PURE__ */ React16.createElement(Box14, { width: 25 }, /* @__PURE__ */ React16.createElement(Text16, { color: "blue" }, "Session Duration:")), /* @__PURE__ */ React16.createElement(Text16, { color: "white" }, formatMsDuration(Date.now() - SESSION_START_TIME))), /* @__PURE__ */ React16.createElement(Box14, null, /* @__PURE__ */ React16.createElement(Box14, { width: 25 }, /* @__PURE__ */ React16.createElement(Text16, { color: "blue" }, "Model Requests:")), /* @__PURE__ */ React16.createElement(Text16, { color: "white" }, sessionAgentCalls)), /* @__PURE__ */ React16.createElement(Box14, { marginLeft: 2 }, /* @__PURE__ */ React16.createElement(Box14, { width: 23 }, /* @__PURE__ */ React16.createElement(Text16, { color: "grey" }, "\xBB API Time:")), /* @__PURE__ */ React16.createElement(Text16, { color: "white" }, formatMsDuration(sessionApiTime))), /* @__PURE__ */ React16.createElement(Box14, { marginLeft: 2 }, /* @__PURE__ */ React16.createElement(Box14, { width: 23 }, /* @__PURE__ */ React16.createElement(Text16, { color: "grey" }, "\xBB Tool Time:")), /* @__PURE__ */ React16.createElement(Text16, { color: "white" }, formatMsDuration(sessionToolTime))), /* @__PURE__ */ React16.createElement(Box14, null, /* @__PURE__ */ React16.createElement(Box14, { width: 25 }, /* @__PURE__ */ React16.createElement(Text16, { color: "blue" }, "Memory Agent:")), /* @__PURE__ */ React16.createElement(Text16, { color: "white" }, sessionBackgroundCalls)), /* @__PURE__ */ React16.createElement(Box14, null, /* @__PURE__ */ React16.createElement(Box14, { width: 25 }, /* @__PURE__ */ React16.createElement(Text16, { color: "blue" }, "Tokens Consumed:")), /* @__PURE__ */ React16.createElement(Text16, { color: "white" }, formatTokens(sessionTotalTokens))), /* @__PURE__ */ React16.createElement(Box14, null, /* @__PURE__ */ React16.createElement(Box14, { width: 25 }, /* @__PURE__ */ React16.createElement(Text16, { color: "blue" }, "Active Context:")), /* @__PURE__ */ React16.createElement(Text16, { color: "white" }, formatTokens(sessionStats.tokens))), sessionTotalTokens > 0 && /* @__PURE__ */ React16.createElement(React16.Fragment, null, /* @__PURE__ */ React16.createElement(Box14, { marginLeft: 2 }, /* @__PURE__ */ React16.createElement(Box14, { width: 23 }, /* @__PURE__ */ React16.createElement(Text16, { color: "grey" }, "\xBB Input Tokens:")), /* @__PURE__ */ React16.createElement(Text16, { color: "white" }, formatTokens(sessionTotalTokens - sessionTotalCandidateTokens))), sessionTotalCachedTokens > 0 && /* @__PURE__ */ React16.createElement(Box14, { marginLeft: 4 }, /* @__PURE__ */ React16.createElement(Box14, { width: 21 }, /* @__PURE__ */ React16.createElement(Text16, { color: "grey" }, "\xBB Cached:")), /* @__PURE__ */ React16.createElement(Text16, { color: "white" }, formatTokens(sessionTotalCachedTokens))), sessionTotalCandidateTokens > 0 && /* @__PURE__ */ React16.createElement(Box14, { marginLeft: 2 }, /* @__PURE__ */ React16.createElement(Box14, { width: 23 }, /* @__PURE__ */ React16.createElement(Text16, { color: "grey" }, "\xBB Output Tokens:")), /* @__PURE__ */ React16.createElement(Text16, { color: "white" }, formatTokens(sessionTotalCandidateTokens)))), sessionImageCount > 0 && /* @__PURE__ */ React16.createElement(React16.Fragment, null, /* @__PURE__ */ React16.createElement(Box14, null, /* @__PURE__ */ React16.createElement(Box14, { width: 25 }, /* @__PURE__ */ React16.createElement(Text16, { color: "blue" }, "Images Made:")), /* @__PURE__ */ React16.createElement(Text16, { color: "white" }, sessionImageCount)), /* @__PURE__ */ React16.createElement(Box14, null, /* @__PURE__ */ React16.createElement(Box14, { width: 25 }, /* @__PURE__ */ React16.createElement(Text16, { color: "blue" }, "Image Credits:")), /* @__PURE__ */ React16.createElement(Text16, { color: "white" }, Number(((sessionImageCredits || 0) * 1e3).toFixed(0)), " credits"))), /* @__PURE__ */ React16.createElement(Box14, null, /* @__PURE__ */ React16.createElement(Box14, { width: 25 }, /* @__PURE__ */ React16.createElement(Text16, { color: "blue" }, "Code Changes (Sess):")), /* @__PURE__ */ React16.createElement(Text16, { color: "white" }, /* @__PURE__ */ React16.createElement(Text16, { color: "green" }, "+", runtimeSession.linesAdded), " ", /* @__PURE__ */ React16.createElement(Text16, { color: "red" }, "-", runtimeSession.linesRemoved))), /* @__PURE__ */ React16.createElement(Box14, null, /* @__PURE__ */ React16.createElement(Box14, { width: 25 }, /* @__PURE__ */ React16.createElement(Text16, { color: "blue" }, "Tool Calls (Sess):")), /* @__PURE__ */ React16.createElement(Text16, { color: "white" }, runtimeSession.toolSuccess + runtimeSession.toolFailure + runtimeSession.toolDenied, " ( "), /* @__PURE__ */ React16.createElement(Text16, { color: "green" }, "\u2714 ", runtimeSession.toolSuccess), /* @__PURE__ */ React16.createElement(Text16, { color: "white" }, " "), /* @__PURE__ */ React16.createElement(Text16, { color: "yellow" }, "\u{1F6C7} ", runtimeSession.toolDenied), /* @__PURE__ */ React16.createElement(Text16, { color: "white" }, " "), /* @__PURE__ */ React16.createElement(Text16, { color: "red" }, "\u2718 ", runtimeSession.toolFailure), /* @__PURE__ */ React16.createElement(Text16, { color: "white" }, " )"))), /* @__PURE__ */ React16.createElement(Box14, { flexDirection: "column", marginTop: 1 }, /* @__PURE__ */ React16.createElement(Text16, { color: "white", bold: true, underline: true }, trackerTitle), /* @__PURE__ */ React16.createElement(Box14, { marginTop: 1 }, /* @__PURE__ */ React16.createElement(Box14, { width: 25 }, /* @__PURE__ */ React16.createElement(Text16, { color: "blue" }, timeLabel)), /* @__PURE__ */ React16.createElement(Text16, { color: "white" }, formatDuration(u?.duration || 0))), /* @__PURE__ */ React16.createElement(Box14, null, /* @__PURE__ */ React16.createElement(Box14, { width: 25 }, /* @__PURE__ */ React16.createElement(Text16, { color: "blue" }, "Model Requests:")), /* @__PURE__ */ React16.createElement(Text16, { color: "white" }, u?.agent || 0)), /* @__PURE__ */ React16.createElement(Box14, null, /* @__PURE__ */ React16.createElement(Box14, { width: 25 }, /* @__PURE__ */ React16.createElement(Text16, { color: "blue" }, "Memory Agent:")), /* @__PURE__ */ React16.createElement(Text16, { color: "white" }, u?.background || 0)), /* @__PURE__ */ React16.createElement(Box14, null, /* @__PURE__ */ React16.createElement(Box14, { width: 25 }, /* @__PURE__ */ React16.createElement(Text16, { color: "blue" }, tokensLabel)), /* @__PURE__ */ React16.createElement(Text16, { color: "white" }, formatTokens(u?.tokens || 0))), (u?.tokens || 0) > 0 && /* @__PURE__ */ React16.createElement(React16.Fragment, null, /* @__PURE__ */ React16.createElement(Box14, { marginLeft: 2 }, /* @__PURE__ */ React16.createElement(Box14, { width: 23 }, /* @__PURE__ */ React16.createElement(Text16, { color: "grey" }, "\xBB Input Tokens:")), /* @__PURE__ */ React16.createElement(Text16, { color: "white" }, formatTokens((u?.tokens || 0) - (u?.candidateTokens || 0)))), (u?.cachedTokens || 0) > 0 && /* @__PURE__ */ React16.createElement(Box14, { marginLeft: 4 }, /* @__PURE__ */ React16.createElement(Box14, { width: 21 }, /* @__PURE__ */ React16.createElement(Text16, { color: "grey" }, "\xBB Cached:")), /* @__PURE__ */ React16.createElement(Text16, { color: "white" }, formatTokens(u.cachedTokens))), (u?.candidateTokens || 0) > 0 && /* @__PURE__ */ React16.createElement(Box14, { marginLeft: 2 }, /* @__PURE__ */ React16.createElement(Box14, { width: 23 }, /* @__PURE__ */ React16.createElement(Text16, { color: "grey" }, "\xBB Output Tokens:")), /* @__PURE__ */ React16.createElement(Text16, { color: "white" }, formatTokens(u.candidateTokens)))), (u?.imageCalls?.length || 0) > 0 && /* @__PURE__ */ React16.createElement(React16.Fragment, null, /* @__PURE__ */ React16.createElement(Box14, null, /* @__PURE__ */ React16.createElement(Box14, { width: 25 }, /* @__PURE__ */ React16.createElement(Text16, { color: "blue" }, imagesLabel)), /* @__PURE__ */ React16.createElement(Text16, { color: "white" }, u.imageCalls.length)), /* @__PURE__ */ React16.createElement(Box14, null, /* @__PURE__ */ React16.createElement(Box14, { width: 25 }, /* @__PURE__ */ React16.createElement(Text16, { color: "blue" }, imageCreditsLabel)), /* @__PURE__ */ React16.createElement(Text16, { color: "white" }, Number(((u.imageCalls.reduce((sum, c) => sum + c.cost, 0) || 0) * 1e3).toFixed(0)), " credits"))), /* @__PURE__ */ React16.createElement(Box14, null, /* @__PURE__ */ React16.createElement(Box14, { width: 25 }, /* @__PURE__ */ React16.createElement(Text16, { color: "blue" }, codeChangesLabel)), /* @__PURE__ */ React16.createElement(Text16, { color: "white" }, /* @__PURE__ */ React16.createElement(Text16, { color: "green" }, "+", u?.linesAdded || 0), " ", /* @__PURE__ */ React16.createElement(Text16, { color: "red" }, "-", u?.linesRemoved || 0))), /* @__PURE__ */ React16.createElement(Box14, null, /* @__PURE__ */ React16.createElement(Box14, { width: 25 }, /* @__PURE__ */ React16.createElement(Text16, { color: "blue" }, toolCallsLabel)), /* @__PURE__ */ React16.createElement(Text16, { color: "white" }, (u?.toolSuccess || 0) + (u?.toolFailure || 0) + (u?.toolDenied || 0), " ( "), /* @__PURE__ */ React16.createElement(Text16, { color: "green" }, "\u2714 ", u?.toolSuccess || 0), /* @__PURE__ */ React16.createElement(Text16, { color: "white" }, " "), /* @__PURE__ */ React16.createElement(Text16, { color: "yellow" }, "\u{1F6C7} ", u?.toolDenied || 0), /* @__PURE__ */ React16.createElement(Text16, { color: "white" }, " "), /* @__PURE__ */ React16.createElement(Text16, { color: "red" }, "\u2718 ", u?.toolFailure || 0), /* @__PURE__ */ React16.createElement(Text16, { color: "white" }, " )")))), /* @__PURE__ */ React16.createElement(Text16, { dimColor: true, marginTop: 1, italic: true }, "(Press TAB to toggle Daily/Monthly views, SPACE for Model Breakdown, ESC to return)"));
19541
19729
  }
19542
19730
  case "autoExecDanger":
19543
- return /* @__PURE__ */ React15.createElement(Box14, { flexDirection: "column", borderStyle: "round", borderColor: "grey", paddingX: 2, paddingY: 1, width: "100%" }, /* @__PURE__ */ React15.createElement(Text15, { color: "white", bold: true, underline: true }, "SECURITY WARNING: YOLO MODE"), /* @__PURE__ */ React15.createElement(Text15, { marginTop: 1 }, "Turning this ON allows the agent to execute terminal commands automatically without requiring your approval for each step."), /* @__PURE__ */ React15.createElement(Text15, { marginTop: 1, color: "white" }, "RISKS INVOLVED:"), /* @__PURE__ */ React15.createElement(Text15, null, "\u2022 The agent may execute destructive commands (rm -rf, etc.) by mistake unless specified in sandbox rules."), /* @__PURE__ */ React15.createElement(Text15, null, "\u2022 Unintended system changes if the agent hallucinates a path or command."), /* @__PURE__ */ React15.createElement(Text15, null, "\u2022 Reduced control over the agent's step-by-step decision making."), /* @__PURE__ */ React15.createElement(Box14, { marginTop: 1 }, /* @__PURE__ */ React15.createElement(
19731
+ return /* @__PURE__ */ React16.createElement(Box14, { flexDirection: "column", borderStyle: "round", borderColor: "grey", paddingX: 2, paddingY: 1, width: "100%" }, /* @__PURE__ */ React16.createElement(Text16, { color: "white", bold: true, underline: true }, "SECURITY WARNING: YOLO MODE"), /* @__PURE__ */ React16.createElement(Text16, { marginTop: 1 }, "Turning this ON allows the agent to execute terminal commands automatically without requiring your approval for each step."), /* @__PURE__ */ React16.createElement(Text16, { marginTop: 1, color: "white" }, "RISKS INVOLVED:"), /* @__PURE__ */ React16.createElement(Text16, null, "\u2022 The agent may execute destructive commands (rm -rf, etc.) by mistake unless specified in sandbox rules."), /* @__PURE__ */ React16.createElement(Text16, null, "\u2022 Unintended system changes if the agent hallucinates a path or command."), /* @__PURE__ */ React16.createElement(Text16, null, "\u2022 Reduced control over the agent's step-by-step decision making."), /* @__PURE__ */ React16.createElement(Box14, { marginTop: 1 }, /* @__PURE__ */ React16.createElement(
19544
19732
  CommandMenu,
19545
19733
  {
19546
19734
  title: "Confirm Intent",
@@ -19557,7 +19745,7 @@ Selection: ${val}`,
19557
19745
  }
19558
19746
  )));
19559
19747
  case "advanceRollbackDanger":
19560
- return /* @__PURE__ */ React15.createElement(Box14, { flexDirection: "column", borderStyle: "round", borderColor: "grey", paddingX: 2, paddingY: 1, paddingTop: 0, width: "100%" }, /* @__PURE__ */ React15.createElement(Text15, { color: "white", bold: true }, "\u26A0 Emergency Rollback Notice"), /* @__PURE__ */ React15.createElement(Text15, { marginTop: 1 }, "When enabled, full repo snapshots exist only during active AI turns."), /* @__PURE__ */ React15.createElement(Text15, { marginTop: 1 }, "If catastrophic changes occur during a turn, avoid abruptly stopping the agent unless absolutely necessary (external damages out of codebase)."), /* @__PURE__ */ React15.createElement(Text15, null, "The agent may be able to automatically restore the repo to a safe state."), /* @__PURE__ */ React15.createElement(Text15, { marginTop: 1 }, "Once the turn ends, emergency snapshots are deleted and standard /revert takes over which may not retain full repo content."), /* @__PURE__ */ React15.createElement(Box14, { marginTop: 1 }, /* @__PURE__ */ React15.createElement(
19748
+ return /* @__PURE__ */ React16.createElement(Box14, { flexDirection: "column", borderStyle: "round", borderColor: "grey", paddingX: 2, paddingY: 1, paddingTop: 0, width: "100%" }, /* @__PURE__ */ React16.createElement(Text16, { color: "white", bold: true }, "\u26A0 Emergency Rollback Notice"), /* @__PURE__ */ React16.createElement(Text16, { marginTop: 1 }, "When enabled, full repo snapshots exist only during active AI turns."), /* @__PURE__ */ React16.createElement(Text16, { marginTop: 1 }, "If catastrophic changes occur during a turn, avoid abruptly stopping the agent unless absolutely necessary (external damages out of codebase)."), /* @__PURE__ */ React16.createElement(Text16, null, "The agent may be able to automatically restore the repo to a safe state."), /* @__PURE__ */ React16.createElement(Text16, { marginTop: 1 }, "Once the turn ends, emergency snapshots are deleted and standard /revert takes over which may not retain full repo content."), /* @__PURE__ */ React16.createElement(Box14, { marginTop: 1 }, /* @__PURE__ */ React16.createElement(
19561
19749
  CommandMenu,
19562
19750
  {
19563
19751
  title: "Confirm",
@@ -19574,7 +19762,7 @@ Selection: ${val}`,
19574
19762
  }
19575
19763
  )));
19576
19764
  case "externalDanger":
19577
- return /* @__PURE__ */ React15.createElement(Box14, { flexDirection: "column", borderStyle: "round", borderColor: "grey", paddingX: 2, paddingY: 1, width: "100%" }, /* @__PURE__ */ React15.createElement(Text15, { color: "white", bold: true, underline: true }, "SECURITY WARNING: EXTERNAL WORKSPACE ACCESS"), /* @__PURE__ */ React15.createElement(Text15, { marginTop: 1 }, "Turning this ON allows the agent to execute tools (Read/Write/Exec) outside of the current active workspace directory."), /* @__PURE__ */ React15.createElement(Text15, { marginTop: 1, color: "white" }, "RISKS INVOLVED:"), /* @__PURE__ */ React15.createElement(Text15, null, "\u2022 Access to sensitive system files (SSH keys, Browser data, etc.)"), /* @__PURE__ */ React15.createElement(Text15, null, "\u2022 Potential for accidental or malicious deletion of OS-critical files."), /* @__PURE__ */ React15.createElement(Text15, null, "\u2022 Unauthorized script execution across your entire file system."), /* @__PURE__ */ React15.createElement(Box14, { marginTop: 1 }, /* @__PURE__ */ React15.createElement(
19765
+ return /* @__PURE__ */ React16.createElement(Box14, { flexDirection: "column", borderStyle: "round", borderColor: "grey", paddingX: 2, paddingY: 1, width: "100%" }, /* @__PURE__ */ React16.createElement(Text16, { color: "white", bold: true, underline: true }, "SECURITY WARNING: EXTERNAL WORKSPACE ACCESS"), /* @__PURE__ */ React16.createElement(Text16, { marginTop: 1 }, "Turning this ON allows the agent to execute tools (Read/Write/Exec) outside of the current active workspace directory."), /* @__PURE__ */ React16.createElement(Text16, { marginTop: 1, color: "white" }, "RISKS INVOLVED:"), /* @__PURE__ */ React16.createElement(Text16, null, "\u2022 Access to sensitive system files (SSH keys, Browser data, etc.)"), /* @__PURE__ */ React16.createElement(Text16, null, "\u2022 Potential for accidental or malicious deletion of OS-critical files."), /* @__PURE__ */ React16.createElement(Text16, null, "\u2022 Unauthorized script execution across your entire file system."), /* @__PURE__ */ React16.createElement(Box14, { marginTop: 1 }, /* @__PURE__ */ React16.createElement(
19578
19766
  CommandMenu,
19579
19767
  {
19580
19768
  title: "Confirm Intent",
@@ -19591,7 +19779,7 @@ Selection: ${val}`,
19591
19779
  }
19592
19780
  )));
19593
19781
  case "doubleDanger":
19594
- return /* @__PURE__ */ React15.createElement(Box14, { flexDirection: "column", borderStyle: "round", borderColor: "white", paddingX: 2, paddingY: 1, width: "100%" }, /* @__PURE__ */ React15.createElement(Text15, { color: "white", bold: true, underline: true }, "CRITICAL SECURITY WARNING: COMBINED SYSTEM RISK"), /* @__PURE__ */ React15.createElement(Text15, { marginTop: 1 }, "You are attempting to enable BOTH [YOLO Mode] and [External Workspace Access] simultaneously."), /* @__PURE__ */ React15.createElement(Text15, { marginTop: 1, color: "red", bold: true }, "THIS IS NOT RECOMMENDED."), /* @__PURE__ */ React15.createElement(Text15, { marginTop: 1, color: "white" }, "THE CRITICAL RISK:"), /* @__PURE__ */ React15.createElement(Text15, null, "The agent will have the power to execute any command across your entire system WITHOUT your approval or supervision."), /* @__PURE__ */ React15.createElement(Text15, { color: "red", italic: true, marginTop: 1 }, "A single hallucination or error could result in full system wipe or data theft."), /* @__PURE__ */ React15.createElement(Box14, { marginTop: 1 }, /* @__PURE__ */ React15.createElement(
19782
+ return /* @__PURE__ */ React16.createElement(Box14, { flexDirection: "column", borderStyle: "round", borderColor: "white", paddingX: 2, paddingY: 1, width: "100%" }, /* @__PURE__ */ React16.createElement(Text16, { color: "white", bold: true, underline: true }, "CRITICAL SECURITY WARNING: COMBINED SYSTEM RISK"), /* @__PURE__ */ React16.createElement(Text16, { marginTop: 1 }, "You are attempting to enable BOTH [YOLO Mode] and [External Workspace Access] simultaneously."), /* @__PURE__ */ React16.createElement(Text16, { marginTop: 1, color: "red", bold: true }, "THIS IS NOT RECOMMENDED."), /* @__PURE__ */ React16.createElement(Text16, { marginTop: 1, color: "white" }, "THE CRITICAL RISK:"), /* @__PURE__ */ React16.createElement(Text16, null, "The agent will have the power to execute any command across your entire system WITHOUT your approval or supervision."), /* @__PURE__ */ React16.createElement(Text16, { color: "red", italic: true, marginTop: 1 }, "A single hallucination or error could result in full system wipe or data theft."), /* @__PURE__ */ React16.createElement(Box14, { marginTop: 1 }, /* @__PURE__ */ React16.createElement(
19595
19783
  CommandMenu,
19596
19784
  {
19597
19785
  title: "Final Confirmation",
@@ -19608,7 +19796,7 @@ Selection: ${val}`,
19608
19796
  }
19609
19797
  )));
19610
19798
  case "key":
19611
- return /* @__PURE__ */ React15.createElement(
19799
+ return /* @__PURE__ */ React16.createElement(
19612
19800
  CommandMenu,
19613
19801
  {
19614
19802
  title: "API KEY MANAGEMENT",
@@ -19632,10 +19820,10 @@ Selection: ${val}`,
19632
19820
  }
19633
19821
  );
19634
19822
  case "deleteKey":
19635
- return /* @__PURE__ */ React15.createElement(Box14, { flexDirection: "column", borderStyle: "round", borderColor: "grey", paddingX: 2, paddingY: 1 }, (() => {
19823
+ return /* @__PURE__ */ React16.createElement(Box14, { flexDirection: "column", borderStyle: "round", borderColor: "grey", paddingX: 2, paddingY: 1 }, (() => {
19636
19824
  const s = emojiSpace(2);
19637
- return /* @__PURE__ */ React15.createElement(Text15, { color: "white", bold: true }, "DANGER: CLEAR CREDENTIALS");
19638
- })(), /* @__PURE__ */ React15.createElement(Text15, { marginTop: 1 }, "This will permanently delete all saved API keys in credential cache. You will need to enter it again to use Flux."), /* @__PURE__ */ React15.createElement(Box14, { marginTop: 1 }, /* @__PURE__ */ React15.createElement(
19825
+ return /* @__PURE__ */ React16.createElement(Text16, { color: "white", bold: true }, "DANGER: CLEAR CREDENTIALS");
19826
+ })(), /* @__PURE__ */ React16.createElement(Text16, { marginTop: 1 }, "This will permanently delete all saved API keys in credential cache. You will need to enter it again to use Flux."), /* @__PURE__ */ React16.createElement(Box14, { marginTop: 1 }, /* @__PURE__ */ React16.createElement(
19639
19827
  CommandMenu,
19640
19828
  {
19641
19829
  title: "Are you sure?",
@@ -19659,7 +19847,7 @@ Selection: ${val}`,
19659
19847
  case "exit":
19660
19848
  return null;
19661
19849
  case "ask":
19662
- return /* @__PURE__ */ React15.createElement(Box14, { width: "100%" }, /* @__PURE__ */ React15.createElement(
19850
+ return /* @__PURE__ */ React16.createElement(Box14, { width: "100%" }, /* @__PURE__ */ React16.createElement(
19663
19851
  AskUserModal_default,
19664
19852
  {
19665
19853
  question: pendingAsk?.question,
@@ -19674,7 +19862,7 @@ Selection: ${val}`,
19674
19862
  }
19675
19863
  ));
19676
19864
  case "revert":
19677
- return /* @__PURE__ */ React15.createElement(Box14, { width: "100%", alignItems: "center", justifyContent: "center" }, /* @__PURE__ */ React15.createElement(
19865
+ return /* @__PURE__ */ React16.createElement(Box14, { width: "100%", alignItems: "center", justifyContent: "center" }, /* @__PURE__ */ React16.createElement(
19678
19866
  RevertModal,
19679
19867
  {
19680
19868
  prompts: recentPrompts,
@@ -19745,7 +19933,7 @@ Selection: ${val}`,
19745
19933
  }
19746
19934
  ));
19747
19935
  case "resume":
19748
- return /* @__PURE__ */ React15.createElement(Box14, { width: "100%", alignItems: "center", justifyContent: "center" }, /* @__PURE__ */ React15.createElement(
19936
+ return /* @__PURE__ */ React16.createElement(Box14, { width: "100%", alignItems: "center", justifyContent: "center" }, /* @__PURE__ */ React16.createElement(
19749
19937
  ResumeModal,
19750
19938
  {
19751
19939
  onSelect: async (id) => {
@@ -19782,7 +19970,7 @@ Selection: ${val}`,
19782
19970
  }
19783
19971
  ));
19784
19972
  case "keybindingsPrompt":
19785
- return /* @__PURE__ */ React15.createElement(Box14, { flexDirection: "column", borderStyle: "round", borderColor: "grey", paddingX: 2, paddingY: 1, width: "100%" }, /* @__PURE__ */ React15.createElement(Text15, { color: "white", bold: true, underline: true }, "\u2328 CONFIGURE SHIFT+ENTER NEWLINE"), /* @__PURE__ */ React15.createElement(Text15, { marginTop: 1 }, "To support multi-line inputs with ", /* @__PURE__ */ React15.createElement(Text15, { bold: true, color: "white" }, "Shift + Enter"), " for newline, a terminal sequence keybinding needs to be added to your IDE configuration."), /* @__PURE__ */ React15.createElement(Text15, { marginTop: 1 }, "Would you like FluxFlow to automatically add this to your ", getIDEName(), " keybindings?"), /* @__PURE__ */ React15.createElement(Box14, { marginTop: 1 }, /* @__PURE__ */ React15.createElement(
19973
+ return /* @__PURE__ */ React16.createElement(Box14, { flexDirection: "column", borderStyle: "round", borderColor: "grey", paddingX: 2, paddingY: 1, width: "100%" }, /* @__PURE__ */ React16.createElement(Text16, { color: "white", bold: true, underline: true }, "\u2328 CONFIGURE SHIFT+ENTER NEWLINE"), /* @__PURE__ */ React16.createElement(Text16, { marginTop: 1 }, "To support multi-line inputs with ", /* @__PURE__ */ React16.createElement(Text16, { bold: true, color: "white" }, "Shift + Enter"), " for newline, a terminal sequence keybinding needs to be added to your IDE configuration."), /* @__PURE__ */ React16.createElement(Text16, { marginTop: 1 }, "Would you like FluxFlow to automatically add this to your ", getIDEName(), " keybindings?"), /* @__PURE__ */ React16.createElement(Box14, { marginTop: 1 }, /* @__PURE__ */ React16.createElement(
19786
19974
  CommandMenu,
19787
19975
  {
19788
19976
  title: "Add Keybinding?",
@@ -19801,11 +19989,11 @@ Selection: ${val}`,
19801
19989
  }
19802
19990
  )));
19803
19991
  case "memory":
19804
- return /* @__PURE__ */ React15.createElement(Box14, { width: "100%", alignItems: "center", justifyContent: "center" }, /* @__PURE__ */ React15.createElement(MemoryModal, { onClose: () => setActiveView("chat") }));
19992
+ return /* @__PURE__ */ React16.createElement(Box14, { width: "100%", alignItems: "center", justifyContent: "center" }, /* @__PURE__ */ React16.createElement(MemoryModal, { onClose: () => setActiveView("chat") }));
19805
19993
  case "parserDownload":
19806
- return /* @__PURE__ */ React15.createElement(Box14, { width: "100%", alignItems: "center", justifyContent: "center" }, /* @__PURE__ */ React15.createElement(ParserDownloadModal, { onClose: () => setActiveView("settings") }));
19994
+ return /* @__PURE__ */ React16.createElement(Box14, { width: "100%", alignItems: "center", justifyContent: "center" }, /* @__PURE__ */ React16.createElement(ParserDownloadModal, { onClose: () => setActiveView("settings") }));
19807
19995
  case "profile":
19808
- return /* @__PURE__ */ React15.createElement(
19996
+ return /* @__PURE__ */ React16.createElement(
19809
19997
  ProfileForm,
19810
19998
  {
19811
19999
  initialData: profileData,
@@ -19818,7 +20006,7 @@ Selection: ${val}`,
19818
20006
  }
19819
20007
  );
19820
20008
  case "resolution":
19821
- return /* @__PURE__ */ React15.createElement(Box14, { width: "100%", alignItems: "center", justifyContent: "center" }, /* @__PURE__ */ React15.createElement(
20009
+ return /* @__PURE__ */ React16.createElement(Box14, { width: "100%", alignItems: "center", justifyContent: "center" }, /* @__PURE__ */ React16.createElement(
19822
20010
  ResolutionModal,
19823
20011
  {
19824
20012
  data: resolutionData,
@@ -19837,7 +20025,7 @@ Selection: ${val}`,
19837
20025
  }
19838
20026
  ));
19839
20027
  case "approval":
19840
- return /* @__PURE__ */ React15.createElement(Box14, { flexDirection: "column", borderStyle: "round", borderColor: "white", paddingX: 2, paddingY: 1, width: "100%" }, /* @__PURE__ */ React15.createElement(Text15, { color: "white", bold: true, underline: true }, "FILE WRITE PERMISSION"), /* @__PURE__ */ React15.createElement(Text15, { marginTop: 1 }, "The agent is attempting to modify: ", /* @__PURE__ */ React15.createElement(Text15, { color: "cyan" }, parseArgs(pendingApproval?.args || "{}").path || "Unknown File")), !isBridgeConnected() ? /* @__PURE__ */ React15.createElement(Box14, { marginTop: 1, borderStyle: "single", borderColor: "#333", paddingX: 1, flexDirection: "column" }, /* @__PURE__ */ React15.createElement(Text15, { color: "gray" }, "--- PROPOSED CONTENT ---"), (() => {
20028
+ return /* @__PURE__ */ React16.createElement(Box14, { flexDirection: "column", borderStyle: "round", borderColor: "white", paddingX: 2, paddingY: 1, width: "100%" }, /* @__PURE__ */ React16.createElement(Text16, { color: "white", bold: true, underline: true }, "FILE WRITE PERMISSION"), /* @__PURE__ */ React16.createElement(Text16, { marginTop: 1 }, "The agent is attempting to modify: ", /* @__PURE__ */ React16.createElement(Text16, { color: "cyan" }, parseArgs(pendingApproval?.args || "{}").path || "Unknown File")), !isBridgeConnected() ? /* @__PURE__ */ React16.createElement(Box14, { marginTop: 1, borderStyle: "single", borderColor: "#333", paddingX: 1, flexDirection: "column" }, /* @__PURE__ */ React16.createElement(Text16, { color: "gray" }, "--- PROPOSED CONTENT ---"), (() => {
19841
20029
  const args2 = parseArgs(pendingApproval?.args || "{}");
19842
20030
  const patchPairs = [];
19843
20031
  const indices = /* @__PURE__ */ new Set();
@@ -19863,15 +20051,15 @@ Selection: ${val}`,
19863
20051
  }
19864
20052
  });
19865
20053
  if (patchPairs.length > 0) {
19866
- return /* @__PURE__ */ React15.createElement(Box14, { flexDirection: "column", marginTop: 1 }, patchPairs.map((pair, idx) => {
20054
+ return /* @__PURE__ */ React16.createElement(Box14, { flexDirection: "column", marginTop: 1 }, patchPairs.map((pair, idx) => {
19867
20055
  const hasOld = pair.replace !== null;
19868
20056
  const hasNew = pair.new !== null;
19869
- return /* @__PURE__ */ React15.createElement(Box14, { key: idx, flexDirection: "column", marginTop: idx > 0 ? 1 : 0 }, patchPairs.length > 1 && /* @__PURE__ */ React15.createElement(Text15, { color: "gray" }, "Block ", idx + 1, ":"), hasOld && /* @__PURE__ */ React15.createElement(Box14, null, /* @__PURE__ */ React15.createElement(Text15, { color: "red", wrap: "anywhere", bold: true }, "- ", pair.replace)), hasNew && /* @__PURE__ */ React15.createElement(Box14, { marginTop: hasOld ? 0 : 0 }, /* @__PURE__ */ React15.createElement(Text15, { color: "green", wrap: "anywhere", bold: true }, "+ ", pair.new.replace(/\[\/n\]?/g, "\\n"))));
20057
+ return /* @__PURE__ */ React16.createElement(Box14, { key: idx, flexDirection: "column", marginTop: idx > 0 ? 1 : 0 }, patchPairs.length > 1 && /* @__PURE__ */ React16.createElement(Text16, { color: "gray" }, "Block ", idx + 1, ":"), hasOld && /* @__PURE__ */ React16.createElement(Box14, null, /* @__PURE__ */ React16.createElement(Text16, { color: "red", wrap: "anywhere", bold: true }, "- ", pair.replace)), hasNew && /* @__PURE__ */ React16.createElement(Box14, { marginTop: hasOld ? 0 : 0 }, /* @__PURE__ */ React16.createElement(Text16, { color: "green", wrap: "anywhere", bold: true }, "+ ", pair.new.replace(/\[\/n\]?/g, "\\n"))));
19870
20058
  }));
19871
20059
  }
19872
20060
  const newVal = args2.content || args2.ReplacementContent || args2.content_to_add || args2.replacementContent || args2.newContent || null;
19873
- return /* @__PURE__ */ React15.createElement(Text15, { color: "white", wrap: "anywhere" }, (newVal ? newVal.replace(/\[\/n\]?/g, "\\n") : null) || "Updating file content...");
19874
- })()) : /* @__PURE__ */ React15.createElement(Box14, { marginTop: 1, paddingX: 1 }, /* @__PURE__ */ React15.createElement(Text15, { color: "cyan", italic: true }, "\u26A1\uFE0F FluxFlow Companion is active. Review the changes in your editor.")), /* @__PURE__ */ React15.createElement(Box14, { marginTop: 1 }, /* @__PURE__ */ React15.createElement(
20061
+ return /* @__PURE__ */ React16.createElement(Text16, { color: "white", wrap: "anywhere" }, (newVal ? newVal.replace(/\[\/n\]?/g, "\\n") : null) || "Updating file content...");
20062
+ })()) : /* @__PURE__ */ React16.createElement(Box14, { marginTop: 1, paddingX: 1 }, /* @__PURE__ */ React16.createElement(Text16, { color: "cyan", italic: true }, "\u26A1\uFE0F FluxFlow Companion is active. Review the changes in your editor.")), /* @__PURE__ */ React16.createElement(Box14, { marginTop: 1 }, /* @__PURE__ */ React16.createElement(
19875
20063
  CommandMenu,
19876
20064
  {
19877
20065
  title: "Action Required",
@@ -19890,7 +20078,7 @@ Selection: ${val}`,
19890
20078
  }
19891
20079
  )));
19892
20080
  case "updateManager":
19893
- return /* @__PURE__ */ React15.createElement(
20081
+ return /* @__PURE__ */ React16.createElement(
19894
20082
  CommandMenu,
19895
20083
  {
19896
20084
  title: "Select Preferred Update Manager",
@@ -19927,7 +20115,7 @@ Selection: ${val}`,
19927
20115
  }
19928
20116
  );
19929
20117
  case "update":
19930
- return /* @__PURE__ */ React15.createElement(
20118
+ return /* @__PURE__ */ React16.createElement(
19931
20119
  UpdateProcessor_default,
19932
20120
  {
19933
20121
  latest: latestVer,
@@ -19953,7 +20141,7 @@ Selection: ${val}`,
19953
20141
  }
19954
20142
  );
19955
20143
  case "terminalApproval":
19956
- return /* @__PURE__ */ React15.createElement(Box14, { flexDirection: "column", borderStyle: "round", borderColor: "white", paddingX: 2, paddingY: 1, width: "100%" }, /* @__PURE__ */ React15.createElement(Text15, { color: "white", bold: true, underline: true }, "TERMINAL COMMAND OVERSIGHT"), /* @__PURE__ */ React15.createElement(Box14, { marginTop: 1 }, /* @__PURE__ */ React15.createElement(Text15, null, "Agent requested to run: ", /* @__PURE__ */ React15.createElement(Text15, { color: "yellow", bold: true }, parseArgs(pendingApproval?.args || "{}").command || "Unknown Command"))), /* @__PURE__ */ React15.createElement(Box14, { marginTop: 1 }, /* @__PURE__ */ React15.createElement(
20144
+ return /* @__PURE__ */ React16.createElement(Box14, { flexDirection: "column", borderStyle: "round", borderColor: "white", paddingX: 2, paddingY: 1, width: "100%" }, /* @__PURE__ */ React16.createElement(Text16, { color: "white", bold: true, underline: true }, "TERMINAL COMMAND OVERSIGHT"), /* @__PURE__ */ React16.createElement(Box14, { marginTop: 1 }, /* @__PURE__ */ React16.createElement(Text16, null, "Agent requested to run: ", /* @__PURE__ */ React16.createElement(Text16, { color: "yellow", bold: true }, parseArgs(pendingApproval?.args || "{}").command || "Unknown Command"))), /* @__PURE__ */ React16.createElement(Box14, { marginTop: 1 }, /* @__PURE__ */ React16.createElement(
19957
20145
  CommandMenu,
19958
20146
  {
19959
20147
  title: "Risk Assessment Required",
@@ -19969,7 +20157,18 @@ Selection: ${val}`,
19969
20157
  }
19970
20158
  )));
19971
20159
  default:
19972
- return /* @__PURE__ */ React15.createElement(Box14, { flexDirection: "column", marginTop: 1, flexShrink: 0, width: "100%" }, showBtwBox && btwResponse && /* @__PURE__ */ React15.createElement(Box14, { flexDirection: "column", borderStyle: "round", borderColor: "grey", paddingX: 2, paddingY: 1, width: "100%", marginBottom: 1 }, /* @__PURE__ */ React15.createElement(Box14, { justifyContent: "space-between", width: "100%" }, /* @__PURE__ */ React15.createElement(Text15, { color: "white", bold: true, underline: true }, "INQUIRY RESPONSE"), /* @__PURE__ */ React15.createElement(Text15, { color: "gray" }, "[ ESC to Close ]")), /* @__PURE__ */ React15.createElement(Box14, { marginTop: 1, width: "100%" }, /* @__PURE__ */ React15.createElement(CodeRenderer, { text: btwResponse, columns: terminalSize.columns - 6 }))), activeSubagents.filter((sa) => sa.status === "running").length > 0 && /* @__PURE__ */ React15.createElement(Box14, { flexDirection: "column", borderStyle: "round", borderColor: "gray", paddingX: 2, paddingY: 0, width: "100%", marginBottom: 1 }, /* @__PURE__ */ React15.createElement(Box14, { justifyContent: "space-between", width: "100%" }, /* @__PURE__ */ React15.createElement(Text15, { color: "white", bold: true }, "ACTIVE SUBAGENTS")), /* @__PURE__ */ React15.createElement(Box14, { flexDirection: "column", marginTop: 1, width: "100%" }, activeSubagents.filter((sa) => sa.status === "running").map((sa) => /* @__PURE__ */ React15.createElement(SubagentRow, { key: sa.id, sa })))), /* @__PURE__ */ React15.createElement(Box14, { paddingX: 1, marginBottom: 0, justifyContent: "space-between", width: "100%" }, /* @__PURE__ */ React15.createElement(Box14, null, statusText ? /* @__PURE__ */ React15.createElement(Box14, { gap: 1 }, /* @__PURE__ */ React15.createElement(build_default, null), /* @__PURE__ */ React15.createElement(Text15, { color: "white", bold: true, italic: true }, statusText.trimEnd()), /* @__PURE__ */ React15.createElement(Text15, { color: "gray" }, activeTime > 0 ? `[${activeTime.toFixed(0)}s]` : "")) : /* @__PURE__ */ React15.createElement(Text15, { color: "white", italic: true }, input.length > 0 && escPressCount ? "Press ESC again to clear input" : hasPasteBlock ? "Press CTRL + O to expand" : "Waiting for input...")), /* @__PURE__ */ React15.createElement(Box14, null, isProcessing && Date.now() - lastChunkTime > 15e3 && !activeSubagents.some((sa) => sa.status === "running" && !statusText.toLowerCase().includes("waiting")) ? /* @__PURE__ */ React15.createElement(Box14, null, /* @__PURE__ */ React15.createElement(Text15, { color: "white", bold: true }, "Waiting for API"), /* @__PURE__ */ React15.createElement(Text15, { color: "gray", dimColor: true }, " \u2503 ")) : wittyPhrase ? /* @__PURE__ */ React15.createElement(Box14, null, /* @__PURE__ */ React15.createElement(Text15, { color: "gray", italic: true }, wittyPhrase), /* @__PURE__ */ React15.createElement(Text15, { color: "gray", dimColor: true }, " \u2503 ")) : null, /* @__PURE__ */ React15.createElement(Text15, { color: "white" }, tempModelOverride || activeModel))), /* @__PURE__ */ React15.createElement(Box14, { flexDirection: "column", width: "100%" }, /* @__PURE__ */ React15.createElement(Box14, { width: "100%", height: 1, overflow: "hidden" }, /* @__PURE__ */ React15.createElement(Text15, { color: "#555555" }, "\u2584".repeat(Math.max(1, terminalSize.columns)))), /* @__PURE__ */ React15.createElement(
20160
+ return /* @__PURE__ */ React16.createElement(Box14, { flexDirection: "column", marginTop: 1, flexShrink: 0, width: "100%" }, showBtwBox && btwResponse && /* @__PURE__ */ React16.createElement(Box14, { flexDirection: "column", borderStyle: "round", borderColor: "grey", paddingX: 2, paddingY: 1, width: "100%", marginBottom: 1 }, /* @__PURE__ */ React16.createElement(Box14, { justifyContent: "space-between", width: "100%" }, /* @__PURE__ */ React16.createElement(Text16, { color: "white", bold: true, underline: true }, "INQUIRY RESPONSE"), /* @__PURE__ */ React16.createElement(Text16, { color: "gray" }, "[ ESC to Close ]")), /* @__PURE__ */ React16.createElement(Box14, { marginTop: 1, width: "100%" }, /* @__PURE__ */ React16.createElement(CodeRenderer, { text: btwResponse, columns: terminalSize.columns - 6 }))), activeSubagents.filter((sa) => sa.status === "running").length > 0 && /* @__PURE__ */ React16.createElement(Box14, { flexDirection: "column", borderStyle: "round", borderColor: "gray", paddingX: 2, paddingY: 0, width: "100%", marginBottom: 1 }, /* @__PURE__ */ React16.createElement(Box14, { justifyContent: "space-between", width: "100%" }, /* @__PURE__ */ React16.createElement(Text16, { color: "white", bold: true }, "ACTIVE SUBAGENTS")), /* @__PURE__ */ React16.createElement(Box14, { flexDirection: "column", marginTop: 1, width: "100%" }, activeSubagents.filter((sa) => sa.status === "running").map((sa) => /* @__PURE__ */ React16.createElement(SubagentRow, { key: sa.id, sa })))), /* @__PURE__ */ React16.createElement(Box14, { paddingX: 1, marginBottom: 0, justifyContent: "space-between", width: "100%" }, /* @__PURE__ */ React16.createElement(Box14, null, statusText ? /* @__PURE__ */ React16.createElement(Box14, { gap: 1 }, /* @__PURE__ */ React16.createElement(build_default, null), /* @__PURE__ */ React16.createElement(
20161
+ GlintText_default,
20162
+ {
20163
+ text: statusText.trimEnd(),
20164
+ baseColor: "#BFD2CA",
20165
+ glintColor: "#D8D2C8",
20166
+ speed: 60,
20167
+ italic: true,
20168
+ glintWidth: 2,
20169
+ typeSpeed: 10
20170
+ }
20171
+ ), /* @__PURE__ */ React16.createElement(Text16, { color: "gray" }, activeTime > 0 ? `(${activeTime.toFixed(0)}s)` : "")) : /* @__PURE__ */ React16.createElement(Text16, { color: "grey", italic: true }, input.length > 0 && escPressCount ? "Press ESC again to clear input" : hasPasteBlock ? "Press CTRL + O to expand" : "Waiting for input...")), /* @__PURE__ */ React16.createElement(Box14, null, isProcessing && Date.now() - lastChunkTime > 15e3 && !activeSubagents.some((sa) => sa.status === "running" && !statusText.toLowerCase().includes("waiting")) ? /* @__PURE__ */ React16.createElement(Box14, null, /* @__PURE__ */ React16.createElement(Text16, { color: "white" }, "Waiting for API"), /* @__PURE__ */ React16.createElement(Text16, { color: "gray", dimColor: true }, " \u2503 ")) : wittyPhrase ? /* @__PURE__ */ React16.createElement(Box14, null, /* @__PURE__ */ React16.createElement(Text16, { color: "gray", italic: true }, wittyPhrase), /* @__PURE__ */ React16.createElement(Text16, { color: "gray", dimColor: true }, " \u2503 ")) : null, /* @__PURE__ */ React16.createElement(GlintText_default, { text: tempModelOverride || activeModel, baseColor: "white", glintColor: "gray", glintWidth: 1 }))), /* @__PURE__ */ React16.createElement(Box14, { flexDirection: "column", width: "100%" }, /* @__PURE__ */ React16.createElement(Box14, { width: "100%", height: 1, overflow: "hidden" }, /* @__PURE__ */ React16.createElement(Text16, { color: "#555555" }, "\u2584".repeat(Math.max(1, terminalSize.columns)))), /* @__PURE__ */ React16.createElement(
19973
20172
  Box14,
19974
20173
  {
19975
20174
  backgroundColor: "#555555",
@@ -19978,7 +20177,7 @@ Selection: ${val}`,
19978
20177
  width: "100%",
19979
20178
  flexDirection: "column"
19980
20179
  },
19981
- /* @__PURE__ */ React15.createElement(Box14, { flexDirection: "column", width: "100%" }, /* @__PURE__ */ React15.createElement(Box14, { flexDirection: "row", width: "100%", paddingY: 0 }, /* @__PURE__ */ React15.createElement(Box14, { flexShrink: 0, width: 4 }, /* @__PURE__ */ React15.createElement(Text15, { color: "white", bold: true }, isProcessing || isCompressing ? "\u2726 " : " \u276F ")), /* @__PURE__ */ React15.createElement(Box14, { flexGrow: 1 }, /* @__PURE__ */ React15.createElement(Box14, { flexGrow: 1, position: "relative" }, input === "" && /* @__PURE__ */ React15.createElement(Box14, { position: "absolute", paddingLeft: 0 }, activeCommand && !isTerminalFocused ? /* @__PURE__ */ React15.createElement(Text15, { color: "yellow" }, isTerminalWaitingForInput ? " Terminal is waiting for user input. Press TAB to interact" : " Press TAB to interact with terminal...") : activeCommand && isTerminalFocused ? /* @__PURE__ */ React15.createElement(Text15, { color: "yellow", bold: true }, " [ TERMINAL FOCUSED ] Type to interact, press TAB to exit...") : escPressCount === 1 ? /* @__PURE__ */ React15.createElement(Text15, { color: "white", bold: true }, " Press ESC again to ", input.length > 0 ? "clear input" : "revert codebase to checkpoint", "...") : /* @__PURE__ */ React15.createElement(Text15, { color: "#cccccc" }, escPressed ? " Press ESC again to cancel the request." : isCompressing ? " Compressing session history, please wait..." : !isProcessing ? ` Send message, @file or /cmd ... (${terminalEnv.shortcut} for newline)` : " Enter a prompt to steer the agent.")), /* @__PURE__ */ React15.createElement(
20180
+ /* @__PURE__ */ React16.createElement(Box14, { flexDirection: "column", width: "100%" }, /* @__PURE__ */ React16.createElement(Box14, { flexDirection: "row", width: "100%", paddingY: 0 }, /* @__PURE__ */ React16.createElement(Box14, { flexShrink: 0, width: 4 }, /* @__PURE__ */ React16.createElement(Text16, { color: "white", bold: true }, isProcessing || isCompressing ? "\u2726 " : " \u276F ")), /* @__PURE__ */ React16.createElement(Box14, { flexGrow: 1 }, /* @__PURE__ */ React16.createElement(Box14, { flexGrow: 1, position: "relative" }, input === "" && /* @__PURE__ */ React16.createElement(Box14, { position: "absolute", paddingLeft: 0 }, activeCommand && !isTerminalFocused ? /* @__PURE__ */ React16.createElement(Text16, { color: "yellow" }, isTerminalWaitingForInput ? " Terminal is waiting for user input. Press TAB to interact" : " Press TAB to interact with terminal...") : activeCommand && isTerminalFocused ? /* @__PURE__ */ React16.createElement(Text16, { color: "yellow", bold: true }, " [ TERMINAL FOCUSED ] Type to interact, press TAB to exit...") : escPressCount === 1 ? /* @__PURE__ */ React16.createElement(Text16, { color: "white", bold: true }, " Press ESC again to ", input.length > 0 ? "clear input" : "revert codebase to checkpoint", "...") : /* @__PURE__ */ React16.createElement(Text16, { color: "#cccccc" }, escPressed ? " Press ESC again to cancel the request." : isCompressing ? " Compressing session history, please wait..." : !isProcessing ? ` Send message, @file or /cmd ... (${terminalEnv.shortcut} for newline)` : " Enter a prompt to steer the agent.")), /* @__PURE__ */ React16.createElement(
19982
20181
  MultilineInput,
19983
20182
  {
19984
20183
  key: `input-${inputKey}`,
@@ -20003,10 +20202,10 @@ Selection: ${val}`,
20003
20202
  }
20004
20203
  }
20005
20204
  )))))
20006
- ), /* @__PURE__ */ React15.createElement(Box14, { width: "100%", height: 1, overflow: "hidden" }, /* @__PURE__ */ React15.createElement(Text15, { color: "#555555" }, "\u2580".repeat(Math.max(1, terminalSize.columns))))));
20205
+ ), /* @__PURE__ */ React16.createElement(Box14, { width: "100%", height: 1, overflow: "hidden" }, /* @__PURE__ */ React16.createElement(Text16, { color: "#555555" }, "\u2580".repeat(Math.max(1, terminalSize.columns))))));
20007
20206
  }
20008
20207
  };
20009
- return /* @__PURE__ */ React15.createElement(Box14, { flexDirection: "column", width: "100%" }, isInitializing ? null : showBridgePromo ? /* @__PURE__ */ React15.createElement(BridgePromo, { width: stdout?.columns || 80, height: stdout?.rows || 24, selectedIndex: promoSelectedIndex, aiProvider }) : /* @__PURE__ */ React15.createElement(React15.Fragment, null, /* @__PURE__ */ React15.createElement(Box14, { paddingX: 1, flexDirection: "column", width: "100%" }, /* @__PURE__ */ React15.createElement(Static, { key: `static-${clearKey}-${chatId}-${terminalSize.columns}-${terminalSize.rows}`, items: parsedBlocks.completed }, (block) => /* @__PURE__ */ React15.createElement(
20208
+ return /* @__PURE__ */ React16.createElement(Box14, { flexDirection: "column", width: "100%" }, isInitializing ? null : showBridgePromo ? /* @__PURE__ */ React16.createElement(BridgePromo, { width: stdout?.columns || 80, height: stdout?.rows || 24, selectedIndex: promoSelectedIndex, aiProvider }) : /* @__PURE__ */ React16.createElement(React16.Fragment, null, /* @__PURE__ */ React16.createElement(Box14, { paddingX: 1, flexDirection: "column", width: "100%" }, /* @__PURE__ */ React16.createElement(Static, { key: `static-${clearKey}-${chatId}-${terminalSize.columns}-${terminalSize.rows}`, items: parsedBlocks.completed }, (block) => /* @__PURE__ */ React16.createElement(
20010
20209
  BlockItem,
20011
20210
  {
20012
20211
  key: block.key,
@@ -20016,7 +20215,7 @@ Selection: ${val}`,
20016
20215
  aiProvider,
20017
20216
  version: versionFluxflow
20018
20217
  }
20019
- ))), /* @__PURE__ */ React15.createElement(Box14, { flexDirection: "column", paddingX: 1, paddingBottom: 0, width: "100%" }, (activeView === "chat" || ["ask", "approval", "terminalApproval"].includes(activeView)) && /* @__PURE__ */ React15.createElement(Box14, { flexDirection: "column", width: "100%" }, parsedBlocks.active.map((block) => /* @__PURE__ */ React15.createElement(
20218
+ ))), /* @__PURE__ */ React16.createElement(Box14, { flexDirection: "column", paddingX: 1, paddingBottom: 0, width: "100%" }, (activeView === "chat" || ["ask", "approval", "terminalApproval"].includes(activeView)) && /* @__PURE__ */ React16.createElement(Box14, { flexDirection: "column", width: "100%" }, parsedBlocks.active.map((block) => /* @__PURE__ */ React16.createElement(
20020
20219
  BlockItem,
20021
20220
  {
20022
20221
  key: block.key,
@@ -20026,7 +20225,7 @@ Selection: ${val}`,
20026
20225
  aiProvider,
20027
20226
  version: versionFluxflow
20028
20227
  }
20029
- )), activeCommand && /* @__PURE__ */ React15.createElement(Box14, { marginTop: 1 }, /* @__PURE__ */ React15.createElement(TerminalBox, { command: activeCommand, output: execOutput, isFocused: isTerminalFocused, isPty: isActiveCommandPty, terminalHeight: terminalSize.rows }))), isInitializing ? /* @__PURE__ */ React15.createElement(Box14, { borderStyle: "double", borderColor: "grey", padding: 1, flexShrink: 0 }, /* @__PURE__ */ React15.createElement(Text15, { color: "white" }, "Starting Flux Flow...")) : !apiKey ? /* @__PURE__ */ React15.createElement(Box14, { borderStyle: "round", borderColor: "white", padding: 0, flexDirection: "column", flexShrink: 0, width: "100%" }, /* @__PURE__ */ React15.createElement(Box14, { paddingX: 1, marginBottom: 1 }, /* @__PURE__ */ React15.createElement(Text15, { color: "gray", bold: true }, "API KEY REQUIRED")), /* @__PURE__ */ React15.createElement(Box14, { paddingX: 1, flexDirection: "column" }, setupStep === 0 ? /* @__PURE__ */ React15.createElement(React15.Fragment, null, /* @__PURE__ */ React15.createElement(Text15, { color: "white" }, "Select your Preferred Provider:"), /* @__PURE__ */ React15.createElement(Box14, { marginTop: 1 }, /* @__PURE__ */ React15.createElement(
20228
+ )), activeCommand && /* @__PURE__ */ React16.createElement(Box14, { marginTop: 1 }, /* @__PURE__ */ React16.createElement(TerminalBox, { command: activeCommand, output: execOutput, isFocused: isTerminalFocused, isPty: isActiveCommandPty, terminalHeight: terminalSize.rows, columns: terminalSize.columns }))), isInitializing ? /* @__PURE__ */ React16.createElement(Box14, { borderStyle: "double", borderColor: "grey", padding: 1, flexShrink: 0 }, /* @__PURE__ */ React16.createElement(Text16, { color: "white" }, "Starting Flux Flow...")) : !apiKey ? /* @__PURE__ */ React16.createElement(Box14, { borderStyle: "round", borderColor: "white", padding: 0, flexDirection: "column", flexShrink: 0, width: "100%" }, /* @__PURE__ */ React16.createElement(Box14, { paddingX: 1, marginBottom: 1 }, /* @__PURE__ */ React16.createElement(Text16, { color: "gray", bold: true }, "API KEY REQUIRED")), /* @__PURE__ */ React16.createElement(Box14, { paddingX: 1, flexDirection: "column" }, setupStep === 0 ? /* @__PURE__ */ React16.createElement(React16.Fragment, null, /* @__PURE__ */ React16.createElement(Text16, { color: "white" }, "Select your Preferred Provider:"), /* @__PURE__ */ React16.createElement(Box14, { marginTop: 1 }, /* @__PURE__ */ React16.createElement(
20030
20229
  CommandMenu,
20031
20230
  {
20032
20231
  items: [
@@ -20040,7 +20239,7 @@ Selection: ${val}`,
20040
20239
  setSetupStep(1);
20041
20240
  }
20042
20241
  }
20043
- ))) : /* @__PURE__ */ React15.createElement(React15.Fragment, null, /* @__PURE__ */ React15.createElement(Text15, { color: "white" }, "Please enter your ", aiProvider, " API Key to initialize the agent (If billing is enabled set /settings \u2192 Others \u2192 API Strategy to use premium models. Set budget limit at /budgets.)."), /* @__PURE__ */ React15.createElement(Box14, { marginTop: 1 }, /* @__PURE__ */ React15.createElement(Text15, { color: "gray", bold: true }, " ", ">", " "), /* @__PURE__ */ React15.createElement(
20242
+ ))) : /* @__PURE__ */ React16.createElement(React16.Fragment, null, /* @__PURE__ */ React16.createElement(Text16, { color: "white" }, "Please enter your ", aiProvider, " API Key to initialize the agent (If billing is enabled set /settings \u2192 Others \u2192 API Strategy to use premium models. Set budget limit at /budgets.)."), /* @__PURE__ */ React16.createElement(Box14, { marginTop: 1 }, /* @__PURE__ */ React16.createElement(Text16, { color: "gray", bold: true }, " ", ">", " "), /* @__PURE__ */ React16.createElement(
20044
20243
  TextInput4,
20045
20244
  {
20046
20245
  value: tempKey,
@@ -20048,7 +20247,7 @@ Selection: ${val}`,
20048
20247
  onSubmit: handleSetup,
20049
20248
  mask: "*"
20050
20249
  }
20051
- )), /* @__PURE__ */ React15.createElement(Box14, { marginTop: 1 }, /* @__PURE__ */ React15.createElement(Text15, { color: "gray", italic: true }, "(Press ESC to go back to provider selection)")))), /* @__PURE__ */ React15.createElement(Box14, { paddingX: 1, marginTop: 1 }, /* @__PURE__ */ React15.createElement(Text15, { color: "gray", italic: true }, setupStep === 0 ? "(Use arrows to select and Enter to confirm)" : "(Press Enter to confirm and initialize)"))) : renderActiveView(), confirmExit && /* @__PURE__ */ React15.createElement(Box14, { borderStyle: "round", borderColor: "white", paddingX: 2, marginY: 0, width: "100%" }, /* @__PURE__ */ React15.createElement(Text15, { color: "white", bold: true }, "\u{1F534} EXIT CONFIRMATION: "), /* @__PURE__ */ React15.createElement(Text15, { color: "white" }, "Press "), /* @__PURE__ */ React15.createElement(Text15, { color: "white", bold: true }, "CTRL + C"), /* @__PURE__ */ React15.createElement(Text15, { color: "white" }, " again to exit (", exitCountdown, "s). Press "), /* @__PURE__ */ React15.createElement(Text15, { color: "gray", bold: true }, "ESC"), /* @__PURE__ */ React15.createElement(Text15, { color: "white" }, " to cancel.")), suggestions.length > 0 && (() => {
20250
+ )), /* @__PURE__ */ React16.createElement(Box14, { marginTop: 1 }, /* @__PURE__ */ React16.createElement(Text16, { color: "gray", italic: true }, "(Press ESC to go back to provider selection)")))), /* @__PURE__ */ React16.createElement(Box14, { paddingX: 1, marginTop: 1 }, /* @__PURE__ */ React16.createElement(Text16, { color: "gray", italic: true }, setupStep === 0 ? "(Use arrows to select and Enter to confirm)" : "(Press Enter to confirm and initialize)"))) : renderActiveView(), confirmExit && /* @__PURE__ */ React16.createElement(Box14, { borderStyle: "round", borderColor: "white", paddingX: 2, marginY: 0, width: "100%" }, /* @__PURE__ */ React16.createElement(Text16, { color: "white", bold: true }, "\u{1F534} EXIT CONFIRMATION: "), /* @__PURE__ */ React16.createElement(Text16, { color: "white" }, "Press "), /* @__PURE__ */ React16.createElement(Text16, { color: "white", bold: true }, "CTRL + C"), /* @__PURE__ */ React16.createElement(Text16, { color: "white" }, " again to exit (", exitCountdown, "s). Press "), /* @__PURE__ */ React16.createElement(Text16, { color: "gray", bold: true }, "ESC"), /* @__PURE__ */ React16.createElement(Text16, { color: "white" }, " to cancel.")), suggestions.length > 0 && (() => {
20052
20251
  const windowSize = 5;
20053
20252
  let startIdx = suggestionOffsetRef.current;
20054
20253
  if (selectedIndex < startIdx) {
@@ -20060,14 +20259,14 @@ Selection: ${val}`,
20060
20259
  suggestionOffsetRef.current = startIdx;
20061
20260
  const visible = suggestions.slice(startIdx, startIdx + windowSize);
20062
20261
  const remaining = suggestions.length - (startIdx + visible.length);
20063
- return /* @__PURE__ */ React15.createElement(
20262
+ return /* @__PURE__ */ React16.createElement(
20064
20263
  Box14,
20065
20264
  {
20066
20265
  flexDirection: "column",
20067
20266
  width: "100%",
20068
20267
  marginBottom: 1
20069
20268
  },
20070
- /* @__PURE__ */ React15.createElement(Box14, { paddingX: 1, marginBottom: 0, justifyContent: "space-between", width: "100%" }, /* @__PURE__ */ React15.createElement(Text15, { color: "white", bold: true }, suggestions[0]?.cmd?.startsWith("@") ? "FILE SUGGESTIONS" : "COMMAND SUGGESTIONS"), suggestions[0]?.cmd?.startsWith("@") ? /* @__PURE__ */ React15.createElement(Text15, { color: "gray", italic: true }, "(Use '#Lstart-Lend' to specify line numbers)") : input.startsWith("/model") && apiTier === "Free" ? (() => {
20269
+ /* @__PURE__ */ React16.createElement(Box14, { paddingX: 1, marginBottom: 0, justifyContent: "space-between", width: "100%" }, /* @__PURE__ */ React16.createElement(Text16, { color: "white", bold: true }, suggestions[0]?.cmd?.startsWith("@") ? "FILE SUGGESTIONS" : "COMMAND SUGGESTIONS"), suggestions[0]?.cmd?.startsWith("@") ? /* @__PURE__ */ React16.createElement(Text16, { color: "gray", italic: true }, "(Use '#Lstart-Lend' to specify line numbers)") : input.startsWith("/model") && apiTier === "Free" ? (() => {
20071
20270
  let url = "https://aistudio.google.com/billing";
20072
20271
  let label = "billing";
20073
20272
  if (aiProvider === "DeepSeek") {
@@ -20080,13 +20279,13 @@ Selection: ${val}`,
20080
20279
  url = "https://build.nvidia.com/settings/api-keys";
20081
20280
  label = "billing";
20082
20281
  }
20083
- return /* @__PURE__ */ React15.createElement(Text15, { color: "gray", dimColor: true, italic: true }, "Paid API Strategy has more models. Configure ", /* @__PURE__ */ React15.createElement(Text15, { color: "cyan", underline: true }, `\x1B]8;;${url}\x07${label}\x1B]8;;\x07`), " & /settings");
20282
+ return /* @__PURE__ */ React16.createElement(Text16, { color: "gray", dimColor: true, italic: true }, "Paid API Strategy has more models. Configure ", /* @__PURE__ */ React16.createElement(Text16, { color: "cyan", underline: true }, `\x1B]8;;${url}\x07${label}\x1B]8;;\x07`), " & /settings");
20084
20283
  })() : null),
20085
20284
  visible.map((s, i) => {
20086
20285
  const actualIdx = startIdx + i;
20087
20286
  const isActive = actualIdx === selectedIndex;
20088
20287
  const isGemmaDisabled = s.cmd === "gemma-4-31b-it" && apiTier !== "Free";
20089
- return /* @__PURE__ */ React15.createElement(
20288
+ return /* @__PURE__ */ React16.createElement(
20090
20289
  Box14,
20091
20290
  {
20092
20291
  key: s.cmd,
@@ -20094,9 +20293,9 @@ Selection: ${val}`,
20094
20293
  backgroundColor: isActive ? "#2a2a2a" : void 0,
20095
20294
  paddingX: 1
20096
20295
  },
20097
- /* @__PURE__ */ React15.createElement(Box14, { width: 3 }, /* @__PURE__ */ React15.createElement(Text15, { color: isActive ? "white" : "gray", bold: isActive }, isActive ? " \u276F" : " ")),
20098
- /* @__PURE__ */ React15.createElement(Box14, { width: 55 }, /* @__PURE__ */ React15.createElement(
20099
- Text15,
20296
+ /* @__PURE__ */ React16.createElement(Box14, { width: 3 }, /* @__PURE__ */ React16.createElement(Text16, { color: isActive ? "white" : "gray", bold: isActive }, isActive ? " \u276F" : " ")),
20297
+ /* @__PURE__ */ React16.createElement(Box14, { width: 55 }, /* @__PURE__ */ React16.createElement(
20298
+ Text16,
20100
20299
  {
20101
20300
  color: isGemmaDisabled ? "gray" : isActive ? "white" : "grey",
20102
20301
  bold: isActive
@@ -20107,12 +20306,12 @@ Selection: ${val}`,
20107
20306
  return parts[parts.length - 1];
20108
20307
  })() : s.cmd
20109
20308
  )),
20110
- /* @__PURE__ */ React15.createElement(Box14, { flexGrow: 1 }, /* @__PURE__ */ React15.createElement(Text15, { color: `${!isActive ? "gray" : "white"}`, italic: true }, s.desc))
20309
+ /* @__PURE__ */ React16.createElement(Box14, { flexGrow: 1 }, /* @__PURE__ */ React16.createElement(Text16, { color: `${!isActive ? "gray" : "white"}`, italic: true }, s.desc))
20111
20310
  );
20112
20311
  }),
20113
- suggestions.length > 5 && /* @__PURE__ */ React15.createElement(Box14, { paddingX: 1, height: 1 }, remaining > 0 ? /* @__PURE__ */ React15.createElement(Text15, { color: "gray", dimColor: true, italic: true }, " ... (", remaining, " more commands available)") : /* @__PURE__ */ React15.createElement(Text15, { color: "gray", dimColor: true, italic: true }, " (End of list)"))
20312
+ suggestions.length > 5 && /* @__PURE__ */ React16.createElement(Box14, { paddingX: 1, height: 1 }, remaining > 0 ? /* @__PURE__ */ React16.createElement(Text16, { color: "gray", dimColor: true, italic: true }, " ... (", remaining, " more commands available)") : /* @__PURE__ */ React16.createElement(Text16, { color: "gray", dimColor: true, italic: true }, " (End of list)"))
20114
20313
  );
20115
- })(), /* @__PURE__ */ React15.createElement(Box14, { flexShrink: 0, width: "100%" }, /* @__PURE__ */ React15.createElement(
20314
+ })(), /* @__PURE__ */ React16.createElement(Box14, { flexShrink: 0, width: "100%" }, /* @__PURE__ */ React16.createElement(
20116
20315
  StatusBar_default,
20117
20316
  {
20118
20317
  mode,
@@ -20129,15 +20328,15 @@ Selection: ${val}`,
20129
20328
  }
20130
20329
  )), activeView === "exit" && (() => {
20131
20330
  const wallTimeMs = Date.now() - SESSION_START_TIME;
20132
- const totalTools = sessionToolSuccess + sessionToolFailure;
20133
- const successRate = totalTools > 0 ? (sessionToolSuccess / totalTools * 100).toFixed(1) : "0.0";
20331
+ const totalTools = runtimeSession.toolSuccess + runtimeSession.toolFailure;
20332
+ const successRate = totalTools > 0 ? (runtimeSession.toolSuccess / totalTools * 100).toFixed(1) : "0.0";
20134
20333
  const agentActiveMs = sessionApiTime + sessionToolTime;
20135
20334
  const apiPercent = agentActiveMs > 0 ? (sessionApiTime / agentActiveMs * 100).toFixed(1) : "0.0";
20136
20335
  const toolPercent = agentActiveMs > 0 ? (sessionToolTime / agentActiveMs * 100).toFixed(1) : "0.0";
20137
- return /* @__PURE__ */ React15.createElement(Box14, { flexDirection: "column", borderStyle: "round", paddingX: 3, paddingY: 1, borderColor: "grey", width: Math.min(100, (stdout?.columns || 100) - 2), marginTop: 0, marginBottom: 0 }, /* @__PURE__ */ React15.createElement(Box14, { marginBottom: 1 }, /* @__PURE__ */ React15.createElement(Text15, { bold: true }, gradient2(["blue", "purple"])("Agent powering down. Goodbye!"))), /* @__PURE__ */ React15.createElement(Box14, { flexDirection: "column" }, /* @__PURE__ */ React15.createElement(Text15, { color: "white", bold: true, underline: true }, "Interaction Summary"), /* @__PURE__ */ React15.createElement(Box14, { marginTop: 1 }, /* @__PURE__ */ React15.createElement(Box14, { width: 20 }, /* @__PURE__ */ React15.createElement(Text15, { color: "blue" }, "Session ID:")), /* @__PURE__ */ React15.createElement(Text15, { color: "white" }, chatId)), /* @__PURE__ */ React15.createElement(Box14, null, /* @__PURE__ */ React15.createElement(Box14, { width: 20 }, /* @__PURE__ */ React15.createElement(Text15, { color: "blue" }, "Tool Calls:")), /* @__PURE__ */ React15.createElement(Text15, { color: "white" }, sessionToolSuccess + sessionToolFailure + sessionToolDenied, " ( ", /* @__PURE__ */ React15.createElement(Text15, { color: "green" }, "\u2714 ", sessionToolSuccess), " ", /* @__PURE__ */ React15.createElement(Text15, { color: "yellow" }, "\u{1F6C7} ", sessionToolDenied), " ", /* @__PURE__ */ React15.createElement(Text15, { color: "red" }, "\u2718 ", sessionToolFailure), " )")), /* @__PURE__ */ React15.createElement(Box14, null, /* @__PURE__ */ React15.createElement(Box14, { width: 20 }, /* @__PURE__ */ React15.createElement(Text15, { color: "blue" }, "Success Rate:")), /* @__PURE__ */ React15.createElement(Text15, { color: "white" }, successRate, "%")), /* @__PURE__ */ React15.createElement(Box14, null, /* @__PURE__ */ React15.createElement(Box14, { width: 20 }, /* @__PURE__ */ React15.createElement(Text15, { color: "blue" }, "Code Changes:")), /* @__PURE__ */ React15.createElement(Text15, { color: "white" }, /* @__PURE__ */ React15.createElement(Text15, { color: "green" }, "+", linesAdded), " ", /* @__PURE__ */ React15.createElement(Text15, { color: "red" }, "-", linesRemoved))), /* @__PURE__ */ React15.createElement(Box14, null, /* @__PURE__ */ React15.createElement(Box14, { width: 20 }, /* @__PURE__ */ React15.createElement(Text15, { color: "blue" }, "Tokens Consumed:")), /* @__PURE__ */ React15.createElement(Text15, { color: "white" }, formatTokens(sessionTotalTokens))), sessionTotalTokens > 0 && /* @__PURE__ */ React15.createElement(React15.Fragment, null, /* @__PURE__ */ React15.createElement(Box14, { marginLeft: 2 }, /* @__PURE__ */ React15.createElement(Box14, { width: 18 }, /* @__PURE__ */ React15.createElement(Text15, { color: "grey" }, "\xBB Input Tokens:")), /* @__PURE__ */ React15.createElement(Text15, { color: "white" }, formatTokens(sessionTotalTokens - sessionTotalCandidateTokens))), sessionTotalCachedTokens > 0 && /* @__PURE__ */ React15.createElement(Box14, { marginLeft: 4 }, /* @__PURE__ */ React15.createElement(Box14, { width: 16 }, /* @__PURE__ */ React15.createElement(Text15, { color: "grey" }, "\xBB Cached:")), /* @__PURE__ */ React15.createElement(Text15, { color: "white" }, formatTokens(sessionTotalCachedTokens))), sessionTotalCandidateTokens > 0 && /* @__PURE__ */ React15.createElement(Box14, { marginLeft: 2 }, /* @__PURE__ */ React15.createElement(Box14, { width: 18 }, /* @__PURE__ */ React15.createElement(Text15, { color: "grey" }, "\xBB Output Tokens:")), /* @__PURE__ */ React15.createElement(Text15, { color: "white" }, formatTokens(sessionTotalCandidateTokens)))), sessionImageCount > 0 && /* @__PURE__ */ React15.createElement(React15.Fragment, null, /* @__PURE__ */ React15.createElement(Box14, null, /* @__PURE__ */ React15.createElement(Box14, { width: 20 }, /* @__PURE__ */ React15.createElement(Text15, { color: "blue" }, "Images Made:")), /* @__PURE__ */ React15.createElement(Text15, { color: "white" }, sessionImageCount)), /* @__PURE__ */ React15.createElement(Box14, null, /* @__PURE__ */ React15.createElement(Box14, { width: 20 }, /* @__PURE__ */ React15.createElement(Text15, { color: "blue" }, "Image Credits:")), /* @__PURE__ */ React15.createElement(Text15, { color: "white" }, Number(((sessionImageCredits || 0) * 1e3).toFixed(0)), " credits")))), /* @__PURE__ */ React15.createElement(Box14, { flexDirection: "column", marginTop: 1 }, /* @__PURE__ */ React15.createElement(Text15, { color: "white", bold: true, underline: true }, "Performance"), /* @__PURE__ */ React15.createElement(Box14, { marginTop: 1 }, /* @__PURE__ */ React15.createElement(Box14, { width: 20 }, /* @__PURE__ */ React15.createElement(Text15, { color: "blue" }, "Wall Time:")), /* @__PURE__ */ React15.createElement(Text15, { color: "white" }, formatMsDuration(wallTimeMs))), /* @__PURE__ */ React15.createElement(Box14, null, /* @__PURE__ */ React15.createElement(Box14, { width: 20 }, /* @__PURE__ */ React15.createElement(Text15, { color: "blue" }, "Agent Active:")), /* @__PURE__ */ React15.createElement(Text15, { color: "white" }, formatMsDuration(agentActiveMs))), /* @__PURE__ */ React15.createElement(Box14, { marginLeft: 2 }, /* @__PURE__ */ React15.createElement(Box14, { width: 18 }, /* @__PURE__ */ React15.createElement(Text15, { color: "grey" }, "\xBB API Time:")), /* @__PURE__ */ React15.createElement(Text15, { color: "white" }, formatMsDuration(sessionApiTime), " (", apiPercent, "%)")), /* @__PURE__ */ React15.createElement(Box14, { marginLeft: 2 }, /* @__PURE__ */ React15.createElement(Box14, { width: 18 }, /* @__PURE__ */ React15.createElement(Text15, { color: "grey" }, "\xBB Tool Time:")), /* @__PURE__ */ React15.createElement(Text15, { color: "white" }, formatMsDuration(sessionToolTime), " (", toolPercent, "%)"))));
20336
+ return /* @__PURE__ */ React16.createElement(Box14, { flexDirection: "column", borderStyle: "round", paddingX: 3, paddingY: 1, borderColor: "grey", width: Math.min(100, (stdout?.columns || 100) - 2), marginTop: 0, marginBottom: 0 }, /* @__PURE__ */ React16.createElement(Box14, { marginBottom: 1 }, /* @__PURE__ */ React16.createElement(Text16, { bold: true }, gradient2(["blue", "purple"])("Agent powering down. Goodbye!"))), /* @__PURE__ */ React16.createElement(Box14, { flexDirection: "column" }, /* @__PURE__ */ React16.createElement(Text16, { color: "white", bold: true, underline: true }, "Interaction Summary"), /* @__PURE__ */ React16.createElement(Box14, { marginTop: 1 }, /* @__PURE__ */ React16.createElement(Box14, { width: 20 }, /* @__PURE__ */ React16.createElement(Text16, { color: "blue" }, "Session ID:")), /* @__PURE__ */ React16.createElement(Text16, { color: "white" }, chatId)), /* @__PURE__ */ React16.createElement(Box14, null, /* @__PURE__ */ React16.createElement(Box14, { width: 20 }, /* @__PURE__ */ React16.createElement(Text16, { color: "blue" }, "Tool Calls:")), /* @__PURE__ */ React16.createElement(Text16, { color: "white" }, runtimeSession.toolSuccess + runtimeSession.toolFailure + runtimeSession.toolDenied, " ( ", /* @__PURE__ */ React16.createElement(Text16, { color: "green" }, "\u2714 ", runtimeSession.toolSuccess), " ", /* @__PURE__ */ React16.createElement(Text16, { color: "yellow" }, "\u{1F6C7} ", runtimeSession.toolDenied), " ", /* @__PURE__ */ React16.createElement(Text16, { color: "red" }, "\u2718 ", runtimeSession.toolFailure), " )")), /* @__PURE__ */ React16.createElement(Box14, null, /* @__PURE__ */ React16.createElement(Box14, { width: 20 }, /* @__PURE__ */ React16.createElement(Text16, { color: "blue" }, "Success Rate:")), /* @__PURE__ */ React16.createElement(Text16, { color: "white" }, successRate, "%")), /* @__PURE__ */ React16.createElement(Box14, null, /* @__PURE__ */ React16.createElement(Box14, { width: 20 }, /* @__PURE__ */ React16.createElement(Text16, { color: "blue" }, "Code Changes:")), /* @__PURE__ */ React16.createElement(Text16, { color: "white" }, /* @__PURE__ */ React16.createElement(Text16, { color: "green" }, "+", runtimeSession.linesAdded), " ", /* @__PURE__ */ React16.createElement(Text16, { color: "red" }, "-", runtimeSession.linesRemoved))), /* @__PURE__ */ React16.createElement(Box14, null, /* @__PURE__ */ React16.createElement(Box14, { width: 20 }, /* @__PURE__ */ React16.createElement(Text16, { color: "blue" }, "Tokens Consumed:")), /* @__PURE__ */ React16.createElement(Text16, { color: "white" }, formatTokens(sessionTotalTokens))), sessionTotalTokens > 0 && /* @__PURE__ */ React16.createElement(React16.Fragment, null, /* @__PURE__ */ React16.createElement(Box14, { marginLeft: 2 }, /* @__PURE__ */ React16.createElement(Box14, { width: 18 }, /* @__PURE__ */ React16.createElement(Text16, { color: "grey" }, "\xBB Input Tokens:")), /* @__PURE__ */ React16.createElement(Text16, { color: "white" }, formatTokens(sessionTotalTokens - sessionTotalCandidateTokens))), sessionTotalCachedTokens > 0 && /* @__PURE__ */ React16.createElement(Box14, { marginLeft: 4 }, /* @__PURE__ */ React16.createElement(Box14, { width: 16 }, /* @__PURE__ */ React16.createElement(Text16, { color: "grey" }, "\xBB Cached:")), /* @__PURE__ */ React16.createElement(Text16, { color: "white" }, formatTokens(sessionTotalCachedTokens))), sessionTotalCandidateTokens > 0 && /* @__PURE__ */ React16.createElement(Box14, { marginLeft: 2 }, /* @__PURE__ */ React16.createElement(Box14, { width: 18 }, /* @__PURE__ */ React16.createElement(Text16, { color: "grey" }, "\xBB Output Tokens:")), /* @__PURE__ */ React16.createElement(Text16, { color: "white" }, formatTokens(sessionTotalCandidateTokens)))), sessionImageCount > 0 && /* @__PURE__ */ React16.createElement(React16.Fragment, null, /* @__PURE__ */ React16.createElement(Box14, null, /* @__PURE__ */ React16.createElement(Box14, { width: 20 }, /* @__PURE__ */ React16.createElement(Text16, { color: "blue" }, "Images Made:")), /* @__PURE__ */ React16.createElement(Text16, { color: "white" }, sessionImageCount)), /* @__PURE__ */ React16.createElement(Box14, null, /* @__PURE__ */ React16.createElement(Box14, { width: 20 }, /* @__PURE__ */ React16.createElement(Text16, { color: "blue" }, "Image Credits:")), /* @__PURE__ */ React16.createElement(Text16, { color: "white" }, Number(((sessionImageCredits || 0) * 1e3).toFixed(0)), " credits")))), /* @__PURE__ */ React16.createElement(Box14, { flexDirection: "column", marginTop: 1 }, /* @__PURE__ */ React16.createElement(Text16, { color: "white", bold: true, underline: true }, "Performance"), /* @__PURE__ */ React16.createElement(Box14, { marginTop: 1 }, /* @__PURE__ */ React16.createElement(Box14, { width: 20 }, /* @__PURE__ */ React16.createElement(Text16, { color: "blue" }, "Wall Time:")), /* @__PURE__ */ React16.createElement(Text16, { color: "white" }, formatMsDuration(wallTimeMs))), /* @__PURE__ */ React16.createElement(Box14, null, /* @__PURE__ */ React16.createElement(Box14, { width: 20 }, /* @__PURE__ */ React16.createElement(Text16, { color: "blue" }, "Agent Active:")), /* @__PURE__ */ React16.createElement(Text16, { color: "white" }, formatMsDuration(agentActiveMs))), /* @__PURE__ */ React16.createElement(Box14, { marginLeft: 2 }, /* @__PURE__ */ React16.createElement(Box14, { width: 18 }, /* @__PURE__ */ React16.createElement(Text16, { color: "grey" }, "\xBB API Time:")), /* @__PURE__ */ React16.createElement(Text16, { color: "white" }, formatMsDuration(sessionApiTime), " (", apiPercent, "%)")), /* @__PURE__ */ React16.createElement(Box14, { marginLeft: 2 }, /* @__PURE__ */ React16.createElement(Box14, { width: 18 }, /* @__PURE__ */ React16.createElement(Text16, { color: "grey" }, "\xBB Tool Time:")), /* @__PURE__ */ React16.createElement(Text16, { color: "white" }, formatMsDuration(sessionToolTime), " (", toolPercent, "%)"))));
20138
20337
  })())));
20139
20338
  }
20140
- var shouldClearValue, getPrefilledValue, getIDEName, getIDEDirName, getKeybindingsPath, parseJsonc, hasShiftEnterBinding, getPromoOptions, BridgePromo, SESSION_START_TIME, CHANGELOG_URL, DOCS_URL, linesAdded, linesRemoved, packageJsonPath, packageJson, versionFluxflow, updatedOn, ResolutionModal, parseAgentText, getProjectFiles, cachedShortcut, getLatencyColor2, SubagentRow;
20339
+ var shouldClearValue, getPrefilledValue, getIDEName, getIDEDirName, getKeybindingsPath, parseJsonc, hasShiftEnterBinding, getPromoOptions, BridgePromo, SESSION_START_TIME, CHANGELOG_URL, DOCS_URL, packageJsonPath, packageJson, versionFluxflow, updatedOn, ResolutionModal, parseAgentText, getProjectFiles, cachedShortcut, getLatencyColor2, SubagentRow;
20141
20340
  var init_app = __esm({
20142
20341
  async "src/app.jsx"() {
20143
20342
  init_build();
@@ -20170,6 +20369,7 @@ var init_app = __esm({
20170
20369
  init_setup();
20171
20370
  init_text();
20172
20371
  init_editor();
20372
+ init_GlintText();
20173
20373
  shouldClearValue = (val) => {
20174
20374
  const s = String(val);
20175
20375
  return s.startsWith("999") && s.endsWith("9");
@@ -20252,7 +20452,7 @@ var init_app = __esm({
20252
20452
  BridgePromo = ({ width, height, selectedIndex, aiProvider }) => {
20253
20453
  const ideName = getIDEName();
20254
20454
  const options = getPromoOptions(ideName);
20255
- return /* @__PURE__ */ React15.createElement(
20455
+ return /* @__PURE__ */ React16.createElement(
20256
20456
  Box14,
20257
20457
  {
20258
20458
  flexDirection: "column",
@@ -20261,20 +20461,18 @@ var init_app = __esm({
20261
20461
  width,
20262
20462
  height
20263
20463
  },
20264
- /* @__PURE__ */ React15.createElement(Box14, { marginBottom: 1, width: Math.min(80, width - 4), justifyContent: "flex-start" }, /* @__PURE__ */ React15.createElement(Text15, null, getFluxLogo(versionFluxflow, aiProvider))),
20265
- /* @__PURE__ */ React15.createElement(Box14, { flexDirection: "column", borderStyle: "double", borderColor: "grey", paddingX: 3, paddingY: 1, width: Math.min(80, width - 4) }, /* @__PURE__ */ React15.createElement(Text15, { bold: true, color: "white", textAlign: "center" }, "\u{1F680} UPGRADE YOUR WORKFLOW"), /* @__PURE__ */ React15.createElement(Box14, { marginY: 1, flexDirection: "column", alignItems: "left" }, /* @__PURE__ */ React15.createElement(Text15, null, "You're in ", /* @__PURE__ */ React15.createElement(Text15, { bold: true, color: "cyan" }, ideName), ", but the ", /* @__PURE__ */ React15.createElement(Text15, { bold: true, color: "white" }, "FluxFlow-CLI Companion"), " is not installed."), /* @__PURE__ */ React15.createElement(Box14, { flexDirection: "column", marginY: 1 }, /* @__PURE__ */ React15.createElement(Text15, { color: "gray" }, " \u2705 Real-time IDE context & Error Resolution"), /* @__PURE__ */ React15.createElement(Text15, { color: "gray" }, " \u2705 Auto-open files created by agent"), /* @__PURE__ */ React15.createElement(Text15, { color: "gray" }, " \u2705 Native DIFFing for AI edits"), /* @__PURE__ */ React15.createElement(Text15, { color: "gray" }, " \u2705 Direct IDE context sharing"), /* @__PURE__ */ React15.createElement(Text15, { color: "gray" }, " \u2705 Surgical Diagnostic Sync"), /* @__PURE__ */ React15.createElement(Text15, { color: "gray" }, " \u2705 Native Right-Click \u276F Chat integration"), /* @__PURE__ */ React15.createElement(Text15, { color: "gray" }, " \u2705 Live Status in IDE"), /* @__PURE__ */ React15.createElement(Text15, { color: "gray" }, " \u2705 Clickable terminal-to-code links"))), /* @__PURE__ */ React15.createElement(Box14, { flexDirection: "column", marginTop: 1 }, options.map((opt, i) => /* @__PURE__ */ React15.createElement(Box14, { key: i }, /* @__PURE__ */ React15.createElement(Text15, { color: selectedIndex === i ? "yellow" : "white", bold: selectedIndex === i }, selectedIndex === i ? " \u276F " : " ", opt.label)))), /* @__PURE__ */ React15.createElement(Box14, { marginTop: 1, alignItems: "center", justifyContent: "center" }, /* @__PURE__ */ React15.createElement(Text15, { dimColor: true, italic: true }, "(Use arrows to navigate, Enter to select)")))
20464
+ /* @__PURE__ */ React16.createElement(Box14, { marginBottom: 1, width: Math.min(80, width - 4), justifyContent: "flex-start" }, /* @__PURE__ */ React16.createElement(Text16, null, getFluxLogo(versionFluxflow, aiProvider))),
20465
+ /* @__PURE__ */ React16.createElement(Box14, { flexDirection: "column", borderStyle: "double", borderColor: "grey", paddingX: 3, paddingY: 1, width: Math.min(80, width - 4) }, /* @__PURE__ */ React16.createElement(Text16, { bold: true, color: "white", textAlign: "center" }, "\u{1F680} UPGRADE YOUR WORKFLOW"), /* @__PURE__ */ React16.createElement(Box14, { marginY: 1, flexDirection: "column", alignItems: "left" }, /* @__PURE__ */ React16.createElement(Text16, null, "You're in ", /* @__PURE__ */ React16.createElement(Text16, { bold: true, color: "cyan" }, ideName), ", but the ", /* @__PURE__ */ React16.createElement(Text16, { bold: true, color: "white" }, "FluxFlow-CLI Companion"), " is not installed."), /* @__PURE__ */ React16.createElement(Box14, { flexDirection: "column", marginY: 1 }, /* @__PURE__ */ React16.createElement(Text16, { color: "gray" }, " \u2705 Real-time IDE context & Error Resolution"), /* @__PURE__ */ React16.createElement(Text16, { color: "gray" }, " \u2705 Auto-open files created by agent"), /* @__PURE__ */ React16.createElement(Text16, { color: "gray" }, " \u2705 Native DIFFing for AI edits"), /* @__PURE__ */ React16.createElement(Text16, { color: "gray" }, " \u2705 Direct IDE context sharing"), /* @__PURE__ */ React16.createElement(Text16, { color: "gray" }, " \u2705 Surgical Diagnostic Sync"), /* @__PURE__ */ React16.createElement(Text16, { color: "gray" }, " \u2705 Native Right-Click \u276F Chat integration"), /* @__PURE__ */ React16.createElement(Text16, { color: "gray" }, " \u2705 Live Status in IDE"), /* @__PURE__ */ React16.createElement(Text16, { color: "gray" }, " \u2705 Clickable terminal-to-code links"))), /* @__PURE__ */ React16.createElement(Box14, { flexDirection: "column", marginTop: 1 }, options.map((opt, i) => /* @__PURE__ */ React16.createElement(Box14, { key: i }, /* @__PURE__ */ React16.createElement(Text16, { color: selectedIndex === i ? "yellow" : "white", bold: selectedIndex === i }, selectedIndex === i ? " \u276F " : " ", opt.label)))), /* @__PURE__ */ React16.createElement(Box14, { marginTop: 1, alignItems: "center", justifyContent: "center" }, /* @__PURE__ */ React16.createElement(Text16, { dimColor: true, italic: true }, "(Use arrows to navigate, Enter to select)")))
20266
20466
  );
20267
20467
  };
20268
20468
  SESSION_START_TIME = Date.now();
20269
20469
  CHANGELOG_URL = "https://fluxflow-cli.onrender.com/changelog";
20270
20470
  DOCS_URL = "https://fluxflow-cli.onrender.com/";
20271
- linesAdded = 0;
20272
- linesRemoved = 0;
20273
20471
  packageJsonPath = path22.join(path22.dirname(fileURLToPath2(import.meta.url)), "../package.json");
20274
20472
  packageJson = JSON.parse(fs24.readFileSync(packageJsonPath, "utf8"));
20275
20473
  versionFluxflow = packageJson.version;
20276
20474
  updatedOn = packageJson.date || "2026-05-20";
20277
- ResolutionModal = ({ data, onResolve, onEdit }) => /* @__PURE__ */ React15.createElement(Box14, { flexDirection: "column", borderStyle: "round", borderColor: "grey", padding: 0, width: "100%" }, /* @__PURE__ */ React15.createElement(Box14, { paddingX: 1 }, /* @__PURE__ */ React15.createElement(Text15, { color: "white", bold: true, underline: true }, data.startsWith("/btw") ? "QUESTION" : "STEERING HINT", " RESOLUTION")), /* @__PURE__ */ React15.createElement(Box14, { paddingX: 1, marginTop: 1 }, /* @__PURE__ */ React15.createElement(Text15, null, "The agent already finished the task before your ", data.startsWith("/btw") ? "question" : "hint", " was consumed.")), /* @__PURE__ */ React15.createElement(Box14, { marginTop: 1, backgroundColor: "#222", paddingX: 2, width: "100%" }, /* @__PURE__ */ React15.createElement(Text15, { italic: true, color: "gray" }, '"', data.replace("/btw", "").trim(), '"')), /* @__PURE__ */ React15.createElement(Box14, { paddingX: 1, marginTop: 1 }, /* @__PURE__ */ React15.createElement(Text15, { color: "grey" }, "How would you like to proceed?")), /* @__PURE__ */ React15.createElement(Box14, { marginTop: 0 }, /* @__PURE__ */ React15.createElement(
20475
+ ResolutionModal = ({ data, onResolve, onEdit }) => /* @__PURE__ */ React16.createElement(Box14, { flexDirection: "column", borderStyle: "round", borderColor: "grey", padding: 0, width: "100%" }, /* @__PURE__ */ React16.createElement(Box14, { paddingX: 1 }, /* @__PURE__ */ React16.createElement(Text16, { color: "white", bold: true, underline: true }, data.startsWith("/btw") ? "QUESTION" : "STEERING HINT", " RESOLUTION")), /* @__PURE__ */ React16.createElement(Box14, { paddingX: 1, marginTop: 1 }, /* @__PURE__ */ React16.createElement(Text16, null, "The agent already finished the task before your ", data.startsWith("/btw") ? "question" : "hint", " was consumed.")), /* @__PURE__ */ React16.createElement(Box14, { marginTop: 1, backgroundColor: "#222", paddingX: 2, width: "100%" }, /* @__PURE__ */ React16.createElement(Text16, { italic: true, color: "gray" }, '"', data.replace("/btw", "").trim(), '"')), /* @__PURE__ */ React16.createElement(Box14, { paddingX: 1, marginTop: 1 }, /* @__PURE__ */ React16.createElement(Text16, { color: "grey" }, "How would you like to proceed?")), /* @__PURE__ */ React16.createElement(Box14, { marginTop: 0 }, /* @__PURE__ */ React16.createElement(
20278
20476
  CommandMenu,
20279
20477
  {
20280
20478
  title: "Select Action",
@@ -20394,10 +20592,10 @@ var init_app = __esm({
20394
20592
  })();
20395
20593
  cachedShortcut = "Ctrl + Enter";
20396
20594
  getLatencyColor2 = (delay) => {
20397
- if (delay <= 400) return "#00a564";
20595
+ if (delay <= 500) return "#00a564";
20398
20596
  if (delay >= 5e3) return "#ff0000";
20399
20597
  const points = [
20400
- { t: 400, r: 0, g: 165, b: 100 },
20598
+ { t: 500, r: 0, g: 165, b: 100 },
20401
20599
  { t: 800, r: 120, g: 220, b: 80 },
20402
20600
  { t: 1500, r: 250, g: 210, b: 40 },
20403
20601
  { t: 3e3, r: 255, g: 120, b: 0 },
@@ -20416,10 +20614,10 @@ var init_app = __esm({
20416
20614
  }
20417
20615
  return "#ff0000";
20418
20616
  };
20419
- SubagentRow = React15.memo(({ sa }) => {
20420
- const [dotColor, setDotColor] = useState14("green");
20617
+ SubagentRow = React16.memo(({ sa }) => {
20618
+ const [dotColor, setDotColor] = useState15("green");
20421
20619
  const chunkTimesRef = useRef4([]);
20422
- useEffect11(() => {
20620
+ useEffect12(() => {
20423
20621
  if (sa.status !== "running") {
20424
20622
  chunkTimesRef.current = [];
20425
20623
  return;
@@ -20456,7 +20654,7 @@ var init_app = __esm({
20456
20654
  const timer = setInterval(checkLatency, 100);
20457
20655
  return () => clearInterval(timer);
20458
20656
  }, [sa.status, sa.lastChunkTime]);
20459
- return /* @__PURE__ */ React15.createElement(Box14, { justifyContent: "space-between", width: "100%" }, /* @__PURE__ */ React15.createElement(Text15, { color: "white" }, " \u2022 ", sa.title, " ", /* @__PURE__ */ React15.createElement(Text15, { color: "white", dimColor: true }, "(", sa.id, ")")), /* @__PURE__ */ React15.createElement(Text15, { color: "white" }, /* @__PURE__ */ React15.createElement(Text15, { color: "white", dimColor: true, bold: true }, sa.currentTool || "Active"), /* @__PURE__ */ React15.createElement(Text15, { color: dotColor }, " \u25CF")));
20657
+ return /* @__PURE__ */ React16.createElement(Box14, { justifyContent: "space-between", width: "100%" }, /* @__PURE__ */ React16.createElement(Text16, { color: "white" }, " \u2022 ", sa.title, " ", /* @__PURE__ */ React16.createElement(Text16, { color: "white", dimColor: true }, "(", sa.id, ")")), /* @__PURE__ */ React16.createElement(Text16, { color: "white" }, /* @__PURE__ */ React16.createElement(Text16, { color: "white", dimColor: true, bold: true }, sa.currentTool || "Active"), /* @__PURE__ */ React16.createElement(Text16, { color: dotColor }, " \u25CF")));
20460
20658
  });
20461
20659
  }
20462
20660
  });
@@ -20610,9 +20808,9 @@ if (isBundled && !process.execArgv.some((arg) => arg.includes("max-old-space-siz
20610
20808
  process.exit(0);
20611
20809
  }
20612
20810
  const promptPackageManager = async () => {
20613
- const React17 = (await import("react")).default;
20614
- const { useState: useState15 } = React17;
20615
- const { render: render2, Box: Box15, Text: Text16 } = await import("ink");
20811
+ const React18 = (await import("react")).default;
20812
+ const { useState: useState16 } = React18;
20813
+ const { render: render2, Box: Box15, Text: Text17 } = await import("ink");
20616
20814
  const SelectInput3 = (await import("ink-select-input")).default;
20617
20815
  const TextInput5 = (await import("ink-text-input")).default;
20618
20816
  return new Promise((resolve) => {
@@ -20624,12 +20822,12 @@ if (isBundled && !process.execArgv.some((arg) => arg.includes("max-old-space-siz
20624
20822
  { label: "Custom Command", value: "custom" }
20625
20823
  ];
20626
20824
  const CustomItem2 = ({ label, isSelected }) => {
20627
- return /* @__PURE__ */ React17.createElement(Box15, { width: "100%" }, /* @__PURE__ */ React17.createElement(Text16, { bold: isSelected }, "\u2514\u2500 ", isSelected ? "\x1B[32m\u25CF\x1B[0m" : "\u25CB", " ", label));
20825
+ return /* @__PURE__ */ React18.createElement(Box15, { width: "100%" }, /* @__PURE__ */ React18.createElement(Text17, { bold: isSelected }, "\u2514\u2500 ", isSelected ? "\x1B[32m\u25CF\x1B[0m" : "\u25CB", " ", label));
20628
20826
  };
20629
20827
  let unmountFn;
20630
20828
  const PromptComponent = () => {
20631
- const [step, setStep] = useState15("select");
20632
- const [customCommand2, setCustomCommand] = useState15("");
20829
+ const [step, setStep] = useState16("select");
20830
+ const [customCommand2, setCustomCommand] = useState16("");
20633
20831
  const handleSelect = (item) => {
20634
20832
  if (item.value === "custom") {
20635
20833
  setStep("custom");
@@ -20641,16 +20839,16 @@ if (isBundled && !process.execArgv.some((arg) => arg.includes("max-old-space-siz
20641
20839
  cleanupAndResolve({ manager: "custom", customCommand: value });
20642
20840
  };
20643
20841
  if (step === "custom") {
20644
- return /* @__PURE__ */ React17.createElement(Box15, { flexDirection: "column", marginY: 1 }, /* @__PURE__ */ React17.createElement(Box15, { marginBottom: 1 }, /* @__PURE__ */ React17.createElement(Text16, { color: "magenta", bold: true }, "\u{1F527} Enter custom update command:")), /* @__PURE__ */ React17.createElement(Box15, { flexDirection: "row" }, /* @__PURE__ */ React17.createElement(Text16, { color: "cyan", bold: true }, " \u276F "), /* @__PURE__ */ React17.createElement(
20842
+ return /* @__PURE__ */ React18.createElement(Box15, { flexDirection: "column", marginY: 1 }, /* @__PURE__ */ React18.createElement(Box15, { marginBottom: 1 }, /* @__PURE__ */ React18.createElement(Text17, { color: "magenta", bold: true }, "\u{1F527} Enter custom update command:")), /* @__PURE__ */ React18.createElement(Box15, { flexDirection: "row" }, /* @__PURE__ */ React18.createElement(Text17, { color: "cyan", bold: true }, " \u276F "), /* @__PURE__ */ React18.createElement(
20645
20843
  TextInput5,
20646
20844
  {
20647
20845
  value: customCommand2,
20648
20846
  onChange: setCustomCommand,
20649
20847
  onSubmit: handleCustomSubmit
20650
20848
  }
20651
- )), /* @__PURE__ */ React17.createElement(Box15, { marginTop: 1 }, /* @__PURE__ */ React17.createElement(Text16, { color: "gray", dimColor: true, italic: true }, " (Press Enter to confirm)")));
20849
+ )), /* @__PURE__ */ React18.createElement(Box15, { marginTop: 1 }, /* @__PURE__ */ React18.createElement(Text17, { color: "gray", dimColor: true, italic: true }, " (Press Enter to confirm)")));
20652
20850
  }
20653
- return /* @__PURE__ */ React17.createElement(Box15, { flexDirection: "column", marginY: 1 }, /* @__PURE__ */ React17.createElement(Box15, { marginBottom: 1 }, /* @__PURE__ */ React17.createElement(Text16, { color: "magenta", bold: true }, "\u{1F4E6} Select a package manager for the update:")), /* @__PURE__ */ React17.createElement(
20851
+ return /* @__PURE__ */ React18.createElement(Box15, { flexDirection: "column", marginY: 1 }, /* @__PURE__ */ React18.createElement(Box15, { marginBottom: 1 }, /* @__PURE__ */ React18.createElement(Text17, { color: "magenta", bold: true }, "\u{1F4E6} Select a package manager for the update:")), /* @__PURE__ */ React18.createElement(
20654
20852
  SelectInput3,
20655
20853
  {
20656
20854
  items,
@@ -20664,7 +20862,7 @@ if (isBundled && !process.execArgv.some((arg) => arg.includes("max-old-space-siz
20664
20862
  if (unmountFn) unmountFn();
20665
20863
  resolve(val);
20666
20864
  };
20667
- const { unmount } = render2(/* @__PURE__ */ React17.createElement(PromptComponent, null));
20865
+ const { unmount } = render2(/* @__PURE__ */ React18.createElement(PromptComponent, null));
20668
20866
  unmountFn = unmount;
20669
20867
  });
20670
20868
  };
@@ -20704,7 +20902,7 @@ if (isBundled && !process.execArgv.some((arg) => arg.includes("max-old-space-siz
20704
20902
  }
20705
20903
  }
20706
20904
  }
20707
- const { default: React16 } = await import("react");
20905
+ const { default: React17 } = await import("react");
20708
20906
  const { render } = await import("ink");
20709
20907
  const { default: App2 } = await init_app().then(() => app_exports);
20710
20908
  process.env.NODE_NO_WARNINGS = "1";
@@ -20757,5 +20955,5 @@ if (isBundled && !process.execArgv.some((arg) => arg.includes("max-old-space-siz
20757
20955
  } catch (e) {
20758
20956
  }
20759
20957
  }
20760
- render(/* @__PURE__ */ React16.createElement(App2, { args: process.argv.slice(2) }), { exitOnCtrlC: false });
20958
+ render(/* @__PURE__ */ React17.createElement(App2, { args: process.argv.slice(2) }), { exitOnCtrlC: false });
20761
20959
  }