fluxflow-cli 1.18.25 → 1.19.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/fluxflow.js +259 -91
- 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,7 @@ CWD: ${process.cwd()}${cwdMismatch ? ` (CWD Mismatch! Previous Path: ${lastCwd})
|
|
|
5732
5742
|
**DIRECTORY STRUCTURE**
|
|
5733
5743
|
${dirStructure}
|
|
5734
5744
|
${memoryPrompt}
|
|
5735
|
-
${thinkingLevel != "Fast" ? "[SYSTEM] **STRICTLY FOLLOW THINKING POLICY AS CRITICAL PRIORITY. DO NOT START A RESPONSE WITHOUT <think> ... </think
|
|
5745
|
+
${thinkingLevel != "Fast" ? `${modelName.toLowerCase().startsWith("gemma") ? "[SYSTEM] **STRICTLY FOLLOW THINKING POLICY AS CRITICAL PRIORITY. DO NOT START A RESPONSE WITHOUT <think> ... </think**\n" : ""}` : ""}[USER] ${agentText.replace(/\s*\[Prompted on:.*?\]/g, "").trim()}`.trim();
|
|
5736
5746
|
modifiedHistory.push({ role: "user", text: firstUserMsg });
|
|
5737
5747
|
let lastUsage = null;
|
|
5738
5748
|
const MAX_LOOPS = mode === "Flux" ? 70 : 7;
|
|
@@ -5763,7 +5773,7 @@ ${thinkingLevel != "Fast" ? "[SYSTEM] **STRICTLY FOLLOW THINKING POLICY AS CRITI
|
|
|
5763
5773
|
|
|
5764
5774
|
[STEERING HINT]: ${hint}`;
|
|
5765
5775
|
} else {
|
|
5766
|
-
modifiedHistory.push({ role: "user", text: `${thinkingLevel != "Fast" ? "[SYSTEM] **STRICTLY FOLLOW THINKING POLICY AS CRITICAL PRIORITY. DO NOT START A RESPONSE WITHOUT <think> ... </think
|
|
5776
|
+
modifiedHistory.push({ role: "user", text: `${thinkingLevel != "Fast" ? `${modelName.toLowerCase().startsWith("gemma") ? "[SYSTEM] **STRICTLY FOLLOW THINKING POLICY AS CRITICAL PRIORITY. DO NOT START A RESPONSE WITHOUT <think> ... </think**\n" : ""}` : ""}[STEERING HINT]: ${hint}` });
|
|
5767
5777
|
}
|
|
5768
5778
|
yield { type: "status", content: "Steering Hint Injected." };
|
|
5769
5779
|
}
|
|
@@ -5787,7 +5797,10 @@ ${thinkingLevel != "Fast" ? "[SYSTEM] **STRICTLY FOLLOW THINKING POLICY AS CRITI
|
|
|
5787
5797
|
let accumulatedContext = "";
|
|
5788
5798
|
let dedupeBuffer = "";
|
|
5789
5799
|
let isDedupeActive = false;
|
|
5800
|
+
let targetModel = modelName;
|
|
5801
|
+
let currentSystemInstruction = "";
|
|
5790
5802
|
while (retryCount <= MAX_RETRIES && inStreamRetryCount <= MAX_RETRIES && !success && !TERMINATION_SIGNAL) {
|
|
5803
|
+
let inThinkingState = false;
|
|
5791
5804
|
try {
|
|
5792
5805
|
turnText = "";
|
|
5793
5806
|
if (isInitialAttempt) {
|
|
@@ -5817,7 +5830,7 @@ ${thinkingLevel != "Fast" ? "[SYSTEM] **STRICTLY FOLLOW THINKING POLICY AS CRITI
|
|
|
5817
5830
|
if (!await checkQuota("agent", settings)) {
|
|
5818
5831
|
throw new Error("Error: Quota Exausted for Agent");
|
|
5819
5832
|
}
|
|
5820
|
-
|
|
5833
|
+
targetModel = modelName;
|
|
5821
5834
|
if (retryCount === MAX_RETRIES - 1) {
|
|
5822
5835
|
targetModel = "gemini-3-flash-preview";
|
|
5823
5836
|
yield { type: "model_update", content: "Trying with fallback model" };
|
|
@@ -5830,24 +5843,38 @@ ${thinkingLevel != "Fast" ? "[SYSTEM] **STRICTLY FOLLOW THINKING POLICY AS CRITI
|
|
|
5830
5843
|
} else if (retryCount > 0) {
|
|
5831
5844
|
yield { type: "model_update", content: null };
|
|
5832
5845
|
}
|
|
5833
|
-
|
|
5834
|
-
const
|
|
5835
|
-
|
|
5836
|
-
const lastUserMsg = contents[contents.length - 1];
|
|
5846
|
+
currentSystemInstruction = getSystemInstruction(profile, !(targetModel || "gemma").toLowerCase().startsWith("gemma") ? "GEM" : thinkingLevel, mode, systemSettings, isMemoryEnabled, MAX_LOOPS, loop + 1);
|
|
5847
|
+
const isGemma = modelName && modelName.toLowerCase().startsWith("gemma");
|
|
5848
|
+
let jitInstruction = "";
|
|
5837
5849
|
let addedMarker = false;
|
|
5838
|
-
|
|
5839
|
-
|
|
5840
|
-
|
|
5850
|
+
const lastUserMsg = contents[contents.length - 1];
|
|
5851
|
+
if (isGemma) {
|
|
5852
|
+
jitInstruction = `
|
|
5853
|
+
[SYSTEM] Tool result received. Analyze output and proceed with your turn${thinkingLevel != "Fast" ? `. **STRICTLY MAINTAIN THINKING POLICY. DO NOT START A RESPONSE WITHOUT <think> ... </think>}**` : ""}`;
|
|
5854
|
+
if (lastUserMsg && lastUserMsg.role === "user" && lastUserMsg.parts?.[0]?.text?.startsWith("[TOOL RESULT]")) {
|
|
5855
|
+
lastUserMsg.parts[0].text += jitInstruction;
|
|
5856
|
+
addedMarker = true;
|
|
5857
|
+
}
|
|
5841
5858
|
}
|
|
5842
|
-
|
|
5843
|
-
|
|
5844
|
-
|
|
5845
|
-
lastUserMsg.parts[0]
|
|
5859
|
+
if (isGemma) {
|
|
5860
|
+
const stepThreshold = Math.floor(MAX_LOOPS * (mode === "Flux" ? 0.98 : 0.7));
|
|
5861
|
+
const currentStep = loop + 1;
|
|
5862
|
+
if (currentStep >= stepThreshold && lastUserMsg && lastUserMsg.parts?.[0]) {
|
|
5863
|
+
lastUserMsg.parts[0].text += `
|
|
5846
5864
|
[SYSTEM] WARNING, Turn Limit Impending: Step ${currentStep}/${MAX_LOOPS}. Wrap up quickly/prompt user to continue & use [turn:finish] quickly.`;
|
|
5865
|
+
}
|
|
5866
|
+
}
|
|
5867
|
+
let activeContents = contents;
|
|
5868
|
+
let cachedContentName = null;
|
|
5869
|
+
if (settings.apiTier !== "Free" && (sessionStats?.tokens || 0) > 16384) {
|
|
5870
|
+
if (lastUsage?.cachedContentTokenCount > 0) {
|
|
5871
|
+
fs17.appendFileSync("status_check.txt", `[${(/* @__PURE__ */ new Date()).toLocaleString()}] IMPLICIT CACHE HIT: ${lastUsage.cachedContentTokenCount} tokens
|
|
5872
|
+
`);
|
|
5873
|
+
}
|
|
5847
5874
|
}
|
|
5848
5875
|
stream = await client.models.generateContentStream({
|
|
5849
5876
|
model: targetModel || "gemma-4-31b-it",
|
|
5850
|
-
contents,
|
|
5877
|
+
contents: activeContents,
|
|
5851
5878
|
config: {
|
|
5852
5879
|
systemInstruction: currentSystemInstruction,
|
|
5853
5880
|
temperature: mode === "Flux" ? 1 : 1.4,
|
|
@@ -5859,8 +5886,41 @@ ${thinkingLevel != "Fast" ? "[SYSTEM] **STRICTLY FOLLOW THINKING POLICY AS CRITI
|
|
|
5859
5886
|
{ category: HarmCategory.HARM_CATEGORY_SEXUALLY_EXPLICIT, threshold: HarmBlockThreshold.BLOCK_NONE },
|
|
5860
5887
|
{ category: HarmCategory.HARM_CATEGORY_DANGEROUS_CONTENT, threshold: HarmBlockThreshold.BLOCK_NONE }
|
|
5861
5888
|
],
|
|
5862
|
-
thinkingConfig:
|
|
5863
|
-
|
|
5889
|
+
thinkingConfig: (() => {
|
|
5890
|
+
const modelLower = (targetModel || "").toLowerCase();
|
|
5891
|
+
const isGemma4 = modelLower.includes("gemma-4") || modelLower.startsWith("gemma");
|
|
5892
|
+
const isGemini3 = modelLower.includes("gemini-3");
|
|
5893
|
+
if (isGemma4 || isGemini3) {
|
|
5894
|
+
if (isGemma4) {
|
|
5895
|
+
return { includeThoughts: false, thinkingLevel: ThinkingLevel.MINIMAL };
|
|
5896
|
+
}
|
|
5897
|
+
return {
|
|
5898
|
+
includeThoughts: true,
|
|
5899
|
+
thinkingLevel: {
|
|
5900
|
+
"Fast": modelLower.includes("pro") ? ThinkingLevel.LOW : ThinkingLevel.MINIMAL,
|
|
5901
|
+
"Low": ThinkingLevel.LOW,
|
|
5902
|
+
"Medium": ThinkingLevel.MEDIUM,
|
|
5903
|
+
"High": ThinkingLevel.HIGH,
|
|
5904
|
+
"xHigh": ThinkingLevel.HIGH
|
|
5905
|
+
}[thinkingLevel] || ThinkingLevel.MEDIUM
|
|
5906
|
+
};
|
|
5907
|
+
} else {
|
|
5908
|
+
const budget = {
|
|
5909
|
+
"Fast": -1,
|
|
5910
|
+
"Low": 512,
|
|
5911
|
+
"Medium": 2048,
|
|
5912
|
+
"High": 16384,
|
|
5913
|
+
"xHigh": 24576
|
|
5914
|
+
}[thinkingLevel] || 2048;
|
|
5915
|
+
if (budget === -1) {
|
|
5916
|
+
return { includeThoughts: false };
|
|
5917
|
+
}
|
|
5918
|
+
return {
|
|
5919
|
+
includeThoughts: true,
|
|
5920
|
+
thinkingBudget: budget
|
|
5921
|
+
};
|
|
5922
|
+
}
|
|
5923
|
+
})()
|
|
5864
5924
|
}
|
|
5865
5925
|
});
|
|
5866
5926
|
if (addedMarker && contents[contents.length - 1]?.parts?.[0]) {
|
|
@@ -5878,12 +5938,40 @@ ${thinkingLevel != "Fast" ? "[SYSTEM] **STRICTLY FOLLOW THINKING POLICY AS CRITI
|
|
|
5878
5938
|
for await (const chunk of stream) {
|
|
5879
5939
|
if (TERMINATION_SIGNAL) {
|
|
5880
5940
|
yield { type: "status", content: "Termination Signal Received." };
|
|
5881
|
-
await new Promise((resolve) => setTimeout(resolve,
|
|
5941
|
+
await new Promise((resolve) => setTimeout(resolve, 1500));
|
|
5882
5942
|
break;
|
|
5883
5943
|
}
|
|
5884
|
-
|
|
5944
|
+
let chunkText = "";
|
|
5945
|
+
const parts = chunk.candidates?.[0]?.content?.parts;
|
|
5946
|
+
if (parts && parts.length > 0) {
|
|
5947
|
+
for (const part of parts) {
|
|
5948
|
+
if (part.thought) {
|
|
5949
|
+
if (part.text) {
|
|
5950
|
+
if (!inThinkingState) {
|
|
5951
|
+
chunkText += "<think>";
|
|
5952
|
+
inThinkingState = true;
|
|
5953
|
+
}
|
|
5954
|
+
chunkText += part.text;
|
|
5955
|
+
}
|
|
5956
|
+
} else if (part.text) {
|
|
5957
|
+
if (inThinkingState) {
|
|
5958
|
+
chunkText += "</think>";
|
|
5959
|
+
inThinkingState = false;
|
|
5960
|
+
}
|
|
5961
|
+
chunkText += part.text;
|
|
5962
|
+
}
|
|
5963
|
+
}
|
|
5964
|
+
} else {
|
|
5965
|
+
const t = chunk.text || "";
|
|
5966
|
+
if (t && inThinkingState) {
|
|
5967
|
+
chunkText += "</think>";
|
|
5968
|
+
inThinkingState = false;
|
|
5969
|
+
}
|
|
5970
|
+
chunkText += t;
|
|
5971
|
+
}
|
|
5972
|
+
if (chunkText) {
|
|
5885
5973
|
if (isDedupeActive) {
|
|
5886
|
-
dedupeBuffer +=
|
|
5974
|
+
dedupeBuffer += chunkText;
|
|
5887
5975
|
if (dedupeBuffer.length >= 30) {
|
|
5888
5976
|
let overlapLen = 0;
|
|
5889
5977
|
const maxPossibleOverlap = Math.min(accumulatedContext.length, dedupeBuffer.length);
|
|
@@ -5907,8 +5995,8 @@ ${thinkingLevel != "Fast" ? "[SYSTEM] **STRICTLY FOLLOW THINKING POLICY AS CRITI
|
|
|
5907
5995
|
}
|
|
5908
5996
|
continue;
|
|
5909
5997
|
} else {
|
|
5910
|
-
turnText +=
|
|
5911
|
-
yield { type: "text", content:
|
|
5998
|
+
turnText += chunkText;
|
|
5999
|
+
yield { type: "text", content: chunkText };
|
|
5912
6000
|
}
|
|
5913
6001
|
const signalSafeText3 = getSanitizedText(turnText);
|
|
5914
6002
|
const toolContext = getActiveToolContext(turnText);
|
|
@@ -5988,17 +6076,20 @@ ${thinkingLevel != "Fast" ? "[SYSTEM] **STRICTLY FOLLOW THINKING POLICY AS CRITI
|
|
|
5988
6076
|
const wordCount = thinkContent.split(/\s+/).filter((w) => w.length > 0).length;
|
|
5989
6077
|
let repetitionThresholdThinking = 0.4;
|
|
5990
6078
|
let repetitionThresholdResponse = 0.6;
|
|
5991
|
-
|
|
5992
|
-
|
|
5993
|
-
|
|
5994
|
-
|
|
5995
|
-
|
|
5996
|
-
|
|
5997
|
-
|
|
5998
|
-
|
|
5999
|
-
|
|
6079
|
+
let isOverVerboseThinking = false;
|
|
6080
|
+
if ((targetModel || "").toLowerCase().startsWith("gemma")) {
|
|
6081
|
+
const thinkingCaps = {
|
|
6082
|
+
"low": 256,
|
|
6083
|
+
"medium": 768,
|
|
6084
|
+
"high": 2048,
|
|
6085
|
+
"max": 4096,
|
|
6086
|
+
"xhigh": 4096
|
|
6087
|
+
};
|
|
6088
|
+
const cap = thinkingCaps[thinkingLevel?.toLowerCase()] || 2500;
|
|
6089
|
+
isOverVerboseThinking = wordCount > cap;
|
|
6090
|
+
}
|
|
6000
6091
|
if (repetitionRatio > repetitionThresholdThinking || isOverVerboseThinking) {
|
|
6001
|
-
const reason = repetitionRatio > repetitionThresholdThinking ? "
|
|
6092
|
+
const reason = repetitionRatio > repetitionThresholdThinking ? "Reasoning Loop Detected" : "Thinking Budget Exceeded";
|
|
6002
6093
|
yield { type: "status", content: `${reason}. Re-centering...` };
|
|
6003
6094
|
isThinkingLoop = true;
|
|
6004
6095
|
await new Promise((resolve) => setTimeout(resolve, 3e3));
|
|
@@ -6392,6 +6483,15 @@ ${boxBottom}` };
|
|
|
6392
6483
|
yield { type: "liveTokens", content: lastUsage.totalTokenCount };
|
|
6393
6484
|
}
|
|
6394
6485
|
}
|
|
6486
|
+
if (inThinkingState) {
|
|
6487
|
+
inThinkingState = false;
|
|
6488
|
+
if (isDedupeActive) {
|
|
6489
|
+
dedupeBuffer += "</think>";
|
|
6490
|
+
} else {
|
|
6491
|
+
turnText += "</think>";
|
|
6492
|
+
yield { type: "text", content: "</think>" };
|
|
6493
|
+
}
|
|
6494
|
+
}
|
|
6395
6495
|
if (isDedupeActive && dedupeBuffer.length > 0) {
|
|
6396
6496
|
let overlapLen = 0;
|
|
6397
6497
|
const maxPossibleOverlap = Math.min(accumulatedContext.length, dedupeBuffer.length);
|
|
@@ -6427,10 +6527,27 @@ ${boxBottom}` };
|
|
|
6427
6527
|
await incrementUsage("agent");
|
|
6428
6528
|
} catch (err) {
|
|
6429
6529
|
if (String(err).includes("Incomplete JSON segment at the end")) {
|
|
6530
|
+
if (inThinkingState) {
|
|
6531
|
+
inThinkingState = false;
|
|
6532
|
+
if (isDedupeActive) {
|
|
6533
|
+
dedupeBuffer += "</think>";
|
|
6534
|
+
} else {
|
|
6535
|
+
turnText += "</think>";
|
|
6536
|
+
yield { type: "text", content: "</think>" };
|
|
6537
|
+
}
|
|
6538
|
+
}
|
|
6430
6539
|
success = true;
|
|
6431
6540
|
await incrementUsage("agent");
|
|
6432
6541
|
break;
|
|
6433
6542
|
}
|
|
6543
|
+
if (inThinkingState) {
|
|
6544
|
+
inThinkingState = false;
|
|
6545
|
+
if (isDedupeActive) {
|
|
6546
|
+
dedupeBuffer += "</think>";
|
|
6547
|
+
} else {
|
|
6548
|
+
turnText += "</think>";
|
|
6549
|
+
}
|
|
6550
|
+
}
|
|
6434
6551
|
if (isDedupeActive && dedupeBuffer.length > 0) {
|
|
6435
6552
|
let overlapLen = 0;
|
|
6436
6553
|
const maxPossibleOverlap = Math.min(accumulatedContext.length, dedupeBuffer.length);
|
|
@@ -6523,7 +6640,12 @@ Error Log can be found in ${path16.join(LOGS_DIR, "agent", "error.log")}`);
|
|
|
6523
6640
|
}
|
|
6524
6641
|
}
|
|
6525
6642
|
if (lastUsage) {
|
|
6526
|
-
|
|
6643
|
+
const total = lastUsage.totalTokenCount || 0;
|
|
6644
|
+
const cached = lastUsage.cachedContentTokenCount || 0;
|
|
6645
|
+
await addToUsage("tokens", total);
|
|
6646
|
+
if (cached > 0) {
|
|
6647
|
+
await addToUsage("cachedTokens", cached);
|
|
6648
|
+
}
|
|
6527
6649
|
yield { type: "usage", content: lastUsage };
|
|
6528
6650
|
}
|
|
6529
6651
|
fullAgentResponseChunks.push(turnText);
|
|
@@ -7198,7 +7320,7 @@ function App({ args = [] }) {
|
|
|
7198
7320
|
const [tempKey, setTempKey] = useState10("");
|
|
7199
7321
|
const [activeView, setActiveView] = useState10("chat");
|
|
7200
7322
|
const [apiTier, setApiTier] = useState10("Free");
|
|
7201
|
-
const [quotas, setQuotas] = useState10({ agentLimit:
|
|
7323
|
+
const [quotas, setQuotas] = useState10({ agentLimit: 999999, backgroundLimit: 999999, searchLimit: 100, customModelId: "", customLimit: 0 });
|
|
7202
7324
|
const [inputConfig, setInputConfig] = useState10(null);
|
|
7203
7325
|
const [systemSettings, setSystemSettings] = useState10({ memory: true, compression: 0, autoExec: false, autoDeleteHistory: "7d", autoUpdate: false, updateManager: "npm", customUpdateCommand: "" });
|
|
7204
7326
|
const [profileData, setProfileData] = useState10({ name: null, nickname: null, instructions: null });
|
|
@@ -7207,6 +7329,7 @@ function App({ args = [] }) {
|
|
|
7207
7329
|
const [sessionAgentCalls, setSessionAgentCalls] = useState10(0);
|
|
7208
7330
|
const [sessionBackgroundCalls, setSessionBackgroundCalls] = useState10(0);
|
|
7209
7331
|
const [sessionTotalTokens, setSessionTotalTokens] = useState10(0);
|
|
7332
|
+
const [sessionTotalCachedTokens, setSessionTotalCachedTokens] = useState10(0);
|
|
7210
7333
|
const [sessionToolSuccess, setSessionToolSuccess] = useState10(0);
|
|
7211
7334
|
const [sessionToolFailure, setSessionToolFailure] = useState10(0);
|
|
7212
7335
|
const [sessionToolDenied, setSessionToolDenied] = useState10(0);
|
|
@@ -7220,10 +7343,23 @@ function App({ args = [] }) {
|
|
|
7220
7343
|
const [execOutput, setExecOutput] = useState10("");
|
|
7221
7344
|
const [isTerminalFocused, setIsTerminalFocused] = useState10(false);
|
|
7222
7345
|
const [tick, setTick] = useState10(0);
|
|
7346
|
+
const isFirstRender = useRef3(true);
|
|
7347
|
+
const isSecondRender = useRef3(true);
|
|
7223
7348
|
useEffect7(() => {
|
|
7349
|
+
if (isFirstRender.current) {
|
|
7350
|
+
isFirstRender.current = false;
|
|
7351
|
+
setTimeout(() => {
|
|
7352
|
+
isSecondRender.current = false;
|
|
7353
|
+
}, 2e3);
|
|
7354
|
+
return;
|
|
7355
|
+
}
|
|
7356
|
+
if (isSecondRender.current) {
|
|
7357
|
+
return;
|
|
7358
|
+
}
|
|
7224
7359
|
const s = emojiSpace(2);
|
|
7225
7360
|
if (apiTier === "Free") {
|
|
7226
7361
|
setActiveModel("gemma-4-31b-it");
|
|
7362
|
+
saveSettings({ apiTier: "Free", activeModel: "gemma-4-31b-it" });
|
|
7227
7363
|
setMessages((prev) => {
|
|
7228
7364
|
setCompletedIndex(prev.length + 1);
|
|
7229
7365
|
return [...prev, {
|
|
@@ -7235,12 +7371,13 @@ function App({ args = [] }) {
|
|
|
7235
7371
|
});
|
|
7236
7372
|
} else {
|
|
7237
7373
|
setActiveModel("gemini-3-flash-preview");
|
|
7374
|
+
saveSettings({ apiTier: "Paid", activeModel: "gemini-3-flash-preview" });
|
|
7238
7375
|
setMessages((prev) => {
|
|
7239
7376
|
setCompletedIndex(prev.length + 1);
|
|
7240
7377
|
return [...prev, {
|
|
7241
7378
|
id: "tier-switch-" + Date.now(),
|
|
7242
7379
|
role: "system",
|
|
7243
|
-
text: `\u26A0\uFE0F${s}**[TIER LIMIT]** Auto-switched to Gemini 3 Flash
|
|
7380
|
+
text: `\u26A0\uFE0F${s}**[TIER LIMIT]** Auto-switched to Gemini 3 Flash.`,
|
|
7244
7381
|
isMeta: true
|
|
7245
7382
|
}];
|
|
7246
7383
|
});
|
|
@@ -7530,7 +7667,7 @@ function App({ args = [] }) {
|
|
|
7530
7667
|
}
|
|
7531
7668
|
setShowFullThinking(saved.showFullThinking);
|
|
7532
7669
|
setApiTier(saved.apiTier || "Free");
|
|
7533
|
-
setQuotas(saved.quotas || { agentLimit:
|
|
7670
|
+
setQuotas(saved.quotas || { agentLimit: 999999, backgroundLimit: 999999, searchLimit: 100, customModelId: "", customLimit: 0 });
|
|
7534
7671
|
const freshSettings = {
|
|
7535
7672
|
memory: true,
|
|
7536
7673
|
compression: 0,
|
|
@@ -7636,10 +7773,11 @@ function App({ args = [] }) {
|
|
|
7636
7773
|
showFullThinking,
|
|
7637
7774
|
systemSettings,
|
|
7638
7775
|
profileData,
|
|
7639
|
-
imageSettings
|
|
7776
|
+
imageSettings,
|
|
7777
|
+
apiTier
|
|
7640
7778
|
});
|
|
7641
7779
|
}
|
|
7642
|
-
}, [mode, thinkingLevel, activeModel, showFullThinking, systemSettings, profileData, imageSettings, isInitializing, parsedArgs]);
|
|
7780
|
+
}, [mode, thinkingLevel, activeModel, showFullThinking, systemSettings, profileData, imageSettings, isInitializing, parsedArgs, apiTier]);
|
|
7643
7781
|
const handleSetup = async (val) => {
|
|
7644
7782
|
const key = val.trim();
|
|
7645
7783
|
if (key.length >= 30) {
|
|
@@ -7748,20 +7886,36 @@ function App({ args = [] }) {
|
|
|
7748
7886
|
},
|
|
7749
7887
|
{
|
|
7750
7888
|
cmd: "/model",
|
|
7751
|
-
desc: "Switch
|
|
7889
|
+
desc: "Switch Model for Agent",
|
|
7752
7890
|
subs: apiTier === "Free" ? [
|
|
7753
7891
|
{
|
|
7754
7892
|
cmd: "gemma-4-31b-it",
|
|
7755
7893
|
desc: "Standard Default"
|
|
7894
|
+
},
|
|
7895
|
+
{
|
|
7896
|
+
cmd: "gemini-3-flash-preview",
|
|
7897
|
+
desc: "Fast & Lightweight (Limited Free Quota)"
|
|
7898
|
+
},
|
|
7899
|
+
{
|
|
7900
|
+
cmd: "gemini-3.5-flash",
|
|
7901
|
+
desc: "Flash Latest (Limited Free Quota) [Instability Issues]"
|
|
7756
7902
|
}
|
|
7757
7903
|
] : [
|
|
7904
|
+
{
|
|
7905
|
+
cmd: "gemini-3.1-flash-lite",
|
|
7906
|
+
desc: "Ultra-Fast & Lite"
|
|
7907
|
+
},
|
|
7758
7908
|
{
|
|
7759
7909
|
cmd: "gemini-3-flash-preview",
|
|
7760
|
-
desc: "Fast & Lightweight"
|
|
7910
|
+
desc: "Default, Fast & Lightweight"
|
|
7761
7911
|
},
|
|
7762
7912
|
{
|
|
7763
7913
|
cmd: "gemini-3.5-flash",
|
|
7764
|
-
desc: "Latest"
|
|
7914
|
+
desc: "Flash Latest [Instability Issues]"
|
|
7915
|
+
},
|
|
7916
|
+
{
|
|
7917
|
+
cmd: "gemini-3.1-pro-preview",
|
|
7918
|
+
desc: "Pro Reasoning"
|
|
7765
7919
|
}
|
|
7766
7920
|
]
|
|
7767
7921
|
},
|
|
@@ -8546,6 +8700,15 @@ Selection: ${val}`,
|
|
|
8546
8700
|
if (packet.type === "interactive_turn_finished") {
|
|
8547
8701
|
setIsProcessing(false);
|
|
8548
8702
|
hasFiredJanitor = true;
|
|
8703
|
+
setMessages((prev) => {
|
|
8704
|
+
const aiHistory = packet.data.history;
|
|
8705
|
+
return prev.map((msg, idx) => {
|
|
8706
|
+
if (aiHistory[idx]) {
|
|
8707
|
+
return { ...msg, fullText: aiHistory[idx].text };
|
|
8708
|
+
}
|
|
8709
|
+
return msg;
|
|
8710
|
+
});
|
|
8711
|
+
});
|
|
8549
8712
|
runJanitorTask(
|
|
8550
8713
|
{ profile: profileData, thinkingLevel, mode, janitorModel, chatId, systemSettings, sessionStats },
|
|
8551
8714
|
packet.data.agentText,
|
|
@@ -8580,8 +8743,12 @@ Selection: ${val}`,
|
|
|
8580
8743
|
}
|
|
8581
8744
|
if (packet.type === "usage") {
|
|
8582
8745
|
const total = packet.content.totalTokenCount || 0;
|
|
8746
|
+
const cached = packet.content.cachedContentTokenCount || 0;
|
|
8583
8747
|
setSessionStats({ tokens: total });
|
|
8584
8748
|
setSessionTotalTokens((prev) => prev + total);
|
|
8749
|
+
if (cached > 0) {
|
|
8750
|
+
setSessionTotalCachedTokens((prev) => prev + cached);
|
|
8751
|
+
}
|
|
8585
8752
|
setSessionAgentCalls((prev) => prev + 1);
|
|
8586
8753
|
continue;
|
|
8587
8754
|
}
|
|
@@ -8689,13 +8856,13 @@ Selection: ${val}`,
|
|
|
8689
8856
|
currentThinkId = "think-" + Date.now();
|
|
8690
8857
|
setMessages((prev) => [...prev, { id: currentThinkId, role: "think", text: "", isStreaming: true, startTime: Date.now() }]);
|
|
8691
8858
|
}
|
|
8692
|
-
if (chunkLower.includes("</think>") || chunkLower.includes("</thought>")) {
|
|
8859
|
+
if ((chunkLower.includes("</think>") || chunkLower.includes("</thought>")) && currentThinkId) {
|
|
8693
8860
|
const parts = chunkText.split(/<\/(think|thought)>/gi);
|
|
8694
8861
|
const thinkPart = parts[0] || "";
|
|
8695
8862
|
const agentPart = parts.slice(2).join("").replace(/<\/?(think|thought)>/gi, "");
|
|
8696
8863
|
setMessages((prev) => {
|
|
8697
8864
|
const newMsgs = prev.map((m) => {
|
|
8698
|
-
if (m.id === currentThinkId) {
|
|
8865
|
+
if (m.id === currentThinkId && typeof m.id === "string") {
|
|
8699
8866
|
const startTime = m.startTime || parseInt(m.id.split("-")[1]) || Date.now();
|
|
8700
8867
|
const duration = Date.now() - startTime;
|
|
8701
8868
|
return { ...m, text: m.text + thinkPart, isStreaming: false, duration };
|
|
@@ -8868,10 +9035,10 @@ Selection: ${val}`,
|
|
|
8868
9035
|
return /* @__PURE__ */ React13.createElement(
|
|
8869
9036
|
CommandMenu,
|
|
8870
9037
|
{
|
|
8871
|
-
title:
|
|
9038
|
+
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
9039
|
items: [
|
|
8873
|
-
{ label: "Free Tier (Gemini API Free Tier
|
|
8874
|
-
{ label: `
|
|
9040
|
+
{ label: "Free Tier (Gemini API Free Tier)", value: "Free" },
|
|
9041
|
+
{ label: `Paid Tier (API with Billing Account)`, value: "Paid" },
|
|
8875
9042
|
{ label: "Back", value: "settings" }
|
|
8876
9043
|
],
|
|
8877
9044
|
onSelect: (item) => {
|
|
@@ -8881,9 +9048,9 @@ Selection: ${val}`,
|
|
|
8881
9048
|
}
|
|
8882
9049
|
const newTier = item.value;
|
|
8883
9050
|
setApiTier(newTier);
|
|
8884
|
-
if (newTier === "
|
|
9051
|
+
if (newTier === "Paid") {
|
|
8885
9052
|
setInputConfig({
|
|
8886
|
-
label: "Enter Agent daily
|
|
9053
|
+
label: "Enter Agent daily budget (requests made):",
|
|
8887
9054
|
key: "quotas",
|
|
8888
9055
|
subKey: "agentLimit",
|
|
8889
9056
|
value: String(quotas.agentLimit)
|
|
@@ -8957,7 +9124,7 @@ Selection: ${val}`,
|
|
|
8957
9124
|
}
|
|
8958
9125
|
)), /* @__PURE__ */ React13.createElement(Box13, { paddingX: 1, marginTop: 1 }, /* @__PURE__ */ React13.createElement(Text13, { color: "gray", dimColor: true, italic: true }, "(Press Enter to confirm selection)")));
|
|
8959
9126
|
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" }, "
|
|
9127
|
+
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
9128
|
case "autoExecDanger":
|
|
8962
9129
|
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
9130
|
CommandMenu,
|
|
@@ -9339,7 +9506,7 @@ Selection: ${val}`,
|
|
|
9339
9506
|
showFullThinking,
|
|
9340
9507
|
columns: Math.max(20, (stdout?.columns || 80) - 1)
|
|
9341
9508
|
}
|
|
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(
|
|
9509
|
+
), 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
9510
|
TextInput4,
|
|
9344
9511
|
{
|
|
9345
9512
|
value: tempKey,
|
|
@@ -9355,7 +9522,8 @@ Selection: ${val}`,
|
|
|
9355
9522
|
tokens: sessionStats.tokens,
|
|
9356
9523
|
tokensTotal: sessionStats.tokens,
|
|
9357
9524
|
chatId,
|
|
9358
|
-
isMemoryEnabled: systemSettings.memory
|
|
9525
|
+
isMemoryEnabled: systemSettings.memory,
|
|
9526
|
+
apiTier
|
|
9359
9527
|
}
|
|
9360
9528
|
)), activeView === "exit" && (() => {
|
|
9361
9529
|
const wallTimeMs = Date.now() - SESSION_START_TIME;
|
|
@@ -9364,7 +9532,7 @@ Selection: ${val}`,
|
|
|
9364
9532
|
const agentActiveMs = sessionApiTime + sessionToolTime;
|
|
9365
9533
|
const apiPercent = agentActiveMs > 0 ? (sessionApiTime / agentActiveMs * 100).toFixed(1) : "0.0";
|
|
9366
9534
|
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" }, "
|
|
9535
|
+
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
9536
|
})(), suggestions.length > 0 && (() => {
|
|
9369
9537
|
const windowSize = 5;
|
|
9370
9538
|
const startIdx = Math.max(0, Math.min(selectedIndex - 2, suggestions.length - windowSize));
|
|
@@ -9380,7 +9548,7 @@ Selection: ${val}`,
|
|
|
9380
9548
|
paddingY: 0,
|
|
9381
9549
|
width: "100%"
|
|
9382
9550
|
},
|
|
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("@")
|
|
9551
|
+
/* @__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
9552
|
visible.map((s, i) => {
|
|
9385
9553
|
const actualIdx = startIdx + i;
|
|
9386
9554
|
const isActive = actualIdx === selectedIndex;
|