fimo 0.2.3-staging.8 → 0.2.3-staging.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.
package/dist/cli/index.js CHANGED
@@ -1972,8 +1972,8 @@ var require_command = __commonJS({
1972
1972
  "../../node_modules/.pnpm/commander@13.1.0/node_modules/commander/lib/command.js"(exports2) {
1973
1973
  var EventEmitter = __require("node:events").EventEmitter;
1974
1974
  var childProcess2 = __require("node:child_process");
1975
- var path43 = __require("node:path");
1976
- var fs40 = __require("node:fs");
1975
+ var path44 = __require("node:path");
1976
+ var fs41 = __require("node:fs");
1977
1977
  var process8 = __require("node:process");
1978
1978
  var { Argument: Argument2, humanReadableArgName } = require_argument();
1979
1979
  var { CommanderError: CommanderError2 } = require_error();
@@ -2957,7 +2957,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
2957
2957
  * @param {string} subcommandName
2958
2958
  */
2959
2959
  _checkForMissingExecutable(executableFile, executableDir, subcommandName) {
2960
- if (fs40.existsSync(executableFile)) return;
2960
+ if (fs41.existsSync(executableFile)) return;
2961
2961
  const executableDirMessage = executableDir ? `searched for local subcommand relative to directory '${executableDir}'` : "no directory for search for local subcommand, use .executableDir() to supply a custom directory";
2962
2962
  const executableMissing = `'${executableFile}' does not exist
2963
2963
  - if '${subcommandName}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead
@@ -2975,11 +2975,11 @@ Expecting one of '${allowedValues.join("', '")}'`);
2975
2975
  let launchWithNode = false;
2976
2976
  const sourceExt = [".js", ".ts", ".tsx", ".mjs", ".cjs"];
2977
2977
  function findFile(baseDir, baseName) {
2978
- const localBin = path43.resolve(baseDir, baseName);
2979
- if (fs40.existsSync(localBin)) return localBin;
2980
- if (sourceExt.includes(path43.extname(baseName))) return void 0;
2978
+ const localBin = path44.resolve(baseDir, baseName);
2979
+ if (fs41.existsSync(localBin)) return localBin;
2980
+ if (sourceExt.includes(path44.extname(baseName))) return void 0;
2981
2981
  const foundExt = sourceExt.find(
2982
- (ext) => fs40.existsSync(`${localBin}${ext}`)
2982
+ (ext) => fs41.existsSync(`${localBin}${ext}`)
2983
2983
  );
2984
2984
  if (foundExt) return `${localBin}${foundExt}`;
2985
2985
  return void 0;
@@ -2992,21 +2992,21 @@ Expecting one of '${allowedValues.join("', '")}'`);
2992
2992
  if (this._scriptPath) {
2993
2993
  let resolvedScriptPath;
2994
2994
  try {
2995
- resolvedScriptPath = fs40.realpathSync(this._scriptPath);
2995
+ resolvedScriptPath = fs41.realpathSync(this._scriptPath);
2996
2996
  } catch {
2997
2997
  resolvedScriptPath = this._scriptPath;
2998
2998
  }
2999
- executableDir = path43.resolve(
3000
- path43.dirname(resolvedScriptPath),
2999
+ executableDir = path44.resolve(
3000
+ path44.dirname(resolvedScriptPath),
3001
3001
  executableDir
3002
3002
  );
3003
3003
  }
3004
3004
  if (executableDir) {
3005
3005
  let localFile = findFile(executableDir, executableFile);
3006
3006
  if (!localFile && !subcommand._executableFile && this._scriptPath) {
3007
- const legacyName = path43.basename(
3007
+ const legacyName = path44.basename(
3008
3008
  this._scriptPath,
3009
- path43.extname(this._scriptPath)
3009
+ path44.extname(this._scriptPath)
3010
3010
  );
3011
3011
  if (legacyName !== this._name) {
3012
3012
  localFile = findFile(
@@ -3017,7 +3017,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
3017
3017
  }
3018
3018
  executableFile = localFile || executableFile;
3019
3019
  }
3020
- launchWithNode = sourceExt.includes(path43.extname(executableFile));
3020
+ launchWithNode = sourceExt.includes(path44.extname(executableFile));
3021
3021
  let proc;
3022
3022
  if (process8.platform !== "win32") {
3023
3023
  if (launchWithNode) {
@@ -3865,7 +3865,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
3865
3865
  * @return {Command}
3866
3866
  */
3867
3867
  nameFromFilename(filename) {
3868
- this._name = path43.basename(filename, path43.extname(filename));
3868
+ this._name = path44.basename(filename, path44.extname(filename));
3869
3869
  return this;
3870
3870
  }
3871
3871
  /**
@@ -3879,9 +3879,9 @@ Expecting one of '${allowedValues.join("', '")}'`);
3879
3879
  * @param {string} [path]
3880
3880
  * @return {(string|null|Command)}
3881
3881
  */
3882
- executableDir(path44) {
3883
- if (path44 === void 0) return this._executableDir;
3884
- this._executableDir = path44;
3882
+ executableDir(path45) {
3883
+ if (path45 === void 0) return this._executableDir;
3884
+ this._executableDir = path45;
3885
3885
  return this;
3886
3886
  }
3887
3887
  /**
@@ -6579,17 +6579,17 @@ var require_visit = __commonJS({
6579
6579
  visit2.BREAK = BREAK;
6580
6580
  visit2.SKIP = SKIP;
6581
6581
  visit2.REMOVE = REMOVE;
6582
- function visit_(key, node, visitor, path43) {
6583
- const ctrl = callVisitor(key, node, visitor, path43);
6582
+ function visit_(key, node, visitor, path44) {
6583
+ const ctrl = callVisitor(key, node, visitor, path44);
6584
6584
  if (identity2.isNode(ctrl) || identity2.isPair(ctrl)) {
6585
- replaceNode(key, path43, ctrl);
6586
- return visit_(key, ctrl, visitor, path43);
6585
+ replaceNode(key, path44, ctrl);
6586
+ return visit_(key, ctrl, visitor, path44);
6587
6587
  }
6588
6588
  if (typeof ctrl !== "symbol") {
6589
6589
  if (identity2.isCollection(node)) {
6590
- path43 = Object.freeze(path43.concat(node));
6590
+ path44 = Object.freeze(path44.concat(node));
6591
6591
  for (let i = 0; i < node.items.length; ++i) {
6592
- const ci = visit_(i, node.items[i], visitor, path43);
6592
+ const ci = visit_(i, node.items[i], visitor, path44);
6593
6593
  if (typeof ci === "number")
6594
6594
  i = ci - 1;
6595
6595
  else if (ci === BREAK)
@@ -6600,13 +6600,13 @@ var require_visit = __commonJS({
6600
6600
  }
6601
6601
  }
6602
6602
  } else if (identity2.isPair(node)) {
6603
- path43 = Object.freeze(path43.concat(node));
6604
- const ck = visit_("key", node.key, visitor, path43);
6603
+ path44 = Object.freeze(path44.concat(node));
6604
+ const ck = visit_("key", node.key, visitor, path44);
6605
6605
  if (ck === BREAK)
6606
6606
  return BREAK;
6607
6607
  else if (ck === REMOVE)
6608
6608
  node.key = null;
6609
- const cv = visit_("value", node.value, visitor, path43);
6609
+ const cv = visit_("value", node.value, visitor, path44);
6610
6610
  if (cv === BREAK)
6611
6611
  return BREAK;
6612
6612
  else if (cv === REMOVE)
@@ -6629,17 +6629,17 @@ var require_visit = __commonJS({
6629
6629
  visitAsync.BREAK = BREAK;
6630
6630
  visitAsync.SKIP = SKIP;
6631
6631
  visitAsync.REMOVE = REMOVE;
6632
- async function visitAsync_(key, node, visitor, path43) {
6633
- const ctrl = await callVisitor(key, node, visitor, path43);
6632
+ async function visitAsync_(key, node, visitor, path44) {
6633
+ const ctrl = await callVisitor(key, node, visitor, path44);
6634
6634
  if (identity2.isNode(ctrl) || identity2.isPair(ctrl)) {
6635
- replaceNode(key, path43, ctrl);
6636
- return visitAsync_(key, ctrl, visitor, path43);
6635
+ replaceNode(key, path44, ctrl);
6636
+ return visitAsync_(key, ctrl, visitor, path44);
6637
6637
  }
6638
6638
  if (typeof ctrl !== "symbol") {
6639
6639
  if (identity2.isCollection(node)) {
6640
- path43 = Object.freeze(path43.concat(node));
6640
+ path44 = Object.freeze(path44.concat(node));
6641
6641
  for (let i = 0; i < node.items.length; ++i) {
6642
- const ci = await visitAsync_(i, node.items[i], visitor, path43);
6642
+ const ci = await visitAsync_(i, node.items[i], visitor, path44);
6643
6643
  if (typeof ci === "number")
6644
6644
  i = ci - 1;
6645
6645
  else if (ci === BREAK)
@@ -6650,13 +6650,13 @@ var require_visit = __commonJS({
6650
6650
  }
6651
6651
  }
6652
6652
  } else if (identity2.isPair(node)) {
6653
- path43 = Object.freeze(path43.concat(node));
6654
- const ck = await visitAsync_("key", node.key, visitor, path43);
6653
+ path44 = Object.freeze(path44.concat(node));
6654
+ const ck = await visitAsync_("key", node.key, visitor, path44);
6655
6655
  if (ck === BREAK)
6656
6656
  return BREAK;
6657
6657
  else if (ck === REMOVE)
6658
6658
  node.key = null;
6659
- const cv = await visitAsync_("value", node.value, visitor, path43);
6659
+ const cv = await visitAsync_("value", node.value, visitor, path44);
6660
6660
  if (cv === BREAK)
6661
6661
  return BREAK;
6662
6662
  else if (cv === REMOVE)
@@ -6685,24 +6685,24 @@ var require_visit = __commonJS({
6685
6685
  return visitor;
6686
6686
  }
6687
6687
  __name(initVisitor, "initVisitor");
6688
- function callVisitor(key, node, visitor, path43) {
6688
+ function callVisitor(key, node, visitor, path44) {
6689
6689
  if (typeof visitor === "function")
6690
- return visitor(key, node, path43);
6690
+ return visitor(key, node, path44);
6691
6691
  if (identity2.isMap(node))
6692
- return visitor.Map?.(key, node, path43);
6692
+ return visitor.Map?.(key, node, path44);
6693
6693
  if (identity2.isSeq(node))
6694
- return visitor.Seq?.(key, node, path43);
6694
+ return visitor.Seq?.(key, node, path44);
6695
6695
  if (identity2.isPair(node))
6696
- return visitor.Pair?.(key, node, path43);
6696
+ return visitor.Pair?.(key, node, path44);
6697
6697
  if (identity2.isScalar(node))
6698
- return visitor.Scalar?.(key, node, path43);
6698
+ return visitor.Scalar?.(key, node, path44);
6699
6699
  if (identity2.isAlias(node))
6700
- return visitor.Alias?.(key, node, path43);
6700
+ return visitor.Alias?.(key, node, path44);
6701
6701
  return void 0;
6702
6702
  }
6703
6703
  __name(callVisitor, "callVisitor");
6704
- function replaceNode(key, path43, node) {
6705
- const parent2 = path43[path43.length - 1];
6704
+ function replaceNode(key, path44, node) {
6705
+ const parent2 = path44[path44.length - 1];
6706
6706
  if (identity2.isCollection(parent2)) {
6707
6707
  parent2.items[key] = node;
6708
6708
  } else if (identity2.isPair(parent2)) {
@@ -7334,10 +7334,10 @@ var require_Collection = __commonJS({
7334
7334
  var createNode = require_createNode();
7335
7335
  var identity2 = require_identity();
7336
7336
  var Node2 = require_Node();
7337
- function collectionFromPath(schema, path43, value) {
7337
+ function collectionFromPath(schema, path44, value) {
7338
7338
  let v = value;
7339
- for (let i = path43.length - 1; i >= 0; --i) {
7340
- const k = path43[i];
7339
+ for (let i = path44.length - 1; i >= 0; --i) {
7340
+ const k = path44[i];
7341
7341
  if (typeof k === "number" && Number.isInteger(k) && k >= 0) {
7342
7342
  const a = [];
7343
7343
  a[k] = v;
@@ -7357,7 +7357,7 @@ var require_Collection = __commonJS({
7357
7357
  });
7358
7358
  }
7359
7359
  __name(collectionFromPath, "collectionFromPath");
7360
- var isEmptyPath = /* @__PURE__ */ __name((path43) => path43 == null || typeof path43 === "object" && !!path43[Symbol.iterator]().next().done, "isEmptyPath");
7360
+ var isEmptyPath = /* @__PURE__ */ __name((path44) => path44 == null || typeof path44 === "object" && !!path44[Symbol.iterator]().next().done, "isEmptyPath");
7361
7361
  var Collection = class extends Node2.NodeBase {
7362
7362
  static {
7363
7363
  __name(this, "Collection");
@@ -7390,11 +7390,11 @@ var require_Collection = __commonJS({
7390
7390
  * be a Pair instance or a `{ key, value }` object, which may not have a key
7391
7391
  * that already exists in the map.
7392
7392
  */
7393
- addIn(path43, value) {
7394
- if (isEmptyPath(path43))
7393
+ addIn(path44, value) {
7394
+ if (isEmptyPath(path44))
7395
7395
  this.add(value);
7396
7396
  else {
7397
- const [key, ...rest] = path43;
7397
+ const [key, ...rest] = path44;
7398
7398
  const node = this.get(key, true);
7399
7399
  if (identity2.isCollection(node))
7400
7400
  node.addIn(rest, value);
@@ -7408,8 +7408,8 @@ var require_Collection = __commonJS({
7408
7408
  * Removes a value from the collection.
7409
7409
  * @returns `true` if the item was found and removed.
7410
7410
  */
7411
- deleteIn(path43) {
7412
- const [key, ...rest] = path43;
7411
+ deleteIn(path44) {
7412
+ const [key, ...rest] = path44;
7413
7413
  if (rest.length === 0)
7414
7414
  return this.delete(key);
7415
7415
  const node = this.get(key, true);
@@ -7423,8 +7423,8 @@ var require_Collection = __commonJS({
7423
7423
  * scalar values from their surrounding node; to disable set `keepScalar` to
7424
7424
  * `true` (collections are always returned intact).
7425
7425
  */
7426
- getIn(path43, keepScalar) {
7427
- const [key, ...rest] = path43;
7426
+ getIn(path44, keepScalar) {
7427
+ const [key, ...rest] = path44;
7428
7428
  const node = this.get(key, true);
7429
7429
  if (rest.length === 0)
7430
7430
  return !keepScalar && identity2.isScalar(node) ? node.value : node;
@@ -7442,8 +7442,8 @@ var require_Collection = __commonJS({
7442
7442
  /**
7443
7443
  * Checks if the collection includes a value with the key `key`.
7444
7444
  */
7445
- hasIn(path43) {
7446
- const [key, ...rest] = path43;
7445
+ hasIn(path44) {
7446
+ const [key, ...rest] = path44;
7447
7447
  if (rest.length === 0)
7448
7448
  return this.has(key);
7449
7449
  const node = this.get(key, true);
@@ -7453,8 +7453,8 @@ var require_Collection = __commonJS({
7453
7453
  * Sets a value in this collection. For `!!set`, `value` needs to be a
7454
7454
  * boolean to add/remove the item from the set.
7455
7455
  */
7456
- setIn(path43, value) {
7457
- const [key, ...rest] = path43;
7456
+ setIn(path44, value) {
7457
+ const [key, ...rest] = path44;
7458
7458
  if (rest.length === 0) {
7459
7459
  this.set(key, value);
7460
7460
  } else {
@@ -10031,9 +10031,9 @@ var require_Document = __commonJS({
10031
10031
  this.contents.add(value);
10032
10032
  }
10033
10033
  /** Adds a value to the document. */
10034
- addIn(path43, value) {
10034
+ addIn(path44, value) {
10035
10035
  if (assertCollection(this.contents))
10036
- this.contents.addIn(path43, value);
10036
+ this.contents.addIn(path44, value);
10037
10037
  }
10038
10038
  /**
10039
10039
  * Create a new `Alias` node, ensuring that the target `node` has the required anchor.
@@ -10108,14 +10108,14 @@ var require_Document = __commonJS({
10108
10108
  * Removes a value from the document.
10109
10109
  * @returns `true` if the item was found and removed.
10110
10110
  */
10111
- deleteIn(path43) {
10112
- if (Collection.isEmptyPath(path43)) {
10111
+ deleteIn(path44) {
10112
+ if (Collection.isEmptyPath(path44)) {
10113
10113
  if (this.contents == null)
10114
10114
  return false;
10115
10115
  this.contents = null;
10116
10116
  return true;
10117
10117
  }
10118
- return assertCollection(this.contents) ? this.contents.deleteIn(path43) : false;
10118
+ return assertCollection(this.contents) ? this.contents.deleteIn(path44) : false;
10119
10119
  }
10120
10120
  /**
10121
10121
  * Returns item at `key`, or `undefined` if not found. By default unwraps
@@ -10130,10 +10130,10 @@ var require_Document = __commonJS({
10130
10130
  * scalar values from their surrounding node; to disable set `keepScalar` to
10131
10131
  * `true` (collections are always returned intact).
10132
10132
  */
10133
- getIn(path43, keepScalar) {
10134
- if (Collection.isEmptyPath(path43))
10133
+ getIn(path44, keepScalar) {
10134
+ if (Collection.isEmptyPath(path44))
10135
10135
  return !keepScalar && identity2.isScalar(this.contents) ? this.contents.value : this.contents;
10136
- return identity2.isCollection(this.contents) ? this.contents.getIn(path43, keepScalar) : void 0;
10136
+ return identity2.isCollection(this.contents) ? this.contents.getIn(path44, keepScalar) : void 0;
10137
10137
  }
10138
10138
  /**
10139
10139
  * Checks if the document includes a value with the key `key`.
@@ -10144,10 +10144,10 @@ var require_Document = __commonJS({
10144
10144
  /**
10145
10145
  * Checks if the document includes a value at `path`.
10146
10146
  */
10147
- hasIn(path43) {
10148
- if (Collection.isEmptyPath(path43))
10147
+ hasIn(path44) {
10148
+ if (Collection.isEmptyPath(path44))
10149
10149
  return this.contents !== void 0;
10150
- return identity2.isCollection(this.contents) ? this.contents.hasIn(path43) : false;
10150
+ return identity2.isCollection(this.contents) ? this.contents.hasIn(path44) : false;
10151
10151
  }
10152
10152
  /**
10153
10153
  * Sets a value in this document. For `!!set`, `value` needs to be a
@@ -10164,13 +10164,13 @@ var require_Document = __commonJS({
10164
10164
  * Sets a value in this document. For `!!set`, `value` needs to be a
10165
10165
  * boolean to add/remove the item from the set.
10166
10166
  */
10167
- setIn(path43, value) {
10168
- if (Collection.isEmptyPath(path43)) {
10167
+ setIn(path44, value) {
10168
+ if (Collection.isEmptyPath(path44)) {
10169
10169
  this.contents = value;
10170
10170
  } else if (this.contents == null) {
10171
- this.contents = Collection.collectionFromPath(this.schema, Array.from(path43), value);
10171
+ this.contents = Collection.collectionFromPath(this.schema, Array.from(path44), value);
10172
10172
  } else if (assertCollection(this.contents)) {
10173
- this.contents.setIn(path43, value);
10173
+ this.contents.setIn(path44, value);
10174
10174
  }
10175
10175
  }
10176
10176
  /**
@@ -12182,9 +12182,9 @@ var require_cst_visit = __commonJS({
12182
12182
  visit2.BREAK = BREAK;
12183
12183
  visit2.SKIP = SKIP;
12184
12184
  visit2.REMOVE = REMOVE;
12185
- visit2.itemAtPath = (cst, path43) => {
12185
+ visit2.itemAtPath = (cst, path44) => {
12186
12186
  let item = cst;
12187
- for (const [field, index2] of path43) {
12187
+ for (const [field, index2] of path44) {
12188
12188
  const tok = item?.[field];
12189
12189
  if (tok && "items" in tok) {
12190
12190
  item = tok.items[index2];
@@ -12193,23 +12193,23 @@ var require_cst_visit = __commonJS({
12193
12193
  }
12194
12194
  return item;
12195
12195
  };
12196
- visit2.parentCollection = (cst, path43) => {
12197
- const parent2 = visit2.itemAtPath(cst, path43.slice(0, -1));
12198
- const field = path43[path43.length - 1][0];
12196
+ visit2.parentCollection = (cst, path44) => {
12197
+ const parent2 = visit2.itemAtPath(cst, path44.slice(0, -1));
12198
+ const field = path44[path44.length - 1][0];
12199
12199
  const coll = parent2?.[field];
12200
12200
  if (coll && "items" in coll)
12201
12201
  return coll;
12202
12202
  throw new Error("Parent collection not found");
12203
12203
  };
12204
- function _visit(path43, item, visitor) {
12205
- let ctrl = visitor(item, path43);
12204
+ function _visit(path44, item, visitor) {
12205
+ let ctrl = visitor(item, path44);
12206
12206
  if (typeof ctrl === "symbol")
12207
12207
  return ctrl;
12208
12208
  for (const field of ["key", "value"]) {
12209
12209
  const token = item[field];
12210
12210
  if (token && "items" in token) {
12211
12211
  for (let i = 0; i < token.items.length; ++i) {
12212
- const ci = _visit(Object.freeze(path43.concat([[field, i]])), token.items[i], visitor);
12212
+ const ci = _visit(Object.freeze(path44.concat([[field, i]])), token.items[i], visitor);
12213
12213
  if (typeof ci === "number")
12214
12214
  i = ci - 1;
12215
12215
  else if (ci === BREAK)
@@ -12220,10 +12220,10 @@ var require_cst_visit = __commonJS({
12220
12220
  }
12221
12221
  }
12222
12222
  if (typeof ctrl === "function" && field === "key")
12223
- ctrl = ctrl(item, path43);
12223
+ ctrl = ctrl(item, path44);
12224
12224
  }
12225
12225
  }
12226
- return typeof ctrl === "function" ? ctrl(item, path43) : ctrl;
12226
+ return typeof ctrl === "function" ? ctrl(item, path44) : ctrl;
12227
12227
  }
12228
12228
  __name(_visit, "_visit");
12229
12229
  exports2.visit = visit2;
@@ -13545,14 +13545,14 @@ var require_parser = __commonJS({
13545
13545
  case "scalar":
13546
13546
  case "single-quoted-scalar":
13547
13547
  case "double-quoted-scalar": {
13548
- const fs40 = this.flowScalar(this.type);
13548
+ const fs41 = this.flowScalar(this.type);
13549
13549
  if (atNextItem || it2.value) {
13550
- map3.items.push({ start, key: fs40, sep: [] });
13550
+ map3.items.push({ start, key: fs41, sep: [] });
13551
13551
  this.onKeyLine = true;
13552
13552
  } else if (it2.sep) {
13553
- this.stack.push(fs40);
13553
+ this.stack.push(fs41);
13554
13554
  } else {
13555
- Object.assign(it2, { key: fs40, sep: [] });
13555
+ Object.assign(it2, { key: fs41, sep: [] });
13556
13556
  this.onKeyLine = true;
13557
13557
  }
13558
13558
  return;
@@ -13680,13 +13680,13 @@ var require_parser = __commonJS({
13680
13680
  case "scalar":
13681
13681
  case "single-quoted-scalar":
13682
13682
  case "double-quoted-scalar": {
13683
- const fs40 = this.flowScalar(this.type);
13683
+ const fs41 = this.flowScalar(this.type);
13684
13684
  if (!it2 || it2.value)
13685
- fc.items.push({ start: [], key: fs40, sep: [] });
13685
+ fc.items.push({ start: [], key: fs41, sep: [] });
13686
13686
  else if (it2.sep)
13687
- this.stack.push(fs40);
13687
+ this.stack.push(fs41);
13688
13688
  else
13689
- Object.assign(it2, { key: fs40, sep: [] });
13689
+ Object.assign(it2, { key: fs41, sep: [] });
13690
13690
  return;
13691
13691
  }
13692
13692
  case "flow-map-end":
@@ -14625,9 +14625,9 @@ var init_skill_DRd1jW7a = __esm({
14625
14625
  if (!(await Promise.all(entries2.map((entry) => writeSkillFiles(resolved, entry, baseDir)))).some(Boolean)) throw new Error(`Failed to fetch any skill files from well-known index at ${inputUrl}`);
14626
14626
  return baseDir;
14627
14627
  }, "fetchWellKnownSkills");
14628
- readJsonObjectIfExists = /* @__PURE__ */ __name(async (path43) => {
14628
+ readJsonObjectIfExists = /* @__PURE__ */ __name(async (path44) => {
14629
14629
  try {
14630
- const content2 = await readFile(path43, "utf-8");
14630
+ const content2 = await readFile(path44, "utf-8");
14631
14631
  const parsed = JSON.parse(content2);
14632
14632
  return isPlainObject2(parsed) ? parsed : null;
14633
14633
  } catch {
@@ -14822,16 +14822,16 @@ var init_skill_DRd1jW7a = __esm({
14822
14822
  if (isGlobal) return agent.globalSkillsDir ?? join2(baseDir, agent.skillsDir);
14823
14823
  return join2(baseDir, agent.skillsDir);
14824
14824
  }, "getSkillAgentBaseDir");
14825
- cleanAndCreateDirectory = /* @__PURE__ */ __name(async (path43) => {
14826
- await rm(path43, {
14825
+ cleanAndCreateDirectory = /* @__PURE__ */ __name(async (path44) => {
14826
+ await rm(path44, {
14827
14827
  recursive: true,
14828
14828
  force: true
14829
14829
  }).catch(() => void 0);
14830
- await mkdir(path43, { recursive: true });
14830
+ await mkdir(path44, { recursive: true });
14831
14831
  }, "cleanAndCreateDirectory");
14832
14832
  resolveSymlinkTarget = /* @__PURE__ */ __name((linkPath, linkTarget) => resolve(dirname(linkPath), linkTarget), "resolveSymlinkTarget");
14833
- resolveParentSymlinks = /* @__PURE__ */ __name(async (path43) => {
14834
- const resolved = resolve(path43);
14833
+ resolveParentSymlinks = /* @__PURE__ */ __name(async (path44) => {
14834
+ const resolved = resolve(path44);
14835
14835
  const parentDir = dirname(resolved);
14836
14836
  const name = basename(resolved);
14837
14837
  try {
@@ -18103,11 +18103,10 @@ function readReleaseMeta() {
18103
18103
  try {
18104
18104
  const raw = fs4.readFileSync(RELEASE_FILE2, "utf8");
18105
18105
  const parsed = JSON.parse(raw);
18106
- const id = typeof parsed.id === "string" && parsed.id.length > 0 ? parsed.id : null;
18107
- const source = parsed.source === "npm" || parsed.source === "url" || parsed.source === "dev" ? parsed.source : null;
18108
- return { id, source };
18106
+ const source = parsed.source === "npm" || parsed.source === "dev" ? parsed.source : null;
18107
+ return { source };
18109
18108
  } catch {
18110
- return { id: null, source: null };
18109
+ return { source: null };
18111
18110
  }
18112
18111
  }
18113
18112
  function readCliSemver() {
@@ -18127,9 +18126,6 @@ function computeFimoPin(meta, semver, options = {}) {
18127
18126
  return semver;
18128
18127
  }
18129
18128
  }
18130
- if (meta.id) {
18131
- return `${TARBALL_URL_BASE}/fimo-${meta.id}.tgz`;
18132
- }
18133
18129
  if ((meta.source === "dev" || meta.source === null) && options.devPackageRoot) {
18134
18130
  return `file:${options.devPackageRoot}`;
18135
18131
  }
@@ -18152,23 +18148,24 @@ function rewriteFimoDep(pkg, pin = resolveFimoPin()) {
18152
18148
  if (typeof current !== "string") {
18153
18149
  continue;
18154
18150
  }
18155
- const looksLikeFimoTarball = current.includes(`${TARBALL_URL_BASE}/fimo-`);
18151
+ const looksLikeLegacyR2 = current.includes("r2.dev/cli/fimo-");
18152
+ const looksLikeLocalFile = current.startsWith("file:");
18156
18153
  const looksLikeSemver = /^[\^~]?\d+\.\d+\.\d+/.test(current);
18157
- if ((looksLikeFimoTarball || looksLikeSemver) && current !== pin) {
18154
+ const looksLikeOwnedDistTag = current === "latest" || current === "staging" || current === "experimental";
18155
+ if ((looksLikeLegacyR2 || looksLikeLocalFile || looksLikeSemver || looksLikeOwnedDistTag) && current !== pin) {
18158
18156
  deps["fimo"] = pin;
18159
18157
  changed = true;
18160
18158
  }
18161
18159
  }
18162
18160
  return changed;
18163
18161
  }
18164
- var MODULE_DIR, PACKAGE_ROOT, RELEASE_FILE2, PACKAGE_JSON_FILE, TARBALL_URL_BASE, DEFAULT_TEMPLATE;
18162
+ var MODULE_DIR, PACKAGE_ROOT, RELEASE_FILE2, PACKAGE_JSON_FILE, DEFAULT_TEMPLATE;
18165
18163
  var init_templates = __esm({
18166
18164
  "src/runtime/templates.ts"() {
18167
18165
  MODULE_DIR = path3.dirname(fileURLToPath2(import.meta.url));
18168
18166
  PACKAGE_ROOT = path3.resolve(MODULE_DIR, "..", "..");
18169
18167
  RELEASE_FILE2 = path3.join(PACKAGE_ROOT, "release.json");
18170
18168
  PACKAGE_JSON_FILE = path3.join(PACKAGE_ROOT, "package.json");
18171
- TARBALL_URL_BASE = "https://pub-41cdea46386f4b238d8c528c4327dfc1.r2.dev/cli";
18172
18169
  DEFAULT_TEMPLATE = "react-router";
18173
18170
  __name(getTemplatePath, "getTemplatePath");
18174
18171
  __name(readReleaseMeta, "readReleaseMeta");
@@ -18369,7 +18366,7 @@ function detectAgentsInProject(cwd) {
18369
18366
  }
18370
18367
  return detected;
18371
18368
  }
18372
- var TEMPLATE_ROOT, AGENTS_STARTER_ROOT, AGENT_TEMPLATES_ROOT, RELEASE_FILE3, EXCLUDED_DIRS;
18369
+ var TEMPLATE_ROOT, AGENTS_STARTER_ROOT, AGENT_TEMPLATES_ROOT, EXCLUDED_DIRS;
18373
18370
  var init_scaffold = __esm({
18374
18371
  "src/cli/utils/scaffold.ts"() {
18375
18372
  init_templates();
@@ -18378,7 +18375,6 @@ var init_scaffold = __esm({
18378
18375
  TEMPLATE_ROOT = getTemplatePath("react-router");
18379
18376
  AGENTS_STARTER_ROOT = path4.resolve(CLI_ROOT, "assets", "agents-starter");
18380
18377
  AGENT_TEMPLATES_ROOT = path4.resolve(CLI_ROOT, "assets", "agent-templates");
18381
- RELEASE_FILE3 = path4.resolve(CLI_ROOT, "release.json");
18382
18378
  EXCLUDED_DIRS = /* @__PURE__ */ new Set(["node_modules", "dist", "build", ".turbo", ".git"]);
18383
18379
  __name(resolveTemplateRoot, "resolveTemplateRoot");
18384
18380
  __name(resolveAgentTemplatesRoot, "resolveAgentTemplatesRoot");
@@ -19615,11 +19611,11 @@ var init_api = __esm({
19615
19611
  method;
19616
19612
  path;
19617
19613
  detail;
19618
- constructor(method, path43, status, detail) {
19619
- super(`API ${method} ${path43} failed: ${status} ${detail}`);
19614
+ constructor(method, path44, status, detail) {
19615
+ super(`API ${method} ${path44} failed: ${status} ${detail}`);
19620
19616
  this.name = "ApiRequestError";
19621
19617
  this.method = method;
19622
- this.path = path43;
19618
+ this.path = path44;
19623
19619
  this.status = status;
19624
19620
  this.detail = detail;
19625
19621
  }
@@ -19695,7 +19691,7 @@ var init_api = __esm({
19695
19691
  resolveAuthToken() {
19696
19692
  return process.env.FIMO_API_TOKEN?.trim() || requireToken(this.cfg);
19697
19693
  }
19698
- async request(path43, init = {}, opts = {}) {
19694
+ async request(path44, init = {}, opts = {}) {
19699
19695
  const token = this.resolveAuthToken();
19700
19696
  const headers = new Headers(init.headers);
19701
19697
  headers.set("Authorization", `Bearer ${token}`);
@@ -19705,33 +19701,33 @@ var init_api = __esm({
19705
19701
  if (this.env && !headers.has(FIMO_ENV_HEADER)) {
19706
19702
  headers.set(FIMO_ENV_HEADER, this.env);
19707
19703
  }
19708
- const response = await fimoFetch(`${this.cfg.apiUrl}${path43}`, { ...init, headers });
19704
+ const response = await fimoFetch(`${this.cfg.apiUrl}${path44}`, { ...init, headers });
19709
19705
  if (response.status === 401 || response.status === 403 && !opts.allow403) {
19710
19706
  throwUnauthorized(this.cfg, response.status);
19711
19707
  }
19712
19708
  if (!response.ok) {
19713
19709
  const error45 = await this.formatError(response);
19714
- throw new ApiRequestError(init.method ?? "GET", path43, response.status, error45);
19710
+ throw new ApiRequestError(init.method ?? "GET", path44, response.status, error45);
19715
19711
  }
19716
19712
  if (response.status === 204) {
19717
19713
  return void 0;
19718
19714
  }
19719
19715
  return await response.json();
19720
19716
  }
19721
- async rawRequest(path43, init = {}) {
19717
+ async rawRequest(path44, init = {}) {
19722
19718
  const token = this.resolveAuthToken();
19723
19719
  const headers = new Headers(init.headers);
19724
19720
  headers.set("Authorization", `Bearer ${token}`);
19725
19721
  if (this.env && !headers.has(FIMO_ENV_HEADER)) {
19726
19722
  headers.set(FIMO_ENV_HEADER, this.env);
19727
19723
  }
19728
- const response = await fimoFetch(`${this.cfg.apiUrl}${path43}`, { ...init, headers });
19724
+ const response = await fimoFetch(`${this.cfg.apiUrl}${path44}`, { ...init, headers });
19729
19725
  if (response.status === 401 || response.status === 403) {
19730
19726
  throwUnauthorized(this.cfg, response.status);
19731
19727
  }
19732
19728
  if (!response.ok) {
19733
19729
  const error45 = await this.formatError(response);
19734
- throw new Error(`API ${init.method ?? "GET"} ${path43} failed: ${response.status} ${error45}`);
19730
+ throw new Error(`API ${init.method ?? "GET"} ${path44} failed: ${response.status} ${error45}`);
19735
19731
  }
19736
19732
  return response;
19737
19733
  }
@@ -20038,8 +20034,8 @@ var init_api = __esm({
20038
20034
  // ── Per-surface lazy-fetch (V3 §20.4) ────────────────────────────────
20039
20035
  // One method per surface — all share the same `(projectId, env, against?, …key)`
20040
20036
  // shape. The drill-in renderers in `utils/format/drill/*` consume these.
20041
- async getCodeFileDiff(projectId, env2, path43, opts = {}) {
20042
- const qs = lazyFetchQs(opts.against, { path: path43 });
20037
+ async getCodeFileDiff(projectId, env2, path44, opts = {}) {
20038
+ const qs = lazyFetchQs(opts.against, { path: path44 });
20043
20039
  const body = await this.request(
20044
20040
  `/api/management/projects/${projectId}/envs/${encodeURIComponent(env2)}/diff/code/file?${qs}`
20045
20041
  );
@@ -20047,38 +20043,38 @@ var init_api = __esm({
20047
20043
  }
20048
20044
  async getContentRowDiff(projectId, env2, collection, rowId, opts = {}) {
20049
20045
  const qs = lazyFetchQs(opts.against);
20050
- const path43 = `/api/management/projects/${projectId}/envs/${encodeURIComponent(env2)}/diff/content/${encodeURIComponent(collection)}/${encodeURIComponent(rowId)}`;
20051
- const body = await this.request(qs ? `${path43}?${qs}` : path43);
20046
+ const path44 = `/api/management/projects/${projectId}/envs/${encodeURIComponent(env2)}/diff/content/${encodeURIComponent(collection)}/${encodeURIComponent(rowId)}`;
20047
+ const body = await this.request(qs ? `${path44}?${qs}` : path44);
20052
20048
  return body.data;
20053
20049
  }
20054
20050
  async getSchemaTypeDiff(projectId, env2, typeName, opts = {}) {
20055
20051
  const qs = lazyFetchQs(opts.against);
20056
- const path43 = `/api/management/projects/${projectId}/envs/${encodeURIComponent(env2)}/diff/schemas/${encodeURIComponent(typeName)}`;
20057
- const body = await this.request(qs ? `${path43}?${qs}` : path43);
20052
+ const path44 = `/api/management/projects/${projectId}/envs/${encodeURIComponent(env2)}/diff/schemas/${encodeURIComponent(typeName)}`;
20053
+ const body = await this.request(qs ? `${path44}?${qs}` : path44);
20058
20054
  return body.data;
20059
20055
  }
20060
20056
  async getAssetDiff(projectId, env2, assetId, opts = {}) {
20061
20057
  const qs = lazyFetchQs(opts.against);
20062
- const path43 = `/api/management/projects/${projectId}/envs/${encodeURIComponent(env2)}/diff/assets/${encodeURIComponent(assetId)}`;
20063
- const body = await this.request(qs ? `${path43}?${qs}` : path43);
20058
+ const path44 = `/api/management/projects/${projectId}/envs/${encodeURIComponent(env2)}/diff/assets/${encodeURIComponent(assetId)}`;
20059
+ const body = await this.request(qs ? `${path44}?${qs}` : path44);
20064
20060
  return body.data;
20065
20061
  }
20066
20062
  async getTranslationRowDiff(projectId, env2, locale, key, opts = {}) {
20067
20063
  const qs = lazyFetchQs(opts.against);
20068
- const path43 = `/api/management/projects/${projectId}/envs/${encodeURIComponent(env2)}/diff/translations/${encodeURIComponent(locale)}/${encodeURIComponent(key)}`;
20069
- const body = await this.request(qs ? `${path43}?${qs}` : path43);
20064
+ const path44 = `/api/management/projects/${projectId}/envs/${encodeURIComponent(env2)}/diff/translations/${encodeURIComponent(locale)}/${encodeURIComponent(key)}`;
20065
+ const body = await this.request(qs ? `${path44}?${qs}` : path44);
20070
20066
  return body.data;
20071
20067
  }
20072
20068
  async getFormSchemaDiff(projectId, env2, formName, opts = {}) {
20073
20069
  const qs = lazyFetchQs(opts.against);
20074
- const path43 = `/api/management/projects/${projectId}/envs/${encodeURIComponent(env2)}/diff/forms/${encodeURIComponent(formName)}`;
20075
- const body = await this.request(qs ? `${path43}?${qs}` : path43);
20070
+ const path44 = `/api/management/projects/${projectId}/envs/${encodeURIComponent(env2)}/diff/forms/${encodeURIComponent(formName)}`;
20071
+ const body = await this.request(qs ? `${path44}?${qs}` : path44);
20076
20072
  return body.data;
20077
20073
  }
20078
20074
  async getActivationDiff(projectId, env2, agentName, triggerIndex, opts = {}) {
20079
20075
  const qs = lazyFetchQs(opts.against);
20080
- const path43 = `/api/management/projects/${projectId}/envs/${encodeURIComponent(env2)}/diff/activations/${encodeURIComponent(agentName)}/${triggerIndex}`;
20081
- const body = await this.request(qs ? `${path43}?${qs}` : path43);
20076
+ const path44 = `/api/management/projects/${projectId}/envs/${encodeURIComponent(env2)}/diff/activations/${encodeURIComponent(agentName)}/${triggerIndex}`;
20077
+ const body = await this.request(qs ? `${path44}?${qs}` : path44);
20082
20078
  return body.data;
20083
20079
  }
20084
20080
  /** Merge `from` → `env` via the M09 engine. */
@@ -20748,17 +20744,17 @@ var require_visit2 = __commonJS({
20748
20744
  visit2.BREAK = BREAK;
20749
20745
  visit2.SKIP = SKIP;
20750
20746
  visit2.REMOVE = REMOVE;
20751
- function visit_(key, node, visitor, path43) {
20752
- const ctrl = callVisitor(key, node, visitor, path43);
20747
+ function visit_(key, node, visitor, path44) {
20748
+ const ctrl = callVisitor(key, node, visitor, path44);
20753
20749
  if (identity2.isNode(ctrl) || identity2.isPair(ctrl)) {
20754
- replaceNode(key, path43, ctrl);
20755
- return visit_(key, ctrl, visitor, path43);
20750
+ replaceNode(key, path44, ctrl);
20751
+ return visit_(key, ctrl, visitor, path44);
20756
20752
  }
20757
20753
  if (typeof ctrl !== "symbol") {
20758
20754
  if (identity2.isCollection(node)) {
20759
- path43 = Object.freeze(path43.concat(node));
20755
+ path44 = Object.freeze(path44.concat(node));
20760
20756
  for (let i = 0; i < node.items.length; ++i) {
20761
- const ci = visit_(i, node.items[i], visitor, path43);
20757
+ const ci = visit_(i, node.items[i], visitor, path44);
20762
20758
  if (typeof ci === "number")
20763
20759
  i = ci - 1;
20764
20760
  else if (ci === BREAK)
@@ -20769,13 +20765,13 @@ var require_visit2 = __commonJS({
20769
20765
  }
20770
20766
  }
20771
20767
  } else if (identity2.isPair(node)) {
20772
- path43 = Object.freeze(path43.concat(node));
20773
- const ck = visit_("key", node.key, visitor, path43);
20768
+ path44 = Object.freeze(path44.concat(node));
20769
+ const ck = visit_("key", node.key, visitor, path44);
20774
20770
  if (ck === BREAK)
20775
20771
  return BREAK;
20776
20772
  else if (ck === REMOVE)
20777
20773
  node.key = null;
20778
- const cv = visit_("value", node.value, visitor, path43);
20774
+ const cv = visit_("value", node.value, visitor, path44);
20779
20775
  if (cv === BREAK)
20780
20776
  return BREAK;
20781
20777
  else if (cv === REMOVE)
@@ -20798,17 +20794,17 @@ var require_visit2 = __commonJS({
20798
20794
  visitAsync.BREAK = BREAK;
20799
20795
  visitAsync.SKIP = SKIP;
20800
20796
  visitAsync.REMOVE = REMOVE;
20801
- async function visitAsync_(key, node, visitor, path43) {
20802
- const ctrl = await callVisitor(key, node, visitor, path43);
20797
+ async function visitAsync_(key, node, visitor, path44) {
20798
+ const ctrl = await callVisitor(key, node, visitor, path44);
20803
20799
  if (identity2.isNode(ctrl) || identity2.isPair(ctrl)) {
20804
- replaceNode(key, path43, ctrl);
20805
- return visitAsync_(key, ctrl, visitor, path43);
20800
+ replaceNode(key, path44, ctrl);
20801
+ return visitAsync_(key, ctrl, visitor, path44);
20806
20802
  }
20807
20803
  if (typeof ctrl !== "symbol") {
20808
20804
  if (identity2.isCollection(node)) {
20809
- path43 = Object.freeze(path43.concat(node));
20805
+ path44 = Object.freeze(path44.concat(node));
20810
20806
  for (let i = 0; i < node.items.length; ++i) {
20811
- const ci = await visitAsync_(i, node.items[i], visitor, path43);
20807
+ const ci = await visitAsync_(i, node.items[i], visitor, path44);
20812
20808
  if (typeof ci === "number")
20813
20809
  i = ci - 1;
20814
20810
  else if (ci === BREAK)
@@ -20819,13 +20815,13 @@ var require_visit2 = __commonJS({
20819
20815
  }
20820
20816
  }
20821
20817
  } else if (identity2.isPair(node)) {
20822
- path43 = Object.freeze(path43.concat(node));
20823
- const ck = await visitAsync_("key", node.key, visitor, path43);
20818
+ path44 = Object.freeze(path44.concat(node));
20819
+ const ck = await visitAsync_("key", node.key, visitor, path44);
20824
20820
  if (ck === BREAK)
20825
20821
  return BREAK;
20826
20822
  else if (ck === REMOVE)
20827
20823
  node.key = null;
20828
- const cv = await visitAsync_("value", node.value, visitor, path43);
20824
+ const cv = await visitAsync_("value", node.value, visitor, path44);
20829
20825
  if (cv === BREAK)
20830
20826
  return BREAK;
20831
20827
  else if (cv === REMOVE)
@@ -20854,24 +20850,24 @@ var require_visit2 = __commonJS({
20854
20850
  return visitor;
20855
20851
  }
20856
20852
  __name(initVisitor, "initVisitor");
20857
- function callVisitor(key, node, visitor, path43) {
20853
+ function callVisitor(key, node, visitor, path44) {
20858
20854
  if (typeof visitor === "function")
20859
- return visitor(key, node, path43);
20855
+ return visitor(key, node, path44);
20860
20856
  if (identity2.isMap(node))
20861
- return visitor.Map?.(key, node, path43);
20857
+ return visitor.Map?.(key, node, path44);
20862
20858
  if (identity2.isSeq(node))
20863
- return visitor.Seq?.(key, node, path43);
20859
+ return visitor.Seq?.(key, node, path44);
20864
20860
  if (identity2.isPair(node))
20865
- return visitor.Pair?.(key, node, path43);
20861
+ return visitor.Pair?.(key, node, path44);
20866
20862
  if (identity2.isScalar(node))
20867
- return visitor.Scalar?.(key, node, path43);
20863
+ return visitor.Scalar?.(key, node, path44);
20868
20864
  if (identity2.isAlias(node))
20869
- return visitor.Alias?.(key, node, path43);
20865
+ return visitor.Alias?.(key, node, path44);
20870
20866
  return void 0;
20871
20867
  }
20872
20868
  __name(callVisitor, "callVisitor");
20873
- function replaceNode(key, path43, node) {
20874
- const parent2 = path43[path43.length - 1];
20869
+ function replaceNode(key, path44, node) {
20870
+ const parent2 = path44[path44.length - 1];
20875
20871
  if (identity2.isCollection(parent2)) {
20876
20872
  parent2.items[key] = node;
20877
20873
  } else if (identity2.isPair(parent2)) {
@@ -21501,10 +21497,10 @@ var require_Collection2 = __commonJS({
21501
21497
  var createNode = require_createNode2();
21502
21498
  var identity2 = require_identity2();
21503
21499
  var Node2 = require_Node2();
21504
- function collectionFromPath(schema, path43, value) {
21500
+ function collectionFromPath(schema, path44, value) {
21505
21501
  let v = value;
21506
- for (let i = path43.length - 1; i >= 0; --i) {
21507
- const k = path43[i];
21502
+ for (let i = path44.length - 1; i >= 0; --i) {
21503
+ const k = path44[i];
21508
21504
  if (typeof k === "number" && Number.isInteger(k) && k >= 0) {
21509
21505
  const a = [];
21510
21506
  a[k] = v;
@@ -21524,7 +21520,7 @@ var require_Collection2 = __commonJS({
21524
21520
  });
21525
21521
  }
21526
21522
  __name(collectionFromPath, "collectionFromPath");
21527
- var isEmptyPath = /* @__PURE__ */ __name((path43) => path43 == null || typeof path43 === "object" && !!path43[Symbol.iterator]().next().done, "isEmptyPath");
21523
+ var isEmptyPath = /* @__PURE__ */ __name((path44) => path44 == null || typeof path44 === "object" && !!path44[Symbol.iterator]().next().done, "isEmptyPath");
21528
21524
  var Collection = class extends Node2.NodeBase {
21529
21525
  static {
21530
21526
  __name(this, "Collection");
@@ -21557,11 +21553,11 @@ var require_Collection2 = __commonJS({
21557
21553
  * be a Pair instance or a `{ key, value }` object, which may not have a key
21558
21554
  * that already exists in the map.
21559
21555
  */
21560
- addIn(path43, value) {
21561
- if (isEmptyPath(path43))
21556
+ addIn(path44, value) {
21557
+ if (isEmptyPath(path44))
21562
21558
  this.add(value);
21563
21559
  else {
21564
- const [key, ...rest] = path43;
21560
+ const [key, ...rest] = path44;
21565
21561
  const node = this.get(key, true);
21566
21562
  if (identity2.isCollection(node))
21567
21563
  node.addIn(rest, value);
@@ -21575,8 +21571,8 @@ var require_Collection2 = __commonJS({
21575
21571
  * Removes a value from the collection.
21576
21572
  * @returns `true` if the item was found and removed.
21577
21573
  */
21578
- deleteIn(path43) {
21579
- const [key, ...rest] = path43;
21574
+ deleteIn(path44) {
21575
+ const [key, ...rest] = path44;
21580
21576
  if (rest.length === 0)
21581
21577
  return this.delete(key);
21582
21578
  const node = this.get(key, true);
@@ -21590,8 +21586,8 @@ var require_Collection2 = __commonJS({
21590
21586
  * scalar values from their surrounding node; to disable set `keepScalar` to
21591
21587
  * `true` (collections are always returned intact).
21592
21588
  */
21593
- getIn(path43, keepScalar) {
21594
- const [key, ...rest] = path43;
21589
+ getIn(path44, keepScalar) {
21590
+ const [key, ...rest] = path44;
21595
21591
  const node = this.get(key, true);
21596
21592
  if (rest.length === 0)
21597
21593
  return !keepScalar && identity2.isScalar(node) ? node.value : node;
@@ -21609,8 +21605,8 @@ var require_Collection2 = __commonJS({
21609
21605
  /**
21610
21606
  * Checks if the collection includes a value with the key `key`.
21611
21607
  */
21612
- hasIn(path43) {
21613
- const [key, ...rest] = path43;
21608
+ hasIn(path44) {
21609
+ const [key, ...rest] = path44;
21614
21610
  if (rest.length === 0)
21615
21611
  return this.has(key);
21616
21612
  const node = this.get(key, true);
@@ -21620,8 +21616,8 @@ var require_Collection2 = __commonJS({
21620
21616
  * Sets a value in this collection. For `!!set`, `value` needs to be a
21621
21617
  * boolean to add/remove the item from the set.
21622
21618
  */
21623
- setIn(path43, value) {
21624
- const [key, ...rest] = path43;
21619
+ setIn(path44, value) {
21620
+ const [key, ...rest] = path44;
21625
21621
  if (rest.length === 0) {
21626
21622
  this.set(key, value);
21627
21623
  } else {
@@ -24186,9 +24182,9 @@ var require_Document2 = __commonJS({
24186
24182
  this.contents.add(value);
24187
24183
  }
24188
24184
  /** Adds a value to the document. */
24189
- addIn(path43, value) {
24185
+ addIn(path44, value) {
24190
24186
  if (assertCollection(this.contents))
24191
- this.contents.addIn(path43, value);
24187
+ this.contents.addIn(path44, value);
24192
24188
  }
24193
24189
  /**
24194
24190
  * Create a new `Alias` node, ensuring that the target `node` has the required anchor.
@@ -24263,14 +24259,14 @@ var require_Document2 = __commonJS({
24263
24259
  * Removes a value from the document.
24264
24260
  * @returns `true` if the item was found and removed.
24265
24261
  */
24266
- deleteIn(path43) {
24267
- if (Collection.isEmptyPath(path43)) {
24262
+ deleteIn(path44) {
24263
+ if (Collection.isEmptyPath(path44)) {
24268
24264
  if (this.contents == null)
24269
24265
  return false;
24270
24266
  this.contents = null;
24271
24267
  return true;
24272
24268
  }
24273
- return assertCollection(this.contents) ? this.contents.deleteIn(path43) : false;
24269
+ return assertCollection(this.contents) ? this.contents.deleteIn(path44) : false;
24274
24270
  }
24275
24271
  /**
24276
24272
  * Returns item at `key`, or `undefined` if not found. By default unwraps
@@ -24285,10 +24281,10 @@ var require_Document2 = __commonJS({
24285
24281
  * scalar values from their surrounding node; to disable set `keepScalar` to
24286
24282
  * `true` (collections are always returned intact).
24287
24283
  */
24288
- getIn(path43, keepScalar) {
24289
- if (Collection.isEmptyPath(path43))
24284
+ getIn(path44, keepScalar) {
24285
+ if (Collection.isEmptyPath(path44))
24290
24286
  return !keepScalar && identity2.isScalar(this.contents) ? this.contents.value : this.contents;
24291
- return identity2.isCollection(this.contents) ? this.contents.getIn(path43, keepScalar) : void 0;
24287
+ return identity2.isCollection(this.contents) ? this.contents.getIn(path44, keepScalar) : void 0;
24292
24288
  }
24293
24289
  /**
24294
24290
  * Checks if the document includes a value with the key `key`.
@@ -24299,10 +24295,10 @@ var require_Document2 = __commonJS({
24299
24295
  /**
24300
24296
  * Checks if the document includes a value at `path`.
24301
24297
  */
24302
- hasIn(path43) {
24303
- if (Collection.isEmptyPath(path43))
24298
+ hasIn(path44) {
24299
+ if (Collection.isEmptyPath(path44))
24304
24300
  return this.contents !== void 0;
24305
- return identity2.isCollection(this.contents) ? this.contents.hasIn(path43) : false;
24301
+ return identity2.isCollection(this.contents) ? this.contents.hasIn(path44) : false;
24306
24302
  }
24307
24303
  /**
24308
24304
  * Sets a value in this document. For `!!set`, `value` needs to be a
@@ -24319,13 +24315,13 @@ var require_Document2 = __commonJS({
24319
24315
  * Sets a value in this document. For `!!set`, `value` needs to be a
24320
24316
  * boolean to add/remove the item from the set.
24321
24317
  */
24322
- setIn(path43, value) {
24323
- if (Collection.isEmptyPath(path43)) {
24318
+ setIn(path44, value) {
24319
+ if (Collection.isEmptyPath(path44)) {
24324
24320
  this.contents = value;
24325
24321
  } else if (this.contents == null) {
24326
- this.contents = Collection.collectionFromPath(this.schema, Array.from(path43), value);
24322
+ this.contents = Collection.collectionFromPath(this.schema, Array.from(path44), value);
24327
24323
  } else if (assertCollection(this.contents)) {
24328
- this.contents.setIn(path43, value);
24324
+ this.contents.setIn(path44, value);
24329
24325
  }
24330
24326
  }
24331
24327
  /**
@@ -26329,9 +26325,9 @@ var require_cst_visit2 = __commonJS({
26329
26325
  visit2.BREAK = BREAK;
26330
26326
  visit2.SKIP = SKIP;
26331
26327
  visit2.REMOVE = REMOVE;
26332
- visit2.itemAtPath = (cst, path43) => {
26328
+ visit2.itemAtPath = (cst, path44) => {
26333
26329
  let item = cst;
26334
- for (const [field, index2] of path43) {
26330
+ for (const [field, index2] of path44) {
26335
26331
  const tok = item?.[field];
26336
26332
  if (tok && "items" in tok) {
26337
26333
  item = tok.items[index2];
@@ -26340,23 +26336,23 @@ var require_cst_visit2 = __commonJS({
26340
26336
  }
26341
26337
  return item;
26342
26338
  };
26343
- visit2.parentCollection = (cst, path43) => {
26344
- const parent2 = visit2.itemAtPath(cst, path43.slice(0, -1));
26345
- const field = path43[path43.length - 1][0];
26339
+ visit2.parentCollection = (cst, path44) => {
26340
+ const parent2 = visit2.itemAtPath(cst, path44.slice(0, -1));
26341
+ const field = path44[path44.length - 1][0];
26346
26342
  const coll = parent2?.[field];
26347
26343
  if (coll && "items" in coll)
26348
26344
  return coll;
26349
26345
  throw new Error("Parent collection not found");
26350
26346
  };
26351
- function _visit(path43, item, visitor) {
26352
- let ctrl = visitor(item, path43);
26347
+ function _visit(path44, item, visitor) {
26348
+ let ctrl = visitor(item, path44);
26353
26349
  if (typeof ctrl === "symbol")
26354
26350
  return ctrl;
26355
26351
  for (const field of ["key", "value"]) {
26356
26352
  const token = item[field];
26357
26353
  if (token && "items" in token) {
26358
26354
  for (let i = 0; i < token.items.length; ++i) {
26359
- const ci = _visit(Object.freeze(path43.concat([[field, i]])), token.items[i], visitor);
26355
+ const ci = _visit(Object.freeze(path44.concat([[field, i]])), token.items[i], visitor);
26360
26356
  if (typeof ci === "number")
26361
26357
  i = ci - 1;
26362
26358
  else if (ci === BREAK)
@@ -26367,10 +26363,10 @@ var require_cst_visit2 = __commonJS({
26367
26363
  }
26368
26364
  }
26369
26365
  if (typeof ctrl === "function" && field === "key")
26370
- ctrl = ctrl(item, path43);
26366
+ ctrl = ctrl(item, path44);
26371
26367
  }
26372
26368
  }
26373
- return typeof ctrl === "function" ? ctrl(item, path43) : ctrl;
26369
+ return typeof ctrl === "function" ? ctrl(item, path44) : ctrl;
26374
26370
  }
26375
26371
  __name(_visit, "_visit");
26376
26372
  exports2.visit = visit2;
@@ -27674,14 +27670,14 @@ var require_parser3 = __commonJS({
27674
27670
  case "scalar":
27675
27671
  case "single-quoted-scalar":
27676
27672
  case "double-quoted-scalar": {
27677
- const fs40 = this.flowScalar(this.type);
27673
+ const fs41 = this.flowScalar(this.type);
27678
27674
  if (atNextItem || it2.value) {
27679
- map3.items.push({ start, key: fs40, sep: [] });
27675
+ map3.items.push({ start, key: fs41, sep: [] });
27680
27676
  this.onKeyLine = true;
27681
27677
  } else if (it2.sep) {
27682
- this.stack.push(fs40);
27678
+ this.stack.push(fs41);
27683
27679
  } else {
27684
- Object.assign(it2, { key: fs40, sep: [] });
27680
+ Object.assign(it2, { key: fs41, sep: [] });
27685
27681
  this.onKeyLine = true;
27686
27682
  }
27687
27683
  return;
@@ -27809,13 +27805,13 @@ var require_parser3 = __commonJS({
27809
27805
  case "scalar":
27810
27806
  case "single-quoted-scalar":
27811
27807
  case "double-quoted-scalar": {
27812
- const fs40 = this.flowScalar(this.type);
27808
+ const fs41 = this.flowScalar(this.type);
27813
27809
  if (!it2 || it2.value)
27814
- fc.items.push({ start: [], key: fs40, sep: [] });
27810
+ fc.items.push({ start: [], key: fs41, sep: [] });
27815
27811
  else if (it2.sep)
27816
- this.stack.push(fs40);
27812
+ this.stack.push(fs41);
27817
27813
  else
27818
- Object.assign(it2, { key: fs40, sep: [] });
27814
+ Object.assign(it2, { key: fs41, sep: [] });
27819
27815
  return;
27820
27816
  }
27821
27817
  case "flow-map-end":
@@ -28382,10 +28378,10 @@ function mergeDefs(...defs) {
28382
28378
  function cloneDef(schema) {
28383
28379
  return mergeDefs(schema._zod.def);
28384
28380
  }
28385
- function getElementAtPath(obj, path43) {
28386
- if (!path43)
28381
+ function getElementAtPath(obj, path44) {
28382
+ if (!path44)
28387
28383
  return obj;
28388
- return path43.reduce((acc, key) => acc?.[key], obj);
28384
+ return path44.reduce((acc, key) => acc?.[key], obj);
28389
28385
  }
28390
28386
  function promiseAllObject(promisesObj) {
28391
28387
  const keys = Object.keys(promisesObj);
@@ -28675,11 +28671,11 @@ function aborted(x, startIndex = 0) {
28675
28671
  }
28676
28672
  return false;
28677
28673
  }
28678
- function prefixIssues(path43, issues) {
28674
+ function prefixIssues(path44, issues) {
28679
28675
  return issues.map((iss) => {
28680
28676
  var _a5;
28681
28677
  (_a5 = iss).path ?? (_a5.path = []);
28682
- iss.path.unshift(path43);
28678
+ iss.path.unshift(path44);
28683
28679
  return iss;
28684
28680
  });
28685
28681
  }
@@ -28961,7 +28957,7 @@ function treeifyError(error45, _mapper) {
28961
28957
  return issue2.message;
28962
28958
  };
28963
28959
  const result = { errors: [] };
28964
- const processError = /* @__PURE__ */ __name((error46, path43 = []) => {
28960
+ const processError = /* @__PURE__ */ __name((error46, path44 = []) => {
28965
28961
  var _a5, _b;
28966
28962
  for (const issue2 of error46.issues) {
28967
28963
  if (issue2.code === "invalid_union" && issue2.errors.length) {
@@ -28971,7 +28967,7 @@ function treeifyError(error45, _mapper) {
28971
28967
  } else if (issue2.code === "invalid_element") {
28972
28968
  processError({ issues: issue2.issues }, issue2.path);
28973
28969
  } else {
28974
- const fullpath = [...path43, ...issue2.path];
28970
+ const fullpath = [...path44, ...issue2.path];
28975
28971
  if (fullpath.length === 0) {
28976
28972
  result.errors.push(mapper(issue2));
28977
28973
  continue;
@@ -29003,8 +28999,8 @@ function treeifyError(error45, _mapper) {
29003
28999
  }
29004
29000
  function toDotPath(_path) {
29005
29001
  const segs = [];
29006
- const path43 = _path.map((seg) => typeof seg === "object" ? seg.key : seg);
29007
- for (const seg of path43) {
29002
+ const path44 = _path.map((seg) => typeof seg === "object" ? seg.key : seg);
29003
+ for (const seg of path44) {
29008
29004
  if (typeof seg === "number")
29009
29005
  segs.push(`[${seg}]`);
29010
29006
  else if (typeof seg === "symbol")
@@ -45657,10 +45653,12 @@ ${failure.stderr || ""}`.trim()
45657
45653
  }
45658
45654
  let installedDeps = false;
45659
45655
  let installError = null;
45656
+ const installArgs = installArgsForPackageManager(packageManager);
45657
+ const installCommand2 = formatPackageManagerCommand(packageManager, installArgs);
45660
45658
  if (installDeps) {
45661
- const installSp = spinner(`Installing dependencies (${packageManager} install)`);
45659
+ const installSp = spinner(`Installing dependencies (${installCommand2})`);
45662
45660
  try {
45663
- await execFileAsync3(packageManager, ["install"], { cwd: targetDir });
45661
+ await execFileAsync3(packageManager, installArgs, { cwd: targetDir });
45664
45662
  installSp.succeed("Dependencies installed");
45665
45663
  installedDeps = true;
45666
45664
  } catch (error45) {
@@ -45671,7 +45669,7 @@ ${failure.stderr || ""}`.trim()
45671
45669
  const relativeTarget = path22.relative(process.cwd(), targetDir) || ".";
45672
45670
  const setupSteps = [`cd ${relativeTarget}`];
45673
45671
  if (!installDeps) {
45674
- setupSteps.push(`${packageManager} install`);
45672
+ setupSteps.push(installCommand2);
45675
45673
  }
45676
45674
  if (isPretty()) {
45677
45675
  wt(setupSteps.join("\n"), "Get set up");
@@ -45736,6 +45734,15 @@ Aborted. Deleting project ${projectName}\u2026
45736
45734
  process.off("SIGINT", handler);
45737
45735
  };
45738
45736
  }
45737
+ function installArgsForPackageManager(packageManager) {
45738
+ if (packageManager === "pnpm") {
45739
+ return ["install", "--config.dangerouslyAllowAllBuilds=true"];
45740
+ }
45741
+ return ["install"];
45742
+ }
45743
+ function formatPackageManagerCommand(packageManager, args) {
45744
+ return [packageManager, ...args].join(" ");
45745
+ }
45739
45746
  function detectPackageManager() {
45740
45747
  if (isCommandAvailable("pnpm")) {
45741
45748
  return "pnpm";
@@ -45820,6 +45827,8 @@ var init_create = __esm({
45820
45827
  __name(explainCreateProjectError, "explainCreateProjectError");
45821
45828
  __name(runPostCreation, "runPostCreation");
45822
45829
  __name(installAbortHandler, "installAbortHandler");
45830
+ __name(installArgsForPackageManager, "installArgsForPackageManager");
45831
+ __name(formatPackageManagerCommand, "formatPackageManagerCommand");
45823
45832
  __name(detectPackageManager, "detectPackageManager");
45824
45833
  __name(isCommandAvailable, "isCommandAvailable");
45825
45834
  __name(resolveOrganization, "resolveOrganization");
@@ -46039,8 +46048,8 @@ var init_dist8 = __esm({
46039
46048
  });
46040
46049
 
46041
46050
  // ../../node_modules/.pnpm/eta@3.5.0/node_modules/eta/dist/eta.module.mjs
46042
- import * as path23 from "node:path";
46043
- import * as fs19 from "node:fs";
46051
+ import * as path24 from "node:path";
46052
+ import * as fs20 from "node:fs";
46044
46053
  function ParseErr(message, str, indx) {
46045
46054
  const whitespace2 = str.slice(0, indx).split(/\n/);
46046
46055
  const lineNo = whitespace2.length;
@@ -46048,11 +46057,11 @@ function ParseErr(message, str, indx) {
46048
46057
  message += " at line " + lineNo + " col " + colNo + ":\n\n " + str.split(/\n/)[lineNo - 1] + "\n " + Array(colNo).join(" ") + "^";
46049
46058
  throw new EtaParseError(message);
46050
46059
  }
46051
- function RuntimeErr(originalError, str, lineNo, path43) {
46060
+ function RuntimeErr(originalError, str, lineNo, path44) {
46052
46061
  const lines = str.split("\n");
46053
46062
  const start = Math.max(lineNo - 3, 0);
46054
46063
  const end2 = Math.min(lines.length, lineNo + 3);
46055
- const filename = path43;
46064
+ const filename = path44;
46056
46065
  const context = lines.slice(start, end2).map(function(line, i) {
46057
46066
  const curr = i + start + 1;
46058
46067
  return (curr == lineNo ? " >> " : " ") + curr + "| " + line;
@@ -46383,13 +46392,13 @@ function renderStringAsync(template, data2) {
46383
46392
  });
46384
46393
  return renderAsync.call(this, templateFn, data2);
46385
46394
  }
46386
- function readFile2(path43) {
46395
+ function readFile2(path44) {
46387
46396
  let res = "";
46388
46397
  try {
46389
- res = fs19.readFileSync(path43, "utf8");
46398
+ res = fs20.readFileSync(path44, "utf8");
46390
46399
  } catch (err) {
46391
46400
  if ((err == null ? void 0 : err.code) === "ENOENT") {
46392
- throw new EtaFileResolutionError(`Could not find template: ${path43}`);
46401
+ throw new EtaFileResolutionError(`Could not find template: ${path44}`);
46393
46402
  } else {
46394
46403
  throw err;
46395
46404
  }
@@ -46409,7 +46418,7 @@ function resolvePath2(templatePath, options) {
46409
46418
  path: templatePath,
46410
46419
  views: this.config.views
46411
46420
  });
46412
- templatePath += path23.extname(templatePath) ? "" : defaultExtension;
46421
+ templatePath += path24.extname(templatePath) ? "" : defaultExtension;
46413
46422
  if (baseFilePath) {
46414
46423
  if (this.config.cacheFilepaths && this.filepathCache[cacheIndex]) {
46415
46424
  return this.filepathCache[cacheIndex];
@@ -46417,12 +46426,12 @@ function resolvePath2(templatePath, options) {
46417
46426
  const absolutePathTest = absolutePathRegExp.exec(templatePath);
46418
46427
  if (absolutePathTest && absolutePathTest.length) {
46419
46428
  const formattedPath = templatePath.replace(/^\/*|^\\*/, "");
46420
- resolvedFilePath = path23.join(views, formattedPath);
46429
+ resolvedFilePath = path24.join(views, formattedPath);
46421
46430
  } else {
46422
- resolvedFilePath = path23.join(path23.dirname(baseFilePath), templatePath);
46431
+ resolvedFilePath = path24.join(path24.dirname(baseFilePath), templatePath);
46423
46432
  }
46424
46433
  } else {
46425
- resolvedFilePath = path23.join(views, templatePath);
46434
+ resolvedFilePath = path24.join(views, templatePath);
46426
46435
  }
46427
46436
  if (dirIsChild(views, resolvedFilePath)) {
46428
46437
  if (baseFilePath && this.config.cacheFilepaths) {
@@ -46434,8 +46443,8 @@ function resolvePath2(templatePath, options) {
46434
46443
  }
46435
46444
  }
46436
46445
  function dirIsChild(parent2, dir) {
46437
- const relative3 = path23.relative(parent2, dir);
46438
- return relative3 && !relative3.startsWith("..") && !path23.isAbsolute(relative3);
46446
+ const relative3 = path24.relative(parent2, dir);
46447
+ return relative3 && !relative3.startsWith("..") && !path24.isAbsolute(relative3);
46439
46448
  }
46440
46449
  var Cacher, EtaError, EtaParseError, EtaRuntimeError, EtaFileResolutionError, EtaNameResolutionError, AsyncFunction, escMap, defaultConfig, templateLitReg, singleQuoteReg, doubleQuoteReg, Eta$1, absolutePathRegExp, Eta;
46441
46450
  var init_eta_module = __esm({
@@ -46666,9 +46675,9 @@ function getFormFiles(formsDir) {
46666
46675
  }
46667
46676
  return readdirSync2(formsDir).filter((f) => f.endsWith(".json")).map((f) => join7(formsDir, f));
46668
46677
  }
46669
- function readForm(path43) {
46678
+ function readForm(path44) {
46670
46679
  try {
46671
- return JSON.parse(readFileSync4(path43, "utf-8"));
46680
+ return JSON.parse(readFileSync4(path44, "utf-8"));
46672
46681
  } catch {
46673
46682
  return null;
46674
46683
  }
@@ -46787,9 +46796,9 @@ function getSchemaFiles(schemasDir) {
46787
46796
  }
46788
46797
  return readdirSync3(schemasDir).filter((f) => f.endsWith(".json")).map((f) => join8(schemasDir, f));
46789
46798
  }
46790
- function readSchema(path43) {
46799
+ function readSchema(path44) {
46791
46800
  try {
46792
- return JSON.parse(readFileSync5(path43, "utf-8"));
46801
+ return JSON.parse(readFileSync5(path44, "utf-8"));
46793
46802
  } catch {
46794
46803
  return null;
46795
46804
  }
@@ -68310,14 +68319,14 @@ var require_util = __commonJS({
68310
68319
  }
68311
68320
  const port = url2.port != null ? url2.port : url2.protocol === "https:" ? 443 : 80;
68312
68321
  let origin = url2.origin != null ? url2.origin : `${url2.protocol || ""}//${url2.hostname || ""}:${port}`;
68313
- let path43 = url2.path != null ? url2.path : `${url2.pathname || ""}${url2.search || ""}`;
68322
+ let path44 = url2.path != null ? url2.path : `${url2.pathname || ""}${url2.search || ""}`;
68314
68323
  if (origin[origin.length - 1] === "/") {
68315
68324
  origin = origin.slice(0, origin.length - 1);
68316
68325
  }
68317
- if (path43 && path43[0] !== "/") {
68318
- path43 = `/${path43}`;
68326
+ if (path44 && path44[0] !== "/") {
68327
+ path44 = `/${path44}`;
68319
68328
  }
68320
- return new URL(`${origin}${path43}`);
68329
+ return new URL(`${origin}${path44}`);
68321
68330
  }
68322
68331
  if (!isHttpOrHttpsPrefixed(url2.origin || url2.protocol)) {
68323
68332
  throw new InvalidArgumentError2("Invalid URL protocol: the URL must start with `http:` or `https:`.");
@@ -69177,9 +69186,9 @@ var require_diagnostics = __commonJS({
69177
69186
  "undici:client:sendHeaders",
69178
69187
  (evt) => {
69179
69188
  const {
69180
- request: { method, path: path43, origin }
69189
+ request: { method, path: path44, origin }
69181
69190
  } = evt;
69182
- debugLog("sending request to %s %s%s", method, origin, path43);
69191
+ debugLog("sending request to %s %s%s", method, origin, path44);
69183
69192
  }
69184
69193
  );
69185
69194
  }
@@ -69198,14 +69207,14 @@ var require_diagnostics = __commonJS({
69198
69207
  "undici:request:headers",
69199
69208
  (evt) => {
69200
69209
  const {
69201
- request: { method, path: path43, origin },
69210
+ request: { method, path: path44, origin },
69202
69211
  response: { statusCode }
69203
69212
  } = evt;
69204
69213
  debugLog(
69205
69214
  "received response to %s %s%s - HTTP %d",
69206
69215
  method,
69207
69216
  origin,
69208
- path43,
69217
+ path44,
69209
69218
  statusCode
69210
69219
  );
69211
69220
  }
@@ -69214,23 +69223,23 @@ var require_diagnostics = __commonJS({
69214
69223
  "undici:request:trailers",
69215
69224
  (evt) => {
69216
69225
  const {
69217
- request: { method, path: path43, origin }
69226
+ request: { method, path: path44, origin }
69218
69227
  } = evt;
69219
- debugLog("trailers received from %s %s%s", method, origin, path43);
69228
+ debugLog("trailers received from %s %s%s", method, origin, path44);
69220
69229
  }
69221
69230
  );
69222
69231
  diagnosticsChannel.subscribe(
69223
69232
  "undici:request:error",
69224
69233
  (evt) => {
69225
69234
  const {
69226
- request: { method, path: path43, origin },
69235
+ request: { method, path: path44, origin },
69227
69236
  error: error45
69228
69237
  } = evt;
69229
69238
  debugLog(
69230
69239
  "request to %s %s%s errored - %s",
69231
69240
  method,
69232
69241
  origin,
69233
- path43,
69242
+ path44,
69234
69243
  error45.message
69235
69244
  );
69236
69245
  }
@@ -69338,7 +69347,7 @@ var require_request = __commonJS({
69338
69347
  __name(this, "Request");
69339
69348
  }
69340
69349
  constructor(origin, {
69341
- path: path43,
69350
+ path: path44,
69342
69351
  method,
69343
69352
  body,
69344
69353
  headers,
@@ -69355,11 +69364,11 @@ var require_request = __commonJS({
69355
69364
  maxRedirections,
69356
69365
  typeOfService
69357
69366
  }, handler) {
69358
- if (typeof path43 !== "string") {
69367
+ if (typeof path44 !== "string") {
69359
69368
  throw new InvalidArgumentError2("path must be a string");
69360
- } else if (path43[0] !== "/" && !(path43.startsWith("http://") || path43.startsWith("https://")) && method !== "CONNECT") {
69369
+ } else if (path44[0] !== "/" && !(path44.startsWith("http://") || path44.startsWith("https://")) && method !== "CONNECT") {
69361
69370
  throw new InvalidArgumentError2("path must be an absolute URL or start with a slash");
69362
- } else if (invalidPathRegex.test(path43)) {
69371
+ } else if (invalidPathRegex.test(path44)) {
69363
69372
  throw new InvalidArgumentError2("invalid request path");
69364
69373
  }
69365
69374
  if (typeof method !== "string") {
@@ -69434,7 +69443,7 @@ var require_request = __commonJS({
69434
69443
  this.completed = false;
69435
69444
  this.aborted = false;
69436
69445
  this.upgrade = upgrade || null;
69437
- this.path = query ? serializePathWithQuery(path43, query) : path43;
69446
+ this.path = query ? serializePathWithQuery(path44, query) : path44;
69438
69447
  this.origin = origin;
69439
69448
  this.protocol = getProtocolFromUrlString(origin);
69440
69449
  this.idempotent = idempotent == null ? method === "HEAD" || method === "GET" : idempotent;
@@ -74626,7 +74635,7 @@ var require_client_h1 = __commonJS({
74626
74635
  }
74627
74636
  __name(shouldSendContentLength, "shouldSendContentLength");
74628
74637
  function writeH1(client, request) {
74629
- const { method, path: path43, host, upgrade, blocking, reset } = request;
74638
+ const { method, path: path44, host, upgrade, blocking, reset } = request;
74630
74639
  let { body, headers, contentLength } = request;
74631
74640
  const expectsPayload = method === "PUT" || method === "POST" || method === "PATCH" || method === "QUERY" || method === "PROPFIND" || method === "PROPPATCH";
74632
74641
  if (util.isFormDataLike(body)) {
@@ -74695,7 +74704,7 @@ var require_client_h1 = __commonJS({
74695
74704
  if (socket.setTypeOfService) {
74696
74705
  socket.setTypeOfService(request.typeOfService);
74697
74706
  }
74698
- let header = `${method} ${path43} HTTP/1.1\r
74707
+ let header = `${method} ${path44} HTTP/1.1\r
74699
74708
  `;
74700
74709
  if (typeof host === "string") {
74701
74710
  header += `host: ${host}\r
@@ -75374,7 +75383,7 @@ var require_client_h2 = __commonJS({
75374
75383
  function writeH2(client, request) {
75375
75384
  const requestTimeout = request.bodyTimeout ?? client[kBodyTimeout];
75376
75385
  const session = client[kHTTP2Session];
75377
- const { method, path: path43, host, upgrade, expectContinue, signal, protocol, headers: reqHeaders } = request;
75386
+ const { method, path: path44, host, upgrade, expectContinue, signal, protocol, headers: reqHeaders } = request;
75378
75387
  let { body } = request;
75379
75388
  if (upgrade != null && upgrade !== "websocket") {
75380
75389
  util.errorRequest(client, request, new InvalidArgumentError2(`Custom upgrade "${upgrade}" not supported over HTTP/2`));
@@ -75442,7 +75451,7 @@ var require_client_h2 = __commonJS({
75442
75451
  }
75443
75452
  headers[HTTP2_HEADER_METHOD] = "CONNECT";
75444
75453
  headers[HTTP2_HEADER_PROTOCOL] = "websocket";
75445
- headers[HTTP2_HEADER_PATH] = path43;
75454
+ headers[HTTP2_HEADER_PATH] = path44;
75446
75455
  if (protocol === "ws:" || protocol === "wss:") {
75447
75456
  headers[HTTP2_HEADER_SCHEME] = protocol === "ws:" ? "http" : "https";
75448
75457
  } else {
@@ -75483,7 +75492,7 @@ var require_client_h2 = __commonJS({
75483
75492
  stream.setTimeout(requestTimeout);
75484
75493
  return true;
75485
75494
  }
75486
- headers[HTTP2_HEADER_PATH] = path43;
75495
+ headers[HTTP2_HEADER_PATH] = path44;
75487
75496
  headers[HTTP2_HEADER_SCHEME] = protocol === "http:" ? "http" : "https";
75488
75497
  const expectsPayload = method === "PUT" || method === "POST" || method === "PATCH";
75489
75498
  if (body && typeof body.read === "function") {
@@ -77846,10 +77855,10 @@ var require_proxy_agent = __commonJS({
77846
77855
  };
77847
77856
  const {
77848
77857
  origin,
77849
- path: path43 = "/",
77858
+ path: path44 = "/",
77850
77859
  headers = {}
77851
77860
  } = opts;
77852
- opts.path = origin + path43;
77861
+ opts.path = origin + path44;
77853
77862
  if (!("host" in headers) && !("Host" in headers)) {
77854
77863
  const { host } = new URL(origin);
77855
77864
  headers.host = host;
@@ -79985,21 +79994,21 @@ var require_mock_utils = __commonJS({
79985
79994
  return normalizedQp;
79986
79995
  }
79987
79996
  __name(normalizeSearchParams, "normalizeSearchParams");
79988
- function safeUrl(path43) {
79989
- if (typeof path43 !== "string") {
79990
- return path43;
79997
+ function safeUrl(path44) {
79998
+ if (typeof path44 !== "string") {
79999
+ return path44;
79991
80000
  }
79992
- const pathSegments = path43.split("?", 3);
80001
+ const pathSegments = path44.split("?", 3);
79993
80002
  if (pathSegments.length !== 2) {
79994
- return path43;
80003
+ return path44;
79995
80004
  }
79996
80005
  const qp = new URLSearchParams(pathSegments.pop());
79997
80006
  qp.sort();
79998
80007
  return [...pathSegments, qp.toString()].join("?");
79999
80008
  }
80000
80009
  __name(safeUrl, "safeUrl");
80001
- function matchKey(mockDispatch2, { path: path43, method, body, headers }) {
80002
- const pathMatch = matchValue(mockDispatch2.path, path43);
80010
+ function matchKey(mockDispatch2, { path: path44, method, body, headers }) {
80011
+ const pathMatch = matchValue(mockDispatch2.path, path44);
80003
80012
  const methodMatch = matchValue(mockDispatch2.method, method);
80004
80013
  const bodyMatch = typeof mockDispatch2.body !== "undefined" ? matchValue(mockDispatch2.body, body) : true;
80005
80014
  const headersMatch = matchHeaders(mockDispatch2, headers);
@@ -80026,8 +80035,8 @@ var require_mock_utils = __commonJS({
80026
80035
  const basePath = key.query ? serializePathWithQuery(key.path, key.query) : key.path;
80027
80036
  const resolvedPath = typeof basePath === "string" ? safeUrl(basePath) : basePath;
80028
80037
  const resolvedPathWithoutTrailingSlash = removeTrailingSlash(resolvedPath);
80029
- let matchedMockDispatches = mockDispatches.filter(({ consumed }) => !consumed).filter(({ path: path43, ignoreTrailingSlash }) => {
80030
- return ignoreTrailingSlash ? matchValue(removeTrailingSlash(safeUrl(path43)), resolvedPathWithoutTrailingSlash) : matchValue(safeUrl(path43), resolvedPath);
80038
+ let matchedMockDispatches = mockDispatches.filter(({ consumed }) => !consumed).filter(({ path: path44, ignoreTrailingSlash }) => {
80039
+ return ignoreTrailingSlash ? matchValue(removeTrailingSlash(safeUrl(path44)), resolvedPathWithoutTrailingSlash) : matchValue(safeUrl(path44), resolvedPath);
80031
80040
  });
80032
80041
  if (matchedMockDispatches.length === 0) {
80033
80042
  throw new MockNotMatchedError(`Mock dispatch not matched for path '${resolvedPath}'`);
@@ -80069,20 +80078,20 @@ var require_mock_utils = __commonJS({
80069
80078
  }
80070
80079
  }
80071
80080
  __name(deleteMockDispatch, "deleteMockDispatch");
80072
- function removeTrailingSlash(path43) {
80073
- while (path43.endsWith("/")) {
80074
- path43 = path43.slice(0, -1);
80081
+ function removeTrailingSlash(path44) {
80082
+ while (path44.endsWith("/")) {
80083
+ path44 = path44.slice(0, -1);
80075
80084
  }
80076
- if (path43.length === 0) {
80077
- path43 = "/";
80085
+ if (path44.length === 0) {
80086
+ path44 = "/";
80078
80087
  }
80079
- return path43;
80088
+ return path44;
80080
80089
  }
80081
80090
  __name(removeTrailingSlash, "removeTrailingSlash");
80082
80091
  function buildKey(opts) {
80083
- const { path: path43, method, body, headers, query } = opts;
80092
+ const { path: path44, method, body, headers, query } = opts;
80084
80093
  return {
80085
- path: path43,
80094
+ path: path44,
80086
80095
  method,
80087
80096
  body,
80088
80097
  headers,
@@ -80809,10 +80818,10 @@ var require_pending_interceptors_formatter = __commonJS({
80809
80818
  }
80810
80819
  format(pendingInterceptors) {
80811
80820
  const withPrettyHeaders = pendingInterceptors.map(
80812
- ({ method, path: path43, data: { statusCode }, persist, times, timesInvoked, origin }) => ({
80821
+ ({ method, path: path44, data: { statusCode }, persist, times, timesInvoked, origin }) => ({
80813
80822
  Method: method,
80814
80823
  Origin: origin,
80815
- Path: path43,
80824
+ Path: path44,
80816
80825
  "Status code": statusCode,
80817
80826
  Persistent: persist ? PERSISTENT : NOT_PERSISTENT,
80818
80827
  Invocations: timesInvoked,
@@ -80897,9 +80906,9 @@ var require_mock_agent = __commonJS({
80897
80906
  const acceptNonStandardSearchParameters = this[kMockAgentAcceptsNonStandardSearchParameters];
80898
80907
  const dispatchOpts = { ...opts };
80899
80908
  if (acceptNonStandardSearchParameters && dispatchOpts.path) {
80900
- const [path43, searchParams] = dispatchOpts.path.split("?");
80909
+ const [path44, searchParams] = dispatchOpts.path.split("?");
80901
80910
  const normalizedSearchParams = normalizeSearchParams(searchParams, acceptNonStandardSearchParameters);
80902
- dispatchOpts.path = `${path43}?${normalizedSearchParams}`;
80911
+ dispatchOpts.path = `${path44}?${normalizedSearchParams}`;
80903
80912
  }
80904
80913
  return this[kAgent].dispatch(dispatchOpts, handler);
80905
80914
  }
@@ -81312,12 +81321,12 @@ var require_snapshot_recorder = __commonJS({
81312
81321
  * @return {Promise<void>} - Resolves when snapshots are loaded
81313
81322
  */
81314
81323
  async loadSnapshots(filePath) {
81315
- const path43 = filePath || this.#snapshotPath;
81316
- if (!path43) {
81324
+ const path44 = filePath || this.#snapshotPath;
81325
+ if (!path44) {
81317
81326
  throw new InvalidArgumentError2("Snapshot path is required");
81318
81327
  }
81319
81328
  try {
81320
- const data2 = await readFile3(resolve6(path43), "utf8");
81329
+ const data2 = await readFile3(resolve6(path44), "utf8");
81321
81330
  const parsed = JSON.parse(data2);
81322
81331
  if (Array.isArray(parsed)) {
81323
81332
  this.#snapshots.clear();
@@ -81331,7 +81340,7 @@ var require_snapshot_recorder = __commonJS({
81331
81340
  if (error45.code === "ENOENT") {
81332
81341
  this.#snapshots.clear();
81333
81342
  } else {
81334
- throw new UndiciError(`Failed to load snapshots from ${path43}`, { cause: error45 });
81343
+ throw new UndiciError(`Failed to load snapshots from ${path44}`, { cause: error45 });
81335
81344
  }
81336
81345
  }
81337
81346
  }
@@ -81342,11 +81351,11 @@ var require_snapshot_recorder = __commonJS({
81342
81351
  * @returns {Promise<void>} - Resolves when snapshots are saved
81343
81352
  */
81344
81353
  async saveSnapshots(filePath) {
81345
- const path43 = filePath || this.#snapshotPath;
81346
- if (!path43) {
81354
+ const path44 = filePath || this.#snapshotPath;
81355
+ if (!path44) {
81347
81356
  throw new InvalidArgumentError2("Snapshot path is required");
81348
81357
  }
81349
- const resolvedPath = resolve6(path43);
81358
+ const resolvedPath = resolve6(path44);
81350
81359
  await mkdir2(dirname9(resolvedPath), { recursive: true });
81351
81360
  const data2 = Array.from(this.#snapshots.entries()).map(([hash2, snapshot]) => ({
81352
81361
  hash: hash2,
@@ -81985,15 +81994,15 @@ var require_redirect_handler = __commonJS({
81985
81994
  return;
81986
81995
  }
81987
81996
  const { origin, pathname, search } = util.parseURL(new URL(this.location, this.opts.origin && new URL(this.opts.path, this.opts.origin)));
81988
- const path43 = search ? `${pathname}${search}` : pathname;
81989
- const redirectUrlString = `${origin}${path43}`;
81997
+ const path44 = search ? `${pathname}${search}` : pathname;
81998
+ const redirectUrlString = `${origin}${path44}`;
81990
81999
  for (const historyUrl of this.history) {
81991
82000
  if (historyUrl.toString() === redirectUrlString) {
81992
82001
  throw new InvalidArgumentError2(`Redirect loop detected. Cannot redirect to ${origin}. This typically happens when using a Client or Pool with cross-origin redirects. Use an Agent for cross-origin redirects.`);
81993
82002
  }
81994
82003
  }
81995
82004
  this.opts.headers = cleanRequestHeaders(this.opts.headers, statusCode === 303, this.opts.origin !== origin);
81996
- this.opts.path = path43;
82005
+ this.opts.path = path44;
81997
82006
  this.opts.origin = origin;
81998
82007
  this.opts.query = null;
81999
82008
  }
@@ -88324,11 +88333,11 @@ var require_fetch = __commonJS({
88324
88333
  function dispatch({ body }) {
88325
88334
  const url2 = requestCurrentURL(request);
88326
88335
  const agent = fetchParams.controller.dispatcher;
88327
- const path43 = url2.pathname + url2.search;
88336
+ const path44 = url2.pathname + url2.search;
88328
88337
  const hasTrailingQuestionMark = url2.search.length === 0 && url2.href[url2.href.length - url2.hash.length - 1] === "?";
88329
88338
  return new Promise((resolve6, reject) => agent.dispatch(
88330
88339
  {
88331
- path: hasTrailingQuestionMark ? `${path43}?` : path43,
88340
+ path: hasTrailingQuestionMark ? `${path44}?` : path44,
88332
88341
  origin: url2.origin,
88333
88342
  method: request.method,
88334
88343
  body: agent.isMockActive ? request.body && (request.body.source || request.body.stream) : body,
@@ -89288,9 +89297,9 @@ var require_util4 = __commonJS({
89288
89297
  }
89289
89298
  }
89290
89299
  __name(validateCookieValue, "validateCookieValue");
89291
- function validateCookiePath(path43) {
89292
- for (let i = 0; i < path43.length; ++i) {
89293
- const code2 = path43.charCodeAt(i);
89300
+ function validateCookiePath(path44) {
89301
+ for (let i = 0; i < path44.length; ++i) {
89302
+ const code2 = path44.charCodeAt(i);
89294
89303
  if (code2 < 32 || // exclude CTLs (0-31)
89295
89304
  code2 === 127 || // DEL
89296
89305
  code2 === 59) {
@@ -92538,11 +92547,11 @@ var require_undici = __commonJS({
92538
92547
  if (typeof opts.path !== "string") {
92539
92548
  throw new InvalidArgumentError2("invalid opts.path");
92540
92549
  }
92541
- let path43 = opts.path;
92550
+ let path44 = opts.path;
92542
92551
  if (!opts.path.startsWith("/")) {
92543
- path43 = `/${path43}`;
92552
+ path44 = `/${path44}`;
92544
92553
  }
92545
- url2 = new URL(util.parseOrigin(url2).origin + path43);
92554
+ url2 = new URL(util.parseOrigin(url2).origin + path44);
92546
92555
  } else {
92547
92556
  if (!opts) {
92548
92557
  opts = typeof url2 === "object" ? url2 : {};
@@ -93015,19 +93024,19 @@ var init_esm12 = __esm({
93015
93024
  });
93016
93025
 
93017
93026
  // src/cli/commands/migrate-apply.ts
93018
- import fs32 from "node:fs";
93019
- import path35 from "node:path";
93027
+ import fs33 from "node:fs";
93028
+ import path36 from "node:path";
93020
93029
  function applyMigrationManifest(options) {
93021
93030
  const { cwd, manifest } = options;
93022
93031
  const written = [];
93023
93032
  const warnings = [];
93024
93033
  const previousArtifacts = readArtifactIndex(cwd);
93025
93034
  cleanupPreviousArtifacts(cwd, previousArtifacts);
93026
- resetDir(path35.join(cwd, GENERATED_PAGES_DIR));
93027
- resetDir(path35.join(cwd, GENERATED_COMPONENTS_DIR));
93028
- resetDir(path35.join(cwd, GENERATED_ROOT));
93029
- ensureDir(path35.join(cwd, SCHEMAS_DIR));
93030
- ensureDir(path35.join(cwd, FORMS_DIR));
93035
+ resetDir(path36.join(cwd, GENERATED_PAGES_DIR));
93036
+ resetDir(path36.join(cwd, GENERATED_COMPONENTS_DIR));
93037
+ resetDir(path36.join(cwd, GENERATED_ROOT));
93038
+ ensureDir(path36.join(cwd, SCHEMAS_DIR));
93039
+ ensureDir(path36.join(cwd, FORMS_DIR));
93031
93040
  const theme = pickThemePalette(manifest);
93032
93041
  const siteName = deriveSiteName(manifest);
93033
93042
  const navPages = selectNavPages(manifest.pages);
@@ -93045,10 +93054,10 @@ function applyMigrationManifest(options) {
93045
93054
  }
93046
93055
  writeFile2(cwd, "design.md", buildDesignDoc(manifest, theme, siteName), written);
93047
93056
  writeFile2(cwd, "src/index.css", buildThemeCss(theme), written);
93048
- writeFile2(cwd, path35.join(GENERATED_COMPONENTS_DIR, "MigrationShell.tsx"), buildMigrationShellComponent(), written);
93057
+ writeFile2(cwd, path36.join(GENERATED_COMPONENTS_DIR, "MigrationShell.tsx"), buildMigrationShellComponent(), written);
93049
93058
  writeFile2(
93050
93059
  cwd,
93051
- path35.join(GENERATED_COMPONENTS_DIR, "MigrationPageTemplate.tsx"),
93060
+ path36.join(GENERATED_COMPONENTS_DIR, "MigrationPageTemplate.tsx"),
93052
93061
  buildMigrationPageTemplateComponent(),
93053
93062
  written
93054
93063
  );
@@ -93067,14 +93076,14 @@ function applyMigrationManifest(options) {
93067
93076
  const artifactIndex = {
93068
93077
  pageFiles: plannedPages.map((page) => toPosix(page.modulePath)),
93069
93078
  componentFiles: [
93070
- toPosix(path35.join(GENERATED_COMPONENTS_DIR, "MigrationShell.tsx")),
93071
- toPosix(path35.join(GENERATED_COMPONENTS_DIR, "MigrationPageTemplate.tsx"))
93079
+ toPosix(path36.join(GENERATED_COMPONENTS_DIR, "MigrationShell.tsx")),
93080
+ toPosix(path36.join(GENERATED_COMPONENTS_DIR, "MigrationPageTemplate.tsx"))
93072
93081
  ],
93073
93082
  schemaFiles: schemaFiles.map(toPosix),
93074
93083
  formFiles: formFiles.map(toPosix),
93075
93084
  generatedFiles: generatedNotes.map(toPosix)
93076
93085
  };
93077
- writeFile2(cwd, path35.join(GENERATED_ROOT, "artifacts.json"), JSON.stringify(artifactIndex, null, 2) + "\n", written);
93086
+ writeFile2(cwd, path36.join(GENERATED_ROOT, "artifacts.json"), JSON.stringify(artifactIndex, null, 2) + "\n", written);
93078
93087
  return {
93079
93088
  written,
93080
93089
  warnings,
@@ -93165,7 +93174,7 @@ function writeSchemas(cwd, collections, written) {
93165
93174
  const filePaths = [];
93166
93175
  for (const collection of collections) {
93167
93176
  const definition = buildSchemaDefinition(collection);
93168
- const relativePath = path35.join(SCHEMAS_DIR, `${definition.uid}.json`);
93177
+ const relativePath = path36.join(SCHEMAS_DIR, `${definition.uid}.json`);
93169
93178
  writeFile2(cwd, relativePath, JSON.stringify(definition, null, 2) + "\n", written);
93170
93179
  filePaths.push(relativePath);
93171
93180
  }
@@ -93175,15 +93184,15 @@ function writeForms(cwd, forms3, written) {
93175
93184
  const filePaths = [];
93176
93185
  for (const form of forms3) {
93177
93186
  const definition = buildFormDefinition(form);
93178
- const relativePath = path35.join(FORMS_DIR, `${definition.name}.json`);
93187
+ const relativePath = path36.join(FORMS_DIR, `${definition.name}.json`);
93179
93188
  writeFile2(cwd, relativePath, JSON.stringify(definition, null, 2) + "\n", written);
93180
93189
  filePaths.push(relativePath);
93181
93190
  }
93182
93191
  return filePaths;
93183
93192
  }
93184
93193
  function writeCollectionSeeds(cwd, manifest, written) {
93185
- const entriesDir = path35.join(GENERATED_ROOT, "entries");
93186
- ensureDir(path35.join(cwd, entriesDir));
93194
+ const entriesDir = path36.join(GENERATED_ROOT, "entries");
93195
+ ensureDir(path36.join(cwd, entriesDir));
93187
93196
  for (const collection of manifest.collections) {
93188
93197
  const pages = manifest.pages.filter((page) => collection.sourceRoutes.includes(page.route));
93189
93198
  const entries2 = pages.map((page) => ({
@@ -93191,16 +93200,16 @@ function writeCollectionSeeds(cwd, manifest, written) {
93191
93200
  }));
93192
93201
  writeFile2(
93193
93202
  cwd,
93194
- path35.join(entriesDir, `${collection.suggestedSchema}.json`),
93203
+ path36.join(entriesDir, `${collection.suggestedSchema}.json`),
93195
93204
  JSON.stringify(entries2, null, 2) + "\n",
93196
93205
  written
93197
93206
  );
93198
93207
  }
93199
93208
  }
93200
93209
  function writeGeneratedNotes(cwd, manifest, siteName, warnings, written) {
93201
- const generatedDir = path35.join(cwd, GENERATED_ROOT);
93210
+ const generatedDir = path36.join(cwd, GENERATED_ROOT);
93202
93211
  ensureDir(generatedDir);
93203
- const noteFiles = [path35.join(GENERATED_ROOT, "next-steps.md"), path35.join(GENERATED_ROOT, "summary.json")];
93212
+ const noteFiles = [path36.join(GENERATED_ROOT, "next-steps.md"), path36.join(GENERATED_ROOT, "summary.json")];
93204
93213
  const nextSteps = [
93205
93214
  "# Next Steps",
93206
93215
  "",
@@ -93833,7 +93842,7 @@ function planPages(pages) {
93833
93842
  planned.push({
93834
93843
  page,
93835
93844
  componentName,
93836
- modulePath: path35.join(GENERATED_PAGES_DIR, `${componentName}.tsx`)
93845
+ modulePath: path36.join(GENERATED_PAGES_DIR, `${componentName}.tsx`)
93837
93846
  });
93838
93847
  }
93839
93848
  if (!planned.some((item) => item.page.route === "/")) {
@@ -93860,7 +93869,7 @@ function planPages(pages) {
93860
93869
  confidence: 0.3
93861
93870
  },
93862
93871
  componentName: "HomePage",
93863
- modulePath: path35.join(GENERATED_PAGES_DIR, "HomePage.tsx")
93872
+ modulePath: path36.join(GENERATED_PAGES_DIR, "HomePage.tsx")
93864
93873
  });
93865
93874
  }
93866
93875
  return planned.sort(
@@ -93919,12 +93928,12 @@ function extractPageSeedContent(cwd, page) {
93919
93928
  paragraphs: page.paragraphs ?? [],
93920
93929
  images: page.images ?? []
93921
93930
  };
93922
- const htmlPath = page.artifacts.html ? path35.resolve(cwd, page.artifacts.html) : "";
93923
- if (!htmlPath || !fs32.existsSync(htmlPath)) {
93931
+ const htmlPath = page.artifacts.html ? path36.resolve(cwd, page.artifacts.html) : "";
93932
+ if (!htmlPath || !fs33.existsSync(htmlPath)) {
93924
93933
  return fallback;
93925
93934
  }
93926
93935
  try {
93927
- const $3 = load(fs32.readFileSync(htmlPath, "utf8"));
93936
+ const $3 = load(fs33.readFileSync(htmlPath, "utf8"));
93928
93937
  const headings = unique(
93929
93938
  $3("h1, h2, h3").toArray().map((element) => cleanText($3(element).text())).filter(Boolean).slice(0, 12)
93930
93939
  );
@@ -94173,12 +94182,12 @@ function toRgb(color) {
94173
94182
  return null;
94174
94183
  }
94175
94184
  function readArtifactIndex(cwd) {
94176
- const artifactPath = path35.join(cwd, GENERATED_ROOT, "artifacts.json");
94177
- if (!fs32.existsSync(artifactPath)) {
94185
+ const artifactPath = path36.join(cwd, GENERATED_ROOT, "artifacts.json");
94186
+ if (!fs33.existsSync(artifactPath)) {
94178
94187
  return null;
94179
94188
  }
94180
94189
  try {
94181
- return JSON.parse(fs32.readFileSync(artifactPath, "utf8"));
94190
+ return JSON.parse(fs33.readFileSync(artifactPath, "utf8"));
94182
94191
  } catch {
94183
94192
  return null;
94184
94193
  }
@@ -94192,25 +94201,25 @@ function cleanupPreviousArtifacts(cwd, index2) {
94192
94201
  ...index2.componentFiles,
94193
94202
  ...index2.generatedFiles
94194
94203
  ]) {
94195
- deleteIfExists(path35.join(cwd, relativePath));
94204
+ deleteIfExists(path36.join(cwd, relativePath));
94196
94205
  }
94197
94206
  }
94198
94207
  function writeFile2(cwd, relativePath, content2, written) {
94199
- const absolutePath = path35.join(cwd, relativePath);
94200
- ensureDir(path35.dirname(absolutePath));
94201
- fs32.writeFileSync(absolutePath, content2, "utf8");
94208
+ const absolutePath = path36.join(cwd, relativePath);
94209
+ ensureDir(path36.dirname(absolutePath));
94210
+ fs33.writeFileSync(absolutePath, content2, "utf8");
94202
94211
  written.push(absolutePath);
94203
94212
  }
94204
94213
  function ensureDir(dir) {
94205
- fs32.mkdirSync(dir, { recursive: true });
94214
+ fs33.mkdirSync(dir, { recursive: true });
94206
94215
  }
94207
94216
  function resetDir(dir) {
94208
- fs32.rmSync(dir, { recursive: true, force: true });
94209
- fs32.mkdirSync(dir, { recursive: true });
94217
+ fs33.rmSync(dir, { recursive: true, force: true });
94218
+ fs33.mkdirSync(dir, { recursive: true });
94210
94219
  }
94211
94220
  function deleteIfExists(filePath) {
94212
- if (fs32.existsSync(filePath)) {
94213
- fs32.rmSync(filePath, { recursive: true, force: true });
94221
+ if (fs33.existsSync(filePath)) {
94222
+ fs33.rmSync(filePath, { recursive: true, force: true });
94214
94223
  }
94215
94224
  }
94216
94225
  function unique(values) {
@@ -94242,7 +94251,7 @@ function absolutizeUrl(value, base) {
94242
94251
  }
94243
94252
  }
94244
94253
  function toPosix(value) {
94245
- return value.split(path35.sep).join("/");
94254
+ return value.split(path36.sep).join("/");
94246
94255
  }
94247
94256
  function manifestLikeUrl(seedUrl, routePath) {
94248
94257
  try {
@@ -94261,12 +94270,12 @@ var init_migrate_apply = __esm({
94261
94270
  init_sync_forms();
94262
94271
  init_sync_schemas();
94263
94272
  GENERATED_MARKER = "/* AUTO-GENERATED by fimo migrate apply */";
94264
- MIGRATION_DIR = path35.join(".fimo", "migrations", "current");
94265
- GENERATED_ROOT = path35.join(MIGRATION_DIR, "generated");
94266
- GENERATED_PAGES_DIR = path35.join("src", "pages", "migrated");
94267
- GENERATED_COMPONENTS_DIR = path35.join("src", "components", "migration");
94268
- SCHEMAS_DIR = path35.join("src", "schemas");
94269
- FORMS_DIR = path35.join("src", "forms");
94273
+ MIGRATION_DIR = path36.join(".fimo", "migrations", "current");
94274
+ GENERATED_ROOT = path36.join(MIGRATION_DIR, "generated");
94275
+ GENERATED_PAGES_DIR = path36.join("src", "pages", "migrated");
94276
+ GENERATED_COMPONENTS_DIR = path36.join("src", "components", "migration");
94277
+ SCHEMAS_DIR = path36.join("src", "schemas");
94278
+ FORMS_DIR = path36.join("src", "forms");
94270
94279
  GENERIC_FONTS = /* @__PURE__ */ new Set([
94271
94280
  "arial",
94272
94281
  "georgia",
@@ -94351,8 +94360,8 @@ var init_migrate_apply = __esm({
94351
94360
 
94352
94361
  // src/cli/commands/migrate.ts
94353
94362
  import { spawnSync as spawnSync5 } from "node:child_process";
94354
- import fs33 from "node:fs";
94355
- import path36 from "node:path";
94363
+ import fs34 from "node:fs";
94364
+ import path37 from "node:path";
94356
94365
  import { fileURLToPath as fileURLToPath7 } from "node:url";
94357
94366
  async function migrateInitCommand(sourceUrlArg, dirArg, options) {
94358
94367
  const projectRoot = await ensureMigrationProject(dirArg, options);
@@ -94374,14 +94383,14 @@ async function migrateInitCommand(sourceUrlArg, dirArg, options) {
94374
94383
  maxAssets,
94375
94384
  downloadMedia: options.downloadMedia !== false
94376
94385
  });
94377
- spinner2.stop(`Migration artifacts written to ${path36.join(projectRoot, MIGRATION_DIR2)}`);
94386
+ spinner2.stop(`Migration artifacts written to ${path37.join(projectRoot, MIGRATION_DIR2)}`);
94378
94387
  if (options.json) {
94379
94388
  console.log(JSON.stringify(manifest, null, 2));
94380
94389
  return;
94381
94390
  }
94382
94391
  printManifestSummary(manifest);
94383
94392
  console.log(`
94384
- Next step: read ${path36.join(projectRoot, MIGRATION_DIR2, "brief.md")}`);
94393
+ Next step: read ${path37.join(projectRoot, MIGRATION_DIR2, "brief.md")}`);
94385
94394
  } catch (error45) {
94386
94395
  spinner2.stop(`Migration bootstrap failed: ${error45 instanceof Error ? error45.message : String(error45)}`);
94387
94396
  process.exitCode = 1;
@@ -94393,13 +94402,13 @@ async function migratePullCommand(options) {
94393
94402
  process.exitCode = 1;
94394
94403
  return;
94395
94404
  }
94396
- const manifestPath = path36.join(projectRoot, MIGRATION_DIR2, "manifest.json");
94397
- if (!fs33.existsSync(manifestPath)) {
94405
+ const manifestPath = path37.join(projectRoot, MIGRATION_DIR2, "manifest.json");
94406
+ if (!fs34.existsSync(manifestPath)) {
94398
94407
  console.error("No migration manifest found. Run `fimo migrate init <url>` first.");
94399
94408
  process.exitCode = 1;
94400
94409
  return;
94401
94410
  }
94402
- const previous = JSON.parse(fs33.readFileSync(manifestPath, "utf8"));
94411
+ const previous = JSON.parse(fs34.readFileSync(manifestPath, "utf8"));
94403
94412
  const project = loadProjectMetadata(projectRoot);
94404
94413
  const maxPages = parseMaxPages(options.maxPages, previous.crawl.maxPages);
94405
94414
  const maxAssets = parseMaxAssets(options.maxAssets);
@@ -94413,7 +94422,7 @@ async function migratePullCommand(options) {
94413
94422
  maxAssets,
94414
94423
  downloadMedia: options.downloadMedia !== false
94415
94424
  });
94416
- spinner2.stop(`Migration artifacts refreshed in ${path36.join(projectRoot, MIGRATION_DIR2)}`);
94425
+ spinner2.stop(`Migration artifacts refreshed in ${path37.join(projectRoot, MIGRATION_DIR2)}`);
94417
94426
  if (options.json) {
94418
94427
  console.log(JSON.stringify(manifest, null, 2));
94419
94428
  return;
@@ -94431,7 +94440,7 @@ async function migrateRunCommand(sourceUrlArg, dirArg, options) {
94431
94440
  if (hasFailed()) {
94432
94441
  return;
94433
94442
  }
94434
- const projectRoot = resolveProjectCwd(dirArg ? path36.resolve(dirArg) : options.cwd);
94443
+ const projectRoot = resolveProjectCwd(dirArg ? path37.resolve(dirArg) : options.cwd);
94435
94444
  console.log("\nStep 2/4: inspect migration manifest");
94436
94445
  migrateInspectCommand({ cwd: projectRoot });
94437
94446
  if (hasFailed()) {
@@ -94454,7 +94463,7 @@ Agent-ready migration draft prepared for ${projectRoot}`);
94454
94463
  "This is not the final visual rebuild yet. The CLI extracted the source, generated a scaffold, and wrote an agent handoff pack."
94455
94464
  );
94456
94465
  console.log(
94457
- `Next step: ask your coding agent to follow ${path36.join(projectRoot, MIGRATION_DIR2, "refine", "agent-prompt.md")}`
94466
+ `Next step: ask your coding agent to follow ${path37.join(projectRoot, MIGRATION_DIR2, "refine", "agent-prompt.md")}`
94458
94467
  );
94459
94468
  }
94460
94469
  function migrateInspectCommand(options) {
@@ -94463,13 +94472,13 @@ function migrateInspectCommand(options) {
94463
94472
  process.exitCode = 1;
94464
94473
  return;
94465
94474
  }
94466
- const manifestPath = path36.join(projectRoot, MIGRATION_DIR2, "manifest.json");
94467
- if (!fs33.existsSync(manifestPath)) {
94475
+ const manifestPath = path37.join(projectRoot, MIGRATION_DIR2, "manifest.json");
94476
+ if (!fs34.existsSync(manifestPath)) {
94468
94477
  console.error("No migration manifest found. Run `fimo migrate init <url>` first.");
94469
94478
  process.exitCode = 1;
94470
94479
  return;
94471
94480
  }
94472
- const manifest = JSON.parse(fs33.readFileSync(manifestPath, "utf8"));
94481
+ const manifest = JSON.parse(fs34.readFileSync(manifestPath, "utf8"));
94473
94482
  if (options.json) {
94474
94483
  console.log(JSON.stringify(manifest, null, 2));
94475
94484
  return;
@@ -94518,7 +94527,7 @@ function migrateApplyCommand(options) {
94518
94527
  }
94519
94528
  console.log(
94520
94529
  `
94521
- Next step: run \`fimo migrate refine -C ${projectRoot}\` or read ${path36.join(projectRoot, MIGRATION_DIR2, "generated", "next-steps.md")}`
94530
+ Next step: run \`fimo migrate refine -C ${projectRoot}\` or read ${path37.join(projectRoot, MIGRATION_DIR2, "generated", "next-steps.md")}`
94522
94531
  );
94523
94532
  } catch (error45) {
94524
94533
  spinner2.stop(`Migration apply failed: ${error45 instanceof Error ? error45.message : String(error45)}`);
@@ -94531,17 +94540,17 @@ function migrateImportCommand(options) {
94531
94540
  process.exitCode = 1;
94532
94541
  return;
94533
94542
  }
94534
- const mediaMapPath = path36.join(projectRoot, MIGRATION_DIR2, MEDIA_DIR, "map.json");
94535
- const entriesDir = path36.join(projectRoot, MIGRATION_DIR2, "generated", "entries");
94536
- const schemasDir = path36.join(projectRoot, "src", "schemas");
94537
- const formsDir = path36.join(projectRoot, "src", "forms");
94538
- const media = fs33.existsSync(mediaMapPath) ? readDownloadedMedia(mediaMapPath) : [];
94539
- const schemas3 = fs33.existsSync(schemasDir) ? fs33.readdirSync(schemasDir).filter((name) => name.endsWith(".json")) : [];
94540
- const forms3 = fs33.existsSync(formsDir) ? fs33.readdirSync(formsDir).filter((name) => name.endsWith(".json")) : [];
94541
- const entryFiles = fs33.existsSync(entriesDir) ? fs33.readdirSync(entriesDir).filter((name) => name.endsWith(".json")) : [];
94543
+ const mediaMapPath = path37.join(projectRoot, MIGRATION_DIR2, MEDIA_DIR, "map.json");
94544
+ const entriesDir = path37.join(projectRoot, MIGRATION_DIR2, "generated", "entries");
94545
+ const schemasDir = path37.join(projectRoot, "src", "schemas");
94546
+ const formsDir = path37.join(projectRoot, "src", "forms");
94547
+ const media = fs34.existsSync(mediaMapPath) ? readDownloadedMedia(mediaMapPath) : [];
94548
+ const schemas3 = fs34.existsSync(schemasDir) ? fs34.readdirSync(schemasDir).filter((name) => name.endsWith(".json")) : [];
94549
+ const forms3 = fs34.existsSync(formsDir) ? fs34.readdirSync(formsDir).filter((name) => name.endsWith(".json")) : [];
94550
+ const entryFiles = fs34.existsSync(entriesDir) ? fs34.readdirSync(entriesDir).filter((name) => name.endsWith(".json")) : [];
94542
94551
  const entryCommands = entryFiles.map((file2) => {
94543
- const typeName = path36.basename(file2, ".json");
94544
- return `Review ${path36.join(MIGRATION_DIR2, "generated", "entries", file2)}, then run fimo entries create ${typeName} --body '<entry-json>' -C ${projectRoot} for each approved entry`;
94552
+ const typeName = path37.basename(file2, ".json");
94553
+ return `Review ${path37.join(MIGRATION_DIR2, "generated", "entries", file2)}, then run fimo entries create ${typeName} --body '<entry-json>' -C ${projectRoot} for each approved entry`;
94545
94554
  });
94546
94555
  const result = {
94547
94556
  media: media.length,
@@ -94550,8 +94559,8 @@ function migrateImportCommand(options) {
94550
94559
  entryFiles: entryFiles.length,
94551
94560
  commands: [
94552
94561
  ...media.map((asset) => `fimo assets upload ${asset.localPath} -C ${projectRoot}`),
94553
- ...schemas3.map((file2) => `fimo schemas push ${path36.basename(file2, ".json")} -C ${projectRoot}`),
94554
- ...forms3.map((file2) => `fimo forms push ${path36.basename(file2, ".json")} -C ${projectRoot}`),
94562
+ ...schemas3.map((file2) => `fimo schemas push ${path37.basename(file2, ".json")} -C ${projectRoot}`),
94563
+ ...forms3.map((file2) => `fimo forms push ${path37.basename(file2, ".json")} -C ${projectRoot}`),
94555
94564
  ...entryCommands
94556
94565
  ]
94557
94566
  };
@@ -94595,8 +94604,8 @@ function migrateReportCommand(options) {
94595
94604
  runBundledMigrationScript("write-migration-report.mjs", args);
94596
94605
  }
94597
94606
  function runBundledMigrationScript(scriptName, args) {
94598
- const scriptPath = path36.join(MIGRATION_SKILL_SCRIPTS_DIR, scriptName);
94599
- if (!fs33.existsSync(scriptPath)) {
94607
+ const scriptPath = path37.join(MIGRATION_SKILL_SCRIPTS_DIR, scriptName);
94608
+ if (!fs34.existsSync(scriptPath)) {
94600
94609
  console.error(`Migration helper script not found: ${scriptPath}`);
94601
94610
  process.exitCode = 1;
94602
94611
  return;
@@ -94633,7 +94642,7 @@ function readStringOption(options, name) {
94633
94642
  return void 0;
94634
94643
  }
94635
94644
  function readDownloadedMedia(mediaMapPath) {
94636
- return JSON.parse(fs33.readFileSync(mediaMapPath, "utf8")).filter(
94645
+ return JSON.parse(fs34.readFileSync(mediaMapPath, "utf8")).filter(
94637
94646
  (asset) => asset.status === "downloaded" && asset.localPath
94638
94647
  );
94639
94648
  }
@@ -94641,12 +94650,12 @@ async function ensureMigrationProject(dirArg, options) {
94641
94650
  if (!dirArg) {
94642
94651
  return requireProjectRoot(options.cwd);
94643
94652
  }
94644
- const explicitDir = path36.resolve(dirArg);
94653
+ const explicitDir = path37.resolve(dirArg);
94645
94654
  const resolvedRoot = resolveProjectCwd(explicitDir);
94646
- if (fs33.existsSync(path36.join(resolvedRoot, ".fimo.settings.json"))) {
94655
+ if (fs34.existsSync(path37.join(resolvedRoot, ".fimo.settings.json"))) {
94647
94656
  return resolvedRoot;
94648
94657
  }
94649
- if (fs33.existsSync(explicitDir) && fs33.readdirSync(explicitDir).length > 0) {
94658
+ if (fs34.existsSync(explicitDir) && fs34.readdirSync(explicitDir).length > 0) {
94650
94659
  console.error(
94651
94660
  `Refusing to initialize a migration in non-empty directory ${explicitDir}. Pass a Fimo project directory or an empty/new directory.`
94652
94661
  );
@@ -94654,7 +94663,7 @@ async function ensureMigrationProject(dirArg, options) {
94654
94663
  }
94655
94664
  await createCommand2(explicitDir, options);
94656
94665
  const createdRoot = resolveProjectCwd(explicitDir);
94657
- if (!fs33.existsSync(path36.join(createdRoot, ".fimo.settings.json"))) {
94666
+ if (!fs34.existsSync(path37.join(createdRoot, ".fimo.settings.json"))) {
94658
94667
  console.error("Project creation did not complete. Re-run `fimo create` or try again with explicit flags.");
94659
94668
  return null;
94660
94669
  }
@@ -94662,7 +94671,7 @@ async function ensureMigrationProject(dirArg, options) {
94662
94671
  }
94663
94672
  function requireProjectRoot(cwdOption) {
94664
94673
  const root2 = resolveProjectCwd(cwdOption);
94665
- if (!fs33.existsSync(path36.join(root2, ".fimo.settings.json"))) {
94674
+ if (!fs34.existsSync(path37.join(root2, ".fimo.settings.json"))) {
94666
94675
  console.error(
94667
94676
  "You are not in a Fimo project. Run `fimo create` first or pass a project directory to `fimo migrate init`."
94668
94677
  );
@@ -94671,12 +94680,12 @@ function requireProjectRoot(cwdOption) {
94671
94680
  return root2;
94672
94681
  }
94673
94682
  function readMigrationManifest(projectRoot) {
94674
- const manifestPath = path36.join(projectRoot, MIGRATION_DIR2, "manifest.json");
94675
- if (!fs33.existsSync(manifestPath)) {
94683
+ const manifestPath = path37.join(projectRoot, MIGRATION_DIR2, "manifest.json");
94684
+ if (!fs34.existsSync(manifestPath)) {
94676
94685
  console.error("No migration manifest found. Run `fimo migrate init <url>` first.");
94677
94686
  return null;
94678
94687
  }
94679
- return JSON.parse(fs33.readFileSync(manifestPath, "utf8"));
94688
+ return JSON.parse(fs34.readFileSync(manifestPath, "utf8"));
94680
94689
  }
94681
94690
  function loadProjectMetadata(projectRoot) {
94682
94691
  const settings = loadProjectSettings(projectRoot);
@@ -94704,14 +94713,14 @@ function parseMaxAssets(value, fallback = DEFAULT_MAX_ASSETS) {
94704
94713
  }
94705
94714
  async function buildMigrationArtifacts(args) {
94706
94715
  const { project, sourceUrl, maxPages, maxAssets } = args;
94707
- const migrationRoot = path36.join(project.root, MIGRATION_DIR2);
94708
- const pagesRoot = path36.join(migrationRoot, SOURCE_PAGES_DIR);
94709
- const extractedRoot = path36.join(migrationRoot, EXTRACTED_DIR);
94710
- const mediaRoot = path36.join(migrationRoot, MEDIA_DIR);
94711
- fs33.rmSync(migrationRoot, { recursive: true, force: true });
94712
- fs33.mkdirSync(pagesRoot, { recursive: true });
94713
- fs33.mkdirSync(extractedRoot, { recursive: true });
94714
- fs33.mkdirSync(mediaRoot, { recursive: true });
94716
+ const migrationRoot = path37.join(project.root, MIGRATION_DIR2);
94717
+ const pagesRoot = path37.join(migrationRoot, SOURCE_PAGES_DIR);
94718
+ const extractedRoot = path37.join(migrationRoot, EXTRACTED_DIR);
94719
+ const mediaRoot = path37.join(migrationRoot, MEDIA_DIR);
94720
+ fs34.rmSync(migrationRoot, { recursive: true, force: true });
94721
+ fs34.mkdirSync(pagesRoot, { recursive: true });
94722
+ fs34.mkdirSync(extractedRoot, { recursive: true });
94723
+ fs34.mkdirSync(mediaRoot, { recursive: true });
94715
94724
  const crawl = await crawlSite({
94716
94725
  sourceUrl,
94717
94726
  maxPages,
@@ -94721,7 +94730,7 @@ async function buildMigrationArtifacts(args) {
94721
94730
  const designTokens = extractDesignTokens(crawl.pages.map((page) => page.html));
94722
94731
  const forms3 = dedupeForms(crawl.pages.flatMap((page) => page.forms));
94723
94732
  const pages = crawl.pages.map((page) => {
94724
- const artifactPath = toPosix2(path36.relative(project.root, path36.join(pagesRoot, routeToFileName(page.route))));
94733
+ const artifactPath = toPosix2(path37.relative(project.root, path37.join(pagesRoot, routeToFileName(page.route))));
94725
94734
  return {
94726
94735
  route: page.route,
94727
94736
  url: page.url,
@@ -94792,7 +94801,7 @@ async function buildMigrationArtifacts(args) {
94792
94801
  scripts: allScripts.length,
94793
94802
  downloaded: mediaAssets.filter((asset) => asset.status === "downloaded").length,
94794
94803
  failed: mediaAssets.filter((asset) => asset.status === "failed").length,
94795
- manifest: mediaAssets.length > 0 ? toPosix2(path36.relative(project.root, path36.join(mediaRoot, "map.json"))) : void 0,
94804
+ manifest: mediaAssets.length > 0 ? toPosix2(path37.relative(project.root, path37.join(mediaRoot, "map.json"))) : void 0,
94796
94805
  externalHosts: unique2(
94797
94806
  [...allImages, ...allStylesheets, ...allScripts].map((value) => safeHostname(value)).filter((value) => Boolean(value))
94798
94807
  )
@@ -94811,19 +94820,19 @@ async function buildMigrationArtifacts(args) {
94811
94820
  unresolved,
94812
94821
  recommendation
94813
94822
  };
94814
- fs33.writeFileSync(path36.join(migrationRoot, "manifest.json"), JSON.stringify(manifest, null, 2) + "\n", "utf8");
94815
- fs33.writeFileSync(path36.join(extractedRoot, "pages.json"), JSON.stringify(pages, null, 2) + "\n", "utf8");
94816
- fs33.writeFileSync(path36.join(extractedRoot, "forms.json"), JSON.stringify(forms3, null, 2) + "\n", "utf8");
94817
- fs33.writeFileSync(
94818
- path36.join(extractedRoot, "design-tokens.json"),
94823
+ fs34.writeFileSync(path37.join(migrationRoot, "manifest.json"), JSON.stringify(manifest, null, 2) + "\n", "utf8");
94824
+ fs34.writeFileSync(path37.join(extractedRoot, "pages.json"), JSON.stringify(pages, null, 2) + "\n", "utf8");
94825
+ fs34.writeFileSync(path37.join(extractedRoot, "forms.json"), JSON.stringify(forms3, null, 2) + "\n", "utf8");
94826
+ fs34.writeFileSync(
94827
+ path37.join(extractedRoot, "design-tokens.json"),
94819
94828
  JSON.stringify(designTokens, null, 2) + "\n",
94820
94829
  "utf8"
94821
94830
  );
94822
- fs33.writeFileSync(path36.join(extractedRoot, "assets.json"), JSON.stringify(manifest.assets, null, 2) + "\n", "utf8");
94831
+ fs34.writeFileSync(path37.join(extractedRoot, "assets.json"), JSON.stringify(manifest.assets, null, 2) + "\n", "utf8");
94823
94832
  if (mediaAssets.length > 0) {
94824
- fs33.writeFileSync(path36.join(mediaRoot, "map.json"), JSON.stringify(mediaAssets, null, 2) + "\n", "utf8");
94833
+ fs34.writeFileSync(path37.join(mediaRoot, "map.json"), JSON.stringify(mediaAssets, null, 2) + "\n", "utf8");
94825
94834
  }
94826
- fs33.writeFileSync(path36.join(migrationRoot, "brief.md"), buildMigrationBrief(manifest) + "\n", "utf8");
94835
+ fs34.writeFileSync(path37.join(migrationRoot, "brief.md"), buildMigrationBrief(manifest) + "\n", "utf8");
94827
94836
  return manifest;
94828
94837
  }
94829
94838
  async function crawlSite(args) {
@@ -94874,7 +94883,7 @@ async function crawlSiteWithFetch(args) {
94874
94883
  const html3 = await response.text();
94875
94884
  const page = analyzePage(finalUrl, html3, siteOrigin);
94876
94885
  pages.push(page);
94877
- fs33.writeFileSync(path36.join(args.pagesRoot, routeToFileName(page.route)), html3, "utf8");
94886
+ fs34.writeFileSync(path37.join(args.pagesRoot, routeToFileName(page.route)), html3, "utf8");
94878
94887
  for (const link of page.discoveredLinks) {
94879
94888
  if (!visited.has(link) && queue.length + pages.length < args.maxPages * 4) {
94880
94889
  queue.push(link);
@@ -95045,11 +95054,11 @@ function buildDesignNotes(tokens, platform4) {
95045
95054
  async function downloadMediaAssets(args) {
95046
95055
  const selected = args.urls.slice(0, args.maxAssets);
95047
95056
  const assets3 = [];
95048
- const originalsRoot = path36.join(args.mediaRoot, "originals");
95049
- fs33.mkdirSync(originalsRoot, { recursive: true });
95057
+ const originalsRoot = path37.join(args.mediaRoot, "originals");
95058
+ fs34.mkdirSync(originalsRoot, { recursive: true });
95050
95059
  for (const sourceUrl of selected) {
95051
95060
  const fileName = mediaFileName(sourceUrl, assets3.length + 1);
95052
- const localPath = path36.join(originalsRoot, fileName);
95061
+ const localPath = path37.join(originalsRoot, fileName);
95053
95062
  try {
95054
95063
  const response = await fetch(sourceUrl, {
95055
95064
  headers: {
@@ -95065,11 +95074,11 @@ async function downloadMediaAssets(args) {
95065
95074
  throw new Error(`Unsupported content type ${contentType}`);
95066
95075
  }
95067
95076
  const buffer = Buffer.from(await response.arrayBuffer());
95068
- fs33.writeFileSync(localPath, buffer);
95077
+ fs34.writeFileSync(localPath, buffer);
95069
95078
  assets3.push({
95070
95079
  sourceUrl,
95071
95080
  fileName,
95072
- localPath: toPosix2(path36.relative(args.projectRoot, localPath)),
95081
+ localPath: toPosix2(path37.relative(args.projectRoot, localPath)),
95073
95082
  contentType,
95074
95083
  bytes: buffer.byteLength,
95075
95084
  status: "downloaded"
@@ -95090,9 +95099,9 @@ async function downloadMediaAssets(args) {
95090
95099
  }
95091
95100
  function mediaFileName(sourceUrl, index2) {
95092
95101
  const url2 = new URL(sourceUrl);
95093
- const original = path36.basename(url2.pathname).replace(/[^a-zA-Z0-9._-]/g, "-");
95094
- const ext = path36.extname(original) || ".bin";
95095
- const stem = path36.basename(original, ext) || "asset";
95102
+ const original = path37.basename(url2.pathname).replace(/[^a-zA-Z0-9._-]/g, "-");
95103
+ const ext = path37.extname(original) || ".bin";
95104
+ const stem = path37.basename(original, ext) || "asset";
95096
95105
  return `${String(index2).padStart(3, "0")}-${slugify2(stem).slice(0, 48) || "asset"}${ext}`;
95097
95106
  }
95098
95107
  function buildNextActions(args) {
@@ -95243,7 +95252,7 @@ function printManifestSummary(manifest) {
95243
95252
  console.log(`Media: ${manifest.assets.downloaded}/${manifest.assets.images} downloaded`);
95244
95253
  }
95245
95254
  console.log(`Recommendation: ${manifest.recommendation.mode}`);
95246
- console.log(`Artifacts: ${path36.join(manifest.project.root, manifest.project.migrationDir)}`);
95255
+ console.log(`Artifacts: ${path37.join(manifest.project.root, manifest.project.migrationDir)}`);
95247
95256
  if (manifest.unresolved.length > 0) {
95248
95257
  console.log("\nUnresolved");
95249
95258
  for (const issue2 of manifest.unresolved) {
@@ -95438,7 +95447,7 @@ function toPascalCase(value) {
95438
95447
  return value.split(/[^a-zA-Z0-9]/).filter(Boolean).map((part) => part.charAt(0).toUpperCase() + part.slice(1)).join("");
95439
95448
  }
95440
95449
  function toPosix2(value) {
95441
- return value.split(path36.sep).join("/");
95450
+ return value.split(path37.sep).join("/");
95442
95451
  }
95443
95452
  var DEFAULT_MAX_PAGES, DEFAULT_MAX_ASSETS, MIGRATION_DIR2, CLI_ROOT4, MIGRATION_SKILL_SCRIPTS_DIR, SOURCE_PAGES_DIR, EXTRACTED_DIR, MEDIA_DIR, USER_AGENT, LEGAL_ROUTES, COLLECTION_ROUTE_BLACKLIST;
95444
95453
  var init_migrate = __esm({
@@ -95450,10 +95459,10 @@ var init_migrate = __esm({
95450
95459
  init_migrate_apply();
95451
95460
  DEFAULT_MAX_PAGES = 12;
95452
95461
  DEFAULT_MAX_ASSETS = 40;
95453
- MIGRATION_DIR2 = path36.join(".fimo", "migrations", "current");
95454
- CLI_ROOT4 = path36.resolve(path36.dirname(fileURLToPath7(import.meta.url)), "..", "..", "..");
95455
- MIGRATION_SKILL_SCRIPTS_DIR = path36.join(CLI_ROOT4, "assets", "skills", "fimo-migration", "scripts");
95456
- SOURCE_PAGES_DIR = path36.join("source", "pages");
95462
+ MIGRATION_DIR2 = path37.join(".fimo", "migrations", "current");
95463
+ CLI_ROOT4 = path37.resolve(path37.dirname(fileURLToPath7(import.meta.url)), "..", "..", "..");
95464
+ MIGRATION_SKILL_SCRIPTS_DIR = path37.join(CLI_ROOT4, "assets", "skills", "fimo-migration", "scripts");
95465
+ SOURCE_PAGES_DIR = path37.join("source", "pages");
95457
95466
  EXTRACTED_DIR = "extracted";
95458
95467
  MEDIA_DIR = "media";
95459
95468
  USER_AGENT = "fimo-cli migrate/0.1";
@@ -95538,8 +95547,8 @@ __export(migrate_refine_exports, {
95538
95547
  migrateRefineCommand: () => migrateRefineCommand,
95539
95548
  prepareMigrationRefineArtifacts: () => prepareMigrationRefineArtifacts
95540
95549
  });
95541
- import fs34 from "node:fs";
95542
- import path37 from "node:path";
95550
+ import fs35 from "node:fs";
95551
+ import path38 from "node:path";
95543
95552
  function migrateRefineCommand(options) {
95544
95553
  const projectRoot = requireProjectRoot2(options.cwd);
95545
95554
  if (!projectRoot) {
@@ -95567,11 +95576,11 @@ function migrateRefineCommand(options) {
95567
95576
  console.log(`Project: ${projectRoot}`);
95568
95577
  console.log(`Pages prepared: ${result.pagesPrepared}`);
95569
95578
  console.log(`Focus route: ${result.focusRoute ?? "all routes"}`);
95570
- console.log(`Prompt: ${path37.join(projectRoot, result.promptPath)}`);
95571
- console.log(`Summary: ${path37.join(projectRoot, result.summaryPath)}`);
95579
+ console.log(`Prompt: ${path38.join(projectRoot, result.promptPath)}`);
95580
+ console.log(`Summary: ${path38.join(projectRoot, result.summaryPath)}`);
95572
95581
  console.log(`Page briefs: ${result.pageBriefs.length}`);
95573
95582
  console.log(`
95574
- Next step: open ${path37.join(projectRoot, result.promptPath)} and paste it to your coding agent.`);
95583
+ Next step: open ${path38.join(projectRoot, result.promptPath)} and paste it to your coding agent.`);
95575
95584
  } catch (error45) {
95576
95585
  spinner2.stop(`Migration refine failed: ${error45 instanceof Error ? error45.message : String(error45)}`);
95577
95586
  process.exitCode = 1;
@@ -95586,10 +95595,10 @@ function prepareMigrationRefineArtifacts(args) {
95586
95595
  );
95587
95596
  }
95588
95597
  const generatedArtifacts = readGeneratedArtifacts(cwd);
95589
- const refineRootAbs = path37.join(cwd, REFINE_ROOT);
95590
- const pageBriefsAbs = path37.join(cwd, PAGE_BRIEFS_DIR);
95591
- fs34.rmSync(refineRootAbs, { recursive: true, force: true });
95592
- fs34.mkdirSync(pageBriefsAbs, { recursive: true });
95598
+ const refineRootAbs = path38.join(cwd, REFINE_ROOT);
95599
+ const pageBriefsAbs = path38.join(cwd, PAGE_BRIEFS_DIR);
95600
+ fs35.rmSync(refineRootAbs, { recursive: true, force: true });
95601
+ fs35.mkdirSync(pageBriefsAbs, { recursive: true });
95593
95602
  const written = [];
95594
95603
  const pageSummaries = [];
95595
95604
  const mediaMap = readMediaMap(cwd, manifest);
@@ -95604,8 +95613,8 @@ function prepareMigrationRefineArtifacts(args) {
95604
95613
  });
95605
95614
  pageSummaries.push(pageSummary);
95606
95615
  }
95607
- const summaryPath = path37.join(REFINE_ROOT, "summary.json");
95608
- const promptPath = path37.join(REFINE_ROOT, "agent-prompt.md");
95616
+ const summaryPath = path38.join(REFINE_ROOT, "summary.json");
95617
+ const promptPath = path38.join(REFINE_ROOT, "agent-prompt.md");
95609
95618
  writeFile3(
95610
95619
  cwd,
95611
95620
  summaryPath,
@@ -95634,7 +95643,7 @@ function prepareMigrationRefineArtifacts(args) {
95634
95643
  }
95635
95644
  function requireProjectRoot2(cwdOption) {
95636
95645
  const root2 = resolveProjectCwd(cwdOption);
95637
- if (!fs34.existsSync(path37.join(root2, ".fimo.settings.json"))) {
95646
+ if (!fs35.existsSync(path38.join(root2, ".fimo.settings.json"))) {
95638
95647
  console.error("You are not in a Fimo project. Run `fimo create` first or pass a project directory.");
95639
95648
  return null;
95640
95649
  }
@@ -95649,15 +95658,15 @@ function selectPagesForRefine(manifest, focusRoute) {
95649
95658
  }
95650
95659
  function writePageBrief(args) {
95651
95660
  const { cwd, manifest, page, generatedArtifacts, mediaMap, written } = args;
95652
- const sourceHtmlPath = path37.join(cwd, page.artifacts.html);
95653
- const sourceHtml = fs34.existsSync(sourceHtmlPath) ? fs34.readFileSync(sourceHtmlPath, "utf8") : "";
95661
+ const sourceHtmlPath = path38.join(cwd, page.artifacts.html);
95662
+ const sourceHtml = fs35.existsSync(sourceHtmlPath) ? fs35.readFileSync(sourceHtmlPath, "utf8") : "";
95654
95663
  const outline = analyzeSourceHtml(sourceHtml, manifest.source.url);
95655
95664
  const pageMedia = mediaMap.filter(
95656
95665
  (asset) => outline.images.some((image) => normalizeUrlForMatch(image.src) === normalizeUrlForMatch(asset.sourceUrl))
95657
95666
  );
95658
95667
  const targetModule = resolveGeneratedPageModule(cwd, page.route, generatedArtifacts);
95659
95668
  const currentTemplate = detectCurrentTemplate(targetModule);
95660
- const briefPath = path37.join(PAGE_BRIEFS_DIR, `${routeToBriefFile(page.route)}.md`);
95669
+ const briefPath = path38.join(PAGE_BRIEFS_DIR, `${routeToBriefFile(page.route)}.md`);
95661
95670
  writeFile3(
95662
95671
  cwd,
95663
95672
  briefPath,
@@ -95665,7 +95674,7 @@ function writePageBrief(args) {
95665
95674
  page,
95666
95675
  manifest,
95667
95676
  sourceHtmlPath: page.artifacts.html,
95668
- targetModule: targetModule ? toPosix3(path37.relative(cwd, targetModule)) : null,
95677
+ targetModule: targetModule ? toPosix3(path38.relative(cwd, targetModule)) : null,
95669
95678
  currentTemplate,
95670
95679
  outline,
95671
95680
  pageMedia
@@ -95677,7 +95686,7 @@ function writePageBrief(args) {
95677
95686
  title: page.title,
95678
95687
  kind: page.kind,
95679
95688
  sourceHtml: page.artifacts.html,
95680
- targetModule: targetModule ? toPosix3(path37.relative(cwd, targetModule)) : null,
95689
+ targetModule: targetModule ? toPosix3(path38.relative(cwd, targetModule)) : null,
95681
95690
  currentTemplate,
95682
95691
  briefPath,
95683
95692
  headings: outline.headings,
@@ -95884,12 +95893,12 @@ function buildAgentPrompt(manifest, pageSummaries, focusRoute) {
95884
95893
  ].join("\n");
95885
95894
  }
95886
95895
  function readGeneratedArtifacts(cwd) {
95887
- const artifactsPath = path37.join(cwd, GENERATED_ARTIFACTS_PATH);
95888
- if (!fs34.existsSync(artifactsPath)) {
95896
+ const artifactsPath = path38.join(cwd, GENERATED_ARTIFACTS_PATH);
95897
+ if (!fs35.existsSync(artifactsPath)) {
95889
95898
  return null;
95890
95899
  }
95891
95900
  try {
95892
- return JSON.parse(fs34.readFileSync(artifactsPath, "utf8"));
95901
+ return JSON.parse(fs35.readFileSync(artifactsPath, "utf8"));
95893
95902
  } catch {
95894
95903
  return null;
95895
95904
  }
@@ -95899,12 +95908,12 @@ function readMediaMap(cwd, manifest) {
95899
95908
  if (!mediaMapPath) {
95900
95909
  return [];
95901
95910
  }
95902
- const fullPath = path37.join(cwd, mediaMapPath);
95903
- if (!fs34.existsSync(fullPath)) {
95911
+ const fullPath = path38.join(cwd, mediaMapPath);
95912
+ if (!fs35.existsSync(fullPath)) {
95904
95913
  return [];
95905
95914
  }
95906
95915
  try {
95907
- const parsed = JSON.parse(fs34.readFileSync(fullPath, "utf8"));
95916
+ const parsed = JSON.parse(fs35.readFileSync(fullPath, "utf8"));
95908
95917
  if (!Array.isArray(parsed)) {
95909
95918
  return [];
95910
95919
  }
@@ -95920,20 +95929,20 @@ function isRecord(value) {
95920
95929
  return typeof value === "object" && value !== null && !Array.isArray(value);
95921
95930
  }
95922
95931
  function resolveGeneratedPageModule(cwd, routePath, generatedArtifacts) {
95923
- const expected = path37.join(cwd, "src", "pages", "migrated", `${pageComponentName2(routePath)}.tsx`);
95924
- if (fs34.existsSync(expected)) {
95932
+ const expected = path38.join(cwd, "src", "pages", "migrated", `${pageComponentName2(routePath)}.tsx`);
95933
+ if (fs35.existsSync(expected)) {
95925
95934
  return expected;
95926
95935
  }
95927
95936
  const pageFiles = generatedArtifacts?.pageFiles ?? [];
95928
95937
  const expectedBase = `${pageComponentName2(routePath)}.tsx`;
95929
- const fallback = pageFiles.map((relativePath) => path37.join(cwd, relativePath)).find((filePath) => path37.basename(filePath) === expectedBase);
95930
- return fallback && fs34.existsSync(fallback) ? fallback : null;
95938
+ const fallback = pageFiles.map((relativePath) => path38.join(cwd, relativePath)).find((filePath) => path38.basename(filePath) === expectedBase);
95939
+ return fallback && fs35.existsSync(fallback) ? fallback : null;
95931
95940
  }
95932
95941
  function detectCurrentTemplate(targetModule) {
95933
- if (!targetModule || !fs34.existsSync(targetModule)) {
95942
+ if (!targetModule || !fs35.existsSync(targetModule)) {
95934
95943
  return "custom-or-missing";
95935
95944
  }
95936
- const source = fs34.readFileSync(targetModule, "utf8");
95945
+ const source = fs35.readFileSync(targetModule, "utf8");
95937
95946
  return source.includes("MigrationPageTemplate") ? "generic-migration-template" : "custom-or-missing";
95938
95947
  }
95939
95948
  function routeToBriefFile(routePath) {
@@ -95978,9 +95987,9 @@ function absolutizeHref(value, baseUrl) {
95978
95987
  }
95979
95988
  }
95980
95989
  function writeFile3(cwd, relativePath, content2, written) {
95981
- const fullPath = path37.join(cwd, relativePath);
95982
- fs34.mkdirSync(path37.dirname(fullPath), { recursive: true });
95983
- fs34.writeFileSync(fullPath, content2, "utf8");
95990
+ const fullPath = path38.join(cwd, relativePath);
95991
+ fs35.mkdirSync(path38.dirname(fullPath), { recursive: true });
95992
+ fs35.writeFileSync(fullPath, content2, "utf8");
95984
95993
  written.push(relativePath);
95985
95994
  }
95986
95995
  function unique3(values) {
@@ -96048,7 +96057,7 @@ function slugify3(value) {
96048
96057
  return value.normalize("NFKD").replace(/[\u0300-\u036f]/g, "").toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "");
96049
96058
  }
96050
96059
  function toPosix3(value) {
96051
- return value.split(path37.sep).join("/");
96060
+ return value.split(path38.sep).join("/");
96052
96061
  }
96053
96062
  var REFINE_ROOT, PAGE_BRIEFS_DIR, GENERATED_ARTIFACTS_PATH;
96054
96063
  var init_migrate_refine = __esm({
@@ -96057,9 +96066,9 @@ var init_migrate_refine = __esm({
96057
96066
  init_esm12();
96058
96067
  init_project();
96059
96068
  init_migrate();
96060
- REFINE_ROOT = path37.join(MIGRATION_DIR2, "refine");
96061
- PAGE_BRIEFS_DIR = path37.join(REFINE_ROOT, "pages");
96062
- GENERATED_ARTIFACTS_PATH = path37.join(MIGRATION_DIR2, "generated", "artifacts.json");
96069
+ REFINE_ROOT = path38.join(MIGRATION_DIR2, "refine");
96070
+ PAGE_BRIEFS_DIR = path38.join(REFINE_ROOT, "pages");
96071
+ GENERATED_ARTIFACTS_PATH = path38.join(MIGRATION_DIR2, "generated", "artifacts.json");
96063
96072
  __name(migrateRefineCommand, "migrateRefineCommand");
96064
96073
  __name(prepareMigrationRefineArtifacts, "prepareMigrationRefineArtifacts");
96065
96074
  __name(requireProjectRoot2, "requireProjectRoot");
@@ -96196,9 +96205,9 @@ async function localCodeSurface(cwd) {
96196
96205
  const lines = out.split("\n").filter(Boolean);
96197
96206
  const items = lines.map((line) => {
96198
96207
  const code2 = line.slice(0, 2);
96199
- const path43 = line.slice(3).trim();
96208
+ const path44 = line.slice(3).trim();
96200
96209
  const verb = code2.startsWith("A") || code2.startsWith("?") ? "added" : code2.startsWith("D") ? "removed" : "changed";
96201
- return { verb, key: path43, origin: "local-uncommitted" };
96210
+ return { verb, key: path44, origin: "local-uncommitted" };
96202
96211
  });
96203
96212
  return {
96204
96213
  surface: "code",
@@ -96312,8 +96321,8 @@ var init_status = __esm({
96312
96321
 
96313
96322
  // src/cli/index.ts
96314
96323
  init_dist();
96315
- import fs39 from "node:fs";
96316
- import path42 from "node:path";
96324
+ import fs40 from "node:fs";
96325
+ import path43 from "node:path";
96317
96326
 
96318
96327
  // ../../node_modules/.pnpm/commander@13.1.0/node_modules/commander/esm.mjs
96319
96328
  var import_index = __toESM(require_commander(), 1);
@@ -96506,8 +96515,8 @@ function parseYamlStrict(text3, file2, bundlePath) {
96506
96515
  }
96507
96516
  __name(parseYamlStrict, "parseYamlStrict");
96508
96517
  function formatZodIssue(issue2) {
96509
- const path43 = issue2.path.length === 0 ? "(root)" : issue2.path.join(".");
96510
- return `${path43}: ${issue2.message}`;
96518
+ const path44 = issue2.path.length === 0 ? "(root)" : issue2.path.join(".");
96519
+ return `${path44}: ${issue2.message}`;
96511
96520
  }
96512
96521
  __name(formatZodIssue, "formatZodIssue");
96513
96522
  async function parseBundle(bundlePath, opts = {}) {
@@ -100465,8 +100474,8 @@ __name(creditsCommand, "creditsCommand");
100465
100474
  init_dist6();
100466
100475
  init_esm();
100467
100476
  init_dist();
100468
- import fs23 from "node:fs";
100469
- import path28 from "node:path";
100477
+ import fs24 from "node:fs";
100478
+ import path29 from "node:path";
100470
100479
 
100471
100480
  // src/scripts/lib/validation-report.ts
100472
100481
  function skippedPhase(name, reason) {
@@ -100541,21 +100550,121 @@ __name(formatPhaseHuman, "formatPhaseHuman");
100541
100550
  init_api();
100542
100551
  init_config2();
100543
100552
  init_auth_errors();
100553
+
100554
+ // src/cli/utils/dev-release.ts
100555
+ import fs19 from "node:fs";
100556
+ import path23 from "node:path";
100557
+ var DEP_FIELDS = ["dependencies", "devDependencies"];
100558
+ function prepareDevFimoDependencyForDeploy(cwd) {
100559
+ const packagePath = path23.join(cwd, "package.json");
100560
+ if (!fs19.existsSync(packagePath)) {
100561
+ return null;
100562
+ }
100563
+ const original = fs19.readFileSync(packagePath, "utf8");
100564
+ const pkg = JSON.parse(original);
100565
+ const fileSpec = findLocalFimoSpec(pkg);
100566
+ if (!fileSpec) {
100567
+ return null;
100568
+ }
100569
+ const localPackageRoot = resolveFileSpec(fileSpec, cwd);
100570
+ const devJsonPath = findDevJson(localPackageRoot);
100571
+ if (!devJsonPath) {
100572
+ throw new Error(
100573
+ `Found local fimo dependency "${fileSpec}", but no .fimo/dev.json exists above ${localPackageRoot}. Publish an experimental CLI build from the Fimo repo first.`
100574
+ );
100575
+ }
100576
+ const state = readDevReleaseState(devJsonPath);
100577
+ if (!state.version) {
100578
+ throw new Error(`Missing "version" in ${devJsonPath}. Publish an experimental CLI build again.`);
100579
+ }
100580
+ const changed = replaceLocalFimoSpecs(pkg, state.version);
100581
+ if (!changed) {
100582
+ return null;
100583
+ }
100584
+ fs19.writeFileSync(packagePath, JSON.stringify(pkg, null, 2) + "\n");
100585
+ return {
100586
+ devJsonPath,
100587
+ packagePath,
100588
+ version: state.version,
100589
+ restore: /* @__PURE__ */ __name(() => fs19.writeFileSync(packagePath, original), "restore")
100590
+ };
100591
+ }
100592
+ __name(prepareDevFimoDependencyForDeploy, "prepareDevFimoDependencyForDeploy");
100593
+ function findLocalFimoSpec(pkg) {
100594
+ for (const field of DEP_FIELDS) {
100595
+ const spec = pkg[field]?.fimo;
100596
+ if (typeof spec === "string" && spec.startsWith("file:")) {
100597
+ return spec;
100598
+ }
100599
+ }
100600
+ return null;
100601
+ }
100602
+ __name(findLocalFimoSpec, "findLocalFimoSpec");
100603
+ function replaceLocalFimoSpecs(pkg, version2) {
100604
+ let changed = false;
100605
+ for (const field of DEP_FIELDS) {
100606
+ const deps = pkg[field];
100607
+ if (!deps) {
100608
+ continue;
100609
+ }
100610
+ const spec = deps.fimo;
100611
+ if (typeof spec === "string" && spec.startsWith("file:") && spec !== version2) {
100612
+ deps.fimo = version2;
100613
+ changed = true;
100614
+ }
100615
+ }
100616
+ return changed;
100617
+ }
100618
+ __name(replaceLocalFimoSpecs, "replaceLocalFimoSpecs");
100619
+ function resolveFileSpec(spec, cwd) {
100620
+ const rawPath = spec.slice("file:".length);
100621
+ const packagePath = path23.isAbsolute(rawPath) ? rawPath : path23.resolve(cwd, rawPath);
100622
+ return path23.resolve(packagePath);
100623
+ }
100624
+ __name(resolveFileSpec, "resolveFileSpec");
100625
+ function findDevJson(startPath) {
100626
+ let current = startPath;
100627
+ while (true) {
100628
+ const candidate = path23.join(current, ".fimo", "dev.json");
100629
+ if (fs19.existsSync(candidate)) {
100630
+ return candidate;
100631
+ }
100632
+ const parent2 = path23.dirname(current);
100633
+ if (parent2 === current) {
100634
+ return null;
100635
+ }
100636
+ current = parent2;
100637
+ }
100638
+ }
100639
+ __name(findDevJson, "findDevJson");
100640
+ function readDevReleaseState(devJsonPath) {
100641
+ const parsed = JSON.parse(fs19.readFileSync(devJsonPath, "utf8"));
100642
+ if (typeof parsed.version !== "string" || parsed.version.trim().length === 0) {
100643
+ return { version: "", channel: null };
100644
+ }
100645
+ return {
100646
+ version: parsed.version.trim(),
100647
+ channel: typeof parsed.channel === "string" && parsed.channel.trim() ? parsed.channel.trim() : null
100648
+ };
100649
+ }
100650
+ __name(readDevReleaseState, "readDevReleaseState");
100651
+
100652
+ // src/cli/commands/deploy.ts
100544
100653
  init_git_credential_setup();
100545
100654
  init_git();
100546
100655
  init_interactive();
100547
100656
  init_project_context();
100548
100657
 
100549
100658
  // src/cli/commands/validate.ts
100550
- import path27 from "node:path";
100659
+ import path28 from "node:path";
100551
100660
  init_dist();
100552
100661
  init_extract_translations();
100553
100662
  init_sync_forms();
100554
100663
  init_sync_schemas();
100555
100664
 
100556
100665
  // src/scripts/validate-route-metadata.ts
100557
- import fs20 from "node:fs";
100558
- import path24 from "node:path";
100666
+ import fs21 from "node:fs";
100667
+ import path25 from "node:path";
100559
100668
 
100560
100669
  // src/scripts/lib/parse-routes-file.ts
100561
100670
  function parseRoutesSource(source) {
@@ -100603,7 +100712,7 @@ __name(parseRoutesSource, "parseRoutesSource");
100603
100712
  // src/scripts/validate-route-metadata.ts
100604
100713
  function readJson(filePath) {
100605
100714
  try {
100606
- return JSON.parse(fs20.readFileSync(filePath, "utf-8"));
100715
+ return JSON.parse(fs21.readFileSync(filePath, "utf-8"));
100607
100716
  } catch {
100608
100717
  return {};
100609
100718
  }
@@ -100629,15 +100738,15 @@ function loadConfigRoutes(config2) {
100629
100738
  __name(loadConfigRoutes, "loadConfigRoutes");
100630
100739
  function validateRouteMetadata(options = {}) {
100631
100740
  const cwd = options.cwd ?? process.cwd();
100632
- const configFilePath = path24.resolve(cwd, "fimo-config.json");
100633
- const srcDir = path24.resolve(cwd, "src");
100634
- const routesFilePath = path24.resolve(srcDir, "routes.ts");
100741
+ const configFilePath = path25.resolve(cwd, "fimo-config.json");
100742
+ const srcDir = path25.resolve(cwd, "src");
100743
+ const routesFilePath = path25.resolve(srcDir, "routes.ts");
100635
100744
  const errors2 = [];
100636
100745
  let fileRoutes = [];
100637
- if (!fs20.existsSync(routesFilePath)) {
100746
+ if (!fs21.existsSync(routesFilePath)) {
100638
100747
  errors2.push("Missing src/routes.ts.");
100639
100748
  } else {
100640
- const source = fs20.readFileSync(routesFilePath, "utf-8");
100749
+ const source = fs21.readFileSync(routesFilePath, "utf-8");
100641
100750
  fileRoutes = parseRoutesSource(source);
100642
100751
  }
100643
100752
  const pathToFile = /* @__PURE__ */ new Map();
@@ -100683,8 +100792,8 @@ Fix: add the route to src/routes.ts. Example: route('${route.path.replace(/^\//,
100683
100792
  if (!file2) {
100684
100793
  continue;
100685
100794
  }
100686
- const routeModulePath = path24.resolve(srcDir, file2);
100687
- if (!fs20.existsSync(routeModulePath)) {
100795
+ const routeModulePath = path25.resolve(srcDir, file2);
100796
+ if (!fs21.existsSync(routeModulePath)) {
100688
100797
  errors2.push(
100689
100798
  `Route "${route.id}" (${route.path}) references missing module "${file2}".
100690
100799
  Fix: create the file at src/${file2}.`
@@ -100766,11 +100875,11 @@ import { existsSync as existsSync9, readFileSync as readFileSync8, readdirSync a
100766
100875
  import { join as join11, resolve as resolve5 } from "node:path";
100767
100876
 
100768
100877
  // src/scripts/export-static.ts
100769
- import fs21 from "node:fs/promises";
100770
- import path25 from "node:path";
100878
+ import fs22 from "node:fs/promises";
100879
+ import path26 from "node:path";
100771
100880
  async function pathExists(targetPath) {
100772
100881
  try {
100773
- await fs21.access(targetPath);
100882
+ await fs22.access(targetPath);
100774
100883
  return true;
100775
100884
  } catch {
100776
100885
  return false;
@@ -100778,26 +100887,26 @@ async function pathExists(targetPath) {
100778
100887
  }
100779
100888
  __name(pathExists, "pathExists");
100780
100889
  async function removeDataFiles(dir) {
100781
- const entries2 = await fs21.readdir(dir, { withFileTypes: true });
100890
+ const entries2 = await fs22.readdir(dir, { withFileTypes: true });
100782
100891
  for (const entry of entries2) {
100783
- const fullPath = path25.join(dir, entry.name);
100892
+ const fullPath = path26.join(dir, entry.name);
100784
100893
  if (entry.isDirectory()) {
100785
100894
  await removeDataFiles(fullPath);
100786
100895
  } else if (entry.name.endsWith(".data")) {
100787
- await fs21.rm(fullPath);
100896
+ await fs22.rm(fullPath);
100788
100897
  }
100789
100898
  }
100790
100899
  }
100791
100900
  __name(removeDataFiles, "removeDataFiles");
100792
100901
  async function exportStatic(options = {}) {
100793
100902
  const cwd = options.cwd ?? process.cwd();
100794
- const clientDir = path25.resolve(cwd, "dist/client");
100795
- const serverDir = path25.resolve(cwd, "dist/server");
100903
+ const clientDir = path26.resolve(cwd, "dist/client");
100904
+ const serverDir = path26.resolve(cwd, "dist/server");
100796
100905
  if (!await pathExists(clientDir)) {
100797
100906
  throw new Error("Missing dist/client output. Run `react-router build` first.");
100798
100907
  }
100799
100908
  if (await pathExists(serverDir)) {
100800
- await fs21.rm(serverDir, { recursive: true, force: true });
100909
+ await fs22.rm(serverDir, { recursive: true, force: true });
100801
100910
  }
100802
100911
  await removeDataFiles(clientDir);
100803
100912
  console.log("Static export complete.");
@@ -101079,8 +101188,8 @@ if (isStandalone) {
101079
101188
  }
101080
101189
 
101081
101190
  // src/scripts/resolve-routes.ts
101082
- import fs22 from "node:fs";
101083
- import path26 from "node:path";
101191
+ import fs23 from "node:fs";
101192
+ import path27 from "node:path";
101084
101193
  var SCAN_EXTENSIONS = [".ts", ".tsx", ".js", ".jsx", ".mjs"];
101085
101194
  var SCAN_EXTENSIONS_SET = new Set(SCAN_EXTENSIONS);
101086
101195
  var SKIP_DIRS = /* @__PURE__ */ new Set(["node_modules", "dist", ".next", ".fimo", ".git", "public"]);
@@ -101103,18 +101212,18 @@ function isGlobalFile(filePath) {
101103
101212
  __name(isGlobalFile, "isGlobalFile");
101104
101213
  function collectFiles(dir) {
101105
101214
  const files = [];
101106
- if (!fs22.existsSync(dir)) {
101215
+ if (!fs23.existsSync(dir)) {
101107
101216
  return files;
101108
101217
  }
101109
- const entries2 = fs22.readdirSync(dir, { withFileTypes: true });
101218
+ const entries2 = fs23.readdirSync(dir, { withFileTypes: true });
101110
101219
  for (const entry of entries2) {
101111
101220
  if (SKIP_DIRS.has(entry.name)) {
101112
101221
  continue;
101113
101222
  }
101114
- const fullPath = path26.join(dir, entry.name);
101223
+ const fullPath = path27.join(dir, entry.name);
101115
101224
  if (entry.isDirectory()) {
101116
101225
  files.push(...collectFiles(fullPath));
101117
- } else if (SCAN_EXTENSIONS_SET.has(path26.extname(entry.name))) {
101226
+ } else if (SCAN_EXTENSIONS_SET.has(path27.extname(entry.name))) {
101118
101227
  files.push(fullPath);
101119
101228
  }
101120
101229
  }
@@ -101141,24 +101250,24 @@ __name(extractImports, "extractImports");
101141
101250
  function resolveImport(specifier, fromDir, srcDir) {
101142
101251
  let targetPath;
101143
101252
  if (specifier.startsWith("@/")) {
101144
- targetPath = path26.resolve(srcDir, specifier.slice(2));
101253
+ targetPath = path27.resolve(srcDir, specifier.slice(2));
101145
101254
  } else if (specifier.startsWith(".")) {
101146
- targetPath = path26.resolve(fromDir, specifier);
101255
+ targetPath = path27.resolve(fromDir, specifier);
101147
101256
  } else {
101148
101257
  return null;
101149
101258
  }
101150
- if (fs22.existsSync(targetPath) && fs22.statSync(targetPath).isFile()) {
101259
+ if (fs23.existsSync(targetPath) && fs23.statSync(targetPath).isFile()) {
101151
101260
  return targetPath;
101152
101261
  }
101153
101262
  for (const ext of SCAN_EXTENSIONS) {
101154
101263
  const withExt = targetPath + ext;
101155
- if (fs22.existsSync(withExt)) {
101264
+ if (fs23.existsSync(withExt)) {
101156
101265
  return withExt;
101157
101266
  }
101158
101267
  }
101159
101268
  for (const ext of SCAN_EXTENSIONS) {
101160
- const indexFile = path26.join(targetPath, "index" + ext);
101161
- if (fs22.existsSync(indexFile)) {
101269
+ const indexFile = path27.join(targetPath, "index" + ext);
101270
+ if (fs23.existsSync(indexFile)) {
101162
101271
  return indexFile;
101163
101272
  }
101164
101273
  }
@@ -101166,11 +101275,11 @@ function resolveImport(specifier, fromDir, srcDir) {
101166
101275
  }
101167
101276
  __name(resolveImport, "resolveImport");
101168
101277
  function discoverRoutes(srcDir, root2) {
101169
- const routesFilePath = path26.resolve(srcDir, "routes.ts");
101170
- if (!fs22.existsSync(routesFilePath)) {
101278
+ const routesFilePath = path27.resolve(srcDir, "routes.ts");
101279
+ if (!fs23.existsSync(routesFilePath)) {
101171
101280
  return /* @__PURE__ */ new Map();
101172
101281
  }
101173
- const source = fs22.readFileSync(routesFilePath, "utf-8");
101282
+ const source = fs23.readFileSync(routesFilePath, "utf-8");
101174
101283
  const parsed = parseRoutesSource(source);
101175
101284
  const fileToRoutes = /* @__PURE__ */ new Map();
101176
101285
  for (const r of parsed) {
@@ -101181,7 +101290,7 @@ function discoverRoutes(srcDir, root2) {
101181
101290
  if (!resolved) {
101182
101291
  continue;
101183
101292
  }
101184
- const rel = path26.relative(root2, resolved);
101293
+ const rel = path27.relative(root2, resolved);
101185
101294
  if (!fileToRoutes.has(rel)) {
101186
101295
  fileToRoutes.set(rel, /* @__PURE__ */ new Set());
101187
101296
  }
@@ -101196,18 +101305,18 @@ function buildReverseImportGraph(srcDir, root2) {
101196
101305
  for (const filePath of allFiles) {
101197
101306
  let content2;
101198
101307
  try {
101199
- content2 = fs22.readFileSync(filePath, "utf-8");
101308
+ content2 = fs23.readFileSync(filePath, "utf-8");
101200
101309
  } catch {
101201
101310
  continue;
101202
101311
  }
101203
101312
  const imports = extractImports(content2);
101204
101313
  for (const specifier of imports) {
101205
- const resolved = resolveImport(specifier, path26.dirname(filePath), srcDir);
101314
+ const resolved = resolveImport(specifier, path27.dirname(filePath), srcDir);
101206
101315
  if (!resolved) {
101207
101316
  continue;
101208
101317
  }
101209
- const resolvedRel = path26.relative(root2, resolved);
101210
- const importerRel = path26.relative(root2, filePath);
101318
+ const resolvedRel = path27.relative(root2, resolved);
101319
+ const importerRel = path27.relative(root2, filePath);
101211
101320
  if (!fileToImporters.has(resolvedRel)) {
101212
101321
  fileToImporters.set(resolvedRel, /* @__PURE__ */ new Set());
101213
101322
  }
@@ -101247,7 +101356,7 @@ function resolveAffectedRoutes(file2, fileToImporters, fileToRoutes) {
101247
101356
  __name(resolveAffectedRoutes, "resolveAffectedRoutes");
101248
101357
  function resolveRoutes(changedFiles, options = {}) {
101249
101358
  const root2 = options.cwd ?? process.cwd();
101250
- const srcDir = path26.resolve(root2, "src");
101359
+ const srcDir = path27.resolve(root2, "src");
101251
101360
  const normalizedChangedFiles = changedFiles.map((f) => f.replace(/^\/+/, ""));
101252
101361
  if (normalizedChangedFiles.length === 0) {
101253
101362
  return { routeMap: {}, routes: [], unresolvedFiles: [] };
@@ -101531,7 +101640,7 @@ async function runAgentIntegrationAvailabilityCheck(opts) {
101531
101640
  } catch {
101532
101641
  return [];
101533
101642
  }
101534
- const bundles = await listBundles(path27.join(projectRoot, "agents"));
101643
+ const bundles = await listBundles(path28.join(projectRoot, "agents"));
101535
101644
  const requiredByAgent = bundles.map((bundle) => {
101536
101645
  const policy = agentIntegrationPolicy(bundle.config);
101537
101646
  return {
@@ -101611,7 +101720,7 @@ async function runAgentSecretAvailabilityCheck(opts) {
101611
101720
  } catch {
101612
101721
  return [];
101613
101722
  }
101614
- const bundles = await listBundles(path27.join(projectRoot, "agents"));
101723
+ const bundles = await listBundles(path28.join(projectRoot, "agents"));
101615
101724
  const requiredByAgent = bundles.map((bundle) => ({
101616
101725
  name: bundle.name,
101617
101726
  keys: (bundle.config.secrets ?? []).filter((secret) => secret.required !== false).map((secret) => secret.key)
@@ -101742,9 +101851,9 @@ __name(runSyncPhase, "runSyncPhase");
101742
101851
 
101743
101852
  // src/cli/commands/deploy.ts
101744
101853
  async function deployCommand(options, cmd) {
101745
- const cwd = path28.resolve(options.cwd ?? process.cwd());
101746
- const fimoPath = path28.join(cwd, ".fimo.settings.json");
101747
- if (!fs23.existsSync(fimoPath)) {
101854
+ const cwd = path29.resolve(options.cwd ?? process.cwd());
101855
+ const fimoPath = path29.join(cwd, ".fimo.settings.json");
101856
+ if (!fs24.existsSync(fimoPath)) {
101748
101857
  ui.error({
101749
101858
  command: "deploy",
101750
101859
  code: "NOT_IN_PROJECT",
@@ -101753,7 +101862,7 @@ async function deployCommand(options, cmd) {
101753
101862
  });
101754
101863
  return;
101755
101864
  }
101756
- const local = JSON.parse(fs23.readFileSync(fimoPath, "utf-8"));
101865
+ const local = JSON.parse(fs24.readFileSync(fimoPath, "utf-8"));
101757
101866
  if (!await isGitRepo(cwd)) {
101758
101867
  ui.error({ command: "deploy", code: "NOT_A_GIT_REPO", message: "Not a git repository." });
101759
101868
  return;
@@ -101811,46 +101920,64 @@ async function deployCommand(options, cmd) {
101811
101920
  } else {
101812
101921
  validateSp.succeed("Validation passed");
101813
101922
  }
101814
- if (await hasUncommittedChanges(cwd)) {
101815
- let message;
101816
- if (options.message !== void 0) {
101817
- message = options.message;
101818
- } else {
101819
- assertInteractive('Pass -m "<message>" or commit your changes manually.', "deploy");
101820
- if (isPretty2) {
101821
- O2.warn("You have uncommitted changes. Commit them before deploying.");
101822
- }
101823
- const answer = await Ot({
101824
- message: "Commit message",
101825
- placeholder: "Deploy",
101826
- defaultValue: "Deploy"
101827
- });
101828
- if (q(answer)) {
101829
- ui.info({ command: "deploy", message: "Cancelled." });
101830
- return;
101831
- }
101832
- message = String(answer);
101833
- }
101834
- const commitSp = spinner("Committing pending changes");
101835
- await runGit2(["add", "-A"], cwd);
101836
- await runGit2(["commit", "-m", message], cwd);
101837
- commitSp.succeed("Changes committed");
101838
- }
101839
- const remoteSp = spinner("Refreshing git remote URL");
101840
- const remote = await api.getGitRemote(local.projectId, ctx.env);
101841
- await ensureFimoRemote(cwd, remote.url);
101842
- const remoteBranch = remote.branch;
101843
- remoteSp.succeed(`Remote ready (branch ${remoteBranch})`);
101844
- const pushSp = spinner(`Pushing to fimo/${remoteBranch}`);
101923
+ let devFimoDependency = null;
101845
101924
  try {
101846
- await runGit2(["push", "fimo", `HEAD:${remoteBranch}`], cwd);
101847
- pushSp.succeed("Pushed to Fimo");
101925
+ devFimoDependency = prepareDevFimoDependencyForDeploy(cwd);
101848
101926
  } catch (error45) {
101849
- pushSp.fail("Push failed");
101850
- const failure = classifyPushError(error45);
101851
- emitPushFailure(failure, remoteBranch);
101927
+ ui.error({
101928
+ command: "deploy",
101929
+ code: "DEV_FIMO_VERSION_MISSING",
101930
+ message: errorMessage(error45)
101931
+ });
101852
101932
  return;
101853
101933
  }
101934
+ if (devFimoDependency && isPretty2) {
101935
+ O2.info(`Deploying with fimo ${devFimoDependency.version}; restoring local file: dependency after push.`);
101936
+ }
101937
+ try {
101938
+ if (await hasUncommittedChanges(cwd)) {
101939
+ let message;
101940
+ if (options.message !== void 0) {
101941
+ message = options.message;
101942
+ } else {
101943
+ assertInteractive('Pass -m "<message>" or commit your changes manually.', "deploy");
101944
+ if (isPretty2) {
101945
+ O2.warn("You have uncommitted changes. Commit them before deploying.");
101946
+ }
101947
+ const answer = await Ot({
101948
+ message: "Commit message",
101949
+ placeholder: "Deploy",
101950
+ defaultValue: "Deploy"
101951
+ });
101952
+ if (q(answer)) {
101953
+ ui.info({ command: "deploy", message: "Cancelled." });
101954
+ return;
101955
+ }
101956
+ message = String(answer);
101957
+ }
101958
+ const commitSp = spinner("Committing pending changes");
101959
+ await runGit2(["add", "-A"], cwd);
101960
+ await runGit2(["commit", "-m", message], cwd);
101961
+ commitSp.succeed("Changes committed");
101962
+ }
101963
+ const remoteSp = spinner("Refreshing git remote URL");
101964
+ const remote = await api.getGitRemote(local.projectId, ctx.env);
101965
+ await ensureFimoRemote(cwd, remote.url);
101966
+ const remoteBranch = remote.branch;
101967
+ remoteSp.succeed(`Remote ready (branch ${remoteBranch})`);
101968
+ const pushSp = spinner(`Pushing to fimo/${remoteBranch}`);
101969
+ try {
101970
+ await runGit2(["push", "fimo", `HEAD:${remoteBranch}`], cwd);
101971
+ pushSp.succeed("Pushed to Fimo");
101972
+ } catch (error45) {
101973
+ pushSp.fail("Push failed");
101974
+ const failure = classifyPushError(error45);
101975
+ emitPushFailure(failure, remoteBranch);
101976
+ return;
101977
+ }
101978
+ } finally {
101979
+ devFimoDependency?.restore();
101980
+ }
101854
101981
  let stepLabel = "";
101855
101982
  let stepStartedAt = 0;
101856
101983
  let stepSp = null;
@@ -102021,8 +102148,8 @@ __name(errorMessage, "errorMessage");
102021
102148
  // src/cli/commands/describe.ts
102022
102149
  init_dist();
102023
102150
  init_project();
102024
- import fs24 from "node:fs";
102025
- import path29 from "node:path";
102151
+ import fs25 from "node:fs";
102152
+ import path30 from "node:path";
102026
102153
  var DEFAULT_DEPTH = 3;
102027
102154
  var HARD_ENTRY_CAP = 1e4;
102028
102155
  var WIDE_DIR_THRESHOLD = 20;
@@ -102041,7 +102168,7 @@ async function describeCommand(targetPath, options) {
102041
102168
  const cwd = resolveProjectCwd(options.cwd);
102042
102169
  const full = options.full === true;
102043
102170
  const depth = full ? Number.POSITIVE_INFINITY : parseDepth(options.depth);
102044
- const scope = targetPath ? path29.resolve(cwd, targetPath) : null;
102171
+ const scope = targetPath ? path30.resolve(cwd, targetPath) : null;
102045
102172
  const description = buildDescription({ cwd, depth, scope });
102046
102173
  ui.result({
102047
102174
  command: "describe",
@@ -102059,9 +102186,9 @@ function parseDepth(raw) {
102059
102186
  __name(parseDepth, "parseDepth");
102060
102187
  function buildDescription(opts) {
102061
102188
  const { cwd, depth, scope } = opts;
102062
- const packageJson = readJsonSafe(path29.join(cwd, "package.json"));
102063
- const fimoConfig = readJsonSafe(path29.join(cwd, "fimo-config.json"));
102064
- const projectName = packageJson?.name ?? path29.basename(cwd);
102189
+ const packageJson = readJsonSafe(path30.join(cwd, "package.json"));
102190
+ const fimoConfig = readJsonSafe(path30.join(cwd, "fimo-config.json"));
102191
+ const projectName = packageJson?.name ?? path30.basename(cwd);
102065
102192
  const configVersion = fimoConfig?.version != null ? String(fimoConfig.version) : null;
102066
102193
  return {
102067
102194
  project: { name: projectName, version: configVersion },
@@ -102077,7 +102204,7 @@ function buildDescription(opts) {
102077
102204
  __name(buildDescription, "buildDescription");
102078
102205
  function readJsonSafe(filePath) {
102079
102206
  try {
102080
- return JSON.parse(fs24.readFileSync(filePath, "utf-8"));
102207
+ return JSON.parse(fs25.readFileSync(filePath, "utf-8"));
102081
102208
  } catch {
102082
102209
  return null;
102083
102210
  }
@@ -102116,10 +102243,10 @@ function normalizeVersion(raw) {
102116
102243
  }
102117
102244
  __name(normalizeVersion, "normalizeVersion");
102118
102245
  function detectPackageManager2(cwd) {
102119
- if (fs24.existsSync(path29.join(cwd, "pnpm-lock.yaml"))) return "pnpm";
102120
- if (fs24.existsSync(path29.join(cwd, "bun.lockb"))) return "bun";
102121
- if (fs24.existsSync(path29.join(cwd, "yarn.lock"))) return "yarn";
102122
- if (fs24.existsSync(path29.join(cwd, "package-lock.json"))) return "npm";
102246
+ if (fs25.existsSync(path30.join(cwd, "pnpm-lock.yaml"))) return "pnpm";
102247
+ if (fs25.existsSync(path30.join(cwd, "bun.lockb"))) return "bun";
102248
+ if (fs25.existsSync(path30.join(cwd, "yarn.lock"))) return "yarn";
102249
+ if (fs25.existsSync(path30.join(cwd, "package-lock.json"))) return "npm";
102123
102250
  return "unknown";
102124
102251
  }
102125
102252
  __name(detectPackageManager2, "detectPackageManager");
@@ -102129,16 +102256,16 @@ function countRoutes(config2) {
102129
102256
  }
102130
102257
  __name(countRoutes, "countRoutes");
102131
102258
  function collectSchemas(cwd) {
102132
- const dir = path29.join(cwd, "src", "schemas");
102133
- if (!fs24.existsSync(dir)) return { count: 0, names: [] };
102134
- const names = fs24.readdirSync(dir).filter((f) => f.endsWith(".json")).map((f) => f.replace(/\.json$/, "")).sort();
102259
+ const dir = path30.join(cwd, "src", "schemas");
102260
+ if (!fs25.existsSync(dir)) return { count: 0, names: [] };
102261
+ const names = fs25.readdirSync(dir).filter((f) => f.endsWith(".json")).map((f) => f.replace(/\.json$/, "")).sort();
102135
102262
  return { count: names.length, names };
102136
102263
  }
102137
102264
  __name(collectSchemas, "collectSchemas");
102138
102265
  function collectLocales(cwd, config2) {
102139
- const translationsDir = path29.join(cwd, "translations");
102140
- if (fs24.existsSync(translationsDir)) {
102141
- const fromDir = fs24.readdirSync(translationsDir).filter((f) => f.endsWith(".json")).map((f) => f.replace(/\.json$/, "")).sort();
102266
+ const translationsDir = path30.join(cwd, "translations");
102267
+ if (fs25.existsSync(translationsDir)) {
102268
+ const fromDir = fs25.readdirSync(translationsDir).filter((f) => f.endsWith(".json")).map((f) => f.replace(/\.json$/, "")).sort();
102142
102269
  if (fromDir.length > 0) return fromDir;
102143
102270
  }
102144
102271
  if (config2?.seo?.locales?.length) return [...config2.seo.locales].sort();
@@ -102149,11 +102276,11 @@ __name(collectLocales, "collectLocales");
102149
102276
  function walkTree(opts) {
102150
102277
  const { cwd, depth, scope } = opts;
102151
102278
  const root2 = scope ?? cwd;
102152
- if (!fs24.existsSync(root2) || !fs24.statSync(root2).isDirectory()) {
102279
+ if (!fs25.existsSync(root2) || !fs25.statSync(root2).isDirectory()) {
102153
102280
  return {
102154
102281
  entries: [],
102155
102282
  depth,
102156
- scope: scope ? path29.relative(cwd, scope) : null,
102283
+ scope: scope ? path30.relative(cwd, scope) : null,
102157
102284
  cappedToDepth1: false,
102158
102285
  totalEntries: 0
102159
102286
  };
@@ -102167,7 +102294,7 @@ function walkTree(opts) {
102167
102294
  return {
102168
102295
  entries: cappedEntries,
102169
102296
  depth: 1,
102170
- scope: scope ? path29.relative(cwd, scope) : null,
102297
+ scope: scope ? path30.relative(cwd, scope) : null,
102171
102298
  cappedToDepth1: true,
102172
102299
  totalEntries: counter.count
102173
102300
  };
@@ -102175,7 +102302,7 @@ function walkTree(opts) {
102175
102302
  return {
102176
102303
  entries: entries2,
102177
102304
  depth,
102178
- scope: scope ? path29.relative(cwd, scope) : null,
102305
+ scope: scope ? path30.relative(cwd, scope) : null,
102179
102306
  cappedToDepth1: false,
102180
102307
  totalEntries: counter.count
102181
102308
  };
@@ -102185,7 +102312,7 @@ function walkDir(dir, depthRemaining, counter) {
102185
102312
  if (counter.capped) return [];
102186
102313
  let names;
102187
102314
  try {
102188
- names = fs24.readdirSync(dir);
102315
+ names = fs25.readdirSync(dir);
102189
102316
  } catch {
102190
102317
  return [];
102191
102318
  }
@@ -102198,7 +102325,7 @@ function walkDir(dir, depthRemaining, counter) {
102198
102325
  }
102199
102326
  let stat2;
102200
102327
  try {
102201
- stat2 = fs24.statSync(path29.join(dir, name));
102328
+ stat2 = fs25.statSync(path30.join(dir, name));
102202
102329
  } catch {
102203
102330
  continue;
102204
102331
  }
@@ -102219,10 +102346,10 @@ function walkDir(dir, depthRemaining, counter) {
102219
102346
  break;
102220
102347
  }
102221
102348
  if (depthRemaining > 1) {
102222
- const childEntries = walkDir(path29.join(dir, name), depthRemaining - 1, counter);
102349
+ const childEntries = walkDir(path30.join(dir, name), depthRemaining - 1, counter);
102223
102350
  result.push({ name, type: "dir", children: childEntries });
102224
102351
  } else {
102225
- const childCount = safeCountChildren(path29.join(dir, name));
102352
+ const childCount = safeCountChildren(path30.join(dir, name));
102226
102353
  result.push({
102227
102354
  name,
102228
102355
  type: "dir",
@@ -102260,7 +102387,7 @@ function walkDir(dir, depthRemaining, counter) {
102260
102387
  __name(walkDir, "walkDir");
102261
102388
  function safeCountChildren(dir) {
102262
102389
  try {
102263
- return fs24.readdirSync(dir).filter((n) => !ALWAYS_SKIP_DIRS.has(n) && !n.startsWith(".")).length;
102390
+ return fs25.readdirSync(dir).filter((n) => !ALWAYS_SKIP_DIRS.has(n) && !n.startsWith(".")).length;
102264
102391
  } catch {
102265
102392
  return 0;
102266
102393
  }
@@ -102944,30 +103071,30 @@ init_dist();
102944
103071
  // ../../node_modules/.pnpm/open@10.2.0/node_modules/open/index.js
102945
103072
  import process7 from "node:process";
102946
103073
  import { Buffer as Buffer2 } from "node:buffer";
102947
- import path30 from "node:path";
103074
+ import path31 from "node:path";
102948
103075
  import { fileURLToPath as fileURLToPath6 } from "node:url";
102949
103076
  import { promisify as promisify8 } from "node:util";
102950
103077
  import childProcess from "node:child_process";
102951
- import fs29, { constants as fsConstants2 } from "node:fs/promises";
103078
+ import fs30, { constants as fsConstants2 } from "node:fs/promises";
102952
103079
 
102953
103080
  // ../../node_modules/.pnpm/wsl-utils@0.1.0/node_modules/wsl-utils/index.js
102954
103081
  import process3 from "node:process";
102955
- import fs28, { constants as fsConstants } from "node:fs/promises";
103082
+ import fs29, { constants as fsConstants } from "node:fs/promises";
102956
103083
 
102957
103084
  // ../../node_modules/.pnpm/is-wsl@3.1.1/node_modules/is-wsl/index.js
102958
103085
  import process2 from "node:process";
102959
103086
  import os2 from "node:os";
102960
- import fs27 from "node:fs";
103087
+ import fs28 from "node:fs";
102961
103088
 
102962
103089
  // ../../node_modules/.pnpm/is-inside-container@1.0.0/node_modules/is-inside-container/index.js
102963
- import fs26 from "node:fs";
103090
+ import fs27 from "node:fs";
102964
103091
 
102965
103092
  // ../../node_modules/.pnpm/is-docker@3.0.0/node_modules/is-docker/index.js
102966
- import fs25 from "node:fs";
103093
+ import fs26 from "node:fs";
102967
103094
  var isDockerCached;
102968
103095
  function hasDockerEnv() {
102969
103096
  try {
102970
- fs25.statSync("/.dockerenv");
103097
+ fs26.statSync("/.dockerenv");
102971
103098
  return true;
102972
103099
  } catch {
102973
103100
  return false;
@@ -102976,7 +103103,7 @@ function hasDockerEnv() {
102976
103103
  __name(hasDockerEnv, "hasDockerEnv");
102977
103104
  function hasDockerCGroup() {
102978
103105
  try {
102979
- return fs25.readFileSync("/proc/self/cgroup", "utf8").includes("docker");
103106
+ return fs26.readFileSync("/proc/self/cgroup", "utf8").includes("docker");
102980
103107
  } catch {
102981
103108
  return false;
102982
103109
  }
@@ -102994,7 +103121,7 @@ __name(isDocker, "isDocker");
102994
103121
  var cachedResult;
102995
103122
  var hasContainerEnv = /* @__PURE__ */ __name(() => {
102996
103123
  try {
102997
- fs26.statSync("/run/.containerenv");
103124
+ fs27.statSync("/run/.containerenv");
102998
103125
  return true;
102999
103126
  } catch {
103000
103127
  return false;
@@ -103020,12 +103147,12 @@ var isWsl = /* @__PURE__ */ __name(() => {
103020
103147
  return true;
103021
103148
  }
103022
103149
  try {
103023
- if (fs27.readFileSync("/proc/version", "utf8").toLowerCase().includes("microsoft")) {
103150
+ if (fs28.readFileSync("/proc/version", "utf8").toLowerCase().includes("microsoft")) {
103024
103151
  return !isInsideContainer();
103025
103152
  }
103026
103153
  } catch {
103027
103154
  }
103028
- if (fs27.existsSync("/proc/sys/fs/binfmt_misc/WSLInterop") || fs27.existsSync("/run/WSL")) {
103155
+ if (fs28.existsSync("/proc/sys/fs/binfmt_misc/WSLInterop") || fs28.existsSync("/run/WSL")) {
103029
103156
  return !isInsideContainer();
103030
103157
  }
103031
103158
  return false;
@@ -103043,14 +103170,14 @@ var wslDrivesMountPoint = /* @__PURE__ */ (() => {
103043
103170
  const configFilePath = "/etc/wsl.conf";
103044
103171
  let isConfigFileExists = false;
103045
103172
  try {
103046
- await fs28.access(configFilePath, fsConstants.F_OK);
103173
+ await fs29.access(configFilePath, fsConstants.F_OK);
103047
103174
  isConfigFileExists = true;
103048
103175
  } catch {
103049
103176
  }
103050
103177
  if (!isConfigFileExists) {
103051
103178
  return defaultMountPoint;
103052
103179
  }
103053
- const configContent = await fs28.readFile(configFilePath, { encoding: "utf8" });
103180
+ const configContent = await fs29.readFile(configFilePath, { encoding: "utf8" });
103054
103181
  const configMountPoint = /(?<!#.*)root\s*=\s*(?<mountPoint>.*)/g.exec(configContent);
103055
103182
  if (!configMountPoint) {
103056
103183
  return defaultMountPoint;
@@ -103213,8 +103340,8 @@ __name(defaultBrowser2, "defaultBrowser");
103213
103340
 
103214
103341
  // ../../node_modules/.pnpm/open@10.2.0/node_modules/open/index.js
103215
103342
  var execFile8 = promisify8(childProcess.execFile);
103216
- var __dirname = path30.dirname(fileURLToPath6(import.meta.url));
103217
- var localXdgOpenPath = path30.join(__dirname, "xdg-open");
103343
+ var __dirname = path31.dirname(fileURLToPath6(import.meta.url));
103344
+ var localXdgOpenPath = path31.join(__dirname, "xdg-open");
103218
103345
  var { platform: platform3, arch } = process7;
103219
103346
  async function getWindowsDefaultBrowserFromWsl() {
103220
103347
  const powershellPath = await powerShellPath();
@@ -103365,7 +103492,7 @@ var baseOpen = /* @__PURE__ */ __name(async (options) => {
103365
103492
  const isBundled = !__dirname || __dirname === "/";
103366
103493
  let exeLocalXdgOpen = false;
103367
103494
  try {
103368
- await fs29.access(localXdgOpenPath, fsConstants2.X_OK);
103495
+ await fs30.access(localXdgOpenPath, fsConstants2.X_OK);
103369
103496
  exeLocalXdgOpen = true;
103370
103497
  } catch {
103371
103498
  }
@@ -104439,8 +104566,8 @@ __name(formsSubmissionsStatsCommand, "formsSubmissionsStatsCommand");
104439
104566
 
104440
104567
  // src/cli/commands/forms.ts
104441
104568
  init_dist();
104442
- import fs30 from "node:fs";
104443
- import path31 from "node:path";
104569
+ import fs31 from "node:fs";
104570
+ import path32 from "node:path";
104444
104571
  init_project_context();
104445
104572
  init_project();
104446
104573
  function renderPrettyJson6(data2) {
@@ -104465,15 +104592,15 @@ async function formsPushCommand(formName, options, cmd) {
104465
104592
  const { ctx, api } = await bootstrapProjectCommand(options, cmd, { refuseReadOnly: true });
104466
104593
  await requireOperation("forms.push", { projectId: ctx.projectId, env: ctx.env });
104467
104594
  const cwd = resolveProjectCwd(options.cwd);
104468
- const formsDir = path31.join(cwd, "src/forms");
104469
- const files = formName ? [`${formName}.json`] : fs30.readdirSync(formsDir).filter((f) => f.endsWith(".json"));
104595
+ const formsDir = path32.join(cwd, "src/forms");
104596
+ const files = formName ? [`${formName}.json`] : fs31.readdirSync(formsDir).filter((f) => f.endsWith(".json"));
104470
104597
  const results = [];
104471
104598
  for (const file2 of files) {
104472
- const filePath = path31.join(formsDir, file2);
104473
- if (!fs30.existsSync(filePath)) {
104599
+ const filePath = path32.join(formsDir, file2);
104600
+ if (!fs31.existsSync(filePath)) {
104474
104601
  throw new Error(`Form file not found: ${filePath}`);
104475
104602
  }
104476
- const form = JSON.parse(fs30.readFileSync(filePath, "utf-8"));
104603
+ const form = JSON.parse(fs31.readFileSync(filePath, "utf-8"));
104477
104604
  const { id, ...payload2 } = form;
104478
104605
  if (id) {
104479
104606
  const result = await api.updateForm(ctx.projectId, id, payload2);
@@ -104481,7 +104608,7 @@ async function formsPushCommand(formName, options, cmd) {
104481
104608
  } else {
104482
104609
  const result = await api.createForm(ctx.projectId, payload2);
104483
104610
  form.id = result.id;
104484
- fs30.writeFileSync(filePath, `${JSON.stringify(form, null, 2)}
104611
+ fs31.writeFileSync(filePath, `${JSON.stringify(form, null, 2)}
104485
104612
  `);
104486
104613
  results.push(result);
104487
104614
  }
@@ -104873,7 +105000,7 @@ __name(installCommand, "installCommand");
104873
105000
 
104874
105001
  // src/cli/commands/integrations.ts
104875
105002
  init_dist6();
104876
- import path32 from "node:path";
105003
+ import path33 from "node:path";
104877
105004
  init_dist();
104878
105005
  init_api();
104879
105006
  init_auth();
@@ -104957,7 +105084,7 @@ async function listAgentRuntimeCommand(api, projectId, opts) {
104957
105084
  );
104958
105085
  }
104959
105086
  const projectRoot = resolveProjectCwd(opts.cwd);
104960
- const bundle = await parseBundle(path32.join(projectRoot, "agents", agentName));
105087
+ const bundle = await parseBundle(path33.join(projectRoot, "agents", agentName));
104961
105088
  const policy = agentIntegrationPolicy(bundle.config);
104962
105089
  const statuses = await api.listProjectIntegrations(projectId);
104963
105090
  const statusByKey = new Map(statuses.map((status) => [status.integrationKey, status]));
@@ -105108,7 +105235,7 @@ async function requireAgentIntegrationTool(integration, tool, opts) {
105108
105235
  );
105109
105236
  }
105110
105237
  const projectRoot = resolveProjectCwd(opts.cwd);
105111
- const bundle = await parseBundle(path32.join(projectRoot, "agents", agentName));
105238
+ const bundle = await parseBundle(path33.join(projectRoot, "agents", agentName));
105112
105239
  const policy = agentIntegrationPolicy(bundle.config);
105113
105240
  const integrationKey = integration.toLowerCase();
105114
105241
  const toolKey = tool.toLowerCase();
@@ -105771,8 +105898,8 @@ init_auth();
105771
105898
  init_config2();
105772
105899
  init_auth_errors();
105773
105900
  init_project();
105774
- import fs31 from "node:fs";
105775
- import path33 from "node:path";
105901
+ import fs32 from "node:fs";
105902
+ import path34 from "node:path";
105776
105903
  var EMAIL_RE = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
105777
105904
  var ORGANIZATION_ROLE_OPTIONS = [
105778
105905
  { value: "member", label: "Member", hint: "Can create projects and view members" },
@@ -106129,8 +106256,8 @@ async function confirmInvite(skipPrompt) {
106129
106256
  __name(confirmInvite, "confirmInvite");
106130
106257
  function tryLoadLocalProject(cwdOption) {
106131
106258
  const cwd = resolveProjectCwd(cwdOption);
106132
- const settingsPath = path33.join(cwd, ".fimo.settings.json");
106133
- if (!fs31.existsSync(settingsPath)) {
106259
+ const settingsPath = path34.join(cwd, ".fimo.settings.json");
106260
+ if (!fs32.existsSync(settingsPath)) {
106134
106261
  return null;
106135
106262
  }
106136
106263
  return loadProjectSettings(cwd);
@@ -106493,7 +106620,7 @@ init_color();
106493
106620
  import { execSync, spawnSync as spawnSync4 } from "node:child_process";
106494
106621
  import { mkdtempSync, readFileSync as readFileSync9, writeFileSync as writeFileSync7 } from "node:fs";
106495
106622
  import { tmpdir as tmpdir3 } from "node:os";
106496
- import path34 from "node:path";
106623
+ import path35 from "node:path";
106497
106624
 
106498
106625
  // src/cli/utils/format/render-merge.ts
106499
106626
  function renderMergeSuccess(result, p2) {
@@ -106891,8 +107018,8 @@ async function resumeMerge(args) {
106891
107018
  __name(resumeMerge, "resumeMerge");
106892
107019
  function openEditorForPick(conflict) {
106893
107020
  const editor = process.env.EDITOR ?? process.env.VISUAL ?? "nano";
106894
- const tmp = mkdtempSync(path34.join(tmpdir3(), "fimo-merge-"));
106895
- const file2 = path34.join(tmp, `${conflict.surface}-${sanitiseKey(conflict.key)}.json`);
107021
+ const tmp = mkdtempSync(path35.join(tmpdir3(), "fimo-merge-"));
107022
+ const file2 = path35.join(tmp, `${conflict.surface}-${sanitiseKey(conflict.key)}.json`);
106896
107023
  const seed = conflict.childValue !== void 0 ? JSON.stringify(conflict.childValue, null, 2) : '// Replace this comment with the resolved value as JSON\n""';
106897
107024
  writeFileSync7(file2, seed, "utf8");
106898
107025
  spawnSync4(editor, [file2], { stdio: "inherit" });
@@ -107226,8 +107353,8 @@ init_dist();
107226
107353
  init_api();
107227
107354
  init_config2();
107228
107355
  init_project();
107229
- import fs35 from "node:fs";
107230
- import path38 from "node:path";
107356
+ import fs36 from "node:fs";
107357
+ import path39 from "node:path";
107231
107358
  function registerProjectSecretsCommands(program2) {
107232
107359
  const vars = program2.command("vars").description("Manage project variables");
107233
107360
  vars.command("list").description("List project variables").option("--project <id>", "Project id (defaults to .fimo.settings.json projectId)").option("-C, --cwd <dir>", "Project directory").action((opts) => listCommand2("variable", opts));
@@ -107339,10 +107466,10 @@ async function writePulledVars(api, projectRoot, projectId, file2) {
107339
107466
  const rows = (await api.listProjectSecretEntries(projectId, { kind: "variable" })).filter(
107340
107467
  (row2) => row2.exposure === "public"
107341
107468
  );
107342
- const target = path38.resolve(projectRoot, file2);
107343
- const existing = fs35.existsSync(target) ? fs35.readFileSync(target, "utf8") : "";
107469
+ const target = path39.resolve(projectRoot, file2);
107470
+ const existing = fs36.existsSync(target) ? fs36.readFileSync(target, "utf8") : "";
107344
107471
  const body = mergeEnvFile(existing, rows);
107345
- fs35.writeFileSync(target, body);
107472
+ fs36.writeFileSync(target, body);
107346
107473
  return { path: target, written: rows.length };
107347
107474
  }
107348
107475
  __name(writePulledVars, "writePulledVars");
@@ -107410,19 +107537,19 @@ init_auth();
107410
107537
  init_config2();
107411
107538
  init_auth_errors();
107412
107539
  init_interactive();
107413
- import fs36 from "node:fs";
107414
- import path39 from "node:path";
107540
+ import fs37 from "node:fs";
107541
+ import path40 from "node:path";
107415
107542
  function resolveCwd2(options) {
107416
- return options.cwd ? path39.resolve(options.cwd) : process.cwd();
107543
+ return options.cwd ? path40.resolve(options.cwd) : process.cwd();
107417
107544
  }
107418
107545
  __name(resolveCwd2, "resolveCwd");
107419
107546
  function readLocalConfig(options) {
107420
107547
  const cwd = resolveCwd2(options);
107421
- const settingsPath = path39.join(cwd, ".fimo.settings.json");
107422
- if (!fs36.existsSync(settingsPath)) {
107548
+ const settingsPath = path40.join(cwd, ".fimo.settings.json");
107549
+ if (!fs37.existsSync(settingsPath)) {
107423
107550
  return null;
107424
107551
  }
107425
- return JSON.parse(fs36.readFileSync(settingsPath, "utf-8"));
107552
+ return JSON.parse(fs37.readFileSync(settingsPath, "utf-8"));
107426
107553
  }
107427
107554
  __name(readLocalConfig, "readLocalConfig");
107428
107555
  function resolveProjectId5(argv, options, command) {
@@ -107534,11 +107661,11 @@ async function projectsRenameCommand(nameArg, projectIdArg, options) {
107534
107661
  });
107535
107662
  return;
107536
107663
  }
107537
- const configPath = path39.join(cwd, "fimo-config.json");
107664
+ const configPath = path40.join(cwd, "fimo-config.json");
107538
107665
  let config2 = {};
107539
- if (fs36.existsSync(configPath)) {
107666
+ if (fs37.existsSync(configPath)) {
107540
107667
  try {
107541
- config2 = JSON.parse(fs36.readFileSync(configPath, "utf-8"));
107668
+ config2 = JSON.parse(fs37.readFileSync(configPath, "utf-8"));
107542
107669
  } catch (error45) {
107543
107670
  ui.error({
107544
107671
  command: "projects rename",
@@ -107550,7 +107677,7 @@ async function projectsRenameCommand(nameArg, projectIdArg, options) {
107550
107677
  }
107551
107678
  const seo = config2.seo ?? {};
107552
107679
  config2.seo = { ...seo, siteName: name };
107553
- fs36.writeFileSync(configPath, JSON.stringify(config2, null, 2) + "\n");
107680
+ fs37.writeFileSync(configPath, JSON.stringify(config2, null, 2) + "\n");
107554
107681
  ui.ok({
107555
107682
  command: "projects rename",
107556
107683
  headline: `Renamed to "${name}".`,
@@ -107770,12 +107897,12 @@ __name(resolveCurrentCliUser, "resolveCurrentCliUser");
107770
107897
  init_dist();
107771
107898
  init_agents();
107772
107899
  init_scaffold();
107773
- import fs37 from "node:fs";
107774
- import path40 from "node:path";
107900
+ import fs38 from "node:fs";
107901
+ import path41 from "node:path";
107775
107902
  async function rulesSyncCommand(options = {}) {
107776
- const cwd = path40.resolve(options.cwd ?? process.cwd());
107777
- const agentsMdPath = path40.join(cwd, "AGENTS.md");
107778
- if (!fs37.existsSync(agentsMdPath)) {
107903
+ const cwd = path41.resolve(options.cwd ?? process.cwd());
107904
+ const agentsMdPath = path41.join(cwd, "AGENTS.md");
107905
+ if (!fs38.existsSync(agentsMdPath)) {
107779
107906
  ui.error({
107780
107907
  command: "rules sync",
107781
107908
  code: "NO_AGENTS_MD",
@@ -107853,8 +107980,8 @@ __name(rulesSyncCommand, "rulesSyncCommand");
107853
107980
 
107854
107981
  // src/cli/commands/schema.ts
107855
107982
  init_dist();
107856
- import fs38 from "node:fs";
107857
- import path41 from "node:path";
107983
+ import fs39 from "node:fs";
107984
+ import path42 from "node:path";
107858
107985
  init_project_context();
107859
107986
  init_project();
107860
107987
  function toApiShape(schema) {
@@ -107888,15 +108015,15 @@ async function schemaPushCommand(typeName, options, cmd) {
107888
108015
  const { ctx, api } = await bootstrapProjectCommand(options, cmd, { refuseReadOnly: true });
107889
108016
  await requireOperation("cms.schema.push", { projectId: ctx.projectId, env: ctx.env });
107890
108017
  const cwd = resolveProjectCwd(options.cwd);
107891
- const schemasDir = path41.join(cwd, "src/schemas");
107892
- const files = typeName ? [`${typeName}.json`] : fs38.readdirSync(schemasDir).filter((f) => f.endsWith(".json"));
108018
+ const schemasDir = path42.join(cwd, "src/schemas");
108019
+ const files = typeName ? [`${typeName}.json`] : fs39.readdirSync(schemasDir).filter((f) => f.endsWith(".json"));
107893
108020
  const results = [];
107894
108021
  for (const file2 of files) {
107895
- const filePath = path41.join(schemasDir, file2);
107896
- if (!fs38.existsSync(filePath)) {
108022
+ const filePath = path42.join(schemasDir, file2);
108023
+ if (!fs39.existsSync(filePath)) {
107897
108024
  throw new Error(`Schema file not found: ${filePath}`);
107898
108025
  }
107899
- const schema = JSON.parse(fs38.readFileSync(filePath, "utf-8"));
108026
+ const schema = JSON.parse(fs39.readFileSync(filePath, "utf-8"));
107900
108027
  const contentType = toApiShape(schema);
107901
108028
  try {
107902
108029
  const result = await api.createSchema(ctx.projectId, contentType);
@@ -108195,7 +108322,7 @@ init_project_context();
108195
108322
  function computeVersionString() {
108196
108323
  let pkgVersion = "0.0.0";
108197
108324
  try {
108198
- const pkg = JSON.parse(fs39.readFileSync(path42.join(CLI_ROOT, "package.json"), "utf8"));
108325
+ const pkg = JSON.parse(fs40.readFileSync(path43.join(CLI_ROOT, "package.json"), "utf8"));
108199
108326
  if (typeof pkg.version === "string" && pkg.version.length > 0) {
108200
108327
  pkgVersion = pkg.version;
108201
108328
  }
@@ -108203,7 +108330,7 @@ function computeVersionString() {
108203
108330
  }
108204
108331
  let releaseId;
108205
108332
  try {
108206
- const release = JSON.parse(fs39.readFileSync(path42.join(CLI_ROOT, "release.json"), "utf8"));
108333
+ const release = JSON.parse(fs40.readFileSync(path43.join(CLI_ROOT, "release.json"), "utf8"));
108207
108334
  if (typeof release.id === "string" && release.id.length > 0) {
108208
108335
  releaseId = release.id;
108209
108336
  }