fluxflow-cli 1.6.6 → 1.6.7

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 +36 -30
  2. package/package.json +1 -1
package/dist/fluxflow.js CHANGED
@@ -178,9 +178,12 @@ var init_ChatLayout = __esm({
178
178
  };
179
179
  TableRenderer = React2.memo(({ buffer, terminalWidth = 80 }) => {
180
180
  if (buffer.length < 2) return null;
181
- const rows = buffer.map(
182
- (line) => line.split("|").filter((_, i, arr) => i > 0 && i < arr.length - 1).map((cell) => cell.trim())
183
- );
181
+ const rows = buffer.map((line) => {
182
+ const parts = line.split("|");
183
+ if (parts[0] !== void 0 && parts[0].trim() === "") parts.shift();
184
+ if (parts.length > 0 && parts[parts.length - 1].trim() === "") parts.pop();
185
+ return parts.map((cell) => cell.trim());
186
+ });
184
187
  const header = rows[0];
185
188
  const data = rows.slice(2);
186
189
  const colPercentage = Math.floor(100 / header.length);
@@ -208,7 +211,7 @@ var init_ChatLayout = __esm({
208
211
  };
209
212
  lines.forEach((line, i) => {
210
213
  const trimmed = line.trim();
211
- const isTableRow = trimmed.startsWith("|") && trimmed.endsWith("|");
214
+ const isTableRow = trimmed.startsWith("|");
212
215
  const isQuote = trimmed.startsWith(">");
213
216
  if (isTableRow) {
214
217
  if (quoteBuffer.length > 0) flushBuffers(i);
@@ -289,7 +292,7 @@ var init_ChatLayout = __esm({
289
292
  const match = part.match(/```(\w*)\n([\s\S]*?)```/);
290
293
  const lang = match ? match[1] : "code";
291
294
  const code = match ? match[2] : part.slice(3, -3);
292
- return /* @__PURE__ */ React2.createElement(Box2, { key: i, flexDirection: "column", marginY: 1, backgroundColor: "#111", borderStyle: "round", borderColor: "#333", paddingX: 1, width: "100%" }, /* @__PURE__ */ React2.createElement(Box2, { alignSelf: "flex-end", marginTop: -1, marginRight: 1 }, /* @__PURE__ */ React2.createElement(Text2, { backgroundColor: "#333", color: "white" }, " ", lang.toUpperCase(), " ")), /* @__PURE__ */ React2.createElement(Box2, { paddingY: 1, width: "100%" }, /* @__PURE__ */ React2.createElement(Text2, { color: "cyan", wrap: "anywhere" }, code.trim())));
295
+ return /* @__PURE__ */ React2.createElement(Box2, { key: i, flexDirection: "column", marginY: 1, backgroundColor: "#111", borderStyle: "round", borderColor: "#333", paddingX: 1, width: "100%" }, /* @__PURE__ */ React2.createElement(Box2, { alignSelf: "flex-end", marginTop: -1, marginRight: 1 }, /* @__PURE__ */ React2.createElement(Text2, { backgroundColor: "#333", color: "white" }, " ", lang.toUpperCase(), " ")), /* @__PURE__ */ React2.createElement(Box2, { paddingY: 1, width: "100%" }, /* @__PURE__ */ React2.createElement(Text2, { color: "cyan" }, wrapText(code.trim(), columns - 6))));
293
296
  }
294
297
  return /* @__PURE__ */ React2.createElement(MarkdownText, { key: i, text: part, columns });
295
298
  }));
@@ -670,22 +673,23 @@ tool:functions.tool_name(arguments)
670
673
  - WEB TOOLS (Available in Flux & Flow) -
671
674
  1. Web Search: tool:functions.web_search(query="<query>", limit=number). Find info. limit is optional (3-10, default 10). If user asks about something that is not in your training data, proactively use this tool to find the information.Winder search recomemded (limit = 10) when exploring a topic.
672
675
  2. Web Scrape: tool:functions.web_scrape(url="<url>"). provides detail from a URL.
673
- 3. Ask User: tool:functions.ask(question="...", optionA="Option::Desc", optionB="Option::Desc"). Generally use this tool for ANY ambiguity. Mandatory triggers include: 1) **Path Divergence**: When multiple architectural or technical solutions exist, present options via 'ask' instead of choosing arbitrarily. 2) **Security Boundaries**: Explicitly request permission via 'ask' before accessing sensitive files (e.g., .env, config keys, credentials). 3) **Ambiguity Resolution**: Use 'ask' to clarify vague prompts before executing terminal commands or writing code. 4) **Risk Mitigation**: Require a 'Yes/No' confirmation for any destructive or irreversible operations. Options must always follow the 'Short Label::Detailed Description' format. This tool is a non-terminating suspension so you can get guidance without losing context.
676
+ 3. Ask User: tool:functions.ask(question="...", optionA="Option::Desc", optionB="Option::Desc"). Generally use this tool for ANY ambiguity. Mandatory triggers include: 1) **Path Divergence**: When multiple architectural or technical solutions exist, present options via 'ask' instead of choosing arbitrarily. 2) **Security Boundaries**: Explicitly request permission via 'ask' before accessing sensitive files (e.g., .env, config keys, credentials). 3) **Ambiguity Resolution**: Use 'ask' to clarify vague prompts before executing terminal commands or writing code. 4) **Risk Mitigation**: Require a 'Yes/No' confirmation for any destructive or irreversible operations. Options must always follow the 'Short Label::Detailed Description' format. This tool is a non-terminating suspension so you can get guidance without losing context. PREFER USING THIS TOOL RATHER THAN FINISHING THE LOOP FOR USER CLARIFICATION.
674
677
  ${mode === "Flux" ? `
675
678
  - DEV & FILE TOOLS (Available in FLUX MODE ONLY) -
676
679
  1. View File: tool:functions.view_file(path="relative/path", start_line=number, end_line=number). Reads file content. Auto-truncates at 500 lines unless start_line and end_line are provided. You can also use this tool to read images & documents.
677
680
  2. List Files: tool:functions.list_files(path="relative/path"). Lists content of a directory.
678
681
  3. Read Folder: tool:functions.read_folder(path="relative/path"). Detailed stats of a directory.
679
- 4. Write File: tool:functions.write_file(path="path", content="content"). Creates/Overwrites. NO CODE BLOCKS. RETURNS: Disk verification + original content (if overwritten) for 100% reversibility. Escape your double quotes '"' using backslash '"'.
682
+ 4. Write File: tool:functions.write_file(path="path", content="content"). Creates/Overwrites. NO CODE BLOCKS. RETURNS: Disk verification + original content (if overwritten) for 100% reversibility. Escape your double quotes '"' using backslash.
680
683
  5. Update File: tool:functions.update_file(path="relative/path", content_to_replace="old", content_to_add="new"). Surgical patching. RETURNS: High-fidelity visual diff and old code block. You MUST verify that the change specifically matches your intent using the returned diff. PREFFER UPDATE FILE OVER WRITE FILE if file already exists for better reversal tracking (if a file has 500+ lines, try to stick with update_file over full-rewrite). DONT WRAP UPDATE FILE CALL CONTENT IN MARKDOWN CODE BLOCKS.
681
- 6. Write PDF: tool:functions.write_pdf(path="path", content="<html/css content>", orientation="portrait/landscape"). Generates a professional PDF document. Orientation are optional. A4 size page will be used, so any multi-page PDFs calculate your alightment and page breaks to not mess up A4 page layout. DO NOT ADD FOOTER MANUALLY, the system will handle it automatically. USE CSS TO VISUALLY BEAUTIFY THE DOCUMENT, USE full 100vh & 100vw for page area. ENSURE THE CONTENT IS NEVER BROKEN IN BETWEEN PAGES, USE PAGE BREAKS PROACTIVELY FOR A A4 PAGE LAYOUT.
682
- 7. Execution: tool:functions.exec_command(command="terminal command"). Runs a shell command.
684
+ 6. Write PDF: tool:functions.write_pdf(path="path", content="<html/css content>", orientation="portrait/landscape"). Generates a professional PDF document. Orientation are optional. A4 size page will be used, so any multi-page PDFs calculate your alightment and page breaks to not mess up A4 page layout. DO NOT ADD FOOTER MANUALLY, the system will handle it automatically. USE CSS TO VISUALLY BEAUTIFY THE DOCUMENT, USE full 100vh & 100vw for page area. ENSURE THE CONTENT IS NEVER BROKEN IN BETWEEN PAGES, USE PAGE BREAKS PROACTIVELY FOR A A4 PAGE LAYOUT. Keep generous margins for better redability.
685
+ 7. Execution: tool:functions.exec_command(command="terminal command"). Runs a shell command. Use ask tool to confirm before executing any destructive or irreversible operations.
683
686
 
684
687
  AFTER GETTING THE TOOL RESULT, YOU MUST VERIFY THAT ITS A SUCCESS, IF IT GIVES A ERROR, TELL THE USER AND TRY TO FIX IF YOU CAN. DO NOT HALLUCINATE SUCCESS IF TOOL RETURNS ERROR.
685
688
 
686
689
  **CRITICAL POLICY: WHEN WRITING/UPDATING FILES, USE ACTUAL NEW LINE CONTROL CHARACTER (LF) FOR LINE BREAKS RATHER THAN STRING '\\n'**`.trim() : `
687
690
  - DEV & FILE TOOLS ARE NOT AVAILABLE IN FLOW MODE. If you need to access files, tell the user to switch to FLUX MODE (manually by user).`.trim()}
