fluxflow-cli 1.6.5 → 1.6.7
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 +92 -40
- package/package.json +1 -1
package/dist/fluxflow.js
CHANGED
|
@@ -178,9 +178,12 @@ var init_ChatLayout = __esm({
|
|
|
178
178
|
};
|
|
179
179
|
TableRenderer = React2.memo(({ buffer, terminalWidth = 80 }) => {
|
|
180
180
|
if (buffer.length < 2) return null;
|
|
181
|
-
const rows = buffer.map(
|
|
182
|
-
|
|
183
|
-
|
|
181
|
+
const rows = buffer.map((line) => {
|
|
182
|
+
const parts = line.split("|");
|
|
183
|
+
if (parts[0] !== void 0 && parts[0].trim() === "") parts.shift();
|
|
184
|
+
if (parts.length > 0 && parts[parts.length - 1].trim() === "") parts.pop();
|
|
185
|
+
return parts.map((cell) => cell.trim());
|
|
186
|
+
});
|
|
184
187
|
const header = rows[0];
|
|
185
188
|
const data = rows.slice(2);
|
|
186
189
|
const colPercentage = Math.floor(100 / header.length);
|
|
@@ -208,7 +211,7 @@ var init_ChatLayout = __esm({
|
|
|
208
211
|
};
|
|
209
212
|
lines.forEach((line, i) => {
|
|
210
213
|
const trimmed = line.trim();
|
|
211
|
-
const isTableRow = trimmed.startsWith("|")
|
|
214
|
+
const isTableRow = trimmed.startsWith("|");
|
|
212
215
|
const isQuote = trimmed.startsWith(">");
|
|
213
216
|
if (isTableRow) {
|
|
214
217
|
if (quoteBuffer.length > 0) flushBuffers(i);
|
|
@@ -257,7 +260,7 @@ var init_ChatLayout = __esm({
|
|
|
257
260
|
flushBuffers("final");
|
|
258
261
|
return /* @__PURE__ */ React2.createElement(Box2, { flexDirection: "column", width: columns - 2 }, result);
|
|
259
262
|
});
|
|
260
|
-
DiffLine = React2.memo(({ line }) => {
|
|
263
|
+
DiffLine = React2.memo(({ line, columns = 80 }) => {
|
|
261
264
|
const isContext = line.includes("[UI_CONTEXT]");
|
|
262
265
|
const cleanLine = line.replace("[UI_CONTEXT]", "");
|
|
263
266
|
const isRemoval = cleanLine.startsWith("-");
|
|
@@ -267,7 +270,7 @@ var init_ChatLayout = __esm({
|
|
|
267
270
|
const content = parts.slice(1).join("|");
|
|
268
271
|
const bgColor = isRemoval ? "#3a0c0c" : isAddition ? "#0c3a1a" : "#1a1a1a";
|
|
269
272
|
const textColor = isRemoval ? "#ff4d4d" : isAddition ? "#4dff88" : "white";
|
|
270
|
-
return /* @__PURE__ */ React2.createElement(Box2, { backgroundColor: bgColor, paddingX: 1, width: "100%" }, /* @__PURE__ */ React2.createElement(Box2, { width: 5, flexShrink: 0 }, /* @__PURE__ */ React2.createElement(Text2, { color: isRemoval ? "#cf3a3a" : isAddition ? "#3acf65" : "gray", dimColor: true }, lineNum)), /* @__PURE__ */ React2.createElement(Box2, { width: 2, flexShrink: 0, marginLeft: 1 }, /* @__PURE__ */ React2.createElement(Text2, { color: textColor, bold: true }, isRemoval ? "-" : isAddition ? "+" : " ")), /* @__PURE__ */ React2.createElement(Box2, { flexGrow: 1, marginLeft: 1 }, /* @__PURE__ */ React2.createElement(Text2, { color: textColor,
|
|
273
|
+
return /* @__PURE__ */ React2.createElement(Box2, { backgroundColor: bgColor, paddingX: 1, width: "100%" }, /* @__PURE__ */ React2.createElement(Box2, { width: 5, flexShrink: 0 }, /* @__PURE__ */ React2.createElement(Text2, { color: isRemoval ? "#cf3a3a" : isAddition ? "#3acf65" : "gray", dimColor: true }, lineNum)), /* @__PURE__ */ React2.createElement(Box2, { width: 2, flexShrink: 0, marginLeft: 1 }, /* @__PURE__ */ React2.createElement(Text2, { color: textColor, bold: true }, isRemoval ? "-" : isAddition ? "+" : " ")), /* @__PURE__ */ React2.createElement(Box2, { flexGrow: 1, marginLeft: 1 }, /* @__PURE__ */ React2.createElement(Text2, { color: textColor }, wrapText(content, columns - 10))));
|
|
271
274
|
});
|
|
272
275
|
DiffBlock = React2.memo(({ text, columns = 80 }) => {
|
|
273
276
|
const beforeDiff = text.substring(0, text.indexOf("[DIFF_START]")).trim();
|
|
@@ -275,7 +278,7 @@ var init_ChatLayout = __esm({
|
|
|
275
278
|
const match = text.match(/\[DIFF_START\]([\s\S]*?)\[DIFF_END\]/);
|
|
276
279
|
const diffBody = match ? match[1].trim() : "";
|
|
277
280
|
const diffLines = diffBody.split("\n");
|
|
278
|
-
return /* @__PURE__ */ React2.createElement(Box2, { flexDirection: "column", width: "100%" }, beforeDiff && /* @__PURE__ */ React2.createElement(MarkdownText, { text: beforeDiff, columns }), /* @__PURE__ */ React2.createElement(Box2, { flexDirection: "column", marginTop: 1, backgroundColor: "#1a1a1a", paddingY: 0, width: "100%" }, diffLines.map((line, i) => /* @__PURE__ */ React2.createElement(DiffLine, { key: i, line }))), afterDiff && /* @__PURE__ */ React2.createElement(MarkdownText, { text: afterDiff, columns }));
|
|
281
|
+
return /* @__PURE__ */ React2.createElement(Box2, { flexDirection: "column", width: "100%" }, beforeDiff && /* @__PURE__ */ React2.createElement(MarkdownText, { text: beforeDiff, columns }), /* @__PURE__ */ React2.createElement(Box2, { flexDirection: "column", marginTop: 1, backgroundColor: "#1a1a1a", paddingY: 0, width: "100%" }, diffLines.map((line, i) => /* @__PURE__ */ React2.createElement(DiffLine, { key: i, line, columns }))), afterDiff && /* @__PURE__ */ React2.createElement(MarkdownText, { text: afterDiff, columns }));
|
|
279
282
|
});
|
|
280
283
|
CodeRenderer = React2.memo(({ text, columns = 80 }) => {
|
|
281
284
|
if (!text) return null;
|
|
@@ -289,7 +292,7 @@ var init_ChatLayout = __esm({
|
|
|
289
292
|
const match = part.match(/```(\w*)\n([\s\S]*?)```/);
|
|
290
293
|
const lang = match ? match[1] : "code";
|
|
291
294
|
const code = match ? match[2] : part.slice(3, -3);
|
|
292
|
-
return /* @__PURE__ */ React2.createElement(Box2, { key: i, flexDirection: "column", marginY: 1, backgroundColor: "#111", borderStyle: "round", borderColor: "#333", paddingX: 1, width: "100%" }, /* @__PURE__ */ React2.createElement(Box2, { alignSelf: "flex-end", marginTop: -1, marginRight: 1 }, /* @__PURE__ */ React2.createElement(Text2, { backgroundColor: "#333", color: "white" }, " ", lang.toUpperCase(), " ")), /* @__PURE__ */ React2.createElement(Box2, { paddingY: 1, width: "100%" }, /* @__PURE__ */ React2.createElement(Text2, { color: "cyan"
|
|
295
|
+
return /* @__PURE__ */ React2.createElement(Box2, { key: i, flexDirection: "column", marginY: 1, backgroundColor: "#111", borderStyle: "round", borderColor: "#333", paddingX: 1, width: "100%" }, /* @__PURE__ */ React2.createElement(Box2, { alignSelf: "flex-end", marginTop: -1, marginRight: 1 }, /* @__PURE__ */ React2.createElement(Text2, { backgroundColor: "#333", color: "white" }, " ", lang.toUpperCase(), " ")), /* @__PURE__ */ React2.createElement(Box2, { paddingY: 1, width: "100%" }, /* @__PURE__ */ React2.createElement(Text2, { color: "cyan" }, wrapText(code.trim(), columns - 6))));
|
|
293
296
|
}
|
|
294
297
|
return /* @__PURE__ */ React2.createElement(MarkdownText, { key: i, text: part, columns });
|
|
295
298
|
}));
|
|
@@ -670,22 +673,23 @@ tool:functions.tool_name(arguments)
|
|
|
670
673
|
- WEB TOOLS (Available in Flux & Flow) -
|
|
671
674
|
1. Web Search: tool:functions.web_search(query="<query>", limit=number). Find info. limit is optional (3-10, default 10). If user asks about something that is not in your training data, proactively use this tool to find the information.Winder search recomemded (limit = 10) when exploring a topic.
|
|
672
675
|
2. Web Scrape: tool:functions.web_scrape(url="<url>"). provides detail from a URL.
|
|
673
|
-
3. Ask User: tool:functions.ask(question="...", optionA="Option::Desc", optionB="Option::Desc"). Generally use this tool for ANY ambiguity. Mandatory triggers include: 1) **Path Divergence**: When multiple architectural or technical solutions exist, present options via 'ask' instead of choosing arbitrarily. 2) **Security Boundaries**: Explicitly request permission via 'ask' before accessing sensitive files (e.g., .env, config keys, credentials). 3) **Ambiguity Resolution**: Use 'ask' to clarify vague prompts before executing terminal commands or writing code. 4) **Risk Mitigation**: Require a 'Yes/No' confirmation for any destructive or irreversible operations. Options must always follow the 'Short Label::Detailed Description' format. This tool is a non-terminating suspension so you can get guidance without losing context.
|
|
676
|
+
3. Ask User: tool:functions.ask(question="...", optionA="Option::Desc", optionB="Option::Desc"). Generally use this tool for ANY ambiguity. Mandatory triggers include: 1) **Path Divergence**: When multiple architectural or technical solutions exist, present options via 'ask' instead of choosing arbitrarily. 2) **Security Boundaries**: Explicitly request permission via 'ask' before accessing sensitive files (e.g., .env, config keys, credentials). 3) **Ambiguity Resolution**: Use 'ask' to clarify vague prompts before executing terminal commands or writing code. 4) **Risk Mitigation**: Require a 'Yes/No' confirmation for any destructive or irreversible operations. Options must always follow the 'Short Label::Detailed Description' format. This tool is a non-terminating suspension so you can get guidance without losing context. PREFER USING THIS TOOL RATHER THAN FINISHING THE LOOP FOR USER CLARIFICATION.
|
|
674
677
|
${mode === "Flux" ? `
|
|
675
678
|
- DEV & FILE TOOLS (Available in FLUX MODE ONLY) -
|
|
676
679
|
1. View File: tool:functions.view_file(path="relative/path", start_line=number, end_line=number). Reads file content. Auto-truncates at 500 lines unless start_line and end_line are provided. You can also use this tool to read images & documents.
|
|
677
680
|
2. List Files: tool:functions.list_files(path="relative/path"). Lists content of a directory.
|
|
678
681
|
3. Read Folder: tool:functions.read_folder(path="relative/path"). Detailed stats of a directory.
|
|
679
|
-
4. Write File: tool:functions.write_file(path="path", content="content"). Creates/Overwrites. NO CODE BLOCKS. RETURNS: Disk verification + original content (if overwritten) for 100% reversibility.
|
|
682
|
+
4. Write File: tool:functions.write_file(path="path", content="content"). Creates/Overwrites. NO CODE BLOCKS. RETURNS: Disk verification + original content (if overwritten) for 100% reversibility. Escape your double quotes '"' using backslash.
|
|
680
683
|
5. Update File: tool:functions.update_file(path="relative/path", content_to_replace="old", content_to_add="new"). Surgical patching. RETURNS: High-fidelity visual diff and old code block. You MUST verify that the change specifically matches your intent using the returned diff. PREFFER UPDATE FILE OVER WRITE FILE if file already exists for better reversal tracking (if a file has 500+ lines, try to stick with update_file over full-rewrite). DONT WRAP UPDATE FILE CALL CONTENT IN MARKDOWN CODE BLOCKS.
|
|
681
|
-
6. Write PDF: tool:functions.write_pdf(path="path", content="<html/css content>", orientation="portrait/landscape"). Generates a professional PDF document. Orientation are optional. A4 size page will be used, so any multi-page PDFs calculate your alightment and page breaks to not mess up A4 page layout. DO NOT ADD FOOTER MANUALLY, the system will handle it automatically. USE CSS TO VISUALLY BEAUTIFY THE DOCUMENT, USE full 100vh & 100vw for page area. ENSURE THE CONTENT IS NEVER BROKEN IN BETWEEN PAGES, USE PAGE BREAKS PROACTIVELY FOR A A4 PAGE LAYOUT.
|
|
682
|
-
7. Execution: tool:functions.exec_command(command="terminal command"). Runs a shell command.
|
|
684
|
+
6. Write PDF: tool:functions.write_pdf(path="path", content="<html/css content>", orientation="portrait/landscape"). Generates a professional PDF document. Orientation are optional. A4 size page will be used, so any multi-page PDFs calculate your alightment and page breaks to not mess up A4 page layout. DO NOT ADD FOOTER MANUALLY, the system will handle it automatically. USE CSS TO VISUALLY BEAUTIFY THE DOCUMENT, USE full 100vh & 100vw for page area. ENSURE THE CONTENT IS NEVER BROKEN IN BETWEEN PAGES, USE PAGE BREAKS PROACTIVELY FOR A A4 PAGE LAYOUT. Keep generous margins for better redability.
|
|
685
|
+
7. Execution: tool:functions.exec_command(command="terminal command"). Runs a shell command. Use ask tool to confirm before executing any destructive or irreversible operations.
|
|
683
686
|
|
|
684
687
|
AFTER GETTING THE TOOL RESULT, YOU MUST VERIFY THAT ITS A SUCCESS, IF IT GIVES A ERROR, TELL THE USER AND TRY TO FIX IF YOU CAN. DO NOT HALLUCINATE SUCCESS IF TOOL RETURNS ERROR.
|
|
685
688
|
|
|
686
689
|
**CRITICAL POLICY: WHEN WRITING/UPDATING FILES, USE ACTUAL NEW LINE CONTROL CHARACTER (LF) FOR LINE BREAKS RATHER THAN STRING '\\n'**`.trim() : `
|
|
687
690
|
- DEV & FILE TOOLS ARE NOT AVAILABLE IN FLOW MODE. If you need to access files, tell the user to switch to FLUX MODE (manually by user).`.trim()}
|
|
688
691
|
-----------------
|
|
692
|
+
|
|
689
693
|
Results will be provided in the next loop as: [TOOL_RESULT]: [content]
|
|
690
694
|
WHEN CALLING TOOLS, YOU **MUST** end your response with '[turn: continue]'. NEVER use '[turn: finish]' in the same turn as a tool call. After receiving the [TOOL_RESULT], acknowledge the output and verify if the goal is met; only then may you use '[turn: finish]', otherwise use '[turn: continue]'.
|
|
691
695
|
Do NOT over-use tools. Use them only when strictly necessary for the user's objective. You can stack multiple tool calls 1-by-1.
|
|
@@ -771,11 +775,11 @@ ${userMemories}
|
|
|
771
775
|
` : ""}${isMemoryEnabled ? `${tempMemoriesStr}
|
|
772
776
|
|
|
773
777
|
` : ""}--- START SYSTEM INSTRUCTION ---
|
|
774
|
-
You are Flux Flow (made by Kushal Roy Chowdhury/Flux Flow Team). A CLI Agent. Your tone will be friendly, warm, sassy, approchable, funny, NO ROMANTIC OR FLIRTY WORDS. Dont mention modes unless explicitly asked. ${mode === "Flux" ? "You are currently operating in FLUX (dev) mode. Keep your agentic approach goal oriented. Use provided tools when needed. And try to minimize number of agentic loops (Agent Loop is limited to 50 per turn, finish your goal by then). Analyze user prompt and project requirements, then plan your approach." : "You are currently operating in Flow (chat) mode. Focus more on conversation quality and user experience. Keep Agentic Loops to minimum (Agent Loop is limited to 7 per turn, finish your goal by then). You will get access to Web Tools only in this mode."}
|
|
778
|
+
You are Flux Flow (made by Kushal Roy Chowdhury/Flux Flow Team). A CLI Agent. Your tone will be friendly, warm, sassy, approchable, funny, NO ROMANTIC OR FLIRTY WORDS. Dont mention modes unless explicitly asked. ${mode === "Flux" ? "You are currently operating in FLUX (dev) mode. Keep your agentic approach goal oriented, conversation quality and user experience. Use provided tools when needed. And try to minimize number of agentic loops (Agent Loop is limited to 50 per turn, finish your goal by then). Analyze user prompt and project requirements, then plan your approach." : "You are currently operating in Flow (chat) mode. Focus more on conversation quality and user experience. Keep Agentic Loops to minimum (Agent Loop is limited to 7 per turn, finish your goal by then). You will get access to Web Tools only in this mode."}
|
|
775
779
|
CURRENT_WORKING_DIRECTORY: ${cwdStr}.
|
|
776
|
-
OS: ${osDetected}. ${osDetected && mode
|
|
780
|
+
OS: ${osDetected}. ${osDetected === "Windows" && mode === "Flux" ? "Your terminal commands will run on CMD. 'Prefer using PS scripts via CMD' instead of raw CMD commands." : ""}
|
|
777
781
|
${nameStr}${nicknameStr}${userInstrStr}
|
|
778
|
-
If you see a [STEERING HINT] from user, give that prompt priority, user can use it to help you guide if you go wrong way.
|
|
782
|
+
If you see a [STEERING HINT] from user, give that prompt priority for the task at hand, user can use it to help you guide if you go wrong way.
|
|
779
783
|
|
|
780
784
|
${thinkingConfig}
|
|
781
785
|
|
|
@@ -806,7 +810,7 @@ Every ${isMemoryEnabled ? "Prompt, Responses & Memories" : "Prompt & Responses"}
|
|
|
806
810
|
-- START FORMATTING RULES --
|
|
807
811
|
- Structure responses VISUALLY pleasing, easy to read, and beautiful.
|
|
808
812
|
- USE GFM Markdown HEAVILY.
|
|
809
|
-
- Use GFM tables for structured data to keep the terminal view organized. KEEP SENTENCES IN TABLE **SHORT & CONCISE**. AND MAX
|
|
813
|
+
- Use GFM tables for structured data to keep the terminal view organized. KEEP SENTENCES IN TABLE **SHORT & CONCISE**. AND MAX 4 COLUMNS. DO NOT OVERUSE TABLES.
|
|
810
814
|
- **CRITICAL**: NEVER USE LaTeX IN TERMINAL RESPONSES (exception: file content).
|
|
811
815
|
- Keep Poems & Literature in Code Block.
|
|
812
816
|
- Use emojis & Kaomojis. Prefer Kaomojis more.
|
|
@@ -1025,17 +1029,63 @@ var init_arg_parser = __esm({
|
|
|
1025
1029
|
"src/utils/arg_parser.js"() {
|
|
1026
1030
|
parseArgs = (argsString) => {
|
|
1027
1031
|
const args = {};
|
|
1028
|
-
|
|
1029
|
-
let
|
|
1030
|
-
while (
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1032
|
+
if (!argsString) return args;
|
|
1033
|
+
let i = 0;
|
|
1034
|
+
while (i < argsString.length) {
|
|
1035
|
+
while (i < argsString.length && /[\s,]/.test(argsString[i])) i++;
|
|
1036
|
+
if (i >= argsString.length) break;
|
|
1037
|
+
let keyMatch = argsString.substring(i).match(/^(\w+)\s*=\s*/);
|
|
1038
|
+
if (!keyMatch) {
|
|
1039
|
+
i++;
|
|
1040
|
+
continue;
|
|
1041
|
+
}
|
|
1042
|
+
const key = keyMatch[1];
|
|
1043
|
+
i += keyMatch[0].length;
|
|
1044
|
+
let value = "";
|
|
1045
|
+
if (i < argsString.length && (argsString[i] === '"' || argsString[i] === "'" || argsString[i] === "`")) {
|
|
1046
|
+
const quote = argsString[i];
|
|
1047
|
+
i++;
|
|
1048
|
+
let start = i;
|
|
1049
|
+
let end = -1;
|
|
1050
|
+
let searchIndex = i;
|
|
1051
|
+
while (searchIndex < argsString.length) {
|
|
1052
|
+
let qIdx = argsString.indexOf(quote, searchIndex);
|
|
1053
|
+
if (qIdx === -1) break;
|
|
1054
|
+
if (argsString[qIdx - 1] === "\\" && argsString[qIdx - 2] !== "\\") {
|
|
1055
|
+
searchIndex = qIdx + 1;
|
|
1056
|
+
continue;
|
|
1057
|
+
}
|
|
1058
|
+
const after = argsString.substring(qIdx + 1).trim();
|
|
1059
|
+
const isLogicalEnd = after === "" || // End of entire string
|
|
1060
|
+
after.startsWith(")") || // End of tool call
|
|
1061
|
+
after.startsWith(",") || // Next argument separator
|
|
1062
|
+
/^(\w+)\s*=/.test(after);
|
|
1063
|
+
if (isLogicalEnd) {
|
|
1064
|
+
end = qIdx;
|
|
1065
|
+
break;
|
|
1066
|
+
}
|
|
1067
|
+
searchIndex = qIdx + 1;
|
|
1068
|
+
}
|
|
1069
|
+
if (end !== -1) {
|
|
1070
|
+
value = argsString.substring(start, end);
|
|
1071
|
+
i = end + 1;
|
|
1072
|
+
} else {
|
|
1073
|
+
value = argsString.substring(start);
|
|
1074
|
+
i = argsString.length;
|
|
1075
|
+
}
|
|
1034
1076
|
try {
|
|
1035
|
-
|
|
1077
|
+
if (value.includes("\\")) {
|
|
1078
|
+
value = JSON.parse(`"${value.replace(/"/g, '\\"').replace(/\n/g, "\\n").replace(/\r/g, "\\r")}"`);
|
|
1079
|
+
}
|
|
1036
1080
|
} catch (e) {
|
|
1037
1081
|
value = value.replace(/\\"/g, '"').replace(/\\'/g, "'").replace(/\\`/g, "`").replace(/\\\\/g, "\\");
|
|
1038
1082
|
}
|
|
1083
|
+
} else {
|
|
1084
|
+
let endMatch = argsString.substring(i).match(/([^,\s\)]+)/);
|
|
1085
|
+
if (endMatch) {
|
|
1086
|
+
value = endMatch[1];
|
|
1087
|
+
i += value.length;
|
|
1088
|
+
}
|
|
1039
1089
|
}
|
|
1040
1090
|
if (value === "true") value = true;
|
|
1041
1091
|
else if (value === "false") value = false;
|
|
@@ -1077,8 +1127,8 @@ var init_web_search = __esm({
|
|
|
1077
1127
|
]
|
|
1078
1128
|
});
|
|
1079
1129
|
const page = await browser.newPage();
|
|
1080
|
-
await page.setUserAgent("Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/
|
|
1081
|
-
await page.setViewport({ width:
|
|
1130
|
+
await page.setUserAgent("Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/147.0.0.0 Safari/537.36");
|
|
1131
|
+
await page.setViewport({ width: 1366, height: 768 });
|
|
1082
1132
|
const jitter = attempt === 1 ? Math.random() * 1e3 + 500 : Math.random() * 2e3 + 1e3;
|
|
1083
1133
|
await new Promise((r) => setTimeout(r, jitter));
|
|
1084
1134
|
const searchUrl = `https://html.duckduckgo.com/html/?q=${encodeURIComponent(query)}`;
|
|
@@ -1161,8 +1211,8 @@ var init_web_scrape = __esm({
|
|
|
1161
1211
|
]
|
|
1162
1212
|
});
|
|
1163
1213
|
const page = await browser.newPage();
|
|
1164
|
-
await page.setUserAgent("Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/
|
|
1165
|
-
await page.setViewport({ width:
|
|
1214
|
+
await page.setUserAgent("Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/147.0.0.0 Safari/537.36");
|
|
1215
|
+
await page.setViewport({ width: 1366, height: 768 });
|
|
1166
1216
|
const jitter = attempt === 1 ? Math.random() * 1e3 + 500 : Math.random() * 2e3 + 1e3;
|
|
1167
1217
|
await new Promise((r) => setTimeout(r, jitter));
|
|
1168
1218
|
await page.goto(url, { waitUntil: "networkidle2", timeout: 45e3 });
|
|
@@ -1209,7 +1259,7 @@ var init_web_scrape = __esm({
|
|
|
1209
1259
|
if (!fs7.existsSync(toolLogDir)) fs7.mkdirSync(toolLogDir, { recursive: true });
|
|
1210
1260
|
fs7.appendFileSync(path7.join(toolLogDir, "search-scraped.log"), `PUPPETEER ${(/* @__PURE__ */ new Date()).toISOString()} - URL: [${url}]. Length: ${cleanedHtml.length}.
|
|
1211
1261
|
Content:
|
|
1212
|
-
${cleanedHtml}
|
|
1262
|
+
${cleanedHtml}${htmlContent.length > 3e4 ? "\n\n[TRUNCATED AT 30K CHARS]" : ""}
|
|
1213
1263
|
|
|
1214
1264
|
--------------------------------------------------------
|
|
1215
1265
|
|
|
@@ -1255,7 +1305,7 @@ var init_memory = __esm({
|
|
|
1255
1305
|
if (!content) return "ERROR: Missing 'content' for temp memory.";
|
|
1256
1306
|
const tempStorage = readEncryptedJson(TEMP_MEM_FILE, {});
|
|
1257
1307
|
if (!tempStorage[chatId]) tempStorage[chatId] = [];
|
|
1258
|
-
const MAX_CHARS =
|
|
1308
|
+
const MAX_CHARS = 4500 * 4;
|
|
1259
1309
|
let currentTotalLength = tempStorage[chatId].reduce((acc, m) => acc + m.length, 0);
|
|
1260
1310
|
while (tempStorage[chatId].length > 0 && currentTotalLength + content.length > MAX_CHARS) {
|
|
1261
1311
|
const removed = tempStorage[chatId].shift();
|
|
@@ -1269,7 +1319,7 @@ var init_memory = __esm({
|
|
|
1269
1319
|
const memories = readEncryptedJson(MEMORIES_FILE, []);
|
|
1270
1320
|
if (method === "add") {
|
|
1271
1321
|
if (!content) return "ERROR: Missing 'content' for memory addition.";
|
|
1272
|
-
const MAX_CHARS =
|
|
1322
|
+
const MAX_CHARS = 2500 * 4;
|
|
1273
1323
|
let currentTotalLength = memories.reduce((acc, m) => acc + (m.memory?.length || 0), 0);
|
|
1274
1324
|
while (memories.length > 0 && currentTotalLength + content.length > MAX_CHARS) {
|
|
1275
1325
|
const removed = memories.shift();
|
|
@@ -1498,14 +1548,14 @@ ${lines.map((l, i) => `${i + 1} | ${l}`).join("\n")}
|
|
|
1498
1548
|
return `CRITICAL FAILURE: Verification failed. File [${targetPath}] is empty on disk despite success report!`;
|
|
1499
1549
|
}
|
|
1500
1550
|
let snippet = "";
|
|
1501
|
-
if (verifiedLineCount <=
|
|
1551
|
+
if (verifiedLineCount <= 200) {
|
|
1502
1552
|
snippet = verifiedLines.join("\n");
|
|
1503
1553
|
} else {
|
|
1504
|
-
const head = verifiedLines.slice(0,
|
|
1505
|
-
const tail = verifiedLines.slice(-
|
|
1554
|
+
const head = verifiedLines.slice(0, 100).join("\n");
|
|
1555
|
+
const tail = verifiedLines.slice(-100).join("\n");
|
|
1506
1556
|
snippet = `${head}
|
|
1507
1557
|
|
|
1508
|
-
... [${verifiedLineCount -
|
|
1558
|
+
... [${verifiedLineCount - 200} lines truncated for history stability] ...
|
|
1509
1559
|
|
|
1510
1560
|
${tail}`;
|
|
1511
1561
|
}
|
|
@@ -1514,7 +1564,9 @@ ${tail}`;
|
|
|
1514
1564
|
|
|
1515
1565
|
- Stats: [${verifiedLineCount} lines, ${(verifiedSize / 1024).toFixed(1)} KB]
|
|
1516
1566
|
${ancestry}- Content Preview:
|
|
1517
|
-
${snippet}
|
|
1567
|
+
${snippet}
|
|
1568
|
+
|
|
1569
|
+
Check if Starting and Ending matches your write.`;
|
|
1518
1570
|
} catch (err) {
|
|
1519
1571
|
return `ERROR: Failed to write file [${targetPath}]: ${err.message}`;
|
|
1520
1572
|
}
|
|
@@ -1558,7 +1610,7 @@ var init_update_file = __esm({
|
|
|
1558
1610
|
return `ERROR: Could not find exact match for the specified "content_to_replace" in [${targetPath}].
|
|
1559
1611
|
- Disk Content Length (Normalized): ${diskLen}
|
|
1560
1612
|
- Match String Length (Normalized): ${matchLen}
|
|
1561
|
-
- Check indentation/whitespace
|
|
1613
|
+
- Check indentation/whitespace. Try re-reading the file for latest changes.`;
|
|
1562
1614
|
}
|
|
1563
1615
|
const startPos = currentContent.indexOf(content_to_replace);
|
|
1564
1616
|
const startLine = currentContent.substring(0, startPos).split(/\r?\n/).length;
|
|
@@ -1808,7 +1860,7 @@ var init_write_pdf = __esm({
|
|
|
1808
1860
|
path: targetPath,
|
|
1809
1861
|
content,
|
|
1810
1862
|
orientation = "portrait",
|
|
1811
|
-
margin = "
|
|
1863
|
+
margin = "0px"
|
|
1812
1864
|
} = parseArgs(args);
|
|
1813
1865
|
if (!targetPath) return 'ERROR: Missing "path" argument for write_pdf.';
|
|
1814
1866
|
if (!content) return 'ERROR: Missing "content" (HTML/CSS) for write_pdf.';
|
|
@@ -1873,7 +1925,7 @@ var init_write_pdf = __esm({
|
|
|
1873
1925
|
const fileName = path13.basename(targetPath);
|
|
1874
1926
|
pdfDoc.setTitle(`FluxFlow ${fileName}`);
|
|
1875
1927
|
pdfDoc.setAuthor("FluxFlow CLI");
|
|
1876
|
-
pdfDoc.setSubject("Generated with AI");
|
|
1928
|
+
pdfDoc.setSubject("Generated with Agentic AI System");
|
|
1877
1929
|
pdfDoc.setKeywords(["FluxFlow", "AI", "Agentic", "Automated"]);
|
|
1878
1930
|
pdfDoc.setCreator("FluxFlow PDF Engine");
|
|
1879
1931
|
pdfDoc.setProducer("FluxFlow (Generative AI)");
|
|
@@ -4297,8 +4349,8 @@ var init_app = __esm({
|
|
|
4297
4349
|
init_setup();
|
|
4298
4350
|
SESSION_START_TIME = Date.now();
|
|
4299
4351
|
CHANGELOG_URL = "https://fluxflow-cli.onrender.com/changelog.html";
|
|
4300
|
-
versionFluxflow = "1.6.
|
|
4301
|
-
updatedOn = "2026-05-
|
|
4352
|
+
versionFluxflow = "1.6.7";
|
|
4353
|
+
updatedOn = "2026-05-03";
|
|
4302
4354
|
ResolutionModal = ({ data, onResolve, onEdit }) => /* @__PURE__ */ React10.createElement(Box10, { flexDirection: "column", borderStyle: "round", borderColor: "magenta", paddingX: 2, paddingY: 1, width: "100%" }, /* @__PURE__ */ React10.createElement(Text10, { color: "magenta", bold: true, underline: true }, "\u{1F7E3} STEERING HINT RESOLUTION"), /* @__PURE__ */ React10.createElement(Text10, { marginTop: 1 }, "The agent already finished the task (turn: finish) before your hint was consumed."), /* @__PURE__ */ React10.createElement(Box10, { marginTop: 1, backgroundColor: "#222", paddingX: 1, width: "100%" }, /* @__PURE__ */ React10.createElement(Text10, { italic: true, color: "gray" }, '"', data, '"')), /* @__PURE__ */ React10.createElement(Box10, { marginTop: 1 }, /* @__PURE__ */ React10.createElement(Text10, { color: "cyan" }, "How would you like to proceed?")), /* @__PURE__ */ React10.createElement(Box10, { marginTop: 1 }, /* @__PURE__ */ React10.createElement(
|
|
4303
4355
|
CommandMenu,
|
|
4304
4356
|
{
|