fluxflow-cli 1.18.2 → 1.18.4
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 +38 -12
- package/package.json +1 -1
package/dist/fluxflow.js
CHANGED
|
@@ -1676,7 +1676,7 @@ ${mode === "Flux" ? `- PROJECT TOOLS (path = relative to CWD) -
|
|
|
1676
1676
|
3. [tool:functions.PatchFile(path="...", replaceContent1="exact string", newContent1="...", ...MAX 8)]. Surgical Patch. Unsure? ReadFile > guessing. Multiple blocks same file? Use replaceContent2, newContent2 etc.
|
|
1677
1677
|
4. [tool:functions.WriteFile(path="...", content="...")]. Creates/Overwrites. File Exist? PatchFile >> WriteFile. Verify Imports
|
|
1678
1678
|
5. [tool:functions.SearchKeyword(keyword="...", file="path/to/file")]. Global project search. If 'file' is provided, searches only that file. Finds definitions/logic without reading every file
|
|
1679
|
-
6. [tool:functions.Run(command="...")]. Runs
|
|
1679
|
+
6. [tool:functions.Run(command="...")]. Runs ${osDetected === "Windows" ? isPsAvailable() ? "WINDOWS POWERSHELL" : "WINDOWS CMD" : "Bash"} command. Destructive/Irreversible ops -> Ask user
|
|
1680
1680
|
7. [tool:functions.GenerateImage(path="... png", prompt="detailed", ratio="16:9, 9:16, 1:1")]. Usage: Mockups, PDF thumbnails, any visual content
|
|
1681
1681
|
8. [tool:functions.WritePDF(path="...", content="...", orientation="...")]. PROACTIVE A4 PAGE BREAKS MUST IN CSS. HTML/CSS for PREMIUM layout (100vh/vw)
|
|
1682
1682
|
9. [tool:functions.WriteDoc(path="...", content="...")]. A4 Word document
|
|
@@ -1825,8 +1825,8 @@ ${projectContextBlock}
|
|
|
1825
1825
|
- Tables: Max 4 cols
|
|
1826
1826
|
- NO LaTeX${mode === "Flux" ? "" : ". Kaomojis"}
|
|
1827
1827
|
|
|
1828
|
-
--
|
|
1829
|
-
- End with [turn: continue] to continue or [turn: finish]
|
|
1828
|
+
-- TURN RULES (PRIORITY: HIGH) --
|
|
1829
|
+
- End with [turn: continue] to continue or [turn: finish] to finish agent loop (MUST INCLUDE EVERY RESPONSE)
|
|
1830
1830
|
- Tool Called? No post tool response until [turn: continue]
|
|
1831
1831
|
- Task Complete? End loop with [turn: finish]
|
|
1832
1832
|
- NEVER USE [turn: continue] [turn:finish] together
|
|
@@ -3230,16 +3230,28 @@ var init_update_file = __esm({
|
|
|
3230
3230
|
const targetPath = parsed.path;
|
|
3231
3231
|
if (!targetPath) return 'ERROR: Missing "path" argument for update_file.';
|
|
3232
3232
|
const patchPairs = [];
|
|
3233
|
-
const
|
|
3234
|
-
|
|
3235
|
-
|
|
3236
|
-
|
|
3237
|
-
|
|
3238
|
-
|
|
3239
|
-
|
|
3240
|
-
|
|
3241
|
-
|
|
3233
|
+
const indices = /* @__PURE__ */ new Set();
|
|
3234
|
+
Object.keys(parsed).forEach((key) => {
|
|
3235
|
+
const m = key.match(/^(replaceContent|newContent|content_to_replace|content_to_add)(\d+)?$/);
|
|
3236
|
+
if (m) {
|
|
3237
|
+
const index = m[2] ? parseInt(m[2]) : 1;
|
|
3238
|
+
indices.add(index);
|
|
3239
|
+
}
|
|
3240
|
+
});
|
|
3241
|
+
const sortedIndices = Array.from(indices).sort((a, b) => a - b);
|
|
3242
|
+
for (const i of sortedIndices) {
|
|
3243
|
+
let r, n;
|
|
3244
|
+
if (i === 1) {
|
|
3245
|
+
r = parsed.replaceContent1 ?? (parsed.content_to_replace ?? parsed.replaceContent);
|
|
3246
|
+
n = parsed.newContent1 ?? (parsed.content_to_add ?? parsed.newContent);
|
|
3247
|
+
} else {
|
|
3248
|
+
r = parsed[`replaceContent${i}`] ?? parsed[`content_to_replace${i}`];
|
|
3249
|
+
n = parsed[`newContent${i}`] ?? parsed[`content_to_add${i}`];
|
|
3250
|
+
}
|
|
3251
|
+
if (r !== void 0 && n !== void 0) {
|
|
3242
3252
|
patchPairs.push({ replace: r, new: n });
|
|
3253
|
+
} else if (r !== void 0 || n !== void 0) {
|
|
3254
|
+
return `ERROR: Mismatched replacement pair for index ${i}. Both replacement and new content must be provided.`;
|
|
3243
3255
|
}
|
|
3244
3256
|
}
|
|
3245
3257
|
if (patchPairs.length === 0) {
|
|
@@ -3425,6 +3437,7 @@ var pty, activeChildProcess, isActiveCommandPty, writeToActiveCommand, terminate
|
|
|
3425
3437
|
var init_exec_command = __esm({
|
|
3426
3438
|
async "src/tools/exec_command.js"() {
|
|
3427
3439
|
init_arg_parser();
|
|
3440
|
+
init_main_tools();
|
|
3428
3441
|
pty = null;
|
|
3429
3442
|
try {
|
|
3430
3443
|
const ptyModule = await import("node-pty");
|
|
@@ -3526,9 +3539,22 @@ var init_exec_command = __esm({
|
|
|
3526
3539
|
if (/[\(\)\{\}\;\<\>\=\'\"]/.test(str)) return false;
|
|
3527
3540
|
return true;
|
|
3528
3541
|
};
|
|
3542
|
+
let inMkdir = false;
|
|
3529
3543
|
const translatedTokens = [];
|
|
3530
3544
|
for (let i = 0; i < tokens.length; i++) {
|
|
3531
3545
|
const token = tokens[i];
|
|
3546
|
+
if (token === "mkdir" && usePowerShell && isPsAvailable()) {
|
|
3547
|
+
inMkdir = true;
|
|
3548
|
+
}
|
|
3549
|
+
if (inMkdir) {
|
|
3550
|
+
const controlOperators = [">", ">>", "<", "&", "&&", "|", "||", ";"];
|
|
3551
|
+
if (controlOperators.includes(token)) {
|
|
3552
|
+
inMkdir = false;
|
|
3553
|
+
} else if (token === "-p" || token === "--parents") {
|
|
3554
|
+
translatedTokens.push("-Force");
|
|
3555
|
+
continue;
|
|
3556
|
+
}
|
|
3557
|
+
}
|
|
3532
3558
|
if (token === "|" && tokens[i + 1] === "tee") {
|
|
3533
3559
|
if (tokens[i + 2] === "-a") {
|
|
3534
3560
|
translatedTokens.push(">>");
|