688
691
  -----------------
692
+
689
693
  Results will be provided in the next loop as: [TOOL_RESULT]: [content]
690
694
  WHEN CALLING TOOLS, YOU **MUST** end your response with '[turn: continue]'. NEVER use '[turn: finish]' in the same turn as a tool call. After receiving the [TOOL_RESULT], acknowledge the output and verify if the goal is met; only then may you use '[turn: finish]', otherwise use '[turn: continue]'.
691
695
  Do NOT over-use tools. Use them only when strictly necessary for the user's objective. You can stack multiple tool calls 1-by-1.
@@ -771,11 +775,11 @@ ${userMemories}
771
775
  ` : ""}${isMemoryEnabled ? `${tempMemoriesStr}
772
776
 
773
777
  ` : ""}--- START SYSTEM INSTRUCTION ---
774
- You are Flux Flow (made by Kushal Roy Chowdhury/Flux Flow Team). A CLI Agent. Your tone will be friendly, warm, sassy, approchable, funny, NO ROMANTIC OR FLIRTY WORDS. Dont mention modes unless explicitly asked. ${mode === "Flux" ? "You are currently operating in FLUX (dev) mode. Keep your agentic approach goal oriented. Use provided tools when needed. And try to minimize number of agentic loops (Agent Loop is limited to 50 per turn, finish your goal by then). Analyze user prompt and project requirements, then plan your approach." : "You are currently operating in Flow (chat) mode. Focus more on conversation quality and user experience. Keep Agentic Loops to minimum (Agent Loop is limited to 7 per turn, finish your goal by then). You will get access to Web Tools only in this mode."}
778
+ You are Flux Flow (made by Kushal Roy Chowdhury/Flux Flow Team). A CLI Agent. Your tone will be friendly, warm, sassy, approchable, funny, NO ROMANTIC OR FLIRTY WORDS. Dont mention modes unless explicitly asked. ${mode === "Flux" ? "You are currently operating in FLUX (dev) mode. Keep your agentic approach goal oriented, conversation quality and user experience. Use provided tools when needed. And try to minimize number of agentic loops (Agent Loop is limited to 50 per turn, finish your goal by then). Analyze user prompt and project requirements, then plan your approach." : "You are currently operating in Flow (chat) mode. Focus more on conversation quality and user experience. Keep Agentic Loops to minimum (Agent Loop is limited to 7 per turn, finish your goal by then). You will get access to Web Tools only in this mode."}
775
779
  CURRENT_WORKING_DIRECTORY: ${cwdStr}.
776
- OS: ${osDetected}. ${osDetected && mode == "Flux" ? "Your terminal commands will run on CMD. Prefer PS scripts via CMD instead of raw CMD commands." : ""}
780
+ OS: ${osDetected}. ${osDetected === "Windows" && mode === "Flux" ? "Your terminal commands will run on CMD. 'Prefer using PS scripts via CMD' instead of raw CMD commands." : ""}
777
781
  ${nameStr}${nicknameStr}${userInstrStr}
778
- If you see a [STEERING HINT] from user, give that prompt priority, user can use it to help you guide if you go wrong way.
782
+ If you see a [STEERING HINT] from user, give that prompt priority for the task at hand, user can use it to help you guide if you go wrong way.
779
783
 
780
784
  ${thinkingConfig}
781
785
 
@@ -806,7 +810,7 @@ Every ${isMemoryEnabled ? "Prompt, Responses & Memories" : "Prompt & Responses"}
806
810
  -- START FORMATTING RULES --
807
811
  - Structure responses VISUALLY pleasing, easy to read, and beautiful.
808
812
  - USE GFM Markdown HEAVILY.
809
- - Use GFM tables for structured data to keep the terminal view organized. KEEP SENTENCES IN TABLE **SHORT & CONCISE**. AND MAX 3 COLUMNS. DO NOT OVERUSE TABLES.
813
+ - Use GFM tables for structured data to keep the terminal view organized. KEEP SENTENCES IN TABLE **SHORT & CONCISE**. AND MAX 4 COLUMNS. DO NOT OVERUSE TABLES.
810
814
  - **CRITICAL**: NEVER USE LaTeX IN TERMINAL RESPONSES (exception: file content).
811
815
  - Keep Poems & Literature in Code Block.
812
816
  - Use emojis & Kaomojis. Prefer Kaomojis more.
@@ -1123,8 +1127,8 @@ var init_web_search = __esm({
1123
1127
  ]
1124
1128
  });
1125
1129
  const page = await browser.newPage();
1126
- await page.setUserAgent("Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36");
1127
- await page.setViewport({ width: 1280, height: 800 });
1130
+ await page.setUserAgent("Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/147.0.0.0 Safari/537.36");
1131
+ await page.setViewport({ width: 1366, height: 768 });
1128
1132
  const jitter = attempt === 1 ? Math.random() * 1e3 + 500 : Math.random() * 2e3 + 1e3;
1129
1133
  await new Promise((r) => setTimeout(r, jitter));
1130
1134
  const searchUrl = `https://html.duckduckgo.com/html/?q=${encodeURIComponent(query)}`;
