fluxflow-cli 1.18.23 → 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 -124
- 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,101 +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
|
-
const
|
|
4304
|
-
let
|
|
4305
|
-
|
|
4306
|
-
|
|
4307
|
-
|
|
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
|
+
}
|
|
4308
4336
|
} else {
|
|
4309
|
-
|
|
4337
|
+
filesToSearch = await getFilesRecursively(rootDir, excludes);
|
|
4310
4338
|
}
|
|
4311
|
-
|
|
4312
|
-
|
|
4313
|
-
|
|
4314
|
-
|
|
4315
|
-
|
|
4316
|
-
|
|
4317
|
-
|
|
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;
|
|
4318
4356
|
}
|
|
4319
|
-
|
|
4320
|
-
|
|
4321
|
-
|
|
4322
|
-
|
|
4323
|
-
|
|
4324
|
-
}
|
|
4325
|
-
|
|
4326
|
-
|
|
4327
|
-
}
|
|
4328
|
-
if (error && !stdout) {
|
|
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);
|
|
4365
|
-
}
|
|
4366
|
-
filePath = rawPath.replace(/^(\.\/|\.\\)/, "").replace(/\\/g, "/");
|
|
4367
|
-
lineNum = lineNum;
|
|
4368
|
-
}
|
|
4369
|
-
if (!filePath || !lineNum) return null;
|
|
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:
|
|
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:
|
|
4381
4365
|
|
|
4382
4366
|
`;
|
|
4383
|
-
|
|
4384
|
-
|
|
4385
|
-
|
|
4386
|
-
|
|
4387
|
-
|
|
4388
|
-
});
|
|
4389
|
-
});
|
|
4367
|
+
output += matches.join("\n");
|
|
4368
|
+
return output;
|
|
4369
|
+
} catch (error) {
|
|
4370
|
+
return `ERROR: ${error.message}`;
|
|
4371
|
+
}
|
|
4390
4372
|
};
|
|
4391
4373
|
}
|
|
4392
4374
|
});
|
|
4393
4375
|
|
|
4394
4376
|
// src/utils/settings.js
|
|
4395
|
-
import
|
|
4377
|
+
import fs15 from "fs-extra";
|
|
4396
4378
|
import path14 from "path";
|
|
4397
4379
|
var DEFAULT_SETTINGS, loadSettings, migrateToExternal, saveSettings;
|
|
4398
4380
|
var init_settings = __esm({
|
|
@@ -4435,7 +4417,7 @@ var init_settings = __esm({
|
|
|
4435
4417
|
loadSettings = async () => {
|
|
4436
4418
|
let settingsObj = { ...DEFAULT_SETTINGS };
|
|
4437
4419
|
try {
|
|
4438
|
-
if (await
|
|
4420
|
+
if (await fs15.exists(SETTINGS_FILE)) {
|
|
4439
4421
|
const saved = readAesEncryptedJson(SETTINGS_FILE);
|
|
4440
4422
|
if (saved.imageSettings && saved.imageSettings.apiKey) {
|
|
4441
4423
|
try {
|
|
@@ -4483,9 +4465,9 @@ var init_settings = __esm({
|
|
|
4483
4465
|
const src = path14.join(FLUXFLOW_DIR2, folder);
|
|
4484
4466
|
const dest = path14.join(newPath, folder);
|
|
4485
4467
|
try {
|
|
4486
|
-
if (await
|
|
4487
|
-
await
|
|
4488
|
-
await
|
|
4468
|
+
if (await fs15.exists(src)) {
|
|
4469
|
+
await fs15.ensureDir(dest);
|
|
4470
|
+
await fs15.copy(src, dest, { overwrite: true });
|
|
4489
4471
|
}
|
|
4490
4472
|
} catch (err) {
|
|
4491
4473
|
console.error(`Migration failed for ${folder}:`, err);
|
|
@@ -4511,7 +4493,7 @@ var init_settings = __esm({
|
|
|
4511
4493
|
if (updated.imageSettings) {
|
|
4512
4494
|
updated.imageSettings = { ...updated.imageSettings, apiKey: "" };
|
|
4513
4495
|
}
|
|
4514
|
-
await
|
|
4496
|
+
await fs15.ensureDir(path14.dirname(SETTINGS_FILE));
|
|
4515
4497
|
writeAesEncryptedJson(SETTINGS_FILE, updated);
|
|
4516
4498
|
return true;
|
|
4517
4499
|
} catch (err) {
|
|
@@ -4531,7 +4513,7 @@ var init_fallback_key = __esm({
|
|
|
4531
4513
|
});
|
|
4532
4514
|
|
|
4533
4515
|
// src/tools/generate_image.js
|
|
4534
|
-
import
|
|
4516
|
+
import fs16 from "fs-extra";
|
|
4535
4517
|
import path15 from "path";
|
|
4536
4518
|
var injectPngMetadata, generate_image;
|
|
4537
4519
|
var init_generate_image = __esm({
|
|
@@ -4713,9 +4695,9 @@ var init_generate_image = __esm({
|
|
|
4713
4695
|
};
|
|
4714
4696
|
finalBuffer = injectPngMetadata(finalBuffer, metadata);
|
|
4715
4697
|
const absolutePath = path15.resolve(process.cwd(), outputPath);
|
|
4716
|
-
await
|
|
4698
|
+
await fs16.ensureDir(path15.dirname(absolutePath));
|
|
4717
4699
|
await RevertManager.recordFileChange(absolutePath);
|
|
4718
|
-
await
|
|
4700
|
+
await fs16.writeFile(absolutePath, finalBuffer);
|
|
4719
4701
|
await recordImageGeneration(settings);
|
|
4720
4702
|
const ext = path15.extname(outputPath).toLowerCase();
|
|
4721
4703
|
const mimeMap = {
|
|
@@ -4908,7 +4890,7 @@ var init_tools = __esm({
|
|
|
4908
4890
|
// src/utils/ai.js
|
|
4909
4891
|
import { GoogleGenAI, ThinkingLevel, HarmBlockThreshold, HarmCategory } from "@google/genai";
|
|
4910
4892
|
import path16 from "path";
|
|
4911
|
-
import
|
|
4893
|
+
import fs17 from "fs";
|
|
4912
4894
|
var client, TERMINATION_SIGNAL, stripAnsi2, signalTermination, TOOL_LABELS2, getToolDetail, runJanitorTask, getActiveToolContext, getContextSafeText, contextSafeReplace, getSanitizedText, detectToolCalls, initAI, consolidatePastMemories, getAIStream;
|
|
4913
4895
|
var init_ai = __esm({
|
|
4914
4896
|
async "src/utils/ai.js"() {
|
|
@@ -5117,8 +5099,8 @@ ${originalTextProcessed.length > USER_CONTEXT_LENGTH ? "... (truncated) ...\n\n"
|
|
|
5117
5099
|
}
|
|
5118
5100
|
await new Promise((resolve) => setTimeout(resolve, 1e3));
|
|
5119
5101
|
const janitorErrDir = path16.join(LOGS_DIR, "janitor");
|
|
5120
|
-
if (!
|
|
5121
|
-
|
|
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)}
|
|
5122
5104
|
|
|
5123
5105
|
`);
|
|
5124
5106
|
if (attempts > MAX_JANITOR_RETRIES) break;
|
|
@@ -5128,7 +5110,7 @@ ${originalTextProcessed.length > USER_CONTEXT_LENGTH ? "... (truncated) ...\n\n"
|
|
|
5128
5110
|
}
|
|
5129
5111
|
if (attempts) {
|
|
5130
5112
|
const janitorErrDir = path16.join(LOGS_DIR, "janitor");
|
|
5131
|
-
|
|
5113
|
+
fs17.appendFileSync(path16.join(janitorErrDir, "error.log"), `-----------------------------------------------------------------------------
|
|
5132
5114
|
|
|
5133
5115
|
|
|
5134
5116
|
`);
|
|
@@ -5445,8 +5427,8 @@ ${newMemoryListStr}
|
|
|
5445
5427
|
}
|
|
5446
5428
|
} catch (err) {
|
|
5447
5429
|
const janitorLogDir = path16.join(LOGS_DIR, "janitor");
|
|
5448
|
-
if (!
|
|
5449
|
-
|
|
5430
|
+
if (!fs17.existsSync(janitorLogDir)) fs17.mkdirSync(janitorLogDir, { recursive: true });
|
|
5431
|
+
fs17.appendFileSync(
|
|
5450
5432
|
path16.join(janitorLogDir, "error.log"),
|
|
5451
5433
|
`[${(/* @__PURE__ */ new Date()).toLocaleString()}] Past memory batch consolidation error: ${err.message}
|
|
5452
5434
|
`
|
|
@@ -5638,7 +5620,7 @@ ${newMemoryListStr}
|
|
|
5638
5620
|
];
|
|
5639
5621
|
const safeReaddirWithTypes = (dir) => {
|
|
5640
5622
|
try {
|
|
5641
|
-
return
|
|
5623
|
+
return fs17.readdirSync(dir, { withFileTypes: true });
|
|
5642
5624
|
} catch (e) {
|
|
5643
5625
|
return [];
|
|
5644
5626
|
}
|
|
@@ -6109,8 +6091,8 @@ ${thinkingLevel != "Fast" ? "[SYSTEM] **STRICTLY FOLLOW THINKING POLICY AS CRITI
|
|
|
6109
6091
|
let actualEndLine = eLine;
|
|
6110
6092
|
try {
|
|
6111
6093
|
const absPath = path16.resolve(process.cwd(), targetPath2);
|
|
6112
|
-
if (
|
|
6113
|
-
const content =
|
|
6094
|
+
if (fs17.existsSync(absPath)) {
|
|
6095
|
+
const content = fs17.readFileSync(absPath, "utf8");
|
|
6114
6096
|
const lines = content.split("\n").length;
|
|
6115
6097
|
totalLines = lines;
|
|
6116
6098
|
actualEndLine = Math.min(eLine, lines);
|
|
@@ -6352,7 +6334,7 @@ ${boxBottom}` };
|
|
|
6352
6334
|
matchCount = parseInt(m[1]);
|
|
6353
6335
|
}
|
|
6354
6336
|
}
|
|
6355
|
-
const postLabel = `\u{1F50E} Searched: "${keyword}"${file ? `
|
|
6337
|
+
const postLabel = `\u{1F50E} Searched: "${keyword}" in ${file ? `"${file}"` : "./"} \u2192 ${matchCount} Match${matchCount === 1 ? "" : "es"}`;
|
|
6356
6338
|
const boxWidth = Math.min(postLabel.length + 4, 115);
|
|
6357
6339
|
const boxTop = `\u256D${"\u2500".repeat(boxWidth)}\u256E`;
|
|
6358
6340
|
const boxMid = `\u2502 ${postLabel.padEnd(boxWidth - 2).substring(0, boxWidth - 2)} \u2502`;
|
|
@@ -6455,8 +6437,8 @@ ${boxBottom}` };
|
|
|
6455
6437
|
const errLog = String(err);
|
|
6456
6438
|
const date = (/* @__PURE__ */ new Date()).toLocaleString();
|
|
6457
6439
|
const agentErrDir = path16.join(LOGS_DIR, "agent");
|
|
6458
|
-
if (!
|
|
6459
|
-
|
|
6440
|
+
if (!fs17.existsSync(agentErrDir)) fs17.mkdirSync(agentErrDir, { recursive: true });
|
|
6441
|
+
fs17.appendFileSync(path16.join(agentErrDir, "error.log"), `ERROR [${date}]: ${errLog}
|
|
6460
6442
|
|
|
6461
6443
|
----------------------------------------------------------------------
|
|
6462
6444
|
|
|
@@ -6999,17 +6981,17 @@ var init_RevertModal = __esm({
|
|
|
6999
6981
|
|
|
7000
6982
|
// src/utils/setup.js
|
|
7001
6983
|
import puppeteer4 from "puppeteer";
|
|
7002
|
-
import { exec
|
|
6984
|
+
import { exec } from "child_process";
|
|
7003
6985
|
import { promisify } from "util";
|
|
7004
|
-
import
|
|
6986
|
+
import fs18 from "fs";
|
|
7005
6987
|
var execAsync, checkPuppeteerReady, installPuppeteerBrowser;
|
|
7006
6988
|
var init_setup = __esm({
|
|
7007
6989
|
"src/utils/setup.js"() {
|
|
7008
|
-
execAsync = promisify(
|
|
6990
|
+
execAsync = promisify(exec);
|
|
7009
6991
|
checkPuppeteerReady = () => {
|
|
7010
6992
|
try {
|
|
7011
6993
|
const exePath = puppeteer4.executablePath();
|
|
7012
|
-
const exists = exePath &&
|
|
6994
|
+
const exists = exePath && fs18.existsSync(exePath);
|
|
7013
6995
|
if (exists) return true;
|
|
7014
6996
|
} catch (e) {
|
|
7015
6997
|
return false;
|
|
@@ -7042,9 +7024,9 @@ __export(app_exports, {
|
|
|
7042
7024
|
import os4 from "os";
|
|
7043
7025
|
import React13, { useState as useState10, useEffect as useEffect7, useRef as useRef3, useMemo as useMemo2 } from "react";
|
|
7044
7026
|
import { Box as Box13, Text as Text13, useInput as useInput7, useStdout } from "ink";
|
|
7045
|
-
import
|
|
7027
|
+
import fs19 from "fs-extra";
|
|
7046
7028
|
import path17 from "path";
|
|
7047
|
-
import { exec as
|
|
7029
|
+
import { exec as exec2 } from "child_process";
|
|
7048
7030
|
import { fileURLToPath } from "url";
|
|
7049
7031
|
import TextInput4 from "ink-text-input";
|
|
7050
7032
|
import gradient from "gradient-string";
|
|
@@ -7929,7 +7911,7 @@ ${hintText}`, color: "magenta" }];
|
|
|
7929
7911
|
isMeta: true
|
|
7930
7912
|
}];
|
|
7931
7913
|
});
|
|
7932
|
-
|
|
7914
|
+
exec2("start https://enter.pollinations.ai/#pollen");
|
|
7933
7915
|
} else {
|
|
7934
7916
|
try {
|
|
7935
7917
|
const stats = await getImageQuotaStats();
|
|
@@ -8184,7 +8166,7 @@ ${hintText}`, color: "magenta" }];
|
|
|
8184
8166
|
}
|
|
8185
8167
|
const fileContent = exportLines.join("\n");
|
|
8186
8168
|
try {
|
|
8187
|
-
|
|
8169
|
+
fs19.writeFileSync(exportPath, fileContent, "utf8");
|
|
8188
8170
|
setMessages((prev) => {
|
|
8189
8171
|
setCompletedIndex(prev.length + 1);
|
|
8190
8172
|
return [...prev, {
|
|
@@ -8231,12 +8213,12 @@ ${list || "No saved chats found."}`, isMeta: true }];
|
|
|
8231
8213
|
setCompletedIndex(prev.length + 1);
|
|
8232
8214
|
return [...prev, { id: Date.now(), role: "system", text: "\u2622\uFE0F [NUCLEAR] Initiating reset...", isMeta: true }];
|
|
8233
8215
|
});
|
|
8234
|
-
if (
|
|
8235
|
-
if (
|
|
8236
|
-
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);
|
|
8237
8219
|
try {
|
|
8238
|
-
const items =
|
|
8239
|
-
if (items.length === 0)
|
|
8220
|
+
const items = fs19.readdirSync(FLUXFLOW_DIR);
|
|
8221
|
+
if (items.length === 0) fs19.removeSync(FLUXFLOW_DIR);
|
|
8240
8222
|
} catch (e) {
|
|
8241
8223
|
}
|
|
8242
8224
|
setTimeout(() => {
|
|
@@ -8267,7 +8249,7 @@ ${list || "No saved chats found."}`, isMeta: true }];
|
|
|
8267
8249
|
case "/changelog": {
|
|
8268
8250
|
const platform = process.platform;
|
|
8269
8251
|
const command = platform === "win32" ? "start" : platform === "darwin" ? "open" : "xdg-open";
|
|
8270
|
-
|
|
8252
|
+
exec2(`${command} ${CHANGELOG_URL}`);
|
|
8271
8253
|
setMessages((prev) => {
|
|
8272
8254
|
setCompletedIndex(prev.length + 1);
|
|
8273
8255
|
return [...prev, { id: Date.now(), role: "system", text: `\u{1F310} [BROWSER] Opening changelog: ${CHANGELOG_URL}`, isMeta: true }];
|
|
@@ -8294,14 +8276,14 @@ ${list || "No saved chats found."}`, isMeta: true }];
|
|
|
8294
8276
|
- [Define custom step-by-step recipes for this project here]
|
|
8295
8277
|
`;
|
|
8296
8278
|
const filePath = path17.join(process.cwd(), "FluxFlow.md");
|
|
8297
|
-
if (
|
|
8279
|
+
if (fs19.pathExistsSync(filePath)) {
|
|
8298
8280
|
setMessages((prev) => {
|
|
8299
8281
|
setCompletedIndex(prev.length + 1);
|
|
8300
8282
|
return [...prev, { id: "init-err-" + Date.now(), role: "system", text: "\u274C ERROR: FluxFlow.md already exists in this directory.", isMeta: true }];
|
|
8301
8283
|
});
|
|
8302
8284
|
} else {
|
|
8303
8285
|
try {
|
|
8304
|
-
|
|
8286
|
+
fs19.writeFileSync(filePath, template);
|
|
8305
8287
|
setMessages((prev) => {
|
|
8306
8288
|
setCompletedIndex(prev.length + 1);
|
|
8307
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 }];
|
|
@@ -9446,7 +9428,7 @@ var init_app = __esm({
|
|
|
9446
9428
|
linesAdded = 0;
|
|
9447
9429
|
linesRemoved = 0;
|
|
9448
9430
|
packageJsonPath = path17.join(path17.dirname(fileURLToPath(import.meta.url)), "../package.json");
|
|
9449
|
-
packageJson = JSON.parse(
|
|
9431
|
+
packageJson = JSON.parse(fs19.readFileSync(packageJsonPath, "utf8"));
|
|
9450
9432
|
versionFluxflow = packageJson.version;
|
|
9451
9433
|
updatedOn = packageJson.date || "2026-05-20";
|
|
9452
9434
|
SPINNER_FRAMES2 = ["\u280B", "\u2819", "\u2839", "\u2838", "\u283C", "\u2834", "\u2826", "\u2827", "\u2807", "\u280F"];
|
|
@@ -9561,13 +9543,13 @@ var init_app = __esm({
|
|
|
9561
9543
|
const fileList = [];
|
|
9562
9544
|
const scan = (currentDir) => {
|
|
9563
9545
|
try {
|
|
9564
|
-
const files =
|
|
9546
|
+
const files = fs19.readdirSync(currentDir);
|
|
9565
9547
|
for (const file of files) {
|
|
9566
9548
|
if (["node_modules", ".git", ".gemini", "dist", "build", ".next", ".cache", "out"].includes(file)) {
|
|
9567
9549
|
continue;
|
|
9568
9550
|
}
|
|
9569
9551
|
const filePath = path17.join(currentDir, file);
|
|
9570
|
-
const stat =
|
|
9552
|
+
const stat = fs19.statSync(filePath);
|
|
9571
9553
|
if (stat.isDirectory()) {
|
|
9572
9554
|
scan(filePath);
|
|
9573
9555
|
} else {
|