fluxflow-cli 1.18.18 → 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.
- package/dist/fluxflow.js +52 -17
- 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
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
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;
|
|
@@ -1162,11 +1167,11 @@ var init_main_tools = __esm({
|
|
|
1162
1167
|
};
|
|
1163
1168
|
TOOL_PROTOCOL = (mode, osDetected) => `
|
|
1164
1169
|
-- TOOL DEFINITIONS --
|
|
1165
|
-
Access to internal tools.
|
|
1166
|
-
|
|
1167
|
-
- **MAX 3 TOOL CALLS PER TURN. Next Turn, verify results, plan next
|
|
1168
|
-
- Use
|
|
1169
|
-
|
|
1170
|
+
Access to internal tools. MUST use the exact syntax on a new line: [tool:functions.ToolName(args)]
|
|
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" : ""}
|
|
1170
1175
|
- COMMUNICATION TOOLS -
|
|
1171
1176
|
1. [tool:functions.Ask(question="...", optionA="option::description", ...MAX 4)]. Ambiguity Resolution. Mandatory Triggers: Path Divergence, Security, Risk Mitigation. ask >> finish
|
|
1172
1177
|
Suggest best options; don't ask for preferences
|
|
@@ -1178,8 +1183,8 @@ Suggest best options; don't ask for preferences
|
|
|
1178
1183
|
${mode === "Flux" ? `- PROJECT TOOLS (path = relative to CWD) -
|
|
1179
1184
|
1. [tool:functions.ReadFile(path="...", startLine=number, endLine=number)]. Supports images/docs. User gives image/doc: VIEW FIRST
|
|
1180
1185
|
2. [tool:functions.ReadFolder(path="...")]. Detailed DIR stats
|
|
1181
|
-
3. [tool:functions.PatchFile(path="...", replaceContent1="exact string", newContent1="...", ...MAX 8)]. Surgical Patch.
|
|
1182
|
-
4. [tool:functions.WriteFile(path="...", content="...")]. Creates/Overwrites. File Exist? PatchFile
|
|
1186
|
+
3. [tool:functions.PatchFile(path="...", replaceContent1="exact string", newContent1="...", ...MAX 8)]. Surgical Patch. **Multiple patch on same file/path? Use replaceContent2, newContent2 etc >>> multiple spams**. Unsure? ReadFile > guessing.
|
|
1187
|
+
4. [tool:functions.WriteFile(path="...", content="...")]. Creates/Overwrites. File Exist? PatchFile >>> WriteFile. Verify Imports
|
|
1183
1188
|
5. [tool:functions.SearchKeyword(keyword="...", file="optional")]. Global project search. If 'file' is provided, searches only that file. Finds definitions/logic without reading every file
|
|
1184
1189
|
6. [tool:functions.Run(command="...")]. Runs ${osDetected === "Windows" ? isPsAvailable() ? `${isPtyAvailable ? "Interactive " : ""}WINDOWS POWERSHELL ONLY` : `${isPtyAvailable ? "Interactive " : ""}WINDOWS CMD` : `${isPtyAvailable ? "Interactive " : ""}BASH`} command. Destructive/Irreversible ops -> Ask user
|
|
1185
1190
|
7. [tool:functions.GenerateImage(path="... png", prompt="detailed", ratio="16:9, 9:16, 1:1")]. Usage: Mockups, PDF thumbnails, any visual content
|
|
@@ -2209,6 +2214,7 @@ __export(paths_exports, {
|
|
|
2209
2214
|
LEDGER_FILE: () => LEDGER_FILE,
|
|
2210
2215
|
LOGS_DIR: () => LOGS_DIR,
|
|
2211
2216
|
MEMORIES_FILE: () => MEMORIES_FILE,
|
|
2217
|
+
PATHS_FILE: () => PATHS_FILE,
|
|
2212
2218
|
SECRET_DIR: () => SECRET_DIR,
|
|
2213
2219
|
SETTINGS_FILE: () => SETTINGS_FILE,
|
|
2214
2220
|
TEMP_MEM_CHAT_FILE: () => TEMP_MEM_CHAT_FILE,
|
|
@@ -2219,7 +2225,7 @@ import os2 from "os";
|
|
|
2219
2225
|
import path2 from "path";
|
|
2220
2226
|
import fs2 from "fs";
|
|
2221
2227
|
import crypto2 from "crypto";
|
|
2222
|
-
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;
|
|
2223
2229
|
var init_paths = __esm({
|
|
2224
2230
|
"src/utils/paths.js"() {
|
|
2225
2231
|
FLUXFLOW_DIR = path2.join(os2.homedir(), ".fluxflow");
|
|
@@ -2262,6 +2268,7 @@ var init_paths = __esm({
|
|
|
2262
2268
|
TEMP_MEM_CHAT_FILE = path2.join(SECRET_DIR, "temp-memory-chat.json");
|
|
2263
2269
|
BACKUPS_DIR = path2.join(DATA_DIR, "backups");
|
|
2264
2270
|
LEDGER_FILE = path2.join(SECRET_DIR, "ledger.json");
|
|
2271
|
+
PATHS_FILE = path2.join(SECRET_DIR, "path.json");
|
|
2265
2272
|
}
|
|
2266
2273
|
});
|
|
2267
2274
|
|
|
@@ -2452,6 +2459,7 @@ Mode: ${mode}${thinkingLevel !== "Fast" ? " (Thinking Mode)" : ""}. ${mode === "
|
|
|
2452
2459
|
|
|
2453
2460
|
SYSTEM PRIORITY: [SYSTEM], [TOOL RESULT]
|
|
2454
2461
|
HIGH PRIORITY: [STEERING HINT]
|
|
2462
|
+
USER PRIORITY: [USER]
|
|
2455
2463
|
|
|
2456
2464
|
-- THINKING RULES --
|
|
2457
2465
|
${thinkingConfig}
|
|
@@ -4841,6 +4849,13 @@ var init_tools = __esm({
|
|
|
4841
4849
|
AddMemoryScore: addMemScore
|
|
4842
4850
|
};
|
|
4843
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
|
+
}
|
|
4844
4859
|
const tool = TOOL_MAP[toolName];
|
|
4845
4860
|
if (!tool) {
|
|
4846
4861
|
return `ERROR: Tool [${toolName}] not found in registry.`;
|
|
@@ -5670,9 +5685,14 @@ ${newMemoryListStr}
|
|
|
5670
5685
|
else if (totalFolders > 128) dynamicMaxDepth = 8;
|
|
5671
5686
|
else if (totalFolders > 64) dynamicMaxDepth = 9;
|
|
5672
5687
|
else if (totalFolders > 32) dynamicMaxDepth = 10;
|
|
5673
|
-
|
|
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);
|
|
5693
|
+
let dirStructure = process.cwd() + "\n" + getDirTree(process.cwd(), dynamicMaxDepth);
|
|
5674
5694
|
const firstUserMsg = `[SYSTEM METADATA (PRIORITY: DYNAMIC)] Time: ${dateTimeStr} | v${versionFluxflow2}
|
|
5675
|
-
CWD: ${process.cwd()}
|
|
5695
|
+
CWD: ${process.cwd()}${cwdMismatch ? ` (CWD Mismatch! Previous Path: ${lastCwd})` : ""}
|
|
5676
5696
|
**DIRECTORY STRUCTURE**
|
|
5677
5697
|
${dirStructure}
|
|
5678
5698
|
${memoryPrompt}
|
|
@@ -5796,7 +5816,7 @@ ${thinkingLevel != "Fast" ? "[SYSTEM] **STRICTLY FOLLOW THINKING POLICY AS CRITI
|
|
|
5796
5816
|
systemInstruction: currentSystemInstruction,
|
|
5797
5817
|
temperature: mode === "Flux" ? 1 : 1.4,
|
|
5798
5818
|
maxOutputTokens: 32768,
|
|
5799
|
-
mediaResolution: "
|
|
5819
|
+
mediaResolution: "MEDIA_RESOLUTION_HIGH",
|
|
5800
5820
|
safetySettings: [
|
|
5801
5821
|
{ category: HarmCategory.HARM_CATEGORY_HARASSMENT, threshold: HarmBlockThreshold.BLOCK_NONE },
|
|
5802
5822
|
{ category: HarmCategory.HARM_CATEGORY_HATE_SPEECH, threshold: HarmBlockThreshold.BLOCK_NONE },
|
|
@@ -6271,7 +6291,8 @@ ${boxBottom}` };
|
|
|
6271
6291
|
history,
|
|
6272
6292
|
onChunk: (chunk2) => settings.onExecChunk ? settings.onExecChunk(chunk2) : null,
|
|
6273
6293
|
onAskUser: settings.onAskUser,
|
|
6274
|
-
systemSettings: settings.systemSettings
|
|
6294
|
+
systemSettings: settings.systemSettings,
|
|
6295
|
+
mode
|
|
6275
6296
|
});
|
|
6276
6297
|
yield { type: "spinner", content: true };
|
|
6277
6298
|
if (process.stdout.isTTY) {
|
|
@@ -7040,6 +7061,16 @@ function App({ args = [] }) {
|
|
|
7040
7061
|
} else if (arg === "--external-access" && args[i + 1]) {
|
|
7041
7062
|
parsed.externalAccess = args[i + 1].toLowerCase();
|
|
7042
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++;
|
|
7043
7074
|
} else if (arg === "--thinking" && args[i + 1]) {
|
|
7044
7075
|
const val = args[i + 1];
|
|
7045
7076
|
const lower = val.toLowerCase();
|
|
@@ -7445,7 +7476,11 @@ function App({ args = [] }) {
|
|
|
7445
7476
|
});
|
|
7446
7477
|
}
|
|
7447
7478
|
const saved = await loadSettings();
|
|
7448
|
-
|
|
7479
|
+
if (parsedArgs.mode) {
|
|
7480
|
+
setMode(parsedArgs.mode);
|
|
7481
|
+
} else {
|
|
7482
|
+
setMode(saved.mode);
|
|
7483
|
+
}
|
|
7449
7484
|
if (parsedArgs.thinking) {
|
|
7450
7485
|
setThinkingLevel(parsedArgs.thinking);
|
|
7451
7486
|
} else {
|