fimo 0.2.3-staging.10 → 0.2.3-staging.7

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