fluxflow-cli 3.0.13 → 3.0.15
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 +174 -88
- package/package.json +1 -1
package/dist/fluxflow.js
CHANGED
|
@@ -5185,25 +5185,26 @@ ${mode === "Flux" ? `- WORKSPACE TOOLS (path = relative to CWD & WILL BE FIRST A
|
|
|
5185
5185
|
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
|
|
5186
5186
|
7. [tool:functions.Run(command="...")]. Runs ${osDetected === "Windows" ? isPsAvailable() ? `WINDOWS POWERSHELL ONLY` : `WINDOWS CMD ONLY` : `BASH`} command. Destructive/Irreversible ops \u2192 Ask user
|
|
5187
5187
|
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**
|
|
5188
|
-
9. [tool:functions.
|
|
5188
|
+
9. [tool:functions.Await(time="seconds")]. For waiting without exiting agent loop, 15s - 180s
|
|
5189
5189
|
|
|
5190
5190
|
-- SUB AGENTS DEFINITIONS --
|
|
5191
5191
|
**USING SUB AGENTS HIGHLY PREFERRED FOR MOST TASK**
|
|
5192
5192
|
USE PROACTIVELY WITHOUT EXPLICIT USER COMMAND ALLOWED
|
|
5193
5193
|
|
|
5194
5194
|
Invocation Types:
|
|
5195
|
-
-
|
|
5196
|
-
-
|
|
5195
|
+
- Invoke (async, background worker for parallel tasks, upto 7 parallel agents together). Can take long time, If invoked DO NOT REPEAT SAME TASK AGAIN UNLESS subagent returns ERROR. Usage: Benefits parallelism & speed
|
|
5196
|
+
- InvokeSync (sync, blocking main agent loop). Usage: Repeatetive work, Sequential tasks, Task delegation. Huge tokens/costs savings
|
|
5197
5197
|
|
|
5198
|
-
1. [agent:generalist.
|
|
5199
|
-
2. [agent:generalist.
|
|
5198
|
+
1. [agent:generalist.InvokeSync/Invoke(title="...", task="...")]. Task must me detailed, including exact file paths, imports/exports, dependency, folder structure
|
|
5199
|
+
2. [agent:generalist.GetProgress(id="...")]. Usage: Check progress of async subagent task, taking time? continue your task, MUST await (exponentially longer after 1st check, eg. 15s, 30s, 45s ...) than spamming getProgress. NEVER FINISH WITHOUT 'AWAIT' WHILE SUBAGENT WORKING
|
|
5200
|
+
3. [agent:generalist.Cancel(id="...")]. Usage: Cancel async subagent task, LAST RESORT IF SUB AGENT IS STUCK FOR UNUSUALLY LONG (2m+) WITH NO PROGRESS`.trim() : `- CREATIVE TOOLS (path = relative to CWD & WILL BE FIRST ARGUMENT, path separator: '/') -
|
|
5200
5201
|
1. [tool:functions.WritePDF(path="...", content="...", orientation="...")]. PROACTIVE A4 PAGE BREAKS MUST IN CSS. HTML/CSS for PREMIUM layout
|
|
5201
5202
|
2. [tool:functions.WriteDoc(path="...", content="...")]. A4 Word document
|
|
5202
5203
|
- WORKSPACE & SUB AGENT TOOLS ARE NOT AVAILABLE IN FLOW`.trim()}
|
|
5203
5204
|
|
|
5204
5205
|
- VERIFY TOOL RESULT CONTENTS. Fix errors. No hallucinations
|
|
5205
5206
|
- Escape quotes: \\" for code strings
|
|
5206
|
-
- Literal escapes: Double-escape sequences (e.g., \\\\n
|
|
5207
|
+
- Literal escapes: Double-escape sequences (e.g., \\\\n)
|
|
5207
5208
|
- File structure: Real newlines for code formatting`.trim();
|
|
5208
5209
|
}
|
|
5209
5210
|
});
|
|
@@ -9672,6 +9673,7 @@ var init_invoke = __esm({
|
|
|
9672
9673
|
let currentTurnLogs = [];
|
|
9673
9674
|
const subagentContext = {
|
|
9674
9675
|
...context,
|
|
9676
|
+
taskId,
|
|
9675
9677
|
onVisualFeedback: (feedbackLabel) => {
|
|
9676
9678
|
taskEntry.lastChunkTime = Date.now();
|
|
9677
9679
|
const clean = feedbackLabel.replace(/\x1b\[[0-9;]*m/g, "");
|
|
@@ -9694,6 +9696,7 @@ var init_invoke = __esm({
|
|
|
9694
9696
|
}
|
|
9695
9697
|
};
|
|
9696
9698
|
runSubagent2(task, subagentContext, model, allowedTools, 20, (logMessage) => {
|
|
9699
|
+
if (taskEntry.status === "cancelled") return;
|
|
9697
9700
|
if (logMessage.startsWith("[Subagent Turn")) {
|
|
9698
9701
|
if (currentTurnLogs.length > 0) {
|
|
9699
9702
|
taskEntry.progress.push([...currentTurnLogs]);
|
|
@@ -9720,6 +9723,7 @@ var init_invoke = __esm({
|
|
|
9720
9723
|
context.onSubagentUpdate();
|
|
9721
9724
|
}
|
|
9722
9725
|
}).then((finalAnswer) => {
|
|
9726
|
+
if (taskEntry.status === "cancelled") return;
|
|
9723
9727
|
currentTurnLogs.push(`[SUBAGENT SUCCESS] Final Answer:
|
|
9724
9728
|
${finalAnswer}`);
|
|
9725
9729
|
taskEntry.progress.push([...currentTurnLogs]);
|
|
@@ -9729,6 +9733,7 @@ ${finalAnswer}`);
|
|
|
9729
9733
|
context.onSubagentUpdate();
|
|
9730
9734
|
}
|
|
9731
9735
|
}).catch((err) => {
|
|
9736
|
+
if (taskEntry.status === "cancelled") return;
|
|
9732
9737
|
currentTurnLogs.push(`[SUBAGENT FAILURE] Error: ${err.message}`);
|
|
9733
9738
|
taskEntry.progress.push([...currentTurnLogs]);
|
|
9734
9739
|
taskEntry.status = "failed";
|
|
@@ -9743,7 +9748,6 @@ ${finalAnswer}`);
|
|
|
9743
9748
|
});
|
|
9744
9749
|
|
|
9745
9750
|
// src/tools/getProgress.js
|
|
9746
|
-
import fs20 from "fs";
|
|
9747
9751
|
var getProgress;
|
|
9748
9752
|
var init_getProgress = __esm({
|
|
9749
9753
|
"src/tools/getProgress.js"() {
|
|
@@ -9846,12 +9850,42 @@ ${task.finalAnswer}
|
|
|
9846
9850
|
output += `Failure Error: ${task.error}
|
|
9847
9851
|
`;
|
|
9848
9852
|
}
|
|
9849
|
-
fs20.writeFileSync("progress.txt", output.trim());
|
|
9850
9853
|
return output.trim();
|
|
9851
9854
|
};
|
|
9852
9855
|
}
|
|
9853
9856
|
});
|
|
9854
9857
|
|
|
9858
|
+
// src/tools/cancel.js
|
|
9859
|
+
var cancel;
|
|
9860
|
+
var init_cancel = __esm({
|
|
9861
|
+
"src/tools/cancel.js"() {
|
|
9862
|
+
init_subagent_state();
|
|
9863
|
+
init_arg_parser();
|
|
9864
|
+
cancel = async (args, context = {}) => {
|
|
9865
|
+
const parsed = parseArgs(args);
|
|
9866
|
+
const id = parsed.id;
|
|
9867
|
+
if (!id) {
|
|
9868
|
+
return 'ERROR: Missing "id" argument for cancel.';
|
|
9869
|
+
}
|
|
9870
|
+
const task = subagentProgress.find((t) => t.id === id);
|
|
9871
|
+
if (!task) {
|
|
9872
|
+
return `ERROR: Subagent task with ID [${id}] not found.`;
|
|
9873
|
+
}
|
|
9874
|
+
if (task.status === "completed" || task.status === "failed") {
|
|
9875
|
+
return `INFO: Subagent task with ID [${id}] has already finished with status [${task.status.toUpperCase()}].`;
|
|
9876
|
+
}
|
|
9877
|
+
if (task.status === "cancelled") {
|
|
9878
|
+
return `INFO: Subagent task with ID [${id}] is already cancelled.`;
|
|
9879
|
+
}
|
|
9880
|
+
task.status = "cancelled";
|
|
9881
|
+
if (context.onSubagentUpdate) {
|
|
9882
|
+
context.onSubagentUpdate();
|
|
9883
|
+
}
|
|
9884
|
+
return `SUCCESS: Subagent task with ID [${id}] has been cancelled.`;
|
|
9885
|
+
};
|
|
9886
|
+
}
|
|
9887
|
+
});
|
|
9888
|
+
|
|
9855
9889
|
// src/tools/await.js
|
|
9856
9890
|
var awaitTool;
|
|
9857
9891
|
var init_await = __esm({
|
|
@@ -9912,6 +9946,7 @@ var init_tools = __esm({
|
|
|
9912
9946
|
init_invokeSync();
|
|
9913
9947
|
init_invoke();
|
|
9914
9948
|
init_getProgress();
|
|
9949
|
+
init_cancel();
|
|
9915
9950
|
init_await();
|
|
9916
9951
|
TOOL_MAP = {
|
|
9917
9952
|
web_search,
|
|
@@ -9934,6 +9969,7 @@ var init_tools = __esm({
|
|
|
9934
9969
|
invokeSync,
|
|
9935
9970
|
invoke,
|
|
9936
9971
|
getProgress,
|
|
9972
|
+
cancel,
|
|
9937
9973
|
invoke_sync: invokeSync,
|
|
9938
9974
|
get_progress: getProgress,
|
|
9939
9975
|
ask: ask_user,
|
|
@@ -9965,6 +10001,7 @@ var init_tools = __esm({
|
|
|
9965
10001
|
InvokeSync: invokeSync,
|
|
9966
10002
|
Invoke: invoke,
|
|
9967
10003
|
GetProgress: getProgress,
|
|
10004
|
+
Cancel: cancel,
|
|
9968
10005
|
await: awaitTool,
|
|
9969
10006
|
Await: awaitTool
|
|
9970
10007
|
};
|
|
@@ -10117,7 +10154,7 @@ __export(ai_exports, {
|
|
|
10117
10154
|
});
|
|
10118
10155
|
import { GoogleGenAI, ThinkingLevel, HarmBlockThreshold, HarmCategory } from "@google/genai";
|
|
10119
10156
|
import path19 from "path";
|
|
10120
|
-
import
|
|
10157
|
+
import fs20 from "fs";
|
|
10121
10158
|
var client, globalSettings, colorMainWords, withRetry, TERMINATION_SIGNAL, MULTIMODAL_MODELS, isModelMultimodal, getCleanGroupedLength, stripAnsi2, fetchWithBackoff, getDeepSeekStream, getNVIDIAStream, getOpenRouterStream, signalTermination, TOOL_LABELS2, getToolDetail, runJanitorTask, getActiveToolContext, getContextSafeText, contextSafeReplace, getSanitizedText, translateKimiToolCalls, detectToolCalls, initAI, generateSimpleContent, consolidatePastMemories, compressHistory, deleteChatSummary, getAIStream, runSubagent;
|
|
10122
10159
|
var init_ai = __esm({
|
|
10123
10160
|
async "src/utils/ai.js"() {
|
|
@@ -10131,6 +10168,7 @@ var init_ai = __esm({
|
|
|
10131
10168
|
init_terminal();
|
|
10132
10169
|
init_text();
|
|
10133
10170
|
init_settings();
|
|
10171
|
+
init_subagent_state();
|
|
10134
10172
|
init_paths();
|
|
10135
10173
|
init_revert();
|
|
10136
10174
|
init_editor();
|
|
@@ -10138,7 +10176,7 @@ var init_ai = __esm({
|
|
|
10138
10176
|
globalSettings = {};
|
|
10139
10177
|
colorMainWords = (label) => {
|
|
10140
10178
|
if (!label) return label;
|
|
10141
|
-
return label.replace(/(?:(\x1b\[\d+m))?([
|
|
10179
|
+
return label.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|Indexed|Analyzed|Browsed|Elevating SubAgent|Checking SubAgent Work|Invoked Background-Agent|Unsupported Modality|Awaiting|Cancelled)\b/ig, (match, ansiBefore, icon, ansiAfter, word) => {
|
|
10142
10180
|
return `${ansiBefore || ""}${icon}${ansiAfter || ""} \x1B[95m${word}\x1B[0m`;
|
|
10143
10181
|
});
|
|
10144
10182
|
};
|
|
@@ -10151,7 +10189,7 @@ var init_ai = __esm({
|
|
|
10151
10189
|
try {
|
|
10152
10190
|
return await fn();
|
|
10153
10191
|
} catch (error) {
|
|
10154
|
-
if (signal?.aborted || error?.name === "AbortError") {
|
|
10192
|
+
if (signal?.aborted || error?.name === "AbortError" || error?.message === "Subagent task was cancelled.") {
|
|
10155
10193
|
throw error;
|
|
10156
10194
|
}
|
|
10157
10195
|
attempt++;
|
|
@@ -10727,6 +10765,7 @@ var init_ai = __esm({
|
|
|
10727
10765
|
"invoke_sync": "Spawning SubAgent",
|
|
10728
10766
|
"invoke": "Spawning SubAgent",
|
|
10729
10767
|
"get_progress": "Checking SubAgent",
|
|
10768
|
+
"cancel": "Cancelling",
|
|
10730
10769
|
"await": "Waiting"
|
|
10731
10770
|
};
|
|
10732
10771
|
getToolDetail = (toolName, argsStr) => {
|
|
@@ -10736,7 +10775,7 @@ var init_ai = __esm({
|
|
|
10736
10775
|
if (normToolName === "invokesync" || normToolName === "invoke") {
|
|
10737
10776
|
return pArgs.title || (pArgs.task ? pArgs.task.substring(0, 30) : null);
|
|
10738
10777
|
}
|
|
10739
|
-
if (normToolName === "getprogress") {
|
|
10778
|
+
if (normToolName === "getprogress" || normToolName === "cancel") {
|
|
10740
10779
|
return pArgs.id || pArgs.taskId;
|
|
10741
10780
|
}
|
|
10742
10781
|
const filePath = pArgs.path || pArgs.targetFile || pArgs.TargetFile || pArgs.directory;
|
|
@@ -10982,8 +11021,8 @@ ${originalTextProcessed.length > USER_CONTEXT_LENGTH ? "... (truncated) ...\n\n"
|
|
|
10982
11021
|
})() : String(err);
|
|
10983
11022
|
await new Promise((resolve) => setTimeout(resolve, 1e3));
|
|
10984
11023
|
const janitorErrDir = path19.join(LOGS_DIR, "janitor");
|
|
10985
|
-
if (!
|
|
10986
|
-
|
|
11024
|
+
if (!fs20.existsSync(janitorErrDir)) fs20.mkdirSync(janitorErrDir, { recursive: true });
|
|
11025
|
+
fs20.appendFileSync(path19.join(janitorErrDir, "error.log"), `ERROR [Attempt ${attempts}/${MAX_JANITOR_RETRIES + 1}] [${date}]: ${errLog}
|
|
10987
11026
|
|
|
10988
11027
|
`);
|
|
10989
11028
|
if (attempts > MAX_JANITOR_RETRIES) break;
|
|
@@ -10993,7 +11032,7 @@ ${originalTextProcessed.length > USER_CONTEXT_LENGTH ? "... (truncated) ...\n\n"
|
|
|
10993
11032
|
}
|
|
10994
11033
|
if (attempts) {
|
|
10995
11034
|
const janitorErrDir = path19.join(LOGS_DIR, "janitor");
|
|
10996
|
-
|
|
11035
|
+
fs20.appendFileSync(path19.join(janitorErrDir, "error.log"), `-----------------------------------------------------------------------------
|
|
10997
11036
|
|
|
10998
11037
|
`);
|
|
10999
11038
|
if (attempts >= MAX_JANITOR_RETRIES) {
|
|
@@ -11350,6 +11389,12 @@ ${originalTextProcessed.length > USER_CONTEXT_LENGTH ? "... (truncated) ...\n\n"
|
|
|
11350
11389
|
stream = genStream;
|
|
11351
11390
|
}
|
|
11352
11391
|
for await (const chunk of stream) {
|
|
11392
|
+
if (settings?.taskId && typeof subagentProgress !== "undefined") {
|
|
11393
|
+
const taskObj = subagentProgress.find((t) => t.id === settings.taskId);
|
|
11394
|
+
if (taskObj && taskObj.status === "cancelled") {
|
|
11395
|
+
throw new Error("Subagent task was cancelled.");
|
|
11396
|
+
}
|
|
11397
|
+
}
|
|
11353
11398
|
if (settings && typeof settings.onTokenChunk === "function") {
|
|
11354
11399
|
settings.onTokenChunk();
|
|
11355
11400
|
}
|
|
@@ -11379,7 +11424,7 @@ ${originalTextProcessed.length > USER_CONTEXT_LENGTH ? "... (truncated) ...\n\n"
|
|
|
11379
11424
|
});
|
|
11380
11425
|
}
|
|
11381
11426
|
}
|
|
11382
|
-
await incrementUsage(
|
|
11427
|
+
await incrementUsage("agent", aiProvider);
|
|
11383
11428
|
return { text: fullText, usageMetadata };
|
|
11384
11429
|
});
|
|
11385
11430
|
};
|
|
@@ -11468,8 +11513,8 @@ ${newMemoryListStr}
|
|
|
11468
11513
|
})() : String(err);
|
|
11469
11514
|
;
|
|
11470
11515
|
const janitorLogDir = path19.join(LOGS_DIR, "janitor");
|
|
11471
|
-
if (!
|
|
11472
|
-
|
|
11516
|
+
if (!fs20.existsSync(janitorLogDir)) fs20.mkdirSync(janitorLogDir, { recursive: true });
|
|
11517
|
+
fs20.appendFileSync(
|
|
11473
11518
|
path19.join(janitorLogDir, "error.log"),
|
|
11474
11519
|
`[${(/* @__PURE__ */ new Date()).toLocaleString()}] Past memory batch consolidation error: ${errLog}
|
|
11475
11520
|
`
|
|
@@ -11553,7 +11598,7 @@ Provide a consolidated summary of the entire session.`;
|
|
|
11553
11598
|
deleteChatSummary = (chatId) => {
|
|
11554
11599
|
try {
|
|
11555
11600
|
const summariesFile = path19.join(SECRET_DIR, "chat-summaries.json");
|
|
11556
|
-
if (
|
|
11601
|
+
if (fs20.existsSync(summariesFile)) {
|
|
11557
11602
|
const summaries = readEncryptedJson(summariesFile, {});
|
|
11558
11603
|
if (summaries[chatId]) {
|
|
11559
11604
|
delete summaries[chatId];
|
|
@@ -11610,6 +11655,15 @@ Provide a consolidated summary of the entire session.`;
|
|
|
11610
11655
|
modifiedHistory = slicedHistory;
|
|
11611
11656
|
}
|
|
11612
11657
|
}
|
|
11658
|
+
modifiedHistory = modifiedHistory.map((msg) => {
|
|
11659
|
+
if (msg.role === "user" && msg.text) {
|
|
11660
|
+
const match2 = msg.text.match(/\[USER\]([\s\S]*?)\[\/USER\]/);
|
|
11661
|
+
if (match2) {
|
|
11662
|
+
return { ...msg, text: match2[1].trim() };
|
|
11663
|
+
}
|
|
11664
|
+
}
|
|
11665
|
+
return { ...msg };
|
|
11666
|
+
});
|
|
11613
11667
|
let contextCompressionCount = 255e3;
|
|
11614
11668
|
let contextTruncationCount = 26e4;
|
|
11615
11669
|
if (aiProvider === "NVIDIA" && (modelName?.includes("glm") || modelName?.includes("gpt") || modelName?.includes("qwen"))) {
|
|
@@ -11796,7 +11850,7 @@ Provide a consolidated summary of the entire session.`;
|
|
|
11796
11850
|
];
|
|
11797
11851
|
const safeReaddirWithTypes = (dir) => {
|
|
11798
11852
|
try {
|
|
11799
|
-
return
|
|
11853
|
+
return fs20.readdirSync(dir, { withFileTypes: true });
|
|
11800
11854
|
} catch (e) {
|
|
11801
11855
|
return [];
|
|
11802
11856
|
}
|
|
@@ -11902,8 +11956,8 @@ Provide a consolidated summary of the entire session.`;
|
|
|
11902
11956
|
if (hasExistingTurnsAfterCompression && currentSummary) {
|
|
11903
11957
|
if (modifiedHistory[0] && (modifiedHistory[0].role === "user" || modifiedHistory[0].role === "system")) {
|
|
11904
11958
|
if (!modifiedHistory[0].text.includes("**CONTEXT SUMMARY OF PREVIOUS TURNS")) {
|
|
11905
|
-
modifiedHistory[0].text = `[SYSTEM METADATA
|
|
11906
|
-
**CONTEXT SUMMARY OF PREVIOUS TURNS (PRIORITY:
|
|
11959
|
+
modifiedHistory[0].text = `[SYSTEM METADATA]
|
|
11960
|
+
**CONTEXT SUMMARY OF PREVIOUS TURNS (PRIORITY: DYNAMIC)**
|
|
11907
11961
|
${currentSummary}
|
|
11908
11962
|
|
|
11909
11963
|
[USER] ${modifiedHistory[0].text}`;
|
|
@@ -11912,8 +11966,8 @@ ${currentSummary}
|
|
|
11912
11966
|
}
|
|
11913
11967
|
}
|
|
11914
11968
|
const activeSummaryBlock = currentSummary && !hasExistingTurnsAfterCompression ? `
|
|
11915
|
-
[SYSTEM METADATA
|
|
11916
|
-
**CONTEXT SUMMARY OF PREVIOUS TURNS (PRIORITY:
|
|
11969
|
+
[SYSTEM METADATA]
|
|
11970
|
+
**CONTEXT SUMMARY OF PREVIOUS TURNS (PRIORITY: DYNAMIC)**
|
|
11917
11971
|
${currentSummary}
|
|
11918
11972
|
` : "";
|
|
11919
11973
|
let dirStructure = process.cwd() + "\n" + getDirTree(process.cwd(), dynamicMaxDepth);
|
|
@@ -12086,8 +12140,8 @@ ${ideCtx.warnings}
|
|
|
12086
12140
|
filePath = tagClean.slice(0, matchRange.index);
|
|
12087
12141
|
}
|
|
12088
12142
|
const absPath = path19.resolve(process.cwd(), filePath);
|
|
12089
|
-
if (
|
|
12090
|
-
const stats =
|
|
12143
|
+
if (fs20.existsSync(absPath)) {
|
|
12144
|
+
const stats = fs20.statSync(absPath);
|
|
12091
12145
|
if (stats.isFile()) {
|
|
12092
12146
|
const pathLower = filePath.toLowerCase();
|
|
12093
12147
|
const isPdf = pathLower.endsWith(".pdf");
|
|
@@ -12149,7 +12203,7 @@ ${boxMid}
|
|
|
12149
12203
|
} else {
|
|
12150
12204
|
let totalLines = "...";
|
|
12151
12205
|
try {
|
|
12152
|
-
const content =
|
|
12206
|
+
const content = fs20.readFileSync(absPath, "utf8");
|
|
12153
12207
|
totalLines = content.split("\n").length;
|
|
12154
12208
|
} catch (e) {
|
|
12155
12209
|
}
|
|
@@ -12775,6 +12829,8 @@ ${ideErr} [/ERROR]`;
|
|
|
12775
12829
|
"invoke": "invoke",
|
|
12776
12830
|
"invokeSync": "invoke_sync",
|
|
12777
12831
|
"getProgress": "get_progress",
|
|
12832
|
+
"GetProgress": "get_progress",
|
|
12833
|
+
"Cancel": "cancel",
|
|
12778
12834
|
"await": "await",
|
|
12779
12835
|
"Await": "await"
|
|
12780
12836
|
};
|
|
@@ -12832,20 +12888,22 @@ ${ideErr} [/ERROR]`;
|
|
|
12832
12888
|
yield { type: "status", content: `${currentLabel}...` };
|
|
12833
12889
|
if (process.stdout.isTTY) {
|
|
12834
12890
|
const TOOL_TITLES = {
|
|
12835
|
-
"
|
|
12836
|
-
"
|
|
12837
|
-
"
|
|
12838
|
-
"
|
|
12891
|
+
"WebSearch": "Searching",
|
|
12892
|
+
"WebScrape": "Reading",
|
|
12893
|
+
"ReadFile": "Reading",
|
|
12894
|
+
"ReadFolder": "Reading",
|
|
12839
12895
|
"list_files": "Reading",
|
|
12840
|
-
"
|
|
12841
|
-
"
|
|
12842
|
-
"
|
|
12843
|
-
"
|
|
12844
|
-
"
|
|
12845
|
-
"
|
|
12846
|
-
"
|
|
12847
|
-
"
|
|
12848
|
-
"
|
|
12896
|
+
"WriteFile": "Writing",
|
|
12897
|
+
"UpdateFile": "Editing",
|
|
12898
|
+
"WritePdf": "Creating",
|
|
12899
|
+
"WriteDocx": "Creating",
|
|
12900
|
+
"SearchKeyword": "Searching",
|
|
12901
|
+
"Run": "Executing",
|
|
12902
|
+
"Ask": "User Input Required",
|
|
12903
|
+
"Memory": "Updating Memory",
|
|
12904
|
+
"GenerateImage": "Generating",
|
|
12905
|
+
"InvokeSync": "Sub-Agent Working",
|
|
12906
|
+
"Await": "Waiting"
|
|
12849
12907
|
};
|
|
12850
12908
|
const toolTitle = TOOL_TITLES[potentialTool] || "Working";
|
|
12851
12909
|
process.stdout.write(`\x1B]0;${toolTitle}...\x07`);
|
|
@@ -12976,6 +13034,9 @@ ${ideErr} [/ERROR]`;
|
|
|
12976
13034
|
"invoke": "invoke",
|
|
12977
13035
|
"invokeSync": "invoke_sync",
|
|
12978
13036
|
"getProgress": "get_progress",
|
|
13037
|
+
"GetProgress": "get_progress",
|
|
13038
|
+
"Cancel": "cancel",
|
|
13039
|
+
"cancel": "cancel",
|
|
12979
13040
|
"await": "await",
|
|
12980
13041
|
"Await": "await"
|
|
12981
13042
|
};
|
|
@@ -13000,8 +13061,8 @@ ${ideErr} [/ERROR]`;
|
|
|
13000
13061
|
let actualEndLine = eLine;
|
|
13001
13062
|
try {
|
|
13002
13063
|
const absPath = path19.resolve(process.cwd(), targetPath2);
|
|
13003
|
-
if (
|
|
13004
|
-
const content =
|
|
13064
|
+
if (fs20.existsSync(absPath)) {
|
|
13065
|
+
const content = fs20.readFileSync(absPath, "utf8");
|
|
13005
13066
|
const lines = content.split("\n").length;
|
|
13006
13067
|
totalLines = lines;
|
|
13007
13068
|
actualEndLine = Math.min(eLine, lines);
|
|
@@ -13039,12 +13100,18 @@ ${ideErr} [/ERROR]`;
|
|
|
13039
13100
|
} else if (normToolName.toLowerCase() === "generate_image") {
|
|
13040
13101
|
const { path: argPath, outputPath, output } = parseArgs(toolCall.args);
|
|
13041
13102
|
label = `\u2714 Generated: ${argPath || outputPath || output || "generated_image.png"}`;
|
|
13042
|
-
} else if (normToolName === "invoke_sync" || normToolName === "
|
|
13103
|
+
} else if (normToolName === "invoke_sync" || normToolName === "InvokeSync") {
|
|
13104
|
+
const detail2 = getToolDetail(normToolName, toolCall.args);
|
|
13105
|
+
label = `\u2714 Invoked Sub-Agent${detail2 ? `: ${detail2}` : ""}`;
|
|
13106
|
+
} else if (normToolName === "Invoke" || normToolName === "InvokeAsync" || normToolName === "invoke") {
|
|
13043
13107
|
const detail2 = getToolDetail(normToolName, toolCall.args);
|
|
13044
|
-
label = `\u2714
|
|
13045
|
-
} else if (normToolName === "get_progress") {
|
|
13108
|
+
label = `\u2714 Invoked Background-Agent${detail2 ? `: ${detail2}` : ""}`;
|
|
13109
|
+
} else if (normToolName === "get_progress" || normToolName === "GetProgress") {
|
|
13046
13110
|
const detail2 = getToolDetail(normToolName, toolCall.args);
|
|
13047
13111
|
label = `\u2714 Checked${detail2 ? `: ${detail2}` : ""}`;
|
|
13112
|
+
} else if (normToolName === "cancel") {
|
|
13113
|
+
const detail2 = getToolDetail(normToolName, toolCall.args);
|
|
13114
|
+
label = `\u2298 Cancelled${detail2 ? `: ${detail2}` : ""}`;
|
|
13048
13115
|
} else if (normToolName === "await") {
|
|
13049
13116
|
const { time } = parseArgs(toolCall.args);
|
|
13050
13117
|
let sec = parseFloat(time) || 0;
|
|
@@ -13398,8 +13465,8 @@ ${boxMid}`) };
|
|
|
13398
13465
|
if (currentIDE && normFocused === normAbsPath && currentIDE.full_content) {
|
|
13399
13466
|
originalContent = currentIDE.full_content;
|
|
13400
13467
|
hasOriginal = true;
|
|
13401
|
-
} else if (
|
|
13402
|
-
originalContent =
|
|
13468
|
+
} else if (fs20.existsSync(absPath)) {
|
|
13469
|
+
originalContent = fs20.readFileSync(absPath, "utf8");
|
|
13403
13470
|
hasOriginal = true;
|
|
13404
13471
|
}
|
|
13405
13472
|
originalContentForReporting = originalContent;
|
|
@@ -13453,10 +13520,10 @@ ${boxMid}}`) };
|
|
|
13453
13520
|
} else if (normToolName === "write_file") {
|
|
13454
13521
|
const rawContent = toolArgs.content || toolArgs.newContent || "";
|
|
13455
13522
|
const modifiedContent = rawContent.endsWith("\n") ? rawContent : rawContent + "\n";
|
|
13456
|
-
if (!
|
|
13523
|
+
if (!fs20.existsSync(absPath)) {
|
|
13457
13524
|
isNewFileCreated = true;
|
|
13458
|
-
|
|
13459
|
-
|
|
13525
|
+
fs20.mkdirSync(path19.dirname(absPath), { recursive: true });
|
|
13526
|
+
fs20.writeFileSync(absPath, "", "utf8");
|
|
13460
13527
|
}
|
|
13461
13528
|
yield { type: "status", content: `Opening New File Diff in IDE: ${path19.basename(absPath)}...` };
|
|
13462
13529
|
showDiffInIDE(absPath, "", modifiedContent);
|
|
@@ -13496,9 +13563,9 @@ ${boxMid}}`) };
|
|
|
13496
13563
|
if (filePath) {
|
|
13497
13564
|
const absPath = path19.resolve(process.cwd(), filePath);
|
|
13498
13565
|
closeDiffInIDE(absPath, approval);
|
|
13499
|
-
if (approval === "deny" && isNewFileCreated &&
|
|
13566
|
+
if (approval === "deny" && isNewFileCreated && fs20.existsSync(absPath)) {
|
|
13500
13567
|
try {
|
|
13501
|
-
|
|
13568
|
+
fs20.unlinkSync(absPath);
|
|
13502
13569
|
} catch (e) {
|
|
13503
13570
|
}
|
|
13504
13571
|
}
|
|
@@ -13515,8 +13582,8 @@ ${boxMid}}`) };
|
|
|
13515
13582
|
let finalContent = "";
|
|
13516
13583
|
if (finalIDE && finalIDE.file_focused === absPath && finalIDE.full_content) {
|
|
13517
13584
|
finalContent = finalIDE.full_content;
|
|
13518
|
-
} else if (
|
|
13519
|
-
finalContent =
|
|
13585
|
+
} else if (fs20.existsSync(absPath)) {
|
|
13586
|
+
finalContent = fs20.readFileSync(absPath, "utf8");
|
|
13520
13587
|
}
|
|
13521
13588
|
const verifiedLines = finalContent.split(/\r?\n/);
|
|
13522
13589
|
const verifiedLineCount = verifiedLines.length;
|
|
@@ -13938,8 +14005,8 @@ ${colorMainWords(output)}` };
|
|
|
13938
14005
|
;
|
|
13939
14006
|
const date = (/* @__PURE__ */ new Date()).toLocaleString();
|
|
13940
14007
|
const agentErrDir = path19.join(LOGS_DIR, "agent");
|
|
13941
|
-
if (!
|
|
13942
|
-
|
|
14008
|
+
if (!fs20.existsSync(agentErrDir)) fs20.mkdirSync(agentErrDir, { recursive: true });
|
|
14009
|
+
fs20.appendFileSync(path19.join(agentErrDir, "error.log"), `ERROR [${date}]: ${errLog}
|
|
13943
14010
|
|
|
13944
14011
|
----------------------------------------------------------------------
|
|
13945
14012
|
|
|
@@ -14109,8 +14176,8 @@ Error Log can be found in ${path19.join(LOGS_DIR, "agent", "error.log")}`);
|
|
|
14109
14176
|
const date = (/* @__PURE__ */ new Date()).toLocaleString();
|
|
14110
14177
|
const agentErrDir = path19.join(LOGS_DIR, "agent");
|
|
14111
14178
|
yield { type: "text", content: `\u274C CRITICAL ERROR: ${errLog}` };
|
|
14112
|
-
if (!
|
|
14113
|
-
|
|
14179
|
+
if (!fs20.existsSync(agentErrDir)) fs20.mkdirSync(agentErrDir, { recursive: true });
|
|
14180
|
+
fs20.appendFileSync(path19.join(agentErrDir, "error.log"), `CRITICAL ERROR [${date}]: ${errLog}
|
|
14114
14181
|
|
|
14115
14182
|
----------------------------------------------------------------------
|
|
14116
14183
|
|
|
@@ -14152,7 +14219,12 @@ TOOL POLICY:
|
|
|
14152
14219
|
- Want spefific STRING across project/file? SearchKeyword >> Guessing/ReadFile
|
|
14153
14220
|
- HUGE FILES? SearchKeyword >> FileMap/Full Read
|
|
14154
14221
|
-- PROVIDED TOOLS --
|
|
14155
|
-
${Object.values(SUBAGENT_TOOL_DEFINITIONS).join("\n")}
|
|
14222
|
+
${Object.values(SUBAGENT_TOOL_DEFINITIONS).join("\n")}
|
|
14223
|
+
|
|
14224
|
+
- VERIFY TOOL RESULT CONTENTS. Fix errors. No hallucinations
|
|
14225
|
+
- Escape quotes: \\" for code strings
|
|
14226
|
+
- Literal escapes: Double-escape sequences (e.g., \\\\n)
|
|
14227
|
+
- File structure: Real newlines for code formatting`.trim();
|
|
14156
14228
|
const systemInstruction = `=== START SYSTEM PROMPT ===
|
|
14157
14229
|
You are a subagent helping the main FluxFlow CLI agent
|
|
14158
14230
|
Your task is: "${task}"
|
|
@@ -14174,6 +14246,13 @@ Current Time: ${(/* @__PURE__ */ new Date()).toLocaleString("en-US", { year: "nu
|
|
|
14174
14246
|
let turn = 0;
|
|
14175
14247
|
let finalAnswer = "";
|
|
14176
14248
|
while (turn < maxTurns) {
|
|
14249
|
+
if (settings?.taskId && typeof subagentProgress !== "undefined") {
|
|
14250
|
+
const taskObj = subagentProgress.find((t) => t.id === settings.taskId);
|
|
14251
|
+
if (taskObj && taskObj.status === "cancelled") {
|
|
14252
|
+
if (logCallback) logCallback(`[SUBAGENT CANCELLED] Subagent task was cancelled.`);
|
|
14253
|
+
throw new Error("Subagent task was cancelled.");
|
|
14254
|
+
}
|
|
14255
|
+
}
|
|
14177
14256
|
const contents = subagentHistory.map((m) => ({
|
|
14178
14257
|
role: m.role === "user" ? "user" : "model",
|
|
14179
14258
|
parts: [{ text: m.text }]
|
|
@@ -14193,6 +14272,12 @@ ${cleanResponse}
|
|
|
14193
14272
|
}
|
|
14194
14273
|
let toolResultsStr = "";
|
|
14195
14274
|
for (const toolCall of toolCalls) {
|
|
14275
|
+
if (settings?.taskId && typeof subagentProgress !== "undefined") {
|
|
14276
|
+
const taskObj = subagentProgress.find((t) => t.id === settings.taskId);
|
|
14277
|
+
if (taskObj && taskObj.status === "cancelled") {
|
|
14278
|
+
throw new Error("Subagent task was cancelled.");
|
|
14279
|
+
}
|
|
14280
|
+
}
|
|
14196
14281
|
const normalizedToolName = toolCall.toolName.toLowerCase();
|
|
14197
14282
|
const allowed = allowedTools ? allowedTools.some((t) => t.toLowerCase() === normalizedToolName) : true;
|
|
14198
14283
|
if (!allowed) {
|
|
@@ -15084,7 +15169,7 @@ var init_RevertModal = __esm({
|
|
|
15084
15169
|
import puppeteer4 from "puppeteer";
|
|
15085
15170
|
import { exec } from "child_process";
|
|
15086
15171
|
import { promisify } from "util";
|
|
15087
|
-
import
|
|
15172
|
+
import fs21 from "fs";
|
|
15088
15173
|
var execAsync, checkPuppeteerReady, installPuppeteerBrowser;
|
|
15089
15174
|
var init_setup = __esm({
|
|
15090
15175
|
"src/utils/setup.js"() {
|
|
@@ -15092,7 +15177,7 @@ var init_setup = __esm({
|
|
|
15092
15177
|
checkPuppeteerReady = () => {
|
|
15093
15178
|
try {
|
|
15094
15179
|
const exePath = puppeteer4.executablePath();
|
|
15095
|
-
const exists = exePath &&
|
|
15180
|
+
const exists = exePath && fs21.existsSync(exePath);
|
|
15096
15181
|
if (exists) return true;
|
|
15097
15182
|
} catch (e) {
|
|
15098
15183
|
return false;
|
|
@@ -15125,7 +15210,7 @@ __export(app_exports, {
|
|
|
15125
15210
|
import os4 from "os";
|
|
15126
15211
|
import React15, { useState as useState14, useEffect as useEffect11, useRef as useRef4, useMemo as useMemo2 } from "react";
|
|
15127
15212
|
import { Box as Box14, Text as Text15, useInput as useInput9, useStdout as useStdout2, Static } from "ink";
|
|
15128
|
-
import
|
|
15213
|
+
import fs22 from "fs-extra";
|
|
15129
15214
|
import path20 from "path";
|
|
15130
15215
|
import { exec as exec2 } from "child_process";
|
|
15131
15216
|
import { fileURLToPath } from "url";
|
|
@@ -15371,10 +15456,10 @@ function App({ args = [] }) {
|
|
|
15371
15456
|
const kbPath = getKeybindingsPath(ideName);
|
|
15372
15457
|
if (!kbPath) return;
|
|
15373
15458
|
try {
|
|
15374
|
-
await
|
|
15459
|
+
await fs22.ensureDir(path20.dirname(kbPath));
|
|
15375
15460
|
let bindings = [];
|
|
15376
|
-
if (
|
|
15377
|
-
const content =
|
|
15461
|
+
if (fs22.existsSync(kbPath)) {
|
|
15462
|
+
const content = fs22.readFileSync(kbPath, "utf8").trim();
|
|
15378
15463
|
if (content) {
|
|
15379
15464
|
try {
|
|
15380
15465
|
bindings = parseJsonc(content);
|
|
@@ -15394,7 +15479,7 @@ function App({ args = [] }) {
|
|
|
15394
15479
|
},
|
|
15395
15480
|
"when": "terminalFocus"
|
|
15396
15481
|
});
|
|
15397
|
-
|
|
15482
|
+
fs22.writeFileSync(kbPath, JSON.stringify(bindings, null, 4), "utf8");
|
|
15398
15483
|
cachedShortcut = "Shift + Enter";
|
|
15399
15484
|
setMessages((prev) => {
|
|
15400
15485
|
setCompletedIndex(prev.length + 1);
|
|
@@ -16070,7 +16155,7 @@ function App({ args = [] }) {
|
|
|
16070
16155
|
useEffect11(() => {
|
|
16071
16156
|
async function init() {
|
|
16072
16157
|
try {
|
|
16073
|
-
const pkg = JSON.parse(
|
|
16158
|
+
const pkg = JSON.parse(fs22.readFileSync(path20.join(process.cwd(), "package.json"), "utf8"));
|
|
16074
16159
|
initBridge(versionFluxflow || pkg.version || "2.0.0");
|
|
16075
16160
|
} catch (e) {
|
|
16076
16161
|
initBridge("2.0.0");
|
|
@@ -16193,7 +16278,7 @@ function App({ args = [] }) {
|
|
|
16193
16278
|
if (!parsedArgs.playground) {
|
|
16194
16279
|
deleteChat(PLAYGROUND_CHAT_ID).catch(() => {
|
|
16195
16280
|
});
|
|
16196
|
-
|
|
16281
|
+
fs22.remove(path20.join(DATA_DIR, "playground")).catch(() => {
|
|
16197
16282
|
});
|
|
16198
16283
|
}
|
|
16199
16284
|
performVersionCheck(false, freshSettings);
|
|
@@ -16229,7 +16314,7 @@ function App({ args = [] }) {
|
|
|
16229
16314
|
if (parsedArgs.playground) {
|
|
16230
16315
|
const playgroundDir = path20.join(DATA_DIR, "playground");
|
|
16231
16316
|
try {
|
|
16232
|
-
|
|
16317
|
+
fs22.ensureDirSync(playgroundDir);
|
|
16233
16318
|
process.chdir(playgroundDir);
|
|
16234
16319
|
} catch (e) {
|
|
16235
16320
|
}
|
|
@@ -16270,8 +16355,8 @@ function App({ args = [] }) {
|
|
|
16270
16355
|
if (kbPath) {
|
|
16271
16356
|
try {
|
|
16272
16357
|
let bindings = [];
|
|
16273
|
-
if (
|
|
16274
|
-
const content =
|
|
16358
|
+
if (fs22.existsSync(kbPath)) {
|
|
16359
|
+
const content = fs22.readFileSync(kbPath, "utf8").trim();
|
|
16275
16360
|
if (content) {
|
|
16276
16361
|
bindings = parseJsonc(content);
|
|
16277
16362
|
}
|
|
@@ -16812,9 +16897,9 @@ ${cleanText}`, color: "magenta" }];
|
|
|
16812
16897
|
setCompletedIndex(prev.length + 1);
|
|
16813
16898
|
return [...prev, { id: Date.now(), role: "system", text: `[PLAYGROUND] Exporting playground content to ${dest}`, isMeta: true }];
|
|
16814
16899
|
});
|
|
16815
|
-
await
|
|
16900
|
+
await fs22.ensureDir(dest);
|
|
16816
16901
|
const excludeDirs = ["node_modules", ".git", ".venv", "venv", "env", ".next", "dist", "build", ".cache"];
|
|
16817
|
-
await
|
|
16902
|
+
await fs22.copy(src, dest, {
|
|
16818
16903
|
overwrite: true,
|
|
16819
16904
|
filter: (srcPath) => {
|
|
16820
16905
|
const relative = path20.relative(src, srcPath);
|
|
@@ -16879,7 +16964,7 @@ ${cleanText}`, color: "magenta" }];
|
|
|
16879
16964
|
}
|
|
16880
16965
|
}
|
|
16881
16966
|
setTimeout(() => {
|
|
16882
|
-
|
|
16967
|
+
fs22.emptyDir(path20.join(DATA_DIR, "playground")).catch((err) => {
|
|
16883
16968
|
setMessages((prev) => {
|
|
16884
16969
|
const newMsgs = [...prev, {
|
|
16885
16970
|
id: "playground-" + Date.now(),
|
|
@@ -17228,7 +17313,7 @@ ${cleanText}`, color: "magenta" }];
|
|
|
17228
17313
|
}
|
|
17229
17314
|
const fileContent = exportLines.join("\n");
|
|
17230
17315
|
try {
|
|
17231
|
-
|
|
17316
|
+
fs22.writeFileSync(exportPath, fileContent, "utf8");
|
|
17232
17317
|
setMessages((prev) => {
|
|
17233
17318
|
setCompletedIndex(prev.length + 1);
|
|
17234
17319
|
return [...prev, {
|
|
@@ -17275,12 +17360,12 @@ ${list || "No saved chats found."}`, isMeta: true }];
|
|
|
17275
17360
|
setCompletedIndex(prev.length + 1);
|
|
17276
17361
|
return [...prev, { id: Date.now(), role: "system", text: "[NUCLEAR] Initiating reset...", isMeta: true }];
|
|
17277
17362
|
});
|
|
17278
|
-
if (
|
|
17279
|
-
if (
|
|
17280
|
-
if (
|
|
17363
|
+
if (fs22.existsSync(LOGS_DIR)) fs22.removeSync(LOGS_DIR);
|
|
17364
|
+
if (fs22.existsSync(SECRET_DIR)) fs22.removeSync(SECRET_DIR);
|
|
17365
|
+
if (fs22.existsSync(SETTINGS_FILE)) fs22.removeSync(SETTINGS_FILE);
|
|
17281
17366
|
try {
|
|
17282
|
-
const items =
|
|
17283
|
-
if (items.length === 0)
|
|
17367
|
+
const items = fs22.readdirSync(FLUXFLOW_DIR);
|
|
17368
|
+
if (items.length === 0) fs22.removeSync(FLUXFLOW_DIR);
|
|
17284
17369
|
} catch (e) {
|
|
17285
17370
|
}
|
|
17286
17371
|
setTimeout(() => {
|
|
@@ -17403,14 +17488,14 @@ ${list || "No saved chats found."}`, isMeta: true }];
|
|
|
17403
17488
|
- [Define custom step-by-step recipes for this project here]
|
|
17404
17489
|
`;
|
|
17405
17490
|
const filePath = path20.join(process.cwd(), "FluxFlow.md");
|
|
17406
|
-
if (
|
|
17491
|
+
if (fs22.pathExistsSync(filePath)) {
|
|
17407
17492
|
setMessages((prev) => {
|
|
17408
17493
|
setCompletedIndex(prev.length + 1);
|
|
17409
17494
|
return [...prev, { id: "init-err-" + Date.now(), role: "system", text: "ERROR: FluxFlow.md already exists in this directory.", isMeta: true }];
|
|
17410
17495
|
});
|
|
17411
17496
|
} else {
|
|
17412
17497
|
try {
|
|
17413
|
-
|
|
17498
|
+
fs22.writeFileSync(filePath, template);
|
|
17414
17499
|
setMessages((prev) => {
|
|
17415
17500
|
setCompletedIndex(prev.length + 1);
|
|
17416
17501
|
return [...prev, { id: "init-ok-" + Date.now(), role: "system", text: "[SUCCESS] FluxFlow.md has been initialized. You can now customize it for this project.", isMeta: true }];
|
|
@@ -17453,7 +17538,7 @@ ${list || "No saved chats found."}`, isMeta: true }];
|
|
|
17453
17538
|
setInput("");
|
|
17454
17539
|
const cleanCount = messages.filter((m) => (m.role === "user" || m.role === "agent" || m.role === "system") && !String(m.id).startsWith("welcome") && !m.isMeta).length;
|
|
17455
17540
|
const tokens = sessionStats?.tokens || 0;
|
|
17456
|
-
if (cleanCount <
|
|
17541
|
+
if (cleanCount < 64 || tokens < 32768) {
|
|
17457
17542
|
const s2 = emojiSpace(2);
|
|
17458
17543
|
setMessages((prev) => {
|
|
17459
17544
|
setCompletedIndex(prev.length + 1);
|
|
@@ -17904,6 +17989,7 @@ Selection: ${val}`,
|
|
|
17904
17989
|
continue;
|
|
17905
17990
|
}
|
|
17906
17991
|
if (packet.type === "visual_feedback") {
|
|
17992
|
+
await new Promise((resolve) => setTimeout(resolve, 150));
|
|
17907
17993
|
setMessages((prev) => {
|
|
17908
17994
|
const updatedPrev = prev.map((m) => m.isStreaming ? { ...m, isStreaming: false } : m);
|
|
17909
17995
|
const newMsgs = [...updatedPrev, {
|
|
@@ -19503,7 +19589,7 @@ var init_app = __esm({
|
|
|
19503
19589
|
linesAdded = 0;
|
|
19504
19590
|
linesRemoved = 0;
|
|
19505
19591
|
packageJsonPath = path20.join(path20.dirname(fileURLToPath(import.meta.url)), "../package.json");
|
|
19506
|
-
packageJson = JSON.parse(
|
|
19592
|
+
packageJson = JSON.parse(fs22.readFileSync(packageJsonPath, "utf8"));
|
|
19507
19593
|
versionFluxflow = packageJson.version;
|
|
19508
19594
|
updatedOn = packageJson.date || "2026-05-20";
|
|
19509
19595
|
ResolutionModal = ({ data, onResolve, onEdit }) => /* @__PURE__ */ React15.createElement(Box14, { flexDirection: "column", borderStyle: "round", borderColor: "grey", padding: 0, width: "100%" }, /* @__PURE__ */ React15.createElement(Box14, { paddingX: 1 }, /* @__PURE__ */ React15.createElement(Text15, { color: "white", bold: true, underline: true }, data.startsWith("/btw") ? "QUESTION" : "STEERING HINT", " RESOLUTION")), /* @__PURE__ */ React15.createElement(Box14, { paddingX: 1, marginTop: 1 }, /* @__PURE__ */ React15.createElement(Text15, null, "The agent already finished the task before your ", data.startsWith("/btw") ? "question" : "hint", " was consumed.")), /* @__PURE__ */ React15.createElement(Box14, { marginTop: 1, backgroundColor: "#222", paddingX: 2, width: "100%" }, /* @__PURE__ */ React15.createElement(Text15, { italic: true, color: "gray" }, '"', data.replace("/btw", "").trim(), '"')), /* @__PURE__ */ React15.createElement(Box14, { paddingX: 1, marginTop: 1 }, /* @__PURE__ */ React15.createElement(Text15, { color: "grey" }, "How would you like to proceed?")), /* @__PURE__ */ React15.createElement(Box14, { marginTop: 0 }, /* @__PURE__ */ React15.createElement(
|
|
@@ -19599,13 +19685,13 @@ var init_app = __esm({
|
|
|
19599
19685
|
const fileList = [];
|
|
19600
19686
|
const scan = (currentDir) => {
|
|
19601
19687
|
try {
|
|
19602
|
-
const files =
|
|
19688
|
+
const files = fs22.readdirSync(currentDir);
|
|
19603
19689
|
for (const file of files) {
|
|
19604
19690
|
if (["node_modules", ".git", ".gemini", "dist", "build", ".next", ".cache", "out"].includes(file)) {
|
|
19605
19691
|
continue;
|
|
19606
19692
|
}
|
|
19607
19693
|
const filePath = path20.join(currentDir, file);
|
|
19608
|
-
const stat =
|
|
19694
|
+
const stat = fs22.statSync(filePath);
|
|
19609
19695
|
if (stat.isDirectory()) {
|
|
19610
19696
|
scan(filePath);
|
|
19611
19697
|
} else {
|
|
@@ -19734,11 +19820,11 @@ if (isBundled && !process.execArgv.some((arg) => arg.includes("max-old-space-siz
|
|
|
19734
19820
|
const isVersion = args.includes("--version") || args.includes("-v");
|
|
19735
19821
|
const isUpdate = args[0] === "--update";
|
|
19736
19822
|
if (isVersion || isHelp || isHelpCommands || isUpdate) {
|
|
19737
|
-
const
|
|
19823
|
+
const fs23 = await import("fs");
|
|
19738
19824
|
const path21 = await import("path");
|
|
19739
19825
|
const { fileURLToPath: fileURLToPath3 } = await import("url");
|
|
19740
19826
|
const packageJsonPath2 = path21.join(path21.dirname(fileURLToPath3(import.meta.url)), "../package.json");
|
|
19741
|
-
const packageJson2 = JSON.parse(
|
|
19827
|
+
const packageJson2 = JSON.parse(fs23.readFileSync(packageJsonPath2, "utf8"));
|
|
19742
19828
|
const versionFluxflow2 = packageJson2.version;
|
|
19743
19829
|
if (isVersion) {
|
|
19744
19830
|
console.log(`v${versionFluxflow2}`);
|