@@ -1207,8 +1211,8 @@ var init_web_scrape = __esm({
1207
1211
  ]
1208
1212
  });
1209
1213
  const page = await browser.newPage();
1210
- await page.setUserAgent("Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36");
1211
- await page.setViewport({ width: 1280, height: 1600 });
1214
+ await page.setUserAgent("Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/147.0.0.0 Safari/537.36");
1215
+ await page.setViewport({ width: 1366, height: 768 });
1212
1216
  const jitter = attempt === 1 ? Math.random() * 1e3 + 500 : Math.random() * 2e3 + 1e3;
1213
1217
  await new Promise((r) => setTimeout(r, jitter));
1214
1218
  await page.goto(url, { waitUntil: "networkidle2", timeout: 45e3 });
@@ -1255,7 +1259,7 @@ var init_web_scrape = __esm({
1255
1259
  if (!fs7.existsSync(toolLogDir)) fs7.mkdirSync(toolLogDir, { recursive: true });
1256
1260
  fs7.appendFileSync(path7.join(toolLogDir, "search-scraped.log"), `PUPPETEER ${(/* @__PURE__ */ new Date()).toISOString()} - URL: [${url}]. Length: ${cleanedHtml.length}.
1257
1261
  Content:
1258
- ${cleanedHtml}
1262
+ ${cleanedHtml}${htmlContent.length > 3e4 ? "\n\n[TRUNCATED AT 30K CHARS]" : ""}
1259
1263
 
1260
1264
  --------------------------------------------------------
1261
1265
 
@@ -1301,7 +1305,7 @@ var init_memory = __esm({
1301
1305
  if (!content) return "ERROR: Missing 'content' for temp memory.";
1302
1306
  const tempStorage = readEncryptedJson(TEMP_MEM_FILE, {});
1303
1307
  if (!tempStorage[chatId]) tempStorage[chatId] = [];
1304
- const MAX_CHARS = 3e3 * 4;
1308
+ const MAX_CHARS = 4500 * 4;
1305
1309
  let currentTotalLength = tempStorage[chatId].reduce((acc, m) => acc + m.length, 0);
1306
1310
  while (tempStorage[chatId].length > 0 && currentTotalLength + content.length > MAX_CHARS) {
1307
1311
  const removed = tempStorage[chatId].shift();
@@ -1315,7 +1319,7 @@ var init_memory = __esm({
1315
1319
  const memories = readEncryptedJson(MEMORIES_FILE, []);
1316
1320
  if (method === "add") {
1317
1321
  if (!content) return "ERROR: Missing 'content' for memory addition.";
1318
- const MAX_CHARS = 2e3 * 4;
1322
+ const MAX_CHARS = 2500 * 4;
1319
1323
  let currentTotalLength = memories.reduce((acc, m) => acc + (m.memory?.length || 0), 0);
1320
1324
  while (memories.length > 0 && currentTotalLength + content.length > MAX_CHARS) {
1321
1325
  const removed = memories.shift();
@@ -1544,14 +1548,14 @@ ${lines.map((l, i) => `${i + 1} | ${l}`).join("\n")}
1544
1548
  return `CRITICAL FAILURE: Verification failed. File [${targetPath}] is empty on disk despite success report!`;
1545
1549
  }
1546
1550
  let snippet = "";
1547
- if (verifiedLineCount <= 30) {
1551
+ if (verifiedLineCount <= 200) {
1548
1552
  snippet = verifiedLines.join("\n");
1549
1553
  } else {
1550
- const head = verifiedLines.slice(0, 15).join("\n");
1551
- const tail = verifiedLines.slice(-15).join("\n");
1554
+ const head = verifiedLines.slice(0, 100).join("\n");
1555
+ const tail = verifiedLines.slice(-100).join("\n");
1552
1556
  snippet = `${head}
1553
1557
 
1554
- ... [${verifiedLineCount - 30} lines truncated for history stability] ...
1558
+ ... [${verifiedLineCount - 200} lines truncated for history stability] ...
1555
1559
 
1556
1560
  ${tail}`;
1557
1561
  }
@@ -1560,7 +1564,9 @@ ${tail}`;
1560
1564
 
1561
1565
  - Stats: [${verifiedLineCount} lines, ${(verifiedSize / 1024).toFixed(1)} KB]
1562
1566
  ${ancestry}- Content Preview:
1563
- ${snippet}`;
1567
+ ${snippet}
1568
+
1569
+ Check if Starting and Ending matches your write.`;
1564
1570
  } catch (err) {
1565
1571
  return `ERROR: Failed to write file [${targetPath}]: ${err.message}`;
1566
1572
  }
@@ -1604,7 +1610,7 @@ var init_update_file = __esm({
1604
1610
  return `ERROR: Could not find exact match for the specified "content_to_replace" in [${targetPath}].
1605
1611
  - Disk Content Length (Normalized): ${diskLen}
1606
1612
  - Match String Length (Normalized): ${matchLen}
1607
- - Check indentation/whitespace/line breaks. Try re-reading the file for latest changes.`;
1613
+ - Check indentation/whitespace. Try re-reading the file for latest changes.`;
1608
1614
  }
1609
1615
  const startPos = currentContent.indexOf(content_to_replace);
1610
1616
  const startLine = currentContent.substring(0, startPos).split(/\r?\n/).length;
@@ -1854,7 +1860,7 @@ var init_write_pdf = __esm({
1854
1860
  path: targetPath,
1855
1861
  content,
1856
1862
  orientation = "portrait",
1857
- margin = "10px"
1863
+ margin = "0px"
1858
1864
  } = parseArgs(args);
1859
1865
  if (!targetPath) return 'ERROR: Missing "path" argument for write_pdf.';
1860
1866
  if (!content) return 'ERROR: Missing "content" (HTML/CSS) for write_pdf.';
@@ -1919,7 +1925,7 @@ var init_write_pdf = __esm({
1919
1925
  const fileName = path13.basename(targetPath);
1920
1926
  pdfDoc.setTitle(`FluxFlow ${fileName}`);
1921
1927
  pdfDoc.setAuthor("FluxFlow CLI");
1922
- pdfDoc.setSubject("Generated with AI");
1928
+ pdfDoc.setSubject("Generated with Agentic AI System");
1923
1929
  pdfDoc.setKeywords(["FluxFlow", "AI", "Agentic", "Automated"]);
1924
1930
  pdfDoc.setCreator("FluxFlow PDF Engine");
1925
1931
  pdfDoc.setProducer("FluxFlow (Generative AI)");
@@ -4343,8 +4349,8 @@ var init_app = __esm({
4343
4349
  init_setup();
4344
4350
  SESSION_START_TIME = Date.now();
4345
4351
  CHANGELOG_URL = "https://fluxflow-cli.onrender.com/changelog.html";
4346
- versionFluxflow = "1.6.6";
4347
- updatedOn = "2026-05-02";
4352
+ versionFluxflow = "1.6.7";
4353
+ updatedOn = "2026-05-03";
4348
4354
  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 (turn: finish) 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(
4349
4355
  CommandMenu,
4350
4356
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fluxflow-cli",
3
- "version": "1.6.6",
3
+ "version": "1.6.7",
4
4
  "description": "A high-fidelity agentic terminal assistant for the Flux Era.",
5
5
  "keywords": [
6
6
  "ai",