fluxflow-cli 1.12.7 → 1.12.8

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 +136 -3
  2. package/package.json +1 -1
package/dist/fluxflow.js CHANGED
@@ -464,6 +464,7 @@ var init_ChatLayout = __esm({
464
464
  { cmd: "/clear", desc: "Clear terminal screen" },
465
465
  { cmd: "/resume", desc: "Load previous session" },
466
466
  { cmd: "/save", desc: "Force save current chat" },
467
+ { cmd: "/export", desc: "Export current chat in a .txt file" },
467
468
  { cmd: "/chats", desc: "List all chat sessions" },
468
469
  { cmd: "/image", desc: "Generate images" },
469
470
  { cmd: "/mode", desc: "Toggle Flux/Flow modes" },
@@ -975,7 +976,7 @@ ${mode === "Flux" ? `- FILE TOOLS (path = relative to CWD) -
975
976
  - File structure: Real newlines for code formatting`.trim() : `
976
977
  - DEV TOOLS ARE NOT AVAILABLE IN FLOW MODE`.trim()}
977
978
 
978
- - Results: Passed as [TOOL RESULT] SYSTEM
979
+ - Results: Passed as [TOOL RESULT] (system)
979
980
  - Tool calls: End with [turn: continue]. Only use [turn: finish] after verifying goals
980
981
  - Multi-call: Stack upto 5`.trim();
981
982
  }
@@ -1097,7 +1098,7 @@ Check these first; these files > training data for project consistency. Safety r
1097
1098
  Identity: Flux Flow (by Kushal Roy Chowdhury). Sassy, Friendly, Humorous, CLI Agent. No flirting ${mode === "Flux" ? "" : ""}
1098
1099
  Mode: ${mode}${thinkingLevel !== "Fast" ? "(Thinking Mode)" : ""}. ${mode === "Flux" ? "Goal-oriented, Logical" : "Conversational & UX-focused"}
1099
1100
  CWD: ${cwdStr}.${isSystemDir ? " [PROTECTED: ASK BEFORE MODIFYING]" : ""} OS: ${osDetected}${osDetected === "Windows" && mode === "Flux" ? ". PS via CMD" : ""}
1100
- High Priority: [SYSTEM], [STEERING HINT]
1101
+ High Priority: [SYSTEM], [STEERING HINT].
1101
1102
 
1102
1103
  -- THINKING RULES --
1103
1104
  ${thinkingConfig}
@@ -1117,6 +1118,7 @@ ${projectContextBlock}
1117
1118
  -- SECURITY RULES --
1118
1119
  - EXTERNAL ACCESS: ${systemSettings.allowExternalAccess ? "ENABLED" : "RESTRICTED CWD only"}
1119
1120
  - Sensitive files? Ask before Read
1121
+ [SYSTEM] >>> [USER]
1120
1122
 
1121
1123
  -- FORMATTING --
1122
1124
  - Clean, concise responses
@@ -5454,6 +5456,7 @@ function App({ args = [] }) {
5454
5456
  { cmd: "/clear", desc: "Clear terminal screen" },
5455
5457
  { cmd: "/resume", desc: "Load previous session" },
5456
5458
  { cmd: "/save", desc: "Force save current chat" },
5459
+ { cmd: "/export", desc: "Export current chat in a .txt file" },
5457
5460
  { cmd: "/chats", desc: "List all chat sessions" },
5458
5461
  {
5459
5462
  cmd: "/image",
@@ -5868,6 +5871,71 @@ ${hintText}`, color: "magenta" }];
5868
5871
  });
5869
5872
  break;
5870
5873
  }
