fluxflow-cli 1.18.25 → 1.19.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/fluxflow.js +246 -82
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|

|
|
3
3
|
|
|
4
4
|
<p align="left">
|
|
5
|
-
<a href="https://github.com/KushalRoyChowdhury/fluxflow-cli"><img src="https://img.shields.io/badge/FluxFlow-v1.
|
|
5
|
+
<a href="https://github.com/KushalRoyChowdhury/fluxflow-cli"><img src="https://img.shields.io/badge/FluxFlow-v1.19.0-blue?style=plastic" alt="FluxFlow Version"></a>
|
|
6
6
|
<a href="https://deepmind.google"><img src="https://img.shields.io/badge/Engine-Gemma%204-red?style=plastic" alt="Engine Gemma 4"></a>
|
|
7
7
|
<a href="https://pollinations.ai"><img src="https://img.shields.io/badge/Built%20With-pollinations.ai-cyan?style=plastic" alt="Built With pollinations.ai"></a>
|
|
8
8
|
<a href="https://opensource.org/licenses/MIT"><img src="https://img.shields.io/badge/License-MIT-yellow.svg?style=plastic" alt="License MIT"></a>
|
package/dist/fluxflow.js
CHANGED
|
@@ -487,7 +487,7 @@ var init_terminal = __esm({
|
|
|
487
487
|
// src/components/ChatLayout.jsx
|
|
488
488
|
import React3, { useState as useState2, useEffect as useEffect2, useRef as useRef2 } from "react";
|
|
489
489
|
import { Box as Box3, Text as Text3 } from "ink";
|
|
490
|
-
var TOOL_LABELS, cleanSignals, formatThinkText, parseMathSymbols, InlineMarkdown, TableRenderer, MarkdownText, DiffLine, DiffBlock, CodeRenderer, formatThinkingDuration, MessageItem, ChatLayout, ChatLayout_default;
|
|
490
|
+
var TOOL_LABELS, cleanSignals, formatThinkText, parseMathSymbols, renderLatexText, InlineMarkdown, TableRenderer, MarkdownText, DiffLine, DiffBlock, CodeRenderer, formatThinkingDuration, MessageItem, ChatLayout, ChatLayout_default;
|
|
491
491
|
var init_ChatLayout = __esm({
|
|
492
492
|
"src/components/ChatLayout.jsx"() {
|
|
493
493
|
init_TerminalBox();
|
|
@@ -580,10 +580,31 @@ var init_ChatLayout = __esm({
|
|
|
580
580
|
if (!cleaned) return null;
|
|
581
581
|
const availableWidth = columns - 10;
|
|
582
582
|
const wrapped = wrapText(cleaned.trim(), availableWidth);
|
|
583
|
-
return /* @__PURE__ */ React3.createElement(Box3, { width: "100%" }, /* @__PURE__ */ React3.createElement(Text3, { italic: true, color: "gray" }
|
|
583
|
+
return /* @__PURE__ */ React3.createElement(Box3, { width: "100%" }, /* @__PURE__ */ React3.createElement(Text3, { italic: true }, /* @__PURE__ */ React3.createElement(InlineMarkdown, { text: wrapped, color: "gray" })));
|
|
584
584
|
};
|
|
585
585
|
parseMathSymbols = (content) => {
|
|
586
|
-
return content.replace(/\\multiply|\\mul|\\times/g, "\xD7").replace(/\\div/g, "\xF7").replace(/\\cdot/g, "\u22C5").replace(/\\infty/g, "\u221E").replace(/\\pm/g, "\xB1").replace(/\\leq/g, "\u2264").replace(/\\geq/g, "\u2265").replace(/\\neq/g, "\u2260").replace(/\\sqrt\{
|
|
586
|
+
return content.replace(/\\multiply|\\mul|\\times/g, "\xD7").replace(/\\div/g, "\xF7").replace(/\\cdot/g, "\u22C5").replace(/\\infty/g, "\u221E").replace(/\\pm/g, "\xB1").replace(/\\leq/g, "\u2264").replace(/\\geq/g, "\u2265").replace(/\\neq/g, "\u2260").replace(/\\sqrt\s*\{([^}]+)\}/g, "\u221A($1)").replace(/\\sqrt\s*(\w+|\d+)/g, "\u221A($1)").replace(/\\alpha/g, "\u03B1").replace(/\\beta/g, "\u03B2").replace(/\\theta/g, "\u03B8").replace(/\\pi/g, "\u03C0").replace(/\\approx/g, "\u2248").replace(/\\Delta/g, "\u0394").replace(/\\sigma/g, "\u03C3").replace(/\\sum/g, "\u03A3").replace(/\\prod/g, "\u03A0").replace(/\\rightarrow|\\to/g, "\u2192").replace(/\\left\b|\\right\b/g, "").replace(/\\left\(|\\right\)/g, (match) => match.includes("left") ? "(" : ")").replace(/\\left\[|\\right\]/g, (match) => match.includes("left") ? "[" : "]").replace(/\\\{|\\\}/g, (match) => match.includes("{") ? "{" : "}").replace(/\\text\s*\{([^}]+)\}/g, "$1").replace(/\\text\s+(\w+)/g, "$1").replace(/\\%/g, "%");
|
|
587
|
+
};
|
|
588
|
+
renderLatexText = (content, key) => {
|
|
589
|
+
if (!content) return null;
|
|
590
|
+
let formatted = content.replace(/\\frac\s*\{([^{}]*)\}\s*\{([^{}]*)\}/g, "($1/$2)");
|
|
591
|
+
formatted = parseMathSymbols(formatted);
|
|
592
|
+
const parts = formatted.split(/(\\(?:mathbf|textbf|textit|underline|texttt)\{[^{}]*\})/g);
|
|
593
|
+
return /* @__PURE__ */ React3.createElement(React3.Fragment, { key }, parts.map((p, idx) => {
|
|
594
|
+
if (p.startsWith("\\")) {
|
|
595
|
+
const match = p.match(/\\(\w+)\{([^{}]*)\}/);
|
|
596
|
+
if (match) {
|
|
597
|
+
const cmd = match[1];
|
|
598
|
+
const inner = match[2];
|
|
599
|
+
const isBold = cmd === "mathbf" || cmd === "textbf";
|
|
600
|
+
const isItalic = cmd === "textit";
|
|
601
|
+
const isUnderline = cmd === "underline";
|
|
602
|
+
const isMono = cmd === "texttt";
|
|
603
|
+
return /* @__PURE__ */ React3.createElement(Text3, { key: idx, bold: isBold, italic: isItalic, underline: isUnderline, color: isMono ? "cyan" : void 0 }, inner);
|
|
604
|
+
}
|
|
605
|
+
}
|
|
606
|
+
return p;
|
|
607
|
+
}));
|
|
587
608
|
};
|
|
588
609
|
InlineMarkdown = React3.memo(({ text, color }) => {
|
|
589
610
|
if (!text) return null;
|
|
@@ -615,22 +636,7 @@ var init_ChatLayout = __esm({
|
|
|
615
636
|
}
|
|
616
637
|
if (part.startsWith("$") && part.endsWith("$")) {
|
|
617
638
|
const content = part.slice(1, -1);
|
|
618
|
-
|
|
619
|
-
return /* @__PURE__ */ React3.createElement(Text3, { key: j, color: "yellow" }, latexParts.map((lp, lpi) => {
|
|
620
|
-
if (lp.startsWith("\\")) {
|
|
621
|
-
const match = lp.match(/\\(\w+)\{(.*?)\}/);
|
|
622
|
-
if (match) {
|
|
623
|
-
const cmd = match[1];
|
|
624
|
-
const inner = match[2];
|
|
625
|
-
const isBold = cmd === "mathbf" || cmd === "textbf";
|
|
626
|
-
const isItalic = cmd === "textit";
|
|
627
|
-
const isUnderline = cmd === "underline";
|
|
628
|
-
const isMono = cmd === "texttt";
|
|
629
|
-
return /* @__PURE__ */ React3.createElement(Text3, { key: lpi, bold: isBold, italic: isItalic, underline: isUnderline, color: isMono ? "cyan" : void 0 }, parseMathSymbols(inner));
|
|
630
|
-
}
|
|
631
|
-
}
|
|
632
|
-
return /* @__PURE__ */ React3.createElement(Text3, { key: lpi }, parseMathSymbols(lp));
|
|
633
|
-
}));
|
|
639
|
+
return /* @__PURE__ */ React3.createElement(Text3, { key: j, color: "yellow" }, renderLatexText(content, j));
|
|
634
640
|
}
|
|
635
641
|
if (part.startsWith("[") && (part.includes("](") || part.includes("] ("))) {
|
|
636
642
|
const match = part.match(/\[(.*?)\]\s*\((.*?)\)/);
|
|
@@ -643,7 +649,7 @@ var init_ChatLayout = __esm({
|
|
|
643
649
|
if (part.startsWith("http")) {
|
|
644
650
|
return /* @__PURE__ */ React3.createElement(Text3, { key: j, color: "cyan", underline: true, italic: true }, part);
|
|
645
651
|
}
|
|
646
|
-
return part;
|
|
652
|
+
return renderLatexText(part, j);
|
|
647
653
|
}));
|
|
648
654
|
});
|
|
649
655
|
TableRenderer = React3.memo(({ buffer, terminalWidth = 80 }) => {
|
|
@@ -934,7 +940,7 @@ var StatusBar, StatusBar_default;
|
|
|
934
940
|
var init_StatusBar = __esm({
|
|
935
941
|
"src/components/StatusBar.jsx"() {
|
|
936
942
|
init_text();
|
|
937
|
-
StatusBar = React4.memo(({ mode, thinkingLevel, tokens = "0.0k", tokensTotal = "0.0k", chatId = "NEW-SESSION", isMemoryEnabled = true }) => {
|
|
943
|
+
StatusBar = React4.memo(({ mode, thinkingLevel, tokens = "0.0k", tokensTotal = "0.0k", chatId = "NEW-SESSION", isMemoryEnabled = true, apiTier = "Free" }) => {
|
|
938
944
|
const modeColor = mode === "Flux" ? "yellow" : "cyan";
|
|
939
945
|
const modeIcon = mode === "Flux" ? "\u26A1" : "\u{1F30A}";
|
|
940
946
|
return /* @__PURE__ */ React4.createElement(
|
|
@@ -949,7 +955,7 @@ var init_StatusBar = __esm({
|
|
|
949
955
|
},
|
|
950
956
|
/* @__PURE__ */ React4.createElement(Box4, null, /* @__PURE__ */ React4.createElement(Box4, { marginRight: 1 }, /* @__PURE__ */ React4.createElement(Text4, { color: modeColor, bold: true }, modeIcon, " ", mode.toUpperCase())), /* @__PURE__ */ React4.createElement(Text4, { color: "gray", dimColor: true }, "\u2503 "), /* @__PURE__ */ React4.createElement(Box4, { marginX: 1 }, /* @__PURE__ */ React4.createElement(Text4, { color: "magenta" }, "\u{1F9E0} ", thinkingLevel)), /* @__PURE__ */ React4.createElement(Text4, { color: "gray", dimColor: true }, "\u2503 "), /* @__PURE__ */ React4.createElement(Box4, { marginX: 1 }, /* @__PURE__ */ React4.createElement(Text4, { color: "gray" }, "MEM: "), /* @__PURE__ */ React4.createElement(Text4, { color: isMemoryEnabled ? "green" : "red", bold: true }, isMemoryEnabled ? "ON" : "OFF"))),
|
|
951
957
|
/* @__PURE__ */ React4.createElement(Box4, { flexGrow: 1, justifyContent: "center", paddingX: 2 }, /* @__PURE__ */ React4.createElement(Text4, null, "\u{1F4C1}"), /* @__PURE__ */ React4.createElement(Text4, { color: "gray", italic: true }, " ", truncatePath(process.cwd(), 35))),
|
|
952
|
-
/* @__PURE__ */ React4.createElement(Box4, null, /* @__PURE__ */ React4.createElement(Text4, { color: "gray", dimColor: true }, "\u2503 "), /* @__PURE__ */ React4.createElement(Box4, { marginX: 1 }, /* @__PURE__ */ React4.createElement(Text4, null, "\u2728"), /* @__PURE__ */ React4.createElement(Text4, { color: "blue" }, " ", formatTokens(tokensTotal), " ", /* @__PURE__ */ React4.createElement(Text4, { dimColor: true }, "(", (tokens / 254e3 * 100).toFixed(0), "%)"))), /* @__PURE__ */ React4.createElement(Text4, { color: "gray", dimColor: true }, "\u2503 "), /* @__PURE__ */ React4.createElement(Box4, { marginLeft: 1 }, /* @__PURE__ */ React4.createElement(Text4, null, "\u{1F194}"), /* @__PURE__ */ React4.createElement(Text4, { color: "gray", dimColor: true, italic: true }, " ", chatId)))
|
|
958
|
+
/* @__PURE__ */ React4.createElement(Box4, null, /* @__PURE__ */ React4.createElement(Text4, { color: "gray", dimColor: true }, "\u2503 "), /* @__PURE__ */ React4.createElement(Box4, { marginX: 1 }, /* @__PURE__ */ React4.createElement(Text4, null, "\u2728"), /* @__PURE__ */ React4.createElement(Text4, { color: "blue" }, " ", formatTokens(tokensTotal), " ", /* @__PURE__ */ React4.createElement(Text4, { dimColor: true }, "(", (tokens / 254e3 * 100).toFixed(0), "%)"))), /* @__PURE__ */ React4.createElement(Text4, { color: "gray", dimColor: true }, "\u2503 "), /* @__PURE__ */ React4.createElement(Box4, { marginLeft: 1 }, /* @__PURE__ */ React4.createElement(Text4, null, "\u{1F194}"), /* @__PURE__ */ React4.createElement(Text4, { color: "gray", dimColor: true, italic: true }, " ", chatId), (apiTier === "Custom" || apiTier === "Paid") && /* @__PURE__ */ React4.createElement(Text4, { color: "gray", dimColor: true }, " | ", /* @__PURE__ */ React4.createElement(Text4, { color: "green", bold: true }, "PAID"))))
|
|
953
959
|
);
|
|
954
960
|
});
|
|
955
961
|
StatusBar_default = StatusBar;
|
|
@@ -972,7 +978,7 @@ function CommandMenu({ title, subtitle, items, onSelect }) {
|
|
|
972
978
|
flexShrink: 0,
|
|
973
979
|
width: "100%"
|
|
974
980
|
},
|
|
975
|
-
/* @__PURE__ */ React5.createElement(Box5, { paddingX: 1, paddingY: 0, marginBottom: subtitle ? 0 : 1 }, /* @__PURE__ */ React5.createElement(Text5, { color: "magenta", bold: true }, "\u{1F527} ", title.toUpperCase())),
|
|
981
|
+
/* @__PURE__ */ React5.createElement(Box5, { paddingX: 1, paddingY: 0, marginBottom: subtitle ? 0 : 1 }, /* @__PURE__ */ React5.createElement(Text5, { color: "magenta", bold: true }, "\u{1F527} ", typeof title === "string" ? title.toUpperCase() : title)),
|
|
976
982
|
subtitle && /* @__PURE__ */ React5.createElement(Box5, { paddingX: 1, marginBottom: 1 }, /* @__PURE__ */ React5.createElement(Text5, { color: "yellow", dimColor: true, italic: true }, " ", subtitle)),
|
|
977
983
|
/* @__PURE__ */ React5.createElement(Box5, { flexDirection: "column", width: "100%" }, /* @__PURE__ */ React5.createElement(
|
|
978
984
|
SelectInput,
|
|
@@ -2408,11 +2414,14 @@ ${parts.join("\n\n")}
|
|
|
2408
2414
|
` : "";
|
|
2409
2415
|
};
|
|
2410
2416
|
getSystemInstruction = (profile, thinkingLevel, mode, systemSettings, isMemoryEnabled = true) => {
|
|
2411
|
-
let
|
|
2412
|
-
if (thinkingLevel
|
|
2413
|
-
|
|
2414
|
-
|
|
2415
|
-
|
|
2417
|
+
let thinkingConfig = "";
|
|
2418
|
+
if (thinkingLevel !== "GEM") {
|
|
2419
|
+
let levelKey = thinkingLevel;
|
|
2420
|
+
if (thinkingLevel === "Fast") levelKey = "Off";
|
|
2421
|
+
if (thinkingLevel === "Low") levelKey = "Minimal";
|
|
2422
|
+
if (thinkingLevel === "xHigh" || thinkingLevel === "Max") levelKey = "xHigh";
|
|
2423
|
+
thinkingConfig = thinking_prompts_default[levelKey] || thinking_prompts_default["Medium"];
|
|
2424
|
+
}
|
|
2416
2425
|
const osDetected = process.platform === "win32" ? "Windows" : process.platform === "darwin" ? "macOS" : "Linux";
|
|
2417
2426
|
const userInstrStr = profile.instructions && profile.instructions?.length > 0 ? `User Instructions: ${profile.instructions}
|
|
2418
2427
|
|
|
@@ -2460,14 +2469,14 @@ Mode: ${mode}${thinkingLevel !== "Fast" ? " (Thinking Mode)" : ""}. ${mode === "
|
|
|
2460
2469
|
SYSTEM PRIORITY: [SYSTEM], [TOOL RESULT]
|
|
2461
2470
|
HIGH PRIORITY: [STEERING HINT]
|
|
2462
2471
|
USER PRIORITY: [USER]
|
|
2463
|
-
|
|
2472
|
+
${thinkingLevel !== "GEM" ? `
|
|
2464
2473
|
-- THINKING RULES --
|
|
2465
2474
|
${thinkingConfig}
|
|
2466
2475
|
${thinkingLevel !== "Fast" ? `
|
|
2467
2476
|
CRITICAL THINKING POLICY
|
|
2468
2477
|
- ALWAYS use <think> ... </think> before responding, even with simple queries/greetings
|
|
2469
2478
|
- ${thinkingLevel === "Low" || thinkingLevel === "Medium" || thinkingLevel === "Fast" ? "C" : "Interrogate approaches adversarially, but c"}ommit once best solution is determined through analysis. Avoid spiraling after reaching decision point
|
|
2470
|
-
` : ""}
|
|
2479
|
+
` : ""}` : ""}
|
|
2471
2480
|
${TOOL_PROTOCOL(mode, osDetected)}
|
|
2472
2481
|
${projectContextBlock}
|
|
2473
2482
|
-- MEMORY RULES --
|
|
@@ -2922,6 +2931,7 @@ var init_usage = __esm({
|
|
|
2922
2931
|
toolDenied: 0,
|
|
2923
2932
|
duration: 0,
|
|
2924
2933
|
tokens: 0,
|
|
2934
|
+
cachedTokens: 0,
|
|
2925
2935
|
linesAdded: 0,
|
|
2926
2936
|
linesRemoved: 0,
|
|
2927
2937
|
imageCalls: []
|
|
@@ -3133,13 +3143,13 @@ var init_usage = __esm({
|
|
|
3133
3143
|
const quotas = settings.quotas || {};
|
|
3134
3144
|
if (tier === "Free") {
|
|
3135
3145
|
if (key === "agent" || key === "background") {
|
|
3136
|
-
return usage.agent + usage.background <
|
|
3146
|
+
return usage.agent + usage.background < 999999;
|
|
3137
3147
|
}
|
|
3138
3148
|
if (key === "search") return true;
|
|
3139
3149
|
}
|
|
3140
3150
|
if (tier === "Paid" || tier === "Custom") {
|
|
3141
|
-
if (key === "agent") return usage.agent < (quotas.agentLimit ||
|
|
3142
|
-
if (key === "background") return usage.background < (quotas.backgroundLimit ||
|
|
3151
|
+
if (key === "agent") return usage.agent < (quotas.agentLimit || 999999);
|
|
3152
|
+
if (key === "background") return usage.background < (quotas.backgroundLimit || 999999);
|
|
3143
3153
|
if (key === "search") return usage.search < (quotas.searchLimit || 100);
|
|
3144
3154
|
}
|
|
3145
3155
|
return true;
|
|
@@ -4406,8 +4416,8 @@ var init_settings = __esm({
|
|
|
4406
4416
|
showFullThinking: true,
|
|
4407
4417
|
apiTier: "Free",
|
|
4408
4418
|
quotas: {
|
|
4409
|
-
agentLimit:
|
|
4410
|
-
backgroundLimit:
|
|
4419
|
+
agentLimit: 999999,
|
|
4420
|
+
backgroundLimit: 999999,
|
|
4411
4421
|
searchLimit: 100,
|
|
4412
4422
|
customModelId: "",
|
|
4413
4423
|
customLimit: 0
|
|
@@ -5002,7 +5012,7 @@ ${originalTextProcessed.length > USER_CONTEXT_LENGTH ? "... (truncated) ...\n\n"
|
|
|
5002
5012
|
janitorContents.push({ role: "user", parts: [{ text: userPrompt }] });
|
|
5003
5013
|
let finalSynthesis = "";
|
|
5004
5014
|
let attempts = 0;
|
|
5005
|
-
const MAX_JANITOR_RETRIES = 12;
|
|
5015
|
+
const MAX_JANITOR_RETRIES = isMemoryEnabled ? 12 : -1;
|
|
5006
5016
|
while (attempts <= MAX_JANITOR_RETRIES) {
|
|
5007
5017
|
if (process.stdout.isTTY) {
|
|
5008
5018
|
process.stdout.write(`\x1B]0;Retrying Finalizing... (${attempts + 1})...\x07`);
|
|
@@ -5134,7 +5144,7 @@ ${originalTextProcessed.length > USER_CONTEXT_LENGTH ? "... (truncated) ...\n\n"
|
|
|
5134
5144
|
`);
|
|
5135
5145
|
if (attempts >= MAX_JANITOR_RETRIES) {
|
|
5136
5146
|
if (process.stdout.isTTY) {
|
|
5137
|
-
process.stdout.write(`\x1B]0
|
|
5147
|
+
process.stdout.write(`\x1B]0;${isMemoryEnabled ? "Finalizing Error" : "Finalizing Skipped"}\x07`);
|
|
5138
5148
|
}
|
|
5139
5149
|
await new Promise((resolve) => setTimeout(resolve, 3e3));
|
|
5140
5150
|
}
|
|
@@ -5480,7 +5490,7 @@ ${newMemoryListStr}
|
|
|
5480
5490
|
const otherMemories = [...cachedSummaries, ...otherRawMemories].map((mem) => `- ${mem}`).join("\n");
|
|
5481
5491
|
const persistentStorage = readEncryptedJson(MEMORIES_FILE, []);
|
|
5482
5492
|
const mainUserMemories = persistentStorage.map((m) => `- ${m.memory}`).join("\n");
|
|
5483
|
-
const isContext32k = (sessionStats?.tokens || 0) >=
|
|
5493
|
+
const isContext32k = (sessionStats?.tokens || 0) >= 24e3;
|
|
5484
5494
|
const memoryPrompt = getMemoryPrompt(otherMemories, mainUserMemories, isMemoryEnabled, isContext32k);
|
|
5485
5495
|
const dateTimeStr = (/* @__PURE__ */ new Date()).toLocaleString([], { year: "numeric", month: "numeric", day: "numeric", hour: "2-digit", minute: "2-digit", hour12: true });
|
|
5486
5496
|
const COLLAPSED_DIRS_GLOBAL = [
|
|
@@ -5732,7 +5742,8 @@ CWD: ${process.cwd()}${cwdMismatch ? ` (CWD Mismatch! Previous Path: ${lastCwd})
|
|
|
5732
5742
|
**DIRECTORY STRUCTURE**
|
|
5733
5743
|
${dirStructure}
|
|
5734
5744
|
${memoryPrompt}
|
|
5735
|
-
${thinkingLevel != "Fast" ?
|
|
5745
|
+
${thinkingLevel != "Fast" ? `[SYSTEM] **STRICTLY FOLLOW THINKING POLICY AS CRITICAL PRIORITY. DO NOT START A RESPONSE WITHOUT ${(modelName || "gemma").toLowerCase().startsWith("gemma") ? "<think> ... </think>" : "THINKING"}**
|
|
5746
|
+
` : ""}[USER] ${agentText.replace(/\s*\[Prompted on:.*?\]/g, "").trim()}`.trim();
|
|
5736
5747
|
modifiedHistory.push({ role: "user", text: firstUserMsg });
|
|
5737
5748
|
let lastUsage = null;
|
|
5738
5749
|
const MAX_LOOPS = mode === "Flux" ? 70 : 7;
|
|
@@ -5763,7 +5774,8 @@ ${thinkingLevel != "Fast" ? "[SYSTEM] **STRICTLY FOLLOW THINKING POLICY AS CRITI
|
|
|
5763
5774
|
|
|
5764
5775
|
[STEERING HINT]: ${hint}`;
|
|
5765
5776
|
} else {
|
|
5766
|
-
modifiedHistory.push({ role: "user", text: `${thinkingLevel != "Fast" ?
|
|
5777
|
+
modifiedHistory.push({ role: "user", text: `${thinkingLevel != "Fast" ? `[SYSTEM] **STRICTLY FOLLOW THINKING POLICY AS CRITICAL PRIORITY. DO NOT START A RESPONSE WITHOUT ${(modelName || "gemma").toLowerCase().startsWith("gemma") ? "<think> ... </think>" : "THINKING"}**
|
|
5778
|
+
` : ""}[STEERING HINT]: ${hint}` });
|
|
5767
5779
|
}
|
|
5768
5780
|
yield { type: "status", content: "Steering Hint Injected." };
|
|
5769
5781
|
}
|
|
@@ -5787,7 +5799,10 @@ ${thinkingLevel != "Fast" ? "[SYSTEM] **STRICTLY FOLLOW THINKING POLICY AS CRITI
|
|
|
5787
5799
|
let accumulatedContext = "";
|
|
5788
5800
|
let dedupeBuffer = "";
|
|
5789
5801
|
let isDedupeActive = false;
|
|
5802
|
+
let targetModel = modelName;
|
|
5803
|
+
let currentSystemInstruction = "";
|
|
5790
5804
|
while (retryCount <= MAX_RETRIES && inStreamRetryCount <= MAX_RETRIES && !success && !TERMINATION_SIGNAL) {
|
|
5805
|
+
let inThinkingState = false;
|
|
5791
5806
|
try {
|
|
5792
5807
|
turnText = "";
|
|
5793
5808
|
if (isInitialAttempt) {
|
|
@@ -5817,7 +5832,7 @@ ${thinkingLevel != "Fast" ? "[SYSTEM] **STRICTLY FOLLOW THINKING POLICY AS CRITI
|
|
|
5817
5832
|
if (!await checkQuota("agent", settings)) {
|
|
5818
5833
|
throw new Error("Error: Quota Exausted for Agent");
|
|
5819
5834
|
}
|
|
5820
|
-
|
|
5835
|
+
targetModel = modelName;
|
|
5821
5836
|
if (retryCount === MAX_RETRIES - 1) {
|
|
5822
5837
|
targetModel = "gemini-3-flash-preview";
|
|
5823
5838
|
yield { type: "model_update", content: "Trying with fallback model" };
|
|
@@ -5830,9 +5845,9 @@ ${thinkingLevel != "Fast" ? "[SYSTEM] **STRICTLY FOLLOW THINKING POLICY AS CRITI
|
|
|
5830
5845
|
} else if (retryCount > 0) {
|
|
5831
5846
|
yield { type: "model_update", content: null };
|
|
5832
5847
|
}
|
|
5833
|
-
|
|
5848
|
+
currentSystemInstruction = getSystemInstruction(profile, !(targetModel || "gemma").toLowerCase().startsWith("gemma") ? "GEM" : thinkingLevel, mode, systemSettings, isMemoryEnabled, MAX_LOOPS, loop + 1);
|
|
5834
5849
|
const jitInstruction = `
|
|
5835
|
-
[SYSTEM] Tool result received. Analyze output and proceed with your turn${thinkingLevel != "Fast" ?
|
|
5850
|
+
[SYSTEM] Tool result received. Analyze output and proceed with your turn${thinkingLevel != "Fast" ? `. **STRICTLY MAINTAIN THINKING POLICY. DO NOT START A RESPONSE WITHOUT ${(targetModel || "gemma").toLowerCase().startsWith("gemma") ? "<think> ... </think>" : "THINKING"}**` : ""}`;
|
|
5836
5851
|
const lastUserMsg = contents[contents.length - 1];
|
|
5837
5852
|
let addedMarker = false;
|
|
5838
5853
|
if (lastUserMsg && lastUserMsg.role === "user" && lastUserMsg.parts?.[0]?.text?.startsWith("[TOOL RESULT]")) {
|
|
@@ -5845,9 +5860,17 @@ ${thinkingLevel != "Fast" ? "[SYSTEM] **STRICTLY FOLLOW THINKING POLICY AS CRITI
|
|
|
5845
5860
|
lastUserMsg.parts[0].text += `
|
|
5846
5861
|
[SYSTEM] WARNING, Turn Limit Impending: Step ${currentStep}/${MAX_LOOPS}. Wrap up quickly/prompt user to continue & use [turn:finish] quickly.`;
|
|
5847
5862
|
}
|
|
5863
|
+
let activeContents = contents;
|
|
5864
|
+
let cachedContentName = null;
|
|
5865
|
+
if (settings.apiTier !== "Free" && (sessionStats?.tokens || 0) > 16384) {
|
|
5866
|
+
if (lastUsage?.cachedContentTokenCount > 0) {
|
|
5867
|
+
fs17.appendFileSync("status_check.txt", `[${(/* @__PURE__ */ new Date()).toLocaleString()}] IMPLICIT CACHE HIT: ${lastUsage.cachedContentTokenCount} tokens
|
|
5868
|
+
`);
|
|
5869
|
+
}
|
|
5870
|
+
}
|
|
5848
5871
|
stream = await client.models.generateContentStream({
|
|
5849
5872
|
model: targetModel || "gemma-4-31b-it",
|
|
5850
|
-
contents,
|
|
5873
|
+
contents: activeContents,
|
|
5851
5874
|
config: {
|
|
5852
5875
|
systemInstruction: currentSystemInstruction,
|
|
5853
5876
|
temperature: mode === "Flux" ? 1 : 1.4,
|
|
@@ -5859,8 +5882,41 @@ ${thinkingLevel != "Fast" ? "[SYSTEM] **STRICTLY FOLLOW THINKING POLICY AS CRITI
|
|
|
5859
5882
|
{ category: HarmCategory.HARM_CATEGORY_SEXUALLY_EXPLICIT, threshold: HarmBlockThreshold.BLOCK_NONE },
|
|
5860
5883
|
{ category: HarmCategory.HARM_CATEGORY_DANGEROUS_CONTENT, threshold: HarmBlockThreshold.BLOCK_NONE }
|
|
5861
5884
|
],
|
|
5862
|
-
thinkingConfig:
|
|
5863
|
-
|
|
5885
|
+
thinkingConfig: (() => {
|
|
5886
|
+
const modelLower = (targetModel || "").toLowerCase();
|
|
5887
|
+
const isGemma4 = modelLower.includes("gemma-4") || modelLower.startsWith("gemma");
|
|
5888
|
+
const isGemini3 = modelLower.includes("gemini-3");
|
|
5889
|
+
if (isGemma4 || isGemini3) {
|
|
5890
|
+
if (isGemma4) {
|
|
5891
|
+
return { includeThoughts: false, thinkingLevel: ThinkingLevel.MINIMAL };
|
|
5892
|
+
}
|
|
5893
|
+
return {
|
|
5894
|
+
includeThoughts: true,
|
|
5895
|
+
thinkingLevel: {
|
|
5896
|
+
"Fast": modelLower.includes("pro") ? ThinkingLevel.LOW : ThinkingLevel.MINIMAL,
|
|
5897
|
+
"Low": ThinkingLevel.LOW,
|
|
5898
|
+
"Medium": ThinkingLevel.MEDIUM,
|
|
5899
|
+
"High": ThinkingLevel.HIGH,
|
|
5900
|
+
"xHigh": ThinkingLevel.HIGH
|
|
5901
|
+
}[thinkingLevel] || ThinkingLevel.MEDIUM
|
|
5902
|
+
};
|
|
5903
|
+
} else {
|
|
5904
|
+
const budget = {
|
|
5905
|
+
"Fast": -1,
|
|
5906
|
+
"Low": 512,
|
|
5907
|
+
"Medium": 2048,
|
|
5908
|
+
"High": 16384,
|
|
5909
|
+
"xHigh": 24576
|
|
5910
|
+
}[thinkingLevel] || 2048;
|
|
5911
|
+
if (budget === -1) {
|
|
5912
|
+
return { includeThoughts: false };
|
|
5913
|
+
}
|
|
5914
|
+
return {
|
|
5915
|
+
includeThoughts: true,
|
|
5916
|
+
thinkingBudget: budget
|
|
5917
|
+
};
|
|
5918
|
+
}
|
|
5919
|
+
})()
|
|
5864
5920
|
}
|
|
5865
5921
|
});
|
|
5866
5922
|
if (addedMarker && contents[contents.length - 1]?.parts?.[0]) {
|
|
@@ -5878,12 +5934,40 @@ ${thinkingLevel != "Fast" ? "[SYSTEM] **STRICTLY FOLLOW THINKING POLICY AS CRITI
|
|
|
5878
5934
|
for await (const chunk of stream) {
|
|
5879
5935
|
if (TERMINATION_SIGNAL) {
|
|
5880
5936
|
yield { type: "status", content: "Termination Signal Received." };
|
|
5881
|
-
await new Promise((resolve) => setTimeout(resolve,
|
|
5937
|
+
await new Promise((resolve) => setTimeout(resolve, 1500));
|
|
5882
5938
|
break;
|
|
5883
5939
|
}
|
|
5884
|
-
|
|
5940
|
+
let chunkText = "";
|
|
5941
|
+
const parts = chunk.candidates?.[0]?.content?.parts;
|
|
5942
|
+
if (parts && parts.length > 0) {
|
|
5943
|
+
for (const part of parts) {
|
|
5944
|
+
if (part.thought) {
|
|
5945
|
+
if (part.text) {
|
|
5946
|
+
if (!inThinkingState) {
|
|
5947
|
+
chunkText += "<think>";
|
|
5948
|
+
inThinkingState = true;
|
|
5949
|
+
}
|
|
5950
|
+
chunkText += part.text;
|
|
5951
|
+
}
|
|
5952
|
+
} else if (part.text) {
|
|
5953
|
+
if (inThinkingState) {
|
|
5954
|
+
chunkText += "</think>";
|
|
5955
|
+
inThinkingState = false;
|
|
5956
|
+
}
|
|
5957
|
+
chunkText += part.text;
|
|
5958
|
+
}
|
|
5959
|
+
}
|
|
5960
|
+
} else {
|
|
5961
|
+
const t = chunk.text || "";
|
|
5962
|
+
if (t && inThinkingState) {
|
|
5963
|
+
chunkText += "</think>";
|
|
5964
|
+
inThinkingState = false;
|
|
5965
|
+
}
|
|
5966
|
+
chunkText += t;
|
|
5967
|
+
}
|
|
5968
|
+
if (chunkText) {
|
|
5885
5969
|
if (isDedupeActive) {
|
|
5886
|
-
dedupeBuffer +=
|
|
5970
|
+
dedupeBuffer += chunkText;
|
|
5887
5971
|
if (dedupeBuffer.length >= 30) {
|
|
5888
5972
|
let overlapLen = 0;
|
|
5889
5973
|
const maxPossibleOverlap = Math.min(accumulatedContext.length, dedupeBuffer.length);
|
|
@@ -5907,8 +5991,8 @@ ${thinkingLevel != "Fast" ? "[SYSTEM] **STRICTLY FOLLOW THINKING POLICY AS CRITI
|
|
|
5907
5991
|
}
|
|
5908
5992
|
continue;
|
|
5909
5993
|
} else {
|
|
5910
|
-
turnText +=
|
|
5911
|
-
yield { type: "text", content:
|
|
5994
|
+
turnText += chunkText;
|
|
5995
|
+
yield { type: "text", content: chunkText };
|
|
5912
5996
|
}
|
|
5913
5997
|
const signalSafeText3 = getSanitizedText(turnText);
|
|
5914
5998
|
const toolContext = getActiveToolContext(turnText);
|
|
@@ -5988,17 +6072,20 @@ ${thinkingLevel != "Fast" ? "[SYSTEM] **STRICTLY FOLLOW THINKING POLICY AS CRITI
|
|
|
5988
6072
|
const wordCount = thinkContent.split(/\s+/).filter((w) => w.length > 0).length;
|
|
5989
6073
|
let repetitionThresholdThinking = 0.4;
|
|
5990
6074
|
let repetitionThresholdResponse = 0.6;
|
|
5991
|
-
|
|
5992
|
-
|
|
5993
|
-
|
|
5994
|
-
|
|
5995
|
-
|
|
5996
|
-
|
|
5997
|
-
|
|
5998
|
-
|
|
5999
|
-
|
|
6075
|
+
let isOverVerboseThinking = false;
|
|
6076
|
+
if ((targetModel || "").toLowerCase().startsWith("gemma")) {
|
|
6077
|
+
const thinkingCaps = {
|
|
6078
|
+
"low": 256,
|
|
6079
|
+
"medium": 768,
|
|
6080
|
+
"high": 2048,
|
|
6081
|
+
"max": 4096,
|
|
6082
|
+
"xhigh": 4096
|
|
6083
|
+
};
|
|
6084
|
+
const cap = thinkingCaps[thinkingLevel?.toLowerCase()] || 2500;
|
|
6085
|
+
isOverVerboseThinking = wordCount > cap;
|
|
6086
|
+
}
|
|
6000
6087
|
if (repetitionRatio > repetitionThresholdThinking || isOverVerboseThinking) {
|
|
6001
|
-
const reason = repetitionRatio > repetitionThresholdThinking ? "
|
|
6088
|
+
const reason = repetitionRatio > repetitionThresholdThinking ? "Reasoning Loop Detected" : "Thinking Budget Exceeded";
|
|
6002
6089
|
yield { type: "status", content: `${reason}. Re-centering...` };
|
|
6003
6090
|
isThinkingLoop = true;
|
|
6004
6091
|
await new Promise((resolve) => setTimeout(resolve, 3e3));
|
|
@@ -6392,6 +6479,15 @@ ${boxBottom}` };
|
|
|
6392
6479
|
yield { type: "liveTokens", content: lastUsage.totalTokenCount };
|
|
6393
6480
|
}
|
|
6394
6481
|
}
|
|
6482
|
+
if (inThinkingState) {
|
|
6483
|
+
inThinkingState = false;
|
|
6484
|
+
if (isDedupeActive) {
|
|
6485
|
+
dedupeBuffer += "</think>";
|
|
6486
|
+
} else {
|
|
6487
|
+
turnText += "</think>";
|
|
6488
|
+
yield { type: "text", content: "</think>" };
|
|
6489
|
+
}
|
|
6490
|
+
}
|
|
6395
6491
|
if (isDedupeActive && dedupeBuffer.length > 0) {
|
|
6396
6492
|
let overlapLen = 0;
|
|
6397
6493
|
const maxPossibleOverlap = Math.min(accumulatedContext.length, dedupeBuffer.length);
|
|
@@ -6427,10 +6523,27 @@ ${boxBottom}` };
|
|
|
6427
6523
|
await incrementUsage("agent");
|
|
6428
6524
|
} catch (err) {
|
|
6429
6525
|
if (String(err).includes("Incomplete JSON segment at the end")) {
|
|
6526
|
+
if (inThinkingState) {
|
|
6527
|
+
inThinkingState = false;
|
|
6528
|
+
if (isDedupeActive) {
|
|
6529
|
+
dedupeBuffer += "</think>";
|
|
6530
|
+
} else {
|
|
6531
|
+
turnText += "</think>";
|
|
6532
|
+
yield { type: "text", content: "</think>" };
|
|
6533
|
+
}
|
|
6534
|
+
}
|
|
6430
6535
|
success = true;
|
|
6431
6536
|
await incrementUsage("agent");
|
|
6432
6537
|
break;
|
|
6433
6538
|
}
|
|
6539
|
+
if (inThinkingState) {
|
|
6540
|
+
inThinkingState = false;
|
|
6541
|
+
if (isDedupeActive) {
|
|
6542
|
+
dedupeBuffer += "</think>";
|
|
6543
|
+
} else {
|
|
6544
|
+
turnText += "</think>";
|
|
6545
|
+
}
|
|
6546
|
+
}
|
|
6434
6547
|
if (isDedupeActive && dedupeBuffer.length > 0) {
|
|
6435
6548
|
let overlapLen = 0;
|
|
6436
6549
|
const maxPossibleOverlap = Math.min(accumulatedContext.length, dedupeBuffer.length);
|
|
@@ -6523,7 +6636,12 @@ Error Log can be found in ${path16.join(LOGS_DIR, "agent", "error.log")}`);
|
|
|
6523
6636
|
}
|
|
6524
6637
|
}
|
|
6525
6638
|
if (lastUsage) {
|
|
6526
|
-
|
|
6639
|
+
const total = lastUsage.totalTokenCount || 0;
|
|
6640
|
+
const cached = lastUsage.cachedContentTokenCount || 0;
|
|
6641
|
+
await addToUsage("tokens", total);
|
|
6642
|
+
if (cached > 0) {
|
|
6643
|
+
await addToUsage("cachedTokens", cached);
|
|
6644
|
+
}
|
|
6527
6645
|
yield { type: "usage", content: lastUsage };
|
|
6528
6646
|
}
|
|
6529
6647
|
fullAgentResponseChunks.push(turnText);
|
|
@@ -7198,7 +7316,7 @@ function App({ args = [] }) {
|
|
|
7198
7316
|
const [tempKey, setTempKey] = useState10("");
|
|
7199
7317
|
const [activeView, setActiveView] = useState10("chat");
|
|
7200
7318
|
const [apiTier, setApiTier] = useState10("Free");
|
|
7201
|
-
const [quotas, setQuotas] = useState10({ agentLimit:
|
|
7319
|
+
const [quotas, setQuotas] = useState10({ agentLimit: 999999, backgroundLimit: 999999, searchLimit: 100, customModelId: "", customLimit: 0 });
|
|
7202
7320
|
const [inputConfig, setInputConfig] = useState10(null);
|
|
7203
7321
|
const [systemSettings, setSystemSettings] = useState10({ memory: true, compression: 0, autoExec: false, autoDeleteHistory: "7d", autoUpdate: false, updateManager: "npm", customUpdateCommand: "" });
|
|
7204
7322
|
const [profileData, setProfileData] = useState10({ name: null, nickname: null, instructions: null });
|
|
@@ -7207,6 +7325,7 @@ function App({ args = [] }) {
|
|
|
7207
7325
|
const [sessionAgentCalls, setSessionAgentCalls] = useState10(0);
|
|
7208
7326
|
const [sessionBackgroundCalls, setSessionBackgroundCalls] = useState10(0);
|
|
7209
7327
|
const [sessionTotalTokens, setSessionTotalTokens] = useState10(0);
|
|
7328
|
+
const [sessionTotalCachedTokens, setSessionTotalCachedTokens] = useState10(0);
|
|
7210
7329
|
const [sessionToolSuccess, setSessionToolSuccess] = useState10(0);
|
|
7211
7330
|
const [sessionToolFailure, setSessionToolFailure] = useState10(0);
|
|
7212
7331
|
const [sessionToolDenied, setSessionToolDenied] = useState10(0);
|
|
@@ -7220,10 +7339,23 @@ function App({ args = [] }) {
|
|
|
7220
7339
|
const [execOutput, setExecOutput] = useState10("");
|
|
7221
7340
|
const [isTerminalFocused, setIsTerminalFocused] = useState10(false);
|
|
7222
7341
|
const [tick, setTick] = useState10(0);
|
|
7342
|
+
const isFirstRender = useRef3(true);
|
|
7343
|
+
const isSecondRender = useRef3(true);
|
|
7223
7344
|
useEffect7(() => {
|
|
7345
|
+
if (isFirstRender.current) {
|
|
7346
|
+
isFirstRender.current = false;
|
|
7347
|
+
setTimeout(() => {
|
|
7348
|
+
isSecondRender.current = false;
|
|
7349
|
+
}, 2e3);
|
|
7350
|
+
return;
|
|
7351
|
+
}
|
|
7352
|
+
if (isSecondRender.current) {
|
|
7353
|
+
return;
|
|
7354
|
+
}
|
|
7224
7355
|
const s = emojiSpace(2);
|
|
7225
7356
|
if (apiTier === "Free") {
|
|
7226
7357
|
setActiveModel("gemma-4-31b-it");
|
|
7358
|
+
saveSettings({ apiTier: "Free", activeModel: "gemma-4-31b-it" });
|
|
7227
7359
|
setMessages((prev) => {
|
|
7228
7360
|
setCompletedIndex(prev.length + 1);
|
|
7229
7361
|
return [...prev, {
|
|
@@ -7235,12 +7367,13 @@ function App({ args = [] }) {
|
|
|
7235
7367
|
});
|
|
7236
7368
|
} else {
|
|
7237
7369
|
setActiveModel("gemini-3-flash-preview");
|
|
7370
|
+
saveSettings({ apiTier: "Paid", activeModel: "gemini-3-flash-preview" });
|
|
7238
7371
|
setMessages((prev) => {
|
|
7239
7372
|
setCompletedIndex(prev.length + 1);
|
|
7240
7373
|
return [...prev, {
|
|
7241
7374
|
id: "tier-switch-" + Date.now(),
|
|
7242
7375
|
role: "system",
|
|
7243
|
-
text: `\u26A0\uFE0F${s}**[TIER LIMIT]** Auto-switched to Gemini 3 Flash
|
|
7376
|
+
text: `\u26A0\uFE0F${s}**[TIER LIMIT]** Auto-switched to Gemini 3 Flash.`,
|
|
7244
7377
|
isMeta: true
|
|
7245
7378
|
}];
|
|
7246
7379
|
});
|
|
@@ -7530,7 +7663,7 @@ function App({ args = [] }) {
|
|
|
7530
7663
|
}
|
|
7531
7664
|
setShowFullThinking(saved.showFullThinking);
|
|
7532
7665
|
setApiTier(saved.apiTier || "Free");
|
|
7533
|
-
setQuotas(saved.quotas || { agentLimit:
|
|
7666
|
+
setQuotas(saved.quotas || { agentLimit: 999999, backgroundLimit: 999999, searchLimit: 100, customModelId: "", customLimit: 0 });
|
|
7534
7667
|
const freshSettings = {
|
|
7535
7668
|
memory: true,
|
|
7536
7669
|
compression: 0,
|
|
@@ -7636,10 +7769,11 @@ function App({ args = [] }) {
|
|
|
7636
7769
|
showFullThinking,
|
|
7637
7770
|
systemSettings,
|
|
7638
7771
|
profileData,
|
|
7639
|
-
imageSettings
|
|
7772
|
+
imageSettings,
|
|
7773
|
+
apiTier
|
|
7640
7774
|
});
|
|
7641
7775
|
}
|
|
7642
|
-
}, [mode, thinkingLevel, activeModel, showFullThinking, systemSettings, profileData, imageSettings, isInitializing, parsedArgs]);
|
|
7776
|
+
}, [mode, thinkingLevel, activeModel, showFullThinking, systemSettings, profileData, imageSettings, isInitializing, parsedArgs, apiTier]);
|
|
7643
7777
|
const handleSetup = async (val) => {
|
|
7644
7778
|
const key = val.trim();
|
|
7645
7779
|
if (key.length >= 30) {
|
|
@@ -7748,20 +7882,36 @@ function App({ args = [] }) {
|
|
|
7748
7882
|
},
|
|
7749
7883
|
{
|
|
7750
7884
|
cmd: "/model",
|
|
7751
|
-
desc: "Switch
|
|
7885
|
+
desc: "Switch Model for Agent",
|
|
7752
7886
|
subs: apiTier === "Free" ? [
|
|
7753
7887
|
{
|
|
7754
7888
|
cmd: "gemma-4-31b-it",
|
|
7755
7889
|
desc: "Standard Default"
|
|
7890
|
+
},
|
|
7891
|
+
{
|
|
7892
|
+
cmd: "gemini-3-flash-preview",
|
|
7893
|
+
desc: "Fast & Lightweight (Limited Free Quota)"
|
|
7894
|
+
},
|
|
7895
|
+
{
|
|
7896
|
+
cmd: "gemini-3.5-flash",
|
|
7897
|
+
desc: "Flash Latest (Limited Free Quota) [Instability Issues]"
|
|
7756
7898
|
}
|
|
7757
7899
|
] : [
|
|
7900
|
+
{
|
|
7901
|
+
cmd: "gemini-3.1-flash-lite",
|
|
7902
|
+
desc: "Ultra-Fast & Lite"
|
|
7903
|
+
},
|
|
7758
7904
|
{
|
|
7759
7905
|
cmd: "gemini-3-flash-preview",
|
|
7760
|
-
desc: "Fast & Lightweight"
|
|
7906
|
+
desc: "Default, Fast & Lightweight"
|
|
7761
7907
|
},
|
|
7762
7908
|
{
|
|
7763
7909
|
cmd: "gemini-3.5-flash",
|
|
7764
|
-
desc: "Latest"
|
|
7910
|
+
desc: "Flash Latest [Instability Issues]"
|
|
7911
|
+
},
|
|
7912
|
+
{
|
|
7913
|
+
cmd: "gemini-3.1-pro-preview",
|
|
7914
|
+
desc: "Pro Reasoning"
|
|
7765
7915
|
}
|
|
7766
7916
|
]
|
|
7767
7917
|
},
|
|
@@ -8546,6 +8696,15 @@ Selection: ${val}`,
|
|
|
8546
8696
|
if (packet.type === "interactive_turn_finished") {
|
|
8547
8697
|
setIsProcessing(false);
|
|
8548
8698
|
hasFiredJanitor = true;
|
|
8699
|
+
setMessages((prev) => {
|
|
8700
|
+
const aiHistory = packet.data.history;
|
|
8701
|
+
return prev.map((msg, idx) => {
|
|
8702
|
+
if (aiHistory[idx]) {
|
|
8703
|
+
return { ...msg, fullText: aiHistory[idx].text };
|
|
8704
|
+
}
|
|
8705
|
+
return msg;
|
|
8706
|
+
});
|
|
8707
|
+
});
|
|
8549
8708
|
runJanitorTask(
|
|
8550
8709
|
{ profile: profileData, thinkingLevel, mode, janitorModel, chatId, systemSettings, sessionStats },
|
|
8551
8710
|
packet.data.agentText,
|
|
@@ -8580,8 +8739,12 @@ Selection: ${val}`,
|
|
|
8580
8739
|
}
|
|
8581
8740
|
if (packet.type === "usage") {
|
|
8582
8741
|
const total = packet.content.totalTokenCount || 0;
|
|
8742
|
+
const cached = packet.content.cachedContentTokenCount || 0;
|
|
8583
8743
|
setSessionStats({ tokens: total });
|
|
8584
8744
|
setSessionTotalTokens((prev) => prev + total);
|
|
8745
|
+
if (cached > 0) {
|
|
8746
|
+
setSessionTotalCachedTokens((prev) => prev + cached);
|
|
8747
|
+
}
|
|
8585
8748
|
setSessionAgentCalls((prev) => prev + 1);
|
|
8586
8749
|
continue;
|
|
8587
8750
|
}
|
|
@@ -8689,13 +8852,13 @@ Selection: ${val}`,
|
|
|
8689
8852
|
currentThinkId = "think-" + Date.now();
|
|
8690
8853
|
setMessages((prev) => [...prev, { id: currentThinkId, role: "think", text: "", isStreaming: true, startTime: Date.now() }]);
|
|
8691
8854
|
}
|
|
8692
|
-
if (chunkLower.includes("</think>") || chunkLower.includes("</thought>")) {
|
|
8855
|
+
if ((chunkLower.includes("</think>") || chunkLower.includes("</thought>")) && currentThinkId) {
|
|
8693
8856
|
const parts = chunkText.split(/<\/(think|thought)>/gi);
|
|
8694
8857
|
const thinkPart = parts[0] || "";
|
|
8695
8858
|
const agentPart = parts.slice(2).join("").replace(/<\/?(think|thought)>/gi, "");
|
|
8696
8859
|
setMessages((prev) => {
|
|
8697
8860
|
const newMsgs = prev.map((m) => {
|
|
8698
|
-
if (m.id === currentThinkId) {
|
|
8861
|
+
if (m.id === currentThinkId && typeof m.id === "string") {
|
|
8699
8862
|
const startTime = m.startTime || parseInt(m.id.split("-")[1]) || Date.now();
|
|
8700
8863
|
const duration = Date.now() - startTime;
|
|
8701
8864
|
return { ...m, text: m.text + thinkPart, isStreaming: false, duration };
|
|
@@ -8868,10 +9031,10 @@ Selection: ${val}`,
|
|
|
8868
9031
|
return /* @__PURE__ */ React13.createElement(
|
|
8869
9032
|
CommandMenu,
|
|
8870
9033
|
{
|
|
8871
|
-
title:
|
|
9034
|
+
title: /* @__PURE__ */ React13.createElement(Text13, null, "SELECT YOUR CURRENT API TIER BASED ON ", /* @__PURE__ */ React13.createElement(Text13, { color: "cyan", underline: true, bold: true }, "\x1B]8;;https://aistudio.google.com/projects\x07AI STUDIO\x1B]8;;\x07"), ". (CURRENT: ", apiTier.toUpperCase(), ")"),
|
|
8872
9035
|
items: [
|
|
8873
|
-
{ label: "Free Tier (Gemini API Free Tier
|
|
8874
|
-
{ label: `
|
|
9036
|
+
{ label: "Free Tier (Gemini API Free Tier)", value: "Free" },
|
|
9037
|
+
{ label: `Paid Tier (API with Billing Account)`, value: "Paid" },
|
|
8875
9038
|
{ label: "Back", value: "settings" }
|
|
8876
9039
|
],
|
|
8877
9040
|
onSelect: (item) => {
|
|
@@ -8881,9 +9044,9 @@ Selection: ${val}`,
|
|
|
8881
9044
|
}
|
|
8882
9045
|
const newTier = item.value;
|
|
8883
9046
|
setApiTier(newTier);
|
|
8884
|
-
if (newTier === "
|
|
9047
|
+
if (newTier === "Paid") {
|
|
8885
9048
|
setInputConfig({
|
|
8886
|
-
label: "Enter Agent daily
|
|
9049
|
+
label: "Enter Agent daily budget (requests made):",
|
|
8887
9050
|
key: "quotas",
|
|
8888
9051
|
subKey: "agentLimit",
|
|
8889
9052
|
value: String(quotas.agentLimit)
|
|
@@ -8957,7 +9120,7 @@ Selection: ${val}`,
|
|
|
8957
9120
|
}
|
|
8958
9121
|
)), /* @__PURE__ */ React13.createElement(Box13, { paddingX: 1, marginTop: 1 }, /* @__PURE__ */ React13.createElement(Text13, { color: "gray", dimColor: true, italic: true }, "(Press Enter to confirm selection)")));
|
|
8959
9122
|
case "stats":
|
|
8960
|
-
return /* @__PURE__ */ React13.createElement(Box13, { flexDirection: "column", borderStyle: "round", paddingX: 3, paddingY: 1, width: Math.min(100, (stdout?.columns || 100) - 2) }, /* @__PURE__ */ React13.createElement(Box13, { marginBottom: 1 }, /* @__PURE__ */ React13.createElement(Text13, { color: "white", bold: true, underline: true }, "SESSION TELEMETRY")), /* @__PURE__ */ React13.createElement(Box13, { flexDirection: "column" }, /* @__PURE__ */ React13.createElement(Box13, null, /* @__PURE__ */ React13.createElement(Box13, { width: 25 }, /* @__PURE__ */ React13.createElement(Text13, { color: "blue" }, "Session Duration:")), /* @__PURE__ */ React13.createElement(Text13, { color: "white" }, formatMsDuration(Date.now() - SESSION_START_TIME))), /* @__PURE__ */ React13.createElement(Box13, null, /* @__PURE__ */ React13.createElement(Box13, { width: 25 }, /* @__PURE__ */ React13.createElement(Text13, { color: "blue" }, "Agent Interactions:")), /* @__PURE__ */ React13.createElement(Text13, { color: "white" }, sessionAgentCalls)), /* @__PURE__ */ React13.createElement(Box13, { marginLeft: 2 }, /* @__PURE__ */ React13.createElement(Box13, { width: 23 }, /* @__PURE__ */ React13.createElement(Text13, { color: "blue", dimColor: true }, "\xBB API Time:")), /* @__PURE__ */ React13.createElement(Text13, { color: "white" }, formatMsDuration(sessionApiTime))), /* @__PURE__ */ React13.createElement(Box13, { marginLeft: 2 }, /* @__PURE__ */ React13.createElement(Box13, { width: 23 }, /* @__PURE__ */ React13.createElement(Text13, { color: "blue", dimColor: true }, "\xBB Tool Time:")), /* @__PURE__ */ React13.createElement(Text13, { color: "white" }, formatMsDuration(sessionToolTime))), /* @__PURE__ */ React13.createElement(Box13, null, /* @__PURE__ */ React13.createElement(Box13, { width: 25 }, /* @__PURE__ */ React13.createElement(Text13, { color: "blue" }, "Background Tasks:")), /* @__PURE__ */ React13.createElement(Text13, { color: "white" }, sessionBackgroundCalls)), /* @__PURE__ */ React13.createElement(Box13, null, /* @__PURE__ */ React13.createElement(Box13, { width: 25 }, /* @__PURE__ */ React13.createElement(Text13, { color: "blue" }, "Tokens Consumed:")), /* @__PURE__ */ React13.createElement(Text13, { color: "white" }, formatTokens(sessionTotalTokens))), /* @__PURE__ */ React13.createElement(Box13, null, /* @__PURE__ */ React13.createElement(Box13, { width: 25 }, /* @__PURE__ */ React13.createElement(Text13, { color: "blue" }, "
|
|
9123
|
+
return /* @__PURE__ */ React13.createElement(Box13, { flexDirection: "column", borderStyle: "round", paddingX: 3, paddingY: 1, width: Math.min(100, (stdout?.columns || 100) - 2) }, /* @__PURE__ */ React13.createElement(Box13, { marginBottom: 1 }, /* @__PURE__ */ React13.createElement(Text13, { color: "white", bold: true, underline: true }, "SESSION TELEMETRY")), /* @__PURE__ */ React13.createElement(Box13, { flexDirection: "column" }, /* @__PURE__ */ React13.createElement(Box13, null, /* @__PURE__ */ React13.createElement(Box13, { width: 25 }, /* @__PURE__ */ React13.createElement(Text13, { color: "blue" }, "Session Duration:")), /* @__PURE__ */ React13.createElement(Text13, { color: "white" }, formatMsDuration(Date.now() - SESSION_START_TIME))), /* @__PURE__ */ React13.createElement(Box13, null, /* @__PURE__ */ React13.createElement(Box13, { width: 25 }, /* @__PURE__ */ React13.createElement(Text13, { color: "blue" }, "Agent Interactions:")), /* @__PURE__ */ React13.createElement(Text13, { color: "white" }, sessionAgentCalls)), /* @__PURE__ */ React13.createElement(Box13, { marginLeft: 2 }, /* @__PURE__ */ React13.createElement(Box13, { width: 23 }, /* @__PURE__ */ React13.createElement(Text13, { color: "blue", dimColor: true }, "\xBB API Time:")), /* @__PURE__ */ React13.createElement(Text13, { color: "white" }, formatMsDuration(sessionApiTime))), /* @__PURE__ */ React13.createElement(Box13, { marginLeft: 2 }, /* @__PURE__ */ React13.createElement(Box13, { width: 23 }, /* @__PURE__ */ React13.createElement(Text13, { color: "blue", dimColor: true }, "\xBB Tool Time:")), /* @__PURE__ */ React13.createElement(Text13, { color: "white" }, formatMsDuration(sessionToolTime))), /* @__PURE__ */ React13.createElement(Box13, null, /* @__PURE__ */ React13.createElement(Box13, { width: 25 }, /* @__PURE__ */ React13.createElement(Text13, { color: "blue" }, "Background Tasks:")), /* @__PURE__ */ React13.createElement(Text13, { color: "white" }, sessionBackgroundCalls)), /* @__PURE__ */ React13.createElement(Box13, null, /* @__PURE__ */ React13.createElement(Box13, { width: 25 }, /* @__PURE__ */ React13.createElement(Text13, { color: "blue" }, "Tokens Consumed:")), /* @__PURE__ */ React13.createElement(Text13, { color: "white" }, formatTokens(sessionTotalTokens))), sessionTotalCachedTokens > 0 && /* @__PURE__ */ React13.createElement(Box13, null, /* @__PURE__ */ React13.createElement(Box13, { width: 25 }, /* @__PURE__ */ React13.createElement(Text13, { color: "blue" }, "Cached Tokens:")), /* @__PURE__ */ React13.createElement(Text13, { color: "white" }, formatTokens(sessionTotalCachedTokens))), sessionImageCount > 0 && /* @__PURE__ */ React13.createElement(React13.Fragment, null, /* @__PURE__ */ React13.createElement(Box13, null, /* @__PURE__ */ React13.createElement(Box13, { width: 25 }, /* @__PURE__ */ React13.createElement(Text13, { color: "blue" }, "Images Made:")), /* @__PURE__ */ React13.createElement(Text13, { color: "white" }, sessionImageCount)), /* @__PURE__ */ React13.createElement(Box13, null, /* @__PURE__ */ React13.createElement(Box13, { width: 25 }, /* @__PURE__ */ React13.createElement(Text13, { color: "blue" }, "Image Credits:")), /* @__PURE__ */ React13.createElement(Text13, { color: "white" }, Number(((sessionImageCredits || 0) * 1e3).toFixed(0)), " credits"))), /* @__PURE__ */ React13.createElement(Box13, null, /* @__PURE__ */ React13.createElement(Box13, { width: 25 }, /* @__PURE__ */ React13.createElement(Text13, { color: "blue" }, "Code Changes (Sess):")), /* @__PURE__ */ React13.createElement(Text13, { color: "white" }, /* @__PURE__ */ React13.createElement(Text13, { color: "green" }, "+", linesAdded), " ", /* @__PURE__ */ React13.createElement(Text13, { color: "red" }, "-", linesRemoved))), /* @__PURE__ */ React13.createElement(Box13, null, /* @__PURE__ */ React13.createElement(Box13, { width: 25 }, /* @__PURE__ */ React13.createElement(Text13, { color: "blue" }, "Tool Calls (Sess):")), /* @__PURE__ */ React13.createElement(Text13, { color: "white" }, sessionToolSuccess + sessionToolFailure + sessionToolDenied, " ( "), /* @__PURE__ */ React13.createElement(Text13, { color: "green" }, "\u2713 ", sessionToolSuccess), /* @__PURE__ */ React13.createElement(Text13, { color: "white" }, " "), /* @__PURE__ */ React13.createElement(Text13, { color: "yellow" }, "\u2298 ", sessionToolDenied), /* @__PURE__ */ React13.createElement(Text13, { color: "white" }, " "), /* @__PURE__ */ React13.createElement(Text13, { color: "red" }, "\u2715 ", sessionToolFailure), /* @__PURE__ */ React13.createElement(Text13, { color: "white" }, " )"))), /* @__PURE__ */ React13.createElement(Box13, { flexDirection: "column", marginTop: 1 }, /* @__PURE__ */ React13.createElement(Text13, { color: "white", bold: true, underline: true }, "DAILY USAGE TRACKER"), /* @__PURE__ */ React13.createElement(Box13, { marginTop: 1 }, /* @__PURE__ */ React13.createElement(Box13, { width: 25 }, /* @__PURE__ */ React13.createElement(Text13, { color: "blue" }, "Wall Time Today:")), /* @__PURE__ */ React13.createElement(Text13, { color: "white" }, formatDuration(dailyUsage?.duration || 0))), /* @__PURE__ */ React13.createElement(Box13, null, /* @__PURE__ */ React13.createElement(Box13, { width: 25 }, /* @__PURE__ */ React13.createElement(Text13, { color: "blue" }, "Agent Interactions:")), /* @__PURE__ */ React13.createElement(Text13, { color: "white" }, dailyUsage?.agent || 0)), /* @__PURE__ */ React13.createElement(Box13, null, /* @__PURE__ */ React13.createElement(Box13, { width: 25 }, /* @__PURE__ */ React13.createElement(Text13, { color: "blue" }, "Background Tasks:")), /* @__PURE__ */ React13.createElement(Text13, { color: "white" }, dailyUsage?.background || 0)), /* @__PURE__ */ React13.createElement(Box13, null, /* @__PURE__ */ React13.createElement(Box13, { width: 25 }, /* @__PURE__ */ React13.createElement(Text13, { color: "blue" }, "Tokens Used Today:")), /* @__PURE__ */ React13.createElement(Text13, { color: "white" }, formatTokens(dailyUsage?.tokens || 0))), (dailyUsage?.cachedTokens || 0) > 0 && /* @__PURE__ */ React13.createElement(Box13, null, /* @__PURE__ */ React13.createElement(Box13, { width: 25 }, /* @__PURE__ */ React13.createElement(Text13, { color: "blue" }, "Served from Cache:")), /* @__PURE__ */ React13.createElement(Text13, { color: "white" }, formatTokens(dailyUsage.cachedTokens))), (dailyUsage?.imageCalls?.length || 0) > 0 && /* @__PURE__ */ React13.createElement(React13.Fragment, null, /* @__PURE__ */ React13.createElement(Box13, null, /* @__PURE__ */ React13.createElement(Box13, { width: 25 }, /* @__PURE__ */ React13.createElement(Text13, { color: "blue" }, "Images Made Today:")), /* @__PURE__ */ React13.createElement(Text13, { color: "white" }, dailyUsage.imageCalls.length)), /* @__PURE__ */ React13.createElement(Box13, null, /* @__PURE__ */ React13.createElement(Box13, { width: 25 }, /* @__PURE__ */ React13.createElement(Text13, { color: "blue" }, "Image Credits Today:")), /* @__PURE__ */ React13.createElement(Text13, { color: "white" }, Number(((dailyUsage.imageCalls.reduce((sum, c) => sum + c.cost, 0) || 0) * 1e3).toFixed(0)), " credits"))), /* @__PURE__ */ React13.createElement(Box13, null, /* @__PURE__ */ React13.createElement(Box13, { width: 25 }, /* @__PURE__ */ React13.createElement(Text13, { color: "blue" }, "Code Changes Today:")), /* @__PURE__ */ React13.createElement(Text13, { color: "white" }, /* @__PURE__ */ React13.createElement(Text13, { color: "green" }, "+", dailyUsage?.linesAdded || 0), " ", /* @__PURE__ */ React13.createElement(Text13, { color: "red" }, "-", dailyUsage?.linesRemoved || 0))), /* @__PURE__ */ React13.createElement(Box13, null, /* @__PURE__ */ React13.createElement(Box13, { width: 25 }, /* @__PURE__ */ React13.createElement(Text13, { color: "blue" }, "Tool Calls Today:")), /* @__PURE__ */ React13.createElement(Text13, { color: "white" }, (dailyUsage?.toolSuccess || 0) + (dailyUsage?.toolFailure || 0) + (dailyUsage?.toolDenied || 0), " ( "), /* @__PURE__ */ React13.createElement(Text13, { color: "green" }, "\u2713 ", dailyUsage?.toolSuccess || 0), /* @__PURE__ */ React13.createElement(Text13, { color: "white" }, " "), /* @__PURE__ */ React13.createElement(Text13, { color: "yellow" }, "\u2298 ", dailyUsage?.toolDenied || 0), /* @__PURE__ */ React13.createElement(Text13, { color: "white" }, " "), /* @__PURE__ */ React13.createElement(Text13, { color: "red" }, "\u2715 ", dailyUsage?.toolFailure || 0), /* @__PURE__ */ React13.createElement(Text13, { color: "white" }, " )"))), /* @__PURE__ */ React13.createElement(Text13, { dimColor: true, marginTop: 1, italic: true }, "(Press ESC to return to chat)"));
|
|
8961
9124
|
case "autoExecDanger":
|
|
8962
9125
|
return /* @__PURE__ */ React13.createElement(Box13, { flexDirection: "column", borderStyle: "round", borderColor: "yellow", paddingX: 2, paddingY: 1, width: "100%" }, /* @__PURE__ */ React13.createElement(Text13, { color: "yellow", bold: true, underline: true }, "\u26A0\uFE0F SECURITY WARNING: AUTO EXECUTE MODE"), /* @__PURE__ */ React13.createElement(Text13, { marginTop: 1 }, "Turning this ON allows the agent to execute terminal commands automatically without requiring your approval for each step."), /* @__PURE__ */ React13.createElement(Text13, { marginTop: 1, color: "yellow" }, "RISKS INVOLVED:"), /* @__PURE__ */ React13.createElement(Text13, null, "\u2022 The agent may execute destructive commands (rm -rf, etc.) by mistake."), /* @__PURE__ */ React13.createElement(Text13, null, "\u2022 Unintended system changes if the agent hallucinates a path or command."), /* @__PURE__ */ React13.createElement(Text13, null, "\u2022 Reduced control over the agent's step-by-step decision making."), /* @__PURE__ */ React13.createElement(Box13, { marginTop: 1 }, /* @__PURE__ */ React13.createElement(
|
|
8963
9126
|
CommandMenu,
|
|
@@ -9339,7 +9502,7 @@ Selection: ${val}`,
|
|
|
9339
9502
|
showFullThinking,
|
|
9340
9503
|
columns: Math.max(20, (stdout?.columns || 80) - 1)
|
|
9341
9504
|
}
|
|
9342
|
-
), activeCommand && /* @__PURE__ */ React13.createElement(Box13, { marginTop: 1 }, /* @__PURE__ */ React13.createElement(TerminalBox, { command: activeCommand, output: execOutput, isFocused: isTerminalFocused, isPty: isActiveCommandPty }))), isInitializing ? /* @__PURE__ */ React13.createElement(Box13, { borderStyle: "double", borderColor: "magenta", padding: 1, flexShrink: 0 }, /* @__PURE__ */ React13.createElement(Text13, { color: "magenta" }, "\u{1F30A} Starting Flux Flow...")) : !apiKey ? /* @__PURE__ */ React13.createElement(Box13, { borderStyle: "round", borderColor: "gray", padding: 0, flexDirection: "column", flexShrink: 0, width: "100%" }, /* @__PURE__ */ React13.createElement(Box13, { paddingX: 1, marginBottom: 1 }, /* @__PURE__ */ React13.createElement(Text13, { color: "yellow", bold: true }, "\u{1F511}", emojiSpace(2), "API KEY REQUIRED")), /* @__PURE__ */ React13.createElement(Box13, { paddingX: 1, flexDirection: "column" }, /* @__PURE__ */ React13.createElement(Text13, null, "Please enter your Gemini API Key to initialize the agent."), /* @__PURE__ */ React13.createElement(Box13, { marginTop: 1 }, /* @__PURE__ */ React13.createElement(Text13, { color: "cyan", bold: true }, "\u{1F4A0} "), /* @__PURE__ */ React13.createElement(
|
|
9505
|
+
), activeCommand && /* @__PURE__ */ React13.createElement(Box13, { marginTop: 1 }, /* @__PURE__ */ React13.createElement(TerminalBox, { command: activeCommand, output: execOutput, isFocused: isTerminalFocused, isPty: isActiveCommandPty }))), isInitializing ? /* @__PURE__ */ React13.createElement(Box13, { borderStyle: "double", borderColor: "magenta", padding: 1, flexShrink: 0 }, /* @__PURE__ */ React13.createElement(Text13, { color: "magenta" }, "\u{1F30A} Starting Flux Flow...")) : !apiKey ? /* @__PURE__ */ React13.createElement(Box13, { borderStyle: "round", borderColor: "gray", padding: 0, flexDirection: "column", flexShrink: 0, width: "100%" }, /* @__PURE__ */ React13.createElement(Box13, { paddingX: 1, marginBottom: 1 }, /* @__PURE__ */ React13.createElement(Text13, { color: "yellow", bold: true }, "\u{1F511}", emojiSpace(2), "API KEY REQUIRED")), /* @__PURE__ */ React13.createElement(Box13, { paddingX: 1, flexDirection: "column" }, /* @__PURE__ */ React13.createElement(Text13, null, "Please enter your Gemini API Key to initialize the agent (If billing is enabled set Tier to paid in /settings \u2192 other \u2192 API Tier)."), /* @__PURE__ */ React13.createElement(Box13, { marginTop: 1 }, /* @__PURE__ */ React13.createElement(Text13, { color: "cyan", bold: true }, "\u{1F4A0} "), /* @__PURE__ */ React13.createElement(
|
|
9343
9506
|
TextInput4,
|
|
9344
9507
|
{
|
|
9345
9508
|
value: tempKey,
|
|
@@ -9355,7 +9518,8 @@ Selection: ${val}`,
|
|
|
9355
9518
|
tokens: sessionStats.tokens,
|
|
9356
9519
|
tokensTotal: sessionStats.tokens,
|
|
9357
9520
|
chatId,
|
|
9358
|
-
isMemoryEnabled: systemSettings.memory
|
|
9521
|
+
isMemoryEnabled: systemSettings.memory,
|
|
9522
|
+
apiTier
|
|
9359
9523
|
}
|
|
9360
9524
|
)), activeView === "exit" && (() => {
|
|
9361
9525
|
const wallTimeMs = Date.now() - SESSION_START_TIME;
|
|
@@ -9364,7 +9528,7 @@ Selection: ${val}`,
|
|
|
9364
9528
|
const agentActiveMs = sessionApiTime + sessionToolTime;
|
|
9365
9529
|
const apiPercent = agentActiveMs > 0 ? (sessionApiTime / agentActiveMs * 100).toFixed(1) : "0.0";
|
|
9366
9530
|
const toolPercent = agentActiveMs > 0 ? (sessionToolTime / agentActiveMs * 100).toFixed(1) : "0.0";
|
|
9367
|
-
return /* @__PURE__ */ React13.createElement(Box13, { flexDirection: "column", borderStyle: "round", paddingX: 3, paddingY: 1, borderColor: "red", width: Math.min(100, (stdout?.columns || 100) - 2), marginTop: 0, marginBottom: 1 }, /* @__PURE__ */ React13.createElement(Box13, { marginBottom: 1 }, /* @__PURE__ */ React13.createElement(Text13, { color: "cyan", bold: true }, "Agent powering down. ", /* @__PURE__ */ React13.createElement(Text13, { color: "magenta" }, "Goodbye!"))), /* @__PURE__ */ React13.createElement(Box13, { flexDirection: "column" }, /* @__PURE__ */ React13.createElement(Text13, { color: "white", bold: true, underline: true }, "Interaction Summary"), /* @__PURE__ */ React13.createElement(Box13, { marginTop: 1 }, /* @__PURE__ */ React13.createElement(Box13, { width: 20 }, /* @__PURE__ */ React13.createElement(Text13, { color: "blue" }, "Session ID:")), /* @__PURE__ */ React13.createElement(Text13, { color: "white" }, chatId)), /* @__PURE__ */ React13.createElement(Box13, null, /* @__PURE__ */ React13.createElement(Box13, { width: 20 }, /* @__PURE__ */ React13.createElement(Text13, { color: "blue" }, "Tool Calls:")), /* @__PURE__ */ React13.createElement(Text13, { color: "white" }, sessionToolSuccess + sessionToolFailure + sessionToolDenied, " ( ", /* @__PURE__ */ React13.createElement(Text13, { color: "green" }, "\u2713 ", sessionToolSuccess), " ", /* @__PURE__ */ React13.createElement(Text13, { color: "yellow" }, "\u2298 ", sessionToolDenied), " ", /* @__PURE__ */ React13.createElement(Text13, { color: "red" }, "\u2715 ", sessionToolFailure), " )")), /* @__PURE__ */ React13.createElement(Box13, null, /* @__PURE__ */ React13.createElement(Box13, { width: 20 }, /* @__PURE__ */ React13.createElement(Text13, { color: "blue" }, "Success Rate:")), /* @__PURE__ */ React13.createElement(Text13, { color: "white" }, successRate, "%")), /* @__PURE__ */ React13.createElement(Box13, null, /* @__PURE__ */ React13.createElement(Box13, { width: 20 }, /* @__PURE__ */ React13.createElement(Text13, { color: "blue" }, "Code Changes:")), /* @__PURE__ */ React13.createElement(Text13, { color: "white" }, /* @__PURE__ */ React13.createElement(Text13, { color: "green" }, "+", linesAdded), " ", /* @__PURE__ */ React13.createElement(Text13, { color: "red" }, "-", linesRemoved))), /* @__PURE__ */ React13.createElement(Box13, null, /* @__PURE__ */ React13.createElement(Box13, { width: 20 }, /* @__PURE__ */ React13.createElement(Text13, { color: "blue" }, "Tokens Consumed:")), /* @__PURE__ */ React13.createElement(Text13, { color: "white" }, formatTokens(sessionTotalTokens))), /* @__PURE__ */ React13.createElement(Box13, null, /* @__PURE__ */ React13.createElement(Box13, { width: 20 }, /* @__PURE__ */ React13.createElement(Text13, { color: "blue" }, "
|
|
9531
|
+
return /* @__PURE__ */ React13.createElement(Box13, { flexDirection: "column", borderStyle: "round", paddingX: 3, paddingY: 1, borderColor: "red", width: Math.min(100, (stdout?.columns || 100) - 2), marginTop: 0, marginBottom: 1 }, /* @__PURE__ */ React13.createElement(Box13, { marginBottom: 1 }, /* @__PURE__ */ React13.createElement(Text13, { color: "cyan", bold: true }, "Agent powering down. ", /* @__PURE__ */ React13.createElement(Text13, { color: "magenta" }, "Goodbye!"))), /* @__PURE__ */ React13.createElement(Box13, { flexDirection: "column" }, /* @__PURE__ */ React13.createElement(Text13, { color: "white", bold: true, underline: true }, "Interaction Summary"), /* @__PURE__ */ React13.createElement(Box13, { marginTop: 1 }, /* @__PURE__ */ React13.createElement(Box13, { width: 20 }, /* @__PURE__ */ React13.createElement(Text13, { color: "blue" }, "Session ID:")), /* @__PURE__ */ React13.createElement(Text13, { color: "white" }, chatId)), /* @__PURE__ */ React13.createElement(Box13, null, /* @__PURE__ */ React13.createElement(Box13, { width: 20 }, /* @__PURE__ */ React13.createElement(Text13, { color: "blue" }, "Tool Calls:")), /* @__PURE__ */ React13.createElement(Text13, { color: "white" }, sessionToolSuccess + sessionToolFailure + sessionToolDenied, " ( ", /* @__PURE__ */ React13.createElement(Text13, { color: "green" }, "\u2713 ", sessionToolSuccess), " ", /* @__PURE__ */ React13.createElement(Text13, { color: "yellow" }, "\u2298 ", sessionToolDenied), " ", /* @__PURE__ */ React13.createElement(Text13, { color: "red" }, "\u2715 ", sessionToolFailure), " )")), /* @__PURE__ */ React13.createElement(Box13, null, /* @__PURE__ */ React13.createElement(Box13, { width: 20 }, /* @__PURE__ */ React13.createElement(Text13, { color: "blue" }, "Success Rate:")), /* @__PURE__ */ React13.createElement(Text13, { color: "white" }, successRate, "%")), /* @__PURE__ */ React13.createElement(Box13, null, /* @__PURE__ */ React13.createElement(Box13, { width: 20 }, /* @__PURE__ */ React13.createElement(Text13, { color: "blue" }, "Code Changes:")), /* @__PURE__ */ React13.createElement(Text13, { color: "white" }, /* @__PURE__ */ React13.createElement(Text13, { color: "green" }, "+", linesAdded), " ", /* @__PURE__ */ React13.createElement(Text13, { color: "red" }, "-", linesRemoved))), /* @__PURE__ */ React13.createElement(Box13, null, /* @__PURE__ */ React13.createElement(Box13, { width: 20 }, /* @__PURE__ */ React13.createElement(Text13, { color: "blue" }, "Tokens Consumed:")), /* @__PURE__ */ React13.createElement(Text13, { color: "white" }, formatTokens(sessionTotalTokens))), sessionTotalCachedTokens > 0 && /* @__PURE__ */ React13.createElement(Box13, null, /* @__PURE__ */ React13.createElement(Box13, { width: 20 }, /* @__PURE__ */ React13.createElement(Text13, { color: "blue" }, "Cached Tokens:")), /* @__PURE__ */ React13.createElement(Text13, { color: "white" }, formatTokens(sessionTotalCachedTokens))), sessionImageCount > 0 && /* @__PURE__ */ React13.createElement(React13.Fragment, null, /* @__PURE__ */ React13.createElement(Box13, null, /* @__PURE__ */ React13.createElement(Box13, { width: 20 }, /* @__PURE__ */ React13.createElement(Text13, { color: "blue" }, "Images Made:")), /* @__PURE__ */ React13.createElement(Text13, { color: "white" }, sessionImageCount)), /* @__PURE__ */ React13.createElement(Box13, null, /* @__PURE__ */ React13.createElement(Box13, { width: 20 }, /* @__PURE__ */ React13.createElement(Text13, { color: "blue" }, "Image Credits:")), /* @__PURE__ */ React13.createElement(Text13, { color: "white" }, Number(((sessionImageCredits || 0) * 1e3).toFixed(0)), " credits")))), /* @__PURE__ */ React13.createElement(Box13, { flexDirection: "column", marginTop: 1 }, /* @__PURE__ */ React13.createElement(Text13, { color: "white", bold: true, underline: true }, "Performance"), /* @__PURE__ */ React13.createElement(Box13, { marginTop: 1 }, /* @__PURE__ */ React13.createElement(Box13, { width: 20 }, /* @__PURE__ */ React13.createElement(Text13, { color: "blue" }, "Wall Time:")), /* @__PURE__ */ React13.createElement(Text13, { color: "white" }, formatMsDuration(wallTimeMs))), /* @__PURE__ */ React13.createElement(Box13, null, /* @__PURE__ */ React13.createElement(Box13, { width: 20 }, /* @__PURE__ */ React13.createElement(Text13, { color: "blue" }, "Agent Active:")), /* @__PURE__ */ React13.createElement(Text13, { color: "white" }, formatMsDuration(agentActiveMs))), /* @__PURE__ */ React13.createElement(Box13, { marginLeft: 2 }, /* @__PURE__ */ React13.createElement(Box13, { width: 18 }, /* @__PURE__ */ React13.createElement(Text13, { color: "blue", dimColor: true }, "\xBB API Time:")), /* @__PURE__ */ React13.createElement(Text13, { color: "white" }, formatMsDuration(sessionApiTime), " (", apiPercent, "%)")), /* @__PURE__ */ React13.createElement(Box13, { marginLeft: 2 }, /* @__PURE__ */ React13.createElement(Box13, { width: 18 }, /* @__PURE__ */ React13.createElement(Text13, { color: "blue", dimColor: true }, "\xBB Tool Time:")), /* @__PURE__ */ React13.createElement(Text13, { color: "white" }, formatMsDuration(sessionToolTime), " (", toolPercent, "%)"))));
|
|
9368
9532
|
})(), suggestions.length > 0 && (() => {
|
|
9369
9533
|
const windowSize = 5;
|
|
9370
9534
|
const startIdx = Math.max(0, Math.min(selectedIndex - 2, suggestions.length - windowSize));
|
|
@@ -9380,7 +9544,7 @@ Selection: ${val}`,
|
|
|
9380
9544
|
paddingY: 0,
|
|
9381
9545
|
width: "100%"
|
|
9382
9546
|
},
|
|
9383
|
-
/* @__PURE__ */ React13.createElement(Box13, { paddingX: 1, marginBottom: 0, justifyContent: "space-between", width: "100%" }, /* @__PURE__ */ React13.createElement(Text13, { color: "gray", bold: true, dimColor: true }, suggestions[0]?.cmd?.startsWith("@") ? "\u{1F4C1} FILE SUGGESTIONS" : "\u{1F50D} COMMAND SUGGESTIONS"), suggestions[0]?.cmd?.startsWith("@")
|
|
9547
|
+
/* @__PURE__ */ React13.createElement(Box13, { paddingX: 1, marginBottom: 0, justifyContent: "space-between", width: "100%" }, /* @__PURE__ */ React13.createElement(Text13, { color: "gray", bold: true, dimColor: true }, suggestions[0]?.cmd?.startsWith("@") ? "\u{1F4C1} FILE SUGGESTIONS" : "\u{1F50D} COMMAND SUGGESTIONS"), suggestions[0]?.cmd?.startsWith("@") ? /* @__PURE__ */ React13.createElement(Text13, { color: "gray", dimColor: true, italic: true }, "(Use '#Lstart-Lend' to specify line numbers)") : input.startsWith("/model") && apiTier === "Free" ? /* @__PURE__ */ React13.createElement(Text13, { color: "gray", dimColor: true, italic: true }, "Paid API has more models. Configure ", /* @__PURE__ */ React13.createElement(Text13, { color: "cyan", underline: true }, "\x1B]8;;https://aistudio.google.com/billing\x07billing\x1B]8;;\x07"), " & /settings") : null),
|
|
9384
9548
|
visible.map((s, i) => {
|
|
9385
9549
|
const actualIdx = startIdx + i;
|
|
9386
9550
|
const isActive = actualIdx === selectedIndex;
|