fluxflow-cli 1.18.4 → 1.18.5

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 +147 -17
  2. 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 ${osDetected === "Windows" ? isPsAvailable() ? "WINDOWS POWERSHELL" : "WINDOWS CMD" : "Bash"} command. Destructive/Irreversible ops -> Ask user
1679
+ 6. [tool:functions.Run(command="...")]. Runs ${osDetected === "Windows" ? isPsAvailable() ? "WINDOWS POWERSHELL ONLY" : "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
@@ -1804,6 +1804,14 @@ Check these first; These Files > Training Data. Safety rules apply
1804
1804
  Identity: Flux Flow (by Kushal Roy Chowdhury). Sassy${mode === "Flux" ? ", No Flirting, Respectful" : ", Friendly, Humorous, Sarcastic"}, CLI Agent
1805
1805
  Mode: ${mode}${thinkingLevel !== "Fast" ? " (Thinking Mode)" : ""}. ${mode === "Flux" ? "Logical, Highly Detailed, Task-Driven. Prioritizes scalable file/folder structures, modular architecture, clean code abstractions, step-by-step execution. Industry standard latest coding practices/libraries, clean code, Double Check Imports, Client-Server Sync" : "Conversational, Concise"}
1806
1806
 
1807
+ -- AGENT LOOP RULES (PRIORITY: HIGH) --
1808
+ - **MUST END WITH [turn: continue] to continue loop OR [turn: finish] to END loop**
1809
+ - Tool Called? No post tool response until [turn: continue]
1810
+ - NEVER USE [turn: continue] [turn:finish] together
1811
+
1812
+ SYSTEM PRIORITY: [SYSTEM], [TOOL RESULT]
1813
+ HIGH PRIORITY: [STEERING HINT]
1814
+
1807
1815
  -- THINKING RULES --
1808
1816
  ${thinkingConfig}
1809
1817
  ${thinkingLevel !== "Fast" ? `
@@ -1824,12 +1832,6 @@ ${projectContextBlock}
1824
1832
  - GFM Supported
1825
1833
  - Tables: Max 4 cols
1826
1834
  - NO LaTeX${mode === "Flux" ? "" : ". Kaomojis"}
1827
-
1828
- -- TURN RULES (PRIORITY: HIGH) --
1829
- - End with [turn: continue] to continue or [turn: finish] to finish agent loop (MUST INCLUDE EVERY RESPONSE)
1830
- - Tool Called? No post tool response until [turn: continue]
1831
- - Task Complete? End loop with [turn: finish]
1832
- - NEVER USE [turn: continue] [turn:finish] together
1833
1835
  [/SYSTEM]`.trim();
1834
1836
  };
1835
1837
  getJanitorInstruction = (userMemories = "", isMemoryEnabled = true, needTitle = true) => {
@@ -3539,21 +3541,149 @@ var init_exec_command = __esm({
3539
3541
  if (/[\(\)\{\}\;\<\>\=\'\"]/.test(str)) return false;
3540
3542
  return true;
3541
3543
  };
3542
- let inMkdir = false;
3543
3544
  const translatedTokens = [];
3544
3545
  for (let i = 0; i < tokens.length; i++) {
3545
3546
  const token = tokens[i];
3546
3547
  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;
3548
+ const paths = [];
3549
+ let j = i + 1;
3550
+ while (j < tokens.length) {
3551
+ const nextToken = tokens[j];
3552
+ const controlOperators = [">", ">>", "<", "&", "&&", "|", "||", ";"];
3553
+ if (controlOperators.includes(nextToken)) {
3554
+ break;
3555
+ }
3556
+ if (nextToken !== "-p" && nextToken !== "--parents" && nextToken !== "-v" && nextToken !== "--verbose") {
3557
+ paths.push(nextToken);
3558
+ }
3559
+ j++;
3560
+ }
3561
+ if (paths.length > 0) {
3562
+ const processedPaths = paths.map((p) => {
3563
+ const unquoted = p.replace(/^['"]|['"]$/g, "");
3564
+ let newPath = p;
3565
+ if (looksLikePath(unquoted)) {
3566
+ newPath = p.replace(/\//g, "\\");
3567
+ }
3568
+ return newPath;
3569
+ });
3570
+ translatedTokens.push("New-Item", "-ItemType", "Directory", "-Force", "-Path", processedPaths.join(","));
3571
+ } else {
3572
+ translatedTokens.push("New-Item", "-ItemType", "Directory", "-Force");
3573
+ }
3574
+ i = j - 1;
3575
+ continue;
3576
+ }
3577
+ if (token === "rm" && usePowerShell && isPsAvailable()) {
3578
+ const paths = [];
3579
+ let recurse = false;
3580
+ let force = false;
3581
+ let j = i + 1;
3582
+ while (j < tokens.length) {
3583
+ const nextToken = tokens[j];
3584
+ const controlOperators = [">", ">>", "<", "&", "&&", "|", "||", ";"];
3585
+ if (controlOperators.includes(nextToken)) {
3586
+ break;
3587
+ }
3588
+ if (nextToken === "-rf" || nextToken === "-fr") {
3589
+ recurse = true;
3590
+ force = true;
3591
+ } else if (nextToken === "-r" || nextToken === "-R" || nextToken === "--recursive") {
3592
+ recurse = true;
3593
+ } else if (nextToken === "-f" || nextToken === "--force") {
3594
+ force = true;
3595
+ } else {
3596
+ paths.push(nextToken);
3597
+ }
3598
+ j++;
3599
+ }
3600
+ const args = ["Remove-Item"];
3601
+ if (recurse) args.push("-Recurse");
3602
+ if (force) args.push("-Force");
3603
+ if (paths.length > 0) {
3604
+ const processedPaths = paths.map((p) => {
3605
+ const unquoted = p.replace(/^['"]|['"]$/g, "");
3606
+ let newPath = p;
3607
+ if (looksLikePath(unquoted)) {
3608
+ newPath = p.replace(/\//g, "\\");
3609
+ }
3610
+ return newPath;
3611
+ });
3612
+ args.push("-Path", processedPaths.join(","));
3556
3613
  }
3614
+ translatedTokens.push(...args);
3615
+ i = j - 1;
3616
+ continue;
3617
+ }
3618
+ if (token === "cp" && usePowerShell && isPsAvailable()) {
3619
+ const paths = [];
3620
+ let recurse = false;
3621
+ let force = false;
3622
+ let j = i + 1;
3623
+ while (j < tokens.length) {
3624
+ const nextToken = tokens[j];
3625
+ const controlOperators = [">", ">>", "<", "&", "&&", "|", "||", ";"];
3626
+ if (controlOperators.includes(nextToken)) {
3627
+ break;
3628
+ }
3629
+ if (nextToken === "-r" || nextToken === "-R" || nextToken === "--recursive") {
3630
+ recurse = true;
3631
+ } else if (nextToken === "-f" || nextToken === "--force") {
3632
+ force = true;
3633
+ } else {
3634
+ paths.push(nextToken);
3635
+ }
3636
+ j++;
3637
+ }
3638
+ const args = ["Copy-Item"];
3639
+ if (recurse) args.push("-Recurse");
3640
+ if (force) args.push("-Force");
3641
+ if (paths.length > 0) {
3642
+ const processedPaths = paths.map((p) => {
3643
+ const unquoted = p.replace(/^['"]|['"]$/g, "");
3644
+ let newPath = p;
3645
+ if (looksLikePath(unquoted)) {
3646
+ newPath = p.replace(/\//g, "\\");
3647
+ }
3648
+ return newPath;
3649
+ });
3650
+ if (processedPaths.length > 1) {
3651
+ const dest = processedPaths.pop();
3652
+ args.push("-Path", processedPaths.join(","), "-Destination", dest);
3653
+ } else {
3654
+ args.push("-Path", processedPaths[0]);
3655
+ }
3656
+ }
3657
+ translatedTokens.push(...args);
3658
+ i = j - 1;
3659
+ continue;
3660
+ }
3661
+ if (token === "touch" && usePowerShell && isPsAvailable()) {
3662
+ const paths = [];
3663
+ let j = i + 1;
3664
+ while (j < tokens.length) {
3665
+ const nextToken = tokens[j];
3666
+ const controlOperators = [">", ">>", "<", "&", "&&", "|", "||", ";"];
3667
+ if (controlOperators.includes(nextToken)) {
3668
+ break;
3669
+ }
3670
+ paths.push(nextToken);
3671
+ j++;
3672
+ }
3673
+ if (paths.length > 0) {
3674
+ const processedPaths = paths.map((p) => {
3675
+ const unquoted = p.replace(/^['"]|['"]$/g, "");
3676
+ let newPath = p;
3677
+ if (looksLikePath(unquoted)) {
3678
+ newPath = p.replace(/\//g, "\\");
3679
+ }
3680
+ return newPath;
3681
+ });
3682
+ const psTouch = `(${processedPaths.join(", ")}) | ForEach-Object { if (Test-Path $_) { (Get-Item $_).LastWriteTime = [System.DateTime]::Now } else { $null | Out-File -FilePath $_ } }`;
3683
+ translatedTokens.push(psTouch);
3684
+ }
3685
+ i = j - 1;
3686
+ continue;
3557
3687
  }
3558
3688
  if (token === "|" && tokens[i + 1] === "tee") {
3559
3689
  if (tokens[i + 2] === "-a") {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fluxflow-cli",
3
- "version": "1.18.4",
3
+ "version": "1.18.5",
4
4
  "date": "2026-05-30",
5
5
  "description": "A high-fidelity agentic terminal assistant for the Flux Era.",
6
6
  "keywords": [