fluxflow-cli 1.18.12 → 1.18.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/fluxflow.js +198 -50
- package/package.json +2 -2
package/dist/fluxflow.js
CHANGED
|
@@ -442,13 +442,20 @@ var init_TerminalBox = __esm({
|
|
|
442
442
|
TerminalBox = React2.memo(({ command, output, completed = false, isFocused = false, columns = 80, isPty = false }) => {
|
|
443
443
|
const processPTY = (text) => {
|
|
444
444
|
if (!text) return "";
|
|
445
|
-
const
|
|
445
|
+
const screenResetRegex = /\x1b\[H|\x1b\[2J|\x1b\[3J|\x1bc/g;
|
|
446
|
+
const resetMatches = [...text.matchAll(screenResetRegex)];
|
|
447
|
+
let workingText = text;
|
|
448
|
+
if (resetMatches.length > 0) {
|
|
449
|
+
const lastMatch = resetMatches[resetMatches.length - 1];
|
|
450
|
+
workingText = text.substring(lastMatch.index + lastMatch[0].length);
|
|
451
|
+
}
|
|
452
|
+
const noTrailingCr = workingText.replace(/\r+\n/g, "\n");
|
|
446
453
|
return noTrailingCr.split("\n").map((line) => {
|
|
447
454
|
const parts = line.split("\r");
|
|
448
455
|
return parts[parts.length - 1];
|
|
449
456
|
}).join("\n");
|
|
450
457
|
};
|
|
451
|
-
const cleanOutput = isPty ?
|
|
458
|
+
const cleanOutput = isPty ? output || "" : (output || "").replace(/\r\n/g, "\n").replace(/\n{3,}/g, "\n\n");
|
|
452
459
|
const displayOutput = isPty ? cleanOutput : cleanOutput ? wrapText(cleanOutput, columns - 6) : "";
|
|
453
460
|
return /* @__PURE__ */ React2.createElement(Box2, { flexDirection: "column", borderStyle: isFocused ? "double" : "round", borderColor: completed ? "#334155" : isFocused ? "yellow" : "cyan", paddingX: 2, paddingY: completed ? 0 : 1, width: "100%" }, /* @__PURE__ */ React2.createElement(Box2, { marginBottom: 1, justifyContent: "space-between", width: "100%" }, /* @__PURE__ */ React2.createElement(Box2, { flexShrink: 1, paddingRight: 2 }, /* @__PURE__ */ React2.createElement(Text2, null, /* @__PURE__ */ React2.createElement(Text2, { color: completed ? "gray" : isFocused ? "yellow" : "cyan", bold: true }, completed ? "\u{1F3C1} FINISHED:" : "\u26A1 EXECUTING:", " "), /* @__PURE__ */ React2.createElement(Text2, { color: completed ? "gray" : "white" }, command))), isPty && /* @__PURE__ */ React2.createElement(Box2, { flexShrink: 0, paddingX: 1 }, /* @__PURE__ */ React2.createElement(Text2, { color: completed ? "gray" : "magenta", bold: true }, "ADVANCE"))), displayOutput ? /* @__PURE__ */ React2.createElement(Box2, { marginTop: completed ? 0 : 1, backgroundColor: isPty ? void 0 : "#0a0a0a", paddingX: 1 }, /* @__PURE__ */ React2.createElement(Text2, { color: completed ? "gray" : void 0 }, displayOutput)) : !completed && /* @__PURE__ */ React2.createElement(Box2, { marginTop: 1, backgroundColor: isPty ? void 0 : "#0a0a0a", paddingX: 1 }, /* @__PURE__ */ React2.createElement(Text2, { color: "gray", italic: true }, "Waiting for output...")), /* @__PURE__ */ React2.createElement(Box2, { justifyContent: "space-between", marginTop: 1 }, !completed ? /* @__PURE__ */ React2.createElement(Text2, { color: "gray", dimColor: true, italic: true }, isFocused ? "Press TAB to unfocus, then double-press ESC to terminate." : "Double-press ESC to terminate if hanging.") : /* @__PURE__ */ React2.createElement(Box2, null), /* @__PURE__ */ React2.createElement(Text2, { color: completed ? "#475569" : isFocused ? "yellow" : "cyan", bold: true }, completed ? "\u25CF ARCHIVED" : isFocused ? "\u25B6 TERMINAL FOCUSED" : "\u25CF LIVE (Press TAB to focus)")));
|
|
454
461
|
});
|
|
@@ -1138,6 +1145,7 @@ var init_main_tools = __esm({
|
|
|
1138
1145
|
Access to internal tools. To call a tool, MUST use the exact syntax on a new line: [tool:functions.ToolName(args)]
|
|
1139
1146
|
STRICT POLICY
|
|
1140
1147
|
- **MAX 3 TOOL CALLS PER TURN. Next Turn, verify results, plan next**${mode === "Flux" ? "\n- **File Tools >> Code in chat**" : ""}
|
|
1148
|
+
- Use contexual BEST tools, no brute forcing
|
|
1141
1149
|
|
|
1142
1150
|
- COMMUNICATION TOOLS -
|
|
1143
1151
|
1. [tool:functions.Ask(question="...", optionA="option::description", ...MAX 4)]. Ambiguity Resolution. Mandatory Triggers: Path Divergence, Security, Risk Mitigation. ask >> finish
|
|
@@ -1544,7 +1552,7 @@ ${cleanOut}`), 500);
|
|
|
1544
1552
|
if (isResolved) return;
|
|
1545
1553
|
activeChildProcess = null;
|
|
1546
1554
|
const normalizedOutput = (output || "").replace(/\r\n/g, "\n").replace(/\r/g, "\n");
|
|
1547
|
-
const finalOutput = stripAnsi(normalizedOutput) || "Command executed with no output.";
|
|
1555
|
+
const finalOutput = stripAnsi(normalizedOutput).replace(/\n{3,}/g, "\n\n") || "Command executed with no output.";
|
|
1548
1556
|
if (exitCode !== 0) {
|
|
1549
1557
|
resolve(`ERROR: Command [${rawCommand}] failed with exit code [${exitCode}].
|
|
1550
1558
|
|
|
@@ -1633,7 +1641,7 @@ ${stdout}`);
|
|
|
1633
1641
|
${stderr}`);
|
|
1634
1642
|
if (code !== 0) result.push(`EXIT CODE: ${code}`);
|
|
1635
1643
|
const rawOutput = result.join("\n\n") || "Command executed with no output.";
|
|
1636
|
-
const finalOutput = stripAnsi(rawOutput);
|
|
1644
|
+
const finalOutput = stripAnsi(rawOutput).replace(/\n{3,}/g, "\n\n");
|
|
1637
1645
|
if (code !== 0) {
|
|
1638
1646
|
resolve(`ERROR: Command [${rawCommand}] failed with exit code [${code}].
|
|
1639
1647
|
|
|
@@ -2414,8 +2422,8 @@ ${foundFiles.map((f) => `- ${f.name}: ${f.desc}`).join("\n")}
|
|
|
2414
2422
|
Check these first; These Files > Training Data. Safety rules apply
|
|
2415
2423
|
` : "";
|
|
2416
2424
|
return `${nameStr}${nicknameStr}${userInstrStr}[SYSTEM]
|
|
2417
|
-
Identity: Flux Flow (by Kushal Roy Chowdhury). Sassy${mode === "Flux" ? ",
|
|
2418
|
-
Mode: ${mode}${thinkingLevel !== "Fast" ? " (Thinking Mode)" : ""}. ${mode === "Flux" ? "Logical, Highly Detailed, Task-Driven. Prioritizes scalable file/folder structures, modular architecture, clean code abstractions, step-by-step execution. Industry standard latest coding practices/libraries, clean code, Double Check Imports, Client-Server Sync" : "
|
|
2425
|
+
Identity: Flux Flow (by Kushal Roy Chowdhury). Conversational, Sassy${mode === "Flux" ? ", Respectful" : ", Friendly, Humorous, Sarcastic"}, CLI Agent
|
|
2426
|
+
Mode: ${mode}${thinkingLevel !== "Fast" ? " (Thinking Mode)" : ""}. ${mode === "Flux" ? "Logical, Highly Detailed, Task-Driven. Prioritizes scalable file/folder structures, modular architecture, clean code abstractions, step-by-step execution. Industry standard latest coding practices/libraries, clean code, Double Check Imports, Client-Server Sync" : "Concise"}
|
|
2419
2427
|
|
|
2420
2428
|
-- AGENT LOOP RULES (PRIORITY: HIGH) --
|
|
2421
2429
|
- **MUST END WITH [turn: continue] to CONTINUE loop OR [turn: finish] to END loop**
|
|
@@ -5373,7 +5381,159 @@ ${newMemoryListStr}
|
|
|
5373
5381
|
const isContext32k = (sessionStats?.tokens || 0) >= 32e3;
|
|
5374
5382
|
const memoryPrompt = getMemoryPrompt(otherMemories, mainUserMemories, isMemoryEnabled, isContext32k);
|
|
5375
5383
|
const dateTimeStr = (/* @__PURE__ */ new Date()).toLocaleString([], { year: "numeric", month: "numeric", day: "numeric", hour: "2-digit", minute: "2-digit", hour12: true });
|
|
5376
|
-
const COLLAPSED_DIRS_GLOBAL = [
|
|
5384
|
+
const COLLAPSED_DIRS_GLOBAL = [
|
|
5385
|
+
// --- The OG Clutter ---
|
|
5386
|
+
".git",
|
|
5387
|
+
"node_modules",
|
|
5388
|
+
".gemini",
|
|
5389
|
+
"dist",
|
|
5390
|
+
"build",
|
|
5391
|
+
".next",
|
|
5392
|
+
"out",
|
|
5393
|
+
".cache",
|
|
5394
|
+
"bin",
|
|
5395
|
+
"obj",
|
|
5396
|
+
"vendor",
|
|
5397
|
+
"venv",
|
|
5398
|
+
".idea",
|
|
5399
|
+
".gradle",
|
|
5400
|
+
".terraform",
|
|
5401
|
+
"target",
|
|
5402
|
+
"coverage",
|
|
5403
|
+
".vscode",
|
|
5404
|
+
// --- Version Control, Monorepos & CI/CD ---
|
|
5405
|
+
".svn",
|
|
5406
|
+
".hg",
|
|
5407
|
+
".fslckout",
|
|
5408
|
+
".github",
|
|
5409
|
+
".gitlab",
|
|
5410
|
+
".circleci",
|
|
5411
|
+
".gitea",
|
|
5412
|
+
".gitee",
|
|
5413
|
+
".lerna",
|
|
5414
|
+
".changeset",
|
|
5415
|
+
".nx",
|
|
5416
|
+
// --- JS / TS / Web Dev Armageddon ---
|
|
5417
|
+
".npm",
|
|
5418
|
+
".yarn",
|
|
5419
|
+
".pnpm-store",
|
|
5420
|
+
".expo",
|
|
5421
|
+
".nuxt",
|
|
5422
|
+
".svelte-kit",
|
|
5423
|
+
".docusaurus",
|
|
5424
|
+
".turbo",
|
|
5425
|
+
".vercel",
|
|
5426
|
+
"bower_components",
|
|
5427
|
+
".netlify",
|
|
5428
|
+
".vuepress",
|
|
5429
|
+
".quasar",
|
|
5430
|
+
".output",
|
|
5431
|
+
".angular",
|
|
5432
|
+
"jspm_packages",
|
|
5433
|
+
".parcel-cache",
|
|
5434
|
+
".rollup.cache",
|
|
5435
|
+
".rspack",
|
|
5436
|
+
".vitepress",
|
|
5437
|
+
// --- Python & Data Science Brain Melting ---
|
|
5438
|
+
"__pycache__",
|
|
5439
|
+
".pytest_cache",
|
|
5440
|
+
".mypy_cache",
|
|
5441
|
+
".tox",
|
|
5442
|
+
".poetry",
|
|
5443
|
+
"env",
|
|
5444
|
+
"vhdl",
|
|
5445
|
+
".ipynb_checkpoints",
|
|
5446
|
+
".jupyter",
|
|
5447
|
+
".conda",
|
|
5448
|
+
".pdm-build",
|
|
5449
|
+
// --- Ruby / PHP / Go / Rust / Java / C++ / C# ---
|
|
5450
|
+
".bundle",
|
|
5451
|
+
".yardoc",
|
|
5452
|
+
".metadata",
|
|
5453
|
+
"App_Data",
|
|
5454
|
+
"ClientBin",
|
|
5455
|
+
".cargo",
|
|
5456
|
+
".rustc_info",
|
|
5457
|
+
".go",
|
|
5458
|
+
"Godeps",
|
|
5459
|
+
"_vendor",
|
|
5460
|
+
".rake_tasks",
|
|
5461
|
+
"CMakefiles",
|
|
5462
|
+
".wakatime",
|
|
5463
|
+
// --- Mobile Dev Madness (Android / iOS / Flutter) ---
|
|
5464
|
+
".dart_tool",
|
|
5465
|
+
".fvm",
|
|
5466
|
+
".cocoapods",
|
|
5467
|
+
"Pods",
|
|
5468
|
+
".pub-cache",
|
|
5469
|
+
".symlinks",
|
|
5470
|
+
"DerivedData",
|
|
5471
|
+
".xcworkspace",
|
|
5472
|
+
// --- Containers, Cloud & Database Dumps ---
|
|
5473
|
+
".serverless",
|
|
5474
|
+
".aws",
|
|
5475
|
+
".gcloud",
|
|
5476
|
+
".azure",
|
|
5477
|
+
".kube",
|
|
5478
|
+
".vagrant",
|
|
5479
|
+
".docker",
|
|
5480
|
+
"postgres-data",
|
|
5481
|
+
"redis-data",
|
|
5482
|
+
"mongo-data",
|
|
5483
|
+
// --- OS & System Trash (The Ultimate Sinners) ---
|
|
5484
|
+
".Spotlight-V100",
|
|
5485
|
+
".Trashes",
|
|
5486
|
+
"$RECYCLE.BIN",
|
|
5487
|
+
"System Volume Information",
|
|
5488
|
+
".DocumentRevisions-V100",
|
|
5489
|
+
".fseventsd",
|
|
5490
|
+
// --- Windows AppData & System Clutter ---
|
|
5491
|
+
"AppData",
|
|
5492
|
+
"Application Data",
|
|
5493
|
+
"Local",
|
|
5494
|
+
"LocalLow",
|
|
5495
|
+
"Roaming",
|
|
5496
|
+
"$WinREAgent",
|
|
5497
|
+
"$WINDOWS.~BT",
|
|
5498
|
+
"$WINDOWS.~WS",
|
|
5499
|
+
"scw",
|
|
5500
|
+
"System32",
|
|
5501
|
+
"SysWOW64",
|
|
5502
|
+
// --- macOS Specific Garbage ---
|
|
5503
|
+
".AppleDouble",
|
|
5504
|
+
".AppleDB",
|
|
5505
|
+
".AppleDesktop",
|
|
5506
|
+
"_CodeSignature",
|
|
5507
|
+
".cmio",
|
|
5508
|
+
".LSOverride",
|
|
5509
|
+
".localized",
|
|
5510
|
+
".TemporaryItems",
|
|
5511
|
+
// --- Linux / Desktop Environment Junk ---
|
|
5512
|
+
".Trash",
|
|
5513
|
+
".Trash-0",
|
|
5514
|
+
".Trash-1000",
|
|
5515
|
+
".gvfs",
|
|
5516
|
+
".local",
|
|
5517
|
+
".config",
|
|
5518
|
+
".dbus",
|
|
5519
|
+
".fontconfig",
|
|
5520
|
+
".snap",
|
|
5521
|
+
".var",
|
|
5522
|
+
".lost+found",
|
|
5523
|
+
"lost+found",
|
|
5524
|
+
".thumb",
|
|
5525
|
+
".thumbnails",
|
|
5526
|
+
// --- Dual-Boot / Bootloader Stuff ---
|
|
5527
|
+
"EFI",
|
|
5528
|
+
"boot",
|
|
5529
|
+
"grub",
|
|
5530
|
+
// --- Linters, Formatters, Logs & QA ---
|
|
5531
|
+
"logs",
|
|
5532
|
+
"log",
|
|
5533
|
+
".nyc_output",
|
|
5534
|
+
".sonar",
|
|
5535
|
+
".ruff_cache"
|
|
5536
|
+
];
|
|
5377
5537
|
const safeReaddirWithTypes = (dir) => {
|
|
5378
5538
|
try {
|
|
5379
5539
|
return fs16.readdirSync(dir, { withFileTypes: true });
|
|
@@ -5449,13 +5609,16 @@ ${newMemoryListStr}
|
|
|
5449
5609
|
yield { type: "status", content: "Gathering Context..." };
|
|
5450
5610
|
await new Promise((resolve) => setTimeout(resolve, 500));
|
|
5451
5611
|
const totalFolders = countFolders(process.cwd());
|
|
5452
|
-
let dynamicMaxDepth =
|
|
5612
|
+
let dynamicMaxDepth = 12;
|
|
5453
5613
|
if (totalFolders > 4096) dynamicMaxDepth = 1;
|
|
5454
5614
|
else if (totalFolders > 3072) dynamicMaxDepth = 2;
|
|
5455
5615
|
else if (totalFolders > 2048) dynamicMaxDepth = 3;
|
|
5456
5616
|
else if (totalFolders > 1024) dynamicMaxDepth = 4;
|
|
5457
5617
|
else if (totalFolders > 512) dynamicMaxDepth = 6;
|
|
5458
5618
|
else if (totalFolders > 256) dynamicMaxDepth = 7;
|
|
5619
|
+
else if (totalFolders > 128) dynamicMaxDepth = 8;
|
|
5620
|
+
else if (totalFolders > 64) dynamicMaxDepth = 9;
|
|
5621
|
+
else if (totalFolders > 32) dynamicMaxDepth = 10;
|
|
5459
5622
|
let dirStructure = totalFolders > 6144 ? `FileSystem length exceeded for indexing` : process.cwd() + "\n" + getDirTree(process.cwd(), dynamicMaxDepth);
|
|
5460
5623
|
const firstUserMsg = `[SYSTEM METADATA (PRIORITY: DYNAMIC)] Time: ${dateTimeStr} | v${versionFluxflow2}
|
|
5461
5624
|
CWD: ${process.cwd()}
|
|
@@ -6499,6 +6662,7 @@ var init_UpdateProcessor = __esm({
|
|
|
6499
6662
|
try {
|
|
6500
6663
|
const ptyModule = await import("node-pty");
|
|
6501
6664
|
pty2 = ptyModule.default || ptyModule;
|
|
6665
|
+
pty2 = false;
|
|
6502
6666
|
} catch (err) {
|
|
6503
6667
|
}
|
|
6504
6668
|
SPINNER_FRAMES = ["\u280B", "\u2819", "\u2839", "\u2838", "\u283C", "\u2834", "\u2826", "\u2827", "\u2807", "\u280F"];
|
|
@@ -6623,10 +6787,10 @@ var init_UpdateProcessor = __esm({
|
|
|
6623
6787
|
}, []);
|
|
6624
6788
|
if (status === "initializing" || status === "downloading") {
|
|
6625
6789
|
const frame = SPINNER_FRAMES[Math.floor(tick / 3) % SPINNER_FRAMES.length];
|
|
6626
|
-
return /* @__PURE__ */ React11.createElement(Box11, { flexDirection: "column", borderStyle: "round", borderColor: "cyan", paddingX: 2, paddingY: 1 }, /* @__PURE__ */ React11.createElement(Box11, null, /* @__PURE__ */ React11.createElement(Text11, { color: "magenta" }, frame), /* @__PURE__ */ React11.createElement(Text11, { marginLeft: 1, bold: true }, " Updating Flux Flow to v", latest, "...")), /* @__PURE__ */ React11.createElement(Box11, { marginTop: 1, paddingX: 1, borderStyle: "single", borderColor: "#333" }, /* @__PURE__ */ React11.createElement(Text11, { color: "gray",
|
|
6790
|
+
return /* @__PURE__ */ React11.createElement(Box11, { flexDirection: "column", borderStyle: "round", borderColor: "cyan", paddingX: 2, paddingY: 1 }, /* @__PURE__ */ React11.createElement(Box11, null, /* @__PURE__ */ React11.createElement(Text11, { color: "magenta" }, frame), /* @__PURE__ */ React11.createElement(Text11, { marginLeft: 1, bold: true }, " Updating Flux Flow to v", latest, "...")), /* @__PURE__ */ React11.createElement(Box11, { marginTop: 1, paddingX: 1, borderStyle: "single", borderColor: "#333" }, /* @__PURE__ */ React11.createElement(Text11, { color: "gray", italic: true }, log || "Preparing environment...")), /* @__PURE__ */ React11.createElement(Text11, { marginTop: 1, dimColor: true }, "(Please do not close the terminal)"));
|
|
6627
6791
|
}
|
|
6628
6792
|
if (status === "success") {
|
|
6629
|
-
return /* @__PURE__ */ React11.createElement(Box11, { flexDirection: "column", borderStyle: "round", borderColor: "green", paddingX: 2, paddingY: 1 }, /* @__PURE__ */ React11.createElement(Text11, { color: "green", bold: true }, "\u2705 UPDATE SUCCESSFUL!"), /* @__PURE__ */ React11.createElement(Text11, { marginTop: 1 }, "Flux Flow has been updated to ", /* @__PURE__ */ React11.createElement(Text11, { color: "cyan" }, "v", latest), "."), /* @__PURE__ */ React11.createElement(Text11, { marginTop: 1, color: "yellow", bold: true }, "
|
|
6793
|
+
return /* @__PURE__ */ React11.createElement(Box11, { flexDirection: "column", borderStyle: "round", borderColor: "green", paddingX: 2, paddingY: 1 }, /* @__PURE__ */ React11.createElement(Text11, { color: "green", bold: true }, "\u2705 UPDATE SUCCESSFUL!"), /* @__PURE__ */ React11.createElement(Text11, { marginTop: 1 }, "Flux Flow has been updated to ", /* @__PURE__ */ React11.createElement(Text11, { color: "cyan" }, "v", latest), "."), /* @__PURE__ */ React11.createElement(Text11, { marginTop: 1, color: "yellow", bold: true }, "Please restart your terminal session to apply changes."), /* @__PURE__ */ React11.createElement(Box11, { marginTop: 1 }, /* @__PURE__ */ React11.createElement(Text11, { dimColor: true }, "(Press ESC to return to chat)")));
|
|
6630
6794
|
}
|
|
6631
6795
|
if (status === "error") {
|
|
6632
6796
|
return /* @__PURE__ */ React11.createElement(Box11, { flexDirection: "column", borderStyle: "round", borderColor: "red", paddingX: 2, paddingY: 1 }, /* @__PURE__ */ React11.createElement(Text11, { color: "red", bold: true }, "\u274C UPDATE FAILED"), /* @__PURE__ */ React11.createElement(Box11, { marginTop: 1, paddingX: 1, borderStyle: "single", borderColor: "red" }, /* @__PURE__ */ React11.createElement(Text11, { color: "red" }, error)), /* @__PURE__ */ React11.createElement(Text11, { marginTop: 1 }, "Possible causes:"), /* @__PURE__ */ React11.createElement(Text11, null, "\u2022 Missing permissions (Try running as Administrator/Sudo)"), /* @__PURE__ */ React11.createElement(Text11, null, "\u2022 Package manager (", settings.updateManager, ") not found"), /* @__PURE__ */ React11.createElement(Text11, null, "\u2022 Network failure"), /* @__PURE__ */ React11.createElement(Box11, { marginTop: 1 }, /* @__PURE__ */ React11.createElement(Text11, { dimColor: true }, "(Press ESC to return to chat)")));
|
|
@@ -7063,14 +7227,8 @@ function App({ args = [] }) {
|
|
|
7063
7227
|
const isTerminalWaitingForInput = useMemo2(() => {
|
|
7064
7228
|
if (!activeCommand || !execOutput) return false;
|
|
7065
7229
|
const lastChunk = execOutput.trim();
|
|
7066
|
-
return lastChunk.endsWith("?") || lastChunk.endsWith(":") || /\[[yYnN/]+\]\s*$/.test(lastChunk);
|
|
7230
|
+
return lastChunk.endsWith("?") || lastChunk.endsWith(":") || /\[[yYnN/]+\]\s*$/.test(lastChunk) || /\([yYnN]\)\s*$/.test(lastChunk);
|
|
7067
7231
|
}, [activeCommand, execOutput]);
|
|
7068
|
-
const terminalWidth = stdout?.columns || 80;
|
|
7069
|
-
const wrapWidth = Math.max(20, terminalWidth - 10);
|
|
7070
|
-
const wrappedLinesCount = input.split(/\r?\n/).reduce((acc, line) => {
|
|
7071
|
-
return acc + Math.max(1, Math.ceil(line.length / wrapWidth));
|
|
7072
|
-
}, 0);
|
|
7073
|
-
const maxLines = Math.max(1, wrappedLinesCount);
|
|
7074
7232
|
useInput7((inputText, key) => {
|
|
7075
7233
|
if (key.tab && activeCommand) {
|
|
7076
7234
|
setIsTerminalFocused((prev) => !prev);
|
|
@@ -7111,16 +7269,6 @@ function App({ args = [] }) {
|
|
|
7111
7269
|
}
|
|
7112
7270
|
return;
|
|
7113
7271
|
}
|
|
7114
|
-
if (maxLines > 2 && !isExpanded && activeView === "chat") {
|
|
7115
|
-
if (key.backspace || key.delete) {
|
|
7116
|
-
setInput("");
|
|
7117
|
-
return;
|
|
7118
|
-
}
|
|
7119
|
-
if (key.return) {
|
|
7120
|
-
setIsExpanded(true);
|
|
7121
|
-
return;
|
|
7122
|
-
}
|
|
7123
|
-
}
|
|
7124
7272
|
if (key.escape) {
|
|
7125
7273
|
if (suggestions.length > 0 && activeView === "chat") {
|
|
7126
7274
|
setIsFilePickerDismissed(true);
|
|
@@ -8098,7 +8246,14 @@ ${timestamp}` };
|
|
|
8098
8246
|
const rawOutput = execOutputRef.current || "";
|
|
8099
8247
|
let normalizedOutput = "";
|
|
8100
8248
|
if (isActiveCommandPty) {
|
|
8101
|
-
const
|
|
8249
|
+
const screenResetRegex = /\x1b\[H|\x1b\[2J|\x1b\[3J|\x1bc/g;
|
|
8250
|
+
const resetMatches = [...rawOutput.matchAll(screenResetRegex)];
|
|
8251
|
+
let workingText = rawOutput;
|
|
8252
|
+
if (resetMatches.length > 0) {
|
|
8253
|
+
const lastMatch = resetMatches[resetMatches.length - 1];
|
|
8254
|
+
workingText = rawOutput.substring(lastMatch.index + lastMatch[0].length);
|
|
8255
|
+
}
|
|
8256
|
+
const noTrailingCr = workingText.replace(/\r+\n/g, "\n");
|
|
8102
8257
|
normalizedOutput = noTrailingCr.split("\n").map((line) => {
|
|
8103
8258
|
const parts = line.split("\r");
|
|
8104
8259
|
return parts[parts.length - 1];
|
|
@@ -8106,11 +8261,21 @@ ${timestamp}` };
|
|
|
8106
8261
|
} else {
|
|
8107
8262
|
normalizedOutput = rawOutput.replace(/\r\n/g, "\n");
|
|
8108
8263
|
}
|
|
8109
|
-
const
|
|
8264
|
+
const finalStatusRaw = `[TERMINAL_RECORD]
|
|
8265
|
+
COMMAND: ${activeCommandRef.current}
|
|
8266
|
+
PTY: ${isActiveCommandPty}
|
|
8267
|
+
OUTPUT: ${rawOutput}`;
|
|
8268
|
+
const finalStatusNormalized = `[TERMINAL_RECORD]
|
|
8110
8269
|
COMMAND: ${activeCommandRef.current}
|
|
8111
8270
|
PTY: ${isActiveCommandPty}
|
|
8112
|
-
OUTPUT: ${normalizedOutput}`;
|
|
8113
|
-
return [...prev, {
|
|
8271
|
+
OUTPUT: ${normalizedOutput.replace(/\n{3,}/g, "\n\n")}`;
|
|
8272
|
+
return [...prev, {
|
|
8273
|
+
id: "term-" + Date.now(),
|
|
8274
|
+
role: "system",
|
|
8275
|
+
text: finalStatusRaw,
|
|
8276
|
+
fullText: finalStatusNormalized,
|
|
8277
|
+
isTerminalRecord: true
|
|
8278
|
+
}];
|
|
8114
8279
|
});
|
|
8115
8280
|
setActiveCommand(null);
|
|
8116
8281
|
setIsTerminalFocused(false);
|
|
@@ -8998,7 +9163,7 @@ Selection: ${val}`,
|
|
|
8998
9163
|
}
|
|
8999
9164
|
)));
|
|
9000
9165
|
default:
|
|
9001
|
-
return /* @__PURE__ */ React13.createElement(Box13, { flexDirection: "column", marginTop: 1, flexShrink: 0, width: "100%" }, /* @__PURE__ */ React13.createElement(Box13, { paddingX: 1, marginBottom: 0, justifyContent: "space-between", width: "100%" }, /* @__PURE__ */ React13.createElement(Box13, null, statusText ? /* @__PURE__ */ React13.createElement(Box13, null, isSpinnerActive && /* @__PURE__ */ React13.createElement(StatusSpinner, null), /* @__PURE__ */ React13.createElement(Text13, { color: "magenta", bold: true, italic: true }, isSpinnerActive ? " " : "", statusText.toUpperCase())) : /* @__PURE__ */ React13.createElement(Text13, { color: "cyan", dimColor: true, italic: true }, " ", input.length > 0 && escPressCount ? "Press ESC again to clear input" : "READY FOR COMMAND...")), /* @__PURE__ */ React13.createElement(Box13, null, /* @__PURE__ */ React13.createElement(Text13, { color: "gray", bold: true }, "[ "), /* @__PURE__ */ React13.createElement(Text13, { color: "white" }, tempModelOverride || activeModel), /* @__PURE__ */ React13.createElement(Text13, { color: "gray", bold: true }, " ]"))), /* @__PURE__ */ React13.createElement(
|
|
9166
|
+
return /* @__PURE__ */ React13.createElement(Box13, { flexDirection: "column", marginTop: 1, flexShrink: 0, width: "100%" }, /* @__PURE__ */ React13.createElement(Box13, { paddingX: 1, marginBottom: 0, justifyContent: "space-between", width: "100%" }, /* @__PURE__ */ React13.createElement(Box13, null, statusText ? /* @__PURE__ */ React13.createElement(Box13, null, isSpinnerActive && !isSpinnerActive && /* @__PURE__ */ React13.createElement(StatusSpinner, null), /* @__PURE__ */ React13.createElement(Text13, { color: "magenta", bold: true, italic: true }, isSpinnerActive && !isSpinnerActive ? " " : "", statusText.toUpperCase())) : /* @__PURE__ */ React13.createElement(Text13, { color: "cyan", dimColor: true, italic: true }, " ", input.length > 0 && escPressCount ? "Press ESC again to clear input" : "READY FOR COMMAND...")), /* @__PURE__ */ React13.createElement(Box13, null, /* @__PURE__ */ React13.createElement(Text13, { color: "gray", bold: true }, "[ "), /* @__PURE__ */ React13.createElement(Text13, { color: "white" }, tempModelOverride || activeModel), /* @__PURE__ */ React13.createElement(Text13, { color: "gray", bold: true }, " ]"))), /* @__PURE__ */ React13.createElement(
|
|
9002
9167
|
Box13,
|
|
9003
9168
|
{
|
|
9004
9169
|
borderStyle: "round",
|
|
@@ -9007,24 +9172,7 @@ Selection: ${val}`,
|
|
|
9007
9172
|
paddingY: 0,
|
|
9008
9173
|
width: "100%"
|
|
9009
9174
|
},
|
|
9010
|
-
/* @__PURE__ */ React13.createElement(Box13, { flexDirection: "column", width: "100%" },
|
|
9011
|
-
MultilineInput,
|
|
9012
|
-
{
|
|
9013
|
-
value: "",
|
|
9014
|
-
placeholder: " (Backspace to delete / Enter to expand)",
|
|
9015
|
-
onChange: (val) => {
|
|
9016
|
-
if (val.length > 0) {
|
|
9017
|
-
setIsExpanded(true);
|
|
9018
|
-
setInput(input + val);
|
|
9019
|
-
}
|
|
9020
|
-
},
|
|
9021
|
-
onSubmit: () => setIsExpanded(true),
|
|
9022
|
-
keyBindings: {
|
|
9023
|
-
submit: (key) => key.return && !key.shift && !key.ctrl && !key.leftAlt && !key.rightAlt,
|
|
9024
|
-
newline: (key) => key.return && key.shift || key.return && key.ctrl || key.return && key.leftAlt || key.return && key.rightAlt
|
|
9025
|
-
}
|
|
9026
|
-
}
|
|
9027
|
-
)))) : /* @__PURE__ */ React13.createElement(Box13, { flexDirection: "row", width: "100%", paddingY: 0 }, /* @__PURE__ */ React13.createElement(Box13, { flexShrink: 0, width: 4 }, /* @__PURE__ */ React13.createElement(Text13, { color: isProcessing ? "magenta" : "cyan", bold: true }, isProcessing ? "\u2726 " : "\u{1F4A0} ")), /* @__PURE__ */ React13.createElement(Box13, { flexGrow: 1 }, /* @__PURE__ */ React13.createElement(Box13, { flexGrow: 1, position: "relative" }, input === "" && /* @__PURE__ */ React13.createElement(Box13, { position: "absolute", paddingLeft: 0 }, activeCommand && !isTerminalFocused ? /* @__PURE__ */ React13.createElement(Text13, { color: "yellow" }, isTerminalWaitingForInput ? " Terminal is waiting for user input. Press TAB to interact" : " Press TAB to interact with terminal...") : activeCommand && isTerminalFocused ? /* @__PURE__ */ React13.createElement(Text13, { color: "yellow", bold: true }, " [ TERMINAL FOCUSED ] Type to interact, press TAB to exit...") : escPressCount === 1 ? /* @__PURE__ */ React13.createElement(Text13, { color: "cyan", bold: true }, " Press ESC again to ", input.length > 0 ? "clear input" : "revert codebase to checkpoint", "...") : /* @__PURE__ */ React13.createElement(Text13, { color: "gray" }, escPressed ? " Press ESC again to cancel the request." : !isProcessing ? ` Send message or /cmd... (${terminalEnv.shortcut} for newline)` : " Enter a prompt to steer the agent.")), /* @__PURE__ */ React13.createElement(
|
|
9175
|
+
/* @__PURE__ */ React13.createElement(Box13, { flexDirection: "column", width: "100%" }, /* @__PURE__ */ React13.createElement(Box13, { flexDirection: "row", width: "100%", paddingY: 0 }, /* @__PURE__ */ React13.createElement(Box13, { flexShrink: 0, width: 4 }, /* @__PURE__ */ React13.createElement(Text13, { color: isProcessing ? "magenta" : "cyan", bold: true }, isProcessing ? "\u2726 " : "\u{1F4A0} ")), /* @__PURE__ */ React13.createElement(Box13, { flexGrow: 1 }, /* @__PURE__ */ React13.createElement(Box13, { flexGrow: 1, position: "relative" }, input === "" && /* @__PURE__ */ React13.createElement(Box13, { position: "absolute", paddingLeft: 0 }, activeCommand && !isTerminalFocused ? /* @__PURE__ */ React13.createElement(Text13, { color: "yellow" }, isTerminalWaitingForInput ? " Terminal is waiting for user input. Press TAB to interact" : " Press TAB to interact with terminal...") : activeCommand && isTerminalFocused ? /* @__PURE__ */ React13.createElement(Text13, { color: "yellow", bold: true }, " [ TERMINAL FOCUSED ] Type to interact, press TAB to exit...") : escPressCount === 1 ? /* @__PURE__ */ React13.createElement(Text13, { color: "cyan", bold: true }, " Press ESC again to ", input.length > 0 ? "clear input" : "revert codebase to checkpoint", "...") : /* @__PURE__ */ React13.createElement(Text13, { color: "gray" }, escPressed ? " Press ESC again to cancel the request." : !isProcessing ? ` Send message or /cmd... (${terminalEnv.shortcut} for newline)` : " Enter a prompt to steer the agent.")), /* @__PURE__ */ React13.createElement(
|
|
9028
9176
|
MultilineInput,
|
|
9029
9177
|
{
|
|
9030
9178
|
key: `input-${inputKey}`,
|