fluxflow-cli 1.14.4 → 1.14.5
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 +82 -81
- package/package.json +2 -2
package/dist/fluxflow.js
CHANGED
|
@@ -339,12 +339,12 @@ var init_ChatLayout = __esm({
|
|
|
339
339
|
result.push(/* @__PURE__ */ React2.createElement(Box2, { key: i, marginY: 1, borderStyle: "single", borderTop: true, borderBottom: false, borderLeft: false, borderRight: false, width: "100%", borderColor: "#333" }));
|
|
340
340
|
return;
|
|
341
341
|
}
|
|
342
|
-
const headingMatch = trimmed.match(/^(#{1,
|
|
342
|
+
const headingMatch = trimmed.match(/^(#{1,6})\s+(.*)/);
|
|
343
343
|
if (headingMatch) {
|
|
344
344
|
const level = headingMatch[1].length;
|
|
345
345
|
const hText = headingMatch[2];
|
|
346
346
|
result.push(
|
|
347
|
-
/* @__PURE__ */ React2.createElement(Box2, { key: i, marginTop: 1, marginBottom:
|
|
347
|
+
/* @__PURE__ */ React2.createElement(Box2, { key: i, marginTop: 1, marginBottom: 1, width: "100%" }, /* @__PURE__ */ React2.createElement(Text2, { bold: true, color: level === 1 ? "cyan" : level === 2 ? "magenta" : level === 3 ? "yellow" : level === 4 ? "green" : level === 5 ? "blue" : "white", underline: true }, hText.toUpperCase()))
|
|
348
348
|
);
|
|
349
349
|
return;
|
|
350
350
|
}
|
|
@@ -436,7 +436,10 @@ var init_ChatLayout = __esm({
|
|
|
436
436
|
return /* @__PURE__ */ React2.createElement(Box2, { flexDirection: "column", alignItems: "center", width: "100%", marginY: 1 }, /* @__PURE__ */ React2.createElement(Box2, { borderStyle: "round", borderColor: "gray", paddingX: 3, paddingY: 0 }, /* @__PURE__ */ React2.createElement(Text2, { color: "cyan", bold: true }, msg.text.trim())));
|
|
437
437
|
}
|
|
438
438
|
if (msg.isVisualFeedback) {
|
|
439
|
-
return
|
|
439
|
+
return (
|
|
440
|
+
// [SPACE POINT]
|
|
441
|
+
/* @__PURE__ */ React2.createElement(Box2, { marginBottom: 0, marginTop: 0, paddingX: 1, width: "100%" }, /* @__PURE__ */ React2.createElement(Text2, { color: "white" }, msg.text))
|
|
442
|
+
);
|
|
440
443
|
}
|
|
441
444
|
if (isPatchError) {
|
|
442
445
|
return /* @__PURE__ */ React2.createElement(Box2, { marginBottom: 1 }, /* @__PURE__ */ React2.createElement(Box2, { flexDirection: "column", borderStyle: "round", borderColor: "red", paddingX: 1, paddingY: 0 }, /* @__PURE__ */ React2.createElement(Text2, { color: "red", bold: true, underline: true }, "\u274C PATCH FAILED"), /* @__PURE__ */ React2.createElement(Box2, { marginTop: 1 }, /* @__PURE__ */ React2.createElement(Text2, { color: "red" }, "Patch failed: ", /* @__PURE__ */ React2.createElement(Text2, { color: "white", bold: true }, "Model generated malformed edit.")))));
|
|
@@ -502,20 +505,23 @@ var init_ChatLayout = __esm({
|
|
|
502
505
|
}
|
|
503
506
|
return msg.isStreaming ? content : content.trimEnd();
|
|
504
507
|
}, [content, msg.role, showFullThinking, msg.isStreaming]);
|
|
505
|
-
return
|
|
506
|
-
|
|
507
|
-
{
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
508
|
+
return (
|
|
509
|
+
// [SPACE POINT]
|
|
510
|
+
/* @__PURE__ */ React2.createElement(Box2, { marginBottom: msg.role === "think" ? 0 : msg.role === "user" ? 1 : msg.role === "agent" ? 0 : 0, marginTop: msg.role === "think" ? 0 : msg.role === "user" ? 0 : msg.role === "agent" ? 0 : 1, flexDirection: "column", flexShrink: 0, width: "100%", flexGrow: 1 }, msg.role === "user" ? /* @__PURE__ */ React2.createElement(
|
|
511
|
+
Box2,
|
|
512
|
+
{
|
|
513
|
+
backgroundColor: "#262626",
|
|
514
|
+
paddingX: 1,
|
|
515
|
+
paddingY: 1,
|
|
516
|
+
width: "100%",
|
|
517
|
+
flexDirection: "column"
|
|
518
|
+
},
|
|
519
|
+
wrapText(
|
|
520
|
+
finalContent.replace(/\r\n/g, "\n").replace(/\r/g, "\n").replace(/\\\n/g, "\n").replace(/\\$/, ""),
|
|
521
|
+
columns - 6
|
|
522
|
+
).split("\n").map((line, lineIdx) => /* @__PURE__ */ React2.createElement(Box2, { key: lineIdx, flexDirection: "row", width: "100%" }, /* @__PURE__ */ React2.createElement(Box2, { flexShrink: 0, width: 2 }, /* @__PURE__ */ React2.createElement(Text2, { bold: true, color: "white" }, lineIdx === 0 ? "\u276F" : " ")), /* @__PURE__ */ React2.createElement(Box2, { flexGrow: 1, marginLeft: 1 }, /* @__PURE__ */ React2.createElement(Text2, { color: msg.color || "white", wrap: "anywhere" }, line))))
|
|
523
|
+
) : msg.role === "think" ? /* @__PURE__ */ React2.createElement(Box2, { flexDirection: "column", marginTop: 0, marginBottom: 0, paddingX: 1, width: "100%" }, /* @__PURE__ */ React2.createElement(Text2, { bold: true, color: "white" }, "Thinking..."), /* @__PURE__ */ React2.createElement(Box2, { borderStyle: "single", borderLeft: true, borderRight: false, borderTop: false, borderBottom: false, paddingLeft: 2, paddingTop: 1, paddingBottom: 1, flexDirection: "column", width: "100%" }, formatThinkText(finalContent, columns))) : /* @__PURE__ */ React2.createElement(Box2, { flexDirection: "column", paddingX: 1, marginTop: 0, width: "100%" }, /* @__PURE__ */ React2.createElement(CodeRenderer, { text: finalContent.replace(/ \|\n\n/g, " |\n"), columns }), msg.memoryUpdated && /* @__PURE__ */ React2.createElement(Box2, { marginTop: 1, width: "100%" }, /* @__PURE__ */ React2.createElement(Text2, { color: "yellow", italic: true }, "\u2728 [Memory Updated]"))))
|
|
524
|
+
);
|
|
519
525
|
});
|
|
520
526
|
ChatLayout = React2.memo(({ messages, showFullThinking, columns = 80 }) => {
|
|
521
527
|
return /* @__PURE__ */ React2.createElement(Box2, { flexDirection: "column", width: "100%" }, messages.map((msg, idx) => /* @__PURE__ */ React2.createElement(
|
|
@@ -953,38 +959,36 @@ var init_main_tools = __esm({
|
|
|
953
959
|
"src/data/main_tools.js"() {
|
|
954
960
|
TOOL_PROTOCOL = (mode, osDetected) => `
|
|
955
961
|
-- TOOL DEFINITIONS --
|
|
956
|
-
Access to internal tools. To call a tool, MUST use the exact syntax on a new line:
|
|
957
|
-
[tool:functions.ToolName(args)]
|
|
962
|
+
Access to internal tools. To call a tool, MUST use the exact syntax on a new line: [tool:functions.ToolName(args)]
|
|
958
963
|
|
|
959
964
|
- COMMUNICATION TOOLS -
|
|
960
|
-
1. [tool:functions.Ask(question="...", optionA="
|
|
965
|
+
1. [tool:functions.Ask(question="...", optionA="option::description", ...MAX 4)]. Ambiguity Resolution. Mandatory Triggers: Path Divergence, Security, Risk Mitigation. ask >> finish
|
|
961
966
|
Suggest best options; don't ask for preferences. System handles the rest
|
|
962
967
|
|
|
963
968
|
- WEB TOOLS -
|
|
964
|
-
1. [tool:functions.WebSearch(query="...", limit=number)]. Find info (limit 3-10). Proactive use for unknown topics${mode === "Flux" ? " or docs" : ""}
|
|
969
|
+
1. [tool:functions.WebSearch(query="...", limit=number)]. Find info (limit 3-10). Proactive use for unknown/any topics${mode === "Flux" ? " or docs" : ""}
|
|
965
970
|
2. [tool:functions.WebScrape(url="...")]. Visit URL
|
|
966
971
|
|
|
967
|
-
${mode === "Flux" ? `-
|
|
968
|
-
1. [tool:functions.ReadFile(path="...",
|
|
972
|
+
${mode === "Flux" ? `- PROJECT TOOLS (path = relative to CWD) -
|
|
973
|
+
1. [tool:functions.ReadFile(path="...", startLine=N, endLine=N)]. Reads contents. Supports images/docs. User gives image/doc: VIEW FIRST
|
|
969
974
|
2. [tool:functions.ReadFolder(path="...")]. Detailed DIR stats
|
|
970
975
|
3. [tool:functions.WriteFile(path="...", content="...")]. Creates/Overwrites. File Exist? PatchFile > WriteFile
|
|
971
976
|
4. [tool:functions.PatchFile(path="...", replaceContent="exact old content", newContent="new content")]. Surgical patching. Unsure replaceContent? ReadFile > guessing
|
|
972
|
-
5. [tool:functions.
|
|
973
|
-
6. [tool:functions.
|
|
974
|
-
7. [tool:functions.
|
|
975
|
-
8. [tool:functions.
|
|
976
|
-
9. [tool:functions.
|
|
977
|
+
5. [tool:functions.SearchKeyword(keyword="...")]. Global project search. Finds definitions/logic without reading every file
|
|
978
|
+
6. [tool:functions.Run(command="...")]. Runs a ${osDetected === "Windows" ? "Windows CMD" : "Bash"} command. Destructive/Irreversible ops -> Ask user
|
|
979
|
+
7. [tool:functions.GenerateImage(path="... png", prompt="detailed", ratio="16:9, 9:16, 1:1, 4:3, 3:4")]. AI images. Usage: Mockups, PDF thumbnails, any visual content
|
|
980
|
+
8. [tool:functions.WritePDF(path="...", content="...", orientation="...")]. PROACTIVE A4 PAGE BREAKS MUST IN CSS. HTML/CSS for PREMIUM layout (100vh/vw)
|
|
981
|
+
9. [tool:functions.WriteDoc(path="...", content="...")]. A4 Word document
|
|
977
982
|
|
|
978
|
-
- VERIFY RESULT CONTENTS. Fix errors. No hallucinations
|
|
979
|
-
- File tools >
|
|
983
|
+
- VERIFY TOOL RESULT CONTENTS. Fix errors. No hallucinations
|
|
984
|
+
- File tools > Long chat
|
|
980
985
|
|
|
981
986
|
- Escape quotes: \\" for code strings
|
|
982
987
|
- Literal escapes: Double-escape sequences (e.g., \\\\n, \\\\t)
|
|
983
988
|
- File structure: Real newlines for code formatting`.trim() : `
|
|
984
|
-
- FILE TOOLS ARE NOT AVAILABLE IN FLOW
|
|
989
|
+
- FILE TOOLS ARE NOT AVAILABLE IN FLOW`.trim()}
|
|
985
990
|
|
|
986
|
-
- Results: Passed as [TOOL RESULT] (system)
|
|
987
|
-
- Tool calls: End with [turn: continue]. Only use [turn: finish] after verifying goals
|
|
991
|
+
- Results: Passed as [TOOL RESULT] (system priority)
|
|
988
992
|
- Multi-call: Stack upto 5`.trim();
|
|
989
993
|
}
|
|
990
994
|
});
|
|
@@ -1027,21 +1031,22 @@ var thinking_prompts_default;
|
|
|
1027
1031
|
var init_thinking_prompts = __esm({
|
|
1028
1032
|
"src/data/thinking_prompts.json"() {
|
|
1029
1033
|
thinking_prompts_default = {
|
|
1030
|
-
xHigh: `
|
|
1031
|
-
Think in a continuous, fluid analytical monologue within
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1034
|
+
xHigh: `EFFORT LEVEL: MAX
|
|
1035
|
+
Think in a continuous, fluid analytical monologue within <think>...</think> block. Do NOT use headings, markers, bullet points, or artificial sections. Engage in a rigorous "Stream of Consciousness" that aggressively interrogates problem:
|
|
1036
|
+
Deconstruct requirements, trace implicit assumptions, and evaluate system-wide implications
|
|
1037
|
+
Formulate solutions focusing on extreme modularity, DRY principles, and clean abstractions. Mentally simulate architecture
|
|
1038
|
+
Actively try to break your own logic. Search for edge cases, race conditions, memory leaks, and security flaws. If a flaw is found, pivot immediately
|
|
1039
|
+
Map out a granular, step-by-step operational plan before writing code or using tools
|
|
1040
|
+
Ensure your approach adheres to good folder structures, modularity, and clean code practices
|
|
1036
1041
|
RULES:
|
|
1037
|
-
- NO HEADINGS/MARKERS. Maintain a dense, unbroken analytical monologue
|
|
1038
|
-
- Be exhaustive. Detail
|
|
1039
|
-
- Question your own logic ruthlessly as you go
|
|
1040
|
-
- MANDATORY THINKING: You MUST engage in full reasoning regardless of simplicity
|
|
1041
|
-
High: "
|
|
1042
|
-
Medium: "
|
|
1043
|
-
Minimal: "
|
|
1044
|
-
Off: "
|
|
1042
|
+
- NO HEADINGS/MARKERS/LISTS. Maintain a dense, unbroken analytical monologue
|
|
1043
|
+
- Be exhaustive. Detail exact 'why' behind architectural choices and algorithm selections
|
|
1044
|
+
- Question your own logic ruthlessly as you go
|
|
1045
|
+
- MANDATORY THINKING: You MUST engage in full reasoning regardless of simplicity/greetings`,
|
|
1046
|
+
High: "EFFORT LEVEL: HIGH\nThink in a stable, analytical monologue within <think>...</think>\nAvoid headings, markers or structured formatting. Your thinking should be a continuous stream of logical deduction:\nBreak objective down into atomic, executable steps\nMentally execute your planned code/actions. Identify missing dependencies or potential failure states\nEnsure your approach adheres to good folder structures, modularity, and clean code practices\nRULES:\n- NO HEADINGS/MARKERS/LISTS. Maintain a fluid monologue style\n- Be detailed and rigorous in self-correction\n- Focus heavily on technical correctness, clean abstractions, and edge-case prevention\n- MANDATORY THINKING: You MUST enter reasoning to verify path forward/greetings",
|
|
1047
|
+
Medium: "EFFORT LEVEL: MEDIUM\nThink in a brief, stable monologue within <think>...</think>\nFocus on core logic required to solve task efficiently:\nDetermine most straightforward solution that meets requirements\nBriefly review chosen approach against obvious anti-patterns or missing imports\nOutline exact files and functions to modify\nRULES:\n- NO HEADINGS/MARKERS/LISTS. Keep it as a simple, logical stream\n- Be efficient but deliberate. Spend energy primarily on actionable steps\n- MANDATORY THINKING: Engage in a baseline mental check for all technical tasks/greetings",
|
|
1048
|
+
Minimal: "EFFORT LEVEL: LOW\nThink in a concise, focused monologue within <think>...</think>\nJust a quick mental check before acting:\nConfirm what user is asking\nNote specific tool or file to target\nRULES:\n- NO HEADINGS/MARKERS/LISTS. Keep it to a few lines of clear, linear monologue\n- Minimal thinking suitable for simple/conversational requests/greetings",
|
|
1049
|
+
Off: "EFFORT LEVEL: FAST\nNo Thinking. Direct Response"
|
|
1045
1050
|
};
|
|
1046
1051
|
}
|
|
1047
1052
|
});
|
|
@@ -1058,7 +1063,7 @@ var init_prompts = __esm({
|
|
|
1058
1063
|
if (!isMemoryEnabled) return "";
|
|
1059
1064
|
const tempMemoriesStr = tempMemories?.length > 0 && !isContext32k ? `-- RECENT CONTEXT FROM OTHER CHATS (PRIORITY: DYNAMIC-MEDIUM, FOCUS: Chat Context > Recent) --
|
|
1060
1065
|
${tempMemories}` : "";
|
|
1061
|
-
const userMemoriesStr = userMemories?.length > 0 ? `--- SAVED MEMORIES (PRIORITY: MEDIUM,
|
|
1066
|
+
const userMemoriesStr = userMemories?.length > 0 ? `--- SAVED MEMORIES (PRIORITY: MEDIUM, USER PREFERENCES) ---
|
|
1062
1067
|
${userMemories}` : "";
|
|
1063
1068
|
const parts = [userMemoriesStr, tempMemoriesStr].filter((p) => p.length > 0);
|
|
1064
1069
|
return parts.length > 0 ? `[SYSTEM CONTEXT]
|
|
@@ -1104,41 +1109,37 @@ ${nicknameStr.length || userInstrStr.length ? "" : "\n"}` : "";
|
|
|
1104
1109
|
const projectContextBlock = mode === "Flux" && foundFiles.length > 0 ? `
|
|
1105
1110
|
-- PROJECT CONTEXT (Source of Truth) --
|
|
1106
1111
|
${foundFiles.map((f) => `- ${f.name}: ${f.desc}`).join("\n")}
|
|
1107
|
-
Check these first;
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1112
|
+
Check these first; These Files > Training Data. Safety rules apply
|
|
1113
|
+
` : "";
|
|
1114
|
+
return `${nameStr}${nicknameStr}${userInstrStr}[SYSTEM]
|
|
1115
|
+
Identity: Flux Flow (by Kushal Roy Chowdhury). Sassy${mode === "Flux" ? ", Professional, Respectful" : ", Friendly, Humorous, Sarcastic"}, CLI Agent
|
|
1116
|
+
Mode: ${mode}${thinkingLevel !== "Fast" ? " (Thinking Mode)" : ""}. ${mode === "Flux" ? "Expert Developer, Logical, Highly Detailed, Task-Driven. Prioritizes scalable file/folder structures, modular architecture, clean code abstractions, step-by-step execution. Industry standard coding practices/libraries, clean code" : "Conversational & Concise"}
|
|
1117
|
+
CWD: ${cwdStr}${isSystemDir ? ". [PROTECTED: ASK BEFORE MODIFYING]" : ""}
|
|
1113
1118
|
|
|
1114
1119
|
-- THINKING RULES --
|
|
1115
1120
|
${thinkingConfig}
|
|
1116
1121
|
${thinkingLevel !== "Fast" ? `
|
|
1117
1122
|
CRITICAL THINKING POLICY
|
|
1118
|
-
- ALWAYS use <think> ... </think> before responding
|
|
1119
|
-
-
|
|
1120
|
-
- NEVER START responses directly, regardless of task complexity
|
|
1123
|
+
- ALWAYS use <think> ... </think> before responding, even with simple queries/greetings
|
|
1124
|
+
- Avoid spiraling in thinking loop once best approach is found
|
|
1121
1125
|
` : ""}
|
|
1122
1126
|
${TOOL_PROTOCOL(mode, osDetected)}
|
|
1123
1127
|
${projectContextBlock}
|
|
1124
|
-
|
|
1125
1128
|
-- MEMORY RULES --
|
|
1126
|
-
- Memory: ${isMemoryEnabled ? "
|
|
1127
|
-
-
|
|
1129
|
+
- Memory: ${isMemoryEnabled ? "Subtly Personalize. Auto Saves" : "OFF. Decline Remembering Memories"}
|
|
1130
|
+
- Temporal Awareness: RELATIVE TIME REFERENCE eg. few mins ago
|
|
1128
1131
|
|
|
1129
|
-
-- SECURITY RULES
|
|
1130
|
-
- EXTERNAL ACCESS: ${systemSettings.allowExternalAccess ? "ENABLED" : "RESTRICTED CWD only"}
|
|
1132
|
+
-- SECURITY RULES --${systemSettings.allowExternalAccess ? "" : "\n- ACCESS CONTROL: CWD only"}
|
|
1131
1133
|
- Sensitive files? Ask before Read
|
|
1132
|
-
[SYSTEM] >>> [USER]
|
|
1133
1134
|
|
|
1134
1135
|
-- FORMATTING --
|
|
1135
|
-
-
|
|
1136
|
-
- Tables:
|
|
1136
|
+
- GFM Supported
|
|
1137
|
+
- Tables: Max 4 cols, short rows
|
|
1137
1138
|
- NO LaTeX. Code blocks for literature${mode === "Flux" ? "" : ". Kaomojis"}
|
|
1138
1139
|
|
|
1139
1140
|
-- RESPONSE RULES --
|
|
1140
|
-
- End with [turn: continue]
|
|
1141
|
-
- Tool Called? No post tool
|
|
1141
|
+
- End with [turn: continue] to continue or [turn: finish] when task done
|
|
1142
|
+
- Tool Called? No post tool response until [turn: continue]
|
|
1142
1143
|
- Task Complete? End loop with [turn: finish]
|
|
1143
1144
|
[/SYSTEM]`.trim();
|
|
1144
1145
|
};
|
|
@@ -2384,9 +2385,9 @@ var init_view_file = __esm({
|
|
|
2384
2385
|
"src/tools/view_file.js"() {
|
|
2385
2386
|
init_arg_parser();
|
|
2386
2387
|
view_file = async (args) => {
|
|
2387
|
-
let { path: targetPath, StartLine, EndLine, start_line, end_line } = parseArgs(args);
|
|
2388
|
-
const sLine = parseInt(StartLine || start_line);
|
|
2389
|
-
const eLine = parseInt(EndLine || end_line);
|
|
2388
|
+
let { path: targetPath, StartLine, EndLine, start_line, end_line, startLine, endLine } = parseArgs(args);
|
|
2389
|
+
const sLine = parseInt(StartLine || start_line || startLine);
|
|
2390
|
+
const eLine = parseInt(EndLine || end_line || endLine);
|
|
2390
2391
|
const finalStart = sLine || 1;
|
|
2391
2392
|
const finalEnd = eLine || (sLine ? sLine + 800 : 800);
|
|
2392
2393
|
if (!targetPath) return 'ERROR: Missing "path" argument for view_file.';
|
|
@@ -4349,7 +4350,7 @@ ${thinkingLevel != "Fast" ? "[SYSTEM] **STRICTLY FOLLOW THINKING POLICY AS CORE
|
|
|
4349
4350
|
|
|
4350
4351
|
[STEERING HINT]: ${hint}`;
|
|
4351
4352
|
} else {
|
|
4352
|
-
modifiedHistory.push({ role: "user", text: `${thinkingLevel != "Fast" ? "[SYSTEM] **STRICTLY FOLLOW THINKING POLICY AS STRICT PRIORITY. DO NOT START A RESPONSE WITHOUT
|
|
4353
|
+
modifiedHistory.push({ role: "user", text: `${thinkingLevel != "Fast" ? "[SYSTEM] **STRICTLY FOLLOW THINKING POLICY AS STRICT PRIORITY. DO NOT START A RESPONSE WITHOUT <think> ... </think>**\n" : ""}[STEERING HINT]: ${hint}` });
|
|
4353
4354
|
}
|
|
4354
4355
|
yield { type: "status", content: "Steering Hint Injected." };
|
|
4355
4356
|
}
|
|
@@ -4416,14 +4417,14 @@ ${thinkingLevel != "Fast" ? "[SYSTEM] **STRICTLY FOLLOW THINKING POLICY AS CORE
|
|
|
4416
4417
|
const currentSystemInstruction = getSystemInstruction(profile, thinkingLevel, mode, systemSettings, isMemoryEnabled, MAX_LOOPS, loop + 1);
|
|
4417
4418
|
const jitInstruction = `
|
|
4418
4419
|
|
|
4419
|
-
[SYSTEM] Tool result received. Analyze output and proceed with your turn.${thinkingLevel != "Fast" ? "**STRICTLY MAINTAIN THINKING PROTOCOL. DO NOT START A RESPONSE WITHOUT
|
|
4420
|
+
[SYSTEM] Tool result received. Analyze output and proceed with your turn.${thinkingLevel != "Fast" ? "**STRICTLY MAINTAIN THINKING PROTOCOL. DO NOT START A RESPONSE WITHOUT <think> ... </think>**" : ""}`;
|
|
4420
4421
|
const lastUserMsg = contents[contents.length - 1];
|
|
4421
4422
|
let addedMarker = false;
|
|
4422
4423
|
if (lastUserMsg && lastUserMsg.role === "user" && lastUserMsg.parts?.[0]?.text?.startsWith("[TOOL RESULT]")) {
|
|
4423
4424
|
lastUserMsg.parts[0].text += jitInstruction;
|
|
4424
4425
|
addedMarker = true;
|
|
4425
4426
|
}
|
|
4426
|
-
const stepThreshold = Math.floor(MAX_LOOPS * (mode === "Flux" ? 0.
|
|
4427
|
+
const stepThreshold = Math.floor(MAX_LOOPS * (mode === "Flux" ? 0.98 : 0.7));
|
|
4427
4428
|
const currentStep = loop + 1;
|
|
4428
4429
|
if (currentStep >= stepThreshold && lastUserMsg && lastUserMsg.parts?.[0]) {
|
|
4429
4430
|
lastUserMsg.parts[0].text += `
|
|
@@ -4683,9 +4684,9 @@ ${thinkingLevel != "Fast" ? "[SYSTEM] **STRICTLY FOLLOW THINKING POLICY AS CORE
|
|
|
4683
4684
|
const url = parseArgs(toolCall.args).url || "...";
|
|
4684
4685
|
label = `\u{1F4D6} READ SITE: ${url}`.toUpperCase();
|
|
4685
4686
|
} else if (normToolName === "view_file") {
|
|
4686
|
-
const { path: targetPath2, StartLine, EndLine, start_line, end_line } = parseArgs(toolCall.args);
|
|
4687
|
-
const rawStart = StartLine || start_line;
|
|
4688
|
-
const rawEnd = EndLine || end_line;
|
|
4687
|
+
const { path: targetPath2, StartLine, EndLine, start_line, end_line, startLine, endLine } = parseArgs(toolCall.args);
|
|
4688
|
+
const rawStart = StartLine || start_line || startLine;
|
|
4689
|
+
const rawEnd = EndLine || end_line || endLine;
|
|
4689
4690
|
const sLine = parseInt(rawStart) || 1;
|
|
4690
4691
|
const eLine = parseInt(rawEnd) || (rawStart ? sLine + 800 : 800);
|
|
4691
4692
|
let totalLines = "...";
|
|
@@ -4771,7 +4772,7 @@ ${boxBottom}` };
|
|
|
4771
4772
|
const absoluteCwd = path15.resolve(process.cwd());
|
|
4772
4773
|
if (isExternalOff && !absoluteTarget.startsWith(absoluteCwd)) {
|
|
4773
4774
|
const denyMsg = `Access Denied. You are not allowed to access files outside the current workspace. To enable this, ask the user to turn on "External Workspace Access" in /settings.`;
|
|
4774
|
-
toolResults.push({ role: "user", text: `[TOOL RESULT]: ERROR: ${denyMsg}
|
|
4775
|
+
toolResults.push({ role: "user", text: `[TOOL RESULT]: ERROR: ${denyMsg}` });
|
|
4775
4776
|
yield { type: "tool_result", content: `[TOOL RESULT]: ERROR: ${denyMsg}` };
|
|
4776
4777
|
toolCallPointer++;
|
|
4777
4778
|
continue;
|
|
@@ -4784,7 +4785,7 @@ ${boxBottom}` };
|
|
|
4784
4785
|
if (approval === "deny") {
|
|
4785
4786
|
if (normToolName === "exec_command" && settings.onExecEnd) settings.onExecEnd();
|
|
4786
4787
|
const denyMsg = `Permission Denied: User rejected the ${normToolName === "exec_command" ? "terminal execution" : "file edit"}.`;
|
|
4787
|
-
toolResults.push({ role: "user", text: `[TOOL RESULT]: DENIED: ${denyMsg}
|
|
4788
|
+
toolResults.push({ role: "user", text: `[TOOL RESULT]: DENIED: ${denyMsg}` });
|
|
4788
4789
|
yield { type: "tool_result", content: `[TOOL RESULT]: DENIED: ${denyMsg}` };
|
|
4789
4790
|
await incrementUsage("toolDenied");
|
|
4790
4791
|
if (settings.onToolResult) settings.onToolResult("denied", normToolName);
|
|
@@ -7407,12 +7408,12 @@ Selection: ${val}`,
|
|
|
7407
7408
|
case "approval":
|
|
7408
7409
|
return /* @__PURE__ */ React11.createElement(Box11, { flexDirection: "column", borderStyle: "round", borderColor: "yellow", paddingX: 2, paddingY: 1, width: "100%" }, /* @__PURE__ */ React11.createElement(Text11, { color: "yellow", bold: true, underline: true }, "\u{1F510} SECURITY GATE: FILE WRITE PERMISSION"), /* @__PURE__ */ React11.createElement(Text11, { marginTop: 1 }, "The agent is attempting to modify: ", /* @__PURE__ */ React11.createElement(Text11, { color: "cyan" }, parseArgs(pendingApproval?.args || "{}").path || "Unknown File")), /* @__PURE__ */ React11.createElement(Box11, { marginTop: 1, borderStyle: "single", borderColor: "#333", paddingX: 1, flexDirection: "column" }, /* @__PURE__ */ React11.createElement(Text11, { color: "gray" }, "--- PROPOSED CONTENT / DIFF ---"), (() => {
|
|
7409
7410
|
const args2 = parseArgs(pendingApproval?.args || "{}");
|
|
7410
|
-
const oldVal = args2.TargetContent || args2.content_to_replace || null;
|
|
7411
|
-
const newVal = args2.content || args2.ReplacementContent || args2.content_to_add || args2.replacementContent || null;
|
|
7411
|
+
const oldVal = args2.TargetContent || args2.content_to_replace || args2.replaceContent || null;
|
|
7412
|
+
const newVal = args2.content || args2.ReplacementContent || args2.content_to_add || args2.replacementContent || args2.newContent || null;
|
|
7412
7413
|
if (oldVal && newVal) {
|
|
7413
7414
|
return /* @__PURE__ */ React11.createElement(Box11, { flexDirection: "column", marginTop: 1 }, /* @__PURE__ */ React11.createElement(Box11, null, /* @__PURE__ */ React11.createElement(Text11, { color: "red", wrap: "anywhere", bold: true }, "- ", oldVal)), /* @__PURE__ */ React11.createElement(Box11, { marginTop: 1 }, /* @__PURE__ */ React11.createElement(Text11, { color: "green", wrap: "anywhere", bold: true }, "+ ", newVal.replace(/\[\/n\]?/g, "\\n"))));
|
|
7414
7415
|
}
|
|
7415
|
-
return /* @__PURE__ */ React11.createElement(Text11, { color: "white", wrap: "anywhere" }, newVal.replace(/\[\/n\]?/g, "\\n") || "Updating file content...");
|
|
7416
|
+
return /* @__PURE__ */ React11.createElement(Text11, { color: "white", wrap: "anywhere" }, (newVal ? newVal.replace(/\[\/n\]?/g, "\\n") : null) || "Updating file content...");
|
|
7416
7417
|
})()), /* @__PURE__ */ React11.createElement(Box11, { marginTop: 1 }, /* @__PURE__ */ React11.createElement(
|
|
7417
7418
|
CommandMenu,
|
|
7418
7419
|
{
|