@fern-api/generator-cli 0.6.14 → 0.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli.js CHANGED
@@ -91,7 +91,7 @@ var init_esm = __esm({
91
91
  }
92
92
  });
93
93
 
94
- // ../../node_modules/.pnpm/brace-expansion@5.0.3/node_modules/brace-expansion/dist/esm/index.js
94
+ // ../../node_modules/.pnpm/brace-expansion@5.0.5/node_modules/brace-expansion/dist/esm/index.js
95
95
  function numeric(str) {
96
96
  return !isNaN(str) ? parseInt(str, 10) : str.charCodeAt(0);
97
97
  }
@@ -185,7 +185,7 @@ function expand_(str, max, isTop) {
185
185
  const x = numeric(n[0]);
186
186
  const y = numeric(n[1]);
187
187
  const width = Math.max(n[0].length, n[1].length);
188
- let incr = n.length === 3 && n[2] !== void 0 ? Math.abs(numeric(n[2])) : 1;
188
+ let incr = n.length === 3 && n[2] !== void 0 ? Math.max(Math.abs(numeric(n[2])), 1) : 1;
189
189
  let test = lte;
190
190
  const reverse = y < x;
191
191
  if (reverse) {
@@ -236,7 +236,7 @@ function expand_(str, max, isTop) {
236
236
  }
237
237
  var escSlash, escOpen, escClose, escComma, escPeriod, escSlashPattern, escOpenPattern, escClosePattern, escCommaPattern, escPeriodPattern, slashPattern, openPattern, closePattern, commaPattern, periodPattern, EXPANSION_MAX;
238
238
  var init_esm2 = __esm({
239
- "../../node_modules/.pnpm/brace-expansion@5.0.3/node_modules/brace-expansion/dist/esm/index.js"() {
239
+ "../../node_modules/.pnpm/brace-expansion@5.0.5/node_modules/brace-expansion/dist/esm/index.js"() {
240
240
  "use strict";
241
241
  init_esm();
242
242
  escSlash = "\0SLASH" + Math.random() + "\0";
@@ -253,7 +253,7 @@ var init_esm2 = __esm({
253
253
  openPattern = /\\{/g;
254
254
  closePattern = /\\}/g;
255
255
  commaPattern = /\\,/g;
256
- periodPattern = /\\./g;
256
+ periodPattern = /\\\./g;
257
257
  EXPANSION_MAX = 1e5;
258
258
  }
259
259
  });
@@ -12238,9 +12238,9 @@ var require_fast_content_type_parse = __commonJS({
12238
12238
  }
12239
12239
  });
12240
12240
 
12241
- // ../../node_modules/.pnpm/yaml@2.3.3/node_modules/yaml/dist/nodes/identity.js
12241
+ // ../../node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/nodes/identity.js
12242
12242
  var require_identity = __commonJS({
12243
- "../../node_modules/.pnpm/yaml@2.3.3/node_modules/yaml/dist/nodes/identity.js"(exports2) {
12243
+ "../../node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/nodes/identity.js"(exports2) {
12244
12244
  "use strict";
12245
12245
  var ALIAS = /* @__PURE__ */ Symbol.for("yaml.alias");
12246
12246
  var DOC = /* @__PURE__ */ Symbol.for("yaml.document");
@@ -12295,9 +12295,9 @@ var require_identity = __commonJS({
12295
12295
  }
12296
12296
  });
12297
12297
 
12298
- // ../../node_modules/.pnpm/yaml@2.3.3/node_modules/yaml/dist/visit.js
12298
+ // ../../node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/visit.js
12299
12299
  var require_visit = __commonJS({
12300
- "../../node_modules/.pnpm/yaml@2.3.3/node_modules/yaml/dist/visit.js"(exports2) {
12300
+ "../../node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/visit.js"(exports2) {
12301
12301
  "use strict";
12302
12302
  var identity = require_identity();
12303
12303
  var BREAK = /* @__PURE__ */ Symbol("break visit");
@@ -12453,9 +12453,9 @@ var require_visit = __commonJS({
12453
12453
  }
12454
12454
  });
12455
12455
 
12456
- // ../../node_modules/.pnpm/yaml@2.3.3/node_modules/yaml/dist/doc/directives.js
12456
+ // ../../node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/doc/directives.js
12457
12457
  var require_directives = __commonJS({
12458
- "../../node_modules/.pnpm/yaml@2.3.3/node_modules/yaml/dist/doc/directives.js"(exports2) {
12458
+ "../../node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/doc/directives.js"(exports2) {
12459
12459
  "use strict";
12460
12460
  var identity = require_identity();
12461
12461
  var visit = require_visit();
@@ -12568,7 +12568,7 @@ var require_directives = __commonJS({
12568
12568
  onError2("Verbatim tags must end with a >");
12569
12569
  return verbatim;
12570
12570
  }
12571
- const [, handle, suffix] = source.match(/^(.*!)([^!]*)$/);
12571
+ const [, handle, suffix] = source.match(/^(.*!)([^!]*)$/s);
12572
12572
  if (!suffix)
12573
12573
  onError2(`The ${source} tag has no suffix`);
12574
12574
  const prefix = this.tags[handle];
@@ -12624,9 +12624,9 @@ var require_directives = __commonJS({
12624
12624
  }
12625
12625
  });
12626
12626
 
12627
- // ../../node_modules/.pnpm/yaml@2.3.3/node_modules/yaml/dist/doc/anchors.js
12627
+ // ../../node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/doc/anchors.js
12628
12628
  var require_anchors = __commonJS({
12629
- "../../node_modules/.pnpm/yaml@2.3.3/node_modules/yaml/dist/doc/anchors.js"(exports2) {
12629
+ "../../node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/doc/anchors.js"(exports2) {
12630
12630
  "use strict";
12631
12631
  var identity = require_identity();
12632
12632
  var visit = require_visit();
@@ -12662,8 +12662,7 @@ var require_anchors = __commonJS({
12662
12662
  return {
12663
12663
  onAnchor: (source) => {
12664
12664
  aliasObjects.push(source);
12665
- if (!prevAnchors)
12666
- prevAnchors = anchorNames(doc);
12665
+ prevAnchors ?? (prevAnchors = anchorNames(doc));
12667
12666
  const anchor = findNewAnchor(prefix, prevAnchors);
12668
12667
  prevAnchors.add(anchor);
12669
12668
  return anchor;
@@ -12695,9 +12694,9 @@ var require_anchors = __commonJS({
12695
12694
  }
12696
12695
  });
12697
12696
 
12698
- // ../../node_modules/.pnpm/yaml@2.3.3/node_modules/yaml/dist/doc/applyReviver.js
12697
+ // ../../node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/doc/applyReviver.js
12699
12698
  var require_applyReviver = __commonJS({
12700
- "../../node_modules/.pnpm/yaml@2.3.3/node_modules/yaml/dist/doc/applyReviver.js"(exports2) {
12699
+ "../../node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/doc/applyReviver.js"(exports2) {
12701
12700
  "use strict";
12702
12701
  function applyReviver(reviver, obj, key, val) {
12703
12702
  if (val && typeof val === "object") {
@@ -12745,9 +12744,9 @@ var require_applyReviver = __commonJS({
12745
12744
  }
12746
12745
  });
12747
12746
 
12748
- // ../../node_modules/.pnpm/yaml@2.3.3/node_modules/yaml/dist/nodes/toJS.js
12747
+ // ../../node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/nodes/toJS.js
12749
12748
  var require_toJS = __commonJS({
12750
- "../../node_modules/.pnpm/yaml@2.3.3/node_modules/yaml/dist/nodes/toJS.js"(exports2) {
12749
+ "../../node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/nodes/toJS.js"(exports2) {
12751
12750
  "use strict";
12752
12751
  var identity = require_identity();
12753
12752
  function toJS(value, arg, ctx) {
@@ -12775,9 +12774,9 @@ var require_toJS = __commonJS({
12775
12774
  }
12776
12775
  });
12777
12776
 
12778
- // ../../node_modules/.pnpm/yaml@2.3.3/node_modules/yaml/dist/nodes/Node.js
12777
+ // ../../node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/nodes/Node.js
12779
12778
  var require_Node = __commonJS({
12780
- "../../node_modules/.pnpm/yaml@2.3.3/node_modules/yaml/dist/nodes/Node.js"(exports2) {
12779
+ "../../node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/nodes/Node.js"(exports2) {
12781
12780
  "use strict";
12782
12781
  var applyReviver = require_applyReviver();
12783
12782
  var identity = require_identity();
@@ -12816,9 +12815,9 @@ var require_Node = __commonJS({
12816
12815
  }
12817
12816
  });
12818
12817
 
12819
- // ../../node_modules/.pnpm/yaml@2.3.3/node_modules/yaml/dist/nodes/Alias.js
12818
+ // ../../node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/nodes/Alias.js
12820
12819
  var require_Alias = __commonJS({
12821
- "../../node_modules/.pnpm/yaml@2.3.3/node_modules/yaml/dist/nodes/Alias.js"(exports2) {
12820
+ "../../node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/nodes/Alias.js"(exports2) {
12822
12821
  "use strict";
12823
12822
  var anchors = require_anchors();
12824
12823
  var visit = require_visit();
@@ -12839,23 +12838,35 @@ var require_Alias = __commonJS({
12839
12838
  * Resolve the value of this alias within `doc`, finding the last
12840
12839
  * instance of the `source` anchor before this node.
12841
12840
  */
12842
- resolve(doc) {
12841
+ resolve(doc, ctx) {
12842
+ let nodes;
12843
+ if (ctx?.aliasResolveCache) {
12844
+ nodes = ctx.aliasResolveCache;
12845
+ } else {
12846
+ nodes = [];
12847
+ visit.visit(doc, {
12848
+ Node: (_key, node) => {
12849
+ if (identity.isAlias(node) || identity.hasAnchor(node))
12850
+ nodes.push(node);
12851
+ }
12852
+ });
12853
+ if (ctx)
12854
+ ctx.aliasResolveCache = nodes;
12855
+ }
12843
12856
  let found = void 0;
12844
- visit.visit(doc, {
12845
- Node: (_key, node) => {
12846
- if (node === this)
12847
- return visit.visit.BREAK;
12848
- if (node.anchor === this.source)
12849
- found = node;
12850
- }
12851
- });
12857
+ for (const node of nodes) {
12858
+ if (node === this)
12859
+ break;
12860
+ if (node.anchor === this.source)
12861
+ found = node;
12862
+ }
12852
12863
  return found;
12853
12864
  }
12854
12865
  toJSON(_arg, ctx) {
12855
12866
  if (!ctx)
12856
12867
  return { source: this.source };
12857
12868
  const { anchors: anchors2, doc, maxAliasCount } = ctx;
12858
- const source = this.resolve(doc);
12869
+ const source = this.resolve(doc, ctx);
12859
12870
  if (!source) {
12860
12871
  const msg = `Unresolved alias (the anchor must be set before the alias): ${this.source}`;
12861
12872
  throw new ReferenceError(msg);
@@ -12865,7 +12876,7 @@ var require_Alias = __commonJS({
12865
12876
  toJS.toJS(source, null, ctx);
12866
12877
  data = anchors2.get(source);
12867
12878
  }
12868
- if (!data || data.res === void 0) {
12879
+ if (data?.res === void 0) {
12869
12880
  const msg = "This should not happen: Alias anchor was not resolved?";
12870
12881
  throw new ReferenceError(msg);
12871
12882
  }
@@ -12918,9 +12929,9 @@ var require_Alias = __commonJS({
12918
12929
  }
12919
12930
  });
12920
12931
 
12921
- // ../../node_modules/.pnpm/yaml@2.3.3/node_modules/yaml/dist/nodes/Scalar.js
12932
+ // ../../node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/nodes/Scalar.js
12922
12933
  var require_Scalar = __commonJS({
12923
- "../../node_modules/.pnpm/yaml@2.3.3/node_modules/yaml/dist/nodes/Scalar.js"(exports2) {
12934
+ "../../node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/nodes/Scalar.js"(exports2) {
12924
12935
  "use strict";
12925
12936
  var identity = require_identity();
12926
12937
  var Node = require_Node();
@@ -12948,9 +12959,9 @@ var require_Scalar = __commonJS({
12948
12959
  }
12949
12960
  });
12950
12961
 
12951
- // ../../node_modules/.pnpm/yaml@2.3.3/node_modules/yaml/dist/doc/createNode.js
12962
+ // ../../node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/doc/createNode.js
12952
12963
  var require_createNode = __commonJS({
12953
- "../../node_modules/.pnpm/yaml@2.3.3/node_modules/yaml/dist/doc/createNode.js"(exports2) {
12964
+ "../../node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/doc/createNode.js"(exports2) {
12954
12965
  "use strict";
12955
12966
  var Alias = require_Alias();
12956
12967
  var identity = require_identity();
@@ -12984,8 +12995,7 @@ var require_createNode = __commonJS({
12984
12995
  if (aliasDuplicateObjects && value && typeof value === "object") {
12985
12996
  ref = sourceObjects.get(value);
12986
12997
  if (ref) {
12987
- if (!ref.anchor)
12988
- ref.anchor = onAnchor(value);
12998
+ ref.anchor ?? (ref.anchor = onAnchor(value));
12989
12999
  return new Alias.Alias(ref.anchor);
12990
13000
  } else {
12991
13001
  ref = { anchor: null, node: null };
@@ -13024,9 +13034,9 @@ var require_createNode = __commonJS({
13024
13034
  }
13025
13035
  });
13026
13036
 
13027
- // ../../node_modules/.pnpm/yaml@2.3.3/node_modules/yaml/dist/nodes/Collection.js
13037
+ // ../../node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/nodes/Collection.js
13028
13038
  var require_Collection = __commonJS({
13029
- "../../node_modules/.pnpm/yaml@2.3.3/node_modules/yaml/dist/nodes/Collection.js"(exports2) {
13039
+ "../../node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/nodes/Collection.js"(exports2) {
13030
13040
  "use strict";
13031
13041
  var createNode = require_createNode();
13032
13042
  var identity = require_identity();
@@ -13161,16 +13171,15 @@ var require_Collection = __commonJS({
13161
13171
  }
13162
13172
  }
13163
13173
  };
13164
- Collection2.maxFlowStringSingleLineLength = 60;
13165
13174
  exports2.Collection = Collection2;
13166
13175
  exports2.collectionFromPath = collectionFromPath;
13167
13176
  exports2.isEmptyPath = isEmptyPath;
13168
13177
  }
13169
13178
  });
13170
13179
 
13171
- // ../../node_modules/.pnpm/yaml@2.3.3/node_modules/yaml/dist/stringify/stringifyComment.js
13180
+ // ../../node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/stringify/stringifyComment.js
13172
13181
  var require_stringifyComment = __commonJS({
13173
- "../../node_modules/.pnpm/yaml@2.3.3/node_modules/yaml/dist/stringify/stringifyComment.js"(exports2) {
13182
+ "../../node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/stringify/stringifyComment.js"(exports2) {
13174
13183
  "use strict";
13175
13184
  var stringifyComment = (str) => str.replace(/^(?!$)(?: $)?/gm, "#");
13176
13185
  function indentComment(comment, indent) {
@@ -13185,9 +13194,9 @@ var require_stringifyComment = __commonJS({
13185
13194
  }
13186
13195
  });
13187
13196
 
13188
- // ../../node_modules/.pnpm/yaml@2.3.3/node_modules/yaml/dist/stringify/foldFlowLines.js
13197
+ // ../../node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/stringify/foldFlowLines.js
13189
13198
  var require_foldFlowLines = __commonJS({
13190
- "../../node_modules/.pnpm/yaml@2.3.3/node_modules/yaml/dist/stringify/foldFlowLines.js"(exports2) {
13199
+ "../../node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/stringify/foldFlowLines.js"(exports2) {
13191
13200
  "use strict";
13192
13201
  var FOLD_FLOW = "flow";
13193
13202
  var FOLD_BLOCK = "block";
@@ -13195,6 +13204,8 @@ var require_foldFlowLines = __commonJS({
13195
13204
  function foldFlowLines(text, indent, mode = "flow", { indentAtStart, lineWidth = 80, minContentWidth = 20, onFold, onOverflow } = {}) {
13196
13205
  if (!lineWidth || lineWidth < 0)
13197
13206
  return text;
13207
+ if (lineWidth < minContentWidth)
13208
+ minContentWidth = 0;
13198
13209
  const endStep = Math.max(1 + minContentWidth, 1 + lineWidth - indent.length);
13199
13210
  if (text.length <= endStep)
13200
13211
  return text;
@@ -13214,7 +13225,7 @@ var require_foldFlowLines = __commonJS({
13214
13225
  let escStart = -1;
13215
13226
  let escEnd = -1;
13216
13227
  if (mode === FOLD_BLOCK) {
13217
- i = consumeMoreIndentedLines(text, i);
13228
+ i = consumeMoreIndentedLines(text, i, indent.length);
13218
13229
  if (i !== -1)
13219
13230
  end = i + endStep;
13220
13231
  }
@@ -13238,8 +13249,8 @@ var require_foldFlowLines = __commonJS({
13238
13249
  }
13239
13250
  if (ch === "\n") {
13240
13251
  if (mode === FOLD_BLOCK)
13241
- i = consumeMoreIndentedLines(text, i);
13242
- end = i + endStep;
13252
+ i = consumeMoreIndentedLines(text, i, indent.length);
13253
+ end = i + indent.length + endStep;
13243
13254
  split = void 0;
13244
13255
  } else {
13245
13256
  if (ch === " " && prev && prev !== " " && prev !== "\n" && prev !== " ") {
@@ -13294,15 +13305,23 @@ ${indent}${text.slice(fold + 1, end2)}`;
13294
13305
  }
13295
13306
  return res;
13296
13307
  }
13297
- function consumeMoreIndentedLines(text, i) {
13298
- let ch = text[i + 1];
13308
+ function consumeMoreIndentedLines(text, i, indent) {
13309
+ let end = i;
13310
+ let start = i + 1;
13311
+ let ch = text[start];
13299
13312
  while (ch === " " || ch === " ") {
13300
- do {
13301
- ch = text[i += 1];
13302
- } while (ch && ch !== "\n");
13303
- ch = text[i + 1];
13313
+ if (i < start + indent) {
13314
+ ch = text[++i];
13315
+ } else {
13316
+ do {
13317
+ ch = text[++i];
13318
+ } while (ch && ch !== "\n");
13319
+ end = i;
13320
+ start = i + 1;
13321
+ ch = text[start];
13322
+ }
13304
13323
  }
13305
- return i;
13324
+ return end;
13306
13325
  }
13307
13326
  exports2.FOLD_BLOCK = FOLD_BLOCK;
13308
13327
  exports2.FOLD_FLOW = FOLD_FLOW;
@@ -13311,9 +13330,9 @@ ${indent}${text.slice(fold + 1, end2)}`;
13311
13330
  }
13312
13331
  });
13313
13332
 
13314
- // ../../node_modules/.pnpm/yaml@2.3.3/node_modules/yaml/dist/stringify/stringifyString.js
13333
+ // ../../node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/stringify/stringifyString.js
13315
13334
  var require_stringifyString = __commonJS({
13316
- "../../node_modules/.pnpm/yaml@2.3.3/node_modules/yaml/dist/stringify/stringifyString.js"(exports2) {
13335
+ "../../node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/stringify/stringifyString.js"(exports2) {
13317
13336
  "use strict";
13318
13337
  var Scalar = require_Scalar();
13319
13338
  var foldFlowLines = require_foldFlowLines();
@@ -13454,7 +13473,7 @@ ${indent}`) + "'";
13454
13473
  }
13455
13474
  function blockString({ comment, type, value }, ctx, onComment, onChompKeep) {
13456
13475
  const { blockQuote, commentString, lineWidth } = ctx.options;
13457
- if (!blockQuote || /\n[\t ]+$/.test(value) || /^\s*$/.test(value)) {
13476
+ if (!blockQuote || /\n[\t ]+$/.test(value)) {
13458
13477
  return quotedString(value, ctx);
13459
13478
  }
13460
13479
  const indent = ctx.indent || (ctx.forceBlockIndent || containsDocumentMarker(value) ? " " : "");
@@ -13503,21 +13522,29 @@ ${indent}`) + "'";
13503
13522
  start = start.replace(/\n+/g, `$&${indent}`);
13504
13523
  }
13505
13524
  const indentSize = indent ? "2" : "1";
13506
- let header = (literal ? "|" : ">") + (startWithSpace ? indentSize : "") + chomp;
13525
+ let header = (startWithSpace ? indentSize : "") + chomp;
13507
13526
  if (comment) {
13508
13527
  header += " " + commentString(comment.replace(/ ?[\r\n]+/g, " "));
13509
13528
  if (onComment)
13510
13529
  onComment();
13511
13530
  }
13512
- if (literal) {
13513
- value = value.replace(/\n+/g, `$&${indent}`);
13514
- return `${header}
13515
- ${indent}${start}${value}${end}`;
13516
- }
13517
- value = value.replace(/\n+/g, "\n$&").replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g, "$1$2").replace(/\n+/g, `$&${indent}`);
13518
- const body = foldFlowLines.foldFlowLines(`${start}${value}${end}`, indent, foldFlowLines.FOLD_BLOCK, getFoldOptions(ctx, true));
13519
- return `${header}
13531
+ if (!literal) {
13532
+ const foldedValue = value.replace(/\n+/g, "\n$&").replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g, "$1$2").replace(/\n+/g, `$&${indent}`);
13533
+ let literalFallback = false;
13534
+ const foldOptions = getFoldOptions(ctx, true);
13535
+ if (blockQuote !== "folded" && type !== Scalar.Scalar.BLOCK_FOLDED) {
13536
+ foldOptions.onOverflow = () => {
13537
+ literalFallback = true;
13538
+ };
13539
+ }
13540
+ const body = foldFlowLines.foldFlowLines(`${start}${foldedValue}${end}`, indent, foldFlowLines.FOLD_BLOCK, foldOptions);
13541
+ if (!literalFallback)
13542
+ return `>${header}
13520
13543
  ${indent}${body}`;
13544
+ }
13545
+ value = value.replace(/\n+/g, `$&${indent}`);
13546
+ return `|${header}
13547
+ ${indent}${start}${value}${end}`;
13521
13548
  }
13522
13549
  function plainString(item, ctx, onComment, onChompKeep) {
13523
13550
  const { type, value } = item;
@@ -13525,7 +13552,7 @@ ${indent}${body}`;
13525
13552
  if (implicitKey && value.includes("\n") || inFlow && /[[\]{},]/.test(value)) {
13526
13553
  return quotedString(value, ctx);
13527
13554
  }
13528
- if (!value || /^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(value)) {
13555
+ if (/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(value)) {
13529
13556
  return implicitKey || inFlow || !value.includes("\n") ? quotedString(value, ctx) : blockString(item, ctx, onComment, onChompKeep);
13530
13557
  }
13531
13558
  if (!implicitKey && !inFlow && type !== Scalar.Scalar.PLAIN && value.includes("\n")) {
@@ -13586,9 +13613,9 @@ ${indent}`);
13586
13613
  }
13587
13614
  });
13588
13615
 
13589
- // ../../node_modules/.pnpm/yaml@2.3.3/node_modules/yaml/dist/stringify/stringify.js
13616
+ // ../../node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/stringify/stringify.js
13590
13617
  var require_stringify = __commonJS({
13591
- "../../node_modules/.pnpm/yaml@2.3.3/node_modules/yaml/dist/stringify/stringify.js"(exports2) {
13618
+ "../../node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/stringify/stringify.js"(exports2) {
13592
13619
  "use strict";
13593
13620
  var anchors = require_anchors();
13594
13621
  var identity = require_identity();
@@ -13611,6 +13638,7 @@ var require_stringify = __commonJS({
13611
13638
  nullStr: "null",
13612
13639
  simpleKeys: false,
13613
13640
  singleQuote: null,
13641
+ trailingComma: false,
13614
13642
  trueStr: "true",
13615
13643
  verifyAliasOrder: true
13616
13644
  }, doc.schema.toStringOptions, options);
@@ -13645,14 +13673,19 @@ var require_stringify = __commonJS({
13645
13673
  let obj;
13646
13674
  if (identity.isScalar(item)) {
13647
13675
  obj = item.value;
13648
- const match2 = tags.filter((t) => t.identify?.(obj));
13676
+ let match2 = tags.filter((t) => t.identify?.(obj));
13677
+ if (match2.length > 1) {
13678
+ const testMatch = match2.filter((t) => t.test);
13679
+ if (testMatch.length > 0)
13680
+ match2 = testMatch;
13681
+ }
13649
13682
  tagObj = match2.find((t) => t.format === item.format) ?? match2.find((t) => !t.format);
13650
13683
  } else {
13651
13684
  obj = item;
13652
13685
  tagObj = tags.find((t) => t.nodeClass && obj instanceof t.nodeClass);
13653
13686
  }
13654
13687
  if (!tagObj) {
13655
- const name = obj?.constructor?.name ?? typeof obj;
13688
+ const name = obj?.constructor?.name ?? (obj === null ? "null" : typeof obj);
13656
13689
  throw new Error(`Tag not resolved for ${name} value`);
13657
13690
  }
13658
13691
  return tagObj;
@@ -13666,7 +13699,7 @@ var require_stringify = __commonJS({
13666
13699
  anchors$1.add(anchor);
13667
13700
  props.push(`&${anchor}`);
13668
13701
  }
13669
- const tag = node.tag ? node.tag : tagObj.default ? null : tagObj.tag;
13702
+ const tag = node.tag ?? (tagObj.default ? null : tagObj.tag);
13670
13703
  if (tag)
13671
13704
  props.push(doc.directives.tagString(tag));
13672
13705
  return props.join(" ");
@@ -13689,8 +13722,7 @@ var require_stringify = __commonJS({
13689
13722
  }
13690
13723
  let tagObj = void 0;
13691
13724
  const node = identity.isNode(item) ? item : ctx.doc.createNode(item, { onTagObj: (o) => tagObj = o });
13692
- if (!tagObj)
13693
- tagObj = getTagObject(ctx.doc.schema.tags, node);
13725
+ tagObj ?? (tagObj = getTagObject(ctx.doc.schema.tags, node));
13694
13726
  const props = stringifyProps(node, tagObj, ctx);
13695
13727
  if (props.length > 0)
13696
13728
  ctx.indentAtStart = (ctx.indentAtStart ?? 0) + props.length + 1;
@@ -13705,9 +13737,9 @@ ${ctx.indent}${str}`;
13705
13737
  }
13706
13738
  });
13707
13739
 
13708
- // ../../node_modules/.pnpm/yaml@2.3.3/node_modules/yaml/dist/stringify/stringifyPair.js
13740
+ // ../../node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/stringify/stringifyPair.js
13709
13741
  var require_stringifyPair = __commonJS({
13710
- "../../node_modules/.pnpm/yaml@2.3.3/node_modules/yaml/dist/stringify/stringifyPair.js"(exports2) {
13742
+ "../../node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/stringify/stringifyPair.js"(exports2) {
13711
13743
  "use strict";
13712
13744
  var identity = require_identity();
13713
13745
  var Scalar = require_Scalar();
@@ -13720,7 +13752,7 @@ var require_stringifyPair = __commonJS({
13720
13752
  if (keyComment) {
13721
13753
  throw new Error("With simple keys, key nodes cannot have comments");
13722
13754
  }
13723
- if (identity.isCollection(key)) {
13755
+ if (identity.isCollection(key) || !identity.isNode(key) && typeof key === "object") {
13724
13756
  const msg = "With simple keys, collection cannot be used as a key value";
13725
13757
  throw new Error(msg);
13726
13758
  }
@@ -13795,7 +13827,7 @@ ${indent}:`;
13795
13827
  ${stringifyComment.indentComment(cs, ctx.indent)}`;
13796
13828
  }
13797
13829
  if (valueStr === "" && !ctx.inFlow) {
13798
- if (ws === "\n")
13830
+ if (ws === "\n" && valueComment)
13799
13831
  ws = "\n\n";
13800
13832
  } else {
13801
13833
  ws += `
@@ -13838,18 +13870,19 @@ ${ctx.indent}`;
13838
13870
  }
13839
13871
  });
13840
13872
 
13841
- // ../../node_modules/.pnpm/yaml@2.3.3/node_modules/yaml/dist/log.js
13873
+ // ../../node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/log.js
13842
13874
  var require_log = __commonJS({
13843
- "../../node_modules/.pnpm/yaml@2.3.3/node_modules/yaml/dist/log.js"(exports2) {
13875
+ "../../node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/log.js"(exports2) {
13844
13876
  "use strict";
13877
+ var node_process = require("process");
13845
13878
  function debug2(logLevel, ...messages) {
13846
13879
  if (logLevel === "debug")
13847
13880
  console.log(...messages);
13848
13881
  }
13849
13882
  function warn(logLevel, warning) {
13850
13883
  if (logLevel === "debug" || logLevel === "warn") {
13851
- if (typeof process !== "undefined" && process.emitWarning)
13852
- process.emitWarning(warning);
13884
+ if (typeof node_process.emitWarning === "function")
13885
+ node_process.emitWarning(warning);
13853
13886
  else
13854
13887
  console.warn(warning);
13855
13888
  }
@@ -13859,28 +13892,78 @@ var require_log = __commonJS({
13859
13892
  }
13860
13893
  });
13861
13894
 
13862
- // ../../node_modules/.pnpm/yaml@2.3.3/node_modules/yaml/dist/nodes/addPairToJSMap.js
13895
+ // ../../node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/schema/yaml-1.1/merge.js
13896
+ var require_merge = __commonJS({
13897
+ "../../node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/schema/yaml-1.1/merge.js"(exports2) {
13898
+ "use strict";
13899
+ var identity = require_identity();
13900
+ var Scalar = require_Scalar();
13901
+ var MERGE_KEY = "<<";
13902
+ var merge2 = {
13903
+ identify: (value) => value === MERGE_KEY || typeof value === "symbol" && value.description === MERGE_KEY,
13904
+ default: "key",
13905
+ tag: "tag:yaml.org,2002:merge",
13906
+ test: /^<<$/,
13907
+ resolve: () => Object.assign(new Scalar.Scalar(Symbol(MERGE_KEY)), {
13908
+ addToJSMap: addMergeToJSMap
13909
+ }),
13910
+ stringify: () => MERGE_KEY
13911
+ };
13912
+ var isMergeKey = (ctx, key) => (merge2.identify(key) || identity.isScalar(key) && (!key.type || key.type === Scalar.Scalar.PLAIN) && merge2.identify(key.value)) && ctx?.doc.schema.tags.some((tag) => tag.tag === merge2.tag && tag.default);
13913
+ function addMergeToJSMap(ctx, map, value) {
13914
+ value = ctx && identity.isAlias(value) ? value.resolve(ctx.doc) : value;
13915
+ if (identity.isSeq(value))
13916
+ for (const it of value.items)
13917
+ mergeValue(ctx, map, it);
13918
+ else if (Array.isArray(value))
13919
+ for (const it of value)
13920
+ mergeValue(ctx, map, it);
13921
+ else
13922
+ mergeValue(ctx, map, value);
13923
+ }
13924
+ function mergeValue(ctx, map, value) {
13925
+ const source = ctx && identity.isAlias(value) ? value.resolve(ctx.doc) : value;
13926
+ if (!identity.isMap(source))
13927
+ throw new Error("Merge sources must be maps or map aliases");
13928
+ const srcMap = source.toJSON(null, ctx, Map);
13929
+ for (const [key, value2] of srcMap) {
13930
+ if (map instanceof Map) {
13931
+ if (!map.has(key))
13932
+ map.set(key, value2);
13933
+ } else if (map instanceof Set) {
13934
+ map.add(key);
13935
+ } else if (!Object.prototype.hasOwnProperty.call(map, key)) {
13936
+ Object.defineProperty(map, key, {
13937
+ value: value2,
13938
+ writable: true,
13939
+ enumerable: true,
13940
+ configurable: true
13941
+ });
13942
+ }
13943
+ }
13944
+ return map;
13945
+ }
13946
+ exports2.addMergeToJSMap = addMergeToJSMap;
13947
+ exports2.isMergeKey = isMergeKey;
13948
+ exports2.merge = merge2;
13949
+ }
13950
+ });
13951
+
13952
+ // ../../node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/nodes/addPairToJSMap.js
13863
13953
  var require_addPairToJSMap = __commonJS({
13864
- "../../node_modules/.pnpm/yaml@2.3.3/node_modules/yaml/dist/nodes/addPairToJSMap.js"(exports2) {
13954
+ "../../node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/nodes/addPairToJSMap.js"(exports2) {
13865
13955
  "use strict";
13866
13956
  var log = require_log();
13957
+ var merge2 = require_merge();
13867
13958
  var stringify3 = require_stringify();
13868
13959
  var identity = require_identity();
13869
- var Scalar = require_Scalar();
13870
13960
  var toJS = require_toJS();
13871
- var MERGE_KEY = "<<";
13872
13961
  function addPairToJSMap(ctx, map, { key, value }) {
13873
- if (ctx?.doc.schema.merge && isMergeKey(key)) {
13874
- value = identity.isAlias(value) ? value.resolve(ctx.doc) : value;
13875
- if (identity.isSeq(value))
13876
- for (const it of value.items)
13877
- mergeToJSMap(ctx, map, it);
13878
- else if (Array.isArray(value))
13879
- for (const it of value)
13880
- mergeToJSMap(ctx, map, it);
13881
- else
13882
- mergeToJSMap(ctx, map, value);
13883
- } else {
13962
+ if (identity.isNode(key) && key.addToJSMap)
13963
+ key.addToJSMap(ctx, map, value);
13964
+ else if (merge2.isMergeKey(ctx, key))
13965
+ merge2.addMergeToJSMap(ctx, map, value);
13966
+ else {
13884
13967
  const jsKey = toJS.toJS(key, "", ctx);
13885
13968
  if (map instanceof Map) {
13886
13969
  map.set(jsKey, toJS.toJS(value, jsKey, ctx));
@@ -13902,29 +13985,6 @@ var require_addPairToJSMap = __commonJS({
13902
13985
  }
13903
13986
  return map;
13904
13987
  }
13905
- var isMergeKey = (key) => key === MERGE_KEY || identity.isScalar(key) && key.value === MERGE_KEY && (!key.type || key.type === Scalar.Scalar.PLAIN);
13906
- function mergeToJSMap(ctx, map, value) {
13907
- const source = ctx && identity.isAlias(value) ? value.resolve(ctx.doc) : value;
13908
- if (!identity.isMap(source))
13909
- throw new Error("Merge sources must be maps or map aliases");
13910
- const srcMap = source.toJSON(null, ctx, Map);
13911
- for (const [key, value2] of srcMap) {
13912
- if (map instanceof Map) {
13913
- if (!map.has(key))
13914
- map.set(key, value2);
13915
- } else if (map instanceof Set) {
13916
- map.add(key);
13917
- } else if (!Object.prototype.hasOwnProperty.call(map, key)) {
13918
- Object.defineProperty(map, key, {
13919
- value: value2,
13920
- writable: true,
13921
- enumerable: true,
13922
- configurable: true
13923
- });
13924
- }
13925
- }
13926
- return map;
13927
- }
13928
13988
  function stringifyKey(key, jsKey, ctx) {
13929
13989
  if (jsKey === null)
13930
13990
  return "";
@@ -13953,9 +14013,9 @@ var require_addPairToJSMap = __commonJS({
13953
14013
  }
13954
14014
  });
13955
14015
 
13956
- // ../../node_modules/.pnpm/yaml@2.3.3/node_modules/yaml/dist/nodes/Pair.js
14016
+ // ../../node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/nodes/Pair.js
13957
14017
  var require_Pair = __commonJS({
13958
- "../../node_modules/.pnpm/yaml@2.3.3/node_modules/yaml/dist/nodes/Pair.js"(exports2) {
14018
+ "../../node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/nodes/Pair.js"(exports2) {
13959
14019
  "use strict";
13960
14020
  var createNode = require_createNode();
13961
14021
  var stringifyPair = require_stringifyPair();
@@ -13993,11 +14053,10 @@ var require_Pair = __commonJS({
13993
14053
  }
13994
14054
  });
13995
14055
 
13996
- // ../../node_modules/.pnpm/yaml@2.3.3/node_modules/yaml/dist/stringify/stringifyCollection.js
14056
+ // ../../node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/stringify/stringifyCollection.js
13997
14057
  var require_stringifyCollection = __commonJS({
13998
- "../../node_modules/.pnpm/yaml@2.3.3/node_modules/yaml/dist/stringify/stringifyCollection.js"(exports2) {
14058
+ "../../node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/stringify/stringifyCollection.js"(exports2) {
13999
14059
  "use strict";
14000
- var Collection2 = require_Collection();
14001
14060
  var identity = require_identity();
14002
14061
  var stringify3 = require_stringify();
14003
14062
  var stringifyComment = require_stringifyComment();
@@ -14055,7 +14114,7 @@ ${indent}${line}` : "\n";
14055
14114
  onChompKeep();
14056
14115
  return str;
14057
14116
  }
14058
- function stringifyFlowCollection({ comment, items }, ctx, { flowChars, itemIndent, onComment }) {
14117
+ function stringifyFlowCollection({ items }, ctx, { flowChars, itemIndent }) {
14059
14118
  const { indent, indentStep, flowCollectionPadding: fcPadding, options: { commentString } } = ctx;
14060
14119
  itemIndent += indentStep;
14061
14120
  const itemCtx = Object.assign({}, ctx, {
@@ -14068,13 +14127,13 @@ ${indent}${line}` : "\n";
14068
14127
  const lines = [];
14069
14128
  for (let i = 0; i < items.length; ++i) {
14070
14129
  const item = items[i];
14071
- let comment2 = null;
14130
+ let comment = null;
14072
14131
  if (identity.isNode(item)) {
14073
14132
  if (item.spaceBefore)
14074
14133
  lines.push("");
14075
14134
  addCommentBefore(ctx, lines, item.commentBefore, false);
14076
14135
  if (item.comment)
14077
- comment2 = item.comment;
14136
+ comment = item.comment;
14078
14137
  } else if (identity.isPair(item)) {
14079
14138
  const ik = identity.isNode(item.key) ? item.key : null;
14080
14139
  if (ik) {
@@ -14087,51 +14146,51 @@ ${indent}${line}` : "\n";
14087
14146
  const iv = identity.isNode(item.value) ? item.value : null;
14088
14147
  if (iv) {
14089
14148
  if (iv.comment)
14090
- comment2 = iv.comment;
14149
+ comment = iv.comment;
14091
14150
  if (iv.commentBefore)
14092
14151
  reqNewline = true;
14093
14152
  } else if (item.value == null && ik?.comment) {
14094
- comment2 = ik.comment;
14153
+ comment = ik.comment;
14095
14154
  }
14096
14155
  }
14097
- if (comment2)
14156
+ if (comment)
14098
14157
  reqNewline = true;
14099
- let str2 = stringify3.stringify(item, itemCtx, () => comment2 = null);
14100
- if (i < items.length - 1)
14101
- str2 += ",";
14102
- if (comment2)
14103
- str2 += stringifyComment.lineComment(str2, itemIndent, commentString(comment2));
14104
- if (!reqNewline && (lines.length > linesAtValue || str2.includes("\n")))
14105
- reqNewline = true;
14106
- lines.push(str2);
14158
+ let str = stringify3.stringify(item, itemCtx, () => comment = null);
14159
+ reqNewline || (reqNewline = lines.length > linesAtValue || str.includes("\n"));
14160
+ if (i < items.length - 1) {
14161
+ str += ",";
14162
+ } else if (ctx.options.trailingComma) {
14163
+ if (ctx.options.lineWidth > 0) {
14164
+ reqNewline || (reqNewline = lines.reduce((sum, line) => sum + line.length + 2, 2) + (str.length + 2) > ctx.options.lineWidth);
14165
+ }
14166
+ if (reqNewline) {
14167
+ str += ",";
14168
+ }
14169
+ }
14170
+ if (comment)
14171
+ str += stringifyComment.lineComment(str, itemIndent, commentString(comment));
14172
+ lines.push(str);
14107
14173
  linesAtValue = lines.length;
14108
14174
  }
14109
- let str;
14110
14175
  const { start, end } = flowChars;
14111
14176
  if (lines.length === 0) {
14112
- str = start + end;
14177
+ return start + end;
14113
14178
  } else {
14114
14179
  if (!reqNewline) {
14115
14180
  const len = lines.reduce((sum, line) => sum + line.length + 2, 2);
14116
- reqNewline = len > Collection2.Collection.maxFlowStringSingleLineLength;
14181
+ reqNewline = ctx.options.lineWidth > 0 && len > ctx.options.lineWidth;
14117
14182
  }
14118
14183
  if (reqNewline) {
14119
- str = start;
14184
+ let str = start;
14120
14185
  for (const line of lines)
14121
14186
  str += line ? `
14122
14187
  ${indentStep}${indent}${line}` : "\n";
14123
- str += `
14188
+ return `${str}
14124
14189
  ${indent}${end}`;
14125
14190
  } else {
14126
- str = `${start}${fcPadding}${lines.join(" ")}${fcPadding}${end}`;
14191
+ return `${start}${fcPadding}${lines.join(" ")}${fcPadding}${end}`;
14127
14192
  }
14128
14193
  }
14129
- if (comment) {
14130
- str += stringifyComment.lineComment(str, indent, commentString(comment));
14131
- if (onComment)
14132
- onComment();
14133
- }
14134
- return str;
14135
14194
  }
14136
14195
  function addCommentBefore({ indent, options: { commentString } }, lines, comment, chompKeep) {
14137
14196
  if (comment && chompKeep)
@@ -14145,9 +14204,9 @@ ${indent}${end}`;
14145
14204
  }
14146
14205
  });
14147
14206
 
14148
- // ../../node_modules/.pnpm/yaml@2.3.3/node_modules/yaml/dist/nodes/YAMLMap.js
14207
+ // ../../node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/nodes/YAMLMap.js
14149
14208
  var require_YAMLMap = __commonJS({
14150
- "../../node_modules/.pnpm/yaml@2.3.3/node_modules/yaml/dist/nodes/YAMLMap.js"(exports2) {
14209
+ "../../node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/nodes/YAMLMap.js"(exports2) {
14151
14210
  "use strict";
14152
14211
  var stringifyCollection = require_stringifyCollection();
14153
14212
  var addPairToJSMap = require_addPairToJSMap();
@@ -14289,9 +14348,9 @@ var require_YAMLMap = __commonJS({
14289
14348
  }
14290
14349
  });
14291
14350
 
14292
- // ../../node_modules/.pnpm/yaml@2.3.3/node_modules/yaml/dist/schema/common/map.js
14351
+ // ../../node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/schema/common/map.js
14293
14352
  var require_map = __commonJS({
14294
- "../../node_modules/.pnpm/yaml@2.3.3/node_modules/yaml/dist/schema/common/map.js"(exports2) {
14353
+ "../../node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/schema/common/map.js"(exports2) {
14295
14354
  "use strict";
14296
14355
  var identity = require_identity();
14297
14356
  var YAMLMap = require_YAMLMap();
@@ -14311,9 +14370,9 @@ var require_map = __commonJS({
14311
14370
  }
14312
14371
  });
14313
14372
 
14314
- // ../../node_modules/.pnpm/yaml@2.3.3/node_modules/yaml/dist/nodes/YAMLSeq.js
14373
+ // ../../node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/nodes/YAMLSeq.js
14315
14374
  var require_YAMLSeq = __commonJS({
14316
- "../../node_modules/.pnpm/yaml@2.3.3/node_modules/yaml/dist/nodes/YAMLSeq.js"(exports2) {
14375
+ "../../node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/nodes/YAMLSeq.js"(exports2) {
14317
14376
  "use strict";
14318
14377
  var createNode = require_createNode();
14319
14378
  var stringifyCollection = require_stringifyCollection();
@@ -14427,9 +14486,9 @@ var require_YAMLSeq = __commonJS({
14427
14486
  }
14428
14487
  });
14429
14488
 
14430
- // ../../node_modules/.pnpm/yaml@2.3.3/node_modules/yaml/dist/schema/common/seq.js
14489
+ // ../../node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/schema/common/seq.js
14431
14490
  var require_seq = __commonJS({
14432
- "../../node_modules/.pnpm/yaml@2.3.3/node_modules/yaml/dist/schema/common/seq.js"(exports2) {
14491
+ "../../node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/schema/common/seq.js"(exports2) {
14433
14492
  "use strict";
14434
14493
  var identity = require_identity();
14435
14494
  var YAMLSeq = require_YAMLSeq();
@@ -14449,9 +14508,9 @@ var require_seq = __commonJS({
14449
14508
  }
14450
14509
  });
14451
14510
 
14452
- // ../../node_modules/.pnpm/yaml@2.3.3/node_modules/yaml/dist/schema/common/string.js
14511
+ // ../../node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/schema/common/string.js
14453
14512
  var require_string = __commonJS({
14454
- "../../node_modules/.pnpm/yaml@2.3.3/node_modules/yaml/dist/schema/common/string.js"(exports2) {
14513
+ "../../node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/schema/common/string.js"(exports2) {
14455
14514
  "use strict";
14456
14515
  var stringifyString = require_stringifyString();
14457
14516
  var string2 = {
@@ -14468,9 +14527,9 @@ var require_string = __commonJS({
14468
14527
  }
14469
14528
  });
14470
14529
 
14471
- // ../../node_modules/.pnpm/yaml@2.3.3/node_modules/yaml/dist/schema/common/null.js
14530
+ // ../../node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/schema/common/null.js
14472
14531
  var require_null = __commonJS({
14473
- "../../node_modules/.pnpm/yaml@2.3.3/node_modules/yaml/dist/schema/common/null.js"(exports2) {
14532
+ "../../node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/schema/common/null.js"(exports2) {
14474
14533
  "use strict";
14475
14534
  var Scalar = require_Scalar();
14476
14535
  var nullTag = {
@@ -14486,9 +14545,9 @@ var require_null = __commonJS({
14486
14545
  }
14487
14546
  });
14488
14547
 
14489
- // ../../node_modules/.pnpm/yaml@2.3.3/node_modules/yaml/dist/schema/core/bool.js
14548
+ // ../../node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/schema/core/bool.js
14490
14549
  var require_bool = __commonJS({
14491
- "../../node_modules/.pnpm/yaml@2.3.3/node_modules/yaml/dist/schema/core/bool.js"(exports2) {
14550
+ "../../node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/schema/core/bool.js"(exports2) {
14492
14551
  "use strict";
14493
14552
  var Scalar = require_Scalar();
14494
14553
  var boolTag = {
@@ -14510,9 +14569,9 @@ var require_bool = __commonJS({
14510
14569
  }
14511
14570
  });
14512
14571
 
14513
- // ../../node_modules/.pnpm/yaml@2.3.3/node_modules/yaml/dist/stringify/stringifyNumber.js
14572
+ // ../../node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/stringify/stringifyNumber.js
14514
14573
  var require_stringifyNumber = __commonJS({
14515
- "../../node_modules/.pnpm/yaml@2.3.3/node_modules/yaml/dist/stringify/stringifyNumber.js"(exports2) {
14574
+ "../../node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/stringify/stringifyNumber.js"(exports2) {
14516
14575
  "use strict";
14517
14576
  function stringifyNumber({ format: format3, minFractionDigits, tag, value }) {
14518
14577
  if (typeof value === "bigint")
@@ -14520,7 +14579,7 @@ var require_stringifyNumber = __commonJS({
14520
14579
  const num = typeof value === "number" ? value : Number(value);
14521
14580
  if (!isFinite(num))
14522
14581
  return isNaN(num) ? ".nan" : num < 0 ? "-.inf" : ".inf";
14523
- let n = JSON.stringify(value);
14582
+ let n = Object.is(value, -0) ? "-0" : JSON.stringify(value);
14524
14583
  if (!format3 && minFractionDigits && (!tag || tag === "tag:yaml.org,2002:float") && /^\d/.test(n)) {
14525
14584
  let i = n.indexOf(".");
14526
14585
  if (i < 0) {
@@ -14537,9 +14596,9 @@ var require_stringifyNumber = __commonJS({
14537
14596
  }
14538
14597
  });
14539
14598
 
14540
- // ../../node_modules/.pnpm/yaml@2.3.3/node_modules/yaml/dist/schema/core/float.js
14599
+ // ../../node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/schema/core/float.js
14541
14600
  var require_float = __commonJS({
14542
- "../../node_modules/.pnpm/yaml@2.3.3/node_modules/yaml/dist/schema/core/float.js"(exports2) {
14601
+ "../../node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/schema/core/float.js"(exports2) {
14543
14602
  "use strict";
14544
14603
  var Scalar = require_Scalar();
14545
14604
  var stringifyNumber = require_stringifyNumber();
@@ -14547,7 +14606,7 @@ var require_float = __commonJS({
14547
14606
  identify: (value) => typeof value === "number",
14548
14607
  default: true,
14549
14608
  tag: "tag:yaml.org,2002:float",
14550
- test: /^(?:[-+]?\.(?:inf|Inf|INF|nan|NaN|NAN))$/,
14609
+ test: /^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,
14551
14610
  resolve: (str) => str.slice(-3).toLowerCase() === "nan" ? NaN : str[0] === "-" ? Number.NEGATIVE_INFINITY : Number.POSITIVE_INFINITY,
14552
14611
  stringify: stringifyNumber.stringifyNumber
14553
14612
  };
@@ -14583,9 +14642,9 @@ var require_float = __commonJS({
14583
14642
  }
14584
14643
  });
14585
14644
 
14586
- // ../../node_modules/.pnpm/yaml@2.3.3/node_modules/yaml/dist/schema/core/int.js
14645
+ // ../../node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/schema/core/int.js
14587
14646
  var require_int = __commonJS({
14588
- "../../node_modules/.pnpm/yaml@2.3.3/node_modules/yaml/dist/schema/core/int.js"(exports2) {
14647
+ "../../node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/schema/core/int.js"(exports2) {
14589
14648
  "use strict";
14590
14649
  var stringifyNumber = require_stringifyNumber();
14591
14650
  var intIdentify = (value) => typeof value === "bigint" || Number.isInteger(value);
@@ -14628,9 +14687,9 @@ var require_int = __commonJS({
14628
14687
  }
14629
14688
  });
14630
14689
 
14631
- // ../../node_modules/.pnpm/yaml@2.3.3/node_modules/yaml/dist/schema/core/schema.js
14690
+ // ../../node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/schema/core/schema.js
14632
14691
  var require_schema = __commonJS({
14633
- "../../node_modules/.pnpm/yaml@2.3.3/node_modules/yaml/dist/schema/core/schema.js"(exports2) {
14692
+ "../../node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/schema/core/schema.js"(exports2) {
14634
14693
  "use strict";
14635
14694
  var map = require_map();
14636
14695
  var _null = require_null();
@@ -14656,9 +14715,9 @@ var require_schema = __commonJS({
14656
14715
  }
14657
14716
  });
14658
14717
 
14659
- // ../../node_modules/.pnpm/yaml@2.3.3/node_modules/yaml/dist/schema/json/schema.js
14718
+ // ../../node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/schema/json/schema.js
14660
14719
  var require_schema2 = __commonJS({
14661
- "../../node_modules/.pnpm/yaml@2.3.3/node_modules/yaml/dist/schema/json/schema.js"(exports2) {
14720
+ "../../node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/schema/json/schema.js"(exports2) {
14662
14721
  "use strict";
14663
14722
  var Scalar = require_Scalar();
14664
14723
  var map = require_map();
@@ -14688,7 +14747,7 @@ var require_schema2 = __commonJS({
14688
14747
  identify: (value) => typeof value === "boolean",
14689
14748
  default: true,
14690
14749
  tag: "tag:yaml.org,2002:bool",
14691
- test: /^true|false$/,
14750
+ test: /^true$|^false$/,
14692
14751
  resolve: (str) => str === "true",
14693
14752
  stringify: stringifyJSON
14694
14753
  },
@@ -14723,14 +14782,16 @@ var require_schema2 = __commonJS({
14723
14782
  }
14724
14783
  });
14725
14784
 
14726
- // ../../node_modules/.pnpm/yaml@2.3.3/node_modules/yaml/dist/schema/yaml-1.1/binary.js
14785
+ // ../../node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/schema/yaml-1.1/binary.js
14727
14786
  var require_binary = __commonJS({
14728
- "../../node_modules/.pnpm/yaml@2.3.3/node_modules/yaml/dist/schema/yaml-1.1/binary.js"(exports2) {
14787
+ "../../node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/schema/yaml-1.1/binary.js"(exports2) {
14729
14788
  "use strict";
14789
+ var node_buffer = require("buffer");
14730
14790
  var Scalar = require_Scalar();
14731
14791
  var stringifyString = require_stringifyString();
14732
14792
  var binary = {
14733
14793
  identify: (value) => value instanceof Uint8Array,
14794
+ // Buffer inherits from Uint8Array
14734
14795
  default: false,
14735
14796
  tag: "tag:yaml.org,2002:binary",
14736
14797
  /**
@@ -14742,8 +14803,8 @@ var require_binary = __commonJS({
14742
14803
  * document.querySelector('#photo').src = URL.createObjectURL(blob)
14743
14804
  */
14744
14805
  resolve(src, onError2) {
14745
- if (typeof Buffer === "function") {
14746
- return Buffer.from(src, "base64");
14806
+ if (typeof node_buffer.Buffer === "function") {
14807
+ return node_buffer.Buffer.from(src, "base64");
14747
14808
  } else if (typeof atob === "function") {
14748
14809
  const str = atob(src.replace(/[\n\r]/g, ""));
14749
14810
  const buffer = new Uint8Array(str.length);
@@ -14756,10 +14817,12 @@ var require_binary = __commonJS({
14756
14817
  }
14757
14818
  },
14758
14819
  stringify({ comment, type, value }, ctx, onComment, onChompKeep) {
14820
+ if (!value)
14821
+ return "";
14759
14822
  const buf = value;
14760
14823
  let str;
14761
- if (typeof Buffer === "function") {
14762
- str = buf instanceof Buffer ? buf.toString("base64") : Buffer.from(buf.buffer).toString("base64");
14824
+ if (typeof node_buffer.Buffer === "function") {
14825
+ str = buf instanceof node_buffer.Buffer ? buf.toString("base64") : node_buffer.Buffer.from(buf.buffer).toString("base64");
14763
14826
  } else if (typeof btoa === "function") {
14764
14827
  let s = "";
14765
14828
  for (let i = 0; i < buf.length; ++i)
@@ -14768,8 +14831,7 @@ var require_binary = __commonJS({
14768
14831
  } else {
14769
14832
  throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");
14770
14833
  }
14771
- if (!type)
14772
- type = Scalar.Scalar.BLOCK_LITERAL;
14834
+ type ?? (type = Scalar.Scalar.BLOCK_LITERAL);
14773
14835
  if (type !== Scalar.Scalar.QUOTE_DOUBLE) {
14774
14836
  const lineWidth = Math.max(ctx.options.lineWidth - ctx.indent.length, ctx.options.minContentWidth);
14775
14837
  const n = Math.ceil(str.length / lineWidth);
@@ -14786,9 +14848,9 @@ var require_binary = __commonJS({
14786
14848
  }
14787
14849
  });
14788
14850
 
14789
- // ../../node_modules/.pnpm/yaml@2.3.3/node_modules/yaml/dist/schema/yaml-1.1/pairs.js
14851
+ // ../../node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/schema/yaml-1.1/pairs.js
14790
14852
  var require_pairs = __commonJS({
14791
- "../../node_modules/.pnpm/yaml@2.3.3/node_modules/yaml/dist/schema/yaml-1.1/pairs.js"(exports2) {
14853
+ "../../node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/schema/yaml-1.1/pairs.js"(exports2) {
14792
14854
  "use strict";
14793
14855
  var identity = require_identity();
14794
14856
  var Pair = require_Pair();
@@ -14864,9 +14926,9 @@ ${cn.comment}` : item.comment;
14864
14926
  }
14865
14927
  });
14866
14928
 
14867
- // ../../node_modules/.pnpm/yaml@2.3.3/node_modules/yaml/dist/schema/yaml-1.1/omap.js
14929
+ // ../../node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/schema/yaml-1.1/omap.js
14868
14930
  var require_omap = __commonJS({
14869
- "../../node_modules/.pnpm/yaml@2.3.3/node_modules/yaml/dist/schema/yaml-1.1/omap.js"(exports2) {
14931
+ "../../node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/schema/yaml-1.1/omap.js"(exports2) {
14870
14932
  "use strict";
14871
14933
  var identity = require_identity();
14872
14934
  var toJS = require_toJS();
@@ -14942,9 +15004,9 @@ var require_omap = __commonJS({
14942
15004
  }
14943
15005
  });
14944
15006
 
14945
- // ../../node_modules/.pnpm/yaml@2.3.3/node_modules/yaml/dist/schema/yaml-1.1/bool.js
15007
+ // ../../node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/schema/yaml-1.1/bool.js
14946
15008
  var require_bool2 = __commonJS({
14947
- "../../node_modules/.pnpm/yaml@2.3.3/node_modules/yaml/dist/schema/yaml-1.1/bool.js"(exports2) {
15009
+ "../../node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/schema/yaml-1.1/bool.js"(exports2) {
14948
15010
  "use strict";
14949
15011
  var Scalar = require_Scalar();
14950
15012
  function boolStringify({ value, source }, ctx) {
@@ -14965,7 +15027,7 @@ var require_bool2 = __commonJS({
14965
15027
  identify: (value) => value === false,
14966
15028
  default: true,
14967
15029
  tag: "tag:yaml.org,2002:bool",
14968
- test: /^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/i,
15030
+ test: /^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,
14969
15031
  resolve: () => new Scalar.Scalar(false),
14970
15032
  stringify: boolStringify
14971
15033
  };
@@ -14974,9 +15036,9 @@ var require_bool2 = __commonJS({
14974
15036
  }
14975
15037
  });
14976
15038
 
14977
- // ../../node_modules/.pnpm/yaml@2.3.3/node_modules/yaml/dist/schema/yaml-1.1/float.js
15039
+ // ../../node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/schema/yaml-1.1/float.js
14978
15040
  var require_float2 = __commonJS({
14979
- "../../node_modules/.pnpm/yaml@2.3.3/node_modules/yaml/dist/schema/yaml-1.1/float.js"(exports2) {
15041
+ "../../node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/schema/yaml-1.1/float.js"(exports2) {
14980
15042
  "use strict";
14981
15043
  var Scalar = require_Scalar();
14982
15044
  var stringifyNumber = require_stringifyNumber();
@@ -14984,7 +15046,7 @@ var require_float2 = __commonJS({
14984
15046
  identify: (value) => typeof value === "number",
14985
15047
  default: true,
14986
15048
  tag: "tag:yaml.org,2002:float",
14987
- test: /^[-+]?\.(?:inf|Inf|INF|nan|NaN|NAN)$/,
15049
+ test: /^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,
14988
15050
  resolve: (str) => str.slice(-3).toLowerCase() === "nan" ? NaN : str[0] === "-" ? Number.NEGATIVE_INFINITY : Number.POSITIVE_INFINITY,
14989
15051
  stringify: stringifyNumber.stringifyNumber
14990
15052
  };
@@ -15023,9 +15085,9 @@ var require_float2 = __commonJS({
15023
15085
  }
15024
15086
  });
15025
15087
 
15026
- // ../../node_modules/.pnpm/yaml@2.3.3/node_modules/yaml/dist/schema/yaml-1.1/int.js
15088
+ // ../../node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/schema/yaml-1.1/int.js
15027
15089
  var require_int2 = __commonJS({
15028
- "../../node_modules/.pnpm/yaml@2.3.3/node_modules/yaml/dist/schema/yaml-1.1/int.js"(exports2) {
15090
+ "../../node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/schema/yaml-1.1/int.js"(exports2) {
15029
15091
  "use strict";
15030
15092
  var stringifyNumber = require_stringifyNumber();
15031
15093
  var intIdentify = (value) => typeof value === "bigint" || Number.isInteger(value);
@@ -15102,9 +15164,9 @@ var require_int2 = __commonJS({
15102
15164
  }
15103
15165
  });
15104
15166
 
15105
- // ../../node_modules/.pnpm/yaml@2.3.3/node_modules/yaml/dist/schema/yaml-1.1/set.js
15167
+ // ../../node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/schema/yaml-1.1/set.js
15106
15168
  var require_set = __commonJS({
15107
- "../../node_modules/.pnpm/yaml@2.3.3/node_modules/yaml/dist/schema/yaml-1.1/set.js"(exports2) {
15169
+ "../../node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/schema/yaml-1.1/set.js"(exports2) {
15108
15170
  "use strict";
15109
15171
  var identity = require_identity();
15110
15172
  var Pair = require_Pair();
@@ -15191,9 +15253,9 @@ var require_set = __commonJS({
15191
15253
  }
15192
15254
  });
15193
15255
 
15194
- // ../../node_modules/.pnpm/yaml@2.3.3/node_modules/yaml/dist/schema/yaml-1.1/timestamp.js
15256
+ // ../../node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/schema/yaml-1.1/timestamp.js
15195
15257
  var require_timestamp = __commonJS({
15196
- "../../node_modules/.pnpm/yaml@2.3.3/node_modules/yaml/dist/schema/yaml-1.1/timestamp.js"(exports2) {
15258
+ "../../node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/schema/yaml-1.1/timestamp.js"(exports2) {
15197
15259
  "use strict";
15198
15260
  var stringifyNumber = require_stringifyNumber();
15199
15261
  function parseSexagesimal(str, asBigInt) {
@@ -15271,7 +15333,7 @@ var require_timestamp = __commonJS({
15271
15333
  }
15272
15334
  return new Date(date2);
15273
15335
  },
15274
- stringify: ({ value }) => value.toISOString().replace(/((T00:00)?:00)?\.000Z$/, "")
15336
+ stringify: ({ value }) => value?.toISOString().replace(/(T00:00:00)?\.000Z$/, "") ?? ""
15275
15337
  };
15276
15338
  exports2.floatTime = floatTime;
15277
15339
  exports2.intTime = intTime;
@@ -15279,9 +15341,9 @@ var require_timestamp = __commonJS({
15279
15341
  }
15280
15342
  });
15281
15343
 
15282
- // ../../node_modules/.pnpm/yaml@2.3.3/node_modules/yaml/dist/schema/yaml-1.1/schema.js
15344
+ // ../../node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/schema/yaml-1.1/schema.js
15283
15345
  var require_schema3 = __commonJS({
15284
- "../../node_modules/.pnpm/yaml@2.3.3/node_modules/yaml/dist/schema/yaml-1.1/schema.js"(exports2) {
15346
+ "../../node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/schema/yaml-1.1/schema.js"(exports2) {
15285
15347
  "use strict";
15286
15348
  var map = require_map();
15287
15349
  var _null = require_null();
@@ -15291,6 +15353,7 @@ var require_schema3 = __commonJS({
15291
15353
  var bool = require_bool2();
15292
15354
  var float = require_float2();
15293
15355
  var int = require_int2();
15356
+ var merge2 = require_merge();
15294
15357
  var omap = require_omap();
15295
15358
  var pairs = require_pairs();
15296
15359
  var set2 = require_set();
@@ -15310,6 +15373,7 @@ var require_schema3 = __commonJS({
15310
15373
  float.floatExp,
15311
15374
  float.float,
15312
15375
  binary.binary,
15376
+ merge2.merge,
15313
15377
  omap.omap,
15314
15378
  pairs.pairs,
15315
15379
  set2.set,
@@ -15321,9 +15385,9 @@ var require_schema3 = __commonJS({
15321
15385
  }
15322
15386
  });
15323
15387
 
15324
- // ../../node_modules/.pnpm/yaml@2.3.3/node_modules/yaml/dist/schema/tags.js
15388
+ // ../../node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/schema/tags.js
15325
15389
  var require_tags = __commonJS({
15326
- "../../node_modules/.pnpm/yaml@2.3.3/node_modules/yaml/dist/schema/tags.js"(exports2) {
15390
+ "../../node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/schema/tags.js"(exports2) {
15327
15391
  "use strict";
15328
15392
  var map = require_map();
15329
15393
  var _null = require_null();
@@ -15335,6 +15399,7 @@ var require_tags = __commonJS({
15335
15399
  var schema = require_schema();
15336
15400
  var schema$1 = require_schema2();
15337
15401
  var binary = require_binary();
15402
+ var merge2 = require_merge();
15338
15403
  var omap = require_omap();
15339
15404
  var pairs = require_pairs();
15340
15405
  var schema$2 = require_schema3();
@@ -15359,6 +15424,7 @@ var require_tags = __commonJS({
15359
15424
  intOct: int.intOct,
15360
15425
  intTime: timestamp.intTime,
15361
15426
  map: map.map,
15427
+ merge: merge2.merge,
15362
15428
  null: _null.nullTag,
15363
15429
  omap: omap.omap,
15364
15430
  pairs: pairs.pairs,
@@ -15368,13 +15434,18 @@ var require_tags = __commonJS({
15368
15434
  };
15369
15435
  var coreKnownTags = {
15370
15436
  "tag:yaml.org,2002:binary": binary.binary,
15437
+ "tag:yaml.org,2002:merge": merge2.merge,
15371
15438
  "tag:yaml.org,2002:omap": omap.omap,
15372
15439
  "tag:yaml.org,2002:pairs": pairs.pairs,
15373
15440
  "tag:yaml.org,2002:set": set2.set,
15374
15441
  "tag:yaml.org,2002:timestamp": timestamp.timestamp
15375
15442
  };
15376
- function getTags(customTags, schemaName) {
15377
- let tags = schemas.get(schemaName);
15443
+ function getTags(customTags, schemaName, addMergeTag) {
15444
+ const schemaTags = schemas.get(schemaName);
15445
+ if (schemaTags && !customTags) {
15446
+ return addMergeTag && !schemaTags.includes(merge2.merge) ? schemaTags.concat(merge2.merge) : schemaTags.slice();
15447
+ }
15448
+ let tags = schemaTags;
15378
15449
  if (!tags) {
15379
15450
  if (Array.isArray(customTags))
15380
15451
  tags = [];
@@ -15389,24 +15460,28 @@ var require_tags = __commonJS({
15389
15460
  } else if (typeof customTags === "function") {
15390
15461
  tags = customTags(tags.slice());
15391
15462
  }
15392
- return tags.map((tag) => {
15393
- if (typeof tag !== "string")
15394
- return tag;
15395
- const tagObj = tagsByName[tag];
15396
- if (tagObj)
15397
- return tagObj;
15398
- const keys2 = Object.keys(tagsByName).map((key) => JSON.stringify(key)).join(", ");
15399
- throw new Error(`Unknown custom tag "${tag}"; use one of ${keys2}`);
15400
- });
15463
+ if (addMergeTag)
15464
+ tags = tags.concat(merge2.merge);
15465
+ return tags.reduce((tags2, tag) => {
15466
+ const tagObj = typeof tag === "string" ? tagsByName[tag] : tag;
15467
+ if (!tagObj) {
15468
+ const tagName = JSON.stringify(tag);
15469
+ const keys2 = Object.keys(tagsByName).map((key) => JSON.stringify(key)).join(", ");
15470
+ throw new Error(`Unknown custom tag ${tagName}; use one of ${keys2}`);
15471
+ }
15472
+ if (!tags2.includes(tagObj))
15473
+ tags2.push(tagObj);
15474
+ return tags2;
15475
+ }, []);
15401
15476
  }
15402
15477
  exports2.coreKnownTags = coreKnownTags;
15403
15478
  exports2.getTags = getTags;
15404
15479
  }
15405
15480
  });
15406
15481
 
15407
- // ../../node_modules/.pnpm/yaml@2.3.3/node_modules/yaml/dist/schema/Schema.js
15482
+ // ../../node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/schema/Schema.js
15408
15483
  var require_Schema = __commonJS({
15409
- "../../node_modules/.pnpm/yaml@2.3.3/node_modules/yaml/dist/schema/Schema.js"(exports2) {
15484
+ "../../node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/schema/Schema.js"(exports2) {
15410
15485
  "use strict";
15411
15486
  var identity = require_identity();
15412
15487
  var map = require_map();
@@ -15417,10 +15492,9 @@ var require_Schema = __commonJS({
15417
15492
  var Schema = class _Schema {
15418
15493
  constructor({ compat, customTags, merge: merge2, resolveKnownTags, schema, sortMapEntries, toStringDefaults }) {
15419
15494
  this.compat = Array.isArray(compat) ? tags.getTags(compat, "compat") : compat ? tags.getTags(null, compat) : null;
15420
- this.merge = !!merge2;
15421
15495
  this.name = typeof schema === "string" && schema || "core";
15422
15496
  this.knownTags = resolveKnownTags ? tags.coreKnownTags : {};
15423
- this.tags = tags.getTags(customTags, this.name);
15497
+ this.tags = tags.getTags(customTags, this.name, merge2);
15424
15498
  this.toStringOptions = toStringDefaults ?? null;
15425
15499
  Object.defineProperty(this, identity.MAP, { value: map.map });
15426
15500
  Object.defineProperty(this, identity.SCALAR, { value: string2.string });
@@ -15437,9 +15511,9 @@ var require_Schema = __commonJS({
15437
15511
  }
15438
15512
  });
15439
15513
 
15440
- // ../../node_modules/.pnpm/yaml@2.3.3/node_modules/yaml/dist/stringify/stringifyDocument.js
15514
+ // ../../node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/stringify/stringifyDocument.js
15441
15515
  var require_stringifyDocument = __commonJS({
15442
- "../../node_modules/.pnpm/yaml@2.3.3/node_modules/yaml/dist/stringify/stringifyDocument.js"(exports2) {
15516
+ "../../node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/stringify/stringifyDocument.js"(exports2) {
15443
15517
  "use strict";
15444
15518
  var identity = require_identity();
15445
15519
  var stringify3 = require_stringify();
@@ -15517,9 +15591,9 @@ var require_stringifyDocument = __commonJS({
15517
15591
  }
15518
15592
  });
15519
15593
 
15520
- // ../../node_modules/.pnpm/yaml@2.3.3/node_modules/yaml/dist/doc/Document.js
15594
+ // ../../node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/doc/Document.js
15521
15595
  var require_Document = __commonJS({
15522
- "../../node_modules/.pnpm/yaml@2.3.3/node_modules/yaml/dist/doc/Document.js"(exports2) {
15596
+ "../../node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/doc/Document.js"(exports2) {
15523
15597
  "use strict";
15524
15598
  var Alias = require_Alias();
15525
15599
  var Collection2 = require_Collection();
@@ -15552,6 +15626,7 @@ var require_Document = __commonJS({
15552
15626
  logLevel: "warn",
15553
15627
  prettyErrors: true,
15554
15628
  strict: true,
15629
+ stringKeys: false,
15555
15630
  uniqueKeys: true,
15556
15631
  version: "1.2"
15557
15632
  }, options);
@@ -15753,7 +15828,7 @@ var require_Document = __commonJS({
15753
15828
  this.directives.yaml.version = "1.1";
15754
15829
  else
15755
15830
  this.directives = new directives.Directives({ version: "1.1" });
15756
- opt = { merge: true, resolveKnownTags: false, schema: "yaml-1.1" };
15831
+ opt = { resolveKnownTags: false, schema: "yaml-1.1" };
15757
15832
  break;
15758
15833
  case "1.2":
15759
15834
  case "next":
@@ -15761,7 +15836,7 @@ var require_Document = __commonJS({
15761
15836
  this.directives.yaml.version = version;
15762
15837
  else
15763
15838
  this.directives = new directives.Directives({ version });
15764
- opt = { merge: false, resolveKnownTags: true, schema: "core" };
15839
+ opt = { resolveKnownTags: true, schema: "core" };
15765
15840
  break;
15766
15841
  case null:
15767
15842
  if (this.directives)
@@ -15825,9 +15900,9 @@ var require_Document = __commonJS({
15825
15900
  }
15826
15901
  });
15827
15902
 
15828
- // ../../node_modules/.pnpm/yaml@2.3.3/node_modules/yaml/dist/errors.js
15903
+ // ../../node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/errors.js
15829
15904
  var require_errors = __commonJS({
15830
- "../../node_modules/.pnpm/yaml@2.3.3/node_modules/yaml/dist/errors.js"(exports2) {
15905
+ "../../node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/errors.js"(exports2) {
15831
15906
  "use strict";
15832
15907
  var YAMLError = class extends Error {
15833
15908
  constructor(name, pos, code, message) {
@@ -15872,7 +15947,7 @@ var require_errors = __commonJS({
15872
15947
  if (/[^ ]/.test(lineStr)) {
15873
15948
  let count = 1;
15874
15949
  const end = error.linePos[1];
15875
- if (end && end.line === line && end.col > col) {
15950
+ if (end?.line === line && end.col > col) {
15876
15951
  count = Math.max(1, Math.min(end.col - col, 80 - ci));
15877
15952
  }
15878
15953
  const pointer = " ".repeat(ci) + "^".repeat(count);
@@ -15890,21 +15965,22 @@ ${pointer}
15890
15965
  }
15891
15966
  });
15892
15967
 
15893
- // ../../node_modules/.pnpm/yaml@2.3.3/node_modules/yaml/dist/compose/resolve-props.js
15968
+ // ../../node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/compose/resolve-props.js
15894
15969
  var require_resolve_props = __commonJS({
15895
- "../../node_modules/.pnpm/yaml@2.3.3/node_modules/yaml/dist/compose/resolve-props.js"(exports2) {
15970
+ "../../node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/compose/resolve-props.js"(exports2) {
15896
15971
  "use strict";
15897
- function resolveProps(tokens, { flow, indicator, next, offset, onError: onError2, startOnNewline }) {
15972
+ function resolveProps(tokens, { flow, indicator, next, offset, onError: onError2, parentIndent, startOnNewline }) {
15898
15973
  let spaceBefore = false;
15899
15974
  let atNewline = startOnNewline;
15900
15975
  let hasSpace = startOnNewline;
15901
15976
  let comment = "";
15902
15977
  let commentSep = "";
15903
15978
  let hasNewline = false;
15904
- let hasNewlineAfterProp = false;
15905
15979
  let reqSpace = false;
15980
+ let tab = null;
15906
15981
  let anchor = null;
15907
15982
  let tag = null;
15983
+ let newlineAfterProp = null;
15908
15984
  let comma = null;
15909
15985
  let found = null;
15910
15986
  let start = null;
@@ -15914,10 +15990,17 @@ var require_resolve_props = __commonJS({
15914
15990
  onError2(token.offset, "MISSING_CHAR", "Tags and anchors must be separated from the next token by white space");
15915
15991
  reqSpace = false;
15916
15992
  }
15993
+ if (tab) {
15994
+ if (atNewline && token.type !== "comment" && token.type !== "newline") {
15995
+ onError2(tab, "TAB_AS_INDENT", "Tabs are not allowed as indentation");
15996
+ }
15997
+ tab = null;
15998
+ }
15917
15999
  switch (token.type) {
15918
16000
  case "space":
15919
- if (!flow && atNewline && indicator !== "doc-start" && token.source[0] === " ")
15920
- onError2(token, "TAB_AS_INDENT", "Tabs are not allowed as indentation");
16001
+ if (!flow && (indicator !== "doc-start" || next?.type !== "flow-collection") && token.source.includes(" ")) {
16002
+ tab = token;
16003
+ }
15921
16004
  hasSpace = true;
15922
16005
  break;
15923
16006
  case "comment": {
@@ -15936,14 +16019,14 @@ var require_resolve_props = __commonJS({
15936
16019
  if (atNewline) {
15937
16020
  if (comment)
15938
16021
  comment += token.source;
15939
- else
16022
+ else if (!found || indicator !== "seq-item-ind")
15940
16023
  spaceBefore = true;
15941
16024
  } else
15942
16025
  commentSep += token.source;
15943
16026
  atNewline = true;
15944
16027
  hasNewline = true;
15945
16028
  if (anchor || tag)
15946
- hasNewlineAfterProp = true;
16029
+ newlineAfterProp = token;
15947
16030
  hasSpace = true;
15948
16031
  break;
15949
16032
  case "anchor":
@@ -15952,8 +16035,7 @@ var require_resolve_props = __commonJS({
15952
16035
  if (token.source.endsWith(":"))
15953
16036
  onError2(token.offset + token.source.length - 1, "BAD_ALIAS", "Anchor ending in : is ambiguous", true);
15954
16037
  anchor = token;
15955
- if (start === null)
15956
- start = token.offset;
16038
+ start ?? (start = token.offset);
15957
16039
  atNewline = false;
15958
16040
  hasSpace = false;
15959
16041
  reqSpace = true;
@@ -15962,8 +16044,7 @@ var require_resolve_props = __commonJS({
15962
16044
  if (tag)
15963
16045
  onError2(token, "MULTIPLE_TAGS", "A node can have at most one tag");
15964
16046
  tag = token;
15965
- if (start === null)
15966
- start = token.offset;
16047
+ start ?? (start = token.offset);
15967
16048
  atNewline = false;
15968
16049
  hasSpace = false;
15969
16050
  reqSpace = true;
@@ -15975,7 +16056,7 @@ var require_resolve_props = __commonJS({
15975
16056
  if (found)
15976
16057
  onError2(token, "UNEXPECTED_TOKEN", `Unexpected ${token.source} in ${flow ?? "collection"}`);
15977
16058
  found = token;
15978
- atNewline = false;
16059
+ atNewline = indicator === "seq-item-ind" || indicator === "explicit-key-ind";
15979
16060
  hasSpace = false;
15980
16061
  break;
15981
16062
  case "comma":
@@ -15996,17 +16077,20 @@ var require_resolve_props = __commonJS({
15996
16077
  }
15997
16078
  const last2 = tokens[tokens.length - 1];
15998
16079
  const end = last2 ? last2.offset + last2.source.length : offset;
15999
- if (reqSpace && next && next.type !== "space" && next.type !== "newline" && next.type !== "comma" && (next.type !== "scalar" || next.source !== ""))
16080
+ if (reqSpace && next && next.type !== "space" && next.type !== "newline" && next.type !== "comma" && (next.type !== "scalar" || next.source !== "")) {
16000
16081
  onError2(next.offset, "MISSING_CHAR", "Tags and anchors must be separated from the next token by white space");
16082
+ }
16083
+ if (tab && (atNewline && tab.indent <= parentIndent || next?.type === "block-map" || next?.type === "block-seq"))
16084
+ onError2(tab, "TAB_AS_INDENT", "Tabs are not allowed as indentation");
16001
16085
  return {
16002
16086
  comma,
16003
16087
  found,
16004
16088
  spaceBefore,
16005
16089
  comment,
16006
16090
  hasNewline,
16007
- hasNewlineAfterProp,
16008
16091
  anchor,
16009
16092
  tag,
16093
+ newlineAfterProp,
16010
16094
  end,
16011
16095
  start: start ?? end
16012
16096
  };
@@ -16015,9 +16099,9 @@ var require_resolve_props = __commonJS({
16015
16099
  }
16016
16100
  });
16017
16101
 
16018
- // ../../node_modules/.pnpm/yaml@2.3.3/node_modules/yaml/dist/compose/util-contains-newline.js
16102
+ // ../../node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/compose/util-contains-newline.js
16019
16103
  var require_util_contains_newline = __commonJS({
16020
- "../../node_modules/.pnpm/yaml@2.3.3/node_modules/yaml/dist/compose/util-contains-newline.js"(exports2) {
16104
+ "../../node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/compose/util-contains-newline.js"(exports2) {
16021
16105
  "use strict";
16022
16106
  function containsNewline(key) {
16023
16107
  if (!key)
@@ -16057,9 +16141,9 @@ var require_util_contains_newline = __commonJS({
16057
16141
  }
16058
16142
  });
16059
16143
 
16060
- // ../../node_modules/.pnpm/yaml@2.3.3/node_modules/yaml/dist/compose/util-flow-indent-check.js
16144
+ // ../../node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/compose/util-flow-indent-check.js
16061
16145
  var require_util_flow_indent_check = __commonJS({
16062
- "../../node_modules/.pnpm/yaml@2.3.3/node_modules/yaml/dist/compose/util-flow-indent-check.js"(exports2) {
16146
+ "../../node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/compose/util-flow-indent-check.js"(exports2) {
16063
16147
  "use strict";
16064
16148
  var utilContainsNewline = require_util_contains_newline();
16065
16149
  function flowIndentCheck(indent, fc, onError2) {
@@ -16075,25 +16159,25 @@ var require_util_flow_indent_check = __commonJS({
16075
16159
  }
16076
16160
  });
16077
16161
 
16078
- // ../../node_modules/.pnpm/yaml@2.3.3/node_modules/yaml/dist/compose/util-map-includes.js
16162
+ // ../../node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/compose/util-map-includes.js
16079
16163
  var require_util_map_includes = __commonJS({
16080
- "../../node_modules/.pnpm/yaml@2.3.3/node_modules/yaml/dist/compose/util-map-includes.js"(exports2) {
16164
+ "../../node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/compose/util-map-includes.js"(exports2) {
16081
16165
  "use strict";
16082
16166
  var identity = require_identity();
16083
16167
  function mapIncludes(ctx, items, search) {
16084
16168
  const { uniqueKeys } = ctx.options;
16085
16169
  if (uniqueKeys === false)
16086
16170
  return false;
16087
- const isEqual = typeof uniqueKeys === "function" ? uniqueKeys : (a, b) => a === b || identity.isScalar(a) && identity.isScalar(b) && a.value === b.value && !(a.value === "<<" && ctx.schema.merge);
16171
+ const isEqual = typeof uniqueKeys === "function" ? uniqueKeys : (a, b) => a === b || identity.isScalar(a) && identity.isScalar(b) && a.value === b.value;
16088
16172
  return items.some((pair) => isEqual(pair.key, search));
16089
16173
  }
16090
16174
  exports2.mapIncludes = mapIncludes;
16091
16175
  }
16092
16176
  });
16093
16177
 
16094
- // ../../node_modules/.pnpm/yaml@2.3.3/node_modules/yaml/dist/compose/resolve-block-map.js
16178
+ // ../../node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/compose/resolve-block-map.js
16095
16179
  var require_resolve_block_map = __commonJS({
16096
- "../../node_modules/.pnpm/yaml@2.3.3/node_modules/yaml/dist/compose/resolve-block-map.js"(exports2) {
16180
+ "../../node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/compose/resolve-block-map.js"(exports2) {
16097
16181
  "use strict";
16098
16182
  var Pair = require_Pair();
16099
16183
  var YAMLMap = require_YAMLMap();
@@ -16116,6 +16200,7 @@ var require_resolve_block_map = __commonJS({
16116
16200
  next: key ?? sep3?.[0],
16117
16201
  offset,
16118
16202
  onError: onError2,
16203
+ parentIndent: bm.indent,
16119
16204
  startOnNewline: true
16120
16205
  });
16121
16206
  const implicitKey = !keyProps.found;
@@ -16136,16 +16221,18 @@ var require_resolve_block_map = __commonJS({
16136
16221
  }
16137
16222
  continue;
16138
16223
  }
16139
- if (keyProps.hasNewlineAfterProp || utilContainsNewline.containsNewline(key)) {
16224
+ if (keyProps.newlineAfterProp || utilContainsNewline.containsNewline(key)) {
16140
16225
  onError2(key ?? start[start.length - 1], "MULTILINE_IMPLICIT_KEY", "Implicit keys need to be on a single line");
16141
16226
  }
16142
16227
  } else if (keyProps.found?.indent !== bm.indent) {
16143
16228
  onError2(offset, "BAD_INDENT", startColMsg);
16144
16229
  }
16230
+ ctx.atKey = true;
16145
16231
  const keyStart = keyProps.end;
16146
16232
  const keyNode = key ? composeNode(ctx, key, keyProps, onError2) : composeEmptyNode(ctx, keyStart, start, null, keyProps, onError2);
16147
16233
  if (ctx.schema.compat)
16148
16234
  utilFlowIndentCheck.flowIndentCheck(bm.indent, key, onError2);
16235
+ ctx.atKey = false;
16149
16236
  if (utilMapIncludes.mapIncludes(ctx, map.items, keyNode))
16150
16237
  onError2(keyStart, "DUPLICATE_KEY", "Map keys must be unique");
16151
16238
  const valueProps = resolveProps.resolveProps(sep3 ?? [], {
@@ -16153,6 +16240,7 @@ var require_resolve_block_map = __commonJS({
16153
16240
  next: value,
16154
16241
  offset: keyNode.range[2],
16155
16242
  onError: onError2,
16243
+ parentIndent: bm.indent,
16156
16244
  startOnNewline: !key || key.type === "block-scalar"
16157
16245
  });
16158
16246
  offset = valueProps.end;
@@ -16195,9 +16283,9 @@ var require_resolve_block_map = __commonJS({
16195
16283
  }
16196
16284
  });
16197
16285
 
16198
- // ../../node_modules/.pnpm/yaml@2.3.3/node_modules/yaml/dist/compose/resolve-block-seq.js
16286
+ // ../../node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/compose/resolve-block-seq.js
16199
16287
  var require_resolve_block_seq = __commonJS({
16200
- "../../node_modules/.pnpm/yaml@2.3.3/node_modules/yaml/dist/compose/resolve-block-seq.js"(exports2) {
16288
+ "../../node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/compose/resolve-block-seq.js"(exports2) {
16201
16289
  "use strict";
16202
16290
  var YAMLSeq = require_YAMLSeq();
16203
16291
  var resolveProps = require_resolve_props();
@@ -16207,6 +16295,8 @@ var require_resolve_block_seq = __commonJS({
16207
16295
  const seq = new NodeClass(ctx.schema);
16208
16296
  if (ctx.atRoot)
16209
16297
  ctx.atRoot = false;
16298
+ if (ctx.atKey)
16299
+ ctx.atKey = false;
16210
16300
  let offset = bs.offset;
16211
16301
  let commentEnd = null;
16212
16302
  for (const { start, value } of bs.items) {
@@ -16215,11 +16305,12 @@ var require_resolve_block_seq = __commonJS({
16215
16305
  next: value,
16216
16306
  offset,
16217
16307
  onError: onError2,
16308
+ parentIndent: bs.indent,
16218
16309
  startOnNewline: true
16219
16310
  });
16220
16311
  if (!props.found) {
16221
16312
  if (props.anchor || props.tag || value) {
16222
- if (value && value.type === "block-seq")
16313
+ if (value?.type === "block-seq")
16223
16314
  onError2(props.end, "BAD_INDENT", "All sequence items must start at the same column");
16224
16315
  else
16225
16316
  onError2(offset, "MISSING_CHAR", "Sequence item without - indicator");
@@ -16243,9 +16334,9 @@ var require_resolve_block_seq = __commonJS({
16243
16334
  }
16244
16335
  });
16245
16336
 
16246
- // ../../node_modules/.pnpm/yaml@2.3.3/node_modules/yaml/dist/compose/resolve-end.js
16337
+ // ../../node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/compose/resolve-end.js
16247
16338
  var require_resolve_end = __commonJS({
16248
- "../../node_modules/.pnpm/yaml@2.3.3/node_modules/yaml/dist/compose/resolve-end.js"(exports2) {
16339
+ "../../node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/compose/resolve-end.js"(exports2) {
16249
16340
  "use strict";
16250
16341
  function resolveEnd(end, offset, reqSpace, onError2) {
16251
16342
  let comment = "";
@@ -16286,9 +16377,9 @@ var require_resolve_end = __commonJS({
16286
16377
  }
16287
16378
  });
16288
16379
 
16289
- // ../../node_modules/.pnpm/yaml@2.3.3/node_modules/yaml/dist/compose/resolve-flow-collection.js
16380
+ // ../../node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/compose/resolve-flow-collection.js
16290
16381
  var require_resolve_flow_collection = __commonJS({
16291
- "../../node_modules/.pnpm/yaml@2.3.3/node_modules/yaml/dist/compose/resolve-flow-collection.js"(exports2) {
16382
+ "../../node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/compose/resolve-flow-collection.js"(exports2) {
16292
16383
  "use strict";
16293
16384
  var identity = require_identity();
16294
16385
  var Pair = require_Pair();
@@ -16309,6 +16400,8 @@ var require_resolve_flow_collection = __commonJS({
16309
16400
  const atRoot = ctx.atRoot;
16310
16401
  if (atRoot)
16311
16402
  ctx.atRoot = false;
16403
+ if (ctx.atKey)
16404
+ ctx.atKey = false;
16312
16405
  let offset = fc.offset + fc.start.source.length;
16313
16406
  for (let i = 0; i < fc.items.length; ++i) {
16314
16407
  const collItem = fc.items[i];
@@ -16319,6 +16412,7 @@ var require_resolve_flow_collection = __commonJS({
16319
16412
  next: key ?? sep3?.[0],
16320
16413
  offset,
16321
16414
  onError: onError2,
16415
+ parentIndent: fc.indent,
16322
16416
  startOnNewline: false
16323
16417
  });
16324
16418
  if (!props.found) {
@@ -16383,16 +16477,19 @@ var require_resolve_flow_collection = __commonJS({
16383
16477
  if (isBlock(value))
16384
16478
  onError2(valueNode.range, "BLOCK_IN_FLOW", blockMsg);
16385
16479
  } else {
16480
+ ctx.atKey = true;
16386
16481
  const keyStart = props.end;
16387
16482
  const keyNode = key ? composeNode(ctx, key, props, onError2) : composeEmptyNode(ctx, keyStart, start, null, props, onError2);
16388
16483
  if (isBlock(key))
16389
16484
  onError2(keyNode.range, "BLOCK_IN_FLOW", blockMsg);
16485
+ ctx.atKey = false;
16390
16486
  const valueProps = resolveProps.resolveProps(sep3 ?? [], {
16391
16487
  flow: fcName,
16392
16488
  indicator: "map-value-ind",
16393
16489
  next: value,
16394
16490
  offset: keyNode.range[2],
16395
16491
  onError: onError2,
16492
+ parentIndent: fc.indent,
16396
16493
  startOnNewline: false
16397
16494
  });
16398
16495
  if (valueProps.found) {
@@ -16410,7 +16507,7 @@ var require_resolve_flow_collection = __commonJS({
16410
16507
  onError2(valueProps.found, "KEY_OVER_1024_CHARS", "The : indicator must be at most 1024 chars after the start of an implicit flow sequence key");
16411
16508
  }
16412
16509
  } else if (value) {
16413
- if ("source" in value && value.source && value.source[0] === ":")
16510
+ if ("source" in value && value.source?.[0] === ":")
16414
16511
  onError2(value, "MISSING_CHAR", `Missing space after : in ${fcName}`);
16415
16512
  else
16416
16513
  onError2(valueProps.start, "MISSING_CHAR", `Missing , or : between ${fcName} items`);
@@ -16437,6 +16534,8 @@ var require_resolve_flow_collection = __commonJS({
16437
16534
  const map = new YAMLMap.YAMLMap(ctx.schema);
16438
16535
  map.flow = true;
16439
16536
  map.items.push(pair);
16537
+ const endRange = (valueNode ?? keyNode).range;
16538
+ map.range = [keyNode.range[0], endRange[1], endRange[2]];
16440
16539
  coll.items.push(map);
16441
16540
  }
16442
16541
  offset = valueNode ? valueNode.range[2] : valueProps.end;
@@ -16445,7 +16544,7 @@ var require_resolve_flow_collection = __commonJS({
16445
16544
  const expectedEnd = isMap ? "}" : "]";
16446
16545
  const [ce, ...ee] = fc.end;
16447
16546
  let cePos = offset;
16448
- if (ce && ce.source === expectedEnd)
16547
+ if (ce?.source === expectedEnd)
16449
16548
  cePos = ce.offset + ce.source.length;
16450
16549
  else {
16451
16550
  const name = fcName[0].toUpperCase() + fcName.substring(1);
@@ -16472,9 +16571,9 @@ var require_resolve_flow_collection = __commonJS({
16472
16571
  }
16473
16572
  });
16474
16573
 
16475
- // ../../node_modules/.pnpm/yaml@2.3.3/node_modules/yaml/dist/compose/compose-collection.js
16574
+ // ../../node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/compose/compose-collection.js
16476
16575
  var require_compose_collection = __commonJS({
16477
- "../../node_modules/.pnpm/yaml@2.3.3/node_modules/yaml/dist/compose/compose-collection.js"(exports2) {
16576
+ "../../node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/compose/compose-collection.js"(exports2) {
16478
16577
  "use strict";
16479
16578
  var identity = require_identity();
16480
16579
  var Scalar = require_Scalar();
@@ -16494,21 +16593,30 @@ var require_compose_collection = __commonJS({
16494
16593
  coll.tag = tagName;
16495
16594
  return coll;
16496
16595
  }
16497
- function composeCollection(CN, ctx, token, tagToken, onError2) {
16596
+ function composeCollection(CN, ctx, token, props, onError2) {
16597
+ const tagToken = props.tag;
16498
16598
  const tagName = !tagToken ? null : ctx.directives.tagName(tagToken.source, (msg) => onError2(tagToken, "TAG_RESOLVE_FAILED", msg));
16599
+ if (token.type === "block-seq") {
16600
+ const { anchor, newlineAfterProp: nl } = props;
16601
+ const lastProp = anchor && tagToken ? anchor.offset > tagToken.offset ? anchor : tagToken : anchor ?? tagToken;
16602
+ if (lastProp && (!nl || nl.offset < lastProp.offset)) {
16603
+ const message = "Missing newline after block sequence props";
16604
+ onError2(lastProp, "MISSING_CHAR", message);
16605
+ }
16606
+ }
16499
16607
  const expType = token.type === "block-map" ? "map" : token.type === "block-seq" ? "seq" : token.start.source === "{" ? "map" : "seq";
16500
- if (!tagToken || !tagName || tagName === "!" || tagName === YAMLMap.YAMLMap.tagName && expType === "map" || tagName === YAMLSeq.YAMLSeq.tagName && expType === "seq" || !expType) {
16608
+ if (!tagToken || !tagName || tagName === "!" || tagName === YAMLMap.YAMLMap.tagName && expType === "map" || tagName === YAMLSeq.YAMLSeq.tagName && expType === "seq") {
16501
16609
  return resolveCollection(CN, ctx, token, onError2, tagName);
16502
16610
  }
16503
16611
  let tag = ctx.schema.tags.find((t) => t.tag === tagName && t.collection === expType);
16504
16612
  if (!tag) {
16505
16613
  const kt = ctx.schema.knownTags[tagName];
16506
- if (kt && kt.collection === expType) {
16614
+ if (kt?.collection === expType) {
16507
16615
  ctx.schema.tags.push(Object.assign({}, kt, { default: false }));
16508
16616
  tag = kt;
16509
16617
  } else {
16510
- if (kt?.collection) {
16511
- onError2(tagToken, "BAD_COLLECTION_TYPE", `${kt.tag} used for ${expType} collection, but expects ${kt.collection}`, true);
16618
+ if (kt) {
16619
+ onError2(tagToken, "BAD_COLLECTION_TYPE", `${kt.tag} used for ${expType} collection, but expects ${kt.collection ?? "scalar"}`, true);
16512
16620
  } else {
16513
16621
  onError2(tagToken, "TAG_RESOLVE_FAILED", `Unresolved tag: ${tagName}`, true);
16514
16622
  }
@@ -16528,14 +16636,14 @@ var require_compose_collection = __commonJS({
16528
16636
  }
16529
16637
  });
16530
16638
 
16531
- // ../../node_modules/.pnpm/yaml@2.3.3/node_modules/yaml/dist/compose/resolve-block-scalar.js
16639
+ // ../../node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/compose/resolve-block-scalar.js
16532
16640
  var require_resolve_block_scalar = __commonJS({
16533
- "../../node_modules/.pnpm/yaml@2.3.3/node_modules/yaml/dist/compose/resolve-block-scalar.js"(exports2) {
16641
+ "../../node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/compose/resolve-block-scalar.js"(exports2) {
16534
16642
  "use strict";
16535
16643
  var Scalar = require_Scalar();
16536
- function resolveBlockScalar(scalar, strict, onError2) {
16644
+ function resolveBlockScalar(ctx, scalar, onError2) {
16537
16645
  const start = scalar.offset;
16538
- const header = parseBlockScalarHeader(scalar, strict, onError2);
16646
+ const header = parseBlockScalarHeader(scalar, ctx.options.strict, onError2);
16539
16647
  if (!header)
16540
16648
  return { value: "", type: null, comment: "", range: [start, start, start] };
16541
16649
  const type = header.mode === ">" ? Scalar.Scalar.BLOCK_FOLDED : Scalar.Scalar.BLOCK_LITERAL;
@@ -16571,6 +16679,10 @@ var require_resolve_block_scalar = __commonJS({
16571
16679
  if (header.indent === 0)
16572
16680
  trimIndent = indent.length;
16573
16681
  contentStart = i;
16682
+ if (trimIndent === 0 && !ctx.atRoot) {
16683
+ const message = "Block scalar values in collections must be indented";
16684
+ onError2(offset, "BAD_INDENT", message);
16685
+ }
16574
16686
  break;
16575
16687
  }
16576
16688
  offset += indent.length + content.length + 1;
@@ -16707,9 +16819,9 @@ var require_resolve_block_scalar = __commonJS({
16707
16819
  }
16708
16820
  });
16709
16821
 
16710
- // ../../node_modules/.pnpm/yaml@2.3.3/node_modules/yaml/dist/compose/resolve-flow-scalar.js
16822
+ // ../../node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/compose/resolve-flow-scalar.js
16711
16823
  var require_resolve_flow_scalar = __commonJS({
16712
- "../../node_modules/.pnpm/yaml@2.3.3/node_modules/yaml/dist/compose/resolve-flow-scalar.js"(exports2) {
16824
+ "../../node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/compose/resolve-flow-scalar.js"(exports2) {
16713
16825
  "use strict";
16714
16826
  var Scalar = require_Scalar();
16715
16827
  var resolveEnd = require_resolve_end();
@@ -16788,7 +16900,7 @@ var require_resolve_flow_scalar = __commonJS({
16788
16900
  try {
16789
16901
  first2 = new RegExp("(.*?)(?<![ ])[ ]*\r?\n", "sy");
16790
16902
  line = new RegExp("[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?\n", "sy");
16791
- } catch (_) {
16903
+ } catch {
16792
16904
  first2 = /(.*?)[ \t]*\r?\n/sy;
16793
16905
  line = /[ \t]*(.*?)[ \t]*\r?\n/sy;
16794
16906
  }
@@ -16880,18 +16992,31 @@ var require_resolve_flow_scalar = __commonJS({
16880
16992
  }
16881
16993
  var escapeCodes = {
16882
16994
  "0": "\0",
16995
+ // null character
16883
16996
  a: "\x07",
16997
+ // bell character
16884
16998
  b: "\b",
16999
+ // backspace
16885
17000
  e: "\x1B",
17001
+ // escape character
16886
17002
  f: "\f",
17003
+ // form feed
16887
17004
  n: "\n",
17005
+ // line feed
16888
17006
  r: "\r",
17007
+ // carriage return
16889
17008
  t: " ",
17009
+ // horizontal tab
16890
17010
  v: "\v",
17011
+ // vertical tab
16891
17012
  N: "\x85",
17013
+ // Unicode next line
16892
17014
  _: "\xA0",
17015
+ // Unicode non-breaking space
16893
17016
  L: "\u2028",
17017
+ // Unicode line separator
16894
17018
  P: "\u2029",
17019
+ // Unicode paragraph separator
16895
17020
  " ": " ",
16896
17021
  '"': '"',
16897
17022
  "/": "/",
@@ -16913,18 +17038,26 @@ var require_resolve_flow_scalar = __commonJS({
16913
17038
  }
16914
17039
  });
16915
17040
 
16916
- // ../../node_modules/.pnpm/yaml@2.3.3/node_modules/yaml/dist/compose/compose-scalar.js
17041
+ // ../../node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/compose/compose-scalar.js
16917
17042
  var require_compose_scalar = __commonJS({
16918
- "../../node_modules/.pnpm/yaml@2.3.3/node_modules/yaml/dist/compose/compose-scalar.js"(exports2) {
17043
+ "../../node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/compose/compose-scalar.js"(exports2) {
16919
17044
  "use strict";
16920
17045
  var identity = require_identity();
16921
17046
  var Scalar = require_Scalar();
16922
17047
  var resolveBlockScalar = require_resolve_block_scalar();
16923
17048
  var resolveFlowScalar = require_resolve_flow_scalar();
16924
17049
  function composeScalar(ctx, token, tagToken, onError2) {
16925
- const { value, type, comment, range: range2 } = token.type === "block-scalar" ? resolveBlockScalar.resolveBlockScalar(token, ctx.options.strict, onError2) : resolveFlowScalar.resolveFlowScalar(token, ctx.options.strict, onError2);
17050
+ const { value, type, comment, range: range2 } = token.type === "block-scalar" ? resolveBlockScalar.resolveBlockScalar(ctx, token, onError2) : resolveFlowScalar.resolveFlowScalar(token, ctx.options.strict, onError2);
16926
17051
  const tagName = tagToken ? ctx.directives.tagName(tagToken.source, (msg) => onError2(tagToken, "TAG_RESOLVE_FAILED", msg)) : null;
16927
- const tag = tagToken && tagName ? findScalarTagByName(ctx.schema, value, tagName, tagToken, onError2) : token.type === "scalar" ? findScalarTagByTest(ctx, value, token, onError2) : ctx.schema[identity.SCALAR];
17052
+ let tag;
17053
+ if (ctx.options.stringKeys && ctx.atKey) {
17054
+ tag = ctx.schema[identity.SCALAR];
17055
+ } else if (tagName)
17056
+ tag = findScalarTagByName(ctx.schema, value, tagName, tagToken, onError2);
17057
+ else if (token.type === "scalar")
17058
+ tag = findScalarTagByTest(ctx, value, token, onError2);
17059
+ else
17060
+ tag = ctx.schema[identity.SCALAR];
16928
17061
  let scalar;
16929
17062
  try {
16930
17063
  const res = tag.resolve(value, (msg) => onError2(tagToken ?? token, "TAG_RESOLVE_FAILED", msg), ctx.options);
@@ -16969,8 +17102,8 @@ var require_compose_scalar = __commonJS({
16969
17102
  onError2(tagToken, "TAG_RESOLVE_FAILED", `Unresolved tag: ${tagName}`, tagName !== "tag:yaml.org,2002:str");
16970
17103
  return schema[identity.SCALAR];
16971
17104
  }
16972
- function findScalarTagByTest({ directives, schema }, value, token, onError2) {
16973
- const tag = schema.tags.find((tag2) => tag2.default && tag2.test?.test(value)) || schema[identity.SCALAR];
17105
+ function findScalarTagByTest({ atKey, directives, schema }, value, token, onError2) {
17106
+ const tag = schema.tags.find((tag2) => (tag2.default === true || atKey && tag2.default === "key") && tag2.test?.test(value)) || schema[identity.SCALAR];
16974
17107
  if (schema.compat) {
16975
17108
  const compat = schema.compat.find((tag2) => tag2.default && tag2.test?.test(value)) ?? schema[identity.SCALAR];
16976
17109
  if (tag.tag !== compat.tag) {
@@ -16986,14 +17119,13 @@ var require_compose_scalar = __commonJS({
16986
17119
  }
16987
17120
  });
16988
17121
 
16989
- // ../../node_modules/.pnpm/yaml@2.3.3/node_modules/yaml/dist/compose/util-empty-scalar-position.js
17122
+ // ../../node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/compose/util-empty-scalar-position.js
16990
17123
  var require_util_empty_scalar_position = __commonJS({
16991
- "../../node_modules/.pnpm/yaml@2.3.3/node_modules/yaml/dist/compose/util-empty-scalar-position.js"(exports2) {
17124
+ "../../node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/compose/util-empty-scalar-position.js"(exports2) {
16992
17125
  "use strict";
16993
17126
  function emptyScalarPosition(offset, before, pos) {
16994
17127
  if (before) {
16995
- if (pos === null)
16996
- pos = before.length;
17128
+ pos ?? (pos = before.length);
16997
17129
  for (let i = pos - 1; i >= 0; --i) {
16998
17130
  let st = before[i];
16999
17131
  switch (st.type) {
@@ -17017,17 +17149,19 @@ var require_util_empty_scalar_position = __commonJS({
17017
17149
  }
17018
17150
  });
17019
17151
 
17020
- // ../../node_modules/.pnpm/yaml@2.3.3/node_modules/yaml/dist/compose/compose-node.js
17152
+ // ../../node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/compose/compose-node.js
17021
17153
  var require_compose_node = __commonJS({
17022
- "../../node_modules/.pnpm/yaml@2.3.3/node_modules/yaml/dist/compose/compose-node.js"(exports2) {
17154
+ "../../node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/compose/compose-node.js"(exports2) {
17023
17155
  "use strict";
17024
17156
  var Alias = require_Alias();
17157
+ var identity = require_identity();
17025
17158
  var composeCollection = require_compose_collection();
17026
17159
  var composeScalar = require_compose_scalar();
17027
17160
  var resolveEnd = require_resolve_end();
17028
17161
  var utilEmptyScalarPosition = require_util_empty_scalar_position();
17029
17162
  var CN = { composeNode, composeEmptyNode };
17030
17163
  function composeNode(ctx, token, props, onError2) {
17164
+ const atKey = ctx.atKey;
17031
17165
  const { spaceBefore, comment, anchor, tag } = props;
17032
17166
  let node;
17033
17167
  let isSrcToken = true;
@@ -17048,19 +17182,28 @@ var require_compose_node = __commonJS({
17048
17182
  case "block-map":
17049
17183
  case "block-seq":
17050
17184
  case "flow-collection":
17051
- node = composeCollection.composeCollection(CN, ctx, token, tag, onError2);
17052
- if (anchor)
17053
- node.anchor = anchor.source.substring(1);
17185
+ try {
17186
+ node = composeCollection.composeCollection(CN, ctx, token, props, onError2);
17187
+ if (anchor)
17188
+ node.anchor = anchor.source.substring(1);
17189
+ } catch (error) {
17190
+ const message = error instanceof Error ? error.message : String(error);
17191
+ onError2(token, "RESOURCE_EXHAUSTION", message);
17192
+ }
17054
17193
  break;
17055
17194
  default: {
17056
17195
  const message = token.type === "error" ? token.message : `Unsupported token (type: ${token.type})`;
17057
17196
  onError2(token, "UNEXPECTED_TOKEN", message);
17058
- node = composeEmptyNode(ctx, token.offset, void 0, null, props, onError2);
17059
17197
  isSrcToken = false;
17060
17198
  }
17061
17199
  }
17200
+ node ?? (node = composeEmptyNode(ctx, token.offset, void 0, null, props, onError2));
17062
17201
  if (anchor && node.anchor === "")
17063
17202
  onError2(anchor, "BAD_ALIAS", "Anchor cannot be an empty string");
17203
+ if (atKey && ctx.options.stringKeys && (!identity.isScalar(node) || typeof node.value !== "string" || node.tag && node.tag !== "tag:yaml.org,2002:str")) {
17204
+ const msg = "With stringKeys, all keys must be strings";
17205
+ onError2(tag ?? token, "NON_STRING_KEY", msg);
17206
+ }
17064
17207
  if (spaceBefore)
17065
17208
  node.spaceBefore = true;
17066
17209
  if (comment) {
@@ -17112,9 +17255,9 @@ var require_compose_node = __commonJS({
17112
17255
  }
17113
17256
  });
17114
17257
 
17115
- // ../../node_modules/.pnpm/yaml@2.3.3/node_modules/yaml/dist/compose/compose-doc.js
17258
+ // ../../node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/compose/compose-doc.js
17116
17259
  var require_compose_doc = __commonJS({
17117
- "../../node_modules/.pnpm/yaml@2.3.3/node_modules/yaml/dist/compose/compose-doc.js"(exports2) {
17260
+ "../../node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/compose/compose-doc.js"(exports2) {
17118
17261
  "use strict";
17119
17262
  var Document = require_Document();
17120
17263
  var composeNode = require_compose_node();
@@ -17124,6 +17267,7 @@ var require_compose_doc = __commonJS({
17124
17267
  const opts = Object.assign({ _directives: directives }, options);
17125
17268
  const doc = new Document.Document(void 0, opts);
17126
17269
  const ctx = {
17270
+ atKey: false,
17127
17271
  atRoot: true,
17128
17272
  directives: doc.directives,
17129
17273
  options: doc.options,
@@ -17134,6 +17278,7 @@ var require_compose_doc = __commonJS({
17134
17278
  next: value ?? end?.[0],
17135
17279
  offset,
17136
17280
  onError: onError2,
17281
+ parentIndent: 0,
17137
17282
  startOnNewline: true
17138
17283
  });
17139
17284
  if (props.found) {
@@ -17153,10 +17298,11 @@ var require_compose_doc = __commonJS({
17153
17298
  }
17154
17299
  });
17155
17300
 
17156
- // ../../node_modules/.pnpm/yaml@2.3.3/node_modules/yaml/dist/compose/composer.js
17301
+ // ../../node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/compose/composer.js
17157
17302
  var require_composer = __commonJS({
17158
- "../../node_modules/.pnpm/yaml@2.3.3/node_modules/yaml/dist/compose/composer.js"(exports2) {
17303
+ "../../node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/compose/composer.js"(exports2) {
17159
17304
  "use strict";
17305
+ var node_process = require("process");
17160
17306
  var directives = require_directives();
17161
17307
  var Document = require_Document();
17162
17308
  var errors = require_errors();
@@ -17272,7 +17418,7 @@ ${cb}` : comment;
17272
17418
  }
17273
17419
  /** Advance the composer by one CST token. */
17274
17420
  *next(token) {
17275
- if (process.env.LOG_STREAM)
17421
+ if (node_process.env.LOG_STREAM)
17276
17422
  console.dir(token, { depth: null });
17277
17423
  switch (token.type) {
17278
17424
  case "directive":
@@ -17358,9 +17504,9 @@ ${end.comment}` : end.comment;
17358
17504
  }
17359
17505
  });
17360
17506
 
17361
- // ../../node_modules/.pnpm/yaml@2.3.3/node_modules/yaml/dist/parse/cst-scalar.js
17507
+ // ../../node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/parse/cst-scalar.js
17362
17508
  var require_cst_scalar = __commonJS({
17363
- "../../node_modules/.pnpm/yaml@2.3.3/node_modules/yaml/dist/parse/cst-scalar.js"(exports2) {
17509
+ "../../node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/parse/cst-scalar.js"(exports2) {
17364
17510
  "use strict";
17365
17511
  var resolveBlockScalar = require_resolve_block_scalar();
17366
17512
  var resolveFlowScalar = require_resolve_flow_scalar();
@@ -17381,7 +17527,7 @@ var require_cst_scalar = __commonJS({
17381
17527
  case "double-quoted-scalar":
17382
17528
  return resolveFlowScalar.resolveFlowScalar(token, strict, _onError);
17383
17529
  case "block-scalar":
17384
- return resolveBlockScalar.resolveBlockScalar(token, strict, _onError);
17530
+ return resolveBlockScalar.resolveBlockScalar({ options: { strict } }, token, _onError);
17385
17531
  }
17386
17532
  }
17387
17533
  return null;
@@ -17543,9 +17689,9 @@ var require_cst_scalar = __commonJS({
17543
17689
  }
17544
17690
  });
17545
17691
 
17546
- // ../../node_modules/.pnpm/yaml@2.3.3/node_modules/yaml/dist/parse/cst-stringify.js
17692
+ // ../../node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/parse/cst-stringify.js
17547
17693
  var require_cst_stringify = __commonJS({
17548
- "../../node_modules/.pnpm/yaml@2.3.3/node_modules/yaml/dist/parse/cst-stringify.js"(exports2) {
17694
+ "../../node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/parse/cst-stringify.js"(exports2) {
17549
17695
  "use strict";
17550
17696
  var stringify3 = (cst) => "type" in cst ? stringifyToken(cst) : stringifyItem(cst);
17551
17697
  function stringifyToken(token) {
@@ -17604,9 +17750,9 @@ var require_cst_stringify = __commonJS({
17604
17750
  }
17605
17751
  });
17606
17752
 
17607
- // ../../node_modules/.pnpm/yaml@2.3.3/node_modules/yaml/dist/parse/cst-visit.js
17753
+ // ../../node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/parse/cst-visit.js
17608
17754
  var require_cst_visit = __commonJS({
17609
- "../../node_modules/.pnpm/yaml@2.3.3/node_modules/yaml/dist/parse/cst-visit.js"(exports2) {
17755
+ "../../node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/parse/cst-visit.js"(exports2) {
17610
17756
  "use strict";
17611
17757
  var BREAK = /* @__PURE__ */ Symbol("break visit");
17612
17758
  var SKIP = /* @__PURE__ */ Symbol("skip children");
@@ -17666,9 +17812,9 @@ var require_cst_visit = __commonJS({
17666
17812
  }
17667
17813
  });
17668
17814
 
17669
- // ../../node_modules/.pnpm/yaml@2.3.3/node_modules/yaml/dist/parse/cst.js
17815
+ // ../../node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/parse/cst.js
17670
17816
  var require_cst = __commonJS({
17671
- "../../node_modules/.pnpm/yaml@2.3.3/node_modules/yaml/dist/parse/cst.js"(exports2) {
17817
+ "../../node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/parse/cst.js"(exports2) {
17672
17818
  "use strict";
17673
17819
  var cstScalar = require_cst_scalar();
17674
17820
  var cstStringify = require_cst_stringify();
@@ -17768,9 +17914,9 @@ var require_cst = __commonJS({
17768
17914
  }
17769
17915
  });
17770
17916
 
17771
- // ../../node_modules/.pnpm/yaml@2.3.3/node_modules/yaml/dist/parse/lexer.js
17917
+ // ../../node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/parse/lexer.js
17772
17918
  var require_lexer = __commonJS({
17773
- "../../node_modules/.pnpm/yaml@2.3.3/node_modules/yaml/dist/parse/lexer.js"(exports2) {
17919
+ "../../node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/parse/lexer.js"(exports2) {
17774
17920
  "use strict";
17775
17921
  var cst = require_cst();
17776
17922
  function isEmpty(ch) {
@@ -17785,11 +17931,11 @@ var require_lexer = __commonJS({
17785
17931
  return false;
17786
17932
  }
17787
17933
  }
17788
- var hexDigits = "0123456789ABCDEFabcdef".split("");
17789
- var tagChars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()".split("");
17790
- var invalidFlowScalarChars = ",[]{}".split("");
17791
- var invalidAnchorChars = " ,[]{}\n\r ".split("");
17792
- var isNotAnchorChar = (ch) => !ch || invalidAnchorChars.includes(ch);
17934
+ var hexDigits = new Set("0123456789ABCDEFabcdef");
17935
+ var tagChars = new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()");
17936
+ var flowIndicatorChars = new Set(",[]{}");
17937
+ var invalidAnchorChars = new Set(" ,[]{}\n\r ");
17938
+ var isNotAnchorChar = (ch) => !ch || invalidAnchorChars.has(ch);
17793
17939
  var Lexer = class {
17794
17940
  constructor() {
17795
17941
  this.atEnd = false;
@@ -17812,6 +17958,8 @@ var require_lexer = __commonJS({
17812
17958
  */
17813
17959
  *lex(source, incomplete = false) {
17814
17960
  if (source) {
17961
+ if (typeof source !== "string")
17962
+ throw TypeError("source is not a string");
17815
17963
  this.buffer = this.buffer ? this.buffer + source : source;
17816
17964
  this.lineEndPos = null;
17817
17965
  }
@@ -17909,11 +18057,15 @@ var require_lexer = __commonJS({
17909
18057
  }
17910
18058
  if (line[0] === "%") {
17911
18059
  let dirEnd = line.length;
17912
- const cs = line.indexOf("#");
17913
- if (cs !== -1) {
18060
+ let cs = line.indexOf("#");
18061
+ while (cs !== -1) {
17914
18062
  const ch = line[cs - 1];
17915
- if (ch === " " || ch === " ")
18063
+ if (ch === " " || ch === " ") {
17916
18064
  dirEnd = cs - 1;
18065
+ break;
18066
+ } else {
18067
+ cs = line.indexOf("#", cs + 1);
18068
+ }
17917
18069
  }
17918
18070
  while (true) {
17919
18071
  const ch = line[dirEnd - 1];
@@ -17944,14 +18096,11 @@ var require_lexer = __commonJS({
17944
18096
  if (!this.atEnd && !this.hasChars(4))
17945
18097
  return this.setNext("line-start");
17946
18098
  const s = this.peek(3);
17947
- if (s === "---" && isEmpty(this.charAt(3))) {
18099
+ if ((s === "---" || s === "...") && isEmpty(this.charAt(3))) {
17948
18100
  yield* this.pushCount(3);
17949
18101
  this.indentValue = 0;
17950
18102
  this.indentNext = 0;
17951
- return "doc";
17952
- } else if (s === "..." && isEmpty(this.charAt(3))) {
17953
- yield* this.pushCount(3);
17954
- return "stream";
18103
+ return s === "---" ? "doc" : "stream";
17955
18104
  }
17956
18105
  }
17957
18106
  this.indentValue = yield* this.pushSpaces(false);
@@ -18138,17 +18287,17 @@ var require_lexer = __commonJS({
18138
18287
  let nl = this.pos - 1;
18139
18288
  let indent = 0;
18140
18289
  let ch;
18141
- loop: for (let i = this.pos; ch = this.buffer[i]; ++i) {
18290
+ loop: for (let i2 = this.pos; ch = this.buffer[i2]; ++i2) {
18142
18291
  switch (ch) {
18143
18292
  case " ":
18144
18293
  indent += 1;
18145
18294
  break;
18146
18295
  case "\n":
18147
- nl = i;
18296
+ nl = i2;
18148
18297
  indent = 0;
18149
18298
  break;
18150
18299
  case "\r": {
18151
- const next = this.buffer[i + 1];
18300
+ const next = this.buffer[i2 + 1];
18152
18301
  if (!next && !this.atEnd)
18153
18302
  return this.setNext("block-scalar");
18154
18303
  if (next === "\n")
@@ -18164,8 +18313,9 @@ var require_lexer = __commonJS({
18164
18313
  if (indent >= this.indentNext) {
18165
18314
  if (this.blockScalarIndent === -1)
18166
18315
  this.indentNext = indent;
18167
- else
18168
- this.indentNext += this.blockScalarIndent;
18316
+ else {
18317
+ this.indentNext = this.blockScalarIndent + (this.indentNext === 0 ? 1 : this.indentNext);
18318
+ }
18169
18319
  do {
18170
18320
  const cs = this.continueScalar(nl + 1);
18171
18321
  if (cs === -1)
@@ -18178,17 +18328,25 @@ var require_lexer = __commonJS({
18178
18328
  nl = this.buffer.length;
18179
18329
  }
18180
18330
  }
18181
- if (!this.blockScalarKeep) {
18331
+ let i = nl + 1;
18332
+ ch = this.buffer[i];
18333
+ while (ch === " ")
18334
+ ch = this.buffer[++i];
18335
+ if (ch === " ") {
18336
+ while (ch === " " || ch === " " || ch === "\r" || ch === "\n")
18337
+ ch = this.buffer[++i];
18338
+ nl = i - 1;
18339
+ } else if (!this.blockScalarKeep) {
18182
18340
  do {
18183
- let i = nl - 1;
18184
- let ch2 = this.buffer[i];
18341
+ let i2 = nl - 1;
18342
+ let ch2 = this.buffer[i2];
18185
18343
  if (ch2 === "\r")
18186
- ch2 = this.buffer[--i];
18187
- const lastChar = i;
18188
- while (ch2 === " " || ch2 === " ")
18189
- ch2 = this.buffer[--i];
18190
- if (ch2 === "\n" && i >= this.pos && i + 1 + indent > lastChar)
18191
- nl = i;
18344
+ ch2 = this.buffer[--i2];
18345
+ const lastChar = i2;
18346
+ while (ch2 === " ")
18347
+ ch2 = this.buffer[--i2];
18348
+ if (ch2 === "\n" && i2 >= this.pos && i2 + 1 + indent > lastChar)
18349
+ nl = i2;
18192
18350
  else
18193
18351
  break;
18194
18352
  } while (true);
@@ -18205,7 +18363,7 @@ var require_lexer = __commonJS({
18205
18363
  while (ch = this.buffer[++i]) {
18206
18364
  if (ch === ":") {
18207
18365
  const next = this.buffer[i + 1];
18208
- if (isEmpty(next) || inFlow && next === ",")
18366
+ if (isEmpty(next) || inFlow && flowIndicatorChars.has(next))
18209
18367
  break;
18210
18368
  end = i;
18211
18369
  } else if (isEmpty(ch)) {
@@ -18218,7 +18376,7 @@ var require_lexer = __commonJS({
18218
18376
  } else
18219
18377
  end = i;
18220
18378
  }
18221
- if (next === "#" || inFlow && invalidFlowScalarChars.includes(next))
18379
+ if (next === "#" || inFlow && flowIndicatorChars.has(next))
18222
18380
  break;
18223
18381
  if (ch === "\n") {
18224
18382
  const cs = this.continueScalar(i + 1);
@@ -18227,7 +18385,7 @@ var require_lexer = __commonJS({
18227
18385
  i = Math.max(i, cs - 2);
18228
18386
  }
18229
18387
  } else {
18230
- if (inFlow && invalidFlowScalarChars.includes(ch))
18388
+ if (inFlow && flowIndicatorChars.has(ch))
18231
18389
  break;
18232
18390
  end = i;
18233
18391
  }
@@ -18269,7 +18427,7 @@ var require_lexer = __commonJS({
18269
18427
  case ":": {
18270
18428
  const inFlow = this.flowLevel > 0;
18271
18429
  const ch1 = this.charAt(1);
18272
- if (isEmpty(ch1) || inFlow && invalidFlowScalarChars.includes(ch1)) {
18430
+ if (isEmpty(ch1) || inFlow && flowIndicatorChars.has(ch1)) {
18273
18431
  if (!inFlow)
18274
18432
  this.indentNext = this.indentValue + 1;
18275
18433
  else if (this.flowKey)
@@ -18291,9 +18449,9 @@ var require_lexer = __commonJS({
18291
18449
  let i = this.pos + 1;
18292
18450
  let ch = this.buffer[i];
18293
18451
  while (ch) {
18294
- if (tagChars.includes(ch))
18452
+ if (tagChars.has(ch))
18295
18453
  ch = this.buffer[++i];
18296
- else if (ch === "%" && hexDigits.includes(this.buffer[i + 1]) && hexDigits.includes(this.buffer[i + 2])) {
18454
+ else if (ch === "%" && hexDigits.has(this.buffer[i + 1]) && hexDigits.has(this.buffer[i + 2])) {
18297
18455
  ch = this.buffer[i += 3];
18298
18456
  } else
18299
18457
  break;
@@ -18335,9 +18493,9 @@ var require_lexer = __commonJS({
18335
18493
  }
18336
18494
  });
18337
18495
 
18338
- // ../../node_modules/.pnpm/yaml@2.3.3/node_modules/yaml/dist/parse/line-counter.js
18496
+ // ../../node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/parse/line-counter.js
18339
18497
  var require_line_counter = __commonJS({
18340
- "../../node_modules/.pnpm/yaml@2.3.3/node_modules/yaml/dist/parse/line-counter.js"(exports2) {
18498
+ "../../node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/parse/line-counter.js"(exports2) {
18341
18499
  "use strict";
18342
18500
  var LineCounter = class {
18343
18501
  constructor() {
@@ -18366,10 +18524,11 @@ var require_line_counter = __commonJS({
18366
18524
  }
18367
18525
  });
18368
18526
 
18369
- // ../../node_modules/.pnpm/yaml@2.3.3/node_modules/yaml/dist/parse/parser.js
18527
+ // ../../node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/parse/parser.js
18370
18528
  var require_parser = __commonJS({
18371
- "../../node_modules/.pnpm/yaml@2.3.3/node_modules/yaml/dist/parse/parser.js"(exports2) {
18529
+ "../../node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/parse/parser.js"(exports2) {
18372
18530
  "use strict";
18531
+ var node_process = require("process");
18373
18532
  var cst = require_cst();
18374
18533
  var lexer = require_lexer();
18375
18534
  function includesToken(list2, type) {
@@ -18493,7 +18652,7 @@ var require_parser = __commonJS({
18493
18652
  */
18494
18653
  *next(source) {
18495
18654
  this.source = source;
18496
- if (process.env.LOG_TOKENS)
18655
+ if (node_process.env.LOG_TOKENS)
18497
18656
  console.log("|", cst.prettyToken(source));
18498
18657
  if (this.atScalar) {
18499
18658
  this.atScalar = false;
@@ -18555,7 +18714,7 @@ var require_parser = __commonJS({
18555
18714
  }
18556
18715
  *step() {
18557
18716
  const top2 = this.peek(1);
18558
- if (this.type === "doc-end" && (!top2 || top2.type !== "doc-end")) {
18717
+ if (this.type === "doc-end" && top2?.type !== "doc-end") {
18559
18718
  while (this.stack.length > 0)
18560
18719
  yield* this.pop();
18561
18720
  this.stack.push({
@@ -18624,7 +18783,7 @@ var require_parser = __commonJS({
18624
18783
  it.value = token;
18625
18784
  } else {
18626
18785
  Object.assign(it, { key: token, sep: [] });
18627
- this.onKeyLine = !includesToken(it.start, "explicit-key-ind");
18786
+ this.onKeyLine = !it.explicitKey;
18628
18787
  return;
18629
18788
  }
18630
18789
  break;
@@ -18815,7 +18974,8 @@ var require_parser = __commonJS({
18815
18974
  return;
18816
18975
  }
18817
18976
  if (this.indent >= map.indent) {
18818
- const atNextItem = !this.onKeyLine && this.indent === map.indent && it.sep;
18977
+ const atMapIndent = !this.onKeyLine && this.indent === map.indent;
18978
+ const atNextItem = atMapIndent && (it.sep || it.explicitKey) && this.type !== "seq-item-ind";
18819
18979
  let start = [];
18820
18980
  if (atNextItem && it.sep && !it.value) {
18821
18981
  const nl = [];
@@ -18852,23 +19012,24 @@ var require_parser = __commonJS({
18852
19012
  }
18853
19013
  return;
18854
19014
  case "explicit-key-ind":
18855
- if (!it.sep && !includesToken(it.start, "explicit-key-ind")) {
19015
+ if (!it.sep && !it.explicitKey) {
18856
19016
  it.start.push(this.sourceToken);
19017
+ it.explicitKey = true;
18857
19018
  } else if (atNextItem || it.value) {
18858
19019
  start.push(this.sourceToken);
18859
- map.items.push({ start });
19020
+ map.items.push({ start, explicitKey: true });
18860
19021
  } else {
18861
19022
  this.stack.push({
18862
19023
  type: "block-map",
18863
19024
  offset: this.offset,
18864
19025
  indent: this.indent,
18865
- items: [{ start: [this.sourceToken] }]
19026
+ items: [{ start: [this.sourceToken], explicitKey: true }]
18866
19027
  });
18867
19028
  }
18868
19029
  this.onKeyLine = true;
18869
19030
  return;
18870
19031
  case "map-value-ind":
18871
- if (includesToken(it.start, "explicit-key-ind")) {
19032
+ if (it.explicitKey) {
18872
19033
  if (!it.sep) {
18873
19034
  if (includesToken(it.start, "newline")) {
18874
19035
  Object.assign(it, { key: null, sep: [this.sourceToken] });
@@ -18895,7 +19056,8 @@ var require_parser = __commonJS({
18895
19056
  const key = it.key;
18896
19057
  const sep3 = it.sep;
18897
19058
  sep3.push(this.sourceToken);
18898
- delete it.key, delete it.sep;
19059
+ delete it.key;
19060
+ delete it.sep;
18899
19061
  this.stack.push({
18900
19062
  type: "block-map",
18901
19063
  offset: this.offset,
@@ -18944,7 +19106,17 @@ var require_parser = __commonJS({
18944
19106
  default: {
18945
19107
  const bv = this.startBlockValue(map);
18946
19108
  if (bv) {
18947
- if (atNextItem && bv.type !== "block-seq" && includesToken(it.start, "explicit-key-ind")) {
19109
+ if (bv.type === "block-seq") {
19110
+ if (!it.explicitKey && it.sep && !includesToken(it.sep, "newline")) {
19111
+ yield* this.pop({
19112
+ type: "error",
19113
+ offset: this.offset,
19114
+ message: "Unexpected block-seq-ind on same line with key",
19115
+ source: this.source
19116
+ });
19117
+ return;
19118
+ }
19119
+ } else if (atMapIndent) {
18948
19120
  map.items.push({ start });
18949
19121
  }
18950
19122
  this.stack.push(bv);
@@ -19020,7 +19192,7 @@ var require_parser = __commonJS({
19020
19192
  do {
19021
19193
  yield* this.pop();
19022
19194
  top2 = this.peek(1);
19023
- } while (top2 && top2.type === "flow-collection");
19195
+ } while (top2?.type === "flow-collection");
19024
19196
  } else if (fc.end.length === 0) {
19025
19197
  switch (this.type) {
19026
19198
  case "comma":
@@ -19155,7 +19327,7 @@ var require_parser = __commonJS({
19155
19327
  type: "block-map",
19156
19328
  offset: this.offset,
19157
19329
  indent: this.indent,
19158
- items: [{ start }]
19330
+ items: [{ start, explicitKey: true }]
19159
19331
  };
19160
19332
  }
19161
19333
  case "map-value-ind": {
@@ -19219,14 +19391,15 @@ var require_parser = __commonJS({
19219
19391
  }
19220
19392
  });
19221
19393
 
19222
- // ../../node_modules/.pnpm/yaml@2.3.3/node_modules/yaml/dist/public-api.js
19394
+ // ../../node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/public-api.js
19223
19395
  var require_public_api = __commonJS({
19224
- "../../node_modules/.pnpm/yaml@2.3.3/node_modules/yaml/dist/public-api.js"(exports2) {
19396
+ "../../node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/public-api.js"(exports2) {
19225
19397
  "use strict";
19226
19398
  var composer = require_composer();
19227
19399
  var Document = require_Document();
19228
19400
  var errors = require_errors();
19229
19401
  var log = require_log();
19402
+ var identity = require_identity();
19230
19403
  var lineCounter = require_line_counter();
19231
19404
  var parser4 = require_parser();
19232
19405
  function parseOptions(options) {
@@ -19304,6 +19477,8 @@ var require_public_api = __commonJS({
19304
19477
  if (!keepUndefined)
19305
19478
  return void 0;
19306
19479
  }
19480
+ if (identity.isDocument(value) && !_replacer)
19481
+ return value.toString(options);
19307
19482
  return new Document.Document(value, _replacer, options).toString(options);
19308
19483
  }
19309
19484
  exports2.parse = parse3;
@@ -19313,9 +19488,9 @@ var require_public_api = __commonJS({
19313
19488
  }
19314
19489
  });
19315
19490
 
19316
- // ../../node_modules/.pnpm/yaml@2.3.3/node_modules/yaml/dist/index.js
19491
+ // ../../node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/index.js
19317
19492
  var require_dist3 = __commonJS({
19318
- "../../node_modules/.pnpm/yaml@2.3.3/node_modules/yaml/dist/index.js"(exports2) {
19493
+ "../../node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/index.js"(exports2) {
19319
19494
  "use strict";
19320
19495
  var composer = require_composer();
19321
19496
  var Document = require_Document();
@@ -19584,7 +19759,7 @@ var init_diff3 = __esm({
19584
19759
  }
19585
19760
  });
19586
19761
 
19587
- // ../../node_modules/.pnpm/@fern-api+replay@0.7.0/node_modules/@fern-api/replay/dist/index.js
19762
+ // ../../node_modules/.pnpm/@fern-api+replay@0.8.0/node_modules/@fern-api/replay/dist/index.js
19588
19763
  var dist_exports = {};
19589
19764
  __export(dist_exports, {
19590
19765
  FERN_BOT_EMAIL: () => FERN_BOT_EMAIL2,
@@ -19601,6 +19776,9 @@ __export(dist_exports, {
19601
19776
  forget: () => forget,
19602
19777
  isGenerationCommit: () => isGenerationCommit,
19603
19778
  isReplayCommit: () => isReplayCommit,
19779
+ isRevertCommit: () => isRevertCommit,
19780
+ parseRevertedMessage: () => parseRevertedMessage,
19781
+ parseRevertedSha: () => parseRevertedSha,
19604
19782
  reset: () => reset,
19605
19783
  resolve: () => resolve7,
19606
19784
  status: () => status,
@@ -19618,6 +19796,17 @@ function isGenerationCommit(commit) {
19618
19796
  function isReplayCommit(commit) {
19619
19797
  return commit.message.startsWith("[fern-replay]");
19620
19798
  }
19799
+ function isRevertCommit(message) {
19800
+ return message.startsWith('Revert "');
19801
+ }
19802
+ function parseRevertedSha(fullBody) {
19803
+ const match2 = fullBody.match(/This reverts commit ([0-9a-f]{40})\./);
19804
+ return match2?.[1];
19805
+ }
19806
+ function parseRevertedMessage(subject) {
19807
+ const match2 = subject.match(/^Revert "(.+)"$/);
19808
+ return match2?.[1];
19809
+ }
19621
19810
  function threeWayMerge(base, ours, theirs) {
19622
19811
  const baseLines = base.split("\n");
19623
19812
  const oursLines = ours.split("\n");
@@ -19661,6 +19850,32 @@ function isDiffLineForFile(diffLine, filePath) {
19661
19850
  const match2 = diffLine.match(/^diff --git a\/.+ b\/(.+)$/);
19662
19851
  return match2 !== null && match2[1] === filePath;
19663
19852
  }
19853
+ function stripConflictMarkers(content) {
19854
+ const lines = content.split("\n");
19855
+ const result = [];
19856
+ let inConflict = false;
19857
+ let inOurs = false;
19858
+ for (const line of lines) {
19859
+ if (line.startsWith("<<<<<<< ")) {
19860
+ inConflict = true;
19861
+ inOurs = true;
19862
+ continue;
19863
+ }
19864
+ if (inConflict && line === "=======") {
19865
+ inOurs = false;
19866
+ continue;
19867
+ }
19868
+ if (inConflict && line.startsWith(">>>>>>> ")) {
19869
+ inConflict = false;
19870
+ inOurs = false;
19871
+ continue;
19872
+ }
19873
+ if (!inConflict || inOurs) {
19874
+ result.push(line);
19875
+ }
19876
+ }
19877
+ return result.join("\n");
19878
+ }
19664
19879
  async function bootstrap(outputDir, options) {
19665
19880
  const git = new GitClient(outputDir);
19666
19881
  const lockManager = new LockfileManager(outputDir);
@@ -20008,7 +20223,7 @@ function status(outputDir) {
20008
20223
  }
20009
20224
  var import_fs6, import_path8, import_yaml, import_crypto, import_promises4, import_os, import_path9, import_fs7, import_path10, import_crypto2, import_fs8, import_path11, import_yaml2, import_crypto3, import_fs9, import_path12, import_fs10, __defProp3, __getOwnPropNames3, __esm3, __export3, GitClient_exports, GitClient, init_GitClient, FERN_BOT_NAME2, FERN_BOT_EMAIL2, FERN_BOT_LOGIN2, FERN_SUPPORT_NAMES, LOCKFILE_HEADER, LockfileManager, INFRASTRUCTURE_FILES, ReplayDetector, BINARY_EXTENSIONS, ReplayApplicator, ReplayCommitter, ReplayService, FernignoreMigrator, REPLAY_FERNIGNORE_ENTRIES;
20010
20225
  var init_dist = __esm({
20011
- "../../node_modules/.pnpm/@fern-api+replay@0.7.0/node_modules/@fern-api/replay/dist/index.js"() {
20226
+ "../../node_modules/.pnpm/@fern-api+replay@0.8.0/node_modules/@fern-api/replay/dist/index.js"() {
20012
20227
  "use strict";
20013
20228
  init_esm4();
20014
20229
  import_fs6 = require("fs");
@@ -20142,6 +20357,9 @@ var init_dist = __esm({
20142
20357
  return false;
20143
20358
  }
20144
20359
  }
20360
+ async getCommitBody(commitSha) {
20361
+ return this.exec(["log", "-1", "--format=%B", commitSha]);
20362
+ }
20145
20363
  getRepoPath() {
20146
20364
  return this.repoPath;
20147
20365
  }
@@ -20307,14 +20525,14 @@ var init_dist = __esm({
20307
20525
  const lock = this.lockManager.read();
20308
20526
  const lastGen = this.getLastGeneration(lock);
20309
20527
  if (!lastGen) {
20310
- return [];
20528
+ return { patches: [], revertedPatchIds: [] };
20311
20529
  }
20312
20530
  const exists2 = await this.git.commitExists(lastGen.commit_sha);
20313
20531
  if (!exists2) {
20314
20532
  this.warnings.push(
20315
20533
  `Generation commit ${lastGen.commit_sha.slice(0, 7)} not found in git history. Skipping new patch detection. Existing lockfile patches will still be applied.`
20316
20534
  );
20317
- return [];
20535
+ return { patches: [], revertedPatchIds: [] };
20318
20536
  }
20319
20537
  const isAncestor = await this.git.isAncestor(lastGen.commit_sha, "HEAD");
20320
20538
  if (!isAncestor) {
@@ -20328,7 +20546,7 @@ var init_dist = __esm({
20328
20546
  this.sdkOutputDir
20329
20547
  ]);
20330
20548
  if (!log.trim()) {
20331
- return [];
20549
+ return { patches: [], revertedPatchIds: [] };
20332
20550
  }
20333
20551
  const commits = this.parseGitLog(log);
20334
20552
  const newPatches = [];
@@ -20364,7 +20582,60 @@ var init_dist = __esm({
20364
20582
  patch_content: patchContent
20365
20583
  });
20366
20584
  }
20367
- return newPatches.reverse();
20585
+ newPatches.reverse();
20586
+ const revertedPatchIdSet = /* @__PURE__ */ new Set();
20587
+ const revertIndicesToRemove = /* @__PURE__ */ new Set();
20588
+ for (let i = 0; i < newPatches.length; i++) {
20589
+ const patch = newPatches[i];
20590
+ if (!isRevertCommit(patch.original_message)) continue;
20591
+ let body = "";
20592
+ try {
20593
+ body = await this.git.getCommitBody(patch.original_commit);
20594
+ } catch {
20595
+ }
20596
+ const revertedSha = parseRevertedSha(body);
20597
+ const revertedMessage = parseRevertedMessage(patch.original_message);
20598
+ let matchedExisting = false;
20599
+ if (revertedSha) {
20600
+ const existing = lock.patches.find((p) => p.original_commit === revertedSha);
20601
+ if (existing) {
20602
+ revertedPatchIdSet.add(existing.id);
20603
+ revertIndicesToRemove.add(i);
20604
+ matchedExisting = true;
20605
+ }
20606
+ }
20607
+ if (!matchedExisting && revertedMessage) {
20608
+ const existing = lock.patches.find((p) => p.original_message === revertedMessage);
20609
+ if (existing) {
20610
+ revertedPatchIdSet.add(existing.id);
20611
+ revertIndicesToRemove.add(i);
20612
+ matchedExisting = true;
20613
+ }
20614
+ }
20615
+ if (matchedExisting) continue;
20616
+ let matchedNew = false;
20617
+ if (revertedSha) {
20618
+ const idx = newPatches.findIndex(
20619
+ (p, j) => j !== i && !revertIndicesToRemove.has(j) && p.original_commit === revertedSha
20620
+ );
20621
+ if (idx !== -1) {
20622
+ revertIndicesToRemove.add(i);
20623
+ revertIndicesToRemove.add(idx);
20624
+ matchedNew = true;
20625
+ }
20626
+ }
20627
+ if (!matchedNew && revertedMessage) {
20628
+ const idx = newPatches.findIndex(
20629
+ (p, j) => j !== i && !revertIndicesToRemove.has(j) && p.original_message === revertedMessage
20630
+ );
20631
+ if (idx !== -1) {
20632
+ revertIndicesToRemove.add(i);
20633
+ revertIndicesToRemove.add(idx);
20634
+ }
20635
+ }
20636
+ }
20637
+ const filteredPatches = newPatches.filter((_, i) => !revertIndicesToRemove.has(i));
20638
+ return { patches: filteredPatches, revertedPatchIds: [...revertedPatchIdSet] };
20368
20639
  }
20369
20640
  /**
20370
20641
  * Compute content hash for deduplication.
@@ -20375,31 +20646,34 @@ var init_dist = __esm({
20375
20646
  const normalized = patchContent.split("\n").filter((line) => !line.startsWith("From ") && !line.startsWith("index ") && !line.startsWith("Date: ")).join("\n");
20376
20647
  return `sha256:${(0, import_crypto.createHash)("sha256").update(normalized).digest("hex")}`;
20377
20648
  }
20378
- /** Detect patches via tree diff for non-linear history. Returns a composite patch. */
20649
+ /**
20650
+ * Detect patches via tree diff for non-linear history. Returns a composite patch.
20651
+ * Revert reconciliation is skipped here because tree-diff produces a single composite
20652
+ * patch from the aggregate diff — individual revert commits are not distinguishable.
20653
+ */
20379
20654
  async detectPatchesViaTreeDiff(lastGen) {
20380
20655
  const filesOutput = await this.git.exec(["diff", "--name-only", lastGen.commit_sha, "HEAD"]);
20381
20656
  const files = filesOutput.trim().split("\n").filter(Boolean).filter((f) => !INFRASTRUCTURE_FILES.has(f)).filter((f) => !f.startsWith(".fern/"));
20382
- if (files.length === 0) return [];
20657
+ if (files.length === 0) return { patches: [], revertedPatchIds: [] };
20383
20658
  const diff = await this.git.exec(["diff", lastGen.commit_sha, "HEAD", "--", ...files]);
20384
- if (!diff.trim()) return [];
20659
+ if (!diff.trim()) return { patches: [], revertedPatchIds: [] };
20385
20660
  const contentHash = this.computeContentHash(diff);
20386
20661
  const lock = this.lockManager.read();
20387
20662
  if (lock.patches.some((p) => p.content_hash === contentHash)) {
20388
- return [];
20663
+ return { patches: [], revertedPatchIds: [] };
20389
20664
  }
20390
20665
  const headSha = (await this.git.exec(["rev-parse", "HEAD"])).trim();
20391
- return [
20392
- {
20393
- id: `patch-composite-${headSha.slice(0, 8)}`,
20394
- content_hash: contentHash,
20395
- original_commit: headSha,
20396
- original_message: "Customer customizations (composite)",
20397
- original_author: "composite",
20398
- base_generation: lastGen.commit_sha,
20399
- files,
20400
- patch_content: diff
20401
- }
20402
- ];
20666
+ const compositePatch = {
20667
+ id: `patch-composite-${headSha.slice(0, 8)}`,
20668
+ content_hash: contentHash,
20669
+ original_commit: headSha,
20670
+ original_message: "Customer customizations (composite)",
20671
+ original_author: "composite",
20672
+ base_generation: lastGen.commit_sha,
20673
+ files,
20674
+ patch_content: diff
20675
+ };
20676
+ return { patches: [compositePatch], revertedPatchIds: [] };
20403
20677
  }
20404
20678
  parseGitLog(log) {
20405
20679
  return log.trim().split("\n").map((line) => {
@@ -21009,7 +21283,7 @@ CLI Version: ${options.cliVersion}`;
21009
21283
  }
21010
21284
  this.lockManager.save();
21011
21285
  try {
21012
- const redetectedPatches = await this.detector.detectNewPatches();
21286
+ const { patches: redetectedPatches } = await this.detector.detectNewPatches();
21013
21287
  if (redetectedPatches.length > 0) {
21014
21288
  const redetectedFiles = new Set(redetectedPatches.flatMap((p) => p.files));
21015
21289
  const currentPatches = this.lockManager.getPatches();
@@ -21100,7 +21374,7 @@ CLI Version: ${options.cliVersion}`;
21100
21374
  };
21101
21375
  }
21102
21376
  async handleNoPatchesRegeneration(options) {
21103
- const newPatches = await this.detector.detectNewPatches();
21377
+ const { patches: newPatches, revertedPatchIds } = await this.detector.detectNewPatches();
21104
21378
  const warnings = [...this.detector.warnings];
21105
21379
  if (options?.dryRun) {
21106
21380
  return {
@@ -21109,11 +21383,18 @@ CLI Version: ${options.cliVersion}`;
21109
21383
  patchesApplied: 0,
21110
21384
  patchesWithConflicts: 0,
21111
21385
  patchesSkipped: 0,
21386
+ patchesReverted: revertedPatchIds.length,
21112
21387
  conflicts: [],
21113
21388
  wouldApply: newPatches,
21114
21389
  warnings: warnings.length > 0 ? warnings : void 0
21115
21390
  };
21116
21391
  }
21392
+ for (const id of revertedPatchIds) {
21393
+ try {
21394
+ this.lockManager.removePatch(id);
21395
+ } catch {
21396
+ }
21397
+ }
21117
21398
  const commitOpts = options ? {
21118
21399
  cliVersion: options.cliVersion ?? "unknown",
21119
21400
  generatorVersions: options.generatorVersions ?? {},
@@ -21147,12 +21428,12 @@ CLI Version: ${options.cliVersion}`;
21147
21428
  await this.committer.stageAll();
21148
21429
  }
21149
21430
  }
21150
- return this.buildReport("no-patches", newPatches, results, options, warnings, rebaseCounts);
21431
+ return this.buildReport("no-patches", newPatches, results, options, warnings, rebaseCounts, void 0, revertedPatchIds.length);
21151
21432
  }
21152
21433
  async handleNormalRegeneration(options) {
21153
21434
  if (options?.dryRun) {
21154
21435
  const existingPatches2 = this.lockManager.getPatches();
21155
- const newPatches2 = await this.detector.detectNewPatches();
21436
+ const { patches: newPatches2, revertedPatchIds: dryRunReverted } = await this.detector.detectNewPatches();
21156
21437
  const warnings2 = [...this.detector.warnings];
21157
21438
  const allPatches2 = [...existingPatches2, ...newPatches2];
21158
21439
  return {
@@ -21161,13 +21442,19 @@ CLI Version: ${options.cliVersion}`;
21161
21442
  patchesApplied: 0,
21162
21443
  patchesWithConflicts: 0,
21163
21444
  patchesSkipped: 0,
21445
+ patchesReverted: dryRunReverted.length,
21164
21446
  conflicts: [],
21165
21447
  wouldApply: allPatches2,
21166
21448
  warnings: warnings2.length > 0 ? warnings2 : void 0
21167
21449
  };
21168
21450
  }
21169
21451
  let existingPatches = this.lockManager.getPatches();
21452
+ const preRebasePatchIds = new Set(existingPatches.map((p) => p.id));
21170
21453
  const preRebaseCounts = await this.preGenerationRebase(existingPatches);
21454
+ const postRebasePatchIds = new Set(this.lockManager.getPatches().map((p) => p.id));
21455
+ const removedByPreRebase = existingPatches.filter(
21456
+ (p) => preRebasePatchIds.has(p.id) && !postRebasePatchIds.has(p.id)
21457
+ );
21171
21458
  existingPatches = this.lockManager.getPatches();
21172
21459
  const seenHashes = /* @__PURE__ */ new Set();
21173
21460
  for (const p of existingPatches) {
@@ -21178,8 +21465,28 @@ CLI Version: ${options.cliVersion}`;
21178
21465
  }
21179
21466
  }
21180
21467
  existingPatches = this.lockManager.getPatches();
21181
- const newPatches = await this.detector.detectNewPatches();
21468
+ let { patches: newPatches, revertedPatchIds } = await this.detector.detectNewPatches();
21182
21469
  const warnings = [...this.detector.warnings];
21470
+ if (removedByPreRebase.length > 0) {
21471
+ const removedOriginalCommits = new Set(removedByPreRebase.map((p) => p.original_commit));
21472
+ const removedOriginalMessages = new Set(removedByPreRebase.map((p) => p.original_message));
21473
+ newPatches = newPatches.filter((p) => {
21474
+ if (removedOriginalCommits.has(p.original_commit)) return false;
21475
+ if (isRevertCommit(p.original_message)) {
21476
+ const revertedMsg = parseRevertedMessage(p.original_message);
21477
+ if (revertedMsg && removedOriginalMessages.has(revertedMsg)) return false;
21478
+ }
21479
+ return true;
21480
+ });
21481
+ }
21482
+ for (const id of revertedPatchIds) {
21483
+ try {
21484
+ this.lockManager.removePatch(id);
21485
+ } catch {
21486
+ }
21487
+ }
21488
+ const revertedSet = new Set(revertedPatchIds);
21489
+ existingPatches = existingPatches.filter((p) => !revertedSet.has(p.id));
21183
21490
  const allPatches = [...existingPatches, ...newPatches];
21184
21491
  const commitOpts = options ? {
21185
21492
  cliVersion: options.cliVersion ?? "unknown",
@@ -21224,7 +21531,8 @@ CLI Version: ${options.cliVersion}`;
21224
21531
  options,
21225
21532
  warnings,
21226
21533
  rebaseCounts,
21227
- preRebaseCounts
21534
+ preRebaseCounts,
21535
+ revertedPatchIds.length
21228
21536
  );
21229
21537
  }
21230
21538
  /**
@@ -21417,36 +21725,6 @@ CLI Version: ${options.cliVersion}`;
21417
21725
  }
21418
21726
  return { conflictResolved, conflictAbsorbed, contentRefreshed };
21419
21727
  }
21420
- /**
21421
- * Strip conflict markers from file content, keeping the OURS (Generated) side.
21422
- * Preserves clean patches' non-conflicting changes on shared files.
21423
- */
21424
- stripConflictMarkers(content) {
21425
- const lines = content.split("\n");
21426
- const result = [];
21427
- let inConflict = false;
21428
- let inOurs = false;
21429
- for (const line of lines) {
21430
- if (line.startsWith("<<<<<<< ")) {
21431
- inConflict = true;
21432
- inOurs = true;
21433
- continue;
21434
- }
21435
- if (inConflict && line === "=======") {
21436
- inOurs = false;
21437
- continue;
21438
- }
21439
- if (inConflict && line.startsWith(">>>>>>> ")) {
21440
- inConflict = false;
21441
- inOurs = false;
21442
- continue;
21443
- }
21444
- if (!inConflict || inOurs) {
21445
- result.push(line);
21446
- }
21447
- }
21448
- return result.join("\n");
21449
- }
21450
21728
  /**
21451
21729
  * After applyPatches(), strip conflict markers from conflicting files
21452
21730
  * so only clean content is committed. Keeps the Generated (OURS) side.
@@ -21459,7 +21737,7 @@ CLI Version: ${options.cliVersion}`;
21459
21737
  const filePath = (0, import_path10.join)(this.outputDir, fileResult.file);
21460
21738
  try {
21461
21739
  const content = (0, import_fs7.readFileSync)(filePath, "utf-8");
21462
- const stripped = this.stripConflictMarkers(content);
21740
+ const stripped = stripConflictMarkers(content);
21463
21741
  (0, import_fs7.writeFileSync)(filePath, stripped);
21464
21742
  } catch {
21465
21743
  }
@@ -21471,7 +21749,7 @@ CLI Version: ${options.cliVersion}`;
21471
21749
  if (!(0, import_fs7.existsSync)(fernignorePath)) return [];
21472
21750
  return (0, import_fs7.readFileSync)(fernignorePath, "utf-8").split("\n").map((line) => line.trim()).filter((line) => line && !line.startsWith("#"));
21473
21751
  }
21474
- buildReport(flow, patches, results, options, warnings, rebaseCounts, preRebaseCounts) {
21752
+ buildReport(flow, patches, results, options, warnings, rebaseCounts, preRebaseCounts, patchesReverted) {
21475
21753
  const conflictResults = results.filter((r) => r.status === "conflict");
21476
21754
  const conflictDetails = conflictResults.map((r) => {
21477
21755
  const conflictFiles = r.fileResults?.filter((f) => f.status === "conflict") ?? [];
@@ -21496,6 +21774,7 @@ CLI Version: ${options.cliVersion}`;
21496
21774
  patchesRepointed: rebaseCounts && rebaseCounts.repointed > 0 ? rebaseCounts.repointed : void 0,
21497
21775
  patchesContentRebased: rebaseCounts && rebaseCounts.contentRebased > 0 ? rebaseCounts.contentRebased : void 0,
21498
21776
  patchesKeptAsUserOwned: rebaseCounts && rebaseCounts.keptAsUserOwned > 0 ? rebaseCounts.keptAsUserOwned : void 0,
21777
+ patchesReverted: patchesReverted && patchesReverted > 0 ? patchesReverted : void 0,
21499
21778
  patchesConflictResolved: preRebaseCounts && preRebaseCounts.conflictResolved + preRebaseCounts.conflictAbsorbed > 0 ? preRebaseCounts.conflictResolved + preRebaseCounts.conflictAbsorbed : void 0,
21500
21779
  patchesRefreshed: preRebaseCounts && preRebaseCounts.contentRefreshed > 0 ? preRebaseCounts.contentRefreshed : void 0,
21501
21780
  conflicts: conflictResults.flatMap((r) => r.fileResults?.filter((f) => f.status === "conflict") ?? []),
@@ -21535,7 +21814,7 @@ CLI Version: ${options.cliVersion}`;
21535
21814
  async analyzeMigration() {
21536
21815
  const patterns = this.readFernignorePatterns();
21537
21816
  const detector = new ReplayDetector(this.git, this.lockManager, this.outputDir);
21538
- const patches = await detector.detectNewPatches();
21817
+ const { patches } = await detector.detectNewPatches();
21539
21818
  const trackedByBoth = [];
21540
21819
  const fernignoreOnly = [];
21541
21820
  const commitsOnly = [];
@@ -21660,7 +21939,7 @@ CLI Version: ${options.cliVersion}`;
21660
21939
  async migrate() {
21661
21940
  const analysis = await this.analyzeMigration();
21662
21941
  const detector = new ReplayDetector(this.git, this.lockManager, this.outputDir);
21663
- const patches = await detector.detectNewPatches();
21942
+ const { patches } = await detector.detectNewPatches();
21664
21943
  const warnings = [];
21665
21944
  let patchesCreated = 0;
21666
21945
  for (const patch of patches) {
@@ -27432,17 +27711,17 @@ async function githubRelease(params) {
27432
27711
  await github.release();
27433
27712
  }
27434
27713
 
27435
- // ../../node_modules/.pnpm/es-toolkit@1.44.0/node_modules/es-toolkit/dist/predicate/isLength.mjs
27714
+ // ../../node_modules/.pnpm/es-toolkit@1.45.1/node_modules/es-toolkit/dist/predicate/isLength.mjs
27436
27715
  function isLength(value) {
27437
27716
  return Number.isSafeInteger(value) && value >= 0;
27438
27717
  }
27439
27718
 
27440
- // ../../node_modules/.pnpm/es-toolkit@1.44.0/node_modules/es-toolkit/dist/compat/predicate/isArrayLike.mjs
27719
+ // ../../node_modules/.pnpm/es-toolkit@1.45.1/node_modules/es-toolkit/dist/compat/predicate/isArrayLike.mjs
27441
27720
  function isArrayLike2(value) {
27442
27721
  return value != null && typeof value !== "function" && isLength(value.length);
27443
27722
  }
27444
27723
 
27445
- // ../../node_modules/.pnpm/es-toolkit@1.44.0/node_modules/es-toolkit/dist/compat/util/toString.mjs
27724
+ // ../../node_modules/.pnpm/es-toolkit@1.45.1/node_modules/es-toolkit/dist/compat/util/toString.mjs
27446
27725
  function toString(value) {
27447
27726
  if (value == null) {
27448
27727
  return "";
@@ -27460,17 +27739,17 @@ function toString(value) {
27460
27739
  return result;
27461
27740
  }
27462
27741
 
27463
- // ../../node_modules/.pnpm/es-toolkit@1.44.0/node_modules/es-toolkit/dist/compat/predicate/isObject.mjs
27742
+ // ../../node_modules/.pnpm/es-toolkit@1.45.1/node_modules/es-toolkit/dist/compat/predicate/isObject.mjs
27464
27743
  function isObject(value) {
27465
27744
  return value !== null && (typeof value === "object" || typeof value === "function");
27466
27745
  }
27467
27746
 
27468
- // ../../node_modules/.pnpm/es-toolkit@1.44.0/node_modules/es-toolkit/dist/_internal/isEqualsSameValueZero.mjs
27747
+ // ../../node_modules/.pnpm/es-toolkit@1.45.1/node_modules/es-toolkit/dist/_internal/isEqualsSameValueZero.mjs
27469
27748
  function isEqualsSameValueZero(value, other) {
27470
27749
  return value === other || Number.isNaN(value) && Number.isNaN(other);
27471
27750
  }
27472
27751
 
27473
- // ../../node_modules/.pnpm/es-toolkit@1.44.0/node_modules/es-toolkit/dist/compat/_internal/isIndex.mjs
27752
+ // ../../node_modules/.pnpm/es-toolkit@1.45.1/node_modules/es-toolkit/dist/compat/_internal/isIndex.mjs
27474
27753
  var IS_UNSIGNED_INTEGER = /^(?:0|[1-9]\d*)$/;
27475
27754
  function isIndex(value, length = Number.MAX_SAFE_INTEGER) {
27476
27755
  switch (typeof value) {
@@ -27486,7 +27765,7 @@ function isIndex(value, length = Number.MAX_SAFE_INTEGER) {
27486
27765
  }
27487
27766
  }
27488
27767
 
27489
- // ../../node_modules/.pnpm/es-toolkit@1.44.0/node_modules/es-toolkit/dist/compat/_internal/isIterateeCall.mjs
27768
+ // ../../node_modules/.pnpm/es-toolkit@1.45.1/node_modules/es-toolkit/dist/compat/_internal/isIterateeCall.mjs
27490
27769
  function isIterateeCall(value, index, object2) {
27491
27770
  if (!isObject(object2)) {
27492
27771
  return false;
@@ -27497,12 +27776,12 @@ function isIterateeCall(value, index, object2) {
27497
27776
  return false;
27498
27777
  }
27499
27778
 
27500
- // ../../node_modules/.pnpm/es-toolkit@1.44.0/node_modules/es-toolkit/dist/predicate/isNil.mjs
27779
+ // ../../node_modules/.pnpm/es-toolkit@1.45.1/node_modules/es-toolkit/dist/predicate/isNil.mjs
27501
27780
  function isNil(x) {
27502
27781
  return x == null;
27503
27782
  }
27504
27783
 
27505
- // ../../node_modules/.pnpm/es-toolkit@1.44.0/node_modules/es-toolkit/dist/compat/function/attempt.mjs
27784
+ // ../../node_modules/.pnpm/es-toolkit@1.45.1/node_modules/es-toolkit/dist/compat/function/attempt.mjs
27506
27785
  function attempt(func, ...args) {
27507
27786
  try {
27508
27787
  return func(...args);
@@ -27511,7 +27790,7 @@ function attempt(func, ...args) {
27511
27790
  }
27512
27791
  }
27513
27792
 
27514
- // ../../node_modules/.pnpm/es-toolkit@1.44.0/node_modules/es-toolkit/dist/compat/object/defaults.mjs
27793
+ // ../../node_modules/.pnpm/es-toolkit@1.45.1/node_modules/es-toolkit/dist/compat/object/defaults.mjs
27515
27794
  function defaults2(object2, ...sources) {
27516
27795
  object2 = Object(object2);
27517
27796
  const objectProto = Object.prototype;
@@ -27537,18 +27816,18 @@ function defaults2(object2, ...sources) {
27537
27816
  return object2;
27538
27817
  }
27539
27818
 
27540
- // ../../node_modules/.pnpm/es-toolkit@1.44.0/node_modules/es-toolkit/dist/string/capitalize.mjs
27819
+ // ../../node_modules/.pnpm/es-toolkit@1.45.1/node_modules/es-toolkit/dist/string/capitalize.mjs
27541
27820
  function capitalize(str) {
27542
27821
  return str.charAt(0).toUpperCase() + str.slice(1).toLowerCase();
27543
27822
  }
27544
27823
 
27545
- // ../../node_modules/.pnpm/es-toolkit@1.44.0/node_modules/es-toolkit/dist/string/words.mjs
27824
+ // ../../node_modules/.pnpm/es-toolkit@1.45.1/node_modules/es-toolkit/dist/string/words.mjs
27546
27825
  var CASE_SPLIT_PATTERN = /\p{Lu}?\p{Ll}+|[0-9]+|\p{Lu}+(?!\p{Ll})|\p{Emoji_Presentation}|\p{Extended_Pictographic}|\p{L}+/gu;
27547
27826
  function words(str) {
27548
27827
  return Array.from(str.match(CASE_SPLIT_PATTERN) ?? []);
27549
27828
  }
27550
27829
 
27551
- // ../../node_modules/.pnpm/es-toolkit@1.44.0/node_modules/es-toolkit/dist/string/camelCase.mjs
27830
+ // ../../node_modules/.pnpm/es-toolkit@1.45.1/node_modules/es-toolkit/dist/string/camelCase.mjs
27552
27831
  function camelCase2(str) {
27553
27832
  const words$1 = words(str);
27554
27833
  if (words$1.length === 0) {
@@ -27558,7 +27837,7 @@ function camelCase2(str) {
27558
27837
  return `${first2.toLowerCase()}${rest.map((word) => capitalize(word)).join("")}`;
27559
27838
  }
27560
27839
 
27561
- // ../../node_modules/.pnpm/es-toolkit@1.44.0/node_modules/es-toolkit/dist/string/escape.mjs
27840
+ // ../../node_modules/.pnpm/es-toolkit@1.45.1/node_modules/es-toolkit/dist/string/escape.mjs
27562
27841
  var htmlEscapes = {
27563
27842
  "&": "&amp;",
27564
27843
  "<": "&lt;",
@@ -27570,18 +27849,18 @@ function escape2(str) {
27570
27849
  return str.replace(/[&<>"']/g, (match2) => htmlEscapes[match2]);
27571
27850
  }
27572
27851
 
27573
- // ../../node_modules/.pnpm/es-toolkit@1.44.0/node_modules/es-toolkit/dist/compat/string/escape.mjs
27852
+ // ../../node_modules/.pnpm/es-toolkit@1.45.1/node_modules/es-toolkit/dist/compat/string/escape.mjs
27574
27853
  function escape3(string2) {
27575
27854
  return escape2(toString(string2));
27576
27855
  }
27577
27856
 
27578
- // ../../node_modules/.pnpm/es-toolkit@1.44.0/node_modules/es-toolkit/dist/string/snakeCase.mjs
27857
+ // ../../node_modules/.pnpm/es-toolkit@1.45.1/node_modules/es-toolkit/dist/string/snakeCase.mjs
27579
27858
  function snakeCase(str) {
27580
27859
  const words$1 = words(str);
27581
27860
  return words$1.map((word) => word.toLowerCase()).join("_");
27582
27861
  }
27583
27862
 
27584
- // ../../node_modules/.pnpm/es-toolkit@1.44.0/node_modules/es-toolkit/dist/compat/string/template.mjs
27863
+ // ../../node_modules/.pnpm/es-toolkit@1.45.1/node_modules/es-toolkit/dist/compat/string/template.mjs
27585
27864
  var esTemplateRegExp = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g;
27586
27865
  var unEscapedRegExp = /['\n\r\u2028\u2029\\]/g;
27587
27866
  var noMatchExp = /($^)/;
@@ -27667,7 +27946,7 @@ ${source}
27667
27946
  return result;
27668
27947
  }
27669
27948
 
27670
- // ../../node_modules/.pnpm/es-toolkit@1.44.0/node_modules/es-toolkit/dist/string/upperFirst.mjs
27949
+ // ../../node_modules/.pnpm/es-toolkit@1.45.1/node_modules/es-toolkit/dist/string/upperFirst.mjs
27671
27950
  function upperFirst(str) {
27672
27951
  return str.substring(0, 1).toUpperCase() + str.substring(1);
27673
27952
  }
@@ -31750,7 +32029,7 @@ var import_path14 = require("path");
31750
32029
  var import_fs11 = require("fs");
31751
32030
  var import_promises5 = require("fs/promises");
31752
32031
  var import_path13 = require("path");
31753
- var REPLAY_FERNIGNORE_ENTRIES2 = [".fern/replay.lock", ".fern/replay.yml"];
32032
+ var REPLAY_FERNIGNORE_ENTRIES2 = [".fern/replay.lock"];
31754
32033
  async function ensureReplayFernignoreEntries(outputDir) {
31755
32034
  const fernignorePath = (0, import_path13.join)(outputDir, ".fernignore");
31756
32035
  let content = "";
@@ -32058,12 +32337,11 @@ async function replayInit(params) {
32058
32337
  const { githubRepo, token, dryRun } = params;
32059
32338
  const tmpDir = await import_tmp_promise2.default.dir({ unsafeCleanup: true });
32060
32339
  const repoPath = tmpDir.path;
32061
- const repository = await cloneRepository({
32340
+ await cloneRepository({
32062
32341
  githubRepository: githubRepo,
32063
32342
  installationToken: token,
32064
32343
  targetDirectory: repoPath
32065
32344
  });
32066
- const defaultBranch = await repository.getDefaultBranch();
32067
32345
  const bootstrapResult = await bootstrap(repoPath, {
32068
32346
  dryRun,
32069
32347
  fernignoreAction: "skip",
@@ -32072,52 +32350,22 @@ async function replayInit(params) {
32072
32350
  importHistory: params.importHistory
32073
32351
  });
32074
32352
  if (!bootstrapResult.generationCommit) {
32075
- return { bootstrap: bootstrapResult };
32353
+ return { bootstrap: bootstrapResult, fernignoreEntries: [] };
32076
32354
  }
32077
32355
  if (dryRun) {
32078
- return { bootstrap: bootstrapResult };
32356
+ return { bootstrap: bootstrapResult, fernignoreEntries: [] };
32079
32357
  }
32080
32358
  ensureReplayFernignoreEntriesSync(repoPath);
32081
- const commitMessage = `[fern-replay] Initialize Replay
32082
-
32083
- Tracked ${bootstrapResult.patchesCreated} customization patch(es).
32084
- Base generation: ${bootstrapResult.generationCommit.sha.slice(0, 7)}`;
32085
- const filesToAdd = [".fern/replay.lock", ".fern/replay.yml", ".fernignore"].filter(
32086
- (f) => (0, import_fs13.existsSync)((0, import_path15.join)(repoPath, f))
32087
- );
32088
- const branchName = `fern-replay/init-${Date.now()}`;
32089
- await repository.checkoutOrCreateLocal(branchName);
32090
- const git = new GitClient(repoPath);
32091
- await git.exec(["add", ...filesToAdd]);
32092
- await git.exec([
32093
- "-c",
32094
- `user.name=${FERN_BOT_NAME2}`,
32095
- "-c",
32096
- `user.email=${FERN_BOT_EMAIL2}`,
32097
- "-c",
32098
- "commit.gpgsign=false",
32099
- "commit",
32100
- "--no-verify",
32101
- "-m",
32102
- commitMessage
32103
- ]);
32104
- await repository.pushUpstream(branchName);
32105
- const parsed = parseRepository(githubRepo);
32106
- const octokit = new Octokit2({ auth: token });
32107
- const prTitle = params.prTitle ?? "[fern-replay] Initialize Replay for SDK customizations";
32108
- const prBody = params.prBody ?? buildPrBody(bootstrapResult);
32109
- const { data: pr } = await octokit.pulls.create({
32110
- owner: parsed.owner,
32111
- repo: parsed.repo,
32112
- head: branchName,
32113
- base: defaultBranch,
32114
- title: prTitle,
32115
- body: prBody
32116
- });
32359
+ const lockfilePath = (0, import_path15.join)(repoPath, ".fern", "replay.lock");
32360
+ const lockfileContent = (0, import_fs13.existsSync)(lockfilePath) ? (0, import_fs13.readFileSync)(lockfilePath, "utf-8") : void 0;
32361
+ const replayYmlPath = (0, import_path15.join)(repoPath, ".fern", "replay.yml");
32362
+ const replayYmlContent = (0, import_fs13.existsSync)(replayYmlPath) ? (0, import_fs13.readFileSync)(replayYmlPath, "utf-8") : void 0;
32117
32363
  return {
32118
32364
  bootstrap: bootstrapResult,
32119
- prUrl: pr.html_url,
32120
- branch: branchName
32365
+ lockfileContent,
32366
+ replayYmlContent,
32367
+ fernignoreEntries: REPLAY_FERNIGNORE_ENTRIES2,
32368
+ prBody: buildPrBody(bootstrapResult)
32121
32369
  };
32122
32370
  }
32123
32371
  function formatBootstrapSummary(result) {
@@ -32176,14 +32424,6 @@ function formatBootstrapSummary(result) {
32176
32424
  entries2.push({ level: "warn", message: ` ${w}` });
32177
32425
  }
32178
32426
  }
32179
- if (result.prUrl) {
32180
- entries2.push({ level: "info", message: `
32181
- PR created: ${result.prUrl}` });
32182
- entries2.push({ level: "info", message: "Merge the PR to enable Replay for this repository." });
32183
- } else if (result.branch) {
32184
- entries2.push({ level: "info", message: `
32185
- Pushed to branch: ${result.branch}` });
32186
- }
32187
32427
  return entries2;
32188
32428
  }
32189
32429
  function buildPrBody(result) {
@@ -32486,12 +32726,6 @@ ${result.errors.map((e) => ` - ${e}`).join("\n")}
32486
32726
  }).option("max-commits", {
32487
32727
  type: "number",
32488
32728
  description: "Max commits to scan for generation history"
32489
- }).option("pr-title", {
32490
- type: "string",
32491
- description: "Custom title for the PR"
32492
- }).option("pr-body", {
32493
- type: "string",
32494
- description: "Custom body for the PR"
32495
32729
  }).option("force", {
32496
32730
  type: "boolean",
32497
32731
  default: false,
@@ -32515,8 +32749,6 @@ ${result.errors.map((e) => ` - ${e}`).join("\n")}
32515
32749
  token: argv.token,
32516
32750
  dryRun: argv["dry-run"],
32517
32751
  maxCommitsToScan: argv["max-commits"],
32518
- prTitle: argv["pr-title"],
32519
- prBody: argv["pr-body"],
32520
32752
  force: argv.force,
32521
32753
  importHistory: argv["import-history"]
32522
32754
  });