fluxflow-cli 1.14.4 → 1.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/fluxflow.js +96 -106
  2. 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,3})\s+(.*)/);
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: 0, width: "100%" }, /* @__PURE__ */ React2.createElement(Text2, { bold: true, color: level === 1 ? "cyan" : level === 2 ? "magenta" : "yellow", underline: true }, hText.toUpperCase()))
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 /* @__PURE__ */ React2.createElement(Box2, { marginBottom: 1, paddingX: 1, width: "100%" }, /* @__PURE__ */ React2.createElement(Text2, { color: "white" }, msg.text));
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 /* @__PURE__ */ React2.createElement(Box2, { marginBottom: 1, flexDirection: "column", flexShrink: 0, width: "100%", flexGrow: 1 }, msg.role === "user" ? /* @__PURE__ */ React2.createElement(
506
- Box2,
507
- {
508
- backgroundColor: "#262626",
509
- paddingX: 1,
510
- paddingY: 1,
511
- width: "100%",
512
- flexDirection: "column"
513
- },
514
- wrapText(
515
- finalContent.replace(/\r\n/g, "\n").replace(/\r/g, "\n").replace(/\\\n/g, "\n").replace(/\\$/, ""),
516
- columns - 6
517
- ).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))))
518
- ) : 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, columns }), msg.memoryUpdated && /* @__PURE__ */ React2.createElement(Box2, { marginTop: 1, width: "100%" }, /* @__PURE__ */ React2.createElement(Text2, { color: "yellow", italic: true }, "\u2728 [Memory Updated]"))));
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,39 +959,37 @@ 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="<option>::<description>", ...MAX 4)]. Ambiguity Resolution. Mandatory Triggers: Path Divergence, Security, Risk Mitigation. ask >> finish
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" ? `- FILE TOOLS (path = relative to CWD) -
968
- 1. [tool:functions.ReadFile(path="...", start_line=N, end_line=N)]. Reads contents. Supports images/docs. User gives image/doc: VIEW FIRST
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.WritePDF(path="...", content="...", orientation="...")]. PROACTIVE A4 PAGE BREAKS MUST IN CSS. HTML/CSS for PREMIUM layout (100vh/vw). No manual footers
973
- 6. [tool:functions.WriteDoc(path="...", content="...")]. A4 Word doc. Proper margins and page breaks
974
- 7. [tool:functions.Run(command="...")]. Runs a ${osDetected === "Windows" ? "Windows CMD" : "Bash"} command. Destructive/Irreversible ops -> Ask user
975
- 8. [tool:functions.SearchKeyword(keyword="...")]. Global search. Finds definitions/logic without reading every file
976
- 9. [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
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 > long chat
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 MODE`.trim()}
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
988
- - Multi-call: Stack upto 5`.trim();
991
+ - Results: Passed as [TOOL RESULT] (system priority)
992
+ - Multi-call: MAX Stack 3 per turn`.trim();
989
993
  }
990
994
  });
991
995
 
@@ -1027,21 +1031,11 @@ 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: `EFFORT_LEVEL: MAX
1031
- Think in a continuous, fluid analytical monologue within the <think>...</think> block. Do NOT use headings, markers, bullet points, or artificial sections. Engage in a rigorous "Stream of Consciousness" that aggressively interrogates the problem:
1032
- Deep Contextual Analysis: Deconstruct requirements, trace implicit assumptions, and evaluate system-wide implications.
1033
- First-Principles Design: Formulate solutions focusing on extreme modularity, DRY principles, and clean abstractions. Mentally simulate the architecture.
1034
- Adversarial Critique: 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.
1035
- Execution Orchestration: Map out a granular, step-by-step operational plan before writing code or using tools.
1036
- RULES:
1037
- - NO HEADINGS/MARKERS. Maintain a dense, unbroken analytical monologue.
1038
- - Be exhaustive. Detail the exact 'why' behind architectural choices and algorithm selections.
1039
- - Question your own logic ruthlessly as you go.
1040
- - MANDATORY THINKING: You MUST engage in full reasoning regardless of simplicity, even for greetings`,
1041
- High: "EFFORT_LEVEL: HIGH\nThink in a stable, analytical monologue within the <think>...</think> block. Avoid headings, markers or structured formatting. Your thinking should be a continuous stream of logical deduction:\nTask Decomposition: Break the objective down into atomic, executable steps.\nLogic Simulation: Mentally execute your planned code/actions. Identify missing dependencies or potential failure states.\nStructural Strategy: Ensure your approach adheres to good folder structures, modularity, and clean code practices.\nRULES:\n- NO HEADINGS/MARKERS. 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 the path forward, even for greeting.",
1042
- Medium: "EFFORT_LEVEL: MEDIUM\nThink in a concise, stable monologue within the <think>...</think> block. Focus on the core logic required to solve the task efficiently:\nDirect Path Identification: Determine the most straightforward solution that meets the requirements.\nSanity Check: Briefly review the chosen approach against obvious anti-patterns or missing imports.\nExecution Readiness: Outline the exact files and functions to modify.\nRULES:\n- NO HEADINGS/MARKERS. 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, even for greeting",
1043
- Minimal: "EFFORT_LEVEL: LOW\nThink in a brief, focused monologue within the <think>...</think> block. Just a quick mental check before acting:\nIntent Verification: Confirm what the user is asking.\nAction Mapping: Note the specific tool or file to target.\nRULES:\n- NO HEADINGS/MARKERS. Keep it to a few lines of clear, linear thought.\n- Use minimal thinking suitable for simple or conversational requests, even for greetings.",
1044
- Off: "EFFORT_LEVEL: FAST\nNo internal thinking required. Respond directly"
1034
+ xHigh: "EFFORT LEVEL: MAX\nThink in a continuous, relentless analytical monologue within <think>...</think>. Engage in adversarial self interrogation that treats every assumption as hostile until proven:\nDeconstruct requirements into atomic invariants. Trace every implicit dependency, side effect, and state mutation. Map the entire dependency graph and identify circular dependencies or tight coupling before they manifest\nEvaluate algorithmic complexity (time/space) for every operation. Consider memory models, cache locality, and allocation patterns. For concurrent systems, reason through race conditions, deadlocks, and memory ordering\nFormulate solutions by comparing multiple architectural approaches. Explicitly evaluate trade offs: monolithic vs modular, eager vs lazy, mutable vs immutable, sync vs async. Choose based on measured criteria, not intuition\nMentally execute the solution at multiple scales. What breaks at 10x load? 100x? What happens under resource exhaustion? Trace error propagation paths through every layer\nActively attempt to falsify your own logic. Steel man the opposite approach. Search for: off by one errors, integer overflow, null/undefined propagation, unhandled promises, resource leaks, SQL injection vectors, XSS vulnerabilities, CSRF holes, timing attacks, and privilege escalation paths\nReason about observability: what metrics matter? Where are the logging gaps? How will this be debugged in production at 3am?\nConsider future evolution: what changes will this architecture resist vs accommodate? Where are the extension points? What will break when requirements inevitably change?\nMap out implementation with surgical precision: exact file structure, module boundaries, interface contracts, error types, and test strategies before writing a single line\nRULES:\n- Dense, unbroken stream of consciousness that reads like an internal monologue\n- Ruthlessly question every architectural choice. Default to skepticism\n- Think in terms of invariants, contracts, and failure modes, not just happy paths\n- MANDATORY THINKING: Full reasoning required for ALL requests, including greetings (verify context, check for hidden complexity)",
1035
+ High: "EFFORT LEVEL: HIGH\nThink in a rigorous, technically grounded monologue within <think>...</think>. Treat this as a design review where every decision must be justified:\nBreak the objective into verifiable steps with clear success criteria. Identify the critical path and potential bottlenecks\nMentally compile and execute your approach. Check for: missing imports, undefined behavior, type mismatches, unhandled errors, and resource cleanup. Trace data flow from input to output, noting transformations\nRecognize design patterns and anti patterns. If you see God objects, tight coupling, or premature optimization, call it out and refactor mentally before committing\nEvaluate performance characteristics. Will this scale? Are there O(n\xB2) operations hiding in innocent looking code? Where are the allocation hotspots?\nConsider the error surface: what can fail and how? Design error handling that preserves invariants and provides actionable feedback\nReview your architecture for: separation of concerns, single responsibility, dependency inversion, and interface segregation. Ensure clean abstractions with minimal coupling\nRULES:\n- Continuous analytical flow\n- Verify correctness through first principles reasoning, not pattern matching\n- Actively search for ways your solution could fail or degrade\n- MANDATORY THINKING: Full technical verification for all tasks, minimal check for greetings",
1036
+ Medium: "EFFORT LEVEL: MEDIUM\nThink in a focused, technically-aware monologue within <think>...</think>\nIdentify the most direct path that satisfies requirements without over-engineering\nQuickly scan for obvious issues: missing error handling, incorrect input assumptions, forgotten edge cases, or missing dependencies\nVerify the solution is appropriately modular with cohesive changes\nOutline the concrete changes: which files, which functions, what the key logic looks like\nRULES:\n- NO HEADINGS/MARKERS/LISTS/BULLET POINTS. Clean logical stream\n- Efficient but deliberate. Focus energy on actionable implementation details\n- MANDATORY THINKING: Brief verification for technical tasks, minimal for greetings",
1037
+ Minimal: "EFFORT LEVEL: LOW\nThink in a quick, focused monologue within <think>...</think>. Just verify the basics:\nConfirm what the user wants and whether it's straightforward or has hidden complexity\nIdentify the specific tool, file, or action needed\nCheck for any obvious correctness issues before acting\nRULES:\n- Few lines of clear thought\n- Just enough thinking to avoid obvious mistakes\n- Suitable for simple requests and greetings",
1038
+ Off: "EFFORT LEVEL: INSTANT\nNo thinking. Immediate response"
1045
1039
  };
1046
1040
  }
1047
1041
  });
@@ -1058,7 +1052,7 @@ var init_prompts = __esm({
1058
1052
  if (!isMemoryEnabled) return "";
1059
1053
  const tempMemoriesStr = tempMemories?.length > 0 && !isContext32k ? `-- RECENT CONTEXT FROM OTHER CHATS (PRIORITY: DYNAMIC-MEDIUM, FOCUS: Chat Context > Recent) --
1060
1054
  ${tempMemories}` : "";
1061
- const userMemoriesStr = userMemories?.length > 0 ? `--- SAVED MEMORIES (PRIORITY: MEDIUM, TUNES USER PREFERENCES) ---
1055
+ const userMemoriesStr = userMemories?.length > 0 ? `--- SAVED MEMORIES (PRIORITY: MEDIUM, USER PREFERENCES) ---
1062
1056
  ${userMemories}` : "";
1063
1057
  const parts = [userMemoriesStr, tempMemoriesStr].filter((p) => p.length > 0);
1064
1058
  return parts.length > 0 ? `[SYSTEM CONTEXT]
@@ -1104,41 +1098,37 @@ ${nicknameStr.length || userInstrStr.length ? "" : "\n"}` : "";
1104
1098
  const projectContextBlock = mode === "Flux" && foundFiles.length > 0 ? `
1105
1099
  -- PROJECT CONTEXT (Source of Truth) --
1106
1100
  ${foundFiles.map((f) => `- ${f.name}: ${f.desc}`).join("\n")}
1107
- Check these first; these files > training data for project consistency. Safety rules apply` : "";
1108
- return `${nameStr}${nicknameStr}${userInstrStr}[SYSTEM (OVERRIDES EVERYTHING)]
1109
- Identity: Flux Flow (by Kushal Roy Chowdhury). Sassy${mode === "Flux" ? "" : ", Friendly, Humorous, Sarcastic"}, CLI Agent
1110
- Mode: ${mode}${thinkingLevel !== "Fast" ? " (Thinking Mode)" : ""}. ${mode === "Flux" ? "Expert Developer & Orchestrator: Logical, Highly Detailed, Task-Driven. Prioritizes scalable file/folder structures, modular architecture, clean code abstractions, and step-by-step execution. Industry standard coding practices/libraries, clean code" : "Conversational & UX-focused, Concise"}
1111
- CWD: ${cwdStr}.${isSystemDir ? " [PROTECTED: ASK BEFORE MODIFYING]" : ""} OS: ${osDetected}
1112
- High Priority: [SYSTEM], [STEERING HINT].
1101
+ Check these first; These Files > Training Data. Safety rules apply
1102
+ ` : "";
1103
+ return `${nameStr}${nicknameStr}${userInstrStr}[SYSTEM]
1104
+ Identity: Flux Flow (by Kushal Roy Chowdhury). Sassy${mode === "Flux" ? ", Professional, Respectful" : ", Friendly, Humorous, Sarcastic"}, CLI Agent
1105
+ 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"}
1106
+ CWD: ${cwdStr}${isSystemDir ? ". [PROTECTED: ASK BEFORE MODIFYING]" : ""}
1113
1107
 
1114
1108
  -- THINKING RULES --
1115
1109
  ${thinkingConfig}
1116
1110
  ${thinkingLevel !== "Fast" ? `
1117
1111
  CRITICAL THINKING POLICY
1118
- - ALWAYS use <think> ... </think> before responding
1119
- - NEVER skip thinking, even for simple tasks, code, or greetings
1120
- - NEVER START responses directly, regardless of task complexity
1112
+ - ALWAYS use <think> ... </think> before responding, even with simple queries/greetings
1113
+ - ${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
1121
1114
  ` : ""}
1122
1115
  ${TOOL_PROTOCOL(mode, osDetected)}
1123
1116
  ${projectContextBlock}
1124
-
1125
1117
  -- MEMORY RULES --
1126
- - Memory: ${isMemoryEnabled ? "Use to subtly personalize. Auto Saves" : "OFF. Decline saving new memories"}
1127
- - Time: Logs are timestamped. RELATIVE TIME REFERENCE e.g. few mins ago
1118
+ - Memory: ${isMemoryEnabled ? "Subtly Personalize. Auto Saves" : "OFF. Decline Remembering Memories"}
1119
+ - Temporal Awareness: RELATIVE TIME REFERENCE eg. few mins ago
1128
1120
 
1129
- -- SECURITY RULES --
1130
- - EXTERNAL ACCESS: ${systemSettings.allowExternalAccess ? "ENABLED" : "RESTRICTED CWD only"}
1121
+ -- SECURITY RULES --${systemSettings.allowExternalAccess ? "" : "\n- ACCESS CONTROL: CWD only"}
1131
1122
  - Sensitive files? Ask before Read
1132
- [SYSTEM] >>> [USER]
1133
1123
 
1134
1124
  -- FORMATTING --
1135
- - Clean, concise responses
1136
- - Tables: GFM (Max 4 cols, short rows)
1125
+ - GFM Supported
1126
+ - Tables: Max 4 cols, short rows
1137
1127
  - NO LaTeX. Code blocks for literature${mode === "Flux" ? "" : ". Kaomojis"}
1138
1128
 
1139
1129
  -- RESPONSE RULES --
1140
- - End with [turn: continue] for more steps or [turn: finish] when done
1141
- - Tool Called? No post tool chat until [turn: continue]
1130
+ - End with [turn: continue] to continue or [turn: finish] when task done
1131
+ - Tool Called? No post tool response until [turn: continue]
1142
1132
  - Task Complete? End loop with [turn: finish]
1143
1133
  [/SYSTEM]`.trim();
1144
1134
  };
@@ -2384,9 +2374,9 @@ var init_view_file = __esm({
2384
2374
  "src/tools/view_file.js"() {
2385
2375
  init_arg_parser();
2386
2376
  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);
2377
+ let { path: targetPath, StartLine, EndLine, start_line, end_line, startLine, endLine } = parseArgs(args);
2378
+ const sLine = parseInt(StartLine || start_line || startLine);
2379
+ const eLine = parseInt(EndLine || end_line || endLine);
2390
2380
  const finalStart = sLine || 1;
2391
2381
  const finalEnd = eLine || (sLine ? sLine + 800 : 800);
2392
2382
  if (!targetPath) return 'ERROR: Missing "path" argument for view_file.';
@@ -3814,7 +3804,7 @@ var init_ai = __esm({
3814
3804
  const persistentStorage = readEncryptedJson(MEMORIES_FILE, []);
3815
3805
  const janitorUserMemories = persistentStorage.map((m) => `- [${m.id}]: ${m.memory}`).join("\n");
3816
3806
  const janitorContents = history.slice(0, -1).filter((msg) => msg.text && !msg.text.includes("[TOOL RESULT]") && !msg.text.includes("OBSERVATION:") && !msg.isMeta && !msg.isLogo && !String(msg.id).startsWith("welcome") && !String(msg.id).startsWith("logo")).slice(-14).map((msg) => {
3817
- let processedText = msg.text.replace(/\[tool:functions\..*?\]/g, "").replace(/<think>[\s\S]*?<\/think>/g, "").replace(/\[Prompted on:.*?\]/g, "").replace(/\[METADATA \(PRIORITY: DYNAMIC\)\] Time: ([^|\n]+)/g, (match, p1) => {
3807
+ let processedText = msg.text.replace(/\[tool:functions\..*?\]/g, "").replace(/(?:<think>|\[think\])[\s\S]*?(?:<\/think>|\[\/think\])/g, "").replace(/\[Prompted on:.*?\]/g, "").replace(/\[METADATA \(PRIORITY: DYNAMIC\)\] Time: ([^|\n]+)/g, (match, p1) => {
3818
3808
  return `[METADATA (PRIORITY: DYNAMIC)] Time: ${p1.replace(/:\d{2}/g, "")}`;
3819
3809
  }).replace(/\[turn: continue\]/g, "").replace(/\[turn: finish\]/g, "").replace(/\[TOOL RESULTS\]/g, "").replace(/\[tool results\]/g, "").replace(/\r?\n\r?\n/g, "\n").replace(/\n\n/g, "\n").replace(/\\n\\n/g, "").trim();
3820
3810
  const limit = msg.role === "user" ? USER_CONTEXT_LENGTH : AGENT_CONTEXT_LENGTH;
@@ -3832,13 +3822,13 @@ var init_ai = __esm({
3832
3822
  const hasTitleSignal = agentText.includes("[TITLE-UPDATE]");
3833
3823
  const thisHas80pChanceOfBeingTrue = Math.random() < 0.8;
3834
3824
  const needTitle = isFirstPrompt || hasTitleSignal || thisHas80pChanceOfBeingTrue;
3835
- const cleanedFullResponse = fullAgentTextRaw.replace(/<think>[\s\S]*?<\/think>/g, "").trim();
3825
+ const cleanedFullResponse = fullAgentTextRaw.replace(/(?:<think>|\[think\])[\s\S]*?(?:<\/think>|\[\/think\])/g, "").trim();
3836
3826
  const janitorPrompt = getJanitorInstruction(
3837
3827
  janitorUserMemories,
3838
3828
  isMemoryEnabled,
3839
3829
  needTitle
3840
3830
  );
3841
- let agentRes = `${cleanedFullResponse.replace(/\[tool:functions\..*?\]/g, "").replace(/<think>.*<\/think>/g, "").replace(/\[Prompted on:.*?\]/g, "").replace(/\[turn: continue\]/g, "").replace(/\[turn: finish\]/g, "").replace(/\[TOOL RESULTS\]/g, "").replace(/\[tool results\]/g, "").substring(0, AGENT_CONTEXT_LENGTH)}`;
3831
+ let agentRes = `${cleanedFullResponse.replace(/\[tool:functions\..*?\]/g, "").replace(/(?:<think>|\[think\])[\s\S]*?(?:<\/think>|\[\/think\])/g, "").replace(/\[Prompted on:.*?\]/g, "").replace(/\[turn: continue\]/g, "").replace(/\[turn: finish\]/g, "").replace(/\[TOOL RESULTS\]/g, "").replace(/\[tool results\]/g, "").substring(0, AGENT_CONTEXT_LENGTH)}`;
3842
3832
  if (agentRes.length > AGENT_CONTEXT_LENGTH) {
3843
3833
  agentRes += "\n... (truncated) ...";
3844
3834
  }
@@ -4037,7 +4027,7 @@ ${originalTextProcessed.length > USER_CONTEXT_LENGTH ? "... (truncated) ...\n\n"
4037
4027
  let match;
4038
4028
  while ((match = toolRegex.exec(text)) !== null) {
4039
4029
  const before = text.substring(lastIdx, match.index);
4040
- result += stripThoughts ? before.replace(/<think>[\s\S]*?(?:<\/think>|$)/gi, "") : before;
4030
+ result += stripThoughts ? before.replace(/(?:<think>|\[think\])[\s\S]*?(?:<\/think>|\[\/think\]|$)/gi, "") : before;
4041
4031
  const startIdx = match.index + match[0].length - 1;
4042
4032
  let balance = 0;
4043
4033
  let inString = null;
@@ -4077,7 +4067,7 @@ ${originalTextProcessed.length > USER_CONTEXT_LENGTH ? "... (truncated) ...\n\n"
4077
4067
  }
4078
4068
  }
4079
4069
  if (lastIdx < text.length) {
4080
- result += stripThoughts ? text.substring(lastIdx).replace(/<think>[\s\S]*?(?:<\/think>|$)/gi, "") : text.substring(lastIdx);
4070
+ result += stripThoughts ? text.substring(lastIdx).replace(/(?:<think>|\[think\])[\s\S]*?(?:<\/think>|\[\/think\]|$)/gi, "") : text.substring(lastIdx);
4081
4071
  }
4082
4072
  return result;
4083
4073
  };
@@ -4329,7 +4319,7 @@ ${thinkingLevel != "Fast" ? "[SYSTEM] **STRICTLY FOLLOW THINKING POLICY AS CORE
4329
4319
  let wasToolCalledInLastLoop = false;
4330
4320
  modifiedHistory.forEach((msg) => {
4331
4321
  if (msg.text && msg.role === "agent") {
4332
- msg.text = msg.text.replace(/<(think|thought)>[\s\S]*?<\/(think|thought)>/gi, "").trim();
4322
+ msg.text = msg.text.replace(/(?:<(think|thought)>|\[(think|thought)\])[\s\S]*?(?:<\/(think|thought)>|\[\/(think|thought)\])/gi, "").trim();
4333
4323
  }
4334
4324
  });
4335
4325
  for (let loop = 0; loop <= MAX_LOOPS; loop++) {
@@ -4349,7 +4339,7 @@ ${thinkingLevel != "Fast" ? "[SYSTEM] **STRICTLY FOLLOW THINKING POLICY AS CORE
4349
4339
 
4350
4340
  [STEERING HINT]: ${hint}`;
4351
4341
  } else {
4352
- modifiedHistory.push({ role: "user", text: `${thinkingLevel != "Fast" ? "[SYSTEM] **STRICTLY FOLLOW THINKING POLICY AS STRICT PRIORITY. DO NOT START A RESPONSE WITHOUT THINKING**\n" : ""}[STEERING HINT]: ${hint}` });
4342
+ 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
4343
  }
4354
4344
  yield { type: "status", content: "Steering Hint Injected." };
4355
4345
  }
@@ -4416,14 +4406,14 @@ ${thinkingLevel != "Fast" ? "[SYSTEM] **STRICTLY FOLLOW THINKING POLICY AS CORE
4416
4406
  const currentSystemInstruction = getSystemInstruction(profile, thinkingLevel, mode, systemSettings, isMemoryEnabled, MAX_LOOPS, loop + 1);
4417
4407
  const jitInstruction = `
4418
4408
 
4419
- [SYSTEM] Tool result received. Analyze output and proceed with your turn.${thinkingLevel != "Fast" ? "**STRICTLY MAINTAIN THINKING PROTOCOL. DO NOT START A RESPONSE WITHOUT THINKING**" : ""}`;
4409
+ [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
4410
  const lastUserMsg = contents[contents.length - 1];
4421
4411
  let addedMarker = false;
4422
4412
  if (lastUserMsg && lastUserMsg.role === "user" && lastUserMsg.parts?.[0]?.text?.startsWith("[TOOL RESULT]")) {
4423
4413
  lastUserMsg.parts[0].text += jitInstruction;
4424
4414
  addedMarker = true;
4425
4415
  }
4426
- const stepThreshold = Math.floor(MAX_LOOPS * (mode === "Flux" ? 0.95 : 0.7));
4416
+ const stepThreshold = Math.floor(MAX_LOOPS * (mode === "Flux" ? 0.98 : 0.7));
4427
4417
  const currentStep = loop + 1;
4428
4418
  if (currentStep >= stepThreshold && lastUserMsg && lastUserMsg.parts?.[0]) {
4429
4419
  lastUserMsg.parts[0].text += `
@@ -4478,8 +4468,8 @@ ${thinkingLevel != "Fast" ? "[SYSTEM] **STRICTLY FOLLOW THINKING POLICY AS CORE
4478
4468
  }
4479
4469
  const cleanText = dedupeBuffer.substring(overlapLen);
4480
4470
  if (cleanText) {
4481
- const hasOpenThink = /<(think|thought)>(?:(?!<\/(?:think|thought)>)[\s\S])*$/i.test(accumulatedContext);
4482
- const dedupeClean = hasOpenThink ? cleanText.replace(/^\s*<(think|thought)>\s*/gi, "") : cleanText.replace(/^\s*<(think|thought)>[\s\S]*?<\/(think|thought)>\s*/gi, "").replace(/^\s*<(think|thought)>\s*/gi, "");
4471
+ const hasOpenThink = /(?:<(think|thought)>|\[(think|thought)\])(?:(?!(?:<\/(?:think|thought)>|\[\/(?:think|thought)\]))[\s\S])*$/i.test(accumulatedContext);
4472
+ const dedupeClean = hasOpenThink ? cleanText.replace(/^\s*(?:<(think|thought)>|\[(think|thought)\])\s*/gi, "") : cleanText.replace(/^\s*(?:<(think|thought)>|\[(think|thought)\])[\s\S]*?(?:<\/(think|thought)>|\[\/(think|thought)\])\s*/gi, "").replace(/^\s*(?:<(think|thought)>|\[(think|thought)\])\s*/gi, "");
4483
4473
  if (dedupeClean) {
4484
4474
  turnText += dedupeClean;
4485
4475
  yield { type: "text", content: dedupeClean };
@@ -4563,7 +4553,7 @@ ${thinkingLevel != "Fast" ? "[SYSTEM] **STRICTLY FOLLOW THINKING POLICY AS CORE
4563
4553
  }
4564
4554
  }
4565
4555
  const contextSafeText = getContextSafeText(turnText, false);
4566
- const thinkBlocks = contextSafeText.match(/<think>([\s\S]*?)(?:<\/think>|$)/gi) || [];
4556
+ const thinkBlocks = contextSafeText.match(/(?:<think>|\[think\])([\s\S]*?)(?:<\/think>|\[\/think\]|$)/gi) || [];
4567
4557
  const thinkContent = thinkBlocks.join("").trim();
4568
4558
  const sentences = thinkContent.split(/[.!?]\s+/);
4569
4559
  const uniqueSentences = new Set(sentences);
@@ -4572,11 +4562,11 @@ ${thinkingLevel != "Fast" ? "[SYSTEM] **STRICTLY FOLLOW THINKING POLICY AS CORE
4572
4562
  let repetitionThresholdThinking = 0.4;
4573
4563
  let repetitionThresholdResponse = 0.6;
4574
4564
  const thinkingCaps = {
4575
- "low": 200,
4576
- "medium": 500,
4577
- "high": 2e3,
4578
- "max": 3500,
4579
- "xhigh": 3500
4565
+ "low": 256,
4566
+ "medium": 768,
4567
+ "high": 2048,
4568
+ "max": 4096,
4569
+ "xhigh": 4096
4580
4570
  };
4581
4571
  const cap = thinkingCaps[thinkingLevel?.toLowerCase()] || 2500;
4582
4572
  let isOverVerboseThinking = wordCount > cap;
@@ -4649,7 +4639,7 @@ ${thinkingLevel != "Fast" ? "[SYSTEM] **STRICTLY FOLLOW THINKING POLICY AS CORE
4649
4639
  await new Promise((resolve) => setTimeout(resolve, 3e3));
4650
4640
  break;
4651
4641
  }
4652
- const toolActionableText = turnText.replace(/<think>[\s\S]*?(?:<\/think>|$)/gi, "");
4642
+ const toolActionableText = turnText.replace(/(?:<think>|\[think\])[\s\S]*?(?:<\/think>|\[\/think\]|$)/gi, "");
4653
4643
  const allToolsFound = detectToolCalls(toolActionableText);
4654
4644
  while (allToolsFound.length > toolCallPointer) {
4655
4645
  const toolCall = allToolsFound[toolCallPointer];
@@ -4683,9 +4673,9 @@ ${thinkingLevel != "Fast" ? "[SYSTEM] **STRICTLY FOLLOW THINKING POLICY AS CORE
4683
4673
  const url = parseArgs(toolCall.args).url || "...";
4684
4674
  label = `\u{1F4D6} READ SITE: ${url}`.toUpperCase();
4685
4675
  } 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;
4676
+ const { path: targetPath2, StartLine, EndLine, start_line, end_line, startLine, endLine } = parseArgs(toolCall.args);
4677
+ const rawStart = StartLine || start_line || startLine;
4678
+ const rawEnd = EndLine || end_line || endLine;
4689
4679
  const sLine = parseInt(rawStart) || 1;
4690
4680
  const eLine = parseInt(rawEnd) || (rawStart ? sLine + 800 : 800);
4691
4681
  let totalLines = "...";
@@ -4771,7 +4761,7 @@ ${boxBottom}` };
4771
4761
  const absoluteCwd = path15.resolve(process.cwd());
4772
4762
  if (isExternalOff && !absoluteTarget.startsWith(absoluteCwd)) {
4773
4763
  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}${thinkingLevel != "Fast" ? "\n\n[SYSTEM] **STRICTLY FOLLOW THINKING POLICY AS STRICT PRIORITY. DO NOT START A RESPONSE WITHOUT THINKING**" : ""}` });
4764
+ toolResults.push({ role: "user", text: `[TOOL RESULT]: ERROR: ${denyMsg}` });
4775
4765
  yield { type: "tool_result", content: `[TOOL RESULT]: ERROR: ${denyMsg}` };
4776
4766
  toolCallPointer++;
4777
4767
  continue;
@@ -4784,7 +4774,7 @@ ${boxBottom}` };
4784
4774
  if (approval === "deny") {
4785
4775
  if (normToolName === "exec_command" && settings.onExecEnd) settings.onExecEnd();
4786
4776
  const denyMsg = `Permission Denied: User rejected the ${normToolName === "exec_command" ? "terminal execution" : "file edit"}.`;
4787
- toolResults.push({ role: "user", text: `[TOOL RESULT]: DENIED: ${denyMsg}${thinkingLevel != "Fast" ? "\n\n[SYSTEM] **STRICTLY FOLLOW THINKING POLICY AS STRICT PRIORITY. DO NOT START A RESPONSE WITHOUT THINKING**" : ""}` });
4777
+ toolResults.push({ role: "user", text: `[TOOL RESULT]: DENIED: ${denyMsg}` });
4788
4778
  yield { type: "tool_result", content: `[TOOL RESULT]: DENIED: ${denyMsg}` };
4789
4779
  await incrementUsage("toolDenied");
4790
4780
  if (settings.onToolResult) settings.onToolResult("denied", normToolName);
@@ -4862,8 +4852,8 @@ ${boxBottom}` };
4862
4852
  }
4863
4853
  const cleanText = dedupeBuffer.substring(overlapLen);
4864
4854
  if (cleanText) {
4865
- const hasOpenThink = /<(think|thought)>(?:(?!<\/(?:think|thought)>)[\s\S])*$/i.test(accumulatedContext);
4866
- const dedupeClean = hasOpenThink ? cleanText.replace(/^\s*<(think|thought)>\s*/gi, "") : cleanText.replace(/^\s*<(think|thought)>[\s\S]*?<\/(think|thought)>\s*/gi, "").replace(/^\s*<(think|thought)>\s*/gi, "");
4855
+ const hasOpenThink = /(?:<(think|thought)>|\[(think|thought)\])(?:(?!(?:<\/(?:think|thought)>|\[\/(?:think|thought)\]))[\s\S])*$/i.test(accumulatedContext);
4856
+ const dedupeClean = hasOpenThink ? cleanText.replace(/^\s*(?:<(think|thought)>|\[(think|thought)\])\s*/gi, "") : cleanText.replace(/^\s*(?:<(think|thought)>|\[(think|thought)\])[\s\S]*?(?:<\/(think|thought)>|\[\/(think|thought)\])\s*/gi, "").replace(/^\s*(?:<(think|thought)>|\[(think|thought)\])\s*/gi, "");
4867
4857
  if (dedupeClean) {
4868
4858
  turnText += dedupeClean;
4869
4859
  yield { type: "text", content: dedupeClean };
@@ -4877,7 +4867,7 @@ ${boxBottom}` };
4877
4867
  const hasFinish2 = /\[\s*(turn\s*:)?\s*finish\s*\]/i.test(signalSafeText2.toLowerCase());
4878
4868
  const hasContinue = /\[\s*(turn\s*:)?\s*continue\s*\]/i.test(signalSafeText2.toLowerCase());
4879
4869
  const didCallTool = toolResults.length > 0 || lastToolSniffed !== null;
4880
- const pureOutputText = signalSafeText2.replace(/<think>[\s\S]*?<\/think>/gi, "").trim();
4870
+ const pureOutputText = signalSafeText2.replace(/(?:<think>|\[think\])[\s\S]*?(?:<\/think>|\[\/think\])/gi, "").trim();
4881
4871
  const endsNormally = /[.!?}"'`’“”]$|```$/s.test(pureOutputText);
4882
4872
  if (!hasFinish2 && !hasContinue && !didCallTool && signalSafeText2.length > 0 && !endsNormally && !isThinkingLoop && !isStutteringLoop && !isGeneralLoop) {
4883
4873
  throw new Error("Silent stream cutoff (500): Model stream closed cleanly but cut off mid-sentence without signals.");
@@ -4901,8 +4891,8 @@ ${boxBottom}` };
4901
4891
  }
4902
4892
  const cleanText = dedupeBuffer.substring(overlapLen);
4903
4893
  if (cleanText) {
4904
- const hasOpenThink = /<(think|thought)>(?:(?!<\/(?:think|thought)>)[\s\S])*$/i.test(accumulatedContext);
4905
- const dedupeClean = hasOpenThink ? cleanText.replace(/^\s*<(think|thought)>\s*/gi, "") : cleanText.replace(/^\s*<(think|thought)>[\s\S]*?<\/(think|thought)>\s*/gi, "").replace(/^\s*<(think|thought)>\s*/gi, "");
4894
+ const hasOpenThink = /(?:<(think|thought)>|\[(think|thought)\])(?:(?!(?:<\/(?:think|thought)>|\[\/(?:think|thought)\]))[\s\S])*$/i.test(accumulatedContext);
4895
+ const dedupeClean = hasOpenThink ? cleanText.replace(/^\s*(?:<(think|thought)>|\[(think|thought)\])\s*/gi, "") : cleanText.replace(/^\s*(?:<(think|thought)>|\[(think|thought)\])[\s\S]*?(?:<\/(think|thought)>|\[\/(think|thought)\])\s*/gi, "").replace(/^\s*(?:<(think|thought)>|\[(think|thought)\])\s*/gi, "");
4906
4896
  if (dedupeClean) {
4907
4897
  turnText += dedupeClean;
4908
4898
  }
@@ -4987,9 +4977,9 @@ Error Log can be found in ${path15.join(LOGS_DIR, "agent", "error.log")}`);
4987
4977
  }
4988
4978
  fullAgentResponseChunks.push(turnText);
4989
4979
  let textToProcess = turnText;
4990
- const thinkMatch = turnText.match(/<think>([\s\S]*?)<\/think>/i);
4980
+ const thinkMatch = turnText.match(/(?:<think>|\[think\])([\s\S]*?)(?:<\/think>|\[\/think\])/i);
4991
4981
  if (thinkMatch) {
4992
- textToProcess = turnText.replace(/<think>[\s\S]*?<\/think>/i, "");
4982
+ textToProcess = turnText.replace(/(?:<think>|\[think\])[\s\S]*?(?:<\/think>|\[\/think\])/i, "");
4993
4983
  }
4994
4984
  const signalSafeText = getSanitizedText(turnText);
4995
4985
  const hasFinish = /\[\s*(turn\s*:)?\s*finish\s*\]/i.test(signalSafeText.toLowerCase());
@@ -4999,7 +4989,7 @@ Error Log can be found in ${path15.join(LOGS_DIR, "agent", "error.log")}`);
4999
4989
  let isActuallyFinished = hasFinish && !shouldContinue;
5000
4990
  if (isActuallyFinished) {
5001
4991
  const fullAgentTextRaw = fullAgentResponseChunks.join("\n");
5002
- const cleanedFullResponse = fullAgentTextRaw.replace(/<think>[\s\S]*?<\/think>/g, "").trim();
4992
+ const cleanedFullResponse = fullAgentTextRaw.replace(/(?:<think>|\[think\])[\s\S]*?(?:<\/think>|\[\/think\])/g, "").trim();
5003
4993
  yield {
5004
4994
  type: "interactive_turn_finished",
5005
4995
  data: {
@@ -7407,12 +7397,12 @@ Selection: ${val}`,
7407
7397
  case "approval":
7408
7398
  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
7399
  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;
7400
+ const oldVal = args2.TargetContent || args2.content_to_replace || args2.replaceContent || null;
7401
+ const newVal = args2.content || args2.ReplacementContent || args2.content_to_add || args2.replacementContent || args2.newContent || null;
7412
7402
  if (oldVal && newVal) {
7413
7403
  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
7404
  }
7415
- return /* @__PURE__ */ React11.createElement(Text11, { color: "white", wrap: "anywhere" }, newVal.replace(/\[\/n\]?/g, "\\n") || "Updating file content...");
7405
+ return /* @__PURE__ */ React11.createElement(Text11, { color: "white", wrap: "anywhere" }, (newVal ? newVal.replace(/\[\/n\]?/g, "\\n") : null) || "Updating file content...");
7416
7406
  })()), /* @__PURE__ */ React11.createElement(Box11, { marginTop: 1 }, /* @__PURE__ */ React11.createElement(
7417
7407
  CommandMenu,
7418
7408
  {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "fluxflow-cli",
3
- "version": "1.14.4",
4
- "date": "2026-05-25",
3
+ "version": "1.15.0",
4
+ "date": "2026-05-26",
5
5
  "description": "A high-fidelity agentic terminal assistant for the Flux Era.",
6
6
  "keywords": [
7
7
  "ai",