fluxflow-cli 1.7.15 → 1.7.16

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 +35 -15
  2. package/package.json +1 -1
package/dist/fluxflow.js CHANGED
@@ -65,7 +65,7 @@ var init_TerminalBox = __esm({
65
65
  // src/components/ChatLayout.jsx
66
66
  import React2, { useState, useEffect, useRef } from "react";
67
67
  import { Box as Box2, Text as Text2 } from "ink";
68
- var TypewriterText, cleanSignals, formatThinkText, InlineMarkdown, TableRenderer, MarkdownText, DiffLine, DiffBlock, CodeRenderer, MessageItem, ChatLayout, ChatLayout_default;
68
+ var TypewriterText, cleanSignals, formatThinkText, parseMathSymbols, InlineMarkdown, TableRenderer, MarkdownText, DiffLine, DiffBlock, CodeRenderer, MessageItem, ChatLayout, ChatLayout_default;
69
69
  var init_ChatLayout = __esm({
70
70
  "src/components/ChatLayout.jsx"() {
71
71
  init_TerminalBox();
@@ -158,6 +158,9 @@ var init_ChatLayout = __esm({
158
158
  return /* @__PURE__ */ React2.createElement(Box2, { key: i, marginLeft: isBullet ? 2 : 0, width: "100%" }, /* @__PURE__ */ React2.createElement(Text2, { italic: true, color: "gray" }, bulletPrefix, wrapped.split("\n").join("\n" + " ".repeat(bulletPrefix.length))));
159
159
  });
160
160
  };
161
+ parseMathSymbols = (content) => {
162
+ return content.replace(/\\multiply|\\mul|\\times/g, "\xD7").replace(/\\div/g, "\xF7").replace(/\\cdot/g, "\u22C5").replace(/\\infty/g, "\u221E").replace(/\\pm/g, "\xB1").replace(/\\leq/g, "\u2264").replace(/\\geq/g, "\u2265").replace(/\\neq/g, "\u2260").replace(/\\sqrt\{?(.*?)\}?/g, (_, p1) => `\u221A(${p1})`).replace(/\\alpha/g, "\u03B1").replace(/\\beta/g, "\u03B2").replace(/\\theta/g, "\u03B8").replace(/\\pi/g, "\u03C0").replace(/\\approx/g, "\u2248").replace(/\\Delta/g, "\u0394").replace(/\\sigma/g, "\u03C3").replace(/\\sum/g, "\u03A3").replace(/\\prod/g, "\u03A0").replace(/\\rightarrow|\\to/g, "\u2192").replace(/\\leftarrow/g, "\u2190").replace(/\\leftrightarrow/g, "\u2194").replace(/\\left\(|\\right\)/g, (match) => match.includes("left") ? "(" : ")").replace(/\\left\[|\\right\]/g, (match) => match.includes("left") ? "[" : "]").replace(/\\\{|\\\}/g, (match) => match.includes("{") ? "{" : "}").replace(/\\text\{?(.*?)\}?/g, "$1");
163
+ };
161
164
  InlineMarkdown = React2.memo(({ text, color }) => {
162
165
  if (!text) return null;
163
166
  const parts = text.split(/(\*\*.*?\*\*|\*.*?\*|`.*?`|\$.*?\$|\[.*?\]\s*\(.*?\)|\[.*?\]\s*\[.*?\]|https?:\/\/[^\s]+)/g);
@@ -173,12 +176,23 @@ var init_ChatLayout = __esm({
173
176
  return /* @__PURE__ */ React2.createElement(Text2, { key: j, color: "cyan", backgroundColor: "#003333" }, " ", part.slice(1, -1), " ");
174
177
  }
175
178
  if (part.startsWith("$") && part.endsWith("$")) {
176
- let content = part.slice(1, -1);
177
- if (content.startsWith("\\text{") && content.endsWith("}")) {
178
- content = content.slice(6, -1);
179
- }
180
- const mathContent = content.replace(/\\multiply/g, "\xD7").replace(/\\mul/g, "\xD7").replace(/\\times /g, "\xD7").replace(/\\div /g, "\xF7").replace(/\\cdot /g, "\u22C5").replace(/\\infty/g, "\u221E").replace(/\\pm/g, "\xB1").replace(/\\leq/g, "\u2264").replace(/\\geq/g, "\u2265").replace(/\\neq/g, "\u2260").replace(/\\left/g, "<").replace(/\\right/g, ">").replace(/\\left\(/g, "(").replace(/\\right\)/g, ")").replace(/\\sqrt/g, "\u221A").replace(/\\sqrt\[3\]/g, "\u221B").replace(/\\alpha/g, "\u03B1").replace(/\\beta/g, "\u03B2").replace(/\\theta/g, "\u03B8").replace(/\\phi/g, "\u03C6").replace(/\\delta/g, "\u03B4").replace(/\\gamma/g, "\u03B3").replace(/\\sigma/g, "\u03C3").replace(/\\pi/g, "\u03C0").replace(/\\sum/g, "\u03A3").replace(/\\lim/g, "lim").replace(/\\integral/g, "\u222B").replace(/\\diff/g, "d").replace(/\\partial/g, "\u2202").replace(/\\frac/g, "/");
181
- return /* @__PURE__ */ React2.createElement(Text2, { key: j, color: "white", backgroundColor: "#4c0099", bold: true, italic: true }, " ", mathContent, " ");
179
+ const content = part.slice(1, -1);
180
+ const latexParts = content.split(/(\\(?:mathbf|textbf|textit|underline|text|mathrm|textsf|texttt)\{.*?\})/g);
181
+ return /* @__PURE__ */ React2.createElement(Text2, { key: j, color: "yellow" }, latexParts.map((lp, lpi) => {
182
+ if (lp.startsWith("\\")) {
183
+ const match = lp.match(/\\(\w+)\{(.*?)\}/);
184
+ if (match) {
185
+ const cmd = match[1];
186
+ const inner = match[2];
187
+ const isBold = cmd === "mathbf" || cmd === "textbf";
188
+ const isItalic = cmd === "textit";
189
+ const isUnderline = cmd === "underline";
190
+ const isMono = cmd === "texttt";
191
+ return /* @__PURE__ */ React2.createElement(Text2, { key: lpi, bold: isBold, italic: isItalic, underline: isUnderline, color: isMono ? "cyan" : void 0 }, parseMathSymbols(inner));
192
+ }
193
+ }
194
+ return /* @__PURE__ */ React2.createElement(Text2, { key: lpi }, parseMathSymbols(lp));
195
+ }));
182
196
  }
183
197
  if (part.startsWith("[") && (part.includes("](") || part.includes("] ("))) {
184
198
  const match = part.match(/\[(.*?)\]\s*\((.*?)\)/);
@@ -764,10 +778,10 @@ var thinking_prompts_default;
764
778
  var init_thinking_prompts = __esm({
765
779
  "src/data/thinking_prompts.json"() {
766
780
  thinking_prompts_default = {
767
- Max: "-- START THINKING INSTRUCTIONS --\nEFFORT_LEVEL: MAX\nThink Step by Step in Chain-of-Thought. Provide the thinking in <think>...</think> block, length given. Thinking should be structured in this format:\n\n<think>\n\\n\\n\n**Heading**\n\\n\\n\nSelf MONOLOGUE\n\\n\\n\n**Heading**\n\\n\\n\nSelf MONOLOGUE\ncontinue.\n\\n\\n\n</think>\\n\\n\n\n(MUST START THE RESPONSE IN NEW LINE AFTER ENDING THINKING BLOCK)\n\n**CRITICAL**: Heading blocks: **MIN 9**, **MAX 14**. EACH HEADING SHOULD HAVE MIN 8, MAX 12 SENTENCES OF INTERNAL MONOLOGUE. EXPLORE EDGE CASES & NUANCES. Dynamic Thinking preferred based on query.\nNEVER WRITE FUNCTION CALLS IN THINKING BLOCK WITH 'tool:' PREFIX AND NEVER WRITE '[turn: ...]' INSIDE THINKING BLOCK.\nConverge Thinking & Avoid running into thinking Loops. YOU MUST NOT EXCEED ALLOTTED THINKING BUDGET. COMPLETE YOUR THINKING WITHIN LIMITS AND START YOUR RESPONSE. DEFINE YOUR DYNAMIC THINKING BUDGET BASED ON THE QUERY COMPLEXITY. DO NOT OVERTHINK SIMPLE ONES. If a query is really simple and thinking for MIN heading is waste of compute, you can stop thinking before MIN HEADING rule. BUT FOR COMPLEX QUERIES UTILIZE THE BUDGET.\n-- END THINKING INSTRUCTIONS --",
768
- High: "-- START THINKING INSTRUCTIONS --\nEFFORT_LEVEL: HIGH\nThink Step by Step in Chain-of-Thought. Provide the thinking in <think>...</think> block, length given. Thinking should be structured in this format:\n\n<think>\n\\n\\n\n**Heading**\n\\n\\n\nSelf MONOLOGUE\n\\n\\n\n**Heading**\n\\n\\n\nSelf MONOLOGUE\ncontinue.\n\\n\\n\n</think>\\n\\n\n\n(MUST START THE RESPONSE IN NEW LINE AFTER ENDING THINKING BLOCK)\n\n**CRITICAL**: Heading blocks: **MIN 8**, **MAX 11**. EACH HEADING SHOULD HAVE MIN 4, MAX 8 SENTENCES OF INTERNAL MONOLOGUE. EXPLORE EDGE CASES & THINK LONGER before responding. Dynamic Thinking preferred based on query.\nNEVER WRITE FUNCTION CALLS IN THINKING BLOCK WITH 'tool:' PREFIX AND NEVER WRITE '[turn: ...]' INSIDE THINKING BLOCK.\nConverge Thinking & Avoid running into thinking Loops. YOU MUST NOT EXCEED ALLOTTED THINKING BUDGET. COMPLETE YOUR THINKING WITHIN LIMITS AND START YOUR RESPONSE. DEFINE YOUR DYNAMIC THINKING BUDGET BASED ON THE QUERY COMPLEXITY. DO NOT OVERTHINK SIMPLE ONES. If a query is really simple and thinking for MIN heading is waste of compute, you can stop thinking before MIN HEADING rule. BUT FOR COMPLEX QUERIES UTILIZE THE BUDGET.\n-- END THINKING INSTRUCTIONS --",
769
- Medium: "-- START THINKING INSTRUCTIONS --\nEFFORT_LEVEL: MEDIUM\nThink Step by Step in Chain-of-Thought. Provide the thinking in <think>...</think> block, length given. Thinking should be structured in this format:\n\n<think>\n\\n\\n\n**Heading**\n\\n\\n\nSelf MONOLOGUE\n\\n\\n\n**Heading**\n\\n\\n\nSelf MONOLOGUE\ncontinue.\n\\n\\n\n</think>\\n\\n\n\n(MUST START THE RESPONSE IN NEW LINE AFTER ENDING THINKING BLOCK)\n\n**CRITICAL**: Heading blocks: **MIN 3**, **MAX 5**. EACH HEADING SHOULD HAVE MIN 2, MAX 4 SENTENCES OF INTERNAL MONOLOGUE. THINK LONGER FOR COMPLEX QUERIES. Dynamic Thinking preferred based on query.\nNEVER WRITE FUNCTION CALLS IN THINKING BLOCK WITH 'tool:' PREFIX AND NEVER WRITE '[turn: ...]' INSIDE THINKING BLOCK.\nConverge Thinking & Avoid running into thinking Loops. YOU MUST NOT EXCEED ALLOTTED THINKING BUDGET. COMPLETE YOUR THINKING WITHIN LIMITS AND START YOUR RESPONSE. DEFINE YOUR DYNAMIC THINKING BUDGET BASED ON THE QUERY COMPLEXITY. DO NOT OVERTHINK SIMPLE ONES. If a query is really simple and thinking for MIN heading is waste of compute, you can stop thinking before MIN HEADING rule. BUT FOR COMPLEX QUERIES UTILIZE THE BUDGET.\n-- END THINKING INSTRUCTIONS --",
770
- Minimal: "-- START THINKING INSTRUCTIONS --\nEFFORT_LEVEL: LOW\nThink Step by Step in Chain-of-Thought. Provide the thinking in <think>...</think> block, length given. Thinking should be structured in this format:\n\n<think>\n\\n\\n\n**Heading**\n\\n\\n\nSelf MONOLOGUE\n\\n\\n\n**Heading**\n\\n\\n\nSelf MONOLOGUE\ncontinue.\n\\n\\n\n</think>\\n\\n\n\n(MUST START THE RESPONSE IN NEW LINE AFTER ENDING THINKING BLOCK)\n\n**CRITICAL**: Heading blocks: **MIN 0**, **MAX 2**. EACH HEADING SHOULD HAVE MIN 1, MAX 3 SENTENCES OF INTERNAL MONOLOGUE. No Thinking is preferred if query is simple.\nNEVER WRITE FUNCTION CALLS IN THINKING BLOCK WITH 'tool:' PREFIX AND NEVER WRITE '[turn: ...]' INSIDE THINKING BLOCK.\nConverge Thinking & Avoid running into thinking Loops. YOU MUST NOT EXCEED ALLOTTED THINKING BUDGET. COMPLETE YOUR THINKING WITHIN LIMITS AND START YOUR RESPONSE. DEFINE YOUR DYNAMIC THINKING BUDGET BASED ON THE QUERY COMPLEXITY. DO NOT OVERTHINK SIMPLE ONES. If a query is really simple and thinking for MIN heading is waste of compute, you can stop thinking before MIN HEADING rule. BUT FOR COMPLEX QUERIES UTILIZE THE BUDGET.\n-- END THINKING INSTRUCTIONS --"
781
+ Max: "-- START THINKING INSTRUCTIONS --\nEFFORT_LEVEL: MAX\nThink Step by Step in Chain-of-Thought. Provide the thinking in <think>...</think> block, length given. Thinking should be structured in this format:\n\n<think>\n\\n\\n\n**Heading**\n\\n\\n\nSELF-MONOLOGUE\n\\n\\n\n**Heading**\n\\n\\n\nSelf MONOLOGUE\ncontinue.\n\\n\\n\n</think>\n\nRULES OF THINKING: -HEADING COUNT SHOULD BE 12 - 20. SELF-MONOLOGUE SHOULD BE DETAILED AND THROROUGH. MONOLOGUES SHOULD BE **8 - 12** SENTENCES EACH REGARDLESS OF QUERY COMPLEXITY.\n- YOU MUST **NOT** EXCREED YOUR ALLOTED THINKING BUDGET UNDER **ANY** CIRCUMSTANCES.\n- IF THE QUERY IS SIMPLE, YOU CAN KEEP HEADING COUNT LESS THAN MIN COUNT.\n- CONSIDER ABOUT EDGE CASES BEFORE COMMITING.\n- SHOULD PLAN ARCHITECHTURALLY.\n- SHOULD PLAN LOGICALLY.\n\n-- END THINKING INSTRUCTIONS --",
782
+ High: "-- START THINKING INSTRUCTIONS --\nEFFORT_LEVEL: HIGH\nThink Step by Step in Chain-of-Thought. Provide the thinking in <think>...</think> block, length given. Thinking should be structured in this format:\n\n<think>\n\\n\\n\n**Heading**\n\\n\\n\nSELF-MONOLOGUE\n\\n\\n\n**Heading**\n\\n\\n\nSelf MONOLOGUE\ncontinue.\n\\n\\n\n</think>\n\nnRULES OF THINKING: -HEADING COUNT SHOULD BE 8 - 12. SELF-MONOLOGUE SHOULD BE DETAILED AND THROROUGH. MONOLOGUES SHOULD BE **6 - 8** SENTENCES EACH REGARDLESS OF QUERY COMPLEXITY.\n- YOU MUST **NOT** EXCREED YOUR ALLOTED THINKING BUDGET UNDER **ANY** CIRCUMSTANCES.\n- IF THE QUERY IS SIMPLE, YOU CAN KEEP HEADING COUNT LESS THAN MIN COUNT.\n- CONSIDER ABOUT EDGE CASES BEFORE COMMITING.\n\n-- END THINKING INSTRUCTIONS --",
783
+ Medium: "-- START THINKING INSTRUCTIONS --\nEFFORT_LEVEL: MEDIUM\nThink Step by Step in Chain-of-Thought. Provide the thinking in <think>...</think> block, length given. Thinking should be structured in this format:\n\n<think>\n\\n\\n\n**Heading**\n\\n\\n\nSELF-MONOLOGUE\n\\n\\n\n**Heading**\n\\n\\n\nSelf MONOLOGUE\ncontinue.\n\\n\\n\n</think>\n\nnRULES OF THINKING: -HEADING COUNT SHOULD BE 2 - 4. SELF-MONOLOGUE SHOULD BE SHORT YET THROROUGH. MONOLOGUES SHOULD BE **4 - 6** SENTENCES EACH REGARDLESS OF QUERY COMPLEXITY.\n- YOU MUST **NOT** EXCREED YOUR ALLOTED THINKING BUDGET UNDER **ANY** CIRCUMSTANCES.\n- IF THE QUERY IS SIMPLE, YOU CAN KEEP HEADING COUNT LESS THAN MIN COUNT.\n- LITTLE TO NO THINKING IS PREFFERED IF QUERY IS CONVERSATIONAL AND SIMPLE.\n\n-- END THINKING INSTRUCTIONS --",
784
+ Minimal: "-- START THINKING INSTRUCTIONS --\nEFFORT_LEVEL: LOW\nThink Step by Step in Chain-of-Thought. Provide the thinking in <think>...</think> block, length given. Thinking should be structured in this format:\n\n<think>\n\\n\\n\n**Heading**\n\\n\\n\nSELF-MONOLOGUE\n\\n\\n\n**Heading**\n\\n\\n\nSelf MONOLOGUE\ncontinue.\n\\n\\n\n</think>\n\nnRULES OF THINKING: -HEADING COUNT SHOULD BE 0 - 2. SELF-MONOLOGUE SHOULD BE SHORT AND CONCISE. MONOLOGUES SHOULD BE **1 - 2** SENTENCES EACH REGARDLESS OF QUERY COMPLEXITY.\n- YOU MUST **NOT** EXCREED YOUR ALLOTED THINKING BUDGET UNDER **ANY** CIRCUMSTANCES.\n- IF THE QUERY IS SIMPLE, YOU CAN KEEP HEADING COUNT LESS THAN MIN COUNT.\n- NO THINKING IS PREFFERED IF QUERY IS CONVERSATIONAL AND SIMPLE.\n\n-- END THINKING INSTRUCTIONS --"
771
785
  };
772
786
  }
773
787
  });
@@ -2517,9 +2531,15 @@ USER_PROMPT: ${agentText}`.trim();
2517
2531
  }
2518
2532
  const thinkBlocks = turnText.match(/<think>([\s\S]*?)(?:<\/think>|$)/gi) || [];
2519
2533
  const thinkContent = thinkBlocks.join("");
2520
- const headingsCount = (thinkContent.match(/\*\*.*?\*\*/g) || []).length;
2521
- if (headingsCount > 35) {
2522
- yield { type: "status", content: "Loop Detected. Restarting internal loop." };
2534
+ const headingsCount = (thinkContent.match(/^\s*\*\*.*?\*\*\s*$/gm) || []).length;
2535
+ const headingSections = thinkContent.split(/^\s*\*\*.*?\*\*\s*$/gm);
2536
+ const isOverVerbose = headingSections.some((section) => {
2537
+ const wordCount = section.trim().split(/\s+/).filter((w) => w.length > 0).length;
2538
+ return wordCount > 450;
2539
+ });
2540
+ if (headingsCount > 25 || isOverVerbose) {
2541
+ const reason = headingsCount > 25 ? "Loop Detected" : "Noise Detected";
2542
+ yield { type: "status", content: `${reason}. Auto-adjusting...` };
2523
2543
  await new Promise((resolve) => setTimeout(resolve, 3e3));
2524
2544
  break;
2525
2545
  }
@@ -4682,7 +4702,7 @@ var init_app = __esm({
4682
4702
  init_setup();
4683
4703
  SESSION_START_TIME = Date.now();
4684
4704
  CHANGELOG_URL = "https://fluxflow-cli.onrender.com/changelog.html";
4685
- versionFluxflow = "1.7.15";
4705
+ versionFluxflow = "1.7.16";
4686
4706
  updatedOn = "2026-05-05";
4687
4707
  ResolutionModal = ({ data, onResolve, onEdit }) => /* @__PURE__ */ React10.createElement(Box10, { flexDirection: "column", borderStyle: "round", borderColor: "magenta", paddingX: 2, paddingY: 1, width: "100%" }, /* @__PURE__ */ React10.createElement(Text10, { color: "magenta", bold: true, underline: true }, "\u{1F7E3} STEERING HINT RESOLUTION"), /* @__PURE__ */ React10.createElement(Text10, { marginTop: 1 }, "The agent already finished the task before your hint was consumed."), /* @__PURE__ */ React10.createElement(Box10, { marginTop: 1, backgroundColor: "#222", paddingX: 1, width: "100%" }, /* @__PURE__ */ React10.createElement(Text10, { italic: true, color: "gray" }, '"', data, '"')), /* @__PURE__ */ React10.createElement(Box10, { marginTop: 1 }, /* @__PURE__ */ React10.createElement(Text10, { color: "cyan" }, "How would you like to proceed?")), /* @__PURE__ */ React10.createElement(Box10, { marginTop: 1 }, /* @__PURE__ */ React10.createElement(
4688
4708
  CommandMenu,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fluxflow-cli",
3
- "version": "1.7.15",
3
+ "version": "1.7.16",
4
4
  "description": "A high-fidelity agentic terminal assistant for the Flux Era.",
5
5
  "keywords": [
6
6
  "ai",