fimo 0.7.0-experimental.4 → 0.7.0-experimental.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. package/dist/cli/bundle.json +1 -1
  2. package/dist/cli/index.js +816 -459
  3. package/dist/runtime/strapi/client.d.ts +26 -0
  4. package/dist/runtime/strapi/client.d.ts.map +1 -0
  5. package/dist/runtime/strapi/client.js +88 -0
  6. package/dist/runtime/strapi/client.test.d.ts +2 -0
  7. package/dist/runtime/strapi/client.test.d.ts.map +1 -0
  8. package/dist/runtime/strapi/client.test.js +64 -0
  9. package/dist/runtime/strapi/index.d.ts +5 -0
  10. package/dist/runtime/strapi/index.d.ts.map +1 -0
  11. package/dist/runtime/strapi/index.js +6 -0
  12. package/dist/runtime/strapi/reshape.d.ts +28 -0
  13. package/dist/runtime/strapi/reshape.d.ts.map +1 -0
  14. package/dist/runtime/strapi/reshape.js +79 -0
  15. package/dist/runtime/strapi/reshape.test.d.ts +2 -0
  16. package/dist/runtime/strapi/reshape.test.d.ts.map +1 -0
  17. package/dist/runtime/strapi/reshape.test.js +33 -0
  18. package/dist/scripts/cms/example-content.js +22 -1
  19. package/dist/scripts/cms/example-content.test.js +11 -2
  20. package/dist/scripts/cms/strapi/detect.js +1 -0
  21. package/dist/scripts/cms/strapi/index.js +8 -0
  22. package/dist/scripts/cms/strapi/schema-map.js +11 -0
  23. package/dist/scripts/cms/strapi/schema-map.test.js +4 -0
  24. package/dist/scripts/cms/strapi/wire-client.d.ts +15 -0
  25. package/dist/scripts/cms/strapi/wire-client.js +107 -0
  26. package/dist/scripts/cms/strapi/wire-client.test.d.ts +1 -0
  27. package/dist/scripts/cms/strapi/wire-client.test.js +51 -0
  28. package/dist/scripts/cms/strapi/wiring.d.ts +17 -0
  29. package/dist/scripts/cms/strapi/wiring.js +36 -0
  30. package/dist/scripts/cms/strapi/wiring.test.d.ts +1 -0
  31. package/dist/scripts/cms/strapi/wiring.test.js +27 -0
  32. package/dist/scripts/cms/types.d.ts +18 -0
  33. package/package.json +5 -1
  34. package/templates/react-router/package.json +1 -1
