fluxflow-cli 1.18.7 → 1.18.9

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.
Files changed (2) hide show
  1. package/dist/fluxflow.js +78 -51
  2. package/package.json +1 -1
package/dist/fluxflow.js CHANGED
@@ -1206,7 +1206,11 @@ var init_exec_command = __esm({
1206
1206
  if (isActiveCommandPty && typeof activeChildProcess.destroy === "function") {
1207
1207
  activeChildProcess.destroy();
1208
1208
  } else if (typeof activeChildProcess.kill === "function") {
1209
- activeChildProcess.kill("SIGKILL");
1209
+ if (process.platform === "win32") {
1210
+ spawn("taskkill", ["/pid", activeChildProcess.pid, "/f", "/t"]);
1211
+ } else {
1212
+ activeChildProcess.kill("SIGKILL");
1213
+ }
1210
1214
  }
1211
1215
  } catch (err) {
1212
1216
  }
@@ -5343,67 +5347,90 @@ ${newMemoryListStr}
5343
5347
  const isContext32k = (sessionStats?.tokens || 0) >= 32e3;
5344
5348
  const memoryPrompt = getMemoryPrompt(otherMemories, mainUserMemories, isMemoryEnabled, isContext32k);
5345
5349
  const dateTimeStr = (/* @__PURE__ */ new Date()).toLocaleString([], { year: "numeric", month: "numeric", day: "numeric", hour: "2-digit", minute: "2-digit", hour12: true });
5346
- const getDirTree = (dir, prefix = "", depth = 1) => {
5350
+ const COLLAPSED_DIRS_GLOBAL = [".git", "node_modules", ".gemini", "dist", "build", ".next", "out", ".cache", "bin", "obj", "vendor", "venv", ".idea", ".gradle", ".terraform", "target", "coverage", ".vscode"];
5351
+ const safeReaddirWithTypes = (dir) => {
5347
5352
  try {
5348
- const files = fs16.readdirSync(dir);
5349
- const sep = path15.sep;
5350
- if (files.length > 80) {
5351
- return `${prefix}\u2514\u2500\u2500 ${path15.basename(dir)}${sep} ..80+ files...
5352
- `;
5353
+ return fs16.readdirSync(dir, { withFileTypes: true });
5354
+ } catch (e) {
5355
+ return [];
5356
+ }
5357
+ };
5358
+ const countFolders = (dir, currentCount = { value: 0 }, depth = 1) => {
5359
+ if (currentCount.value > 6200 || depth > 7) return currentCount.value;
5360
+ const entries = safeReaddirWithTypes(dir);
5361
+ for (const entry of entries) {
5362
+ if (currentCount.value > 6200) break;
5363
+ if (COLLAPSED_DIRS_GLOBAL.includes(entry.name)) continue;
5364
+ if (entry.isDirectory()) {
5365
+ currentCount.value++;
5366
+ countFolders(path15.join(dir, entry.name), currentCount, depth + 1);
5353
5367
  }
5354
- let result = "";
5355
- const COLLAPSED_DIRS = [".git", "node_modules", ".gemini", "dist", "build", ".next", "out", ".cache", "bin", "obj", "vendor"];
5356
- const filtered = files.filter((f) => !COLLAPSED_DIRS.includes(f));
5357
- const collapsedInDir = files.filter((f) => COLLAPSED_DIRS.includes(f)).sort();
5358
- const sorted = filtered.sort((a, b) => {
5359
- try {
5360
- const aStat = fs16.statSync(path15.join(dir, a));
5361
- const bStat = fs16.statSync(path15.join(dir, b));
5362
- if (aStat.isDirectory() && !bStat.isDirectory()) return -1;
5363
- if (!aStat.isDirectory() && bStat.isDirectory()) return 1;
5364
- } catch (e) {
5365
- }
5366
- return a.localeCompare(b);
5367
- });
5368
- sorted.push(...collapsedInDir);
5369
- sorted.forEach((file, index) => {
5370
- const isLast = index === sorted.length - 1;
5371
- const filePath = path15.join(dir, file);
5372
- const connector = isLast ? "\u2514\u2500\u2500 " : "\u251C\u2500\u2500 ";
5373
- const childPrefix = prefix + (isLast ? " " : "\u2502 ");
5374
- if (COLLAPSED_DIRS.includes(file)) {
5375
- result += `${prefix}${connector}${file}${sep}...
5368
+ }
5369
+ return currentCount.value;
5370
+ };
5371
+ const getDirTree = (dir, maxDepth, prefix = "", depth = 1) => {
5372
+ const entries = safeReaddirWithTypes(dir);
5373
+ const sep = path15.sep;
5374
+ if (entries.length > 100) {
5375
+ return `${prefix}\u2514\u2500\u2500 ${path15.basename(dir)}${sep} ...100+ files...
5376
5376
  `;
5377
- return;
5378
- }
5379
- try {
5380
- const stat = fs16.statSync(filePath);
5381
- if (stat.isDirectory()) {
5382
- const subFiles = fs16.readdirSync(filePath);
5383
- if (subFiles.length > 80 || depth >= 7) {
5384
- result += `${prefix}${connector}${file}${sep} ..{depth exceeded}..
5377
+ }
5378
+ let result = "";
5379
+ const COLLAPSED_DIRS = COLLAPSED_DIRS_GLOBAL;
5380
+ const filtered = entries.filter((e) => !COLLAPSED_DIRS.includes(e.name));
5381
+ const collapsedInDir = entries.filter((e) => COLLAPSED_DIRS.includes(e.name)).map((e) => e.name).sort();
5382
+ filtered.sort((a, b) => {
5383
+ if (a.isDirectory() && !b.isDirectory()) return -1;
5384
+ if (!a.isDirectory() && b.isDirectory()) return 1;
5385
+ return a.name.localeCompare(b.name);
5386
+ });
5387
+ const finalItems = [
5388
+ ...filtered.map((e) => ({ name: e.name, isDir: e.isDirectory() })),
5389
+ ...collapsedInDir.map((name) => ({ name, isDir: true, isCollapsed: true }))
5390
+ ];
5391
+ finalItems.forEach((item, index) => {
5392
+ const isLast = index === finalItems.length - 1;
5393
+ const filePath = path15.join(dir, item.name);
5394
+ const connector = isLast ? "\u2514\u2500\u2500 " : "\u251C\u2500\u2500 ";
5395
+ const childPrefix = prefix + (isLast ? " " : "\u2502 ");
5396
+ if (item.isCollapsed) {
5397
+ result += `${prefix}${connector}${item.name}${sep}...
5385
5398
  `;
5386
- } else {
5387
- result += `${prefix}${connector}${file}${sep}
5399
+ return;
5400
+ }
5401
+ if (item.isDir) {
5402
+ if (depth > maxDepth) {
5403
+ result += `${prefix}${connector}${item.name}${sep} ...depth exceeded...
5404
+ `;
5405
+ } else {
5406
+ const subEntries = safeReaddirWithTypes(filePath);
5407
+ if (subEntries.length > 80) {
5408
+ result += `${prefix}${connector}${item.name}${sep} ...80+ files...
5388
5409
  `;
5389
- result += getDirTree(filePath, childPrefix, depth + 1);
5390
- }
5391
5410
  } else {
5392
- result += `${prefix}${connector}${file}
5411
+ result += `${prefix}${connector}${item.name}${sep}
5393
5412
  `;
5413
+ result += getDirTree(filePath, maxDepth, childPrefix, depth + 1);
5394
5414
  }
5395
- } catch (e) {
5396
- result += `${prefix}${connector}${file}
5397
- `;
5398
5415
  }
5399
- });
5400
- return result;
5401
- } catch (e) {
5402
- return "";
5403
- }
5416
+ } else {
5417
+ result += `${prefix}${connector}${item.name}
5418
+ `;
5419
+ }
5420
+ });
5421
+ return result;
5404
5422
  };
5405
5423
  yield { type: "status", content: "Gathering Context..." };
5406
- let dirStructure = process.cwd() + "\n" + getDirTree(process.cwd());
5424
+ await new Promise((resolve) => setTimeout(resolve, 500));
5425
+ const totalFolders = countFolders(process.cwd());
5426
+ let dynamicMaxDepth = 7;
5427
+ if (totalFolders > 4096) dynamicMaxDepth = 1;
5428
+ else if (totalFolders > 3072) dynamicMaxDepth = 2;
5429
+ else if (totalFolders > 2048) dynamicMaxDepth = 3;
5430
+ else if (totalFolders > 1024) dynamicMaxDepth = 4;
5431
+ else if (totalFolders > 512) dynamicMaxDepth = 6;
5432
+ else if (totalFolders > 256) dynamicMaxDepth = 7;
5433
+ let dirStructure = totalFolders > 6144 ? `FileSystem Depth exceeded for indexing` : process.cwd() + "\n" + getDirTree(process.cwd(), dynamicMaxDepth);
5407
5434
  const firstUserMsg = `[SYSTEM METADATA (PRIORITY: DYNAMIC)] Time: ${dateTimeStr} | v${versionFluxflow2}
5408
5435
  CWD: ${process.cwd()}
5409
5436
  **DIRECTORY STRUCTURE**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fluxflow-cli",
3
- "version": "1.18.7",
3
+ "version": "1.18.9",
4
4
  "date": "2026-05-30",
5
5
  "description": "A high-fidelity agentic terminal assistant for the Flux Era.",
6
6
  "keywords": [