fluxflow-cli 1.8.12 → 1.8.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/fluxflow.js +56 -22
  2. package/package.json +1 -1
package/dist/fluxflow.js CHANGED
@@ -696,8 +696,9 @@ ${mode === "Flux" ? `
696
696
  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 SEE IMAGES AND DOCUMENTS IN A FOLDER. IF USER ASK HOW TO SHARE A IMAGE TELL THEM TO PASTE THE IMAGE IN THE CURRENT FOLDER. IF USER GIVES A IMAGE/DOCUMENT, YOU MUST SEE IT FIRST BEFORE DOING ANYTHING.
697
697
  2. List Files: tool:functions.list_files(path="relative/path"). Lists content of a directory.
698
698
  3. Read Folder: tool:functions.read_folder(path="relative/path"). Detailed stats of a directory. Prefer this one over list_files.
699
- 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.
700
- 5. Update File: tool:functions.update_file(path="relative/path", content_to_replace="old/fuzzy indentation matching supported", 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. KEEP YOUR PATCH INDENTATION AT BASE LEVEL WITH INTERNAL NESTED INDENTATION IN YOUR PROVIDED CODE INTACT, THE SYSTEM WILL HANDLE FILE LEVEL INDENTATION.
699
+ 4. Write File: tool:functions.write_file(path="path", content="First Line
700
+ Second Line with literal [/n] sequence"). Creates/Overwrites. NO CODE BLOCKS.
701
+ 5. Update File: tool:functions.update_file(path="path", content_to_replace="old content", content_to_add="new content with [/n]"). Surgical patching.
701
702
  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.
702
703
  7. Write DOCX: tool:functions.write_docx(path="path", content="<html content>"). Generates a professional Word document (.docx) from HTML. You can make multiple pages. Default Page dimentions will be A4, use proper margins and page break strategy.
703
704
  8. Write PPTX: tool:functions.write_pptx(path="path", content="<h1 style='color: #0088CC;'>Title</h1><ul style='font-size: 14pt;'><li>Point A</li></ul>
@@ -714,9 +715,11 @@ NEVER GUESS A CODE, IF UNSURE READ THE FILE FIRST BEFORE EDITING IT.
714
715
  Prefer write_file tool to write code instead of chat by default.
715
716
 
716
717
  *** [\u{1F6A8} CRITICAL POLICY: NEWLINE CONTROL \u{1F6A8}] ***
717
- 1. FOR ACTUAL LINE BREAKS IN FILES: Use standard LF (press Enter).
718
- 2. TO WRITE THE LITERAL STRING '\\n' INTO A FILE: Use [/n].
719
- \u{1F6D1} FAILURE TO FOLLOW THIS WILL BREAK CODE INDENTATION AND SYNTAX.
718
+ 1. FOR ACTUAL CODE STRUCTURE (Line Breaks): Use standard LF (Press ENTER inside the tool argument).
719
+ 2. TO WRITE THE LITERAL CHARACTERS '\\' AND 'n' (e.g., inside printf("Hello\\n")): You MUST use the sequence [/n].
720
+ 3. \u{1F6D1} NEVER USE "\\\\n" (backslash-n) inside tool arguments for literal strings; the system parser will convert it into a real structural line break, which WILL BREAK your code syntax (e.g. in C, Python).
721
+ 4. ALWAYS check the tool result diff to ensure your [/n] was correctly translated to a literal
722
+ .
720
723
  ***`.trim() : `
721
724
  - 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()}
722
725
  -----------------
@@ -859,7 +862,16 @@ Every ${isMemoryEnabled ? "Prompt, Responses & Memories" : "Prompt & Responses"}
859
862
  -- END TEMPORAL AWARENESS --
860
863
 
861
864
  -- START FORMATTING RULES --
862
- - CRITICAL NEWLINE PROTOCOL: When writing or updating files, you MUST use actual line breaks (LF) for structural newlines. If you need to write the literal characters '\\n' into a file, you MUST use the DSL sequence '[/n]'.
865
+ - CRITICAL NEWLINE PROTOCOL: When writing or updating files, you MUST use actual line breaks (LF) for structural newlines. If you need to write the literal characters '\\' and 'n' (e.g., in printf("Hello\\n")), you MUST use the sequence '[/n]'.
866
+ [CORRECT]:
867
+ tool:functions.write_file(path="test.c", content="#include <stdio.h>
868
+ int main() {
869
+ printf("Hello[/n]");
870
+ return 0;
871
+ }")
872
+ [INCORRECT]:
873
+ tool:functions.write_file(path="test.c", content="#include <stdio.h>\\nint main() {\\nprintf("Hello\\\\n");\\n}")
874
+ \u{1F6D1} NEVER use '\\\\n' for literals; it will be converted to a real line break and break code syntax.
863
875
  - Structure responses VISUALLY pleasing, easy to read, and beautiful.
864
876
  - USE GFM Markdown HEAVILY.
865
877
  - 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.
@@ -1192,9 +1204,9 @@ var init_arg_parser = __esm({
1192
1204
  }
1193
1205
  const after = argsString.substring(qIdx + 1).trim();
1194
1206
  const isLogicalEnd = after === "" || // End of entire string
1195
- after.startsWith(")") || // End of tool call
1196
1207
  after.startsWith(",") || // Next argument separator
1197
- /^(\w+)\s*=/.test(after);
1208
+ /^(\w+)\s*=/.test(after) || // Next argument key=
1209
+ after.startsWith(")") && (after.length === 1 || /^\)\s*([,\]\s]|tool:)/i.test(after));
1198
1210
  if (isLogicalEnd) {
1199
1211
  end = qIdx;
1200
1212
  break;
@@ -1210,10 +1222,11 @@ var init_arg_parser = __esm({
1210
1222
  }
1211
1223
  try {
1212
1224
  if (value.includes("\\")) {
1213
- value = JSON.parse(`"${value.replace(/"/g, '\\"').replace(/\n/g, "\\n").replace(/\r/g, "\\r")}"`);
1225
+ const surgicalValue = value.replace(/(^|[^\\])"/g, '$1\\"');
1226
+ value = JSON.parse(`"${surgicalValue.replace(/\n/g, "\\n").replace(/\r/g, "\\r")}"`);
1214
1227
  }
