fluxflow-cli 1.18.19 → 1.18.20

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 +47 -13
  2. package/package.json +1 -1
package/dist/fluxflow.js CHANGED
@@ -1123,10 +1123,15 @@ var init_arg_parser = __esm({
1123
1123
  i = argsString.length;
1124
1124
  }
1125
1125
  } else {
1126
- let endMatch = argsString.substring(i).match(/([^,\s\)]+)/);
1127
- if (endMatch) {
1128
- value = endMatch[1];
1129
- i += value.length;
1126
+ let rest = argsString.substring(i);
1127
+ let boundaryMatch = rest.match(/,\s*\w+\s*=|(?:\s*\)\s*(?:$|\]))/);
1128
+ if (boundaryMatch) {
1129
+ let boundaryIndex = boundaryMatch.index;
1130
+ value = rest.substring(0, boundaryIndex).trim();
1131
+ i += boundaryIndex;
1132
+ } else {
1133
+ value = rest.trim();
1134
+ i = argsString.length;
1130
1135
  }
1131
1136
  }
1132
1137
  if (value === "true") value = true;
@@ -1163,11 +1168,10 @@ var init_main_tools = __esm({
1163
1168
  TOOL_PROTOCOL = (mode, osDetected) => `
1164
1169
  -- TOOL DEFINITIONS --
1165
1170
  Access to internal tools. MUST use the exact syntax on a new line: [tool:functions.ToolName(args)]
1166
- STRICT POLICY
1167
- - **MAX 3 TOOL CALLS PER TURN. Next Turn, verify results, plan next**${mode === "Flux" ? "\n- **File Tools >> Code in chat**" : ""}
1168
- - Use contextually BEST tool, no brute force, no spamming
1169
- - Use multiple search & replace on patch tool if same file/path
1170
-
1171
+ MANDATORY TOOL POLICY:
1172
+ - **MAX 3 TOOL CALLS PER TURN. Next Turn, verify results, plan next**
1173
+ ${mode === "" ? "- Prefer multiple search & replace on patch tool if same file/path\n" : ""}- Use contextually BEST tool, no brute force, no spamming
1174
+ ${mode === "Flux" ? "- **File Tools >> Code in chat**\n" : ""}
1171
1175
  - COMMUNICATION TOOLS -
1172
1176
  1. [tool:functions.Ask(question="...", optionA="option::description", ...MAX 4)]. Ambiguity Resolution. Mandatory Triggers: Path Divergence, Security, Risk Mitigation. ask >> finish
1173
1177
  Suggest best options; don't ask for preferences
@@ -2210,6 +2214,7 @@ __export(paths_exports, {
2210
2214
  LEDGER_FILE: () => LEDGER_FILE,
2211
2215
  LOGS_DIR: () => LOGS_DIR,
2212
2216
  MEMORIES_FILE: () => MEMORIES_FILE,
2217
+ PATHS_FILE: () => PATHS_FILE,
2213
2218
  SECRET_DIR: () => SECRET_DIR,
2214
2219
  SETTINGS_FILE: () => SETTINGS_FILE,
2215
2220
  TEMP_MEM_CHAT_FILE: () => TEMP_MEM_CHAT_FILE,
@@ -2220,7 +2225,7 @@ import os2 from "os";
2220
2225
  import path2 from "path";
2221
2226
  import fs2 from "fs";
2222
2227
  import crypto2 from "crypto";
2223
- var FLUXFLOW_DIR, SETTINGS_FILE, externalDir, DATA_DIR, LOGS_DIR, SECRET_DIR, HISTORY_FILE, USAGE_FILE, MEMORIES_FILE, TEMP_MEM_FILE, TEMP_MEM_CHAT_FILE, BACKUPS_DIR, LEDGER_FILE;
2228
+ var FLUXFLOW_DIR, SETTINGS_FILE, externalDir, DATA_DIR, LOGS_DIR, SECRET_DIR, HISTORY_FILE, USAGE_FILE, MEMORIES_FILE, TEMP_MEM_FILE, TEMP_MEM_CHAT_FILE, BACKUPS_DIR, LEDGER_FILE, PATHS_FILE;
2224
2229
  var init_paths = __esm({
2225
2230
  "src/utils/paths.js"() {
2226
2231
  FLUXFLOW_DIR = path2.join(os2.homedir(), ".fluxflow");
@@ -2263,6 +2268,7 @@ var init_paths = __esm({
2263
2268
  TEMP_MEM_CHAT_FILE = path2.join(SECRET_DIR, "temp-memory-chat.json");
2264
2269
  BACKUPS_DIR = path2.join(DATA_DIR, "backups");
2265
2270
  LEDGER_FILE = path2.join(SECRET_DIR, "ledger.json");
2271
+ PATHS_FILE = path2.join(SECRET_DIR, "path.json");
2266
2272
  }
2267
2273
  });
2268
2274
 
@@ -2453,6 +2459,7 @@ Mode: ${mode}${thinkingLevel !== "Fast" ? " (Thinking Mode)" : ""}. ${mode === "
2453
2459
 
2454
2460
  SYSTEM PRIORITY: [SYSTEM], [TOOL RESULT]
2455
2461
  HIGH PRIORITY: [STEERING HINT]
2462
+ USER PRIORITY: [USER]
2456
2463
 
2457
2464
  -- THINKING RULES --
2458
2465
  ${thinkingConfig}
@@ -4842,6 +4849,13 @@ var init_tools = __esm({
4842
4849
  AddMemoryScore: addMemScore
4843
4850
  };
4844
4851
  dispatchTool = async (toolName, args, context = {}) => {
4852
+ if (context.mode && context.mode.toLowerCase() === "flow") {
4853
+ const normalized = toolName.toLowerCase();
4854
+ const isWebOrAsk = normalized.startsWith("web") || normalized.startsWith("ask");
4855
+ if (!isWebOrAsk) {
4856
+ return `ERROR: Tool [${toolName}] is restricted in Flow mode.`;
4857
+ }
4858
+ }
4845
4859
  const tool = TOOL_MAP[toolName];
4846
4860
  if (!tool) {
4847
4861
  return `ERROR: Tool [${toolName}] not found in registry.`;
@@ -5671,9 +5685,14 @@ ${newMemoryListStr}
5671
5685
  else if (totalFolders > 128) dynamicMaxDepth = 8;
5672
5686
  else if (totalFolders > 64) dynamicMaxDepth = 9;
5673
5687
  else if (totalFolders > 32) dynamicMaxDepth = 10;
5688
+ const chatPaths = readEncryptedJson(PATHS_FILE, {});
5689
+ const lastCwd = chatPaths[chatId];
5690
+ const cwdMismatch = lastCwd ? lastCwd !== process.cwd() : false;
5691
+ chatPaths[chatId] = process.cwd();
5692
+ writeEncryptedJson(PATHS_FILE, chatPaths);
5674
5693
  let dirStructure = process.cwd() + "\n" + getDirTree(process.cwd(), dynamicMaxDepth);
5675
5694
  const firstUserMsg = `[SYSTEM METADATA (PRIORITY: DYNAMIC)] Time: ${dateTimeStr} | v${versionFluxflow2}
5676
- CWD: ${process.cwd()}
5695
+ CWD: ${process.cwd()}${cwdMismatch ? ` (CWD Mismatch! Previous Path: ${lastCwd})` : ""}
5677
5696
  **DIRECTORY STRUCTURE**
5678
5697
  ${dirStructure}
5679
5698
  ${memoryPrompt}
@@ -6272,7 +6291,8 @@ ${boxBottom}` };
6272
6291
  history,
6273
6292
  onChunk: (chunk2) => settings.onExecChunk ? settings.onExecChunk(chunk2) : null,
6274
6293
  onAskUser: settings.onAskUser,
6275
- systemSettings: settings.systemSettings
6294
+ systemSettings: settings.systemSettings,
6295
+ mode
6276
6296
  });
6277
6297
  yield { type: "spinner", content: true };
6278
6298
  if (process.stdout.isTTY) {
@@ -7041,6 +7061,16 @@ function App({ args = [] }) {
7041
7061
  } else if (arg === "--external-access" && args[i + 1]) {
7042
7062
  parsed.externalAccess = args[i + 1].toLowerCase();
7043
7063
  i++;
7064
+ } else if (arg === "--mode" && args[i + 1]) {
7065
+ const val = args[i + 1];
7066
+ const lower = val.toLowerCase();
7067
+ if (["flux", "flow"].includes(lower)) {
7068
+ let mapped = "Flux";
7069
+ if (lower === "flux") mapped = "Flux";
7070
+ else if (lower === "flow") mapped = "Flow";
7071
+ parsed.mode = mapped;
7072
+ }
7073
+ i++;
7044
7074
  } else if (arg === "--thinking" && args[i + 1]) {
7045
7075
  const val = args[i + 1];
7046
7076
  const lower = val.toLowerCase();
@@ -7446,7 +7476,11 @@ function App({ args = [] }) {
7446
7476
  });
7447
7477
  }
7448
7478
  const saved = await loadSettings();
7449
- setMode(saved.mode);
7479
+ if (parsedArgs.mode) {
7480
+ setMode(parsedArgs.mode);
7481
+ } else {
7482
+ setMode(saved.mode);
7483
+ }
7450
7484
  if (parsedArgs.thinking) {
7451
7485
  setThinkingLevel(parsedArgs.thinking);
7452
7486
  } else {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fluxflow-cli",
3
- "version": "1.18.19",
3
+ "version": "1.18.20",
4
4
  "date": "2026-06-01",
5
5
  "description": "A high-fidelity agentic terminal assistant for the Flux Era.",
6
6
  "keywords": [