fluxflow-cli 1.8.4 → 1.8.5

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 +38 -8
  2. package/package.json +1 -1
package/dist/fluxflow.js CHANGED
@@ -1052,6 +1052,20 @@ var init_usage = __esm({
1052
1052
  if (!isDirty || !cachedUsage) return;
1053
1053
  try {
1054
1054
  await fs5.ensureDir(path5.dirname(USAGE_FILE));
1055
+ let diskData = null;
1056
+ try {
1057
+ if (await fs5.exists(USAGE_FILE)) {
1058
+ diskData = await fs5.readJson(USAGE_FILE);
1059
+ }
1060
+ } catch (e) {
1061
+ }
1062
+ if (diskData && diskData.date === cachedUsage.date && diskData.stats) {
1063
+ for (const key in cachedUsage.stats) {
1064
+ if (diskData.stats[key] !== void 0) {
1065
+ cachedUsage.stats[key] = Math.max(cachedUsage.stats[key], diskData.stats[key]);
1066
+ }
1067
+ }
1068
+ }
1055
1069
  const tempFile = USAGE_FILE + ".tmp";
1056
1070
  await fs5.writeJson(tempFile, cachedUsage, { spaces: 2 });
1057
1071
  const fd = await fs5.open(tempFile, "r+");
@@ -1072,6 +1086,7 @@ var init_usage = __esm({
1072
1086
  await flushUsage();
1073
1087
  writeTimeout = null;
1074
1088
  }, delay);
1089
+ if (writeTimeout.unref) writeTimeout.unref();
1075
1090
  };
1076
1091
  initUsage = async () => {
1077
1092
  cachedUsage = await loadUsageFromFile();
@@ -1596,7 +1611,11 @@ var init_view_file = __esm({
1596
1611
  "src/tools/view_file.js"() {
1597
1612
  init_arg_parser();
1598
1613
  view_file = async (args) => {
1599
- const { path: targetPath, start_line = 1, end_line = 500 } = parseArgs(args);
1614
+ let { path: targetPath, StartLine, EndLine, start_line, end_line } = parseArgs(args);
1615
+ const sLine = parseInt(StartLine || start_line);
1616
+ const eLine = parseInt(EndLine || end_line);
1617
+ const finalStart = sLine || 1;
1618
+ const finalEnd = eLine || (sLine ? sLine + 800 : 800);
1600
1619
  if (!targetPath) return 'ERROR: Missing "path" argument for view_file.';
1601
1620
  const absolutePath = path9.resolve(process.cwd(), targetPath);
1602
1621
  try {
@@ -1639,8 +1658,8 @@ var init_view_file = __esm({
1639
1658
  content = content.replace(/\\n/g, "[/n]");
1640
1659
  const lines = content.split("\n");
1641
1660
  const totalLines = lines.length;
1642
- const start = Math.max(0, start_line - 1);
1643
- const end = Math.min(totalLines, end_line);
1661
+ const start = Math.max(0, finalStart - 1);
1662
+ const end = Math.min(totalLines, finalEnd);
1644
1663
  const resultLines = lines.slice(start, end);
1645
1664
  const header = `File: [${targetPath}] (Showing lines ${start + 1}-${end} of ${totalLines})`;
1646
1665
  const code = resultLines.map((line, i) => `${String(start + i + 1).padStart(4)}: ${line}`).join("\n");
@@ -2636,9 +2655,11 @@ var init_ai = __esm({
2636
2655
  const url = parseArgs(toolCall.args).url || "...";
2637
2656
  label = `\u{1F4D6} READING SITE: ${url}`.toUpperCase();
2638
2657
  } else if (toolCall.toolName === "view_file") {
2639
- const { path: targetPath2, start_line = 1, end_line = 500 } = parseArgs(toolCall.args);
2658
+ const { path: targetPath2, StartLine, EndLine, start_line, end_line } = parseArgs(toolCall.args);
2659
+ const sLine = parseInt(StartLine || start_line) || 1;
2660
+ const eLine = parseInt(EndLine || end_line) || (StartLine || start_line ? sLine + 800 : 800);
2640
2661
  let totalLines = "...";
2641
- let actualEndLine = end_line;
2662
+ let actualEndLine = eLine;
2642
2663
  try {
2643
2664
  const absPath = path16.resolve(process.cwd(), targetPath2);
2644
2665
  if (fs16.existsSync(absPath)) {
@@ -2657,7 +2678,7 @@ var init_ai = __esm({
2657
2678
  } else if (isImage) {
2658
2679
  label = `\u{1F4F8} ANALYZING IMAGE: ${targetPath2}`.toUpperCase();
2659
2680
  } else {
2660
- label = `\u{1F4C4} READING FILE: ${targetPath2}. LINES ${start_line} - ${actualEndLine} FROM ${totalLines}`.toUpperCase();
2681
+ label = `\u{1F4C4} READING FILE: ${targetPath2}. LINES ${sLine} - ${actualEndLine} FROM ${totalLines}`.toUpperCase();
2661
2682
  }
2662
2683
  } else if (toolCall.toolName === "list_files" || toolCall.toolName === "read_folder") {
2663
2684
  const action = toolCall.toolName === "list_files" ? "LISTING" : "DISCOVERING";
@@ -3085,6 +3106,7 @@ var init_UpdateProcessor = __esm({
3085
3106
  const [log, setLog] = useState6("");
3086
3107
  const [error, setError] = useState6(null);
3087
3108
  useEffect4(() => {
3109
+ let child;
3088
3110
  const runUpdate = async () => {
3089
3111
  const manager = settings.updateManager || "npm";
3090
3112
  if (!settings.updateManager) {
@@ -3099,7 +3121,7 @@ var init_UpdateProcessor = __esm({
3099
3121
  else command = `npm install -g fluxflow-cli@${latest}`;
3100
3122
  setStatus("downloading");
3101
3123
  setLog(`Running: ${command}...`);
3102
- const child = exec2(command, (err, stdout, stderr) => {
3124
+ child = exec2(command, (err, stdout, stderr) => {
3103
3125
  if (err) {
3104
3126
  setError(stderr || err.message);
3105
3127
  setStatus("error");
@@ -3113,6 +3135,14 @@ var init_UpdateProcessor = __esm({
3113
3135
  });
3114
3136
  };
3115
3137
  runUpdate();
3138
+ return () => {
3139
+ if (child) {
3140
+ try {
3141
+ child.kill();
3142
+ } catch (e) {
3143
+ }
3144
+ }
3145
+ };
3116
3146
  }, []);
3117
3147
  if (status === "initializing" || status === "downloading") {
3118
3148
  return /* @__PURE__ */ React9.createElement(Box9, { flexDirection: "column", borderStyle: "round", borderColor: "cyan", paddingX: 2, paddingY: 1 }, /* @__PURE__ */ React9.createElement(Box9, null, /* @__PURE__ */ React9.createElement(Text9, { color: "cyan" }, /* @__PURE__ */ React9.createElement(Spinner, { type: "dots" })), /* @__PURE__ */ React9.createElement(Text9, { marginLeft: 1, bold: true }, " Updating Flux Flow to v", latest, "...")), /* @__PURE__ */ React9.createElement(Box9, { marginTop: 1, paddingX: 1, borderStyle: "single", borderColor: "#333" }, /* @__PURE__ */ React9.createElement(Text9, { color: "gray", dimColor: true, italic: true }, log || "Preparing environment...")), /* @__PURE__ */ React9.createElement(Text9, { marginTop: 1, dimColor: true }, "(Please do not close the terminal)"));
@@ -4795,7 +4825,7 @@ var init_app = __esm({
4795
4825
  init_text();
4796
4826
  SESSION_START_TIME = Date.now();
4797
4827
  CHANGELOG_URL = "https://fluxflow-cli.onrender.com/changelog.html";
4798
- versionFluxflow = "1.8.4";
4828
+ versionFluxflow = "1.8.5";
4799
4829
  updatedOn = "2026-05-08";
4800
4830
  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 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(
4801
4831
  CommandMenu,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fluxflow-cli",
3
- "version": "1.8.4",
3
+ "version": "1.8.5",
4
4
  "description": "A high-fidelity agentic terminal assistant for the Flux Era.",
5
5
  "keywords": [
6
6
  "ai",