fluxflow-cli 3.0.1 → 3.0.2
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 +100 -10
- package/package.json +1 -1
package/dist/fluxflow.js
CHANGED
|
@@ -5125,12 +5125,13 @@ ${mode === "Flux" ? `- WORKSPACE TOOLS (path = relative to CWD & WILL BE FIRST A
|
|
|
5125
5125
|
6. [tool:functions.SearchKeyword(keyword="...", file="optional", subString="true/false optional")]. Global project search. If 'file' is provided, searches only that file. Finds definitions/logic without reading every file. Usage: Can search for relevent lines/logic area to read specifically for edit
|
|
5126
5126
|
7. [tool:functions.Run(command="...")]. Runs ${osDetected === "Windows" ? isPsAvailable() ? `WINDOWS POWERSHELL ONLY` : `WINDOWS CMD ONLY` : `BASH`} command. Destructive/Irreversible ops \u2192 Ask user
|
|
5127
5127
|
8. [tool:functions.Todo(method="create/append/get", tasks=[ARRAY OF STRINGS], markDone=[ARRAY OF TASK STRINGS])]. Task List, NO Markdown IN ARRAY. USAGE: ANALYZE USER REQUEST **IF** MULTIPLE TASK \u2192 BREAK DOWN TASK \u2192 CREATE TODO **BEFORE** DIVING IN. 'tasks' & 'markDone' OPTIONAL PARAMETERS WITH method 'get'. USE 'get' method WITH 'markDone' to mark task completed. **EVERY TURN UPDATE POLICY**
|
|
5128
|
+
9. [tool:functions.await(time="seconds")]. For waiting without exiting agent loop
|
|
5128
5129
|
|
|
5129
5130
|
-- SUB AGENTS --
|
|
5130
|
-
|
|
5131
|
-
- Invocation Types: invoke (async, background worker for parallel tasks), invokeSync (sync, blocking main agent loop, task delegation, repeatetive work, sequencial tasks)
|
|
5131
|
+
USE PROACTIVELY WHEN BENEFICIAL
|
|
5132
|
+
- Invocation Types: invoke (async, background worker for parallel tasks, upto 5 parallel agents), invokeSync (sync, blocking main agent loop, task delegation, repeatetive work, sequencial tasks)
|
|
5132
5133
|
1. [agent:generalist.invocationType(title="...", task="...")]. Usage: delegate repeatative task or work in background, Task must me detailed, with file paths & required folder structure provided
|
|
5133
|
-
2. [agent:generalist.getProgress(id="...")]. Usage: Check progress of async subagent task,
|
|
5134
|
+
2. [agent:generalist.getProgress(id="...")]. Usage: Check progress of async subagent task, MIGHT TAKE LONG TIME, DONT SPAM TOOL, WAIT IF NEEDED`.trim() : `- CREATIVE TOOLS (path = relative to CWD & WILL BE FIRST ARGUMENT, path separator: '/') -
|
|
5134
5135
|
1. [tool:functions.WritePDF(path="...", content="...", orientation="...")]. PROACTIVE A4 PAGE BREAKS MUST IN CSS. HTML/CSS for PREMIUM layout
|
|
5135
5136
|
2. [tool:functions.WriteDoc(path="...", content="...")]. A4 Word document
|
|
5136
5137
|
- WORKSPACE TOOLS ARE NOT AVAILABLE IN FLOW`.trim()}
|
|
@@ -9694,6 +9695,41 @@ ${task.finalAnswer}
|
|
|
9694
9695
|
}
|
|
9695
9696
|
});
|
|
9696
9697
|
|
|
9698
|
+
// src/tools/await.js
|
|
9699
|
+
var awaitTool;
|
|
9700
|
+
var init_await = __esm({
|
|
9701
|
+
"src/tools/await.js"() {
|
|
9702
|
+
init_arg_parser();
|
|
9703
|
+
awaitTool = async (args, context = {}) => {
|
|
9704
|
+
const parsed = parseArgs(args);
|
|
9705
|
+
const timeStr = parsed.time;
|
|
9706
|
+
if (!timeStr) {
|
|
9707
|
+
return 'ERROR: Missing "time" argument for await.';
|
|
9708
|
+
}
|
|
9709
|
+
let seconds = parseFloat(timeStr);
|
|
9710
|
+
if (isNaN(seconds)) {
|
|
9711
|
+
return `ERROR: Invalid time value "${timeStr}". Must be a number.`;
|
|
9712
|
+
}
|
|
9713
|
+
if (seconds < 10) {
|
|
9714
|
+
seconds = 10;
|
|
9715
|
+
} else if (seconds > 180) {
|
|
9716
|
+
seconds = 180;
|
|
9717
|
+
}
|
|
9718
|
+
const formatTime = (s) => {
|
|
9719
|
+
if (s >= 60) {
|
|
9720
|
+
const m = Math.floor(s / 60);
|
|
9721
|
+
const rem = s % 60;
|
|
9722
|
+
return `${m}m${rem > 0 ? ` ${rem}s` : ""}`;
|
|
9723
|
+
}
|
|
9724
|
+
return `${s}s`;
|
|
9725
|
+
};
|
|
9726
|
+
const formatted = formatTime(seconds);
|
|
9727
|
+
await new Promise((resolve) => setTimeout(resolve, seconds * 1e3));
|
|
9728
|
+
return `SUCCESS: Waited for ${formatted}${seconds > 180 ? " (Max: 180s)" : ""}${seconds < 10 ? " (Min: 10s)" : ""}.`;
|
|
9729
|
+
};
|
|
9730
|
+
}
|
|
9731
|
+
});
|
|
9732
|
+
|
|
9697
9733
|
// src/utils/tools.js
|
|
9698
9734
|
var TOOL_MAP, dispatchTool;
|
|
9699
9735
|
var init_tools = __esm({
|
|
@@ -9719,6 +9755,7 @@ var init_tools = __esm({
|
|
|
9719
9755
|
init_invokeSync();
|
|
9720
9756
|
init_invoke();
|
|
9721
9757
|
init_getProgress();
|
|
9758
|
+
init_await();
|
|
9722
9759
|
TOOL_MAP = {
|
|
9723
9760
|
web_search,
|
|
9724
9761
|
web_scrape,
|
|
@@ -9770,12 +9807,14 @@ var init_tools = __esm({
|
|
|
9770
9807
|
TODO: todo,
|
|
9771
9808
|
InvokeSync: invokeSync,
|
|
9772
9809
|
Invoke: invoke,
|
|
9773
|
-
GetProgress: getProgress
|
|
9810
|
+
GetProgress: getProgress,
|
|
9811
|
+
await: awaitTool,
|
|
9812
|
+
Await: awaitTool
|
|
9774
9813
|
};
|
|
9775
9814
|
dispatchTool = async (toolName, args, context = {}) => {
|
|
9776
9815
|
const mode = context.mode ? context.mode.toLowerCase() : "flux";
|
|
9777
9816
|
const normalized = toolName.toLowerCase();
|
|
9778
|
-
const systemTools = ["memory", "chat", "savesummary", "addmemscore", "add_mem_score", "ask", "web_search", "web_scrape"];
|
|
9817
|
+
const systemTools = ["memory", "chat", "savesummary", "addmemscore", "add_mem_score", "ask", "web_search", "web_scrape", "await"];
|
|
9779
9818
|
const isSystem = systemTools.some((t) => normalized.includes(t)) || normalized === "ask";
|
|
9780
9819
|
if (!isSystem) {
|
|
9781
9820
|
if (mode === "flow") {
|
|
@@ -9942,7 +9981,7 @@ var init_ai = __esm({
|
|
|
9942
9981
|
globalSettings = {};
|
|
9943
9982
|
colorMainWords = (label2) => {
|
|
9944
9983
|
if (!label2) return label2;
|
|
9945
|
-
return label2.replace(/(?:(\x1b\[\d+m))?([✔✗✖🔍📖→➕↻•])(?:(\x1b\[\d+m))?\s*\b(Created|Read|Edited|Viewed|Auto-Read|List|Generated|Written|Searched|Get Map|Write Canceled|Edit Canceled|Write Cancelled|Edit Denied|Visited|Updated|Reviewed|Delegated|Background|Checked|Elevating SubAgent|Checking SubAgent Work)\b/ig, (match, ansiBefore, icon, ansiAfter, word) => {
|
|
9984
|
+
return label2.replace(/(?:(\x1b\[\d+m))?([✔✗✖🔍📖→➕↻•])(?:(\x1b\[\d+m))?\s*\b(Created|Read|Edited|Viewed|Auto-Read|List|Generated|Written|Searched|Get Map|Write Canceled|Edit Canceled|Write Cancelled|Edit Denied|Visited|Updated|Reviewed|Delegated|Background|Checked|Elevating SubAgent|Checking SubAgent Work|Awaiting)\b/ig, (match, ansiBefore, icon, ansiAfter, word) => {
|
|
9946
9985
|
return `${ansiBefore || ""}${icon}${ansiAfter || ""} \x1B[95m${word}\x1B[0m`;
|
|
9947
9986
|
});
|
|
9948
9987
|
};
|
|
@@ -10530,7 +10569,8 @@ var init_ai = __esm({
|
|
|
10530
10569
|
"Todo": "Planning",
|
|
10531
10570
|
"invoke_sync": "Spawning SubAgent",
|
|
10532
10571
|
"invoke": "Spawning SubAgent",
|
|
10533
|
-
"get_progress": "Checking SubAgent"
|
|
10572
|
+
"get_progress": "Checking SubAgent",
|
|
10573
|
+
"await": "Waiting"
|
|
10534
10574
|
};
|
|
10535
10575
|
getToolDetail = (toolName, argsStr) => {
|
|
10536
10576
|
try {
|
|
@@ -12531,17 +12571,20 @@ ${ideErr} [/ERROR]`;
|
|
|
12531
12571
|
"Todo": "todo",
|
|
12532
12572
|
"invoke": "invoke",
|
|
12533
12573
|
"invokeSync": "invoke_sync",
|
|
12534
|
-
"getProgress": "get_progress"
|
|
12574
|
+
"getProgress": "get_progress",
|
|
12575
|
+
"await": "await",
|
|
12576
|
+
"Await": "await"
|
|
12535
12577
|
};
|
|
12536
12578
|
const potentialTool = NORMALIZE_MAP[toolContext.toolName] || toolContext.toolName;
|
|
12537
12579
|
const partialArgs = toolContext.args || "";
|
|
12538
12580
|
let detail = null;
|
|
12539
|
-
if (["write_file", "update_file", "view_file", "read_folder", "write_pdf", "write_docx", "search_keyword", "generate_image", "file_map", "invoke", "invoke_sync", "get_progress"].includes(potentialTool)) {
|
|
12581
|
+
if (["write_file", "update_file", "view_file", "read_folder", "write_pdf", "write_docx", "search_keyword", "generate_image", "file_map", "invoke", "invoke_sync", "get_progress", "await"].includes(potentialTool)) {
|
|
12540
12582
|
const pArgs = parseArgs(partialArgs);
|
|
12541
12583
|
const filePath = pArgs.path || pArgs.targetFile || pArgs.TargetFile || pArgs.directory;
|
|
12542
12584
|
const keyword = pArgs.keyword;
|
|
12543
12585
|
const title = pArgs.title || pArgs.task;
|
|
12544
12586
|
const id = pArgs.id || pArgs.taskId;
|
|
12587
|
+
const timeVal = pArgs.time;
|
|
12545
12588
|
if (keyword) {
|
|
12546
12589
|
detail = keyword.replace(/["']/g, "");
|
|
12547
12590
|
} else if (filePath) {
|
|
@@ -12550,6 +12593,23 @@ ${ideErr} [/ERROR]`;
|
|
|
12550
12593
|
detail = title.replace(/["']/g, "").substring(0, 30);
|
|
12551
12594
|
} else if (id && potentialTool === "get_progress") {
|
|
12552
12595
|
detail = id.replace(/["']/g, "");
|
|
12596
|
+
} else if (timeVal && potentialTool === "await") {
|
|
12597
|
+
let sec = parseFloat(timeVal.replace(/["']/g, ""));
|
|
12598
|
+
if (!isNaN(sec)) {
|
|
12599
|
+
if (sec < 5) sec = 5;
|
|
12600
|
+
if (sec > 120) sec = 120;
|
|
12601
|
+
const formatTime = (s) => {
|
|
12602
|
+
if (s >= 60) {
|
|
12603
|
+
const m = Math.floor(s / 60);
|
|
12604
|
+
const rem = s % 60;
|
|
12605
|
+
return `${m}m${rem > 0 ? ` ${rem}s` : ""}`;
|
|
12606
|
+
}
|
|
12607
|
+
return `${s}s`;
|
|
12608
|
+
};
|
|
12609
|
+
detail = formatTime(sec);
|
|
12610
|
+
} else {
|
|
12611
|
+
detail = timeVal.replace(/["']/g, "");
|
|
12612
|
+
}
|
|
12553
12613
|
} else {
|
|
12554
12614
|
const m = partialArgs.match(/(?:path|targetFile|TargetFile|directory|keyword|id|taskId|title|task)\s*=\s*\\?["']?([^\\"' \),]+)/);
|
|
12555
12615
|
if (m) {
|
|
@@ -12712,7 +12772,9 @@ ${ideErr} [/ERROR]`;
|
|
|
12712
12772
|
"Todo": "todo",
|
|
12713
12773
|
"invoke": "invoke",
|
|
12714
12774
|
"invokeSync": "invoke_sync",
|
|
12715
|
-
"getProgress": "get_progress"
|
|
12775
|
+
"getProgress": "get_progress",
|
|
12776
|
+
"await": "await",
|
|
12777
|
+
"Await": "await"
|
|
12716
12778
|
};
|
|
12717
12779
|
const normToolName = NORMALIZE_MAP[toolCall.toolName] || toolCall.toolName;
|
|
12718
12780
|
const displayLabel = TOOL_LABELS2[normToolName] || toolCall.toolName;
|
|
@@ -12778,6 +12840,20 @@ ${ideErr} [/ERROR]`;
|
|
|
12778
12840
|
} else if (normToolName === "get_progress") {
|
|
12779
12841
|
const detail2 = getToolDetail(normToolName, toolCall.args);
|
|
12780
12842
|
label2 = `\u2714 Checked${detail2 ? `: ${detail2}` : ""}`;
|
|
12843
|
+
} else if (normToolName === "await") {
|
|
12844
|
+
const { time } = parseArgs(toolCall.args);
|
|
12845
|
+
let sec = parseFloat(time) || 0;
|
|
12846
|
+
if (sec < 5) sec = 5;
|
|
12847
|
+
if (sec > 120) sec = 120;
|
|
12848
|
+
const formatTime = (s) => {
|
|
12849
|
+
if (s >= 60) {
|
|
12850
|
+
const m = Math.floor(s / 60);
|
|
12851
|
+
const rem = s % 60;
|
|
12852
|
+
return `${m}m${rem > 0 ? ` ${rem}s` : ""}`;
|
|
12853
|
+
}
|
|
12854
|
+
return `${s}s`;
|
|
12855
|
+
};
|
|
12856
|
+
label2 = `\u2714 Awaiting \u2192 ${formatTime(sec)}`;
|
|
12781
12857
|
} else if (normToolName === "exec_command" || normToolName === "ask") {
|
|
12782
12858
|
label2 = "";
|
|
12783
12859
|
} else {
|
|
@@ -13929,6 +14005,20 @@ ${cleanResponse}
|
|
|
13929
14005
|
} else if (normalizedToolName === "file_map") {
|
|
13930
14006
|
const path21 = parseArgs(toolCall.args).path || "...";
|
|
13931
14007
|
label2 = `\u2714 \x1B[95mGet Map\x1B[0m: ${path21}`;
|
|
14008
|
+
} else if (normalizedToolName === "await") {
|
|
14009
|
+
const { time } = parseArgs(toolCall.args);
|
|
14010
|
+
let sec = parseFloat(time) || 0;
|
|
14011
|
+
if (sec < 5) sec = 5;
|
|
14012
|
+
if (sec > 120) sec = 120;
|
|
14013
|
+
const formatTime = (s) => {
|
|
14014
|
+
if (s >= 60) {
|
|
14015
|
+
const m = Math.floor(s / 60);
|
|
14016
|
+
const rem = s % 60;
|
|
14017
|
+
return `${m}m${rem > 0 ? ` ${rem}s` : ""}`;
|
|
14018
|
+
}
|
|
14019
|
+
return `${s}s`;
|
|
14020
|
+
};
|
|
14021
|
+
label2 = `\u2714 \x1B[95mAwaiting\x1B[0m \u2192 ${formatTime(sec)}`;
|
|
13932
14022
|
} else {
|
|
13933
14023
|
const displayLabel = TOOL_LABELS2[normalizedToolName] || toolCall.toolName;
|
|
13934
14024
|
const detail = getToolDetail(normalizedToolName, toolCall.args);
|