1215
1228
  } catch (e) {
1216
- value = value.replace(/\\"/g, '"').replace(/\\'/g, "'").replace(/\\`/g, "`").replace(/\\\\/g, "\\");
1229
+ value = value.replace(/\\"/g, '"').replace(/\\'/g, "'").replace(/\\`/g, "`").replace(/\\\\/g, "\\").replace(/\\n/g, "\n");
1217
1230
  }
1218
1231
  } else if (i < argsString.length && argsString[i] === "[") {
1219
1232
  let balance = 0;
@@ -2776,20 +2789,24 @@ var init_ai = __esm({
2776
2789
  if (chunk.text) {
2777
2790
  if (isDedupeActive) {
2778
2791
  dedupeBuffer += chunk.text;
2779
- if (dedupeBuffer.length >= accumulatedContext.length) {
2780
- if (dedupeBuffer.startsWith(accumulatedContext)) {
2781
- const newText = dedupeBuffer.substring(accumulatedContext.length);
2782
- if (newText) {
2783
- turnText += newText;
2784
- yield { type: "text", content: newText };
2792
+ if (dedupeBuffer.length >= 100) {
2793
+ let overlapLen = 0;
2794
+ const maxPossibleOverlap = Math.min(accumulatedContext.length, dedupeBuffer.length);
2795
+ for (let len = maxPossibleOverlap; len > 0; len--) {
2796
+ if (accumulatedContext.endsWith(dedupeBuffer.substring(0, len))) {
2797
+ overlapLen = len;
2798
+ break;
2785
2799
  }
2786
- isDedupeActive = false;
2787
- } else {
2788
- turnText += dedupeBuffer;
2789
- yield { type: "text", content: dedupeBuffer };
2790
- isDedupeActive = false;
2791
2800
  }
2801
+ const cleanText = dedupeBuffer.substring(overlapLen);
2802
+ if (cleanText) {
2803
+ turnText += cleanText;
2804
+ yield { type: "text", content: cleanText };
2805
+ }
2806
+ isDedupeActive = false;
2807
+ dedupeBuffer = "";
2792
2808
  }
2809
+ continue;
2793
2810
  } else {
2794
2811
  turnText += chunk.text;
2795
2812
  yield { type: "text", content: chunk.text };
@@ -3017,6 +3034,23 @@ ${boxBottom}
3017
3034
  yield { type: "liveTokens", content: lastUsage.totalTokenCount };
3018
3035
  }
3019
3036
  }
3037
+ if (isDedupeActive && dedupeBuffer.length > 0) {
3038
+ let overlapLen = 0;
3039
+ const maxPossibleOverlap = Math.min(accumulatedContext.length, dedupeBuffer.length);
3040
+ for (let len = maxPossibleOverlap; len > 0; len--) {
3041
+ if (accumulatedContext.endsWith(dedupeBuffer.substring(0, len))) {
3042
+ overlapLen = len;
3043
+ break;
3044
+ }
3045
+ }
3046
+ const cleanText = dedupeBuffer.substring(overlapLen);
3047
+ if (cleanText) {
3048
+ turnText += cleanText;
3049
+ yield { type: "text", content: cleanText };
3050
+ }
3051
+ isDedupeActive = false;
3052
+ dedupeBuffer = "";
3053
+ }
3020
3054
  if (TERMINATION_SIGNAL) break;
3021
3055
  success = true;
3022
3056
  await incrementUsage("agent");
@@ -5092,7 +5126,7 @@ var init_app = __esm({
5092
5126
  init_text();
5093
5127
  SESSION_START_TIME = Date.now();
5094
5128
  CHANGELOG_URL = "https://fluxflow-cli.onrender.com/changelog.html";
5095
- versionFluxflow = "1.8.12";
5129
+ versionFluxflow = "1.8.14";
5096
5130
  updatedOn = "2026-05-09";
5097
5131
  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(
5098
5132
  CommandMenu,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fluxflow-cli",
3
- "version": "1.8.12",
3
+ "version": "1.8.14",
4
4
  "description": "A high-fidelity agentic terminal assistant for the Flux Era.",
5
5
  "keywords": [
6
6
  "ai",