package/dist/cli/index.js CHANGED
@@ -1984,8 +1984,8 @@ var require_command = __commonJS({
1984
1984
  "../../node_modules/.pnpm/commander@13.1.0/node_modules/commander/lib/command.js"(exports2) {
1985
1985
  var EventEmitter = __require("node:events").EventEmitter;
1986
1986
  var childProcess2 = __require("node:child_process");
1987
- var path61 = __require("node:path");
1988
- var fs56 = __require("node:fs");
1987
+ var path62 = __require("node:path");
1988
+ var fs57 = __require("node:fs");
1989
1989
  var process8 = __require("node:process");
1990
1990
  var { Argument: Argument2, humanReadableArgName } = require_argument();
1991
1991
  var { CommanderError: CommanderError2 } = require_error();
@@ -2969,7 +2969,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
2969
2969
  * @param {string} subcommandName
2970
2970
  */
2971
2971
  _checkForMissingExecutable(executableFile, executableDir, subcommandName) {
2972
- if (fs56.existsSync(executableFile)) return;
2972
+ if (fs57.existsSync(executableFile)) return;
2973
2973
  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";
2974
2974
  const executableMissing = `'${executableFile}' does not exist
2975
2975
  - if '${subcommandName}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead
@@ -2987,11 +2987,11 @@ Expecting one of '${allowedValues.join("', '")}'`);
2987
2987
  let launchWithNode = false;
2988
2988
  const sourceExt = [".js", ".ts", ".tsx", ".mjs", ".cjs"];
2989
2989
  function findFile(baseDir, baseName) {
2990
- const localBin = path61.resolve(baseDir, baseName);
2991
- if (fs56.existsSync(localBin)) return localBin;
2992
- if (sourceExt.includes(path61.extname(baseName))) return void 0;
2990
+ const localBin = path62.resolve(baseDir, baseName);
2991
+ if (fs57.existsSync(localBin)) return localBin;
2992
+ if (sourceExt.includes(path62.extname(baseName))) return void 0;
2993
2993
  const foundExt = sourceExt.find(
2994
- (ext) => fs56.existsSync(`${localBin}${ext}`)
2994
+ (ext) => fs57.existsSync(`${localBin}${ext}`)
2995
2995
  );
2996
2996
  if (foundExt) return `${localBin}${foundExt}`;
2997
2997
  return void 0;
@@ -3004,21 +3004,21 @@ Expecting one of '${allowedValues.join("', '")}'`);
3004
3004
  if (this._scriptPath) {
3005
3005
  let resolvedScriptPath;
3006
3006
  try {
3007
- resolvedScriptPath = fs56.realpathSync(this._scriptPath);
3007
+ resolvedScriptPath = fs57.realpathSync(this._scriptPath);
3008
3008
  } catch {
3009
3009
  resolvedScriptPath = this._scriptPath;
3010
3010
  }
3011
- executableDir = path61.resolve(
3012
- path61.dirname(resolvedScriptPath),
3011
+ executableDir = path62.resolve(
3012
+ path62.dirname(resolvedScriptPath),
3013
3013
  executableDir
3014
3014
  );
3015
3015
  }
3016
3016
  if (executableDir) {
3017
3017
  let localFile = findFile(executableDir, executableFile);
3018
3018
  if (!localFile && !subcommand._executableFile && this._scriptPath) {
3019
- const legacyName = path61.basename(
3019
+ const legacyName = path62.basename(
3020
3020
  this._scriptPath,
3021
- path61.extname(this._scriptPath)
3021
+ path62.extname(this._scriptPath)
3022
3022
  );
3023
3023
  if (legacyName !== this._name) {
3024
3024
  localFile = findFile(
@@ -3029,7 +3029,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
3029
3029
  }
3030
3030
  executableFile = localFile || executableFile;
3031
3031
  }
3032
- launchWithNode = sourceExt.includes(path61.extname(executableFile));
3032
+ launchWithNode = sourceExt.includes(path62.extname(executableFile));
3033
3033
  let proc;
3034
3034
  if (process8.platform !== "win32") {
3035
3035
  if (launchWithNode) {
@@ -3877,7 +3877,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
3877
3877
  * @return {Command}
3878
3878
  */
3879
3879
  nameFromFilename(filename) {
3880
- this._name = path61.basename(filename, path61.extname(filename));
3880
+ this._name = path62.basename(filename, path62.extname(filename));
3881
3881
  return this;
3882
3882
  }
3883
3883
  /**
@@ -3891,9 +3891,9 @@ Expecting one of '${allowedValues.join("', '")}'`);
3891
3891
  * @param {string} [path]
3892
3892
  * @return {(string|null|Command)}
3893
3893
  */
3894
- executableDir(path62) {
3895
- if (path62 === void 0) return this._executableDir;
3896
- this._executableDir = path62;
3894
+ executableDir(path63) {
3895
+ if (path63 === void 0) return this._executableDir;
3896
+ this._executableDir = path63;
3897
3897
  return this;
3898
3898
  }
3899
3899
  /**
@@ -4227,7 +4227,7 @@ function detectFramework(cwd) {
4227
4227
  }
4228
4228
  function findAdoptableApps(rootDir) {
4229
4229
  const apps2 = [];
4230
- const walk = /* @__PURE__ */ __name((dir, depth) => {
4230
+ const walk2 = /* @__PURE__ */ __name((dir, depth) => {
4231
4231
  if (depth > MAX_SCAN_DEPTH) {
4232
4232
  return;
4233
4233
  }
@@ -4246,11 +4246,11 @@ function findAdoptableApps(rootDir) {
4246
4246
  }
4247
4247
  for (const entry of entries2) {
4248
4248
  if (entry.isDirectory() && !WORKSPACE_SKIP.has(entry.name) && !entry.name.startsWith(".")) {
4249
- walk(join(dir, entry.name), depth + 1);
4249
+ walk2(join(dir, entry.name), depth + 1);
4250
4250
  }
4251
4251
  }
4252
4252
  }, "walk");
4253
- walk(rootDir, 0);
4253
+ walk2(rootDir, 0);
4254
4254
  return apps2.sort((a, b) => {
4255
4255
  const depthA = a.relDir.split("/").length;
4256
4256
  const depthB = b.relDir.split("/").length;
@@ -6698,17 +6698,17 @@ var require_visit = __commonJS({
6698
6698
  visit2.BREAK = BREAK;
6699
6699
  visit2.SKIP = SKIP;
6700
6700
  visit2.REMOVE = REMOVE;
6701
- function visit_(key, node, visitor, path61) {
6702
- const ctrl = callVisitor(key, node, visitor, path61);
6701
+ function visit_(key, node, visitor, path62) {
6702
+ const ctrl = callVisitor(key, node, visitor, path62);
6703
6703
  if (identity2.isNode(ctrl) || identity2.isPair(ctrl)) {
6704
- replaceNode(key, path61, ctrl);
6705
- return visit_(key, ctrl, visitor, path61);
6704
+ replaceNode(key, path62, ctrl);
6705
+ return visit_(key, ctrl, visitor, path62);
6706
6706
  }
6707
6707
  if (typeof ctrl !== "symbol") {
6708
6708
  if (identity2.isCollection(node)) {
6709
- path61 = Object.freeze(path61.concat(node));
6709
+ path62 = Object.freeze(path62.concat(node));
6710
6710
  for (let i = 0; i < node.items.length; ++i) {
6711
- const ci = visit_(i, node.items[i], visitor, path61);
6711
+ const ci = visit_(i, node.items[i], visitor, path62);
6712
6712
  if (typeof ci === "number")
6713
6713
  i = ci - 1;
6714
6714
  else if (ci === BREAK)
@@ -6719,13 +6719,13 @@ var require_visit = __commonJS({
6719
6719
  }
6720
6720
  }
6721
6721
  } else if (identity2.isPair(node)) {
6722
- path61 = Object.freeze(path61.concat(node));
6723
- const ck = visit_("key", node.key, visitor, path61);
6722
+ path62 = Object.freeze(path62.concat(node));
6723
+ const ck = visit_("key", node.key, visitor, path62);
6724
6724
  if (ck === BREAK)
6725
6725
  return BREAK;
6726
6726
  else if (ck === REMOVE)
6727
6727
  node.key = null;
6728
- const cv = visit_("value", node.value, visitor, path61);
6728
+ const cv = visit_("value", node.value, visitor, path62);
6729
6729
  if (cv === BREAK)
6730
6730
  return BREAK;
6731
6731
  else if (cv === REMOVE)
@@ -6748,17 +6748,17 @@ var require_visit = __commonJS({
6748
6748
  visitAsync.BREAK = BREAK;
6749
6749
  visitAsync.SKIP = SKIP;
6750
6750
  visitAsync.REMOVE = REMOVE;
6751
- async function visitAsync_(key, node, visitor, path61) {
6752
- const ctrl = await callVisitor(key, node, visitor, path61);
6751
+ async function visitAsync_(key, node, visitor, path62) {
6752
+ const ctrl = await callVisitor(key, node, visitor, path62);
6753
6753
  if (identity2.isNode(ctrl) || identity2.isPair(ctrl)) {
6754
- replaceNode(key, path61, ctrl);
6755
- return visitAsync_(key, ctrl, visitor, path61);
6754
+ replaceNode(key, path62, ctrl);
6755
+ return visitAsync_(key, ctrl, visitor, path62);
6756
6756
  }
6757
6757
  if (typeof ctrl !== "symbol") {
6758
6758
  if (identity2.isCollection(node)) {
6759
- path61 = Object.freeze(path61.concat(node));
6759
+ path62 = Object.freeze(path62.concat(node));
6760
6760
  for (let i = 0; i < node.items.length; ++i) {
6761
- const ci = await visitAsync_(i, node.items[i], visitor, path61);
6761
+ const ci = await visitAsync_(i, node.items[i], visitor, path62);
6762
6762
  if (typeof ci === "number")
6763
6763
  i = ci - 1;
6764
6764
  else if (ci === BREAK)
@@ -6769,13 +6769,13 @@ var require_visit = __commonJS({
6769
6769
  }
6770
6770
  }
6771
6771
  } else if (identity2.isPair(node)) {
6772
- path61 = Object.freeze(path61.concat(node));
6773
- const ck = await visitAsync_("key", node.key, visitor, path61);
6772
+ path62 = Object.freeze(path62.concat(node));
6773
+ const ck = await visitAsync_("key", node.key, visitor, path62);
6774
6774
  if (ck === BREAK)
6775
6775
  return BREAK;
6776
6776
  else if (ck === REMOVE)
6777
6777
  node.key = null;
6778
- const cv = await visitAsync_("value", node.value, visitor, path61);
6778
+ const cv = await visitAsync_("value", node.value, visitor, path62);
6779
6779
  if (cv === BREAK)
6780
6780
  return BREAK;
6781
6781
  else if (cv === REMOVE)
@@ -6804,24 +6804,24 @@ var require_visit = __commonJS({
6804
6804
  return visitor;
6805
6805
  }
6806
6806
  __name(initVisitor, "initVisitor");
6807
- function callVisitor(key, node, visitor, path61) {
6807
+ function callVisitor(key, node, visitor, path62) {
6808
6808
  if (typeof visitor === "function")
6809
- return visitor(key, node, path61);
6809
+ return visitor(key, node, path62);
6810
6810
  if (identity2.isMap(node))
6811
- return visitor.Map?.(key, node, path61);
6811
+ return visitor.Map?.(key, node, path62);
6812
6812
  if (identity2.isSeq(node))
6813
- return visitor.Seq?.(key, node, path61);
6813
+ return visitor.Seq?.(key, node, path62);
6814
6814
  if (identity2.isPair(node))
6815
- return visitor.Pair?.(key, node, path61);
6815
+ return visitor.Pair?.(key, node, path62);
6816
6816
  if (identity2.isScalar(node))
6817
- return visitor.Scalar?.(key, node, path61);
6817
+ return visitor.Scalar?.(key, node, path62);
6818
6818
  if (identity2.isAlias(node))
6819
- return visitor.Alias?.(key, node, path61);
6819
+ return visitor.Alias?.(key, node, path62);
6820
6820
  return void 0;
6821
6821
  }
6822
6822
  __name(callVisitor, "callVisitor");
6823
- function replaceNode(key, path61, node) {
6824
- const parent2 = path61[path61.length - 1];
6823
+ function replaceNode(key, path62, node) {
6824
+ const parent2 = path62[path62.length - 1];
6825
6825
  if (identity2.isCollection(parent2)) {
6826
6826
  parent2.items[key] = node;
6827
6827
  } else if (identity2.isPair(parent2)) {
@@ -7453,10 +7453,10 @@ var require_Collection = __commonJS({
7453
7453
  var createNode = require_createNode();
7454
7454
  var identity2 = require_identity();
7455
7455
  var Node2 = require_Node();
7456
- function collectionFromPath(schema, path61, value) {
7456
+ function collectionFromPath(schema, path62, value) {
7457
7457
  let v = value;
7458
- for (let i = path61.length - 1; i >= 0; --i) {
7459
- const k = path61[i];
7458
+ for (let i = path62.length - 1; i >= 0; --i) {
7459
+ const k = path62[i];
7460
7460
  if (typeof k === "number" && Number.isInteger(k) && k >= 0) {
7461
7461
  const a = [];
7462
7462
  a[k] = v;
@@ -7476,7 +7476,7 @@ var require_Collection = __commonJS({
7476
7476
  });
7477
7477
  }
7478
7478
  __name(collectionFromPath, "collectionFromPath");
7479
- var isEmptyPath = /* @__PURE__ */ __name((path61) => path61 == null || typeof path61 === "object" && !!path61[Symbol.iterator]().next().done, "isEmptyPath");
7479
+ var isEmptyPath = /* @__PURE__ */ __name((path62) => path62 == null || typeof path62 === "object" && !!path62[Symbol.iterator]().next().done, "isEmptyPath");
7480
7480
  var Collection = class extends Node2.NodeBase {
7481
7481
  static {
7482
7482
  __name(this, "Collection");
@@ -7509,11 +7509,11 @@ var require_Collection = __commonJS({
7509
7509
  * be a Pair instance or a `{ key, value }` object, which may not have a key
7510
7510
  * that already exists in the map.
7511
7511
  */
7512
- addIn(path61, value) {
7513
- if (isEmptyPath(path61))
7512
+ addIn(path62, value) {
7513
+ if (isEmptyPath(path62))
7514
7514
  this.add(value);
7515
7515
  else {
7516
- const [key, ...rest] = path61;
7516
+ const [key, ...rest] = path62;
7517
7517
  const node = this.get(key, true);
7518
7518
  if (identity2.isCollection(node))
7519
7519
  node.addIn(rest, value);
@@ -7527,8 +7527,8 @@ var require_Collection = __commonJS({
7527
7527
  * Removes a value from the collection.
7528
7528
  * @returns `true` if the item was found and removed.
7529
7529
  */
7530
- deleteIn(path61) {
7531
- const [key, ...rest] = path61;
7530
+ deleteIn(path62) {
7531
+ const [key, ...rest] = path62;
7532
7532
  if (rest.length === 0)
7533
7533
  return this.delete(key);
7534
7534
  const node = this.get(key, true);
@@ -7542,8 +7542,8 @@ var require_Collection = __commonJS({
7542
7542
  * scalar values from their surrounding node; to disable set `keepScalar` to
7543
7543
  * `true` (collections are always returned intact).
7544
7544
  */
7545
- getIn(path61, keepScalar) {
7546
- const [key, ...rest] = path61;
7545
+ getIn(path62, keepScalar) {
7546
+ const [key, ...rest] = path62;
7547
7547
  const node = this.get(key, true);
7548
7548
  if (rest.length === 0)
7549
7549
  return !keepScalar && identity2.isScalar(node) ? node.value : node;
@@ -7561,8 +7561,8 @@ var require_Collection = __commonJS({
7561
7561
  /**
7562
7562
  * Checks if the collection includes a value with the key `key`.
7563
7563
  */
7564
- hasIn(path61) {
7565
- const [key, ...rest] = path61;
7564
+ hasIn(path62) {
7565
+ const [key, ...rest] = path62;
7566
7566
  if (rest.length === 0)
7567
7567
  return this.has(key);
7568
7568
  const node = this.get(key, true);
@@ -7572,8 +7572,8 @@ var require_Collection = __commonJS({
7572
7572
  * Sets a value in this collection. For `!!set`, `value` needs to be a
7573
7573
  * boolean to add/remove the item from the set.
7574
7574
  */
7575
- setIn(path61, value) {
7576
- const [key, ...rest] = path61;
7575
+ setIn(path62, value) {
7576
+ const [key, ...rest] = path62;
7577
7577
  if (rest.length === 0) {
7578
7578
  this.set(key, value);
7579
7579
  } else {
@@ -10150,9 +10150,9 @@ var require_Document = __commonJS({
10150
10150
  this.contents.add(value);
10151
10151
  }
10152
10152
  /** Adds a value to the document. */
10153
- addIn(path61, value) {
10153
+ addIn(path62, value) {
10154
10154
  if (assertCollection(this.contents))
10155
- this.contents.addIn(path61, value);
10155
+ this.contents.addIn(path62, value);
10156
10156
  }
10157
10157
  /**
10158
10158
  * Create a new `Alias` node, ensuring that the target `node` has the required anchor.
@@ -10227,14 +10227,14 @@ var require_Document = __commonJS({
10227
10227
  * Removes a value from the document.
10228
10228
  * @returns `true` if the item was found and removed.
10229
10229
  */
10230
- deleteIn(path61) {
10231
- if (Collection.isEmptyPath(path61)) {
10230
+ deleteIn(path62) {
10231
+ if (Collection.isEmptyPath(path62)) {
10232
10232
  if (this.contents == null)
10233
10233
  return false;
10234
10234
  this.contents = null;
10235
10235
  return true;
10236
10236
  }
10237
- return assertCollection(this.contents) ? this.contents.deleteIn(path61) : false;
10237
+ return assertCollection(this.contents) ? this.contents.deleteIn(path62) : false;
10238
10238
  }
10239
10239
  /**
10240
10240
  * Returns item at `key`, or `undefined` if not found. By default unwraps
@@ -10249,10 +10249,10 @@ var require_Document = __commonJS({
10249
10249
  * scalar values from their surrounding node; to disable set `keepScalar` to
10250
10250
  * `true` (collections are always returned intact).
10251
10251
  */
10252
- getIn(path61, keepScalar) {
10253
- if (Collection.isEmptyPath(path61))
10252
+ getIn(path62, keepScalar) {
10253
+ if (Collection.isEmptyPath(path62))
10254
10254
  return !keepScalar && identity2.isScalar(this.contents) ? this.contents.value : this.contents;
10255
- return identity2.isCollection(this.contents) ? this.contents.getIn(path61, keepScalar) : void 0;
10255
+ return identity2.isCollection(this.contents) ? this.contents.getIn(path62, keepScalar) : void 0;
10256
10256
  }
10257
10257
  /**
10258
10258
  * Checks if the document includes a value with the key `key`.
@@ -10263,10 +10263,10 @@ var require_Document = __commonJS({
10263
10263
  /**
10264
10264
  * Checks if the document includes a value at `path`.
10265
10265
  */
10266
- hasIn(path61) {
10267
- if (Collection.isEmptyPath(path61))
10266
+ hasIn(path62) {
10267
+ if (Collection.isEmptyPath(path62))
10268
10268
  return this.contents !== void 0;
10269
- return identity2.isCollection(this.contents) ? this.contents.hasIn(path61) : false;
10269
+ return identity2.isCollection(this.contents) ? this.contents.hasIn(path62) : false;
10270
10270
  }
10271
10271
  /**
10272
10272
  * Sets a value in this document. For `!!set`, `value` needs to be a
@@ -10283,13 +10283,13 @@ var require_Document = __commonJS({
10283
10283
  * Sets a value in this document. For `!!set`, `value` needs to be a
10284
10284
  * boolean to add/remove the item from the set.
10285
10285
  */
10286
- setIn(path61, value) {
10287
- if (Collection.isEmptyPath(path61)) {
10286
+ setIn(path62, value) {
10287
+ if (Collection.isEmptyPath(path62)) {
10288
10288
  this.contents = value;
10289
10289
  } else if (this.contents == null) {
10290
- this.contents = Collection.collectionFromPath(this.schema, Array.from(path61), value);
10290
+ this.contents = Collection.collectionFromPath(this.schema, Array.from(path62), value);
10291
10291
  } else if (assertCollection(this.contents)) {
10292
- this.contents.setIn(path61, value);
10292
+ this.contents.setIn(path62, value);
10293
10293
  }
10294
10294
  }
10295
10295
  /**
@@ -12301,9 +12301,9 @@ var require_cst_visit = __commonJS({
12301
12301
  visit2.BREAK = BREAK;
12302
12302
  visit2.SKIP = SKIP;
12303
12303
  visit2.REMOVE = REMOVE;
12304
- visit2.itemAtPath = (cst, path61) => {
12304
+ visit2.itemAtPath = (cst, path62) => {
12305
12305
  let item = cst;
12306
- for (const [field, index2] of path61) {
12306
+ for (const [field, index2] of path62) {
12307
12307
  const tok = item?.[field];
12308
12308
  if (tok && "items" in tok) {
12309
12309
  item = tok.items[index2];
@@ -12312,23 +12312,23 @@ var require_cst_visit = __commonJS({
12312
12312
  }
12313
12313
  return item;
12314
12314
  };
12315
- visit2.parentCollection = (cst, path61) => {
12316
- const parent2 = visit2.itemAtPath(cst, path61.slice(0, -1));
12317
- const field = path61[path61.length - 1][0];
12315
+ visit2.parentCollection = (cst, path62) => {
12316
+ const parent2 = visit2.itemAtPath(cst, path62.slice(0, -1));
12317
+ const field = path62[path62.length - 1][0];
12318
12318
  const coll = parent2?.[field];
12319
12319
  if (coll && "items" in coll)
12320
12320
  return coll;
12321
12321
  throw new Error("Parent collection not found");
12322
12322
  };
12323
- function _visit(path61, item, visitor) {
12324
- let ctrl = visitor(item, path61);
12323
+ function _visit(path62, item, visitor) {
12324
+ let ctrl = visitor(item, path62);
12325
12325
  if (typeof ctrl === "symbol")
12326
12326
  return ctrl;
12327
12327
  for (const field of ["key", "value"]) {
12328
12328
  const token = item[field];
12329
12329
  if (token && "items" in token) {
12330
12330
  for (let i = 0; i < token.items.length; ++i) {
12331
- const ci = _visit(Object.freeze(path61.concat([[field, i]])), token.items[i], visitor);
12331
+ const ci = _visit(Object.freeze(path62.concat([[field, i]])), token.items[i], visitor);
12332
12332
  if (typeof ci === "number")
12333
12333
  i = ci - 1;
12334
12334
  else if (ci === BREAK)
@@ -12339,10 +12339,10 @@ var require_cst_visit = __commonJS({
12339
12339
  }
12340
12340
  }
12341
12341
  if (typeof ctrl === "function" && field === "key")
12342
- ctrl = ctrl(item, path61);
12342
+ ctrl = ctrl(item, path62);
12343
12343
  }
12344
12344
  }
12345
- return typeof ctrl === "function" ? ctrl(item, path61) : ctrl;
12345
+ return typeof ctrl === "function" ? ctrl(item, path62) : ctrl;
12346
12346
  }
12347
12347
  __name(_visit, "_visit");
12348
12348
  exports2.visit = visit2;
@@ -13664,14 +13664,14 @@ var require_parser = __commonJS({
13664
13664
  case "scalar":
13665
13665
  case "single-quoted-scalar":
13666
13666
  case "double-quoted-scalar": {
13667
- const fs56 = this.flowScalar(this.type);
13667
+ const fs57 = this.flowScalar(this.type);
13668
13668
  if (atNextItem || it2.value) {
13669
- map3.items.push({ start, key: fs56, sep: [] });
13669
+ map3.items.push({ start, key: fs57, sep: [] });
13670
13670
  this.onKeyLine = true;
13671
13671
  } else if (it2.sep) {
13672
- this.stack.push(fs56);
13672
+ this.stack.push(fs57);
13673
13673
  } else {
13674
- Object.assign(it2, { key: fs56, sep: [] });
13674
+ Object.assign(it2, { key: fs57, sep: [] });
13675
13675
  this.onKeyLine = true;
13676
13676
  }
13677
13677
  return;
@@ -13799,13 +13799,13 @@ var require_parser = __commonJS({
13799
13799
  case "scalar":
13800
13800
  case "single-quoted-scalar":
13801
13801
  case "double-quoted-scalar": {
13802
- const fs56 = this.flowScalar(this.type);
13802
+ const fs57 = this.flowScalar(this.type);
13803
13803
  if (!it2 || it2.value)
13804
- fc.items.push({ start: [], key: fs56, sep: [] });
13804
+ fc.items.push({ start: [], key: fs57, sep: [] });
13805
13805
  else if (it2.sep)
13806
- this.stack.push(fs56);
13806
+ this.stack.push(fs57);
13807
13807
  else
13808
- Object.assign(it2, { key: fs56, sep: [] });
13808
+ Object.assign(it2, { key: fs57, sep: [] });
13809
13809
  return;
13810
13810
  }
13811
13811
  case "flow-map-end":
@@ -14744,9 +14744,9 @@ var init_skill_DRd1jW7a = __esm({
14744
14744
  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}`);
14745
14745
  return baseDir;
14746
14746
  }, "fetchWellKnownSkills");
14747
- readJsonObjectIfExists = /* @__PURE__ */ __name(async (path61) => {
14747
+ readJsonObjectIfExists = /* @__PURE__ */ __name(async (path62) => {
14748
14748
  try {
14749
- const content2 = await readFile(path61, "utf-8");
14749
+ const content2 = await readFile(path62, "utf-8");
14750
14750
  const parsed = JSON.parse(content2);
14751
14751
  return isPlainObject2(parsed) ? parsed : null;
14752
14752
  } catch {
@@ -14941,16 +14941,16 @@ var init_skill_DRd1jW7a = __esm({
14941
14941
  if (isGlobal) return agent.globalSkillsDir ?? join3(baseDir, agent.skillsDir);
14942
14942
  return join3(baseDir, agent.skillsDir);
14943
14943
  }, "getSkillAgentBaseDir");
14944
- cleanAndCreateDirectory = /* @__PURE__ */ __name(async (path61) => {
14945
- await rm(path61, {
14944
+ cleanAndCreateDirectory = /* @__PURE__ */ __name(async (path62) => {
14945
+ await rm(path62, {
14946
14946
  recursive: true,
14947
14947
  force: true
14948
14948
  }).catch(() => void 0);
14949
- await mkdir(path61, { recursive: true });
14949
+ await mkdir(path62, { recursive: true });
14950
14950
  }, "cleanAndCreateDirectory");
14951
14951
  resolveSymlinkTarget = /* @__PURE__ */ __name((linkPath, linkTarget) => resolve(dirname(linkPath), linkTarget), "resolveSymlinkTarget");
14952
- resolveParentSymlinks = /* @__PURE__ */ __name(async (path61) => {
14953
- const resolved = resolve(path61);
14952
+ resolveParentSymlinks = /* @__PURE__ */ __name(async (path62) => {
14953
+ const resolved = resolve(path62);
14954
14954
  const parentDir = dirname(resolved);
14955
14955
  const name = basename(resolved);
14956
14956
  try {
@@ -19364,17 +19364,17 @@ function listReferenceDocs(skillDir) {
19364
19364
  return [];
19365
19365
  }
19366
19366
  const out = [];
19367
- const walk = /* @__PURE__ */ __name((cur, prefix) => {
19367
+ const walk2 = /* @__PURE__ */ __name((cur, prefix) => {
19368
19368
  for (const entry of fs7.readdirSync(cur, { withFileTypes: true })) {
19369
19369
  const rel = prefix ? `${prefix}/${entry.name}` : entry.name;
19370
19370
  if (entry.isDirectory()) {
19371
- walk(path7.join(cur, entry.name), rel);
19371
+ walk2(path7.join(cur, entry.name), rel);
19372
19372
  } else if (entry.isFile() && entry.name.endsWith(".md")) {
19373
19373
  out.push(rel.slice(0, -".md".length));
19374
19374
  }
19375
19375
  }
19376
19376
  }, "walk");
19377
- walk(refsDir, "");
19377
+ walk2(refsDir, "");
19378
19378
  return out.sort();
19379
19379
  }
19380
19380
  function discoverBundledSkills() {
@@ -19855,8 +19855,8 @@ function formatZodIssues(parsed) {
19855
19855
  return null;
19856
19856
  }
19857
19857
  return issues.map((issue2) => {
19858
- const { path: path61, message } = issue2;
19859
- const prefix = Array.isArray(path61) && path61.length > 0 ? `${path61.join(".")}: ` : "";
19858
+ const { path: path62, message } = issue2;
19859
+ const prefix = Array.isArray(path62) && path62.length > 0 ? `${path62.join(".")}: ` : "";
19860
19860
  return `${prefix}${typeof message === "string" ? message : "Invalid value"}`;
19861
19861
  }).join("; ");
19862
19862
  }
@@ -19877,11 +19877,11 @@ var init_api = __esm({
19877
19877
  method;
19878
19878
  path;
19879
19879
  detail;
19880
- constructor(method, path61, status, detail) {
19881
- super(`API ${method} ${path61} failed: ${status} ${detail}`);
19880
+ constructor(method, path62, status, detail) {
19881
+ super(`API ${method} ${path62} failed: ${status} ${detail}`);
19882
19882
  this.name = "ApiRequestError";
19883
19883
  this.method = method;
19884
- this.path = path61;
19884
+ this.path = path62;
19885
19885
  this.status = status;
19886
19886
  this.detail = detail;
19887
19887
  }
@@ -19982,7 +19982,7 @@ var init_api = __esm({
19982
19982
  resolveAuthToken() {
19983
19983
  return process.env.FIMO_API_TOKEN?.trim() || requireToken(this.cfg);
19984
19984
  }
19985
- async request(path61, init = {}, opts = {}) {
19985
+ async request(path62, init = {}, opts = {}) {
19986
19986
  const token = this.resolveAuthToken();
19987
19987
  const headers = new Headers(init.headers);
19988
19988
  headers.set("Authorization", `Bearer ${token}`);
@@ -19992,7 +19992,7 @@ var init_api = __esm({
19992
19992
  if (this.env && !headers.has(FIMO_ENV_HEADER)) {
19993
19993
  headers.set(FIMO_ENV_HEADER, this.env);
19994
19994
  }
19995
- const response = await fimoFetch(`${this.cfg.apiUrl}${path61}`, { ...init, headers });
19995
+ const response = await fimoFetch(`${this.cfg.apiUrl}${path62}`, { ...init, headers });
19996
19996
  if (response.status === 401) {
19997
19997
  throwUnauthorized(this.cfg, response.status);
19998
19998
  }
@@ -20001,21 +20001,21 @@ var init_api = __esm({
20001
20001
  }
20002
20002
  if (!response.ok) {
20003
20003
  const error45 = await this.formatError(response);
20004
- throw new ApiRequestError(init.method ?? "GET", path61, response.status, error45);
20004
+ throw new ApiRequestError(init.method ?? "GET", path62, response.status, error45);
20005
20005
  }
20006
20006
  if (response.status === 204) {
20007
20007
  return void 0;
20008
20008
  }
20009
20009
  return await response.json();
20010
20010
  }
20011
- async rawRequest(path61, init = {}) {
20011
+ async rawRequest(path62, init = {}) {
20012
20012
  const token = this.resolveAuthToken();
20013
20013
  const headers = new Headers(init.headers);
20014
20014
  headers.set("Authorization", `Bearer ${token}`);
20015
20015
  if (this.env && !headers.has(FIMO_ENV_HEADER)) {
20016
20016
  headers.set(FIMO_ENV_HEADER, this.env);
20017
20017
  }
20018
- const response = await fimoFetch(`${this.cfg.apiUrl}${path61}`, { ...init, headers });
20018
+ const response = await fimoFetch(`${this.cfg.apiUrl}${path62}`, { ...init, headers });
20019
20019
  if (response.status === 401) {
20020
20020
  throwUnauthorized(this.cfg, response.status);
20021
20021
  }
@@ -20024,7 +20024,7 @@ var init_api = __esm({
20024
20024
  }
20025
20025
  if (!response.ok) {
20026
20026
  const error45 = await this.formatError(response);
20027
- throw new Error(`API ${init.method ?? "GET"} ${path61} failed: ${response.status} ${error45}`);
20027
+ throw new Error(`API ${init.method ?? "GET"} ${path62} failed: ${response.status} ${error45}`);
20028
20028
  }
20029
20029
  return response;
20030
20030
  }
@@ -20360,8 +20360,8 @@ var init_api = __esm({
20360
20360
  // ── Per-surface lazy-fetch (V3 §20.4) ────────────────────────────────
20361
20361
  // One method per surface — all share the same `(projectId, env, against?, …key)`
20362
20362
  // shape. The drill-in renderers in `utils/format/drill/*` consume these.
20363
- async getCodeFileDiff(projectId, env2, path61, opts = {}) {
20364
- const qs = lazyFetchQs(opts.against, { path: path61 });
20363
+ async getCodeFileDiff(projectId, env2, path62, opts = {}) {
20364
+ const qs = lazyFetchQs(opts.against, { path: path62 });
20365
20365
  const body = await this.request(
20366
20366
  `/api/management/projects/${projectId}/envs/${encodeURIComponent(env2)}/diff/code/file?${qs}`
20367
20367
  );
@@ -20382,38 +20382,38 @@ var init_api = __esm({
20382
20382
  }
20383
20383
  async getContentRowDiff(projectId, env2, collection, rowId, opts = {}) {
20384
20384
  const qs = lazyFetchQs(opts.against);
20385
- const path61 = `/api/management/projects/${projectId}/envs/${encodeURIComponent(env2)}/diff/content/${encodeURIComponent(collection)}/${encodeURIComponent(rowId)}`;
20386
- const body = await this.request(qs ? `${path61}?${qs}` : path61);
20385
+ const path62 = `/api/management/projects/${projectId}/envs/${encodeURIComponent(env2)}/diff/content/${encodeURIComponent(collection)}/${encodeURIComponent(rowId)}`;
20386
+ const body = await this.request(qs ? `${path62}?${qs}` : path62);
20387
20387
  return body.data;
20388
20388
  }
20389
20389
  async getSchemaTypeDiff(projectId, env2, typeName, opts = {}) {
20390
20390
  const qs = lazyFetchQs(opts.against);
20391
- const path61 = `/api/management/projects/${projectId}/envs/${encodeURIComponent(env2)}/diff/schemas/${encodeURIComponent(typeName)}`;
20392
- const body = await this.request(qs ? `${path61}?${qs}` : path61);
20391
+ const path62 = `/api/management/projects/${projectId}/envs/${encodeURIComponent(env2)}/diff/schemas/${encodeURIComponent(typeName)}`;
20392
+ const body = await this.request(qs ? `${path62}?${qs}` : path62);
20393
20393
  return body.data;
20394
20394
  }
20395
20395
  async getAssetDiff(projectId, env2, assetId, opts = {}) {
20396
20396
  const qs = lazyFetchQs(opts.against);
20397
- const path61 = `/api/management/projects/${projectId}/envs/${encodeURIComponent(env2)}/diff/assets/${encodeURIComponent(assetId)}`;
20398
- const body = await this.request(qs ? `${path61}?${qs}` : path61);
20397
+ const path62 = `/api/management/projects/${projectId}/envs/${encodeURIComponent(env2)}/diff/assets/${encodeURIComponent(assetId)}`;
20398
+ const body = await this.request(qs ? `${path62}?${qs}` : path62);
20399
20399
  return body.data;
20400
20400
  }
20401
20401
  async getTranslationRowDiff(projectId, env2, locale, key, opts = {}) {
20402
20402
  const qs = lazyFetchQs(opts.against);
20403
- const path61 = `/api/management/projects/${projectId}/envs/${encodeURIComponent(env2)}/diff/translations/${encodeURIComponent(locale)}/${encodeURIComponent(key)}`;
20404
- const body = await this.request(qs ? `${path61}?${qs}` : path61);
20403
+ const path62 = `/api/management/projects/${projectId}/envs/${encodeURIComponent(env2)}/diff/translations/${encodeURIComponent(locale)}/${encodeURIComponent(key)}`;
20404
+ const body = await this.request(qs ? `${path62}?${qs}` : path62);
20405
20405
  return body.data;
20406
20406
  }
20407
20407
  async getFormSchemaDiff(projectId, env2, formName, opts = {}) {
20408
20408
  const qs = lazyFetchQs(opts.against);
20409
- const path61 = `/api/management/projects/${projectId}/envs/${encodeURIComponent(env2)}/diff/forms/${encodeURIComponent(formName)}`;
20410
- const body = await this.request(qs ? `${path61}?${qs}` : path61);
20409
+ const path62 = `/api/management/projects/${projectId}/envs/${encodeURIComponent(env2)}/diff/forms/${encodeURIComponent(formName)}`;
20410
+ const body = await this.request(qs ? `${path62}?${qs}` : path62);
20411
20411
  return body.data;
20412
20412
  }
20413
20413
  async getActivationDiff(projectId, env2, agentName, triggerIndex, opts = {}) {
20414
20414
  const qs = lazyFetchQs(opts.against);
20415
- const path61 = `/api/management/projects/${projectId}/envs/${encodeURIComponent(env2)}/diff/activations/${encodeURIComponent(agentName)}/${triggerIndex}`;
20416
- const body = await this.request(qs ? `${path61}?${qs}` : path61);
20415
+ const path62 = `/api/management/projects/${projectId}/envs/${encodeURIComponent(env2)}/diff/activations/${encodeURIComponent(agentName)}/${triggerIndex}`;
20416
+ const body = await this.request(qs ? `${path62}?${qs}` : path62);
20417
20417
  return body.data;
20418
20418
  }
20419
20419
  /** Merge `from` → `env` via the M09 engine. */
@@ -20825,6 +20825,18 @@ var init_api = __esm({
20825
20825
  });
20826
20826
  return body.data;
20827
20827
  }
20828
+ /** Upsert a SINGLETON's single document (collections use createEntriesBatch). */
20829
+ async putDocument(projectId, typeName, data2, options = {}) {
20830
+ const query = options.locale ? `?locale=${encodeURIComponent(options.locale)}` : "";
20831
+ const body = await this.request(
20832
+ this.tenantPath(projectId, `/documents/${typeName}${query}`),
20833
+ {
20834
+ method: "PUT",
20835
+ body: JSON.stringify({ data: data2 })
20836
+ }
20837
+ );
20838
+ return body.data;
20839
+ }
20828
20840
  async updateEntry(projectId, typeName, id, data2) {
20829
20841
  const body = await this.request(this.tenantPath(projectId, `/entries/${typeName}/${id}`), {
20830
20842
  method: "PUT",
@@ -21090,17 +21102,17 @@ var require_visit2 = __commonJS({
21090
21102
  visit2.BREAK = BREAK;
21091
21103
  visit2.SKIP = SKIP;
21092
21104
  visit2.REMOVE = REMOVE;
21093
- function visit_(key, node, visitor, path61) {
21094
- const ctrl = callVisitor(key, node, visitor, path61);
21105
+ function visit_(key, node, visitor, path62) {
21106
+ const ctrl = callVisitor(key, node, visitor, path62);
21095
21107
  if (identity2.isNode(ctrl) || identity2.isPair(ctrl)) {
21096
- replaceNode(key, path61, ctrl);
21097
- return visit_(key, ctrl, visitor, path61);
21108
+ replaceNode(key, path62, ctrl);
21109
+ return visit_(key, ctrl, visitor, path62);
21098
21110
  }
21099
21111
  if (typeof ctrl !== "symbol") {
21100
21112
  if (identity2.isCollection(node)) {
21101
- path61 = Object.freeze(path61.concat(node));
21113
+ path62 = Object.freeze(path62.concat(node));
21102
21114
  for (let i = 0; i < node.items.length; ++i) {
21103
- const ci = visit_(i, node.items[i], visitor, path61);
21115
+ const ci = visit_(i, node.items[i], visitor, path62);
21104
21116
  if (typeof ci === "number")
21105
21117
  i = ci - 1;
21106
21118
  else if (ci === BREAK)
@@ -21111,13 +21123,13 @@ var require_visit2 = __commonJS({
21111
21123
  }
21112
21124
  }
21113
21125
  } else if (identity2.isPair(node)) {
21114
- path61 = Object.freeze(path61.concat(node));
21115
- const ck = visit_("key", node.key, visitor, path61);
21126
+ path62 = Object.freeze(path62.concat(node));
21127
+ const ck = visit_("key", node.key, visitor, path62);
21116
21128
  if (ck === BREAK)
21117
21129
  return BREAK;
21118
21130
  else if (ck === REMOVE)
21119
21131
  node.key = null;
21120
- const cv = visit_("value", node.value, visitor, path61);
21132
+ const cv = visit_("value", node.value, visitor, path62);
21121
21133
  if (cv === BREAK)
21122
21134
  return BREAK;
21123
21135
  else if (cv === REMOVE)
@@ -21140,17 +21152,17 @@ var require_visit2 = __commonJS({
21140
21152
  visitAsync.BREAK = BREAK;
21141
21153
  visitAsync.SKIP = SKIP;
21142
21154
  visitAsync.REMOVE = REMOVE;
21143
- async function visitAsync_(key, node, visitor, path61) {
21144
- const ctrl = await callVisitor(key, node, visitor, path61);
21155
+ async function visitAsync_(key, node, visitor, path62) {
21156
+ const ctrl = await callVisitor(key, node, visitor, path62);
21145
21157
  if (identity2.isNode(ctrl) || identity2.isPair(ctrl)) {
21146
- replaceNode(key, path61, ctrl);
21147
- return visitAsync_(key, ctrl, visitor, path61);
21158
+ replaceNode(key, path62, ctrl);
21159
+ return visitAsync_(key, ctrl, visitor, path62);
21148
21160
  }
21149
21161
  if (typeof ctrl !== "symbol") {
21150
21162
  if (identity2.isCollection(node)) {
21151
- path61 = Object.freeze(path61.concat(node));
21163
+ path62 = Object.freeze(path62.concat(node));
21152
21164
  for (let i = 0; i < node.items.length; ++i) {
21153
- const ci = await visitAsync_(i, node.items[i], visitor, path61);
21165
+ const ci = await visitAsync_(i, node.items[i], visitor, path62);
21154
21166
  if (typeof ci === "number")
21155
21167
  i = ci - 1;
21156
21168
  else if (ci === BREAK)
@@ -21161,13 +21173,13 @@ var require_visit2 = __commonJS({
21161
21173
  }
21162
21174
  }
21163
21175
  } else if (identity2.isPair(node)) {
21164
- path61 = Object.freeze(path61.concat(node));
21165
- const ck = await visitAsync_("key", node.key, visitor, path61);
21176
+ path62 = Object.freeze(path62.concat(node));
21177
+ const ck = await visitAsync_("key", node.key, visitor, path62);
21166
21178
  if (ck === BREAK)
21167
21179
  return BREAK;
21168
21180
  else if (ck === REMOVE)
21169
21181
  node.key = null;
21170
- const cv = await visitAsync_("value", node.value, visitor, path61);
21182
+ const cv = await visitAsync_("value", node.value, visitor, path62);
21171
21183
  if (cv === BREAK)
21172
21184
  return BREAK;
21173
21185
  else if (cv === REMOVE)
@@ -21196,24 +21208,24 @@ var require_visit2 = __commonJS({
21196
21208
  return visitor;
21197
21209
  }
21198
21210
  __name(initVisitor, "initVisitor");
21199
- function callVisitor(key, node, visitor, path61) {
21211
+ function callVisitor(key, node, visitor, path62) {
21200
21212
  if (typeof visitor === "function")
21201
- return visitor(key, node, path61);
21213
+ return visitor(key, node, path62);
21202
21214
  if (identity2.isMap(node))
21203
- return visitor.Map?.(key, node, path61);
21215
+ return visitor.Map?.(key, node, path62);
21204
21216
  if (identity2.isSeq(node))
21205
- return visitor.Seq?.(key, node, path61);
21217
+ return visitor.Seq?.(key, node, path62);
21206
21218
  if (identity2.isPair(node))
21207
- return visitor.Pair?.(key, node, path61);
21219
+ return visitor.Pair?.(key, node, path62);
21208
21220
  if (identity2.isScalar(node))
21209
- return visitor.Scalar?.(key, node, path61);
21221
+ return visitor.Scalar?.(key, node, path62);
21210
21222
  if (identity2.isAlias(node))
21211
- return visitor.Alias?.(key, node, path61);
21223
+ return visitor.Alias?.(key, node, path62);
21212
21224
  return void 0;
21213
21225
  }
21214
21226
  __name(callVisitor, "callVisitor");
21215
- function replaceNode(key, path61, node) {
21216
- const parent2 = path61[path61.length - 1];
21227
+ function replaceNode(key, path62, node) {
21228
+ const parent2 = path62[path62.length - 1];
21217
21229
  if (identity2.isCollection(parent2)) {
21218
21230
  parent2.items[key] = node;
21219
21231
  } else if (identity2.isPair(parent2)) {
@@ -21843,10 +21855,10 @@ var require_Collection2 = __commonJS({
21843
21855
  var createNode = require_createNode2();
21844
21856
  var identity2 = require_identity2();
21845
21857
  var Node2 = require_Node2();
21846
- function collectionFromPath(schema, path61, value) {
21858
+ function collectionFromPath(schema, path62, value) {
21847
21859
  let v = value;
21848
- for (let i = path61.length - 1; i >= 0; --i) {
21849
- const k = path61[i];
21860
+ for (let i = path62.length - 1; i >= 0; --i) {
21861
+ const k = path62[i];
21850
21862
  if (typeof k === "number" && Number.isInteger(k) && k >= 0) {
21851
21863
  const a = [];
21852
21864
  a[k] = v;
@@ -21866,7 +21878,7 @@ var require_Collection2 = __commonJS({
21866
21878
  });
21867
21879
  }
21868
21880
  __name(collectionFromPath, "collectionFromPath");
21869
- var isEmptyPath = /* @__PURE__ */ __name((path61) => path61 == null || typeof path61 === "object" && !!path61[Symbol.iterator]().next().done, "isEmptyPath");
21881
+ var isEmptyPath = /* @__PURE__ */ __name((path62) => path62 == null || typeof path62 === "object" && !!path62[Symbol.iterator]().next().done, "isEmptyPath");
21870
21882
  var Collection = class extends Node2.NodeBase {
21871
21883
  static {
21872
21884
  __name(this, "Collection");
@@ -21899,11 +21911,11 @@ var require_Collection2 = __commonJS({
21899
21911
  * be a Pair instance or a `{ key, value }` object, which may not have a key
21900
21912
  * that already exists in the map.
21901
21913
  */
21902
- addIn(path61, value) {
21903
- if (isEmptyPath(path61))
21914
+ addIn(path62, value) {
21915
+ if (isEmptyPath(path62))
21904
21916
  this.add(value);
21905
21917
  else {
21906
- const [key, ...rest] = path61;
21918
+ const [key, ...rest] = path62;
21907
21919
  const node = this.get(key, true);
21908
21920
  if (identity2.isCollection(node))
21909
21921
  node.addIn(rest, value);
@@ -21917,8 +21929,8 @@ var require_Collection2 = __commonJS({
21917
21929
  * Removes a value from the collection.
21918
21930
  * @returns `true` if the item was found and removed.
21919
21931
  */
21920
- deleteIn(path61) {
21921
- const [key, ...rest] = path61;
21932
+ deleteIn(path62) {
21933
+ const [key, ...rest] = path62;
21922
21934
  if (rest.length === 0)
21923
21935
  return this.delete(key);
21924
21936
  const node = this.get(key, true);
@@ -21932,8 +21944,8 @@ var require_Collection2 = __commonJS({
21932
21944
  * scalar values from their surrounding node; to disable set `keepScalar` to
21933
21945
  * `true` (collections are always returned intact).
21934
21946
  */
21935
- getIn(path61, keepScalar) {
21936
- const [key, ...rest] = path61;
21947
+ getIn(path62, keepScalar) {
21948
+ const [key, ...rest] = path62;
21937
21949
  const node = this.get(key, true);
21938
21950
  if (rest.length === 0)
21939
21951
  return !keepScalar && identity2.isScalar(node) ? node.value : node;
@@ -21951,8 +21963,8 @@ var require_Collection2 = __commonJS({
21951
21963
  /**
21952
21964
  * Checks if the collection includes a value with the key `key`.
21953
21965
  */
21954
- hasIn(path61) {
21955
- const [key, ...rest] = path61;
21966
+ hasIn(path62) {
21967
+ const [key, ...rest] = path62;
21956
21968
  if (rest.length === 0)
21957
21969
  return this.has(key);
21958
21970
  const node = this.get(key, true);
@@ -21962,8 +21974,8 @@ var require_Collection2 = __commonJS({
21962
21974
  * Sets a value in this collection. For `!!set`, `value` needs to be a
21963
21975
  * boolean to add/remove the item from the set.
21964
21976
  */
21965
- setIn(path61, value) {
21966
- const [key, ...rest] = path61;
21977
+ setIn(path62, value) {
21978
+ const [key, ...rest] = path62;
21967
21979
  if (rest.length === 0) {
21968
21980
  this.set(key, value);
21969
21981
  } else {
@@ -24528,9 +24540,9 @@ var require_Document2 = __commonJS({
24528
24540
  this.contents.add(value);
24529
24541
  }
24530
24542
  /** Adds a value to the document. */
24531
- addIn(path61, value) {
24543
+ addIn(path62, value) {
24532
24544
  if (assertCollection(this.contents))
24533
- this.contents.addIn(path61, value);
24545
+ this.contents.addIn(path62, value);
24534
24546
  }
24535
24547
  /**
24536
24548
  * Create a new `Alias` node, ensuring that the target `node` has the required anchor.
@@ -24605,14 +24617,14 @@ var require_Document2 = __commonJS({
24605
24617
  * Removes a value from the document.
24606
24618
  * @returns `true` if the item was found and removed.
24607
24619
  */
24608
- deleteIn(path61) {
24609
- if (Collection.isEmptyPath(path61)) {
24620
+ deleteIn(path62) {
24621
+ if (Collection.isEmptyPath(path62)) {
24610
24622
  if (this.contents == null)
24611
24623
  return false;
24612
24624
  this.contents = null;
24613
24625
  return true;
24614
24626
  }
24615
- return assertCollection(this.contents) ? this.contents.deleteIn(path61) : false;
24627
+ return assertCollection(this.contents) ? this.contents.deleteIn(path62) : false;
24616
24628
  }
24617
24629
  /**
24618
24630
  * Returns item at `key`, or `undefined` if not found. By default unwraps
@@ -24627,10 +24639,10 @@ var require_Document2 = __commonJS({
24627
24639
  * scalar values from their surrounding node; to disable set `keepScalar` to
24628
24640
  * `true` (collections are always returned intact).
24629
24641
  */
24630
- getIn(path61, keepScalar) {
24631
- if (Collection.isEmptyPath(path61))
24642
+ getIn(path62, keepScalar) {
24643
+ if (Collection.isEmptyPath(path62))
24632
24644
  return !keepScalar && identity2.isScalar(this.contents) ? this.contents.value : this.contents;
24633
- return identity2.isCollection(this.contents) ? this.contents.getIn(path61, keepScalar) : void 0;
24645
+ return identity2.isCollection(this.contents) ? this.contents.getIn(path62, keepScalar) : void 0;
24634
24646
  }
24635
24647
  /**
24636
24648
  * Checks if the document includes a value with the key `key`.
@@ -24641,10 +24653,10 @@ var require_Document2 = __commonJS({
24641
24653
  /**
24642
24654
  * Checks if the document includes a value at `path`.
24643
24655
  */
24644
- hasIn(path61) {
24645
- if (Collection.isEmptyPath(path61))
24656
+ hasIn(path62) {
24657
+ if (Collection.isEmptyPath(path62))
24646
24658
  return this.contents !== void 0;
24647
- return identity2.isCollection(this.contents) ? this.contents.hasIn(path61) : false;
24659
+ return identity2.isCollection(this.contents) ? this.contents.hasIn(path62) : false;
24648
24660
  }
24649
24661
  /**
24650
24662
  * Sets a value in this document. For `!!set`, `value` needs to be a
@@ -24661,13 +24673,13 @@ var require_Document2 = __commonJS({
24661
24673
  * Sets a value in this document. For `!!set`, `value` needs to be a
24662
24674
  * boolean to add/remove the item from the set.
24663
24675
  */
24664
- setIn(path61, value) {
24665
- if (Collection.isEmptyPath(path61)) {
24676
+ setIn(path62, value) {
24677
+ if (Collection.isEmptyPath(path62)) {
24666
24678
  this.contents = value;
24667
24679
  } else if (this.contents == null) {
24668
- this.contents = Collection.collectionFromPath(this.schema, Array.from(path61), value);
24680
+ this.contents = Collection.collectionFromPath(this.schema, Array.from(path62), value);
24669
24681
  } else if (assertCollection(this.contents)) {
24670
- this.contents.setIn(path61, value);
24682
+ this.contents.setIn(path62, value);
24671
24683
  }
24672
24684
  }
24673
24685
  /**
@@ -26671,9 +26683,9 @@ var require_cst_visit2 = __commonJS({
26671
26683
  visit2.BREAK = BREAK;
26672
26684
  visit2.SKIP = SKIP;
26673
26685
  visit2.REMOVE = REMOVE;
26674
- visit2.itemAtPath = (cst, path61) => {
26686
+ visit2.itemAtPath = (cst, path62) => {
26675
26687
  let item = cst;
26676
- for (const [field, index2] of path61) {
26688
+ for (const [field, index2] of path62) {
26677
26689
  const tok = item?.[field];
26678
26690
  if (tok && "items" in tok) {
26679
26691
  item = tok.items[index2];
@@ -26682,23 +26694,23 @@ var require_cst_visit2 = __commonJS({
26682
26694
  }
26683
26695
  return item;
26684
26696
  };
26685
- visit2.parentCollection = (cst, path61) => {
26686
- const parent2 = visit2.itemAtPath(cst, path61.slice(0, -1));
26687
- const field = path61[path61.length - 1][0];
26697
+ visit2.parentCollection = (cst, path62) => {
26698
+ const parent2 = visit2.itemAtPath(cst, path62.slice(0, -1));
26699
+ const field = path62[path62.length - 1][0];
26688
26700
  const coll = parent2?.[field];
26689
26701
  if (coll && "items" in coll)
26690
26702
  return coll;
26691
26703
  throw new Error("Parent collection not found");
26692
26704
  };
26693
- function _visit(path61, item, visitor) {
26694
- let ctrl = visitor(item, path61);
26705
+ function _visit(path62, item, visitor) {
26706
+ let ctrl = visitor(item, path62);
26695
26707
  if (typeof ctrl === "symbol")
26696
26708
  return ctrl;
26697
26709
  for (const field of ["key", "value"]) {
26698
26710
  const token = item[field];
26699
26711
  if (token && "items" in token) {
26700
26712
  for (let i = 0; i < token.items.length; ++i) {
26701
- const ci = _visit(Object.freeze(path61.concat([[field, i]])), token.items[i], visitor);
26713
+ const ci = _visit(Object.freeze(path62.concat([[field, i]])), token.items[i], visitor);
26702
26714
  if (typeof ci === "number")
26703
26715
  i = ci - 1;
26704
26716
  else if (ci === BREAK)
@@ -26709,10 +26721,10 @@ var require_cst_visit2 = __commonJS({
26709
26721
  }
26710
26722
  }
26711
26723
  if (typeof ctrl === "function" && field === "key")
26712
- ctrl = ctrl(item, path61);
26724
+ ctrl = ctrl(item, path62);
26713
26725
  }
26714
26726
  }
26715
- return typeof ctrl === "function" ? ctrl(item, path61) : ctrl;
26727
+ return typeof ctrl === "function" ? ctrl(item, path62) : ctrl;
26716
26728
  }
26717
26729
  __name(_visit, "_visit");
26718
26730
  exports2.visit = visit2;
@@ -28016,14 +28028,14 @@ var require_parser3 = __commonJS({
28016
28028
  case "scalar":
28017
28029
  case "single-quoted-scalar":
28018
28030
  case "double-quoted-scalar": {
28019
- const fs56 = this.flowScalar(this.type);
28031
+ const fs57 = this.flowScalar(this.type);
28020
28032
  if (atNextItem || it2.value) {
28021
- map3.items.push({ start, key: fs56, sep: [] });
28033
+ map3.items.push({ start, key: fs57, sep: [] });
28022
28034
  this.onKeyLine = true;
28023
28035
  } else if (it2.sep) {
28024
- this.stack.push(fs56);
28036
+ this.stack.push(fs57);
28025
28037
  } else {
28026
- Object.assign(it2, { key: fs56, sep: [] });
28038
+ Object.assign(it2, { key: fs57, sep: [] });
28027
28039
  this.onKeyLine = true;
28028
28040
  }
28029
28041
  return;
@@ -28151,13 +28163,13 @@ var require_parser3 = __commonJS({
28151
28163
  case "scalar":
28152
28164
  case "single-quoted-scalar":
28153
28165
  case "double-quoted-scalar": {
28154
- const fs56 = this.flowScalar(this.type);
28166
+ const fs57 = this.flowScalar(this.type);
28155
28167
  if (!it2 || it2.value)
28156
- fc.items.push({ start: [], key: fs56, sep: [] });
28168
+ fc.items.push({ start: [], key: fs57, sep: [] });
28157
28169
  else if (it2.sep)
28158
- this.stack.push(fs56);
28170
+ this.stack.push(fs57);
28159
28171
  else
28160
- Object.assign(it2, { key: fs56, sep: [] });
28172
+ Object.assign(it2, { key: fs57, sep: [] });
28161
28173
  return;
28162
28174
  }
28163
28175
  case "flow-map-end":
@@ -28724,10 +28736,10 @@ function mergeDefs(...defs) {
28724
28736
  function cloneDef(schema) {
28725
28737
  return mergeDefs(schema._zod.def);
28726
28738
  }
28727
- function getElementAtPath(obj, path61) {
28728
- if (!path61)
28739
+ function getElementAtPath(obj, path62) {
28740
+ if (!path62)
28729
28741
  return obj;
28730
- return path61.reduce((acc, key) => acc?.[key], obj);
28742
+ return path62.reduce((acc, key) => acc?.[key], obj);
28731
28743
  }
28732
28744
  function promiseAllObject(promisesObj) {
28733
28745
  const keys = Object.keys(promisesObj);
@@ -29017,11 +29029,11 @@ function aborted(x, startIndex = 0) {
29017
29029
  }
29018
29030
  return false;
29019
29031
  }
29020
- function prefixIssues(path61, issues) {
29032
+ function prefixIssues(path62, issues) {
29021
29033
  return issues.map((iss) => {
29022
29034
  var _a5;
29023
29035
  (_a5 = iss).path ?? (_a5.path = []);
29024
- iss.path.unshift(path61);
29036
+ iss.path.unshift(path62);
29025
29037
  return iss;
29026
29038
  });
29027
29039
  }
@@ -29303,7 +29315,7 @@ function treeifyError(error45, _mapper) {
29303
29315
  return issue2.message;
29304
29316
  };
29305
29317
  const result = { errors: [] };
29306
- const processError = /* @__PURE__ */ __name((error46, path61 = []) => {
29318
+ const processError = /* @__PURE__ */ __name((error46, path62 = []) => {
29307
29319
  var _a5, _b;
29308
29320
  for (const issue2 of error46.issues) {
29309
29321
  if (issue2.code === "invalid_union" && issue2.errors.length) {
@@ -29313,7 +29325,7 @@ function treeifyError(error45, _mapper) {
29313
29325
  } else if (issue2.code === "invalid_element") {
29314
29326
  processError({ issues: issue2.issues }, issue2.path);
29315
29327
  } else {
29316
- const fullpath = [...path61, ...issue2.path];
29328
+ const fullpath = [...path62, ...issue2.path];
29317
29329
  if (fullpath.length === 0) {
29318
29330
  result.errors.push(mapper(issue2));
29319
29331
  continue;
@@ -29345,8 +29357,8 @@ function treeifyError(error45, _mapper) {
29345
29357
  }
29346
29358
  function toDotPath(_path) {
29347
29359
  const segs = [];
29348
- const path61 = _path.map((seg) => typeof seg === "object" ? seg.key : seg);
29349
- for (const seg of path61) {
29360
+ const path62 = _path.map((seg) => typeof seg === "object" ? seg.key : seg);
29361
+ for (const seg of path62) {
29350
29362
  if (typeof seg === "number")
29351
29363
  segs.push(`[${seg}]`);
29352
29364
  else if (typeof seg === "symbol")
@@ -46733,11 +46745,11 @@ function ParseErr(message, str, indx) {
46733
46745
  message += " at line " + lineNo + " col " + colNo + ":\n\n " + str.split(/\n/)[lineNo - 1] + "\n " + Array(colNo).join(" ") + "^";
46734
46746
  throw new EtaParseError(message);
46735
46747
  }
46736
- function RuntimeErr(originalError, str, lineNo, path61) {
46748
+ function RuntimeErr(originalError, str, lineNo, path62) {
46737
46749
  const lines = str.split("\n");
46738
46750
  const start = Math.max(lineNo - 3, 0);
46739
46751
  const end2 = Math.min(lines.length, lineNo + 3);
46740
- const filename = path61;
46752
+ const filename = path62;
46741
46753
  const context = lines.slice(start, end2).map(function(line, i) {
46742
46754
  const curr = i + start + 1;
46743
46755
  return (curr == lineNo ? " >> " : " ") + curr + "| " + line;
@@ -47068,13 +47080,13 @@ function renderStringAsync(template, data2) {
47068
47080
  });
47069
47081
  return renderAsync.call(this, templateFn, data2);
47070
47082
  }
47071
- function readFile2(path61) {
47083
+ function readFile2(path62) {
47072
47084
  let res = "";
47073
47085
  try {
47074
- res = fs21.readFileSync(path61, "utf8");
47086
+ res = fs21.readFileSync(path62, "utf8");
47075
47087
  } catch (err) {
47076
47088
  if ((err == null ? void 0 : err.code) === "ENOENT") {
47077
- throw new EtaFileResolutionError(`Could not find template: ${path61}`);
47089
+ throw new EtaFileResolutionError(`Could not find template: ${path62}`);
47078
47090
  } else {
47079
47091
  throw err;
47080
47092
  }
@@ -47351,9 +47363,9 @@ function getFormFiles(formsDir) {
47351
47363
  }
47352
47364
  return readdirSync3(formsDir).filter((f) => f.endsWith(".json")).map((f) => join8(formsDir, f));
47353
47365
  }
47354
- function readForm(path61) {
47366
+ function readForm(path62) {
47355
47367
  try {
47356
- return JSON.parse(readFileSync7(path61, "utf-8"));
47368
+ return JSON.parse(readFileSync7(path62, "utf-8"));
47357
47369
  } catch {
47358
47370
  return null;
47359
47371
  }
@@ -47472,9 +47484,9 @@ function getSchemaFiles(schemasDir) {
47472
47484
  }
47473
47485
  return readdirSync4(schemasDir).filter((f) => f.endsWith(".json")).map((f) => join9(schemasDir, f));
47474
47486
  }
47475
- function readSchema(path61) {
47487
+ function readSchema(path62) {
47476
47488
  try {
47477
- return JSON.parse(readFileSync8(path61, "utf-8"));
47489
+ return JSON.parse(readFileSync8(path62, "utf-8"));
47478
47490
  } catch {
47479
47491
  return null;
47480
47492
  }
@@ -48950,7 +48962,7 @@ function pushRoute(routes, parts) {
48950
48962
  }
48951
48963
  function discoverAstroRoutes(pagesDir) {
48952
48964
  const routes = [];
48953
- const walk = /* @__PURE__ */ __name((dir, segments) => {
48965
+ const walk2 = /* @__PURE__ */ __name((dir, segments) => {
48954
48966
  let entries2;
48955
48967
  try {
48956
48968
  entries2 = readdirSync8(dir);
@@ -48966,7 +48978,7 @@ function discoverAstroRoutes(pagesDir) {
48966
48978
  continue;
48967
48979
  }
48968
48980
  if (isDir) {
48969
- walk(full, [...segments, toSegment(entry)]);
48981
+ walk2(full, [...segments, toSegment(entry)]);
48970
48982
  continue;
48971
48983
  }
48972
48984
  if (!PAGE_EXT.test(entry) || entry.startsWith("_")) {
@@ -48976,7 +48988,7 @@ function discoverAstroRoutes(pagesDir) {
48976
48988
  pushRoute(routes, base === "index" ? segments : [...segments, toSegment(base)]);
48977
48989
  }
48978
48990
  }, "walk");
48979
- walk(pagesDir, []);
48991
+ walk2(pagesDir, []);
48980
48992
  routes.sort((a, b) => a.path.localeCompare(b.path));
48981
48993
  return routes;
48982
48994
  }
@@ -49316,7 +49328,7 @@ function scanScriptCollections(scriptCode, originalCode, relPath) {
49316
49328
  const base = originalCode.indexOf(scriptCode);
49317
49329
  const codeForLines = base >= 0 ? originalCode : scriptCode;
49318
49330
  const scriptOffset = base >= 0 ? base : 0;
49319
- const walk = /* @__PURE__ */ __name((node) => {
49331
+ const walk2 = /* @__PURE__ */ __name((node) => {
49320
49332
  if (!node || typeof node !== "object") {
49321
49333
  return;
49322
49334
  }
@@ -49325,13 +49337,13 @@ function scanScriptCollections(scriptCode, originalCode, relPath) {
49325
49337
  }
49326
49338
  for (const value of Object.values(node)) {
49327
49339
  if (Array.isArray(value)) {
49328
- value.forEach(walk);
49340
+ value.forEach(walk2);
49329
49341
  } else if (value && typeof value === "object" && value.type) {
49330
- walk(value);
49342
+ walk2(value);
49331
49343
  }
49332
49344
  }
49333
49345
  }, "walk");
49334
- walk(program2);
49346
+ walk2(program2);
49335
49347
  return collections;
49336
49348
  }
49337
49349
  function foreignI18nBinding(ast) {
@@ -49607,7 +49619,7 @@ function scanDataJson(relPath, raw) {
49607
49619
  return null;
49608
49620
  }
49609
49621
  const found = { file: relPath, strings: 0, samples: [], collections: [] };
49610
- const walk = /* @__PURE__ */ __name((node, jsonPath, key) => {
49622
+ const walk2 = /* @__PURE__ */ __name((node, jsonPath, key) => {
49611
49623
  if (typeof node === "string") {
49612
49624
  if (isProseValue(key, node)) {
49613
49625
  found.strings += 1;
@@ -49651,16 +49663,16 @@ function scanDataJson(relPath, raw) {
49651
49663
  });
49652
49664
  }
49653
49665
  }
49654
- node.forEach((entry, index2) => walk(entry, `${jsonPath}[${index2}]`, key));
49666
+ node.forEach((entry, index2) => walk2(entry, `${jsonPath}[${index2}]`, key));
49655
49667
  return;
49656
49668
  }
49657
49669
  if (node && typeof node === "object") {
49658
49670
  for (const [childKey, child] of Object.entries(node)) {
49659
- walk(child, jsonPath ? `${jsonPath}.${childKey}` : childKey, childKey);
49671
+ walk2(child, jsonPath ? `${jsonPath}.${childKey}` : childKey, childKey);
49660
49672
  }
49661
49673
  }
49662
49674
  }, "walk");
49663
- walk(parsed, "", "");
49675
+ walk2(parsed, "", "");
49664
49676
  return found.strings >= 3 || found.collections.length > 0 ? found : null;
49665
49677
  }
49666
49678
  function dataFileLabelKeys(raw, prefix, filePath = "") {
@@ -49671,7 +49683,7 @@ function dataFileLabelKeys(raw, prefix, filePath = "") {
49671
49683
  return [];
49672
49684
  }
49673
49685
  const keys = [];
49674
- const walk = /* @__PURE__ */ __name((node, jsonPath, key) => {
49686
+ const walk2 = /* @__PURE__ */ __name((node, jsonPath, key) => {
49675
49687
  if (typeof node === "string") {
49676
49688
  if (isProseValue(key, node)) {
49677
49689
  keys.push(`${prefix}${jsonPath}`);
@@ -49679,16 +49691,16 @@ function dataFileLabelKeys(raw, prefix, filePath = "") {
49679
49691
  return;
49680
49692
  }
49681
49693
  if (Array.isArray(node)) {
49682
- node.forEach((entry, index2) => walk(entry, `${jsonPath}.${index2}`, key));
49694
+ node.forEach((entry, index2) => walk2(entry, `${jsonPath}.${index2}`, key));
49683
49695
  return;
49684
49696
  }
49685
49697
  if (node && typeof node === "object") {
49686
49698
  for (const [childKey, child] of Object.entries(node)) {
49687
- walk(child, jsonPath ? `${jsonPath}.${childKey}` : childKey, childKey);
49699
+ walk2(child, jsonPath ? `${jsonPath}.${childKey}` : childKey, childKey);
49688
49700
  }
49689
49701
  }
49690
49702
  }, "walk");
49691
- walk(parsed, "", "");
49703
+ walk2(parsed, "", "");
49692
49704
  return keys;
49693
49705
  }
49694
49706
  function collectDataFiles(dir, out = []) {
@@ -49773,7 +49785,7 @@ function scanExternalSources(rootDir, dirs) {
49773
49785
  } catch {
49774
49786
  continue;
49775
49787
  }
49776
- const walk = /* @__PURE__ */ __name((node) => {
49788
+ const walk2 = /* @__PURE__ */ __name((node) => {
49777
49789
  if (!node || typeof node !== "object") {
49778
49790
  return;
49779
49791
  }
@@ -49804,14 +49816,14 @@ function scanExternalSources(rootDir, dirs) {
49804
49816
  const child = node[key];
49805
49817
  if (Array.isArray(child)) {
49806
49818
  for (const item of child) {
49807
- walk(item);
49819
+ walk2(item);
49808
49820
  }
49809
49821
  } else if (typeof child === "object" && child !== null) {
49810
- walk(child);
49822
+ walk2(child);
49811
49823
  }
49812
49824
  }
49813
49825
  }, "walk");
49814
- walk(ast);
49826
+ walk2(ast);
49815
49827
  }
49816
49828
  }
49817
49829
  const sources = [...byHost.entries()].map(([host, bucket]) => ({
@@ -50399,21 +50411,21 @@ function relativeImport(fromFile, toFile) {
50399
50411
  }
50400
50412
  function pageFilesUnder(dir) {
50401
50413
  const out = [];
50402
- const walk = /* @__PURE__ */ __name((current) => {
50414
+ const walk2 = /* @__PURE__ */ __name((current) => {
50403
50415
  for (const entry of fs36.readdirSync(current, { withFileTypes: true })) {
50404
50416
  if (entry.name === "node_modules" || entry.name.startsWith(".")) {
50405
50417
  continue;
50406
50418
  }
50407
50419
  const full = path38.join(current, entry.name);
50408
50420
  if (entry.isDirectory()) {
50409
- walk(full);
50421
+ walk2(full);
50410
50422
  } else if (/\.(tsx|jsx|js)$/.test(entry.name)) {
50411
50423
  out.push(full);
50412
50424
  }
50413
50425
  }
50414
50426
  }, "walk");
50415
50427
  if (fs36.existsSync(dir)) {
50416
- walk(dir);
50428
+ walk2(dir);
50417
50429
  }
50418
50430
  return out;
50419
50431
  }
@@ -50634,7 +50646,7 @@ function segmentToPath(segment) {
50634
50646
  }
50635
50647
  function discoverNextRoutes(appDir) {
50636
50648
  const routes = [];
50637
- const walk = /* @__PURE__ */ __name((dir, segments) => {
50649
+ const walk2 = /* @__PURE__ */ __name((dir, segments) => {
50638
50650
  let entries2;
50639
50651
  try {
50640
50652
  entries2 = readdirSync10(dir);
@@ -50666,16 +50678,16 @@ function discoverNextRoutes(appDir) {
50666
50678
  if (mapped === null) {
50667
50679
  continue;
50668
50680
  }
50669
- walk(full, [...segments, mapped]);
50681
+ walk2(full, [...segments, mapped]);
50670
50682
  }
50671
50683
  }, "walk");
50672
- walk(appDir, []);
50684
+ walk2(appDir, []);
50673
50685
  return routes.sort((a, b) => a.path.localeCompare(b.path));
50674
50686
  }
50675
50687
  function discoverNextPagesRoutes(pagesDir) {
50676
50688
  const routes = [];
50677
50689
  const toSegment4 = /* @__PURE__ */ __name((name) => name.replace(/^\[\.\.\.(.+)\]$/, ":$1").replace(/^\[\[\.\.\.(.+)\]\]$/, ":$1").replace(/^\[(.+)\]$/, ":$1"), "toSegment");
50678
- const walk = /* @__PURE__ */ __name((dir, segments) => {
50690
+ const walk2 = /* @__PURE__ */ __name((dir, segments) => {
50679
50691
  let entries2;
50680
50692
  try {
50681
50693
  entries2 = readdirSync10(dir);
@@ -50692,7 +50704,7 @@ function discoverNextPagesRoutes(pagesDir) {
50692
50704
  }
50693
50705
  if (isDir) {
50694
50706
  if (!(segments.length === 0 && PAGES_SKIP.has(entry))) {
50695
- walk(full, [...segments, toSegment4(entry)]);
50707
+ walk2(full, [...segments, toSegment4(entry)]);
50696
50708
  }
50697
50709
  continue;
50698
50710
  }
@@ -50713,7 +50725,7 @@ function discoverNextPagesRoutes(pagesDir) {
50713
50725
  });
50714
50726
  }
50715
50727
  }, "walk");
50716
- walk(pagesDir, []);
50728
+ walk2(pagesDir, []);
50717
50729
  routes.sort((a, b) => a.path.localeCompare(b.path));
50718
50730
  return routes;
50719
50731
  }
@@ -50906,7 +50918,7 @@ function pushRoute2(routes, parts) {
50906
50918
  }
50907
50919
  function discoverNuxtRoutes(pagesDir) {
50908
50920
  const routes = [];
50909
- const walk = /* @__PURE__ */ __name((dir, segments) => {
50921
+ const walk2 = /* @__PURE__ */ __name((dir, segments) => {
50910
50922
  let entries2;
50911
50923
  try {
50912
50924
  entries2 = readdirSync11(dir);
@@ -50922,7 +50934,7 @@ function discoverNuxtRoutes(pagesDir) {
50922
50934
  continue;
50923
50935
  }
50924
50936
  if (isDir) {
50925
- walk(full, [...segments, toSegment2(entry)]);
50937
+ walk2(full, [...segments, toSegment2(entry)]);
50926
50938
  continue;
50927
50939
  }
50928
50940
  if (!entry.endsWith(".vue")) {
@@ -50932,7 +50944,7 @@ function discoverNuxtRoutes(pagesDir) {
50932
50944
  pushRoute2(routes, base === "index" ? segments : [...segments, toSegment2(base)]);
50933
50945
  }
50934
50946
  }, "walk");
50935
- walk(pagesDir, []);
50947
+ walk2(pagesDir, []);
50936
50948
  routes.sort((a, b) => a.path.localeCompare(b.path));
50937
50949
  return routes;
50938
50950
  }
@@ -51036,7 +51048,7 @@ function pushRoute4(routes, parts) {
51036
51048
  }
51037
51049
  function discoverSvelteKitRoutes(routesDir) {
51038
51050
  const routes = [];
51039
- const walk = /* @__PURE__ */ __name((dir, segments) => {
51051
+ const walk2 = /* @__PURE__ */ __name((dir, segments) => {
51040
51052
  let entries2;
51041
51053
  try {
51042
51054
  entries2 = readdirSync13(dir);
@@ -51050,14 +51062,14 @@ function discoverSvelteKitRoutes(routesDir) {
51050
51062
  const full = join18(dir, entry);
51051
51063
  try {
51052
51064
  if (statSync9(full).isDirectory()) {
51053
- walk(full, [...segments, toSegment3(entry)]);
51065
+ walk2(full, [...segments, toSegment3(entry)]);
51054
51066
  }
51055
51067
  } catch {
51056
51068
  continue;
51057
51069
  }
51058
51070
  }
51059
51071
  }, "walk");
51060
- walk(routesDir, []);
51072
+ walk2(routesDir, []);
51061
51073
  routes.sort((a, b) => a.path.localeCompare(b.path));
51062
51074
  return routes;
51063
51075
  }
@@ -51260,7 +51272,7 @@ import { join as join21 } from "node:path";
51260
51272
  function discoverReactRouterDomRoutes(rootDir) {
51261
51273
  const srcDir = join21(rootDir, "src");
51262
51274
  const files = [];
51263
- const walk = /* @__PURE__ */ __name((dir) => {
51275
+ const walk2 = /* @__PURE__ */ __name((dir) => {
51264
51276
  let entries2;
51265
51277
  try {
51266
51278
  entries2 = readdirSync14(dir);
@@ -51279,13 +51291,13 @@ function discoverReactRouterDomRoutes(rootDir) {
51279
51291
  continue;
51280
51292
  }
51281
51293
  if (isDir) {
51282
- walk(full);
51294
+ walk2(full);
51283
51295
  } else if (ROUTE_SOURCE.test(entry)) {
51284
51296
  files.push(full);
51285
51297
  }
51286
51298
  }
51287
51299
  }, "walk");
51288
- walk(srcDir);
51300
+ walk2(srcDir);
51289
51301
  const routes = /* @__PURE__ */ new Map();
51290
51302
  for (const file2 of files) {
51291
51303
  let code2;
@@ -51300,21 +51312,21 @@ function discoverReactRouterDomRoutes(rootDir) {
51300
51312
  const paths = [
51301
51313
  ...[...code2.matchAll(/<Route\b[^>]*\bpath\s*=\s*(?:"([^"]+)"|'([^']+)'|\{\s*(?:"([^"]+)"|'([^']+)')\s*\})/g)],
51302
51314
  ...[...code2.matchAll(/\bpath\s*:\s*(?:"([^"]+)"|'([^']+)')/g)]
51303
- ].map((match) => match.slice(1).find(Boolean)).filter((path61) => typeof path61 === "string");
51315
+ ].map((match) => match.slice(1).find(Boolean)).filter((path62) => typeof path62 === "string");
51304
51316
  for (const raw of paths) {
51305
51317
  if (!raw.startsWith("/") || raw.includes("*")) {
51306
51318
  continue;
51307
51319
  }
51308
- const path61 = raw !== "/" && raw.endsWith("/") ? raw.slice(0, -1) : raw;
51309
- if (routes.has(path61)) {
51320
+ const path62 = raw !== "/" && raw.endsWith("/") ? raw.slice(0, -1) : raw;
51321
+ if (routes.has(path62)) {
51310
51322
  continue;
51311
51323
  }
51312
- const parts = path61.split("/").filter(Boolean);
51324
+ const parts = path62.split("/").filter(Boolean);
51313
51325
  const lastStatic = [...parts].reverse().find((part) => !part.startsWith(":"));
51314
- routes.set(path61, {
51315
- id: path61 === "/" ? "home" : parts.map((part) => part.replace(/^:/, "")).join("-"),
51316
- path: path61,
51317
- label: path61 === "/" ? "Home" : titleCase6(lastStatic ?? parts[parts.length - 1] ?? path61)
51326
+ routes.set(path62, {
51327
+ id: path62 === "/" ? "home" : parts.map((part) => part.replace(/^:/, "")).join("-"),
51328
+ path: path62,
51329
+ label: path62 === "/" ? "Home" : titleCase6(lastStatic ?? parts[parts.length - 1] ?? path62)
51318
51330
  });
51319
51331
  }
51320
51332
  }
@@ -51715,27 +51727,17 @@ This is FAKE content so the model is editable in Fimo immediately \u2014 the rea
51715
51727
  ${machine.cmsScaffold.cms} content is NOT migrated (that is a separate, later
51716
51728
  step). Do NOT re-create these schemas, do NOT hand-wrap this content, and do NOT
51717
51729
  delete the example entries.
51718
- ${machine.cmsListHelperPath ? `
51719
- YOUR job \u2014 render the simple LIST views from this Fimo content:
51720
- 1. Move \`${machine.cmsListHelperPath}\` next to the site's ${machine.cmsScaffold.cms} client
51721
- (the folder holding the client that fetches ${machine.cmsScaffold.cms}).
51722
- 2. In each LIST fetcher (the many/all reads behind an index page \u2014 blog list,
51723
- tags, categories, logo grids), consult Fimo first and fall back to the CMS:
51724
- \`\`\`ts
51725
- const fimo = await fimoCmsList(uid, { limit });
51726
- if (fimo) return fimo; // else the existing ${machine.cmsScaffold.cms} fetch runs
51727
- \`\`\`
51728
- \`uid\` is the ${machine.cmsScaffold.cms} content-type UID already handed to that fetcher.
51729
- 3. LIST views ONLY. Leave DETAIL pages and any dynamic-zone / page-builder reads
51730
- on ${machine.cmsScaffold.cms} \u2014 the helper covers flat list fields, not those.
51731
- 4. The helper flattens richtext to plain text and passes media/scalars through;
51732
- if a list component reads a shape it doesn't get (a populated relation, a
51733
- nested media object), adjust that component or the helper \u2014 this last mile is
51734
- judgment, not mechanical.
51735
- 5. Add a parity ignore for the rewired list routes (they now render example
51736
- content where the pre-wrap baseline was empty) under \`wrap.parityIgnores\` in
51737
- \`.fimo/migration/manifest.json\`.
51738
- ` : ""}Report the scaffolded counts in \xA78.
51730
+ ${machine.cmsWired?.wired ? `
51731
+ The machine WIRED your site's ${machine.cmsScaffold.cms} reads to Fimo \u2014 it swapped the
51732
+ client's fetch for the fimo/strapi adapter, so the WHOLE site now renders this
51733
+ scaffolded content from Fimo. Run \`pnpm dev\` (with your Fimo tenant reachable) to
51734
+ see it. Do NOT re-wire the client or the fetch. Any content type that was not
51735
+ scaffolded falls through to ${machine.cmsScaffold.cms} automatically.
51736
+ ` : `
51737
+ The machine could NOT auto-wire the ${machine.cmsScaffold.cms} client. Wire
51738
+ \`fimoStrapiFetch\` (from the generated \`fimo-strapi\` module) into the client's
51739
+ fetch so the site reads this scaffolded content from Fimo.
51740
+ `}Report the scaffolded counts in \xA78.
51739
51741
  ` : ""}${machine.cmsScaffoldAvailable ? `
51740
51742
  ## ${machine.cmsScaffoldAvailable.cms} detected \u2014 scaffold available (NOT done)
51741
51743
 
@@ -52662,7 +52664,7 @@ function renderInitSuccess(ctx, args) {
52662
52664
  if (args.adopted) {
52663
52665
  lines.push(`Next: ask your coding agent to migrate the content \u2014 paste this prompt:`);
52664
52666
  lines.push("");
52665
- lines.push(` ${p2.cyan('"Migrate this site to Fimo (follow .fimo/migration/wrap/agent-prompt.md)"')}`);
52667
+ lines.push(` ${p2.cyan("Migrate this site to Fimo (follow .fimo/migration/wrap/agent-prompt.md)")}`);
52666
52668
  lines.push("");
52667
52669
  lines.push(
52668
52670
  `${p2.dim("(or run")} ${p2.cyan("npx fimo migrate")} ${p2.dim("yourself)")} \u2014 then ${p2.cyan("npx fimo deploy")} to see it in your Fimo Studio preview.`
@@ -74187,14 +74189,14 @@ var require_util = __commonJS({
74187
74189
  }
74188
74190
  const port = url2.port != null ? url2.port : url2.protocol === "https:" ? 443 : 80;
74189
74191
  let origin = url2.origin != null ? url2.origin : `${url2.protocol || ""}//${url2.hostname || ""}:${port}`;
74190
- let path61 = url2.path != null ? url2.path : `${url2.pathname || ""}${url2.search || ""}`;
74192
+ let path62 = url2.path != null ? url2.path : `${url2.pathname || ""}${url2.search || ""}`;
74191
74193
  if (origin[origin.length - 1] === "/") {
74192
74194
  origin = origin.slice(0, origin.length - 1);
74193
74195
  }
74194
- if (path61 && path61[0] !== "/") {
74195
- path61 = `/${path61}`;
74196
+ if (path62 && path62[0] !== "/") {
74197
+ path62 = `/${path62}`;
74196
74198
  }
74197
- return new URL(`${origin}${path61}`);
74199
+ return new URL(`${origin}${path62}`);
74198
74200
  }
74199
74201
  if (!isHttpOrHttpsPrefixed(url2.origin || url2.protocol)) {
74200
74202
  throw new InvalidArgumentError2("Invalid URL protocol: the URL must start with `http:` or `https:`.");
@@ -75054,9 +75056,9 @@ var require_diagnostics = __commonJS({
75054
75056
  "undici:client:sendHeaders",
75055
75057
  (evt) => {
75056
75058
  const {
75057
- request: { method, path: path61, origin }
75059
+ request: { method, path: path62, origin }
75058
75060
  } = evt;
75059
- debugLog("sending request to %s %s%s", method, origin, path61);
75061
+ debugLog("sending request to %s %s%s", method, origin, path62);
75060
75062
  }
75061
75063
  );
75062
75064
  }
@@ -75075,14 +75077,14 @@ var require_diagnostics = __commonJS({
75075
75077
  "undici:request:headers",
75076
75078
  (evt) => {
75077
75079
  const {
75078
- request: { method, path: path61, origin },
75080
+ request: { method, path: path62, origin },
75079
75081
  response: { statusCode }
75080
75082
  } = evt;
75081
75083
  debugLog(
75082
75084
  "received response to %s %s%s - HTTP %d",
75083
75085
  method,
75084
75086
  origin,
75085
- path61,
75087
+ path62,
75086
75088
  statusCode
75087
75089
  );
75088
75090
  }
@@ -75091,23 +75093,23 @@ var require_diagnostics = __commonJS({
75091
75093
  "undici:request:trailers",
75092
75094
  (evt) => {
75093
75095
  const {
75094
- request: { method, path: path61, origin }
75096
+ request: { method, path: path62, origin }
75095
75097
  } = evt;
75096
- debugLog("trailers received from %s %s%s", method, origin, path61);
75098
+ debugLog("trailers received from %s %s%s", method, origin, path62);
75097
75099
  }
75098
75100
  );
75099
75101
  diagnosticsChannel.subscribe(
75100
75102
  "undici:request:error",
75101
75103
  (evt) => {
75102
75104
  const {
75103
- request: { method, path: path61, origin },
75105
+ request: { method, path: path62, origin },
75104
75106
  error: error45
75105
75107
  } = evt;
75106
75108
  debugLog(
75107
75109
  "request to %s %s%s errored - %s",
75108
75110
  method,
75109
75111
  origin,
75110
- path61,
75112
+ path62,
75111
75113
  error45.message
75112
75114
  );
75113
75115
  }
@@ -75215,7 +75217,7 @@ var require_request = __commonJS({
75215
75217
  __name(this, "Request");
75216
75218
  }
75217
75219
  constructor(origin, {
75218
- path: path61,
75220
+ path: path62,
75219
75221
  method,
75220
75222
  body,
75221
75223
  headers,
@@ -75232,11 +75234,11 @@ var require_request = __commonJS({
75232
75234
  maxRedirections,
75233
75235
  typeOfService
75234
75236
  }, handler) {
75235
- if (typeof path61 !== "string") {
75237
+ if (typeof path62 !== "string") {
75236
75238
  throw new InvalidArgumentError2("path must be a string");
75237
- } else if (path61[0] !== "/" && !(path61.startsWith("http://") || path61.startsWith("https://")) && method !== "CONNECT") {
75239
+ } else if (path62[0] !== "/" && !(path62.startsWith("http://") || path62.startsWith("https://")) && method !== "CONNECT") {
75238
75240
  throw new InvalidArgumentError2("path must be an absolute URL or start with a slash");
75239
- } else if (invalidPathRegex.test(path61)) {
75241
+ } else if (invalidPathRegex.test(path62)) {
75240
75242
  throw new InvalidArgumentError2("invalid request path");
75241
75243
  }
75242
75244
  if (typeof method !== "string") {
@@ -75311,7 +75313,7 @@ var require_request = __commonJS({
75311
75313
  this.completed = false;
75312
75314
  this.aborted = false;
75313
75315
  this.upgrade = upgrade || null;
75314
- this.path = query ? serializePathWithQuery(path61, query) : path61;
75316
+ this.path = query ? serializePathWithQuery(path62, query) : path62;
75315
75317
  this.origin = origin;
75316
75318
  this.protocol = getProtocolFromUrlString(origin);
75317
75319
  this.idempotent = idempotent == null ? method === "HEAD" || method === "GET" : idempotent;
@@ -80503,7 +80505,7 @@ var require_client_h1 = __commonJS({
80503
80505
  }
80504
80506
  __name(shouldSendContentLength, "shouldSendContentLength");
80505
80507
  function writeH1(client, request) {
80506
- const { method, path: path61, host, upgrade, blocking, reset } = request;
80508
+ const { method, path: path62, host, upgrade, blocking, reset } = request;
80507
80509
  let { body, headers, contentLength } = request;
80508
80510
  const expectsPayload = method === "PUT" || method === "POST" || method === "PATCH" || method === "QUERY" || method === "PROPFIND" || method === "PROPPATCH";
80509
80511
  if (util.isFormDataLike(body)) {
@@ -80572,7 +80574,7 @@ var require_client_h1 = __commonJS({
80572
80574
  if (socket.setTypeOfService) {
80573
80575
  socket.setTypeOfService(request.typeOfService);
80574
80576
  }
80575
- let header = `${method} ${path61} HTTP/1.1\r
80577
+ let header = `${method} ${path62} HTTP/1.1\r
80576
80578
  `;
80577
80579
  if (typeof host === "string") {
80578
80580
  header += `host: ${host}\r
@@ -81251,7 +81253,7 @@ var require_client_h2 = __commonJS({
81251
81253
  function writeH2(client, request) {
81252
81254
  const requestTimeout = request.bodyTimeout ?? client[kBodyTimeout];
81253
81255
  const session = client[kHTTP2Session];
81254
- const { method, path: path61, host, upgrade, expectContinue, signal, protocol, headers: reqHeaders } = request;
81256
+ const { method, path: path62, host, upgrade, expectContinue, signal, protocol, headers: reqHeaders } = request;
81255
81257
  let { body } = request;
81256
81258
  if (upgrade != null && upgrade !== "websocket") {
81257
81259
  util.errorRequest(client, request, new InvalidArgumentError2(`Custom upgrade "${upgrade}" not supported over HTTP/2`));
@@ -81319,7 +81321,7 @@ var require_client_h2 = __commonJS({
81319
81321
  }
81320
81322
  headers[HTTP2_HEADER_METHOD] = "CONNECT";
81321
81323
  headers[HTTP2_HEADER_PROTOCOL] = "websocket";
81322
- headers[HTTP2_HEADER_PATH] = path61;
81324
+ headers[HTTP2_HEADER_PATH] = path62;
81323
81325
  if (protocol === "ws:" || protocol === "wss:") {
81324
81326
  headers[HTTP2_HEADER_SCHEME] = protocol === "ws:" ? "http" : "https";
81325
81327
  } else {
@@ -81360,7 +81362,7 @@ var require_client_h2 = __commonJS({
81360
81362
  stream.setTimeout(requestTimeout);
81361
81363
  return true;
81362
81364
  }
81363
- headers[HTTP2_HEADER_PATH] = path61;
81365
+ headers[HTTP2_HEADER_PATH] = path62;
81364
81366
  headers[HTTP2_HEADER_SCHEME] = protocol === "http:" ? "http" : "https";
81365
81367
  const expectsPayload = method === "PUT" || method === "POST" || method === "PATCH";
81366
81368
  if (body && typeof body.read === "function") {
@@ -83723,10 +83725,10 @@ var require_proxy_agent = __commonJS({
83723
83725
  };
83724
83726
  const {
83725
83727
  origin,
83726
- path: path61 = "/",
83728
+ path: path62 = "/",
83727
83729
  headers = {}
83728
83730
  } = opts;
83729
- opts.path = origin + path61;
83731
+ opts.path = origin + path62;
83730
83732
  if (!("host" in headers) && !("Host" in headers)) {
83731
83733
  const { host } = new URL(origin);
83732
83734
  headers.host = host;
@@ -85862,21 +85864,21 @@ var require_mock_utils = __commonJS({
85862
85864
  return normalizedQp;
85863
85865
  }
85864
85866
  __name(normalizeSearchParams, "normalizeSearchParams");
85865
- function safeUrl(path61) {
85866
- if (typeof path61 !== "string") {
85867
- return path61;
85867
+ function safeUrl(path62) {
85868
+ if (typeof path62 !== "string") {
85869
+ return path62;
85868
85870
  }
85869
- const pathSegments = path61.split("?", 3);
85871
+ const pathSegments = path62.split("?", 3);
85870
85872
  if (pathSegments.length !== 2) {
85871
- return path61;
85873
+ return path62;
85872
85874
  }
85873
85875
  const qp = new URLSearchParams(pathSegments.pop());
85874
85876
  qp.sort();
85875
85877
  return [...pathSegments, qp.toString()].join("?");
85876
85878
  }
85877
85879
  __name(safeUrl, "safeUrl");
85878
- function matchKey(mockDispatch2, { path: path61, method, body, headers }) {
85879
- const pathMatch = matchValue(mockDispatch2.path, path61);
85880
+ function matchKey(mockDispatch2, { path: path62, method, body, headers }) {
85881
+ const pathMatch = matchValue(mockDispatch2.path, path62);
85880
85882
  const methodMatch = matchValue(mockDispatch2.method, method);
85881
85883
  const bodyMatch = typeof mockDispatch2.body !== "undefined" ? matchValue(mockDispatch2.body, body) : true;
85882
85884
  const headersMatch = matchHeaders(mockDispatch2, headers);
@@ -85903,8 +85905,8 @@ var require_mock_utils = __commonJS({
85903
85905
  const basePath = key.query ? serializePathWithQuery(key.path, key.query) : key.path;
85904
85906
  const resolvedPath = typeof basePath === "string" ? safeUrl(basePath) : basePath;
85905
85907
  const resolvedPathWithoutTrailingSlash = removeTrailingSlash(resolvedPath);
85906
- let matchedMockDispatches = mockDispatches.filter(({ consumed }) => !consumed).filter(({ path: path61, ignoreTrailingSlash }) => {
85907
- return ignoreTrailingSlash ? matchValue(removeTrailingSlash(safeUrl(path61)), resolvedPathWithoutTrailingSlash) : matchValue(safeUrl(path61), resolvedPath);
85908
+ let matchedMockDispatches = mockDispatches.filter(({ consumed }) => !consumed).filter(({ path: path62, ignoreTrailingSlash }) => {
85909
+ return ignoreTrailingSlash ? matchValue(removeTrailingSlash(safeUrl(path62)), resolvedPathWithoutTrailingSlash) : matchValue(safeUrl(path62), resolvedPath);
85908
85910
  });
85909
85911
  if (matchedMockDispatches.length === 0) {
85910
85912
  throw new MockNotMatchedError(`Mock dispatch not matched for path '${resolvedPath}'`);
@@ -85946,20 +85948,20 @@ var require_mock_utils = __commonJS({
85946
85948
  }
85947
85949
  }
85948
85950
  __name(deleteMockDispatch, "deleteMockDispatch");
85949
- function removeTrailingSlash(path61) {
85950
- while (path61.endsWith("/")) {
85951
- path61 = path61.slice(0, -1);
85951
+ function removeTrailingSlash(path62) {
85952
+ while (path62.endsWith("/")) {
85953
+ path62 = path62.slice(0, -1);
85952
85954
  }
85953
- if (path61.length === 0) {
85954
- path61 = "/";
85955
+ if (path62.length === 0) {
85956
+ path62 = "/";
85955
85957
  }
85956
- return path61;
85958
+ return path62;
85957
85959
  }
85958
85960
  __name(removeTrailingSlash, "removeTrailingSlash");
85959
85961
  function buildKey(opts) {
85960
- const { path: path61, method, body, headers, query } = opts;
85962
+ const { path: path62, method, body, headers, query } = opts;
85961
85963
  return {
85962
- path: path61,
85964
+ path: path62,
85963
85965
  method,
85964
85966
  body,
85965
85967
  headers,
@@ -86686,10 +86688,10 @@ var require_pending_interceptors_formatter = __commonJS({
86686
86688
  }
86687
86689
  format(pendingInterceptors) {
86688
86690
  const withPrettyHeaders = pendingInterceptors.map(
86689
- ({ method, path: path61, data: { statusCode }, persist, times, timesInvoked, origin }) => ({
86691
+ ({ method, path: path62, data: { statusCode }, persist, times, timesInvoked, origin }) => ({
86690
86692
  Method: method,
86691
86693
  Origin: origin,
86692
- Path: path61,
86694
+ Path: path62,
86693
86695
  "Status code": statusCode,
86694
86696
  Persistent: persist ? PERSISTENT : NOT_PERSISTENT,
86695
86697
  Invocations: timesInvoked,
@@ -86774,9 +86776,9 @@ var require_mock_agent = __commonJS({
86774
86776
  const acceptNonStandardSearchParameters = this[kMockAgentAcceptsNonStandardSearchParameters];
86775
86777
  const dispatchOpts = { ...opts };
86776
86778
  if (acceptNonStandardSearchParameters && dispatchOpts.path) {
86777
- const [path61, searchParams] = dispatchOpts.path.split("?");
86779
+ const [path62, searchParams] = dispatchOpts.path.split("?");
86778
86780
  const normalizedSearchParams = normalizeSearchParams(searchParams, acceptNonStandardSearchParameters);
86779
- dispatchOpts.path = `${path61}?${normalizedSearchParams}`;
86781
+ dispatchOpts.path = `${path62}?${normalizedSearchParams}`;
86780
86782
  }
86781
86783
  return this[kAgent].dispatch(dispatchOpts, handler);
86782
86784
  }
@@ -87189,12 +87191,12 @@ var require_snapshot_recorder = __commonJS({
87189
87191
  * @return {Promise<void>} - Resolves when snapshots are loaded
87190
87192
  */
87191
87193
  async loadSnapshots(filePath) {
87192
- const path61 = filePath || this.#snapshotPath;
87193
- if (!path61) {
87194
+ const path62 = filePath || this.#snapshotPath;
87195
+ if (!path62) {
87194
87196
  throw new InvalidArgumentError2("Snapshot path is required");
87195
87197
  }
87196
87198
  try {
87197
- const data2 = await readFile4(resolve8(path61), "utf8");
87199
+ const data2 = await readFile4(resolve8(path62), "utf8");
87198
87200
  const parsed = JSON.parse(data2);
87199
87201
  if (Array.isArray(parsed)) {
87200
87202
  this.#snapshots.clear();
@@ -87208,7 +87210,7 @@ var require_snapshot_recorder = __commonJS({
87208
87210
  if (error45.code === "ENOENT") {
87209
87211
  this.#snapshots.clear();
87210
87212
  } else {
87211
- throw new UndiciError(`Failed to load snapshots from ${path61}`, { cause: error45 });
87213
+ throw new UndiciError(`Failed to load snapshots from ${path62}`, { cause: error45 });
87212
87214
  }
87213
87215
  }
87214
87216
  }
@@ -87219,11 +87221,11 @@ var require_snapshot_recorder = __commonJS({
87219
87221
  * @returns {Promise<void>} - Resolves when snapshots are saved
87220
87222
  */
87221
87223
  async saveSnapshots(filePath) {
87222
- const path61 = filePath || this.#snapshotPath;
87223
- if (!path61) {
87224
+ const path62 = filePath || this.#snapshotPath;
87225
+ if (!path62) {
87224
87226
  throw new InvalidArgumentError2("Snapshot path is required");
87225
87227
  }
87226
- const resolvedPath = resolve8(path61);
87228
+ const resolvedPath = resolve8(path62);
87227
87229
  await mkdir2(dirname10(resolvedPath), { recursive: true });
87228
87230
  const data2 = Array.from(this.#snapshots.entries()).map(([hash2, snapshot]) => ({
87229
87231
  hash: hash2,
@@ -87862,15 +87864,15 @@ var require_redirect_handler = __commonJS({
87862
87864
  return;
87863
87865
  }
87864
87866
  const { origin, pathname, search } = util.parseURL(new URL(this.location, this.opts.origin && new URL(this.opts.path, this.opts.origin)));
87865
- const path61 = search ? `${pathname}${search}` : pathname;
87866
- const redirectUrlString = `${origin}${path61}`;
87867
+ const path62 = search ? `${pathname}${search}` : pathname;
87868
+ const redirectUrlString = `${origin}${path62}`;
87867
87869
  for (const historyUrl of this.history) {
87868
87870
  if (historyUrl.toString() === redirectUrlString) {
87869
87871
  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.`);
87870
87872
  }
87871
87873
  }
87872
87874
  this.opts.headers = cleanRequestHeaders(this.opts.headers, statusCode === 303, this.opts.origin !== origin);
87873
- this.opts.path = path61;
87875
+ this.opts.path = path62;
87874
87876
  this.opts.origin = origin;
87875
87877
  this.opts.query = null;
87876
87878
  }
@@ -94201,11 +94203,11 @@ var require_fetch = __commonJS({
94201
94203
  function dispatch({ body }) {
94202
94204
  const url2 = requestCurrentURL(request);
94203
94205
  const agent = fetchParams.controller.dispatcher;
94204
- const path61 = url2.pathname + url2.search;
94206
+ const path62 = url2.pathname + url2.search;
94205
94207
  const hasTrailingQuestionMark = url2.search.length === 0 && url2.href[url2.href.length - url2.hash.length - 1] === "?";
94206
94208
  return new Promise((resolve8, reject) => agent.dispatch(
94207
94209
  {
94208
- path: hasTrailingQuestionMark ? `${path61}?` : path61,
94210
+ path: hasTrailingQuestionMark ? `${path62}?` : path62,
94209
94211
  origin: url2.origin,
94210
94212
  method: request.method,
94211
94213
  body: agent.isMockActive ? request.body && (request.body.source || request.body.stream) : body,
@@ -95165,9 +95167,9 @@ var require_util4 = __commonJS({
95165
95167
  }
95166
95168
  }
95167
95169
  __name(validateCookieValue, "validateCookieValue");
95168
- function validateCookiePath(path61) {
95169
- for (let i = 0; i < path61.length; ++i) {
95170
- const code2 = path61.charCodeAt(i);
95170
+ function validateCookiePath(path62) {
95171
+ for (let i = 0; i < path62.length; ++i) {
95172
+ const code2 = path62.charCodeAt(i);
95171
95173
  if (code2 < 32 || // exclude CTLs (0-31)
95172
95174
  code2 === 127 || // DEL
95173
95175
  code2 === 59) {
@@ -98415,11 +98417,11 @@ var require_undici = __commonJS({
98415
98417
  if (typeof opts.path !== "string") {
98416
98418
  throw new InvalidArgumentError2("invalid opts.path");
98417
98419
  }
98418
- let path61 = opts.path;
98420
+ let path62 = opts.path;
98419
98421
  if (!opts.path.startsWith("/")) {
98420
- path61 = `/${path61}`;
98422
+ path62 = `/${path62}`;
98421
98423
  }
98422
- url2 = new URL(util.parseOrigin(url2).origin + path61);
98424
+ url2 = new URL(util.parseOrigin(url2).origin + path62);
98423
98425
  } else {
98424
98426
  if (!opts) {
98425
98427
  opts = typeof url2 === "object" ? url2 : {};
@@ -102015,6 +102017,18 @@ function richTextDoc(text3) {
102015
102017
  content: [{ type: "paragraph", content: [{ type: "text", text: text3 }] }]
102016
102018
  };
102017
102019
  }
102020
+ function placeholderMedia(label) {
102021
+ const svg = `<svg xmlns="http://www.w3.org/2000/svg" width="1200" height="630"><rect width="100%" height="100%" fill="#e5e7eb"/><text x="50%" y="50%" font-family="sans-serif" font-size="44" fill="#9ca3af" text-anchor="middle" dominant-baseline="middle">${label}</text></svg>`;
102022
+ return {
102023
+ source: "local",
102024
+ url: `data:image/svg+xml;utf8,${encodeURIComponent(svg)}`,
102025
+ alt: `${label} placeholder`,
102026
+ width: 1200,
102027
+ height: 630,
102028
+ mime: "image/svg+xml",
102029
+ name: "placeholder.svg"
102030
+ };
102031
+ }
102018
102032
  function exampleDate(n) {
102019
102033
  return new Date(Date.UTC(2024, 0, n)).toISOString().slice(0, 10);
102020
102034
  }
@@ -102038,6 +102052,10 @@ function generateExampleSeed(schema, options = {}) {
102038
102052
  row2.slug = `${kebabCase(schema.name)}-example-${i}`;
102039
102053
  }
102040
102054
  for (const [field, def] of Object.entries(schema.fields)) {
102055
+ if (schema.examples && field in schema.examples) {
102056
+ row2[field] = schema.examples[field];
102057
+ continue;
102058
+ }
102041
102059
  switch (def.type) {
102042
102060
  case "string":
102043
102061
  row2[field] = `${humanize(field)} example ${i}${localeSuffix}`;
@@ -102058,6 +102076,7 @@ function generateExampleSeed(schema, options = {}) {
102058
102076
  row2[field] = {};
102059
102077
  break;
102060
102078
  case "media":
102079
+ row2[field] = placeholderMedia(humanize(field));
102061
102080
  break;
102062
102081
  case "reference": {
102063
102082
  const value = exampleReferenceSlug(def);
@@ -102087,6 +102106,7 @@ var init_example_content = __esm({
102087
102106
  __name(kebabCase, "kebabCase");
102088
102107
  __name(humanize, "humanize");
102089
102108
  __name(richTextDoc, "richTextDoc");
102109
+ __name(placeholderMedia, "placeholderMedia");
102090
102110
  __name(exampleDate, "exampleDate");
102091
102111
  __name(exampleReferenceSlug, "exampleReferenceSlug");
102092
102112
  __name(generateExampleSeed, "generateExampleSeed");
@@ -102112,6 +102132,12 @@ function extractSchemaTypeNames(raw) {
102112
102132
  }
102113
102133
  return names;
102114
102134
  }
102135
+ function withoutReferences(fields) {
102136
+ return Object.fromEntries(Object.entries(fields).filter(([, def]) => def.type !== "reference"));
102137
+ }
102138
+ function hasReferences(fields) {
102139
+ return Object.values(fields).some((def) => def.type === "reference");
102140
+ }
102115
102141
  function orderByDependency(schemas3) {
102116
102142
  const byName = new Map(schemas3.map((schema) => [schema.name, schema]));
102117
102143
  const visited = /* @__PURE__ */ new Set();
@@ -102152,10 +102178,12 @@ async function scaffoldCms(opts) {
102152
102178
  let skipped = 0;
102153
102179
  const failures = [];
102154
102180
  const usedLocales = /* @__PURE__ */ new Set();
102181
+ const created = /* @__PURE__ */ new Set();
102155
102182
  try {
102156
102183
  for (const schema of ordered) {
102157
102184
  if (existingTypes.has(schema.name) && !force) {
102158
102185
  skipped += 1;
102186
+ created.add(schema.name);
102159
102187
  continue;
102160
102188
  }
102161
102189
  if (force) {
@@ -102166,30 +102194,54 @@ async function scaffoldCms(opts) {
102166
102194
  name: schema.name,
102167
102195
  label: schema.label,
102168
102196
  isSingleton: schema.isSingleton,
102169
- fields: schema.fields
102197
+ fields: withoutReferences(schema.fields)
102170
102198
  });
102171
102199
  schemasCreated += 1;
102200
+ created.add(schema.name);
102172
102201
  } catch (error45) {
102173
102202
  failures.push({ type: schema.name, stage: "schema", message: errorMessage3(error45) });
102174
102203
  }
102175
102204
  }
102176
102205
  for (const schema of ordered) {
102206
+ if (!created.has(schema.name) || existingTypes.has(schema.name) && !force || !hasReferences(schema.fields)) {
102207
+ continue;
102208
+ }
102209
+ try {
102210
+ await api.updateSchema(ctx.projectId, schema.name, {
102211
+ name: schema.name,
102212
+ label: schema.label,
102213
+ isSingleton: schema.isSingleton,
102214
+ fields: schema.fields
102215
+ });
102216
+ } catch (error45) {
102217
+ failures.push({ type: schema.name, stage: "schema", message: `references: ${errorMessage3(error45)}` });
102218
+ }
102219
+ }
102220
+ for (const schema of ordered) {
102221
+ if (!created.has(schema.name)) {
102222
+ continue;
102223
+ }
102177
102224
  const seedLocales = schema.localized && locales.length > 0 ? locales : [void 0];
102178
102225
  for (const locale of seedLocales) {
102179
102226
  const seed = generateExampleSeed(schema, { count, locale });
102180
102227
  try {
102181
- const result = await api.createEntriesBatch(ctx.projectId, schema.name, {
102182
- entries: seed.rows.map((data2) => ({ data: data2 })),
102183
- ...locale ? { locale } : {},
102184
- ...Object.keys(seed.references).length > 0 ? { references: seed.references } : {}
102185
- });
102186
- entriesCreated += result.created?.length ?? 0;
102187
- if (result.failed && result.failed.length > 0) {
102188
- failures.push({
102189
- type: schema.name,
102190
- stage: "entries",
102191
- message: `${result.failed.length} entry(ies) rejected${locale ? ` (${locale})` : ""}: ${result.failed[0]?.message ?? result.failed[0]?.code ?? "unknown"}`
102228
+ if (schema.isSingleton) {
102229
+ await api.putDocument(ctx.projectId, schema.name, seed.rows[0] ?? {}, locale ? { locale } : {});
102230
+ entriesCreated += 1;
102231
+ } else {
102232
+ const result = await api.createEntriesBatch(ctx.projectId, schema.name, {
102233
+ entries: seed.rows.map((data2) => ({ data: data2 })),
102234
+ ...locale ? { locale } : {},
102235
+ ...Object.keys(seed.references).length > 0 ? { references: seed.references } : {}
102192
102236
  });
102237
+ entriesCreated += result.created?.length ?? 0;
102238
+ if (result.failed && result.failed.length > 0) {
102239
+ failures.push({
102240
+ type: schema.name,
102241
+ stage: "entries",
102242
+ message: `${result.failed.length} entry(ies) rejected${locale ? ` (${locale})` : ""}: ${result.failed[0]?.message ?? result.failed[0]?.code ?? "unknown"}`
102243
+ });
102244
+ }
102193
102245
  }
102194
102246
  if (locale) {
102195
102247
  usedLocales.add(locale);
@@ -102219,6 +102271,8 @@ var init_cms_scaffold = __esm({
102219
102271
  init_dist();
102220
102272
  init_example_content();
102221
102273
  __name(extractSchemaTypeNames, "extractSchemaTypeNames");
102274
+ __name(withoutReferences, "withoutReferences");
102275
+ __name(hasReferences, "hasReferences");
102222
102276
  __name(orderByDependency, "orderByDependency");
102223
102277
  __name(scaffoldCms, "scaffoldCms");
102224
102278
  }
@@ -102328,9 +102382,9 @@ async function localCodeSurface(cwd) {
102328
102382
  const lines = out.split("\n").filter(Boolean);
102329
102383
  const items = lines.map((line) => {
102330
102384
  const code2 = line.slice(0, 2);
102331
- const path61 = line.slice(3).trim();
102385
+ const path62 = line.slice(3).trim();
102332
102386
  const verb = code2.startsWith("A") || code2.startsWith("?") ? "added" : code2.startsWith("D") ? "removed" : "changed";
102333
- return { verb, key: path61, origin: "local-uncommitted" };
102387
+ return { verb, key: path62, origin: "local-uncommitted" };
102334
102388
  });
102335
102389
  return {
102336
102390
  surface: "code",
@@ -102444,8 +102498,8 @@ var init_status = __esm({
102444
102498
 
102445
102499
  // src/cli/index.ts
102446
102500
  init_dist();
102447
- import fs55 from "node:fs";
102448
- import path60 from "node:path";
102501
+ import fs56 from "node:fs";
102502
+ import path61 from "node:path";
102449
102503
 
102450
102504
  // ../../node_modules/.pnpm/commander@13.1.0/node_modules/commander/esm.mjs
102451
102505
  var import_index = __toESM(require_commander(), 1);
@@ -102638,8 +102692,8 @@ function parseYamlStrict(text3, file2, bundlePath) {
102638
102692
  }
102639
102693
  __name(parseYamlStrict, "parseYamlStrict");
102640
102694
  function formatZodIssue(issue2) {
102641
- const path61 = issue2.path.length === 0 ? "(root)" : issue2.path.join(".");
102642
- return `${path61}: ${issue2.message}`;
102695
+ const path62 = issue2.path.length === 0 ? "(root)" : issue2.path.join(".");
102696
+ return `${path62}: ${issue2.message}`;
102643
102697
  }
102644
102698
  __name(formatZodIssue, "formatZodIssue");
102645
102699
  async function parseBundle(bundlePath, opts = {}) {
@@ -111018,15 +111072,15 @@ function flattenMessages(messages, prefix = "") {
111018
111072
  return { flat, skipped };
111019
111073
  }
111020
111074
  for (const [key, value] of Object.entries(messages)) {
111021
- const path61 = prefix ? `${prefix}.${key}` : key;
111075
+ const path62 = prefix ? `${prefix}.${key}` : key;
111022
111076
  if (typeof value === "string") {
111023
- flat[path61] = value;
111077
+ flat[path62] = value;
111024
111078
  } else if (value && typeof value === "object" && !Array.isArray(value)) {
111025
- const nested = flattenMessages(value, path61);
111079
+ const nested = flattenMessages(value, path62);
111026
111080
  Object.assign(flat, nested.flat);
111027
111081
  skipped.push(...nested.skipped);
111028
111082
  } else {
111029
- skipped.push(path61);
111083
+ skipped.push(path62);
111030
111084
  }
111031
111085
  }
111032
111086
  return { flat, skipped };
@@ -111059,7 +111113,7 @@ function findMessageStore(cwd, explicitDir) {
111059
111113
  __name(findMessageStore, "findMessageStore");
111060
111114
  function isI18nFimoWired(cwd) {
111061
111115
  const skip = /* @__PURE__ */ new Set(["node_modules", ".git", ".next", ".nuxt", "dist", "build", ".fimo"]);
111062
- const walk = /* @__PURE__ */ __name((dir, depth) => {
111116
+ const walk2 = /* @__PURE__ */ __name((dir, depth) => {
111063
111117
  if (depth > 4) {
111064
111118
  return false;
111065
111119
  }
@@ -111072,7 +111126,7 @@ function isI18nFimoWired(cwd) {
111072
111126
  for (const entry of entries2) {
111073
111127
  const full = path36.join(dir, entry.name);
111074
111128
  if (entry.isDirectory()) {
111075
- if (!skip.has(entry.name) && !entry.name.startsWith(".") && walk(full, depth + 1)) {
111129
+ if (!skip.has(entry.name) && !entry.name.startsWith(".") && walk2(full, depth + 1)) {
111076
111130
  return true;
111077
111131
  }
111078
111132
  } else if (/\.(tsx?|jsx?|mjs)$/.test(entry.name)) {
@@ -111086,7 +111140,7 @@ function isI18nFimoWired(cwd) {
111086
111140
  }
111087
111141
  return false;
111088
111142
  }, "walk");
111089
- return walk(cwd, 0);
111143
+ return walk2(cwd, 0);
111090
111144
  }
111091
111145
  __name(isI18nFimoWired, "isI18nFimoWired");
111092
111146
  function collectMessageRecords(storeDir) {
@@ -114485,13 +114539,13 @@ async function schemaAdoptDraftsCommand(options, cmd) {
114485
114539
  renameCallSites(dir);
114486
114540
  }
114487
114541
  }
114488
- const hasReferences = adoption.kept.some(
114542
+ const hasReferences2 = adoption.kept.some(
114489
114543
  (schema) => Object.values(schema.fields).some(
114490
114544
  (def) => def && typeof def === "object" && def.type === "reference"
114491
114545
  )
114492
114546
  );
114493
- await pushAllSchemas(ctx, api, cwd, void 0, { tolerateUnknownTargets: hasReferences });
114494
- if (hasReferences) {
114547
+ await pushAllSchemas(ctx, api, cwd, void 0, { tolerateUnknownTargets: hasReferences2 });
114548
+ if (hasReferences2) {
114495
114549
  await pushAllSchemas(ctx, api, cwd);
114496
114550
  }
114497
114551
  const summary2 = {
@@ -114614,8 +114668,8 @@ init_dist6();
114614
114668
  init_dist();
114615
114669
  init_apply_wrap_templates();
114616
114670
  init_apply_wrap();
114617
- import fs51 from "node:fs";
114618
- import path56 from "node:path";
114671
+ import fs52 from "node:fs";
114672
+ import path57 from "node:path";
114619
114673
 
114620
114674
  // src/scripts/cms/strapi/detect.ts
114621
114675
  import { existsSync as existsSync13, readdirSync as readdirSync15, readFileSync as readFileSync17, statSync as statSync11 } from "node:fs";
@@ -114673,7 +114727,7 @@ function scanSourceSignals(frontendDir) {
114673
114727
  let scanned = 0;
114674
114728
  let uid = false;
114675
114729
  let env2 = false;
114676
- const walk = /* @__PURE__ */ __name((dir) => {
114730
+ const walk2 = /* @__PURE__ */ __name((dir) => {
114677
114731
  if (scanned >= MAX_FILES_SCANNED || uid && env2) {
114678
114732
  return;
114679
114733
  }
@@ -114683,7 +114737,7 @@ function scanSourceSignals(frontendDir) {
114683
114737
  }
114684
114738
  if (entry.isDirectory()) {
114685
114739
  if (!SKIP_DIRS4.has(entry.name) && !entry.name.startsWith(".")) {
114686
- walk(join23(dir, entry.name));
114740
+ walk2(join23(dir, entry.name));
114687
114741
  }
114688
114742
  continue;
114689
114743
  }
@@ -114703,7 +114757,7 @@ function scanSourceSignals(frontendDir) {
114703
114757
  }
114704
114758
  }
114705
114759
  }, "walk");
114706
- walk(root2);
114760
+ walk2(root2);
114707
114761
  return { uid, env: env2 };
114708
114762
  }
114709
114763
  __name(scanSourceSignals, "scanSourceSignals");
@@ -114779,6 +114833,7 @@ function detectStrapi(frontendDir) {
114779
114833
  cms: "Strapi",
114780
114834
  host: "Strapi",
114781
114835
  appDir,
114836
+ clientDir: libModule,
114782
114837
  evidence,
114783
114838
  locales: []
114784
114839
  };
@@ -114919,10 +114974,16 @@ function mapSchema(raw, uidToName) {
114919
114974
  const info = raw.schema.info ?? {};
114920
114975
  const name = uidToName.get(raw.uid);
114921
114976
  const fields = {};
114977
+ const examples = {};
114922
114978
  for (const [field, attr2] of Object.entries(raw.schema.attributes ?? {})) {
114923
114979
  const mapped = mapAttribute(field, attr2, uidToName);
114924
114980
  if (mapped) {
114925
114981
  fields[field] = mapped;
114982
+ if (attr2.type === "dynamiczone" || attr2.type === "component" && attr2.repeatable) {
114983
+ examples[field] = [];
114984
+ } else if (attr2.type === "component") {
114985
+ examples[field] = {};
114986
+ }
114926
114987
  }
114927
114988
  }
114928
114989
  return {
@@ -114931,6 +114992,7 @@ function mapSchema(raw, uidToName) {
114931
114992
  isSingleton: raw.schema.kind === "singleType",
114932
114993
  localized: raw.schema.pluginOptions?.i18n?.localized === true,
114933
114994
  fields,
114995
+ ...Object.keys(examples).length > 0 ? { examples } : {},
114934
114996
  sourceUid: raw.uid,
114935
114997
  sourcePath: `/${info.pluralName ?? raw.contentTypeName}`
114936
114998
  };
@@ -114984,6 +115046,158 @@ function readStrapiSchemas(strapiAppDir) {
114984
115046
  }
114985
115047
  __name(readStrapiSchemas, "readStrapiSchemas");
114986
115048
 
115049
+ // src/scripts/cms/strapi/wire-client.ts
115050
+ import fs51 from "node:fs";
115051
+ import path56 from "node:path";
115052
+ import { parseSync as parseSync8 } from "oxc-parser";
115053
+
115054
+ // src/scripts/cms/strapi/wiring.ts
115055
+ function strapiWiring(schemas3) {
115056
+ const types = {};
115057
+ const singletons = [];
115058
+ for (const schema of schemas3) {
115059
+ const pluralName = schema.sourcePath.replace(/^\/+/, "");
115060
+ if (pluralName) {
115061
+ types[pluralName] = schema.name;
115062
+ }
115063
+ if (schema.isSingleton) {
115064
+ singletons.push(schema.name);
115065
+ }
115066
+ }
115067
+ return { types, singletons };
115068
+ }
115069
+ __name(strapiWiring, "strapiWiring");
115070
+ function renderFimoStrapiModule(schemas3) {
115071
+ const { types, singletons } = strapiWiring(schemas3);
115072
+ const typeEntries = Object.entries(types).map(([pluralName, typeName]) => ` '${pluralName}': '${typeName}',`).join("\n");
115073
+ return `// AUTO-GENERATED by \`fimo migrate --scaffold-cms\`. Serves this site's Strapi
115074
+ // content reads from Fimo (scaffolded example content) through fimo/strapi.
115075
+ // The migration points the CMS client's fetch at \`fimoStrapiFetch\`; reads for
115076
+ // scaffolded types resolve from Fimo, everything else falls through to Strapi.
115077
+ import { createFimoStrapiFetch } from 'fimo/strapi';
115078
+
115079
+ // Strapi REST path (pluralName) -> Fimo type name.
115080
+ const TYPES: Record<string, string> = {
115081
+ ${typeEntries}
115082
+ };
115083
+
115084
+ const SINGLETONS = [${singletons.map((name) => `'${name}'`).join(", ")}];
115085
+
115086
+ export const fimoStrapiFetch = createFimoStrapiFetch({ types: TYPES, singletons: SINGLETONS });
115087
+ `;
115088
+ }
115089
+ __name(renderFimoStrapiModule, "renderFimoStrapiModule");
115090
+
115091
+ // src/scripts/cms/strapi/wire-client.ts
115092
+ function walk(node, visit2) {
115093
+ if (!node || typeof node !== "object") {
115094
+ return;
115095
+ }
115096
+ if (Array.isArray(node)) {
115097
+ for (const child of node) {
115098
+ walk(child, visit2);
115099
+ }
115100
+ return;
115101
+ }
115102
+ const record2 = node;
115103
+ if (typeof record2.type === "string") {
115104
+ visit2(record2);
115105
+ }
115106
+ for (const [key, value] of Object.entries(record2)) {
115107
+ if (key !== "type" && value && typeof value === "object") {
115108
+ walk(value, visit2);
115109
+ }
115110
+ }
115111
+ }
115112
+ __name(walk, "walk");
115113
+ function bareFetchCallees(filePath, code2) {
115114
+ let program2;
115115
+ try {
115116
+ program2 = parseSync8(filePath, code2).program;
115117
+ } catch {
115118
+ return [];
115119
+ }
115120
+ const spans = [];
115121
+ walk(program2, (n) => {
115122
+ if (n.type === "CallExpression" && n.callee?.type === "Identifier" && n.callee.name === "fetch") {
115123
+ spans.push({ start: n.callee.start, end: n.callee.end });
115124
+ }
115125
+ });
115126
+ return spans;
115127
+ }
115128
+ __name(bareFetchCallees, "bareFetchCallees");
115129
+ function applyReplacements(code2, edits) {
115130
+ let next2 = code2;
115131
+ for (const edit of [...edits].sort((a, b) => b.start - a.start)) {
115132
+ next2 = next2.slice(0, edit.start) + edit.text + next2.slice(edit.end);
115133
+ }
115134
+ return next2;
115135
+ }
115136
+ __name(applyReplacements, "applyReplacements");
115137
+ function relativeImport2(fromFile, toFile) {
115138
+ const rel = path56.relative(path56.dirname(fromFile), toFile).replace(/\.tsx?$/, "").split(path56.sep).join("/");
115139
+ return rel.startsWith(".") ? rel : `./${rel}`;
115140
+ }
115141
+ __name(relativeImport2, "relativeImport");
115142
+ function sourceFiles(dir) {
115143
+ const out = [];
115144
+ const walkDir2 = /* @__PURE__ */ __name((current) => {
115145
+ for (const entry of fs51.readdirSync(current, { withFileTypes: true })) {
115146
+ if (entry.name === "node_modules" || entry.name.startsWith(".")) {
115147
+ continue;
115148
+ }
115149
+ const full = path56.join(current, entry.name);
115150
+ if (entry.isDirectory()) {
115151
+ walkDir2(full);
115152
+ } else if (/\.(tsx?|jsx?|mjs)$/.test(entry.name)) {
115153
+ out.push(full);
115154
+ }
115155
+ }
115156
+ }, "walkDir");
115157
+ if (fs51.existsSync(dir)) {
115158
+ walkDir2(dir);
115159
+ }
115160
+ return out;
115161
+ }
115162
+ __name(sourceFiles, "sourceFiles");
115163
+ function wireStrapiClient(cwd, clientDir, schemas3) {
115164
+ const changes = [];
115165
+ const warnings = [];
115166
+ if (!fs51.existsSync(clientDir)) {
115167
+ return { changes, warnings: [`CMS client directory not found: ${path56.relative(cwd, clientDir)}`], wired: false };
115168
+ }
115169
+ const modulePath = path56.join(clientDir, "fimo-strapi.ts");
115170
+ fs51.writeFileSync(modulePath, renderFimoStrapiModule(schemas3));
115171
+ changes.push(`generated ${path56.relative(cwd, modulePath)}`);
115172
+ let swapped = 0;
115173
+ for (const file2 of sourceFiles(clientDir)) {
115174
+ if (path56.resolve(file2) === path56.resolve(modulePath)) {
115175
+ continue;
115176
+ }
115177
+ const code2 = fs51.readFileSync(file2, "utf8");
115178
+ const spans = bareFetchCallees(file2, code2);
115179
+ if (spans.length === 0) {
115180
+ continue;
115181
+ }
115182
+ let next2 = applyReplacements(
115183
+ code2,
115184
+ spans.map((span) => ({ ...span, text: "fimoStrapiFetch" }))
115185
+ );
115186
+ next2 = `import { fimoStrapiFetch } from '${relativeImport2(file2, modulePath)}';
115187
+ ${next2}`;
115188
+ fs51.writeFileSync(file2, next2);
115189
+ swapped += spans.length;
115190
+ changes.push(`rewired ${path56.relative(cwd, file2)}: ${spans.length} fetch call(s) \u2192 fimoStrapiFetch`);
115191
+ }
115192
+ if (swapped === 0) {
115193
+ warnings.push(
115194
+ `No bare fetch() call found under ${path56.relative(cwd, clientDir)} \u2014 wire fimoStrapiFetch into the client manually.`
115195
+ );
115196
+ }
115197
+ return { changes, warnings, wired: swapped > 0 };
115198
+ }
115199
+ __name(wireStrapiClient, "wireStrapiClient");
115200
+
114987
115201
  // src/scripts/cms/strapi/index.ts
114988
115202
  function strapiConnector(frontendDir) {
114989
115203
  const detection = detectStrapi(frontendDir);
@@ -114993,7 +115207,12 @@ function strapiConnector(frontendDir) {
114993
115207
  return {
114994
115208
  detection,
114995
115209
  readSchemas: /* @__PURE__ */ __name(() => detection.appDir ? readStrapiSchemas(detection.appDir) : [], "readSchemas"),
114996
- renderListSource: /* @__PURE__ */ __name((schemas3, serverImport) => schemas3.length > 0 ? renderStrapiListSource(schemas3, serverImport) : null, "renderListSource")
115210
+ renderListSource: /* @__PURE__ */ __name((schemas3, serverImport) => schemas3.length > 0 ? renderStrapiListSource(schemas3, serverImport) : null, "renderListSource"),
115211
+ wireClient: /* @__PURE__ */ __name((cwd, schemas3) => detection.clientDir ? wireStrapiClient(cwd, detection.clientDir, schemas3) : {
115212
+ changes: [],
115213
+ warnings: ["No Strapi client directory detected \u2014 wire fimoStrapiFetch manually."],
115214
+ wired: false
115215
+ }, "wireClient")
114997
115216
  };
114998
115217
  }
114999
115218
  __name(strapiConnector, "strapiConnector");
@@ -115321,6 +115540,105 @@ init_wiring();
115321
115540
  init_scan_wrappable();
115322
115541
  init_fimo_dep();
115323
115542
  init_color();
115543
+
115544
+ // src/cli/utils/wrap-dashboard.ts
115545
+ var CHARS = {
115546
+ unicode: { h: "\u2500", v: "\u2502", tl: "\u250C", tr: "\u2510", bl: "\u2514", br: "\u2518", ok: "\u2713", warn: "\u26A0", skip: "\xB7", fail: "\u2717" },
115547
+ ascii: { h: "-", v: "|", tl: "+", tr: "+", bl: "+", br: "+", ok: "v", warn: "!", skip: "-", fail: "x" }
115548
+ };
115549
+ function formatDuration2(ms) {
115550
+ if (ms < 1e3) {
115551
+ return `${Math.round(ms)}ms`;
115552
+ }
115553
+ if (ms < 6e4) {
115554
+ return `${(ms / 1e3).toFixed(1)}s`;
115555
+ }
115556
+ const sec = Math.round(ms / 1e3);
115557
+ return `${Math.floor(sec / 60)}m ${sec % 60}s`;
115558
+ }
115559
+ __name(formatDuration2, "formatDuration");
115560
+ var ANSI2 = /\[[0-9;]*m/g;
115561
+ function visibleLength(text3) {
115562
+ return text3.replace(new RegExp(String.fromCharCode(27), "g"), "").replace(ANSI2, "").length;
115563
+ }
115564
+ __name(visibleLength, "visibleLength");
115565
+ function pad2(text3, width) {
115566
+ const len = visibleLength(text3);
115567
+ return len >= width ? text3 : text3 + " ".repeat(width - len);
115568
+ }
115569
+ __name(pad2, "pad");
115570
+ function renderWrapDashboard(input) {
115571
+ const c2 = input.ascii ? CHARS.ascii : CHARS.unicode;
115572
+ const paintOk = input.colors?.ok ?? ((s) => s);
115573
+ const paintWarn = input.colors?.warn ?? ((s) => s);
115574
+ const paintFail = input.colors?.fail ?? ((s) => s);
115575
+ const stepGlyph = /* @__PURE__ */ __name((s) => s === "ok" ? paintOk(c2.ok) : s === "warn" ? paintWarn(c2.warn) : c2.skip, "stepGlyph");
115576
+ const gateGlyph = /* @__PURE__ */ __name((s) => s === "ok" ? paintOk(c2.ok) : s === "warn" ? paintWarn(c2.warn) : paintFail(c2.fail), "gateGlyph");
115577
+ const rows = input.steps.map((s) => ({
115578
+ label: s.label,
115579
+ status: stepGlyph(s.status),
115580
+ time: formatDuration2(s.ms),
115581
+ detail: s.detail
115582
+ }));
115583
+ const wLabel = Math.max(4, ...rows.map((r) => visibleLength(r.label)));
115584
+ const wStatus = Math.max(1, ...rows.map((r) => visibleLength(r.status)));
115585
+ const wTime = Math.max(4, ...rows.map((r) => visibleLength(r.time)));
115586
+ const stepLine = /* @__PURE__ */ __name((r) => `${pad2(r.label, wLabel)} ${pad2(r.status, wStatus)} ${pad2(r.time, wTime)} ${r.detail}`.trimEnd(), "stepLine");
115587
+ const headerLine = `${pad2("STEP", wLabel)} ${pad2("", wStatus)} ${pad2("TIME", wTime)} DETAIL`;
115588
+ const rule = /* @__PURE__ */ __name(() => "", "rule");
115589
+ const gatesLine = input.gates.length > 0 ? `${input.gates.map((g) => `${g.label} ${gateGlyph(g.status)}`).join(" ")} total ${formatDuration2(input.totalMs)}` : `total ${formatDuration2(input.totalMs)}`;
115590
+ const body = [headerLine, null, ...rows.map(stepLine), null, gatesLine];
115591
+ const inner = Math.max(
115592
+ input.title.length + input.verdict.length + 6,
115593
+ ...body.filter((l) => l !== null).map((l) => visibleLength(l))
115594
+ );
115595
+ const line = /* @__PURE__ */ __name((content2) => `${c2.v} ${pad2(content2, inner)} ${c2.v}`, "line");
115596
+ const divider = `${c2.v} ${c2.h.repeat(inner)} ${c2.v}`;
115597
+ const midFill = Math.max(1, inner - input.title.length - input.verdict.length - 4);
115598
+ const top = `${c2.tl}${c2.h} ${input.title} ${c2.h.repeat(midFill)} ${input.verdict} ${c2.h}${c2.tr}`;
115599
+ const bottom = `${c2.bl}${c2.h.repeat(inner + 2)}${c2.br}`;
115600
+ const out = [top];
115601
+ for (const entry of body) {
115602
+ out.push(entry === null ? divider : line(entry));
115603
+ }
115604
+ out.push(bottom);
115605
+ if (input.findings.length > 0) {
115606
+ out.push(" Findings");
115607
+ for (const finding of input.findings) {
115608
+ out.push(` ${paintWarn(c2.warn)} ${finding}`);
115609
+ }
115610
+ }
115611
+ if (input.reportPath) {
115612
+ out.push(` ${input.ascii ? "->" : "\u2192"} ${input.reportPath}`);
115613
+ }
115614
+ void rule;
115615
+ return out.join("\n");
115616
+ }
115617
+ __name(renderWrapDashboard, "renderWrapDashboard");
115618
+ var StepTimer = class {
115619
+ static {
115620
+ __name(this, "StepTimer");
115621
+ }
115622
+ last;
115623
+ start;
115624
+ recorded = [];
115625
+ constructor(now) {
115626
+ this.last = now;
115627
+ this.start = now;
115628
+ }
115629
+ mark(now, label, status, detail) {
115630
+ this.recorded.push({ label, status, ms: now - this.last, detail });
115631
+ this.last = now;
115632
+ }
115633
+ steps() {
115634
+ return this.recorded;
115635
+ }
115636
+ totalMs(now) {
115637
+ return now - this.start;
115638
+ }
115639
+ };
115640
+
115641
+ // src/cli/commands/migrate-wrap.ts
115324
115642
  init_scaffold_project();
115325
115643
  init_wrap_prompts();
115326
115644
  function detectProjectPackageManager(cwd) {
@@ -115332,7 +115650,7 @@ function detectProjectPackageManager(cwd) {
115332
115650
  ["package-lock.json", "npm"]
115333
115651
  ];
115334
115652
  for (const [lockfile, pm] of byLockfile) {
115335
- if (fs51.existsSync(path56.join(cwd, lockfile))) {
115653
+ if (fs52.existsSync(path57.join(cwd, lockfile))) {
115336
115654
  return pm;
115337
115655
  }
115338
115656
  }
@@ -115340,7 +115658,7 @@ function detectProjectPackageManager(cwd) {
115340
115658
  }
115341
115659
  __name(detectProjectPackageManager, "detectProjectPackageManager");
115342
115660
  function readWrapExemptions(cwd) {
115343
- const manifest = readJson2(path56.join(cwd, ".fimo", "migration", "manifest.json"));
115661
+ const manifest = readJson2(path57.join(cwd, ".fimo", "migration", "manifest.json"));
115344
115662
  const raw = manifest?.wrap?.exemptions;
115345
115663
  if (!Array.isArray(raw)) {
115346
115664
  return [];
@@ -115351,7 +115669,7 @@ function readWrapExemptions(cwd) {
115351
115669
  }
115352
115670
  __name(readWrapExemptions, "readWrapExemptions");
115353
115671
  function readDataFileDecisions(cwd) {
115354
- const manifest = readJson2(path56.join(cwd, ".fimo", "migration", "manifest.json"));
115672
+ const manifest = readJson2(path57.join(cwd, ".fimo", "migration", "manifest.json"));
115355
115673
  const raw = manifest?.wrap?.dataFiles;
115356
115674
  if (!Array.isArray(raw)) {
115357
115675
  return [];
@@ -115362,7 +115680,7 @@ function readDataFileDecisions(cwd) {
115362
115680
  }
115363
115681
  __name(readDataFileDecisions, "readDataFileDecisions");
115364
115682
  function readParityIgnores(cwd) {
115365
- const manifest = readJson2(path56.join(cwd, ".fimo", "migration", "manifest.json"));
115683
+ const manifest = readJson2(path57.join(cwd, ".fimo", "migration", "manifest.json"));
115366
115684
  const raw = manifest?.wrap?.parityIgnores;
115367
115685
  if (!Array.isArray(raw)) {
115368
115686
  return { patterns: [], routes: [] };
@@ -115377,7 +115695,7 @@ function readParityIgnores(cwd) {
115377
115695
  }
115378
115696
  __name(readParityIgnores, "readParityIgnores");
115379
115697
  function readDataSourceDecisions(cwd) {
115380
- const manifest = readJson2(path56.join(cwd, ".fimo", "migration", "manifest.json"));
115698
+ const manifest = readJson2(path57.join(cwd, ".fimo", "migration", "manifest.json"));
115381
115699
  const raw = manifest?.wrap?.dataSources;
115382
115700
  if (!Array.isArray(raw)) {
115383
115701
  return [];
@@ -115388,11 +115706,11 @@ function readDataSourceDecisions(cwd) {
115388
115706
  }
115389
115707
  __name(readDataSourceDecisions, "readDataSourceDecisions");
115390
115708
  function writeDataSourceDecisions(cwd, records) {
115391
- const manifestPath = path56.join(cwd, ".fimo", "migration", "manifest.json");
115709
+ const manifestPath = path57.join(cwd, ".fimo", "migration", "manifest.json");
115392
115710
  const manifest = readJson2(manifestPath) ?? {};
115393
115711
  manifest.wrap = { ...manifest.wrap ?? {}, dataSources: records };
115394
- fs51.mkdirSync(path56.dirname(manifestPath), { recursive: true });
115395
- fs51.writeFileSync(manifestPath, `${JSON.stringify(manifest, null, 2)}
115712
+ fs52.mkdirSync(path57.dirname(manifestPath), { recursive: true });
115713
+ fs52.writeFileSync(manifestPath, `${JSON.stringify(manifest, null, 2)}
115396
115714
  `);
115397
115715
  }
115398
115716
  __name(writeDataSourceDecisions, "writeDataSourceDecisions");
@@ -115557,7 +115875,7 @@ function resolveExcludedSections(cwd, config2, appDir) {
115557
115875
  );
115558
115876
  const sections = [];
115559
115877
  try {
115560
- for (const entry of fs51.readdirSync(path56.join(cwd, appDir))) {
115878
+ for (const entry of fs52.readdirSync(path57.join(cwd, appDir))) {
115561
115879
  const clean = entry.replace(/^\(|\)$/g, "").toLowerCase();
115562
115880
  if (BACKOFFICE_SEGMENTS.has(clean) && !include.has(entry) && !include.has(`/${entry}`)) {
115563
115881
  sections.push(entry);
@@ -115606,12 +115924,12 @@ async function syncProjectEnvKeys(cwd, options) {
115606
115924
  const local = {};
115607
115925
  let found = false;
115608
115926
  for (const filename of [".env", ".env.local"]) {
115609
- const filePath = path56.join(cwd, filename);
115610
- if (!fs51.existsSync(filePath)) {
115927
+ const filePath = path57.join(cwd, filename);
115928
+ if (!fs52.existsSync(filePath)) {
115611
115929
  continue;
115612
115930
  }
115613
115931
  found = true;
115614
- Object.assign(local, parseEnvFile(fs51.readFileSync(filePath, "utf8")));
115932
+ Object.assign(local, parseEnvFile(fs52.readFileSync(filePath, "utf8")));
115615
115933
  }
115616
115934
  if (!found) {
115617
115935
  return { skipped: "no-env-files" };
@@ -115715,7 +116033,7 @@ function renderSeedingSection(seeding) {
115715
116033
  __name(renderSeedingSection, "renderSeedingSection");
115716
116034
  function readJson2(filePath) {
115717
116035
  try {
115718
- return JSON.parse(fs51.readFileSync(filePath, "utf8"));
116036
+ return JSON.parse(fs52.readFileSync(filePath, "utf8"));
115719
116037
  } catch {
115720
116038
  return null;
115721
116039
  }
@@ -115742,7 +116060,7 @@ function checkRootWiring(cwd, detection) {
115742
116060
  }
115743
116061
  const present = marker.files.some((file2) => {
115744
116062
  try {
115745
- return marker.marker.test(fs51.readFileSync(path56.join(cwd, file2), "utf8"));
116063
+ return marker.marker.test(fs52.readFileSync(path57.join(cwd, file2), "utf8"));
115746
116064
  } catch {
115747
116065
  return false;
115748
116066
  }
@@ -115765,8 +116083,8 @@ function ensureWrapWiring(cwd, framework) {
115765
116083
  }
115766
116084
  __name(ensureWrapWiring, "ensureWrapWiring");
115767
116085
  async function migrateWrapCommand(options) {
115768
- const cwd = options.cwd ? path56.resolve(options.cwd) : process.cwd();
115769
- const configPath = path56.join(cwd, "fimo-config.json");
116086
+ const cwd = options.cwd ? path57.resolve(options.cwd) : process.cwd();
116087
+ const configPath = path57.join(cwd, "fimo-config.json");
115770
116088
  const config2 = readJson2(configPath);
115771
116089
  if (!config2) {
115772
116090
  ui.error({
@@ -115799,11 +116117,12 @@ async function migrateWrapCommand(options) {
115799
116117
  }
115800
116118
  config2.routes = routes;
115801
116119
  routeCount = Object.keys(routes).length;
115802
- fs51.writeFileSync(configPath, `${JSON.stringify(config2, null, 2)}
116120
+ fs52.writeFileSync(configPath, `${JSON.stringify(config2, null, 2)}
115803
116121
  `);
115804
116122
  }
115805
116123
  const excludedSections = resolveExcludedSections(cwd, config2, detection.appDir ?? detection.pagesDir);
115806
116124
  const i18nFimoWired = isI18nFimoWired(cwd);
116125
+ const stepTimer = new StepTimer(Date.now());
115807
116126
  let scan = scanWrappable(cwd, {
115808
116127
  i18nFimoWired,
115809
116128
  excludePrefixes: excludedSections.prefixes,
@@ -115811,6 +116130,7 @@ async function migrateWrapCommand(options) {
115811
116130
  keepInternal: !options.check
115812
116131
  });
115813
116132
  let coverage = { wrappable: scan.items.length, wrapped: scan.wrappedCount };
116133
+ stepTimer.mark(Date.now(), "Scan", "ok", `${scan.filesScanned} files \xB7 ${coverage.wrappable} to wrap`);
115814
116134
  const cmsConnector = detectCms(cwd);
115815
116135
  const cmsSchemas = cmsConnector ? cmsConnector.readSchemas() : [];
115816
116136
  const scaffoldableHosts = cmsConnector && cmsSchemas.length > 0 ? /* @__PURE__ */ new Set([cmsConnector.detection.host]) : /* @__PURE__ */ new Set();
@@ -115844,7 +116164,7 @@ async function migrateWrapCommand(options) {
115844
116164
  let parity = { skipped: "disabled" };
115845
116165
  if (options.parity !== false) {
115846
116166
  const planHasParityPointer = Boolean(
115847
- readJson2(path56.join(cwd, ".fimo", "migration", "plan.json"))?.parity
116167
+ readJson2(path57.join(cwd, ".fimo", "migration", "plan.json"))?.parity
115848
116168
  );
115849
116169
  const paritySp = spinner("Verifying render parity (booting your dev server)");
115850
116170
  const parityIgnores = readParityIgnores(cwd);
@@ -115862,7 +116182,7 @@ async function migrateWrapCommand(options) {
115862
116182
  const dataFileKeys = dataFileDecisions.filter((decision) => decision.decision === "labels" && typeof decision.labelPrefix === "string").flatMap((decision) => {
115863
116183
  try {
115864
116184
  return dataFileLabelKeys(
115865
- fs51.readFileSync(path56.join(cwd, decision.file), "utf8"),
116185
+ fs52.readFileSync(path57.join(cwd, decision.file), "utf8"),
115866
116186
  decision.labelPrefix,
115867
116187
  decision.file
115868
116188
  );
@@ -115990,6 +116310,7 @@ ${error45.stderrTail.slice(-800)}` : "";
115990
116310
  );
115991
116311
  }
115992
116312
  }
116313
+ stepTimer.mark(Date.now(), "Baseline", parityNote ? "ok" : "skip", parityNote ?? "not captured");
115993
116314
  const effectiveDetection = {
115994
116315
  ...detection,
115995
116316
  framework: framework ?? detection.framework
@@ -116008,10 +116329,10 @@ ${error45.stderrTail.slice(-800)}` : "";
116008
116329
  runSp?.update("Applying safe wrap transforms");
116009
116330
  applied = jsxWrapperModule ? applyWrap(cwd, { excludePrefixes: excludedSections.prefixes, importModule: jsxWrapperModule }) : applyTemplateWrap(cwd, { style: templateWrapStyle, excludePrefixes: excludedSections.prefixes });
116010
116331
  if (Object.keys(applied.labels).length > 0) {
116011
- const labelsPath = path56.join(cwd, ".fimo", "migration", "labels.json");
116012
- fs51.mkdirSync(path56.dirname(labelsPath), { recursive: true });
116332
+ const labelsPath = path57.join(cwd, ".fimo", "migration", "labels.json");
116333
+ fs52.mkdirSync(path57.dirname(labelsPath), { recursive: true });
116013
116334
  const existing = readJson2(labelsPath) ?? {};
116014
- fs51.writeFileSync(labelsPath, `${JSON.stringify({ ...existing, ...applied.labels }, null, 2)}
116335
+ fs52.writeFileSync(labelsPath, `${JSON.stringify({ ...existing, ...applied.labels }, null, 2)}
116015
116336
  `);
116016
116337
  }
116017
116338
  scan = scanWrappable(cwd, {
@@ -116029,11 +116350,17 @@ ${error45.stderrTail.slice(-800)}` : "";
116029
116350
  }
116030
116351
  }
116031
116352
  }
116353
+ stepTimer.mark(
116354
+ Date.now(),
116355
+ "Apply",
116356
+ applied ? "ok" : "skip",
116357
+ applied ? `${applied.applied.length} auto-wrapped` : "no codemod applied"
116358
+ );
116032
116359
  runSp?.update("Seeding migrated content");
116033
116360
  let contentSeed = null;
116034
116361
  let i18nIngest = null;
116035
116362
  let cmsScaffold = null;
116036
- let cmsListHelperPath = null;
116363
+ let cmsWired = null;
116037
116364
  if (!options.check) {
116038
116365
  try {
116039
116366
  const { bootstrapProjectCommand: bootstrapProjectCommand2 } = await Promise.resolve().then(() => (init_project_context(), project_context_exports));
@@ -116054,7 +116381,7 @@ ${error45.stderrTail.slice(-800)}` : "";
116054
116381
  configured2.add(locale);
116055
116382
  }
116056
116383
  config2.i18n = { ...config2.i18n, locales: [...configured2] };
116057
- fs51.writeFileSync(configPath, `${JSON.stringify(config2, null, 2)}
116384
+ fs52.writeFileSync(configPath, `${JSON.stringify(config2, null, 2)}
116058
116385
  `);
116059
116386
  }
116060
116387
  }
@@ -116075,8 +116402,8 @@ ${error45.stderrTail.slice(-800)}` : "";
116075
116402
  force: options.force,
116076
116403
  existingTypes
116077
116404
  });
116078
- fs51.writeFileSync(
116079
- path56.join(cwd, ".fimo", "migration", "cms-scaffold.json"),
116405
+ fs52.writeFileSync(
116406
+ path57.join(cwd, ".fimo", "migration", "cms-scaffold.json"),
116080
116407
  `${JSON.stringify(cmsScaffold, null, 2)}
116081
116408
  `
116082
116409
  );
@@ -116086,12 +116413,10 @@ ${error45.stderrTail.slice(-800)}` : "";
116086
116413
  `${cmsScaffold.cms} scaffold: ${cmsScaffold.failures.length} issue(s) \u2014 see .fimo/migration/cms-scaffold.json (e.g. ${first2.type}: ${first2.message})`
116087
116414
  );
116088
116415
  }
116089
- const listSource = cmsConnector?.renderListSource?.(cmsSchemas, resolveServerImport(framework ?? "js"));
116090
- if (listSource) {
116091
- const helperAbs = path56.join(cwd, ".fimo", "migration", "wrap", "fimo-cms-list.ts");
116092
- fs51.mkdirSync(path56.dirname(helperAbs), { recursive: true });
116093
- fs51.writeFileSync(helperAbs, listSource);
116094
- cmsListHelperPath = path56.relative(cwd, helperAbs);
116416
+ const wired = cmsConnector?.wireClient?.(cwd, cmsSchemas);
116417
+ if (wired) {
116418
+ cmsWired = wired;
116419
+ parityWarnings.push(...wired.warnings);
116095
116420
  }
116096
116421
  for (const source of scaffoldTargets) {
116097
116422
  source.scaffolded = true;
@@ -116101,9 +116426,15 @@ ${error45.stderrTail.slice(-800)}` : "";
116101
116426
  } catch {
116102
116427
  }
116103
116428
  }
116104
- const migrationDir = path56.join(cwd, ".fimo", "migration");
116105
- const wrapDir = path56.join(migrationDir, "wrap");
116106
- fs51.mkdirSync(wrapDir, { recursive: true });
116429
+ const migrationDir = path57.join(cwd, ".fimo", "migration");
116430
+ const wrapDir = path57.join(migrationDir, "wrap");
116431
+ fs52.mkdirSync(wrapDir, { recursive: true });
116432
+ stepTimer.mark(
116433
+ Date.now(),
116434
+ "Seed",
116435
+ cmsScaffold && cmsScaffold.failures.length > 0 ? "warn" : "ok",
116436
+ `${contentSeed?.seeded ?? 0} labels${cmsScaffold ? `, ${cmsScaffold.schemas} CMS types` : ""}`
116437
+ );
116107
116438
  let schemaDrafts = options.check ? [] : writeSchemaDrafts(cwd, scan);
116108
116439
  let stagedRows = options.check ? 0 : writeRowsStaging(cwd, scan, schemaDrafts);
116109
116440
  let collectionRewire = null;
@@ -116153,14 +116484,14 @@ ${error45.stderrTail.slice(-800)}` : "";
116153
116484
  collections: scan.collections,
116154
116485
  dataFiles: scan.dataFiles
116155
116486
  };
116156
- const planPath = path56.join(migrationDir, "plan.json");
116157
- fs51.writeFileSync(planPath, `${JSON.stringify(plan, null, 2)}
116487
+ const planPath = path57.join(migrationDir, "plan.json");
116488
+ fs52.writeFileSync(planPath, `${JSON.stringify(plan, null, 2)}
116158
116489
  `);
116159
116490
  const cmsScaffoldAvailable = cmsConnector && cmsSchemas.length > 0 && !dataSources.some(
116160
116491
  (source) => source.host === cmsConnector.detection.host && source.decision === "ingest" && source.contentState === "example"
116161
116492
  ) ? { cms: cmsConnector.detection.cms, types: cmsSchemas.length } : void 0;
116162
- const promptPath = path56.join(wrapDir, "agent-prompt.md");
116163
- fs51.writeFileSync(
116493
+ const promptPath = path57.join(wrapDir, "agent-prompt.md");
116494
+ fs52.writeFileSync(
116164
116495
  promptPath,
116165
116496
  renderAgentPrompt(framework ?? "js", coverage, scan, dataSources, {
116166
116497
  applied: applied ? applied.applied.length : 0,
@@ -116173,7 +116504,7 @@ ${error45.stderrTail.slice(-800)}` : "";
116173
116504
  i18nWired: i18nFimoWired,
116174
116505
  cmsScaffold: cmsScaffold ?? void 0,
116175
116506
  cmsScaffoldAvailable,
116176
- cmsListHelperPath: cmsListHelperPath ?? void 0,
116507
+ cmsWired: cmsWired ?? void 0,
116177
116508
  wiring: wiringStatus ? {
116178
116509
  present: wiringStatus.present,
116179
116510
  hint: wiringStatus.hint,
@@ -116187,7 +116518,7 @@ ${error45.stderrTail.slice(-800)}` : "";
116187
116518
  baseline: ".fimo/migration/parity-baseline.json",
116188
116519
  capturedAt: (/* @__PURE__ */ new Date()).toISOString()
116189
116520
  };
116190
- fs51.writeFileSync(planPath, `${JSON.stringify(plan, null, 2)}
116521
+ fs52.writeFileSync(planPath, `${JSON.stringify(plan, null, 2)}
116191
116522
  `);
116192
116523
  }
116193
116524
  if (runSp) {
@@ -116198,7 +116529,7 @@ ${error45.stderrTail.slice(-800)}` : "";
116198
116529
  runSp.stop();
116199
116530
  }
116200
116531
  const dependencyChanged = wiring.changes.some((change) => change.startsWith("added"));
116201
- const promptRel = path56.relative(cwd, promptPath);
116532
+ const promptRel = path57.relative(cwd, promptPath);
116202
116533
  const data2 = {
116203
116534
  framework,
116204
116535
  routes: routeCount,
@@ -116208,7 +116539,7 @@ ${error45.stderrTail.slice(-800)}` : "";
116208
116539
  applied: applied ? { count: applied.applied.length, files: applied.filesChanged } : null,
116209
116540
  env_sync: envSync,
116210
116541
  package_manager: pm,
116211
- plan_path: path56.relative(cwd, planPath),
116542
+ plan_path: path57.relative(cwd, planPath),
116212
116543
  prompt_path: promptRel
116213
116544
  };
116214
116545
  if ("skipped" in envSync && envSync.skipped === "unavailable") {
@@ -116216,6 +116547,9 @@ ${error45.stderrTail.slice(-800)}` : "";
116216
116547
  `Could not import your env keys into the project (${envSync.error ?? "unknown"}) \u2014 pages with server-side external fetches may hang in the sandbox. Import manually with npx fimo secrets set / vars set.`
116217
116548
  );
116218
116549
  }
116550
+ stepTimer.mark(Date.now(), "Finalize", "ok", `${schemaDrafts.length} draft(s)`);
116551
+ const dashboardSteps = stepTimer.steps();
116552
+ const dashboardTotalMs = stepTimer.totalMs(Date.now());
116219
116553
  ui.result({
116220
116554
  command: "migrate wrap",
116221
116555
  data: data2,
@@ -116223,6 +116557,19 @@ ${error45.stderrTail.slice(-800)}` : "";
116223
116557
  const p2 = ctx.color ? palette : makeColorPalette({ forceDisable: true });
116224
116558
  const rootWiringDone = !wiringStatus || wiringStatus.present || scan.wrappedCount === 0;
116225
116559
  const migrationComplete = coverage.wrappable === 0 && !dependencyChanged && rootWiringDone && structuredWorkLeft === 0;
116560
+ const dashboard = renderWrapDashboard({
116561
+ title: "Migration to Fimo \xB7 wrap in place",
116562
+ verdict: migrationComplete ? "complete" : "in progress",
116563
+ steps: dashboardSteps,
116564
+ gates: [
116565
+ { label: "Coverage", status: coverage.wrappable === 0 ? "ok" : "warn" },
116566
+ { label: "Wiring", status: rootWiringDone ? "ok" : "warn" }
116567
+ ],
116568
+ totalMs: dashboardTotalMs,
116569
+ findings: parityWarnings.slice(0, 5),
116570
+ colors: ctx.color ? { ok: p2.green, warn: p2.yellow, fail: p2.red } : void 0,
116571
+ ascii: ctx.ascii
116572
+ });
116226
116573
  const facts = [
116227
116574
  ["Files scanned", String(scan.filesScanned)],
116228
116575
  ...migrationComplete ? [] : [["Content to migrate", String(coverage.wrappable)]],
@@ -116279,13 +116626,19 @@ ${error45.stderrTail.slice(-800)}` : "";
116279
116626
  `${cmsScaffold.schemas} type(s), ${cmsScaffold.entries} example entr${cmsScaffold.entries === 1 ? "y" : "ies"}${cmsScaffold.locales.length > 0 ? ` (${cmsScaffold.locales.join(", ")})` : ""}${cmsScaffold.skipped > 0 ? `, ${cmsScaffold.skipped} existing` : ""}${cmsScaffold.failures.length > 0 ? `, ${cmsScaffold.failures.length} issue(s)` : ""}`
116280
116627
  ]
116281
116628
  ] : [],
116629
+ ...cmsWired ? [
116630
+ [
116631
+ `${cmsScaffold?.cms ?? "CMS"} reads`,
116632
+ cmsWired.wired ? "wired to Fimo (whole site reads scaffolded content)" : "not auto-wired (see prompt)"
116633
+ ]
116634
+ ] : [],
116282
116635
  ...!("skipped" in envSync) ? [
116283
116636
  [
116284
116637
  "Env keys",
116285
116638
  envSync.imported.length > 0 ? `${envSync.imported.length} imported (${envSync.imported.filter((e) => e.kind === "secret").length} secrets)` : "already synced"
116286
116639
  ]
116287
116640
  ] : [],
116288
- ["Migration plan", path56.relative(cwd, planPath)]
116641
+ ["Migration plan", path57.relative(cwd, planPath)]
116289
116642
  ];
116290
116643
  const factWidth = Math.max(...facts.map(([label]) => label.length));
116291
116644
  const factLines = facts.map(([label, value]) => ` ${p2.dim(label.padEnd(factWidth))} ${p2.cyan(value)}`);
@@ -116293,6 +116646,8 @@ ${error45.stderrTail.slice(-800)}` : "";
116293
116646
  const check2 = ctx.ascii ? "[ok]" : "\u2713";
116294
116647
  const shipStep = `${p2.cyan("npx fimo deploy")} ${p2.dim("then edit your content live in your Fimo Studio")}`;
116295
116648
  return [
116649
+ dashboard,
116650
+ "",
116296
116651
  ...factLines,
116297
116652
  "",
116298
116653
  `${p2.green(`${check2} Migration complete!`)} Every piece of content on your site is editable from Fimo.`,
@@ -116313,6 +116668,8 @@ ${error45.stderrTail.slice(-800)}` : "";
116313
116668
  const headline = coverage.wrappable > 0 ? `${p2.bold("Your site is connected.")}
116314
116669
  The migration will make ${p2.cyan(String(coverage.wrappable))} piece(s) of content editable from Fimo \u2014 the migration plan lists every one (file and line).` : p2.bold("Your site is connected and fully migrated: every scanned piece of content is editable from Fimo.");
116315
116670
  return [
116671
+ dashboard,
116672
+ "",
116316
116673
  headline,
116317
116674
  "",
116318
116675
  ...factLines,
@@ -116327,15 +116684,15 @@ The migration will make ${p2.cyan(String(coverage.wrappable))} piece(s) of conte
116327
116684
  }
116328
116685
  __name(migrateWrapCommand, "migrateWrapCommand");
116329
116686
  var ANSI_PATTERN2 = /\[[0-9;]*m/g;
116330
- function visibleLength(line) {
116687
+ function visibleLength2(line) {
116331
116688
  return line.replace(ANSI_PATTERN2, "").length;
116332
116689
  }
116333
- __name(visibleLength, "visibleLength");
116690
+ __name(visibleLength2, "visibleLength");
116334
116691
  function renderStepsBox(steps, ascii, p2, opts = {}) {
116335
116692
  const glyphs = ascii ? { tl: "+", tr: "+", bl: "+", br: "+", h: "-", v: "|" } : { tl: "\u256D", tr: "\u256E", bl: "\u2570", br: "\u256F", h: "\u2500", v: "\u2502" };
116336
116693
  const title = opts.title ?? "Next steps";
116337
116694
  const lines = steps.map((step, index2) => opts.numbered === false ? step : `${index2 + 1}. ${step}`);
116338
- const innerWidth = Math.max(...lines.map(visibleLength), title.length + 2) + 4;
116695
+ const innerWidth = Math.max(...lines.map(visibleLength2), title.length + 2) + 4;
116339
116696
  const top = p2.dim(`${glyphs.tl}${glyphs.h} `) + p2.bold(title) + p2.dim(` ${glyphs.h.repeat(Math.max(1, innerWidth - title.length - 3))}${glyphs.tr}`);
116340
116697
  const bottom = `${glyphs.bl}${glyphs.h.repeat(innerWidth)}${glyphs.br}`;
116341
116698
  const empty2 = `${glyphs.v}${" ".repeat(innerWidth)}${glyphs.v}`;
@@ -116343,7 +116700,7 @@ function renderStepsBox(steps, ascii, p2, opts = {}) {
116343
116700
  top,
116344
116701
  p2.dim(empty2),
116345
116702
  ...lines.map(
116346
- (line) => `${p2.dim(glyphs.v)} ${line}${" ".repeat(Math.max(0, innerWidth - visibleLength(line) - 2))}${p2.dim(glyphs.v)}`
116703
+ (line) => `${p2.dim(glyphs.v)} ${line}${" ".repeat(Math.max(0, innerWidth - visibleLength2(line) - 2))}${p2.dim(glyphs.v)}`
116347
116704
  ),
116348
116705
  p2.dim(empty2),
116349
116706
  p2.dim(bottom)
@@ -116664,8 +117021,8 @@ init_dist();
116664
117021
  init_api();
116665
117022
  init_config2();
116666
117023
  init_project();
116667
- import fs52 from "node:fs";
116668
- import path57 from "node:path";
117024
+ import fs53 from "node:fs";
117025
+ import path58 from "node:path";
116669
117026
  function registerProjectSecretsCommands(program2) {
116670
117027
  const vars = program2.command("vars").description("Manage project variables");
116671
117028
  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));
@@ -116777,10 +117134,10 @@ async function writePulledVars(api, projectRoot, projectId, file2) {
116777
117134
  const rows = (await api.listProjectSecretEntries(projectId, { kind: "variable" })).filter(
116778
117135
  (row2) => row2.exposure === "public"
116779
117136
  );
116780
- const target = path57.resolve(projectRoot, file2);
116781
- const existing = fs52.existsSync(target) ? fs52.readFileSync(target, "utf8") : "";
117137
+ const target = path58.resolve(projectRoot, file2);
117138
+ const existing = fs53.existsSync(target) ? fs53.readFileSync(target, "utf8") : "";
116782
117139
  const body = mergeEnvFile(existing, rows);
116783
- fs52.writeFileSync(target, body);
117140
+ fs53.writeFileSync(target, body);
116784
117141
  return { path: target, written: rows.length };
116785
117142
  }
116786
117143
  __name(writePulledVars, "writePulledVars");
@@ -116848,19 +117205,19 @@ init_auth();
116848
117205
  init_config2();
116849
117206
  init_auth_errors();
116850
117207
  init_interactive();
116851
- import fs53 from "node:fs";
116852
- import path58 from "node:path";
117208
+ import fs54 from "node:fs";
117209
+ import path59 from "node:path";
116853
117210
  function resolveCwd2(options) {
116854
- return options.cwd ? path58.resolve(options.cwd) : process.cwd();
117211
+ return options.cwd ? path59.resolve(options.cwd) : process.cwd();
116855
117212
  }
116856
117213
  __name(resolveCwd2, "resolveCwd");
116857
117214
  function readLocalConfig(options) {
116858
117215
  const cwd = resolveCwd2(options);
116859
- const settingsPath = path58.join(cwd, ".fimo.settings.json");
116860
- if (!fs53.existsSync(settingsPath)) {
117216
+ const settingsPath = path59.join(cwd, ".fimo.settings.json");
117217
+ if (!fs54.existsSync(settingsPath)) {
116861
117218
  return null;
116862
117219
  }
116863
- return JSON.parse(fs53.readFileSync(settingsPath, "utf-8"));
117220
+ return JSON.parse(fs54.readFileSync(settingsPath, "utf-8"));
116864
117221
  }
116865
117222
  __name(readLocalConfig, "readLocalConfig");
116866
117223
  function resolveProjectId5(argv, options, command) {
@@ -116972,11 +117329,11 @@ async function projectsRenameCommand(nameArg, projectIdArg, options) {
116972
117329
  });
116973
117330
  return;
116974
117331
  }
116975
- const configPath = path58.join(cwd, "fimo-config.json");
117332
+ const configPath = path59.join(cwd, "fimo-config.json");
116976
117333
  let config2 = {};
116977
- if (fs53.existsSync(configPath)) {
117334
+ if (fs54.existsSync(configPath)) {
116978
117335
  try {
116979
- config2 = JSON.parse(fs53.readFileSync(configPath, "utf-8"));
117336
+ config2 = JSON.parse(fs54.readFileSync(configPath, "utf-8"));
116980
117337
  } catch (error45) {
116981
117338
  ui.error({
116982
117339
  command: "projects rename",
@@ -116988,7 +117345,7 @@ async function projectsRenameCommand(nameArg, projectIdArg, options) {
116988
117345
  }
116989
117346
  const seo = config2.seo ?? {};
116990
117347
  config2.seo = { ...seo, siteName: name };
116991
- fs53.writeFileSync(configPath, JSON.stringify(config2, null, 2) + "\n");
117348
+ fs54.writeFileSync(configPath, JSON.stringify(config2, null, 2) + "\n");
116992
117349
  ui.ok({
116993
117350
  command: "projects rename",
116994
117351
  headline: `Renamed to "${name}".`,
@@ -117208,12 +117565,12 @@ __name(resolveCurrentCliUser, "resolveCurrentCliUser");
117208
117565
  init_dist();
117209
117566
  init_agents();
117210
117567
  init_scaffold();
117211
- import fs54 from "node:fs";
117212
- import path59 from "node:path";
117568
+ import fs55 from "node:fs";
117569
+ import path60 from "node:path";
117213
117570
  async function rulesSyncCommand(options = {}) {
117214
- const cwd = path59.resolve(options.cwd ?? process.cwd());
117215
- const agentsMdPath = path59.join(cwd, "AGENTS.md");
117216
- if (!fs54.existsSync(agentsMdPath)) {
117571
+ const cwd = path60.resolve(options.cwd ?? process.cwd());
117572
+ const agentsMdPath = path60.join(cwd, "AGENTS.md");
117573
+ if (!fs55.existsSync(agentsMdPath)) {
117217
117574
  ui.error({
117218
117575
  command: "rules sync",
117219
117576
  code: "NO_AGENTS_MD",
@@ -117658,7 +118015,7 @@ init_version();
117658
118015
  function computeVersionString() {
117659
118016
  let pkgVersion = "0.0.0";
117660
118017
  try {
117661
- const pkg = JSON.parse(fs55.readFileSync(path60.join(CLI_ROOT, "package.json"), "utf8"));
118018
+ const pkg = JSON.parse(fs56.readFileSync(path61.join(CLI_ROOT, "package.json"), "utf8"));
117662
118019
  if (typeof pkg.version === "string" && pkg.version.length > 0) {
117663
118020
  pkgVersion = pkg.version;
117664
118021
  }
@@ -117666,7 +118023,7 @@ function computeVersionString() {
117666
118023
  }
117667
118024
  let releaseId;
117668
118025
  try {
117669
- const release = JSON.parse(fs55.readFileSync(path60.join(CLI_ROOT, "release.json"), "utf8"));
118026
+ const release = JSON.parse(fs56.readFileSync(path61.join(CLI_ROOT, "release.json"), "utf8"));
117670
118027
  if (typeof release.id === "string" && release.id.length > 0) {
117671
118028
  releaseId = release.id;
117672
118029
  }
@@ -117728,8 +118085,8 @@ var migrate = program.command("migrate").description("Prepare agent-ready migrat
117728
118085
  (value, prev2 = []) => [...prev2, value]
117729
118086
  ).option("--mode <mode>", "Project skill install method for newly created projects: symlink | copy").option("--max-pages <n>", "Maximum number of HTML pages to crawl (default 12)").option("--max-assets <n>", "Maximum media assets to download into the migration pack (default 40)").option("--download-media", "Download detected media assets into the migration pack").option("--no-download-media", "Skip downloading detected media assets").option("--route <path>", 'Limit the refinement pack to one route (for example "/contact")').action((url2, dir, options) => {
117730
118087
  if (!url2) {
117731
- const cwd = options.cwd ? path60.resolve(options.cwd) : process.cwd();
117732
- if (fs55.existsSync(path60.join(cwd, "fimo-config.json")) || detectFramework(cwd).framework) {
118088
+ const cwd = options.cwd ? path61.resolve(options.cwd) : process.cwd();
118089
+ if (fs56.existsSync(path61.join(cwd, "fimo-config.json")) || detectFramework(cwd).framework) {
117733
118090
  return migrateWrapCommand({ cwd: options.cwd, apply: options.apply !== false, timeout: options.timeout });
117734
118091
  }
117735
118092
  migrate.help();