fluxflow-cli 1.18.23 → 1.18.25
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 +125 -125
- package/package.json +1 -1
package/dist/fluxflow.js
CHANGED
|
@@ -4289,8 +4289,32 @@ var init_write_docx = __esm({
|
|
|
4289
4289
|
});
|
|
4290
4290
|
|
|
4291
4291
|
// src/tools/search_keyword.js
|
|
4292
|
-
import
|
|
4292
|
+
import fs14 from "fs/promises";
|
|
4293
4293
|
import path13 from "path";
|
|
4294
|
+
async function getFilesRecursively(dir, excludes, baseDir = dir, depth = 1) {
|
|
4295
|
+
if (depth > 12) return [];
|
|
4296
|
+
let results = [];
|
|
4297
|
+
let list;
|
|
4298
|
+
try {
|
|
4299
|
+
list = await fs14.readdir(dir, { withFileTypes: true });
|
|
4300
|
+
} catch {
|
|
4301
|
+
return [];
|
|
4302
|
+
}
|
|
4303
|
+
for (const file of list) {
|
|
4304
|
+
const fullPath = path13.join(dir, file.name);
|
|
4305
|
+
const relativePath = path13.relative(baseDir, fullPath);
|
|
4306
|
+
const pathSegments = relativePath.split(path13.sep).map((s) => s.toLowerCase());
|
|
4307
|
+
const isExcluded = excludes.some((ex) => pathSegments.includes(ex.toLowerCase()));
|
|
4308
|
+
if (isExcluded) continue;
|
|
4309
|
+
if (file.isDirectory()) {
|
|
4310
|
+
const nestedFiles = await getFilesRecursively(fullPath, excludes, baseDir, depth + 1);
|
|
4311
|
+
results = results.concat(nestedFiles);
|
|
4312
|
+
} else if (file.isFile()) {
|
|
4313
|
+
results.push({ fullPath, relativePath });
|
|
4314
|
+
}
|
|
4315
|
+
}
|
|
4316
|
+
return results;
|
|
4317
|
+
}
|
|
4294
4318
|
var search_keyword;
|
|
4295
4319
|
var init_search_keyword = __esm({
|
|
4296
4320
|
"src/tools/search_keyword.js"() {
|
|
@@ -4298,101 +4322,77 @@ var init_search_keyword = __esm({
|
|
|
4298
4322
|
search_keyword = async (args) => {
|
|
4299
4323
|
const { keyword, file } = parseArgs(args);
|
|
4300
4324
|
if (!keyword) return 'ERROR: Missing "keyword" argument.';
|
|
4301
|
-
const
|
|
4302
|
-
|
|
4303
|
-
|
|
4304
|
-
|
|
4305
|
-
|
|
4306
|
-
|
|
4307
|
-
|
|
4308
|
-
|
|
4309
|
-
|
|
4310
|
-
|
|
4311
|
-
|
|
4312
|
-
|
|
4313
|
-
|
|
4314
|
-
|
|
4325
|
+
const excludes = [
|
|
4326
|
+
"node_modules",
|
|
4327
|
+
".git",
|
|
4328
|
+
"dist",
|
|
4329
|
+
".next",
|
|
4330
|
+
".gemini",
|
|
4331
|
+
".exe",
|
|
4332
|
+
".dll",
|
|
4333
|
+
".png",
|
|
4334
|
+
".jpg",
|
|
4335
|
+
".jpeg",
|
|
4336
|
+
".gif",
|
|
4337
|
+
".zip",
|
|
4338
|
+
".tgz"
|
|
4339
|
+
];
|
|
4340
|
+
const maxMatches = 150;
|
|
4341
|
+
try {
|
|
4342
|
+
let filesToSearch = [];
|
|
4343
|
+
const rootDir = process.cwd();
|
|
4344
|
+
if (file) {
|
|
4345
|
+
const fullPath = path13.resolve(rootDir, file);
|
|
4346
|
+
try {
|
|
4347
|
+
const stat = await fs14.stat(fullPath);
|
|
4348
|
+
if (stat.isFile()) {
|
|
4349
|
+
filesToSearch.push({ fullPath, relativePath: path13.relative(rootDir, fullPath) });
|
|
4350
|
+
}
|
|
4351
|
+
} catch {
|
|
4352
|
+
return `ERROR: File not found: ${file}`;
|
|
4353
|
+
}
|
|
4315
4354
|
} else {
|
|
4316
|
-
|
|
4317
|
-
command = `grep -rnI ${excludeDirArgs} "${keyword}" . | head -n 150`;
|
|
4355
|
+
filesToSearch = await getFilesRecursively(rootDir, excludes);
|
|
4318
4356
|
}
|
|
4319
|
-
|
|
4320
|
-
|
|
4321
|
-
|
|
4322
|
-
|
|
4323
|
-
|
|
4324
|
-
|
|
4325
|
-
|
|
4326
|
-
|
|
4327
|
-
|
|
4328
|
-
|
|
4329
|
-
return resolve(`ERROR: ${stderr || error.message}`);
|
|
4330
|
-
}
|
|
4331
|
-
const rawLines = stdout.trim().split("\n").filter((l) => l.trim() !== "");
|
|
4332
|
-
if (rawLines.length === 0) return resolve(`Found 0 matches for keyword: "${keyword}"${file ? ` in file: ${file}` : ""}`);
|
|
4333
|
-
const matches = rawLines.slice(0, 150).map((line) => {
|
|
4334
|
-
let filePath, lineNum;
|
|
4335
|
-
if (line.includes("|")) {
|
|
4336
|
-
const parts = line.split("|");
|
|
4337
|
-
let rawPath = parts[0];
|
|
4338
|
-
if (path13.isAbsolute(rawPath)) {
|
|
4339
|
-
rawPath = path13.relative(process.cwd(), rawPath);
|
|
4340
|
-
}
|
|
4341
|
-
filePath = rawPath.replace(/^(\.\/|\.\\)/, "").replace(/\\/g, "/");
|
|
4342
|
-
lineNum = parts[1];
|
|
4343
|
-
} else {
|
|
4344
|
-
let rawPath;
|
|
4345
|
-
const driveMatch = line.match(/^([a-zA-Z]:)/);
|
|
4346
|
-
if (driveMatch) {
|
|
4347
|
-
const startSearch = 2;
|
|
4348
|
-
const nextColon = line.indexOf(":", startSearch);
|
|
4349
|
-
const thirdColon = line.indexOf(":", nextColon + 1);
|
|
4350
|
-
if (nextColon !== -1 && thirdColon !== -1) {
|
|
4351
|
-
rawPath = line.substring(0, nextColon);
|
|
4352
|
-
lineNum = line.substring(nextColon + 1, thirdColon);
|
|
4353
|
-
}
|
|
4354
|
-
} else {
|
|
4355
|
-
const firstColon = line.indexOf(":");
|
|
4356
|
-
const secondColon = line.indexOf(":", firstColon + 1);
|
|
4357
|
-
if (firstColon !== -1 && secondColon !== -1) {
|
|
4358
|
-
rawPath = line.substring(0, firstColon);
|
|
4359
|
-
lineNum = line.substring(firstColon + 1, secondColon);
|
|
4360
|
-
}
|
|
4361
|
-
}
|
|
4362
|
-
if (!rawPath || !lineNum) return null;
|
|
4363
|
-
if (path13.isAbsolute(rawPath)) {
|
|
4364
|
-
rawPath = path13.relative(process.cwd(), rawPath);
|
|
4357
|
+
const searchPromises = filesToSearch.map(async (fileObj) => {
|
|
4358
|
+
try {
|
|
4359
|
+
const content = await fs14.readFile(fileObj.fullPath, "utf-8");
|
|
4360
|
+
if (content.includes("\0")) return [];
|
|
4361
|
+
const lines = content.split(/\r?\n/);
|
|
4362
|
+
const fileMatches = [];
|
|
4363
|
+
for (let i = 0; i < lines.length; i++) {
|
|
4364
|
+
if (lines[i].includes(keyword)) {
|
|
4365
|
+
const displayPath = fileObj.relativePath.replace(/\\/g, "/");
|
|
4366
|
+
fileMatches.push(`${displayPath} \u2192 ${i + 1}`);
|
|
4365
4367
|
}
|
|
4366
|
-
|
|
4367
|
-
|
|
4368
|
-
|
|
4369
|
-
|
|
4370
|
-
const absoluteFilePath = path13.resolve(process.cwd(), filePath).toLowerCase().replace(/\\/g, "/");
|
|
4371
|
-
const pathSegments = absoluteFilePath.split("/");
|
|
4372
|
-
const currentFolderLower = currentFolder.toLowerCase();
|
|
4373
|
-
const folderIndex = pathSegments.lastIndexOf(currentFolderLower);
|
|
4374
|
-
const relativeSegments = folderIndex !== -1 ? pathSegments.slice(folderIndex + 1) : pathSegments;
|
|
4375
|
-
const isNoise = excludes.some((ex) => relativeSegments.includes(ex.toLowerCase()));
|
|
4376
|
-
if (isNoise) return null;
|
|
4377
|
-
return `${filePath} ${lineNum}`;
|
|
4378
|
-
}).filter(Boolean);
|
|
4379
|
-
if (matches.length === 0) return resolve(`Found 0 matches for keyword: "${keyword}"${file ? ` in file: ${file}` : ""}`);
|
|
4380
|
-
let output = `Found ${matches.length} matches:
|
|
4381
|
-
|
|
4382
|
-
`;
|
|
4383
|
-
output += matches.join("\n");
|
|
4384
|
-
if (matches.length >= 150) {
|
|
4385
|
-
output += "\n\n... (Truncated to first 150 matches)";
|
|
4368
|
+
}
|
|
4369
|
+
return fileMatches;
|
|
4370
|
+
} catch {
|
|
4371
|
+
return [];
|
|
4386
4372
|
}
|
|
4387
|
-
resolve(output);
|
|
4388
4373
|
});
|
|
4389
|
-
|
|
4374
|
+
const settledResults = await Promise.all(searchPromises);
|
|
4375
|
+
const matches = settledResults.flat().slice(0, maxMatches);
|
|
4376
|
+
if (typeof global.gc === "function") {
|
|
4377
|
+
global.gc();
|
|
4378
|
+
}
|
|
4379
|
+
if (matches.length === 0) {
|
|
4380
|
+
return `Found 0 matches for keyword: "${keyword}"${file ? ` in file: ${file}` : ". Try to specify files"}`;
|
|
4381
|
+
}
|
|
4382
|
+
let output = `Found ${matches.length} matches:
|
|
4383
|
+
|
|
4384
|
+
`;
|
|
4385
|
+
output += matches.join("\n");
|
|
4386
|
+
return output;
|
|
4387
|
+
} catch (error) {
|
|
4388
|
+
return `ERROR: ${error.message}`;
|
|
4389
|
+
}
|
|
4390
4390
|
};
|
|
4391
4391
|
}
|
|
4392
4392
|
});
|
|
4393
4393
|
|
|
4394
4394
|
// src/utils/settings.js
|
|
4395
|
-
import
|
|
4395
|
+
import fs15 from "fs-extra";
|
|
4396
4396
|
import path14 from "path";
|
|
4397
4397
|
var DEFAULT_SETTINGS, loadSettings, migrateToExternal, saveSettings;
|
|
4398
4398
|
var init_settings = __esm({
|
|
@@ -4435,7 +4435,7 @@ var init_settings = __esm({
|
|
|
4435
4435
|
loadSettings = async () => {
|
|
4436
4436
|
let settingsObj = { ...DEFAULT_SETTINGS };
|
|
4437
4437
|
try {
|
|
4438
|
-
if (await
|
|
4438
|
+
if (await fs15.exists(SETTINGS_FILE)) {
|
|
4439
4439
|
const saved = readAesEncryptedJson(SETTINGS_FILE);
|
|
4440
4440
|
if (saved.imageSettings && saved.imageSettings.apiKey) {
|
|
4441
4441
|
try {
|
|
@@ -4483,9 +4483,9 @@ var init_settings = __esm({
|
|
|
4483
4483
|
const src = path14.join(FLUXFLOW_DIR2, folder);
|
|
4484
4484
|
const dest = path14.join(newPath, folder);
|
|
4485
4485
|
try {
|
|
4486
|
-
if (await
|
|
4487
|
-
await
|
|
4488
|
-
await
|
|
4486
|
+
if (await fs15.exists(src)) {
|
|
4487
|
+
await fs15.ensureDir(dest);
|
|
4488
|
+
await fs15.copy(src, dest, { overwrite: true });
|
|
4489
4489
|
}
|
|
4490
4490
|
} catch (err) {
|
|
4491
4491
|
console.error(`Migration failed for ${folder}:`, err);
|
|
@@ -4511,7 +4511,7 @@ var init_settings = __esm({
|
|
|
4511
4511
|
if (updated.imageSettings) {
|
|
4512
4512
|
updated.imageSettings = { ...updated.imageSettings, apiKey: "" };
|
|
4513
4513
|
}
|
|
4514
|
-
await
|
|
4514
|
+
await fs15.ensureDir(path14.dirname(SETTINGS_FILE));
|
|
4515
4515
|
writeAesEncryptedJson(SETTINGS_FILE, updated);
|
|
4516
4516
|
return true;
|
|
4517
4517
|
} catch (err) {
|
|
@@ -4531,7 +4531,7 @@ var init_fallback_key = __esm({
|
|
|
4531
4531
|
});
|
|
4532
4532
|
|
|
4533
4533
|
// src/tools/generate_image.js
|
|
4534
|
-
import
|
|
4534
|
+
import fs16 from "fs-extra";
|
|
4535
4535
|
import path15 from "path";
|
|
4536
4536
|
var injectPngMetadata, generate_image;
|
|
4537
4537
|
var init_generate_image = __esm({
|
|
@@ -4713,9 +4713,9 @@ var init_generate_image = __esm({
|
|
|
4713
4713
|
};
|
|
4714
4714
|
finalBuffer = injectPngMetadata(finalBuffer, metadata);
|
|
4715
4715
|
const absolutePath = path15.resolve(process.cwd(), outputPath);
|
|
4716
|
-
await
|
|
4716
|
+
await fs16.ensureDir(path15.dirname(absolutePath));
|
|
4717
4717
|
await RevertManager.recordFileChange(absolutePath);
|
|
4718
|
-
await
|
|
4718
|
+
await fs16.writeFile(absolutePath, finalBuffer);
|
|
4719
4719
|
await recordImageGeneration(settings);
|
|
4720
4720
|
const ext = path15.extname(outputPath).toLowerCase();
|
|
4721
4721
|
const mimeMap = {
|
|
@@ -4908,7 +4908,7 @@ var init_tools = __esm({
|
|
|
4908
4908
|
// src/utils/ai.js
|
|
4909
4909
|
import { GoogleGenAI, ThinkingLevel, HarmBlockThreshold, HarmCategory } from "@google/genai";
|
|
4910
4910
|
import path16 from "path";
|
|
4911
|
-
import
|
|
4911
|
+
import fs17 from "fs";
|
|
4912
4912
|
var client, TERMINATION_SIGNAL, stripAnsi2, signalTermination, TOOL_LABELS2, getToolDetail, runJanitorTask, getActiveToolContext, getContextSafeText, contextSafeReplace, getSanitizedText, detectToolCalls, initAI, consolidatePastMemories, getAIStream;
|
|
4913
4913
|
var init_ai = __esm({
|
|
4914
4914
|
async "src/utils/ai.js"() {
|
|
@@ -5117,8 +5117,8 @@ ${originalTextProcessed.length > USER_CONTEXT_LENGTH ? "... (truncated) ...\n\n"
|
|
|
5117
5117
|
}
|
|
5118
5118
|
await new Promise((resolve) => setTimeout(resolve, 1e3));
|
|
5119
5119
|
const janitorErrDir = path16.join(LOGS_DIR, "janitor");
|
|
5120
|
-
if (!
|
|
5121
|
-
|
|
5120
|
+
if (!fs17.existsSync(janitorErrDir)) fs17.mkdirSync(janitorErrDir, { recursive: true });
|
|
5121
|
+
fs17.appendFileSync(path16.join(janitorErrDir, "error.log"), `ERROR [Attempt ${attempts}/${MAX_JANITOR_RETRIES + 1}] [${date}]: ${String(janitorErr)}
|
|
5122
5122
|
|
|
5123
5123
|
`);
|
|
5124
5124
|
if (attempts > MAX_JANITOR_RETRIES) break;
|
|
@@ -5128,7 +5128,7 @@ ${originalTextProcessed.length > USER_CONTEXT_LENGTH ? "... (truncated) ...\n\n"
|
|
|
5128
5128
|
}
|
|
5129
5129
|
if (attempts) {
|
|
5130
5130
|
const janitorErrDir = path16.join(LOGS_DIR, "janitor");
|
|
5131
|
-
|
|
5131
|
+
fs17.appendFileSync(path16.join(janitorErrDir, "error.log"), `-----------------------------------------------------------------------------
|
|
5132
5132
|
|
|
5133
5133
|
|
|
5134
5134
|
`);
|
|
@@ -5445,8 +5445,8 @@ ${newMemoryListStr}
|
|
|
5445
5445
|
}
|
|
5446
5446
|
} catch (err) {
|
|
5447
5447
|
const janitorLogDir = path16.join(LOGS_DIR, "janitor");
|
|
5448
|
-
if (!
|
|
5449
|
-
|
|
5448
|
+
if (!fs17.existsSync(janitorLogDir)) fs17.mkdirSync(janitorLogDir, { recursive: true });
|
|
5449
|
+
fs17.appendFileSync(
|
|
5450
5450
|
path16.join(janitorLogDir, "error.log"),
|
|
5451
5451
|
`[${(/* @__PURE__ */ new Date()).toLocaleString()}] Past memory batch consolidation error: ${err.message}
|
|
5452
5452
|
`
|
|
@@ -5638,7 +5638,7 @@ ${newMemoryListStr}
|
|
|
5638
5638
|
];
|
|
5639
5639
|
const safeReaddirWithTypes = (dir) => {
|
|
5640
5640
|
try {
|
|
5641
|
-
return
|
|
5641
|
+
return fs17.readdirSync(dir, { withFileTypes: true });
|
|
5642
5642
|
} catch (e) {
|
|
5643
5643
|
return [];
|
|
5644
5644
|
}
|
|
@@ -6109,8 +6109,8 @@ ${thinkingLevel != "Fast" ? "[SYSTEM] **STRICTLY FOLLOW THINKING POLICY AS CRITI
|
|
|
6109
6109
|
let actualEndLine = eLine;
|
|
6110
6110
|
try {
|
|
6111
6111
|
const absPath = path16.resolve(process.cwd(), targetPath2);
|
|
6112
|
-
if (
|
|
6113
|
-
const content =
|
|
6112
|
+
if (fs17.existsSync(absPath)) {
|
|
6113
|
+
const content = fs17.readFileSync(absPath, "utf8");
|
|
6114
6114
|
const lines = content.split("\n").length;
|
|
6115
6115
|
totalLines = lines;
|
|
6116
6116
|
actualEndLine = Math.min(eLine, lines);
|
|
@@ -6352,7 +6352,7 @@ ${boxBottom}` };
|
|
|
6352
6352
|
matchCount = parseInt(m[1]);
|
|
6353
6353
|
}
|
|
6354
6354
|
}
|
|
6355
|
-
const postLabel = `\u{1F50E} Searched: "${keyword}"${file ? `
|
|
6355
|
+
const postLabel = `\u{1F50E} Searched: "${keyword}" in ${file ? `"${file}"` : "./"} \u2192 ${matchCount} Match${matchCount === 1 ? "" : "es"}`;
|
|
6356
6356
|
const boxWidth = Math.min(postLabel.length + 4, 115);
|
|
6357
6357
|
const boxTop = `\u256D${"\u2500".repeat(boxWidth)}\u256E`;
|
|
6358
6358
|
const boxMid = `\u2502 ${postLabel.padEnd(boxWidth - 2).substring(0, boxWidth - 2)} \u2502`;
|
|
@@ -6455,8 +6455,8 @@ ${boxBottom}` };
|
|
|
6455
6455
|
const errLog = String(err);
|
|
6456
6456
|
const date = (/* @__PURE__ */ new Date()).toLocaleString();
|
|
6457
6457
|
const agentErrDir = path16.join(LOGS_DIR, "agent");
|
|
6458
|
-
if (!
|
|
6459
|
-
|
|
6458
|
+
if (!fs17.existsSync(agentErrDir)) fs17.mkdirSync(agentErrDir, { recursive: true });
|
|
6459
|
+
fs17.appendFileSync(path16.join(agentErrDir, "error.log"), `ERROR [${date}]: ${errLog}
|
|
6460
6460
|
|
|
6461
6461
|
----------------------------------------------------------------------
|
|
6462
6462
|
|
|
@@ -6999,17 +6999,17 @@ var init_RevertModal = __esm({
|
|
|
6999
6999
|
|
|
7000
7000
|
// src/utils/setup.js
|
|
7001
7001
|
import puppeteer4 from "puppeteer";
|
|
7002
|
-
import { exec
|
|
7002
|
+
import { exec } from "child_process";
|
|
7003
7003
|
import { promisify } from "util";
|
|
7004
|
-
import
|
|
7004
|
+
import fs18 from "fs";
|
|
7005
7005
|
var execAsync, checkPuppeteerReady, installPuppeteerBrowser;
|
|
7006
7006
|
var init_setup = __esm({
|
|
7007
7007
|
"src/utils/setup.js"() {
|
|
7008
|
-
execAsync = promisify(
|
|
7008
|
+
execAsync = promisify(exec);
|
|
7009
7009
|
checkPuppeteerReady = () => {
|
|
7010
7010
|
try {
|
|
7011
7011
|
const exePath = puppeteer4.executablePath();
|
|
7012
|
-
const exists = exePath &&
|
|
7012
|
+
const exists = exePath && fs18.existsSync(exePath);
|
|
7013
7013
|
if (exists) return true;
|
|
7014
7014
|
} catch (e) {
|
|
7015
7015
|
return false;
|
|
@@ -7042,9 +7042,9 @@ __export(app_exports, {
|
|
|
7042
7042
|
import os4 from "os";
|
|
7043
7043
|
import React13, { useState as useState10, useEffect as useEffect7, useRef as useRef3, useMemo as useMemo2 } from "react";
|
|
7044
7044
|
import { Box as Box13, Text as Text13, useInput as useInput7, useStdout } from "ink";
|
|
7045
|
-
import
|
|
7045
|
+
import fs19 from "fs-extra";
|
|
7046
7046
|
import path17 from "path";
|
|
7047
|
-
import { exec as
|
|
7047
|
+
import { exec as exec2 } from "child_process";
|
|
7048
7048
|
import { fileURLToPath } from "url";
|
|
7049
7049
|
import TextInput4 from "ink-text-input";
|
|
7050
7050
|
import gradient from "gradient-string";
|
|
@@ -7929,7 +7929,7 @@ ${hintText}`, color: "magenta" }];
|
|
|
7929
7929
|
isMeta: true
|
|
7930
7930
|
}];
|
|
7931
7931
|
});
|
|
7932
|
-
|
|
7932
|
+
exec2("start https://enter.pollinations.ai/#pollen");
|
|
7933
7933
|
} else {
|
|
7934
7934
|
try {
|
|
7935
7935
|
const stats = await getImageQuotaStats();
|
|
@@ -8184,7 +8184,7 @@ ${hintText}`, color: "magenta" }];
|
|
|
8184
8184
|
}
|
|
8185
8185
|
const fileContent = exportLines.join("\n");
|
|
8186
8186
|
try {
|
|
8187
|
-
|
|
8187
|
+
fs19.writeFileSync(exportPath, fileContent, "utf8");
|
|
8188
8188
|
setMessages((prev) => {
|
|
8189
8189
|
setCompletedIndex(prev.length + 1);
|
|
8190
8190
|
return [...prev, {
|
|
@@ -8231,12 +8231,12 @@ ${list || "No saved chats found."}`, isMeta: true }];
|
|
|
8231
8231
|
setCompletedIndex(prev.length + 1);
|
|
8232
8232
|
return [...prev, { id: Date.now(), role: "system", text: "\u2622\uFE0F [NUCLEAR] Initiating reset...", isMeta: true }];
|
|
8233
8233
|
});
|
|
8234
|
-
if (
|
|
8235
|
-
if (
|
|
8236
|
-
if (
|
|
8234
|
+
if (fs19.existsSync(LOGS_DIR)) fs19.removeSync(LOGS_DIR);
|
|
8235
|
+
if (fs19.existsSync(SECRET_DIR)) fs19.removeSync(SECRET_DIR);
|
|
8236
|
+
if (fs19.existsSync(SETTINGS_FILE)) fs19.removeSync(SETTINGS_FILE);
|
|
8237
8237
|
try {
|
|
8238
|
-
const items =
|
|
8239
|
-
if (items.length === 0)
|
|
8238
|
+
const items = fs19.readdirSync(FLUXFLOW_DIR);
|
|
8239
|
+
if (items.length === 0) fs19.removeSync(FLUXFLOW_DIR);
|
|
8240
8240
|
} catch (e) {
|
|
8241
8241
|
}
|
|
8242
8242
|
setTimeout(() => {
|
|
@@ -8267,7 +8267,7 @@ ${list || "No saved chats found."}`, isMeta: true }];
|
|
|
8267
8267
|
case "/changelog": {
|
|
8268
8268
|
const platform = process.platform;
|
|
8269
8269
|
const command = platform === "win32" ? "start" : platform === "darwin" ? "open" : "xdg-open";
|
|
8270
|
-
|
|
8270
|
+
exec2(`${command} ${CHANGELOG_URL}`);
|
|
8271
8271
|
setMessages((prev) => {
|
|
8272
8272
|
setCompletedIndex(prev.length + 1);
|
|
8273
8273
|
return [...prev, { id: Date.now(), role: "system", text: `\u{1F310} [BROWSER] Opening changelog: ${CHANGELOG_URL}`, isMeta: true }];
|
|
@@ -8294,14 +8294,14 @@ ${list || "No saved chats found."}`, isMeta: true }];
|
|
|
8294
8294
|
- [Define custom step-by-step recipes for this project here]
|
|
8295
8295
|
`;
|
|
8296
8296
|
const filePath = path17.join(process.cwd(), "FluxFlow.md");
|
|
8297
|
-
if (
|
|
8297
|
+
if (fs19.pathExistsSync(filePath)) {
|
|
8298
8298
|
setMessages((prev) => {
|
|
8299
8299
|
setCompletedIndex(prev.length + 1);
|
|
8300
8300
|
return [...prev, { id: "init-err-" + Date.now(), role: "system", text: "\u274C ERROR: FluxFlow.md already exists in this directory.", isMeta: true }];
|
|
8301
8301
|
});
|
|
8302
8302
|
} else {
|
|
8303
8303
|
try {
|
|
8304
|
-
|
|
8304
|
+
fs19.writeFileSync(filePath, template);
|
|
8305
8305
|
setMessages((prev) => {
|
|
8306
8306
|
setCompletedIndex(prev.length + 1);
|
|
8307
8307
|
return [...prev, { id: "init-ok-" + Date.now(), role: "system", text: "\u2705 [SUCCESS] FluxFlow.md has been initialized. You can now customize it for this project.", isMeta: true }];
|
|
@@ -9446,7 +9446,7 @@ var init_app = __esm({
|
|
|
9446
9446
|
linesAdded = 0;
|
|
9447
9447
|
linesRemoved = 0;
|
|
9448
9448
|
packageJsonPath = path17.join(path17.dirname(fileURLToPath(import.meta.url)), "../package.json");
|
|
9449
|
-
packageJson = JSON.parse(
|
|
9449
|
+
packageJson = JSON.parse(fs19.readFileSync(packageJsonPath, "utf8"));
|
|
9450
9450
|
versionFluxflow = packageJson.version;
|
|
9451
9451
|
updatedOn = packageJson.date || "2026-05-20";
|
|
9452
9452
|
SPINNER_FRAMES2 = ["\u280B", "\u2819", "\u2839", "\u2838", "\u283C", "\u2834", "\u2826", "\u2827", "\u2807", "\u280F"];
|
|
@@ -9561,13 +9561,13 @@ var init_app = __esm({
|
|
|
9561
9561
|
const fileList = [];
|
|
9562
9562
|
const scan = (currentDir) => {
|
|
9563
9563
|
try {
|
|
9564
|
-
const files =
|
|
9564
|
+
const files = fs19.readdirSync(currentDir);
|
|
9565
9565
|
for (const file of files) {
|
|
9566
9566
|
if (["node_modules", ".git", ".gemini", "dist", "build", ".next", ".cache", "out"].includes(file)) {
|
|
9567
9567
|
continue;
|
|
9568
9568
|
}
|
|
9569
9569
|
const filePath = path17.join(currentDir, file);
|
|
9570
|
-
const stat =
|
|
9570
|
+
const stat = fs19.statSync(filePath);
|
|
9571
9571
|
if (stat.isDirectory()) {
|
|
9572
9572
|
scan(filePath);
|
|
9573
9573
|
} else {
|