fluxflow-cli 1.18.2 → 1.18.3

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 +21 -9
  2. package/package.json +1 -1
package/dist/fluxflow.js CHANGED
@@ -3230,16 +3230,28 @@ var init_update_file = __esm({
3230
3230
  const targetPath = parsed.path;
3231
3231
  if (!targetPath) return 'ERROR: Missing "path" argument for update_file.';
3232
3232
  const patchPairs = [];
3233
- const legacyReplace = parsed.content_to_replace !== void 0 ? parsed.content_to_replace : parsed.replaceContent;
3234
- const legacyNew = parsed.content_to_add !== void 0 ? parsed.content_to_add : parsed.newContent;
3235
- if (legacyReplace !== void 0 && legacyNew !== void 0) {
3236
- patchPairs.push({ replace: legacyReplace, new: legacyNew });
3237
- }
3238
- for (let i = 1; i <= 10; i++) {
3239
- const r = parsed[`replaceContent${i}`];
3240
- const n = parsed[`newContent${i}`];
3241
- if (r !== void 0 && n !== void 0 && r !== legacyReplace) {
3233
+ const indices = /* @__PURE__ */ new Set();
3234
+ Object.keys(parsed).forEach((key) => {
3235
+ const m = key.match(/^(replaceContent|newContent|content_to_replace|content_to_add)(\d+)?$/);
3236
+ if (m) {
3237
+ const index = m[2] ? parseInt(m[2]) : 1;
3238
+ indices.add(index);
3239
+ }
3240
+ });
3241
+ const sortedIndices = Array.from(indices).sort((a, b) => a - b);
3242
+ for (const i of sortedIndices) {
3243
+ let r, n;
3244
+ if (i === 1) {
3245
+ r = parsed.replaceContent1 ?? (parsed.content_to_replace ?? parsed.replaceContent);
3246
+ n = parsed.newContent1 ?? (parsed.content_to_add ?? parsed.newContent);
3247
+ } else {
3248
+ r = parsed[`replaceContent${i}`] ?? parsed[`content_to_replace${i}`];
3249
+ n = parsed[`newContent${i}`] ?? parsed[`content_to_add${i}`];
3250
+ }
3251
+ if (r !== void 0 && n !== void 0) {
3242
3252
  patchPairs.push({ replace: r, new: n });
3253
+ } else if (r !== void 0 || n !== void 0) {
3254
+ return `ERROR: Mismatched replacement pair for index ${i}. Both replacement and new content must be provided.`;
3243
3255
  }
3244
3256
  }
3245
3257
  if (patchPairs.length === 0) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fluxflow-cli",
3
- "version": "1.18.2",
3
+ "version": "1.18.3",
4
4
  "date": "2026-05-30",
5
5
  "description": "A high-fidelity agentic terminal assistant for the Flux Era.",
6
6
  "keywords": [