fluxflow-cli 1.18.22 → 1.18.24
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 +106 -119
- package/package.json +1 -1
package/dist/fluxflow.js
CHANGED
|
@@ -4289,8 +4289,27 @@ 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
|
+
const list = await fs14.readdir(dir, { withFileTypes: true });
|
|
4298
|
+
for (const file of list) {
|
|
4299
|
+
const fullPath = path13.join(dir, file.name);
|
|
4300
|
+
const relativePath = path13.relative(baseDir, fullPath);
|
|
4301
|
+
const pathSegments = relativePath.split(path13.sep).map((s) => s.toLowerCase());
|
|
4302
|
+
const isExcluded = excludes.some((ex) => pathSegments.includes(ex.toLowerCase()));
|
|
4303
|
+
if (isExcluded) continue;
|
|
4304
|
+
if (file.isDirectory()) {
|
|
4305
|
+
const nestedFiles = await getFilesRecursively(fullPath, excludes, baseDir, depth + 1);
|
|
4306
|
+
results = results.concat(nestedFiles);
|
|
4307
|
+
} else if (file.isFile()) {
|
|
4308
|
+
results.push({ fullPath, relativePath });
|
|
4309
|
+
}
|
|
4310
|
+
}
|
|
4311
|
+
return results;
|
|
4312
|
+
}
|
|
4294
4313
|
var search_keyword;
|
|
4295
4314
|
var init_search_keyword = __esm({
|
|
4296
4315
|
"src/tools/search_keyword.js"() {
|
|
@@ -4298,96 +4317,64 @@ var init_search_keyword = __esm({
|
|
|
4298
4317
|
search_keyword = async (args) => {
|
|
4299
4318
|
const { keyword, file } = parseArgs(args);
|
|
4300
4319
|
if (!keyword) return 'ERROR: Missing "keyword" argument.';
|
|
4301
|
-
const isWindows = process.platform === "win32";
|
|
4302
4320
|
const excludes = ["node_modules", ".git", "dist", ".next", ".gemini"];
|
|
4303
|
-
|
|
4304
|
-
|
|
4305
|
-
|
|
4306
|
-
|
|
4321
|
+
const maxMatches = 150;
|
|
4322
|
+
let matches = [];
|
|
4323
|
+
try {
|
|
4324
|
+
let filesToSearch = [];
|
|
4325
|
+
const rootDir = process.cwd();
|
|
4326
|
+
if (file) {
|
|
4327
|
+
const fullPath = path13.resolve(rootDir, file);
|
|
4328
|
+
try {
|
|
4329
|
+
const stat = await fs14.stat(fullPath);
|
|
4330
|
+
if (stat.isFile()) {
|
|
4331
|
+
filesToSearch.push({ fullPath, relativePath: path13.relative(rootDir, fullPath) });
|
|
4332
|
+
}
|
|
4333
|
+
} catch {
|
|
4334
|
+
return `ERROR: File not found: ${file}`;
|
|
4335
|
+
}
|
|
4307
4336
|
} else {
|
|
4308
|
-
|
|
4337
|
+
filesToSearch = await getFilesRecursively(rootDir, excludes);
|
|
4309
4338
|
}
|
|
4310
|
-
|
|
4311
|
-
|
|
4312
|
-
|
|
4313
|
-
|
|
4314
|
-
|
|
4315
|
-
|
|
4316
|
-
|
|
4339
|
+
for (const fileObj of filesToSearch) {
|
|
4340
|
+
if (matches.length >= maxMatches) break;
|
|
4341
|
+
let content = await fs14.readFile(fileObj.fullPath, "utf-8");
|
|
4342
|
+
if (content.includes("\0")) {
|
|
4343
|
+
content = null;
|
|
4344
|
+
continue;
|
|
4345
|
+
}
|
|
4346
|
+
const lines = content.split(/\r?\n/);
|
|
4347
|
+
content = null;
|
|
4348
|
+
for (let i = 0; i < lines.length; i++) {
|
|
4349
|
+
if (lines[i].includes(keyword)) {
|
|
4350
|
+
const displayPath = fileObj.relativePath.replace(/\\/g, "/");
|
|
4351
|
+
matches.push(`${displayPath} \u2192 ${i + 1}`);
|
|
4352
|
+
if (matches.length >= maxMatches) break;
|
|
4353
|
+
}
|
|
4354
|
+
}
|
|
4355
|
+
lines.length = 0;
|
|
4317
4356
|
}
|
|
4318
|
-
|
|
4319
|
-
|
|
4320
|
-
|
|
4321
|
-
|
|
4322
|
-
|
|
4323
|
-
}
|
|
4324
|
-
|
|
4325
|
-
|
|
4326
|
-
}
|
|
4327
|
-
if (error && !stdout) {
|
|
4328
|
-
return resolve(`ERROR: ${stderr || error.message}`);
|
|
4329
|
-
}
|
|
4330
|
-
const rawLines = stdout.trim().split("\n").filter((l) => l.trim() !== "");
|
|
4331
|
-
if (rawLines.length === 0) return resolve(`Found 0 matches for keyword: "${keyword}"${file ? ` in file: ${file}` : ""}`);
|
|
4332
|
-
const matches = rawLines.slice(0, 150).map((line) => {
|
|
4333
|
-
let filePath, lineNum;
|
|
4334
|
-
if (line.includes("|")) {
|
|
4335
|
-
const parts = line.split("|");
|
|
4336
|
-
let rawPath = parts[0];
|
|
4337
|
-
if (path13.isAbsolute(rawPath)) {
|
|
4338
|
-
rawPath = path13.relative(process.cwd(), rawPath);
|
|
4339
|
-
}
|
|
4340
|
-
filePath = rawPath.replace(/^(\.\/|\.\\)/, "").replace(/\\/g, "/");
|
|
4341
|
-
lineNum = parts[1];
|
|
4342
|
-
} else {
|
|
4343
|
-
let rawPath;
|
|
4344
|
-
const driveMatch = line.match(/^([a-zA-Z]:)/);
|
|
4345
|
-
if (driveMatch) {
|
|
4346
|
-
const startSearch = 2;
|
|
4347
|
-
const nextColon = line.indexOf(":", startSearch);
|
|
4348
|
-
const thirdColon = line.indexOf(":", nextColon + 1);
|
|
4349
|
-
if (nextColon !== -1 && thirdColon !== -1) {
|
|
4350
|
-
rawPath = line.substring(0, nextColon);
|
|
4351
|
-
lineNum = line.substring(nextColon + 1, thirdColon);
|
|
4352
|
-
}
|
|
4353
|
-
} else {
|
|
4354
|
-
const firstColon = line.indexOf(":");
|
|
4355
|
-
const secondColon = line.indexOf(":", firstColon + 1);
|
|
4356
|
-
if (firstColon !== -1 && secondColon !== -1) {
|
|
4357
|
-
rawPath = line.substring(0, firstColon);
|
|
4358
|
-
lineNum = line.substring(firstColon + 1, secondColon);
|
|
4359
|
-
}
|
|
4360
|
-
}
|
|
4361
|
-
if (!rawPath || !lineNum) return null;
|
|
4362
|
-
if (path13.isAbsolute(rawPath)) {
|
|
4363
|
-
rawPath = path13.relative(process.cwd(), rawPath);
|
|
4364
|
-
}
|
|
4365
|
-
filePath = rawPath.replace(/^(\.\/|\.\\)/, "").replace(/\\/g, "/");
|
|
4366
|
-
lineNum = lineNum;
|
|
4367
|
-
}
|
|
4368
|
-
if (!filePath || !lineNum) return null;
|
|
4369
|
-
const lowerPath = filePath.toLowerCase();
|
|
4370
|
-
const isNoise = excludes.some((ex) => lowerPath.split("/").includes(ex.toLowerCase()));
|
|
4371
|
-
if (isNoise) return null;
|
|
4372
|
-
return `${filePath} ${lineNum}`;
|
|
4373
|
-
}).filter(Boolean);
|
|
4374
|
-
if (matches.length === 0) return resolve(`Found 0 matches for keyword: "${keyword}"${file ? ` in file: ${file}` : ""}`);
|
|
4375
|
-
let output = `Found ${matches.length} matches:
|
|
4357
|
+
filesToSearch = null;
|
|
4358
|
+
if (typeof global.gc === "function") {
|
|
4359
|
+
global.gc();
|
|
4360
|
+
}
|
|
4361
|
+
if (matches.length === 0) {
|
|
4362
|
+
return `Found 0 matches for keyword: "${keyword}"${file ? ` in file: ${file}` : ""}`;
|
|
4363
|
+
}
|
|
4364
|
+
let output = `Found ${matches.length} matches:
|
|
4376
4365
|
|
|
4377
4366
|
`;
|
|
4378
|
-
|
|
4379
|
-
|
|
4380
|
-
|
|
4381
|
-
|
|
4382
|
-
|
|
4383
|
-
});
|
|
4384
|
-
});
|
|
4367
|
+
output += matches.join("\n");
|
|
4368
|
+
return output;
|
|
4369
|
+
} catch (error) {
|
|
4370
|
+
return `ERROR: ${error.message}`;
|
|
4371
|
+
}
|
|
4385
4372
|
};
|
|
4386
4373
|
}
|
|
4387
4374
|
});
|
|
4388
4375
|
|
|
4389
4376
|
// src/utils/settings.js
|
|
4390
|
-
import
|
|
4377
|
+
import fs15 from "fs-extra";
|
|
4391
4378
|
import path14 from "path";
|
|
4392
4379
|
var DEFAULT_SETTINGS, loadSettings, migrateToExternal, saveSettings;
|
|
4393
4380
|
var init_settings = __esm({
|
|
@@ -4430,7 +4417,7 @@ var init_settings = __esm({
|
|
|
4430
4417
|
loadSettings = async () => {
|
|
4431
4418
|
let settingsObj = { ...DEFAULT_SETTINGS };
|
|
4432
4419
|
try {
|
|
4433
|
-
if (await
|
|
4420
|
+
if (await fs15.exists(SETTINGS_FILE)) {
|
|
4434
4421
|
const saved = readAesEncryptedJson(SETTINGS_FILE);
|
|
4435
4422
|
if (saved.imageSettings && saved.imageSettings.apiKey) {
|
|
4436
4423
|
try {
|
|
@@ -4478,9 +4465,9 @@ var init_settings = __esm({
|
|
|
4478
4465
|
const src = path14.join(FLUXFLOW_DIR2, folder);
|
|
4479
4466
|
const dest = path14.join(newPath, folder);
|
|
4480
4467
|
try {
|
|
4481
|
-
if (await
|
|
4482
|
-
await
|
|
4483
|
-
await
|
|
4468
|
+
if (await fs15.exists(src)) {
|
|
4469
|
+
await fs15.ensureDir(dest);
|
|
4470
|
+
await fs15.copy(src, dest, { overwrite: true });
|
|
4484
4471
|
}
|
|
4485
4472
|
} catch (err) {
|
|
4486
4473
|
console.error(`Migration failed for ${folder}:`, err);
|
|
@@ -4506,7 +4493,7 @@ var init_settings = __esm({
|
|
|
4506
4493
|
if (updated.imageSettings) {
|
|
4507
4494
|
updated.imageSettings = { ...updated.imageSettings, apiKey: "" };
|
|
4508
4495
|
}
|
|
4509
|
-
await
|
|
4496
|
+
await fs15.ensureDir(path14.dirname(SETTINGS_FILE));
|
|
4510
4497
|
writeAesEncryptedJson(SETTINGS_FILE, updated);
|
|
4511
4498
|
return true;
|
|
4512
4499
|
} catch (err) {
|
|
@@ -4526,7 +4513,7 @@ var init_fallback_key = __esm({
|
|
|
4526
4513
|
});
|
|
4527
4514
|
|
|
4528
4515
|
// src/tools/generate_image.js
|
|
4529
|
-
import
|
|
4516
|
+
import fs16 from "fs-extra";
|
|
4530
4517
|
import path15 from "path";
|
|
4531
4518
|
var injectPngMetadata, generate_image;
|
|
4532
4519
|
var init_generate_image = __esm({
|
|
@@ -4708,9 +4695,9 @@ var init_generate_image = __esm({
|
|
|
4708
4695
|
};
|
|
4709
4696
|
finalBuffer = injectPngMetadata(finalBuffer, metadata);
|
|
4710
4697
|
const absolutePath = path15.resolve(process.cwd(), outputPath);
|
|
4711
|
-
await
|
|
4698
|
+
await fs16.ensureDir(path15.dirname(absolutePath));
|
|
4712
4699
|
await RevertManager.recordFileChange(absolutePath);
|
|
4713
|
-
await
|
|
4700
|
+
await fs16.writeFile(absolutePath, finalBuffer);
|
|
4714
4701
|
await recordImageGeneration(settings);
|
|
4715
4702
|
const ext = path15.extname(outputPath).toLowerCase();
|
|
4716
4703
|
const mimeMap = {
|
|
@@ -4903,7 +4890,7 @@ var init_tools = __esm({
|
|
|
4903
4890
|
// src/utils/ai.js
|
|
4904
4891
|
import { GoogleGenAI, ThinkingLevel, HarmBlockThreshold, HarmCategory } from "@google/genai";
|
|
4905
4892
|
import path16 from "path";
|
|
4906
|
-
import
|
|
4893
|
+
import fs17 from "fs";
|
|
4907
4894
|
var client, TERMINATION_SIGNAL, stripAnsi2, signalTermination, TOOL_LABELS2, getToolDetail, runJanitorTask, getActiveToolContext, getContextSafeText, contextSafeReplace, getSanitizedText, detectToolCalls, initAI, consolidatePastMemories, getAIStream;
|
|
4908
4895
|
var init_ai = __esm({
|
|
4909
4896
|
async "src/utils/ai.js"() {
|
|
@@ -5112,8 +5099,8 @@ ${originalTextProcessed.length > USER_CONTEXT_LENGTH ? "... (truncated) ...\n\n"
|
|
|
5112
5099
|
}
|
|
5113
5100
|
await new Promise((resolve) => setTimeout(resolve, 1e3));
|
|
5114
5101
|
const janitorErrDir = path16.join(LOGS_DIR, "janitor");
|
|
5115
|
-
if (!
|
|
5116
|
-
|
|
5102
|
+
if (!fs17.existsSync(janitorErrDir)) fs17.mkdirSync(janitorErrDir, { recursive: true });
|
|
5103
|
+
fs17.appendFileSync(path16.join(janitorErrDir, "error.log"), `ERROR [Attempt ${attempts}/${MAX_JANITOR_RETRIES + 1}] [${date}]: ${String(janitorErr)}
|
|
5117
5104
|
|
|
5118
5105
|
`);
|
|
5119
5106
|
if (attempts > MAX_JANITOR_RETRIES) break;
|
|
@@ -5123,7 +5110,7 @@ ${originalTextProcessed.length > USER_CONTEXT_LENGTH ? "... (truncated) ...\n\n"
|
|
|
5123
5110
|
}
|
|
5124
5111
|
if (attempts) {
|
|
5125
5112
|
const janitorErrDir = path16.join(LOGS_DIR, "janitor");
|
|
5126
|
-
|
|
5113
|
+
fs17.appendFileSync(path16.join(janitorErrDir, "error.log"), `-----------------------------------------------------------------------------
|
|
5127
5114
|
|
|
5128
5115
|
|
|
5129
5116
|
`);
|
|
@@ -5440,8 +5427,8 @@ ${newMemoryListStr}
|
|
|
5440
5427
|
}
|
|
5441
5428
|
} catch (err) {
|
|
5442
5429
|
const janitorLogDir = path16.join(LOGS_DIR, "janitor");
|
|
5443
|
-
if (!
|
|
5444
|
-
|
|
5430
|
+
if (!fs17.existsSync(janitorLogDir)) fs17.mkdirSync(janitorLogDir, { recursive: true });
|
|
5431
|
+
fs17.appendFileSync(
|
|
5445
5432
|
path16.join(janitorLogDir, "error.log"),
|
|
5446
5433
|
`[${(/* @__PURE__ */ new Date()).toLocaleString()}] Past memory batch consolidation error: ${err.message}
|
|
5447
5434
|
`
|
|
@@ -5633,7 +5620,7 @@ ${newMemoryListStr}
|
|
|
5633
5620
|
];
|
|
5634
5621
|
const safeReaddirWithTypes = (dir) => {
|
|
5635
5622
|
try {
|
|
5636
|
-
return
|
|
5623
|
+
return fs17.readdirSync(dir, { withFileTypes: true });
|
|
5637
5624
|
} catch (e) {
|
|
5638
5625
|
return [];
|
|
5639
5626
|
}
|
|
@@ -6104,8 +6091,8 @@ ${thinkingLevel != "Fast" ? "[SYSTEM] **STRICTLY FOLLOW THINKING POLICY AS CRITI
|
|
|
6104
6091
|
let actualEndLine = eLine;
|
|
6105
6092
|
try {
|
|
6106
6093
|
const absPath = path16.resolve(process.cwd(), targetPath2);
|
|
6107
|
-
if (
|
|
6108
|
-
const content =
|
|
6094
|
+
if (fs17.existsSync(absPath)) {
|
|
6095
|
+
const content = fs17.readFileSync(absPath, "utf8");
|
|
6109
6096
|
const lines = content.split("\n").length;
|
|
6110
6097
|
totalLines = lines;
|
|
6111
6098
|
actualEndLine = Math.min(eLine, lines);
|
|
@@ -6347,7 +6334,7 @@ ${boxBottom}` };
|
|
|
6347
6334
|
matchCount = parseInt(m[1]);
|
|
6348
6335
|
}
|
|
6349
6336
|
}
|
|
6350
|
-
const postLabel = `\u{1F50E} Searched: "${keyword}"${file ? `
|
|
6337
|
+
const postLabel = `\u{1F50E} Searched: "${keyword}" in ${file ? `"${file}"` : "./"} \u2192 ${matchCount} Match${matchCount === 1 ? "" : "es"}`;
|
|
6351
6338
|
const boxWidth = Math.min(postLabel.length + 4, 115);
|
|
6352
6339
|
const boxTop = `\u256D${"\u2500".repeat(boxWidth)}\u256E`;
|
|
6353
6340
|
const boxMid = `\u2502 ${postLabel.padEnd(boxWidth - 2).substring(0, boxWidth - 2)} \u2502`;
|
|
@@ -6450,8 +6437,8 @@ ${boxBottom}` };
|
|
|
6450
6437
|
const errLog = String(err);
|
|
6451
6438
|
const date = (/* @__PURE__ */ new Date()).toLocaleString();
|
|
6452
6439
|
const agentErrDir = path16.join(LOGS_DIR, "agent");
|
|
6453
|
-
if (!
|
|
6454
|
-
|
|
6440
|
+
if (!fs17.existsSync(agentErrDir)) fs17.mkdirSync(agentErrDir, { recursive: true });
|
|
6441
|
+
fs17.appendFileSync(path16.join(agentErrDir, "error.log"), `ERROR [${date}]: ${errLog}
|
|
6455
6442
|
|
|
6456
6443
|
----------------------------------------------------------------------
|
|
6457
6444
|
|
|
@@ -6994,17 +6981,17 @@ var init_RevertModal = __esm({
|
|
|
6994
6981
|
|
|
6995
6982
|
// src/utils/setup.js
|
|
6996
6983
|
import puppeteer4 from "puppeteer";
|
|
6997
|
-
import { exec
|
|
6984
|
+
import { exec } from "child_process";
|
|
6998
6985
|
import { promisify } from "util";
|
|
6999
|
-
import
|
|
6986
|
+
import fs18 from "fs";
|
|
7000
6987
|
var execAsync, checkPuppeteerReady, installPuppeteerBrowser;
|
|
7001
6988
|
var init_setup = __esm({
|
|
7002
6989
|
"src/utils/setup.js"() {
|
|
7003
|
-
execAsync = promisify(
|
|
6990
|
+
execAsync = promisify(exec);
|
|
7004
6991
|
checkPuppeteerReady = () => {
|
|
7005
6992
|
try {
|
|
7006
6993
|
const exePath = puppeteer4.executablePath();
|
|
7007
|
-
const exists = exePath &&
|
|
6994
|
+
const exists = exePath && fs18.existsSync(exePath);
|
|
7008
6995
|
if (exists) return true;
|
|
7009
6996
|
} catch (e) {
|
|
7010
6997
|
return false;
|
|
@@ -7037,9 +7024,9 @@ __export(app_exports, {
|
|
|
7037
7024
|
import os4 from "os";
|
|
7038
7025
|
import React13, { useState as useState10, useEffect as useEffect7, useRef as useRef3, useMemo as useMemo2 } from "react";
|
|
7039
7026
|
import { Box as Box13, Text as Text13, useInput as useInput7, useStdout } from "ink";
|
|
7040
|
-
import
|
|
7027
|
+
import fs19 from "fs-extra";
|
|
7041
7028
|
import path17 from "path";
|
|
7042
|
-
import { exec as
|
|
7029
|
+
import { exec as exec2 } from "child_process";
|
|
7043
7030
|
import { fileURLToPath } from "url";
|
|
7044
7031
|
import TextInput4 from "ink-text-input";
|
|
7045
7032
|
import gradient from "gradient-string";
|
|
@@ -7924,7 +7911,7 @@ ${hintText}`, color: "magenta" }];
|
|
|
7924
7911
|
isMeta: true
|
|
7925
7912
|
}];
|
|
7926
7913
|
});
|
|
7927
|
-
|
|
7914
|
+
exec2("start https://enter.pollinations.ai/#pollen");
|
|
7928
7915
|
} else {
|
|
7929
7916
|
try {
|
|
7930
7917
|
const stats = await getImageQuotaStats();
|
|
@@ -8179,7 +8166,7 @@ ${hintText}`, color: "magenta" }];
|
|
|
8179
8166
|
}
|
|
8180
8167
|
const fileContent = exportLines.join("\n");
|
|
8181
8168
|
try {
|
|
8182
|
-
|
|
8169
|
+
fs19.writeFileSync(exportPath, fileContent, "utf8");
|
|
8183
8170
|
setMessages((prev) => {
|
|
8184
8171
|
setCompletedIndex(prev.length + 1);
|
|
8185
8172
|
return [...prev, {
|
|
@@ -8226,12 +8213,12 @@ ${list || "No saved chats found."}`, isMeta: true }];
|
|
|
8226
8213
|
setCompletedIndex(prev.length + 1);
|
|
8227
8214
|
return [...prev, { id: Date.now(), role: "system", text: "\u2622\uFE0F [NUCLEAR] Initiating reset...", isMeta: true }];
|
|
8228
8215
|
});
|
|
8229
|
-
if (
|
|
8230
|
-
if (
|
|
8231
|
-
if (
|
|
8216
|
+
if (fs19.existsSync(LOGS_DIR)) fs19.removeSync(LOGS_DIR);
|
|
8217
|
+
if (fs19.existsSync(SECRET_DIR)) fs19.removeSync(SECRET_DIR);
|
|
8218
|
+
if (fs19.existsSync(SETTINGS_FILE)) fs19.removeSync(SETTINGS_FILE);
|
|
8232
8219
|
try {
|
|
8233
|
-
const items =
|
|
8234
|
-
if (items.length === 0)
|
|
8220
|
+
const items = fs19.readdirSync(FLUXFLOW_DIR);
|
|
8221
|
+
if (items.length === 0) fs19.removeSync(FLUXFLOW_DIR);
|
|
8235
8222
|
} catch (e) {
|
|
8236
8223
|
}
|
|
8237
8224
|
setTimeout(() => {
|
|
@@ -8262,7 +8249,7 @@ ${list || "No saved chats found."}`, isMeta: true }];
|
|
|
8262
8249
|
case "/changelog": {
|
|
8263
8250
|
const platform = process.platform;
|
|
8264
8251
|
const command = platform === "win32" ? "start" : platform === "darwin" ? "open" : "xdg-open";
|
|
8265
|
-
|
|
8252
|
+
exec2(`${command} ${CHANGELOG_URL}`);
|
|
8266
8253
|
setMessages((prev) => {
|
|
8267
8254
|
setCompletedIndex(prev.length + 1);
|
|
8268
8255
|
return [...prev, { id: Date.now(), role: "system", text: `\u{1F310} [BROWSER] Opening changelog: ${CHANGELOG_URL}`, isMeta: true }];
|
|
@@ -8289,14 +8276,14 @@ ${list || "No saved chats found."}`, isMeta: true }];
|
|
|
8289
8276
|
- [Define custom step-by-step recipes for this project here]
|
|
8290
8277
|
`;
|
|
8291
8278
|
const filePath = path17.join(process.cwd(), "FluxFlow.md");
|
|
8292
|
-
if (
|
|
8279
|
+
if (fs19.pathExistsSync(filePath)) {
|
|
8293
8280
|
setMessages((prev) => {
|
|
8294
8281
|
setCompletedIndex(prev.length + 1);
|
|
8295
8282
|
return [...prev, { id: "init-err-" + Date.now(), role: "system", text: "\u274C ERROR: FluxFlow.md already exists in this directory.", isMeta: true }];
|
|
8296
8283
|
});
|
|
8297
8284
|
} else {
|
|
8298
8285
|
try {
|
|
8299
|
-
|
|
8286
|
+
fs19.writeFileSync(filePath, template);
|
|
8300
8287
|
setMessages((prev) => {
|
|
8301
8288
|
setCompletedIndex(prev.length + 1);
|
|
8302
8289
|
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 }];
|
|
@@ -9441,7 +9428,7 @@ var init_app = __esm({
|
|
|
9441
9428
|
linesAdded = 0;
|
|
9442
9429
|
linesRemoved = 0;
|
|
9443
9430
|
packageJsonPath = path17.join(path17.dirname(fileURLToPath(import.meta.url)), "../package.json");
|
|
9444
|
-
packageJson = JSON.parse(
|
|
9431
|
+
packageJson = JSON.parse(fs19.readFileSync(packageJsonPath, "utf8"));
|
|
9445
9432
|
versionFluxflow = packageJson.version;
|
|
9446
9433
|
updatedOn = packageJson.date || "2026-05-20";
|
|
9447
9434
|
SPINNER_FRAMES2 = ["\u280B", "\u2819", "\u2839", "\u2838", "\u283C", "\u2834", "\u2826", "\u2827", "\u2807", "\u280F"];
|
|
@@ -9556,13 +9543,13 @@ var init_app = __esm({
|
|
|
9556
9543
|
const fileList = [];
|
|
9557
9544
|
const scan = (currentDir) => {
|
|
9558
9545
|
try {
|
|
9559
|
-
const files =
|
|
9546
|
+
const files = fs19.readdirSync(currentDir);
|
|
9560
9547
|
for (const file of files) {
|
|
9561
9548
|
if (["node_modules", ".git", ".gemini", "dist", "build", ".next", ".cache", "out"].includes(file)) {
|
|
9562
9549
|
continue;
|
|
9563
9550
|
}
|
|
9564
9551
|
const filePath = path17.join(currentDir, file);
|
|
9565
|
-
const stat =
|
|
9552
|
+
const stat = fs19.statSync(filePath);
|
|
9566
9553
|
if (stat.isDirectory()) {
|
|
9567
9554
|
scan(filePath);
|
|
9568
9555
|
} else {
|