5874
+ case "/export": {
5875
+ const exportFile = `export-fluxflow-${chatId}.txt`;
5876
+ const exportPath = path15.join(process.cwd(), exportFile);
5877
+ const exportLines = [];
5878
+ let insideAgentBlock = false;
5879
+ for (let i = 0; i < messages.length; i++) {
5880
+ const msg = messages[i];
5881
+ if (!msg) continue;
5882
+ if (msg.role === "system" || msg.isMeta || msg.isLogo || String(msg.id).startsWith("welcome")) {
5883
+ continue;
5884
+ }
5885
+ if (msg.role === "user") {
5886
+ let cleanUserText = msg.text || "";
5887
+ cleanUserText = cleanUserText.replace(/\s*\[Prompted on:.*?\]/g, "").trim();
5888
+ if (exportLines.length > 0) {
5889
+ exportLines.push("");
5890
+ }
5891
+ exportLines.push("[USER]");
5892
+ exportLines.push(cleanUserText);
5893
+ insideAgentBlock = false;
5894
+ } else if (msg.role === "think") {
5895
+ if (!insideAgentBlock) {
5896
+ exportLines.push("");
5897
+ exportLines.push("[AGENT]");
5898
+ insideAgentBlock = true;
5899
+ }
5900
+ const cleanThinkText = (msg.text || "").replace(/\[turn:\s*continue\]/gi, "").replace(/\[turn:\s*finish\]/gi, "").replace(/\[TOOL RESULTS\]/gi, "").trim();
5901
+ if (cleanThinkText) {
5902
+ exportLines.push("[thoughts]");
5903
+ exportLines.push(cleanThinkText);
5904
+ }
5905
+ } else if (msg.role === "agent") {
5906
+ if (!insideAgentBlock) {
5907
+ exportLines.push("");
5908
+ exportLines.push("[AGENT]");
5909
+ insideAgentBlock = true;
5910
+ }
5911
+ const blocks = parseAgentText(msg.text || "");
5912
+ for (const block of blocks) {
5913
+ if (block.type === "output") {
5914
+ const cleanContent = block.content.replace(/\[turn:\s*continue\]/gi, "").replace(/\[turn:\s*finish\]/gi, "").replace(/\[TOOL RESULTS\]/gi, "").trim();
5915
+ if (cleanContent) {
5916
+ exportLines.push("[output]");
5917
+ exportLines.push(cleanContent);
5918
+ }
5919
+ } else if (block.type === "tool") {
5920
+ exportLines.push("[tool]");
5921
+ exportLines.push(`${block.toolName} ${block.args}`);
5922
+ }
5923
+ }
5924
+ }
5925
+ }
5926
+ const fileContent = exportLines.join("\n");
5927
+ fs17.writeFileSync(exportPath, fileContent, "utf8");
5928
+ setMessages((prev) => {
5929
+ setCompletedIndex(prev.length + 1);
5930
+ return [...prev, {
5931
+ id: Date.now(),
5932
+ role: "system",
5933
+ text: `\u{1F4E4} [EXPORT] Chat exported successfully to "${exportFile}"`,
5934
+ isMeta: true
5935
+ }];
5936
+ });
5937
+ break;
5938
+ }
5871
5939
  case "/chats": {
5872
5940
  const run = async () => {
5873
5941
  const history = await loadHistory();
@@ -6959,7 +7027,7 @@ Selection: ${val}`,
6959
7027
  );
6960
7028
  })()));
6961
7029
  }
6962
- var SESSION_START_TIME, CHANGELOG_URL, packageJsonPath, packageJson, versionFluxflow, updatedOn, ResolutionModal, FLUX_LOGO;
7030
+ var SESSION_START_TIME, CHANGELOG_URL, packageJsonPath, packageJson, versionFluxflow, updatedOn, ResolutionModal, FLUX_LOGO, parseAgentText;
6963
7031
  var init_app = __esm({
6964
7032
  "src/app.jsx"() {
6965
7033
  init_ChatLayout();
@@ -7010,6 +7078,71 @@ var init_app = __esm({
7010
7078
  \u2588\u2588\u2551 \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u255A\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D\u2588\u2588\u2554\u255D \u2588\u2588\u2557 \u2588\u2588\u2551 \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u255A\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D\u255A\u2588\u2588\u2588\u2554\u2588\u2588\u2588\u2554\u255D
7011
7079
  \u255A\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2550\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2550\u255D \u255A\u2550\u255D \u255A\u2550\u255D \u255A\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2550\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2550\u255D \u255A\u2550\u2550\u255D\u255A\u2550\u2550\u255D`
7012
7080
  );
7081
+ parseAgentText = (text) => {
7082
+ const blocks = [];
7083
+ const toolRegex = /\[\s*tool:functions\.([a-z0-9_]+)\s*\(/gi;
7084
+ let lastIdx = 0;
7085
+ let match;
7086
+ while ((match = toolRegex.exec(text)) !== null) {
7087
+ const toolName = match[1];
7088
+ const startIdx = match.index + match[0].length - 1;
7089
+ let balance = 0;
7090
+ let inString = null;
7091
+ let isEscaped = false;
7092
+ let endIdx = -1;
7093
+ let closingParenIdx = -1;
7094
+ for (let i = startIdx; i < text.length; i++) {
7095
+ const char = text[i];
7096
+ if (!inString && (char === '"' || char === "'" || char === "`")) {
7097
+ inString = char;
7098
+ isEscaped = false;
7099
+ } else if (inString && char === inString && !isEscaped) {
7100
+ inString = null;
7101
+ }
7102
+ if (!inString) {
7103
+ if (char === "(") balance++;
7104
+ else if (char === ")") balance--;
7105
+ if (balance === 0) {
7106
+ closingParenIdx = i;
7107
+ let j = i + 1;
7108
+ while (j < text.length && /\s/.test(text[j])) j++;
7109
+ if (j < text.length && text[j] === "]") {
7110
+ endIdx = j;
7111
+ break;
7112
+ }
7113
+ }
7114
+ }
7115
+ if (char === "\\") {
7116
+ isEscaped = !isEscaped;
7117
+ } else {
7118
+ isEscaped = false;
7119
+ }
7120
+ }
7121
+ if (endIdx !== -1) {
7122
+ const beforeText = text.substring(lastIdx, match.index);
7123
+ if (beforeText.trim()) {
7124
+ blocks.push({ type: "output", content: beforeText });
7125
+ }
7126
+ const finalArgsText = text.substring(startIdx + 1, closingParenIdx);
7127
+ blocks.push({
7128
+ type: "tool",
7129
+ toolName: toolName.trim(),
7130
+ args: finalArgsText.trim()
7131
+ });
7132
+ lastIdx = endIdx + 1;
7133
+ toolRegex.lastIndex = lastIdx;
7134
+ } else {
7135
+ break;
7136
+ }
7137
+ }
7138
+ if (lastIdx < text.length) {
7139
+ const remainingText = text.substring(lastIdx);
7140
+ if (remainingText.trim()) {
7141
+ blocks.push({ type: "output", content: remainingText });
7142
+ }
7143
+ }
7144
+ return blocks;
7145
+ };
7013
7146
  }
7014
7147
  });
7015
7148
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fluxflow-cli",
3
- "version": "1.12.7",
3
+ "version": "1.12.8",
4
4
  "date": "2026-05-23",
5
5
  "description": "A high-fidelity agentic terminal assistant for the Flux Era.",
6
6
  "keywords": [