@savvy-web/silk 3.5.2 → 3.7.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.
@@ -2335,7 +2335,7 @@ var GlobSet = class GlobSet extends effect.Schema.Class("GlobSet")(effect.Schema
2335
2335
  }
2336
2336
  };
2337
2337
  //#endregion
2338
- //#region ../../node_modules/.pnpm/@effected+lockfiles@0.4.0_@effected+jsonc@0.6.0_effect@4.0.0-beta.107__@effected+npm@0._83da5ef372786d059bed7f4a907143ef/node_modules/@effected/lockfiles/BunExtension.js
2338
+ //#region ../../node_modules/.pnpm/@effected+lockfiles@0.4.1_@effected+jsonc@0.6.0_effect@4.0.0-beta.107__@effected+npm@0._0858c2cd87fcfa2cb556a350de7e385b/node_modules/@effected/lockfiles/BunExtension.js
2339
2339
  /**
2340
2340
  * Extension data specific to bun lockfiles, attached to `Lockfile.extension`
2341
2341
  * when the format is `"bun"`.
@@ -5469,7 +5469,7 @@ var ReleaseAgeGate = class ReleaseAgeGate extends effect.Schema.Class("ReleaseAg
5469
5469
  }
5470
5470
  };
5471
5471
  //#endregion
5472
- //#region ../../node_modules/.pnpm/@effected+lockfiles@0.4.0_@effected+jsonc@0.6.0_effect@4.0.0-beta.107__@effected+npm@0._83da5ef372786d059bed7f4a907143ef/node_modules/@effected/lockfiles/ImporterDependency.js
5472
+ //#region ../../node_modules/.pnpm/@effected+lockfiles@0.4.1_@effected+jsonc@0.6.0_effect@4.0.0-beta.107__@effected+npm@0._0858c2cd87fcfa2cb556a350de7e385b/node_modules/@effected/lockfiles/ImporterDependency.js
5473
5473
  /**
5474
5474
  * One declared dependency of one workspace importer, as the lockfile records it.
5475
5475
  *
@@ -5507,7 +5507,7 @@ var ImporterDependency = class extends effect.Schema.Class("ImporterDependency")
5507
5507
  depType: DependencyField
5508
5508
  }) {};
5509
5509
  //#endregion
5510
- //#region ../../node_modules/.pnpm/@effected+lockfiles@0.4.0_@effected+jsonc@0.6.0_effect@4.0.0-beta.107__@effected+npm@0._83da5ef372786d059bed7f4a907143ef/node_modules/@effected/lockfiles/LockfileImporter.js
5510
+ //#region ../../node_modules/.pnpm/@effected+lockfiles@0.4.1_@effected+jsonc@0.6.0_effect@4.0.0-beta.107__@effected+npm@0._0858c2cd87fcfa2cb556a350de7e385b/node_modules/@effected/lockfiles/LockfileImporter.js
5511
5511
  /**
5512
5512
  * One workspace importer's declared dependencies, as the lockfile records them.
5513
5513
  *
@@ -5531,7 +5531,7 @@ var LockfileImporter = class extends effect.Schema.Class("LockfileImporter")({
5531
5531
  dependencies: effect.Schema.Array(ImporterDependency)
5532
5532
  }) {};
5533
5533
  //#endregion
5534
- //#region ../../node_modules/.pnpm/@effected+lockfiles@0.4.0_@effected+jsonc@0.6.0_effect@4.0.0-beta.107__@effected+npm@0._83da5ef372786d059bed7f4a907143ef/node_modules/@effected/lockfiles/ResolvedPackage.js
5534
+ //#region ../../node_modules/.pnpm/@effected+lockfiles@0.4.1_@effected+jsonc@0.6.0_effect@4.0.0-beta.107__@effected+npm@0._0858c2cd87fcfa2cb556a350de7e385b/node_modules/@effected/lockfiles/ResolvedPackage.js
5535
5535
  const EMPTY_DEPENDENCIES = {};
5536
5536
  /**
5537
5537
  * A package resolved from a lockfile.
@@ -5566,7 +5566,7 @@ var ResolvedPackage = class extends effect.Schema.Class("ResolvedPackage")({
5566
5566
  dependencies: effect.Schema.Record(effect.Schema.String, effect.Schema.String).pipe(effect.Schema.withDecodingDefaultKey(effect.Effect.succeed(EMPTY_DEPENDENCIES)), effect.Schema.withConstructorDefault(effect.Effect.succeed(EMPTY_DEPENDENCIES)))
5567
5567
  }) {};
5568
5568
  //#endregion
5569
- //#region ../../node_modules/.pnpm/@effected+lockfiles@0.4.0_@effected+jsonc@0.6.0_effect@4.0.0-beta.107__@effected+npm@0._83da5ef372786d059bed7f4a907143ef/node_modules/@effected/lockfiles/WorkspaceDependency.js
5569
+ //#region ../../node_modules/.pnpm/@effected+lockfiles@0.4.1_@effected+jsonc@0.6.0_effect@4.0.0-beta.107__@effected+npm@0._0858c2cd87fcfa2cb556a350de7e385b/node_modules/@effected/lockfiles/WorkspaceDependency.js
5570
5570
  /**
5571
5571
  * A directed dependency edge between two workspace packages as recorded in
5572
5572
  * the lockfile.
@@ -5588,7 +5588,7 @@ var WorkspaceDependency = class extends effect.Schema.Class("WorkspaceDependency
5588
5588
  constraint: effect.Schema.String
5589
5589
  }) {};
5590
5590
  //#endregion
5591
- //#region ../../node_modules/.pnpm/@effected+lockfiles@0.4.0_@effected+jsonc@0.6.0_effect@4.0.0-beta.107__@effected+npm@0._83da5ef372786d059bed7f4a907143ef/node_modules/@effected/lockfiles/PnpmExtension.js
5591
+ //#region ../../node_modules/.pnpm/@effected+lockfiles@0.4.1_@effected+jsonc@0.6.0_effect@4.0.0-beta.107__@effected+npm@0._0858c2cd87fcfa2cb556a350de7e385b/node_modules/@effected/lockfiles/PnpmExtension.js
5592
5592
  /**
5593
5593
  * Extension data specific to pnpm lockfiles, attached to `Lockfile.extension`
5594
5594
  * when the format is `"pnpm"`.
@@ -5613,7 +5613,7 @@ var PnpmExtension = class extends effect.Schema.Class("PnpmExtension")({
5613
5613
  }))
5614
5614
  }) {};
5615
5615
  //#endregion
5616
- //#region ../../node_modules/.pnpm/@effected+lockfiles@0.4.0_@effected+jsonc@0.6.0_effect@4.0.0-beta.107__@effected+npm@0._83da5ef372786d059bed7f4a907143ef/node_modules/@effected/lockfiles/LockfileFormat.js
5616
+ //#region ../../node_modules/.pnpm/@effected+lockfiles@0.4.1_@effected+jsonc@0.6.0_effect@4.0.0-beta.107__@effected+npm@0._0858c2cd87fcfa2cb556a350de7e385b/node_modules/@effected/lockfiles/LockfileFormat.js
5617
5617
  /**
5618
5618
  * The lockfile formats this package parses: bun's `bun.lock` (JSONC), npm's
5619
5619
  * `package-lock.json` (v2/v3 JSON), pnpm's `pnpm-lock.yaml` and yarn Berry's
@@ -5651,7 +5651,7 @@ const FILENAMES = {
5651
5651
  */
5652
5652
  const filenameFor = (format) => FILENAMES[format][0];
5653
5653
  //#endregion
5654
- //#region ../../node_modules/.pnpm/@effected+lockfiles@0.4.0_@effected+jsonc@0.6.0_effect@4.0.0-beta.107__@effected+npm@0._83da5ef372786d059bed7f4a907143ef/node_modules/@effected/lockfiles/internal/shared.js
5654
+ //#region ../../node_modules/.pnpm/@effected+lockfiles@0.4.1_@effected+jsonc@0.6.0_effect@4.0.0-beta.107__@effected+npm@0._0858c2cd87fcfa2cb556a350de7e385b/node_modules/@effected/lockfiles/internal/shared.js
5655
5655
  /**
5656
5656
  * The four dependency sections of a manifest, in a stable order — the shared
5657
5657
  * dependency-sections table (v3's `DEP_SECTIONS`). Each entry is both the
@@ -7580,7 +7580,7 @@ var JsoncModifier = class {
7580
7580
  });
7581
7581
  };
7582
7582
  //#endregion
7583
- //#region ../../node_modules/.pnpm/@effected+lockfiles@0.4.0_@effected+jsonc@0.6.0_effect@4.0.0-beta.107__@effected+npm@0._83da5ef372786d059bed7f4a907143ef/node_modules/@effected/lockfiles/internal/bun.js
7583
+ //#region ../../node_modules/.pnpm/@effected+lockfiles@0.4.1_@effected+jsonc@0.6.0_effect@4.0.0-beta.107__@effected+npm@0._0858c2cd87fcfa2cb556a350de7e385b/node_modules/@effected/lockfiles/internal/bun.js
7584
7584
  const DepRecord$2 = effect.Schema.optionalKey(effect.Schema.Record(effect.Schema.String, effect.Schema.String));
7585
7585
  const BunWorkspaceEntry = effect.Schema.Struct({
7586
7586
  name: effect.Schema.optionalKey(effect.Schema.String),
@@ -7673,7 +7673,7 @@ const toFields$3 = (raw) => effect.Effect.gen(function* () {
7673
7673
  };
7674
7674
  });
7675
7675
  //#endregion
7676
- //#region ../../node_modules/.pnpm/@effected+lockfiles@0.4.0_@effected+jsonc@0.6.0_effect@4.0.0-beta.107__@effected+npm@0._83da5ef372786d059bed7f4a907143ef/node_modules/@effected/lockfiles/internal/npm.js
7676
+ //#region ../../node_modules/.pnpm/@effected+lockfiles@0.4.1_@effected+jsonc@0.6.0_effect@4.0.0-beta.107__@effected+npm@0._0858c2cd87fcfa2cb556a350de7e385b/node_modules/@effected/lockfiles/internal/npm.js
7677
7677
  const DepRecord$1 = effect.Schema.optionalKey(effect.Schema.Record(effect.Schema.String, effect.Schema.String));
7678
7678
  const NpmPackageEntry = effect.Schema.Struct({
7679
7679
  name: effect.Schema.optionalKey(effect.Schema.String),
@@ -7771,7 +7771,7 @@ const toFields$2 = (raw) => effect.Effect.gen(function* () {
7771
7771
  };
7772
7772
  });
7773
7773
  //#endregion
7774
- //#region ../../node_modules/.pnpm/@effected+yaml@0.7.0_effect@4.0.0-beta.107/node_modules/@effected/yaml/YamlNode.js
7774
+ //#region ../../node_modules/.pnpm/@effected+yaml@0.8.0_effect@4.0.0-beta.107/node_modules/@effected/yaml/YamlNode.js
7775
7775
  /**
7776
7776
  * YAML scalar presentation styles.
7777
7777
  *
@@ -7820,9 +7820,17 @@ const ScalarChomp = effect.Schema.Literals([
7820
7820
  * - `style` — the scalar presentation style in the source document.
7821
7821
  * - `tag` — optional explicit YAML tag (e.g. `!!str`, `!!int`).
7822
7822
  * - `anchor` — optional anchor name for aliasing.
7823
- * - `comment` — optional trailing or leading comment text.
7823
+ * - `commentBefore` — own-line comment text directly above the node
7824
+ * (multiple consecutive comment lines join with `\n`).
7825
+ * - `comment` — trailing comment text on the node's line (strictly trailing;
7826
+ * own-line comments live on `commentBefore`).
7827
+ * - `spaceBefore` — `true` when a blank line precedes the node (and its
7828
+ * `commentBefore` block, when present) in the source.
7824
7829
  * - `chomp` — block-scalar chomping indicator, when the scalar is a block
7825
7830
  * scalar.
7831
+ * - `blockIndent` — the EXPLICIT indentation-indicator digit from a block
7832
+ * scalar's header (`|2`, `>1+`), when the source spelled one; absent when
7833
+ * the header let the reader auto-detect the indent.
7826
7834
  * - `raw` — the raw source text, preserved when it differs from the resolved
7827
7835
  * value in a way stringification needs to know about.
7828
7836
  * - `sourceMultiline` — `true` when the source span covers two or more lines;
@@ -7836,8 +7844,11 @@ var YamlScalar = class extends effect.Schema.TaggedClass()("YamlScalar", {
7836
7844
  tag: effect.Schema.optionalKey(effect.Schema.String),
7837
7845
  style: ScalarStyle,
7838
7846
  anchor: effect.Schema.optionalKey(effect.Schema.String),
7847
+ commentBefore: effect.Schema.optionalKey(effect.Schema.String),
7839
7848
  comment: effect.Schema.optionalKey(effect.Schema.String),
7849
+ spaceBefore: effect.Schema.optionalKey(effect.Schema.Boolean),
7840
7850
  chomp: effect.Schema.optionalKey(ScalarChomp),
7851
+ blockIndent: effect.Schema.optionalKey(effect.Schema.Number),
7841
7852
  raw: effect.Schema.optionalKey(effect.Schema.String),
7842
7853
  sourceMultiline: effect.Schema.optionalKey(effect.Schema.Boolean),
7843
7854
  offset: effect.Schema.Number,
@@ -7928,18 +7939,31 @@ const YamlNode = effect.Schema.suspend(() => effect.Schema.Union([
7928
7939
  * A YAML key-value pair AST node, representing one entry within a mapping.
7929
7940
  * `value` is `null` when absent (e.g. `key:` with no value).
7930
7941
  *
7942
+ * - `commentBefore` — own-line comment text directly above the pair's key
7943
+ * (multiple consecutive comment lines join with `\n`).
7944
+ * - `comment` — trailing comment text on the pair's line (strictly trailing).
7945
+ * - `spaceBefore` — `true` when a blank line precedes the pair (and its
7946
+ * `commentBefore` block, when present) in the source.
7947
+ *
7931
7948
  * @public
7932
7949
  */
7933
7950
  var YamlPair = class extends effect.Schema.TaggedClass()("YamlPair", {
7934
7951
  key: effect.Schema.suspend(() => YamlNode),
7935
7952
  value: effect.Schema.NullOr(effect.Schema.suspend(() => YamlNode)),
7936
- comment: effect.Schema.optionalKey(effect.Schema.String)
7953
+ commentBefore: effect.Schema.optionalKey(effect.Schema.String),
7954
+ comment: effect.Schema.optionalKey(effect.Schema.String),
7955
+ spaceBefore: effect.Schema.optionalKey(effect.Schema.Boolean)
7937
7956
  }) {};
7938
7957
  /**
7939
7958
  * A YAML mapping AST node, representing a collection of {@link YamlPair}
7940
7959
  * entries.
7941
7960
  *
7942
7961
  * - `style` — the presentation style: `"block"` or `"flow"`.
7962
+ * - `commentBefore` — own-line comment text directly above the mapping.
7963
+ * - `comment` — trailing comment text: own-line comment lines after the
7964
+ * mapping's last entry (still at the mapping's item indent), or a same-line
7965
+ * trailing comment for a flow mapping.
7966
+ * - `spaceBefore` — `true` when a blank line precedes the mapping.
7943
7967
  * - `sourceMultiline` — `true` when the source span covers two or more lines;
7944
7968
  * used by the canonical stringifier. Absent on synthetic nodes.
7945
7969
  *
@@ -7950,7 +7974,9 @@ var YamlMap = class extends effect.Schema.TaggedClass()("YamlMap", {
7950
7974
  tag: effect.Schema.optionalKey(effect.Schema.String),
7951
7975
  anchor: effect.Schema.optionalKey(effect.Schema.String),
7952
7976
  style: CollectionStyle,
7977
+ commentBefore: effect.Schema.optionalKey(effect.Schema.String),
7953
7978
  comment: effect.Schema.optionalKey(effect.Schema.String),
7979
+ spaceBefore: effect.Schema.optionalKey(effect.Schema.Boolean),
7954
7980
  sourceMultiline: effect.Schema.optionalKey(effect.Schema.Boolean),
7955
7981
  offset: effect.Schema.Number,
7956
7982
  length: effect.Schema.Number
@@ -7976,6 +8002,12 @@ var YamlMap = class extends effect.Schema.TaggedClass()("YamlMap", {
7976
8002
  * A YAML sequence AST node, representing an ordered list of
7977
8003
  * {@link (YamlNode:type)} values.
7978
8004
  *
8005
+ * - `commentBefore` — own-line comment text directly above the sequence.
8006
+ * - `comment` — trailing comment text: own-line comment lines after the
8007
+ * sequence's last item (still at the sequence's item indent), or a
8008
+ * same-line trailing comment for a flow sequence.
8009
+ * - `spaceBefore` — `true` when a blank line precedes the sequence.
8010
+ *
7979
8011
  * @public
7980
8012
  */
7981
8013
  var YamlSeq = class extends effect.Schema.TaggedClass()("YamlSeq", {
@@ -7983,7 +8015,9 @@ var YamlSeq = class extends effect.Schema.TaggedClass()("YamlSeq", {
7983
8015
  tag: effect.Schema.optionalKey(effect.Schema.String),
7984
8016
  anchor: effect.Schema.optionalKey(effect.Schema.String),
7985
8017
  style: CollectionStyle,
8018
+ commentBefore: effect.Schema.optionalKey(effect.Schema.String),
7986
8019
  comment: effect.Schema.optionalKey(effect.Schema.String),
8020
+ spaceBefore: effect.Schema.optionalKey(effect.Schema.Boolean),
7987
8021
  sourceMultiline: effect.Schema.optionalKey(effect.Schema.Boolean),
7988
8022
  offset: effect.Schema.Number,
7989
8023
  length: effect.Schema.Number
@@ -8173,7 +8207,7 @@ function nodeToValue(node, anchors, budget, counting = false) {
8173
8207
  return null;
8174
8208
  }
8175
8209
  //#endregion
8176
- //#region ../../node_modules/.pnpm/@effected+yaml@0.7.0_effect@4.0.0-beta.107/node_modules/@effected/yaml/internal/diagnostics.js
8210
+ //#region ../../node_modules/.pnpm/@effected+yaml@0.8.0_effect@4.0.0-beta.107/node_modules/@effected/yaml/internal/diagnostics.js
8177
8211
  /** Error codes emitted by the lexer stage. */
8178
8212
  const YAML_LEX_ERROR_CODES = [
8179
8213
  "UnexpectedCharacter",
@@ -8218,14 +8252,23 @@ const YAML_COMPOSE_ERROR_CODES = [
8218
8252
  */
8219
8253
  const YAML_STRINGIFY_ERROR_CODES = ["CircularReference"];
8220
8254
  /**
8221
- * Error codes for the modify stage (`YamlFormat.modify`'s path navigation
8222
- * against an already-composed AST). Not raised by the parser/composer.
8255
+ * Error codes for the modify stage (`YamlFormat.modify`'s guards and path
8256
+ * navigation against an already-composed AST). Not raised by the
8257
+ * parser/composer. `MultiDocumentStream` is the single-document-contract
8258
+ * refusal: `modify` re-emits exactly one document, so a multi-document
8259
+ * stream fails typed rather than silently truncating documents 2..n.
8260
+ * `DirectiveCarryingDocument` is the directive refusal: the stringifier does
8261
+ * not re-emit `%YAML`/`%TAG` directive lines, and re-emitting a document
8262
+ * without its `%TAG` orphans every shorthand tag that depends on it — the
8263
+ * output would be unparseable — so modify fails typed rather than corrupting.
8223
8264
  */
8224
8265
  const YAML_MODIFY_ERROR_CODES = [
8225
8266
  "EmptyDocument",
8226
8267
  "PathNotFound",
8227
8268
  "InvalidIndex",
8228
- "NotNavigable"
8269
+ "NotNavigable",
8270
+ "MultiDocumentStream",
8271
+ "DirectiveCarryingDocument"
8229
8272
  ];
8230
8273
  /**
8231
8274
  * The single source of truth for which diagnostic codes are fatal to a
@@ -8251,7 +8294,7 @@ function isFatalCode(code) {
8251
8294
  return FATAL_CODES.has(code);
8252
8295
  }
8253
8296
  //#endregion
8254
- //#region ../../node_modules/.pnpm/@effected+yaml@0.7.0_effect@4.0.0-beta.107/node_modules/@effected/yaml/YamlDiagnostic.js
8297
+ //#region ../../node_modules/.pnpm/@effected+yaml@0.8.0_effect@4.0.0-beta.107/node_modules/@effected/yaml/YamlDiagnostic.js
8255
8298
  /**
8256
8299
  * Error codes emitted by the lexer stage.
8257
8300
  *
@@ -8372,100 +8415,7 @@ function lineChar(text, offset) {
8372
8415
  };
8373
8416
  }
8374
8417
  //#endregion
8375
- //#region ../../node_modules/.pnpm/@effected+yaml@0.7.0_effect@4.0.0-beta.107/node_modules/@effected/yaml/internal/composer/anchors.js
8376
- /**
8377
- * Check if a pending anchor is being applied to an alias node (invalid in YAML 1.2 §3.2.2).
8378
- * Aliases represent references to existing anchored nodes and cannot have their own anchors.
8379
- *
8380
- * Uses `DuplicateAnchor` error code as a pragmatic reuse — semantically this is
8381
- * "anchor on alias" rather than "same anchor name defined twice", but adding a
8382
- * dedicated `AnchorOnAlias` code would be a public API change. The error message
8383
- * distinguishes the two cases for consumers inspecting the message text.
8384
- */
8385
- function checkAnchorOnAlias(pendingMeta, cst, state) {
8386
- if (pendingMeta.anchor !== void 0) state.errors.push({
8387
- code: "DuplicateAnchor",
8388
- message: `Anchor &${pendingMeta.anchor} cannot be applied to alias *${getAliasName(cst, state.text)}`,
8389
- offset: cst.offset,
8390
- length: cst.length
8391
- });
8392
- }
8393
- function makeAlias(cst, state) {
8394
- const name = getAliasName(cst, state.text);
8395
- if (!state.anchors.has(name)) state.errors.push({
8396
- code: "UndefinedAlias",
8397
- message: `Undefined alias: *${name}`,
8398
- offset: cst.offset,
8399
- length: cst.length
8400
- });
8401
- else {
8402
- state.aliasCount++;
8403
- if (state.aliasCount > state.options.maxAliasCount) state.errors.push({
8404
- code: "AliasCountExceeded",
8405
- message: `Alias count exceeded maximum of ${state.options.maxAliasCount}`,
8406
- offset: cst.offset,
8407
- length: cst.length
8408
- });
8409
- }
8410
- return new YamlAlias({
8411
- name,
8412
- offset: cst.offset,
8413
- length: cst.length
8414
- });
8415
- }
8416
- function registerAnchor(node, anchor, state, offset) {
8417
- if (state.anchors.has(anchor)) state.warnings.push({
8418
- code: "DuplicateAnchor",
8419
- message: `Duplicate anchor: &${anchor}`,
8420
- offset,
8421
- length: anchor.length + 1
8422
- });
8423
- state.anchors.set(anchor, node);
8424
- }
8425
- function getAnchorName(cst, text) {
8426
- if (text[cst.offset] === "&") return scanName(text, cst.offset + 1);
8427
- return cst.source;
8428
- }
8429
- function getAliasName(cst, text) {
8430
- if (text[cst.offset] === "*") return scanName(text, cst.offset + 1);
8431
- return cst.source;
8432
- }
8433
- function scanName(text, start) {
8434
- let end = start;
8435
- while (end < text.length) {
8436
- const ch = text[end];
8437
- if (ch === " " || ch === " " || ch === "\n" || ch === "\r" || ch === "{" || ch === "}" || ch === "[" || ch === "]" || ch === "," || ch === void 0) break;
8438
- end++;
8439
- }
8440
- return text.slice(start, end);
8441
- }
8442
- /**
8443
- * Build an anchor map by walking the AST, collecting nodes that have anchors.
8444
- * Used to resolve aliases when extracting plain JavaScript values from
8445
- * parsed YAML documents.
8446
- */
8447
- function buildAnchorMap(node) {
8448
- const anchors = /* @__PURE__ */ new Map();
8449
- collectAnchors(node, anchors);
8450
- return anchors;
8451
- }
8452
- function collectAnchors(node, anchors) {
8453
- if (node === null) return;
8454
- if (node instanceof YamlScalar) {
8455
- if (node.anchor !== void 0) anchors.set(node.anchor, node);
8456
- } else if (node instanceof YamlMap) {
8457
- if (node.anchor !== void 0) anchors.set(node.anchor, node);
8458
- for (const pair of node.items) {
8459
- collectAnchors(pair.key, anchors);
8460
- collectAnchors(pair.value, anchors);
8461
- }
8462
- } else if (node instanceof YamlSeq) {
8463
- if (node.anchor !== void 0) anchors.set(node.anchor, node);
8464
- for (const item of node.items) collectAnchors(item, anchors);
8465
- }
8466
- }
8467
- //#endregion
8468
- //#region ../../node_modules/.pnpm/@effected+yaml@0.7.0_effect@4.0.0-beta.107/node_modules/@effected/yaml/internal/lexer.js
8418
+ //#region ../../node_modules/.pnpm/@effected+yaml@0.8.0_effect@4.0.0-beta.107/node_modules/@effected/yaml/internal/lexer.js
8469
8419
  /**
8470
8420
  * Create a new YAML scanner for the given source text.
8471
8421
  *
@@ -9428,7 +9378,7 @@ function lexAll(text) {
9428
9378
  return tokens;
9429
9379
  }
9430
9380
  //#endregion
9431
- //#region ../../node_modules/.pnpm/@effected+yaml@0.7.0_effect@4.0.0-beta.107/node_modules/@effected/yaml/internal/cst-parser.js
9381
+ //#region ../../node_modules/.pnpm/@effected+yaml@0.8.0_effect@4.0.0-beta.107/node_modules/@effected/yaml/internal/cst-parser.js
9432
9382
  /**
9433
9383
  * Hardening: cap CST nesting so hostile inputs cannot overflow the stack
9434
9384
  * while the tree is being BUILT. Set slightly above the composer's
@@ -9793,7 +9743,8 @@ function parseBlockValue(state, parentIndent, explicitKey = false) {
9793
9743
  const token = peek(state);
9794
9744
  if (!token) break;
9795
9745
  if (token.kind === "whitespace") {
9796
- nodes.push(...consumeTrivia(state));
9746
+ advance(state);
9747
+ nodes.push(makeLeafNode("whitespace", token, state.text));
9797
9748
  continue;
9798
9749
  }
9799
9750
  if (token.kind === "newline") break;
@@ -10148,7 +10099,258 @@ function parseCSTAll(text) {
10148
10099
  return parseDocuments(lexAll(text), text);
10149
10100
  }
10150
10101
  //#endregion
10151
- //#region ../../node_modules/.pnpm/@effected+yaml@0.7.0_effect@4.0.0-beta.107/node_modules/@effected/yaml/internal/composer/state.js
10102
+ //#region ../../node_modules/.pnpm/@effected+yaml@0.8.0_effect@4.0.0-beta.107/node_modules/@effected/yaml/internal/composer/anchors.js
10103
+ /**
10104
+ * Check if a pending anchor is being applied to an alias node (invalid in YAML 1.2 §3.2.2).
10105
+ * Aliases represent references to existing anchored nodes and cannot have their own anchors.
10106
+ *
10107
+ * Uses `DuplicateAnchor` error code as a pragmatic reuse — semantically this is
10108
+ * "anchor on alias" rather than "same anchor name defined twice", but adding a
10109
+ * dedicated `AnchorOnAlias` code would be a public API change. The error message
10110
+ * distinguishes the two cases for consumers inspecting the message text.
10111
+ */
10112
+ function checkAnchorOnAlias(pendingMeta, cst, state) {
10113
+ if (pendingMeta.anchor !== void 0) state.errors.push({
10114
+ code: "DuplicateAnchor",
10115
+ message: `Anchor &${pendingMeta.anchor} cannot be applied to alias *${getAliasName(cst, state.text)}`,
10116
+ offset: cst.offset,
10117
+ length: cst.length
10118
+ });
10119
+ }
10120
+ function makeAlias(cst, state) {
10121
+ const name = getAliasName(cst, state.text);
10122
+ if (!state.anchors.has(name)) state.errors.push({
10123
+ code: "UndefinedAlias",
10124
+ message: `Undefined alias: *${name}`,
10125
+ offset: cst.offset,
10126
+ length: cst.length
10127
+ });
10128
+ else {
10129
+ state.aliasCount++;
10130
+ if (state.aliasCount > state.options.maxAliasCount) state.errors.push({
10131
+ code: "AliasCountExceeded",
10132
+ message: `Alias count exceeded maximum of ${state.options.maxAliasCount}`,
10133
+ offset: cst.offset,
10134
+ length: cst.length
10135
+ });
10136
+ }
10137
+ return new YamlAlias({
10138
+ name,
10139
+ offset: cst.offset,
10140
+ length: cst.length
10141
+ });
10142
+ }
10143
+ function registerAnchor(node, anchor, state, offset) {
10144
+ if (state.anchors.has(anchor)) state.warnings.push({
10145
+ code: "DuplicateAnchor",
10146
+ message: `Duplicate anchor: &${anchor}`,
10147
+ offset,
10148
+ length: anchor.length + 1
10149
+ });
10150
+ state.anchors.set(anchor, node);
10151
+ }
10152
+ function getAnchorName(cst, text) {
10153
+ if (text[cst.offset] === "&") return scanName(text, cst.offset + 1);
10154
+ return cst.source;
10155
+ }
10156
+ function getAliasName(cst, text) {
10157
+ if (text[cst.offset] === "*") return scanName(text, cst.offset + 1);
10158
+ return cst.source;
10159
+ }
10160
+ function scanName(text, start) {
10161
+ let end = start;
10162
+ while (end < text.length) {
10163
+ const ch = text[end];
10164
+ if (ch === " " || ch === " " || ch === "\n" || ch === "\r" || ch === "{" || ch === "}" || ch === "[" || ch === "]" || ch === "," || ch === void 0) break;
10165
+ end++;
10166
+ }
10167
+ return text.slice(start, end);
10168
+ }
10169
+ //#endregion
10170
+ //#region ../../node_modules/.pnpm/@effected+yaml@0.8.0_effect@4.0.0-beta.107/node_modules/@effected/yaml/internal/composer/comments.js
10171
+ /** True when there is no line break between `start` and `end` in `text`. */
10172
+ function sameLineSpan(text, start, end) {
10173
+ if (start < 0) return false;
10174
+ return !text.slice(Math.max(0, start), Math.max(0, end)).includes("\n");
10175
+ }
10176
+ /**
10177
+ * True when only horizontal whitespace precedes `offset` on its line — i.e.
10178
+ * the token at `offset` starts its own line. Purely local, so it stays
10179
+ * correct even when a preceding node's span over-extends past line ends.
10180
+ */
10181
+ function isOwnLineAt(text, offset) {
10182
+ let i = offset - 1;
10183
+ while (i >= 0) {
10184
+ const ch = text[i];
10185
+ if (ch === " " || ch === " ") {
10186
+ i--;
10187
+ continue;
10188
+ }
10189
+ return ch === "\n" || ch === "\r";
10190
+ }
10191
+ return true;
10192
+ }
10193
+ /**
10194
+ * True when the line immediately above the line containing `offset` is blank
10195
+ * (empty or horizontal whitespace only). Purely local — see
10196
+ * {@link isOwnLineAt} for why span-based gap checks are not used.
10197
+ */
10198
+ function hasBlankLineAbove(text, offset) {
10199
+ return blankLineAboveStart(text, offset) >= 0;
10200
+ }
10201
+ /**
10202
+ * Start offset of the blank line immediately above the line containing
10203
+ * `offset`, or `-1` when that line is not blank. The offset form of
10204
+ * {@link hasBlankLineAbove}, for callers that must locate the blank line
10205
+ * (e.g. to test whether it falls inside a preceding scalar token's span).
10206
+ */
10207
+ function blankLineAboveStart(text, offset) {
10208
+ const lineBreak = text.lastIndexOf("\n", Math.max(0, offset - 1));
10209
+ if (lineBreak < 0) return -1;
10210
+ const prevBreak = text.lastIndexOf("\n", lineBreak - 1);
10211
+ return text.slice(prevBreak + 1, lineBreak).trim() === "" ? prevBreak + 1 : -1;
10212
+ }
10213
+ /**
10214
+ * The deepest trailing scalar reached by descending last-child edges from
10215
+ * `node` (a map's last pair's value, a seq's last item) — the node whose
10216
+ * token span a textually-following blank line could fall inside.
10217
+ */
10218
+ function deepestTrailingScalar(node) {
10219
+ let current = node;
10220
+ for (;;) {
10221
+ if (current instanceof YamlScalar) return current;
10222
+ if (current instanceof YamlMap) {
10223
+ const last = current.items[current.items.length - 1];
10224
+ if (last === void 0) return void 0;
10225
+ current = last.value ?? last.key;
10226
+ continue;
10227
+ }
10228
+ if (current instanceof YamlSeq) {
10229
+ const last = current.items[current.items.length - 1];
10230
+ if (last === void 0) return void 0;
10231
+ current = last;
10232
+ continue;
10233
+ }
10234
+ return;
10235
+ }
10236
+ }
10237
+ /**
10238
+ * True when the blank line immediately above `offset` is CONTENT of the
10239
+ * preceding keep-chomp block scalar, not a stylistic blank. Under `+`
10240
+ * chomping the trailing line breaks are part of the scalar's VALUE (the
10241
+ * composer already stores them there), so recording the same blank line as
10242
+ * `spaceBefore` (or a leading-blank embed on a terminal comment run) would
10243
+ * double-count it: emission renders both the kept newline and the stylistic
10244
+ * blank, growing the document on every format pass. Clip/strip scalars are
10245
+ * deliberately NOT excluded — their emission drops the trailing blank from
10246
+ * the value, so the `spaceBefore` capture is exactly what re-creates it.
10247
+ *
10248
+ * `prev` is the last composed node before `offset` (a pair's value, a seq
10249
+ * item); the check descends to its deepest trailing scalar and requires the
10250
+ * blank line to start inside that scalar's token span.
10251
+ */
10252
+ function blankAboveIsKeepChompContent(text, offset, prev) {
10253
+ if (prev === void 0) return false;
10254
+ const scalar = deepestTrailingScalar(prev);
10255
+ if (scalar === void 0 || scalar.chomp !== "keep") return false;
10256
+ if (scalar.style !== "block-literal" && scalar.style !== "block-folded") return false;
10257
+ const start = blankLineAboveStart(text, offset);
10258
+ return start >= scalar.offset && start < scalar.offset + scalar.length;
10259
+ }
10260
+ /**
10261
+ * True when the line immediately below the line containing `offset` is blank
10262
+ * (empty or horizontal whitespace only) AND is itself followed by another
10263
+ * line. Purely local, the mirror of {@link hasBlankLineAbove} — used to embed
10264
+ * a blank line AFTER a comment run as a trailing empty line in the stored
10265
+ * comment string.
10266
+ */
10267
+ function hasBlankLineBelow(text, offset) {
10268
+ const lineEnd = text.indexOf("\n", Math.max(0, offset));
10269
+ if (lineEnd < 0) return false;
10270
+ const nextEnd = text.indexOf("\n", lineEnd + 1);
10271
+ if (nextEnd < 0) return false;
10272
+ return text.slice(lineEnd + 1, nextEnd).trim() === "";
10273
+ }
10274
+ /**
10275
+ * The stored text of a comment token: the RAW post-`#` slice, reference
10276
+ * parity with the `yaml` npm package — `# section` stores `" section"`,
10277
+ * `#no-space` stores `"no-space"`, `# aligned` keeps its alignment.
10278
+ *
10279
+ * The one reserved string is `""`, which encodes an embedded blank line
10280
+ * inside a joined comment run — so a spaces-only raw slice stores with ONE
10281
+ * extra trailing space and the renderers strip it back off. A bare `#`
10282
+ * (raw `""`) stores `" "`, `# ` (raw `" "`) stores `" "`, and so on; the
10283
+ * escape is injective, so every comment spelling roundtrips byte-intact.
10284
+ * Raw storage is what makes byte-intact roundtrip possible; trimming would
10285
+ * canonicalize every comment to `# text`.
10286
+ */
10287
+ function rawCommentText(source) {
10288
+ const raw = source.startsWith("#") ? source.slice(1) : source;
10289
+ return /^ *$/.test(raw) ? `${raw} ` : raw;
10290
+ }
10291
+ /** Join two optional comment blocks with a newline. */
10292
+ function joinComments(a, b) {
10293
+ return a === void 0 ? b : `${a}\n${b}`;
10294
+ }
10295
+ /** Zero-based column of `offset` within its line. */
10296
+ function columnAt(text, offset) {
10297
+ if (offset <= 0) return 0;
10298
+ return offset - (text.lastIndexOf("\n", offset - 1) + 1);
10299
+ }
10300
+ /**
10301
+ * Rebuild `node` with the given comment fields merged in (existing fields are
10302
+ * kept unless overridden; `commentBefore`/`comment` join with a newline when
10303
+ * both sides are present). Aliases are returned unchanged — they carry no
10304
+ * comment fields.
10305
+ */
10306
+ function withCommentFields(node, fields) {
10307
+ if (node instanceof YamlScalar) return new YamlScalar({
10308
+ value: node.value,
10309
+ style: node.style,
10310
+ ...node.tag !== void 0 ? { tag: node.tag } : {},
10311
+ ...node.anchor !== void 0 ? { anchor: node.anchor } : {},
10312
+ ...mergedCommentFields(node, fields),
10313
+ ...node.chomp !== void 0 ? { chomp: node.chomp } : {},
10314
+ ...node.blockIndent !== void 0 ? { blockIndent: node.blockIndent } : {},
10315
+ ...node.raw !== void 0 ? { raw: node.raw } : {},
10316
+ ...node.sourceMultiline !== void 0 ? { sourceMultiline: node.sourceMultiline } : {},
10317
+ offset: node.offset,
10318
+ length: node.length
10319
+ });
10320
+ if (node instanceof YamlMap) return new YamlMap({
10321
+ items: node.items,
10322
+ style: node.style,
10323
+ ...node.tag !== void 0 ? { tag: node.tag } : {},
10324
+ ...node.anchor !== void 0 ? { anchor: node.anchor } : {},
10325
+ ...mergedCommentFields(node, fields),
10326
+ ...node.sourceMultiline !== void 0 ? { sourceMultiline: node.sourceMultiline } : {},
10327
+ offset: node.offset,
10328
+ length: node.length
10329
+ });
10330
+ if (node instanceof YamlSeq) return new YamlSeq({
10331
+ items: node.items,
10332
+ style: node.style,
10333
+ ...node.tag !== void 0 ? { tag: node.tag } : {},
10334
+ ...node.anchor !== void 0 ? { anchor: node.anchor } : {},
10335
+ ...mergedCommentFields(node, fields),
10336
+ ...node.sourceMultiline !== void 0 ? { sourceMultiline: node.sourceMultiline } : {},
10337
+ offset: node.offset,
10338
+ length: node.length
10339
+ });
10340
+ return node;
10341
+ }
10342
+ function mergedCommentFields(existing, incoming) {
10343
+ const commentBefore = incoming.commentBefore !== void 0 ? existing.commentBefore !== void 0 ? `${existing.commentBefore}\n${incoming.commentBefore}` : incoming.commentBefore : existing.commentBefore;
10344
+ const comment = incoming.comment !== void 0 ? existing.comment !== void 0 ? `${existing.comment}\n${incoming.comment}` : incoming.comment : existing.comment;
10345
+ const spaceBefore = incoming.spaceBefore ?? existing.spaceBefore;
10346
+ return {
10347
+ ...commentBefore !== void 0 ? { commentBefore } : {},
10348
+ ...comment !== void 0 ? { comment } : {},
10349
+ ...spaceBefore !== void 0 ? { spaceBefore } : {}
10350
+ };
10351
+ }
10352
+ //#endregion
10353
+ //#region ../../node_modules/.pnpm/@effected+yaml@0.8.0_effect@4.0.0-beta.107/node_modules/@effected/yaml/internal/composer/state.js
10152
10354
  let lineStartsText;
10153
10355
  let lineStartsCache = [];
10154
10356
  function getLineStarts(text) {
@@ -10213,6 +10415,19 @@ function clearMeta(m) {
10213
10415
  delete m.tag;
10214
10416
  delete m.comment;
10215
10417
  }
10418
+ /**
10419
+ * The comment-fidelity field triple carried by the four public node classes
10420
+ * (and `YamlPair`). Conditional-spread helper so AST rebuild sites copy all
10421
+ * three without hand-maintaining the list — and never emit an explicit
10422
+ * `undefined` into a v4 `optionalKey` field.
10423
+ */
10424
+ function commentProps(n) {
10425
+ return {
10426
+ ...n.commentBefore !== void 0 ? { commentBefore: n.commentBefore } : {},
10427
+ ...n.comment !== void 0 ? { comment: n.comment } : {},
10428
+ ...n.spaceBefore !== void 0 ? { spaceBefore: n.spaceBefore } : {}
10429
+ };
10430
+ }
10216
10431
  function createState(text, flow, options) {
10217
10432
  return {
10218
10433
  text,
@@ -10227,7 +10442,8 @@ function createState(text, flow, options) {
10227
10442
  },
10228
10443
  tagMap: /* @__PURE__ */ new Map(),
10229
10444
  flow,
10230
- depth: 0
10445
+ depth: 0,
10446
+ escapedComments: []
10231
10447
  };
10232
10448
  }
10233
10449
  /**
@@ -10254,7 +10470,7 @@ function exitNesting(state) {
10254
10470
  state.depth--;
10255
10471
  }
10256
10472
  //#endregion
10257
- //#region ../../node_modules/.pnpm/@effected+yaml@0.7.0_effect@4.0.0-beta.107/node_modules/@effected/yaml/internal/composer/tags.js
10473
+ //#region ../../node_modules/.pnpm/@effected+yaml@0.8.0_effect@4.0.0-beta.107/node_modules/@effected/yaml/internal/composer/tags.js
10258
10474
  /**
10259
10475
  * Resolve a tag shorthand using the document's %TAG directives.
10260
10476
  * For example, with `%TAG !! tag:example.com,2000:app/`, the tag `!!int`
@@ -10340,7 +10556,7 @@ function validateTagHandlesInDocument(docCst, state) {
10340
10556
  }
10341
10557
  }
10342
10558
  //#endregion
10343
- //#region ../../node_modules/.pnpm/@effected+yaml@0.7.0_effect@4.0.0-beta.107/node_modules/@effected/yaml/internal/composer/scalars.js
10559
+ //#region ../../node_modules/.pnpm/@effected+yaml@0.8.0_effect@4.0.0-beta.107/node_modules/@effected/yaml/internal/composer/scalars.js
10344
10560
  const NULL_RE$1 = /^(?:null|Null|NULL|~)$/;
10345
10561
  const TRUE_RE$1 = /^(?:true|True|TRUE)$/;
10346
10562
  const FALSE_RE$1 = /^(?:false|False|FALSE)$/;
@@ -10435,13 +10651,42 @@ function getScalarStyle(node) {
10435
10651
  */
10436
10652
  function getBlockChomp(node) {
10437
10653
  if (node.type !== "block-scalar") return void 0;
10438
- const src = node.source.trimStart();
10439
- const headerEnd = src.indexOf("\n");
10440
- const header = headerEnd === -1 ? src : src.slice(0, headerEnd);
10441
- if (header.includes("+")) return "keep";
10442
- if (header.includes("-")) return "strip";
10654
+ const indicators = node.source.trimStart().match(/^[|>]([0-9+-]*)/)?.[1] ?? "";
10655
+ if (indicators.includes("+")) return "keep";
10656
+ if (indicators.includes("-")) return "strip";
10443
10657
  return "clip";
10444
10658
  }
10659
+ /**
10660
+ * Extracts the EXPLICIT indentation-indicator digit from a block scalar's
10661
+ * header (`|2`, `>1+`), or undefined when the header carries none (the
10662
+ * reader auto-detects) or the node is not a block scalar. Inspects only the
10663
+ * indicator run — see {@link getBlockChomp} for why the rest of the header
10664
+ * line (a comment can contain digits) must not be read.
10665
+ */
10666
+ function getBlockIndent(node) {
10667
+ if (node.type !== "block-scalar") return void 0;
10668
+ const digit = (node.source.trimStart().match(/^[|>]([0-9+-]*)/)?.[1] ?? "").match(/[1-9]/)?.[0];
10669
+ return digit === void 0 ? void 0 : Number(digit);
10670
+ }
10671
+ /**
10672
+ * The trailing comment on a block scalar's HEADER line (`key: | # c`,
10673
+ * `- >-2 # c`) as stored raw-slice text, or `undefined` when the header
10674
+ * carries none. The header is the only line of a block scalar that can carry
10675
+ * a `#` comment — body lines absorb `#` as content — and the lexer packs the
10676
+ * whole scalar (header comment included) into one CST token, so the comment
10677
+ * never surfaces as a sibling comment token for the ordinary attribution
10678
+ * pass (#341).
10679
+ */
10680
+ function blockScalarHeaderComment(cst) {
10681
+ const src = cst.source.trimStart();
10682
+ const nl = src.search(/[\r\n]/);
10683
+ const header = nl < 0 ? src : src.slice(0, nl);
10684
+ const hash = header.indexOf("#");
10685
+ if (hash < 1) return void 0;
10686
+ const before = header[hash - 1];
10687
+ if (before !== " " && before !== " ") return void 0;
10688
+ return rawCommentText(header.slice(hash));
10689
+ }
10445
10690
  function getScalarValue(node, fullText) {
10446
10691
  if (node.type === "block-scalar") return decodeBlockScalar(node.source, fullText, node.offset);
10447
10692
  const style = getScalarStyle(node);
@@ -11127,18 +11372,22 @@ function decodeBlockScalar(raw, fullText, nodeOffset) {
11127
11372
  }
11128
11373
  if (hadContent || trailingNewlines.length > 0) {
11129
11374
  if (chomp === "keep") {
11130
- result += "\n";
11375
+ if (hadContent) result += "\n";
11131
11376
  for (const _nl of trailingNewlines) result += "\n";
11132
- } else if (chomp !== "strip") result += "\n";
11377
+ } else if (chomp !== "strip") {
11378
+ if (hadContent) result += "\n";
11379
+ }
11133
11380
  }
11134
11381
  value = result;
11135
11382
  } else {
11136
11383
  value = lines.join("\n");
11137
11384
  if (lines.length > 0 || trailingNewlines.length > 0) {
11138
11385
  if (chomp === "keep") {
11139
- value += "\n";
11386
+ if (lines.length > 0) value += "\n";
11140
11387
  for (const _nl of trailingNewlines) value += "\n";
11141
- } else if (chomp !== "strip") value += "\n";
11388
+ } else if (chomp !== "strip") {
11389
+ if (lines.length > 0) value += "\n";
11390
+ }
11142
11391
  }
11143
11392
  }
11144
11393
  return value;
@@ -11197,6 +11446,8 @@ function makeScalar(cst, state, meta) {
11197
11446
  const rawValue = getScalarValue(cst, state.text);
11198
11447
  const value = resolveScalar(rawValue, style, meta?.tag, state);
11199
11448
  const chomp = getBlockChomp(cst);
11449
+ const blockIndent = getBlockIndent(cst);
11450
+ const comment = (style === "block-literal" || style === "block-folded" ? blockScalarHeaderComment(cst) : void 0) ?? meta?.comment;
11200
11451
  const needsRaw = style === "plain" && typeof value !== "string" && value !== void 0 && shouldPreserveRaw(rawValue, value);
11201
11452
  const scalar = new YamlScalar({
11202
11453
  value,
@@ -11205,8 +11456,9 @@ function makeScalar(cst, state, meta) {
11205
11456
  length: cst.length,
11206
11457
  ...meta?.tag !== void 0 ? { tag: meta.tag } : {},
11207
11458
  ...meta?.anchor !== void 0 ? { anchor: meta.anchor } : {},
11208
- ...meta?.comment !== void 0 ? { comment: meta.comment } : {},
11459
+ ...comment !== void 0 ? { comment } : {},
11209
11460
  ...chomp !== void 0 ? { chomp } : {},
11461
+ ...blockIndent !== void 0 ? { blockIndent } : {},
11210
11462
  ...needsRaw ? { raw: rawValue } : {}
11211
11463
  });
11212
11464
  if (meta?.anchor) registerAnchor(scalar, meta.anchor, state, cst.offset);
@@ -11230,7 +11482,7 @@ function shouldPreserveRaw(rawValue, value) {
11230
11482
  return false;
11231
11483
  }
11232
11484
  //#endregion
11233
- //#region ../../node_modules/.pnpm/@effected+yaml@0.7.0_effect@4.0.0-beta.107/node_modules/@effected/yaml/internal/composer/block.js
11485
+ //#region ../../node_modules/.pnpm/@effected+yaml@0.8.0_effect@4.0.0-beta.107/node_modules/@effected/yaml/internal/composer/block.js
11234
11486
  /**
11235
11487
  * Compose a block map from its CST children, with an optional external first key.
11236
11488
  *
@@ -11262,18 +11514,20 @@ function composeBlockMapInner(blockMapCst, state, externalFirstKey, meta) {
11262
11514
  kind: "key",
11263
11515
  node: externalFirstKey
11264
11516
  });
11265
- buildPairs(items, pairs, state.text);
11517
+ const trailingComment = buildPairs(items, pairs, state.text, state.escapedComments);
11266
11518
  if (state.options.uniqueKeys) checkDuplicateKeys(pairs, state);
11267
11519
  checkMultilineImplicitKeys(pairs, state);
11268
11520
  const offset = externalFirstKey ? "offset" in externalFirstKey ? externalFirstKey.offset : blockMapCst.offset : blockMapCst.offset;
11521
+ const length = blockMapCst.offset + blockMapCst.length - offset;
11522
+ const mapComment = meta?.comment !== void 0 ? trailingComment !== void 0 ? `${meta.comment}\n${trailingComment}` : meta.comment : trailingComment;
11269
11523
  const map = new YamlMap({
11270
11524
  items: pairs,
11271
11525
  style: "block",
11272
11526
  offset,
11273
- length: blockMapCst.offset + blockMapCst.length - offset,
11527
+ length,
11274
11528
  ...meta?.tag !== void 0 ? { tag: meta.tag } : {},
11275
11529
  ...meta?.anchor !== void 0 ? { anchor: meta.anchor } : {},
11276
- ...meta?.comment !== void 0 ? { comment: meta.comment } : {}
11530
+ ...mapComment !== void 0 ? { comment: mapComment } : {}
11277
11531
  });
11278
11532
  if (meta?.anchor) registerAnchor(map, meta.anchor, state, offset);
11279
11533
  return map;
@@ -11330,6 +11584,14 @@ function flattenBlockMapChildren(children, state, externalKeyColumn, externalKey
11330
11584
  kind: "node",
11331
11585
  node
11332
11586
  });
11587
+ if (state.escapedComments.length > 0) {
11588
+ for (const ec of state.escapedComments) items.push({
11589
+ kind: "comment",
11590
+ comment: ec.text,
11591
+ offset: ec.offset
11592
+ });
11593
+ state.escapedComments.length = 0;
11594
+ }
11333
11595
  afterValueSep = false;
11334
11596
  }
11335
11597
  for (let i = 0; i < children.length; i++) {
@@ -11358,7 +11620,7 @@ function flattenBlockMapChildren(children, state, externalKeyColumn, externalKey
11358
11620
  const sliceChildren = children.slice(i + 1, lookahead.endIdx);
11359
11621
  const innerItems = flattenBlockMapChildren(sliceChildren, state);
11360
11622
  const innerPairs = [];
11361
- buildPairs(innerItems, innerPairs, state.text);
11623
+ const innerTrailing = buildPairs(innerItems, innerPairs, state.text);
11362
11624
  const firstC = findFirstContent(sliceChildren);
11363
11625
  const lastC = findLastContent(sliceChildren);
11364
11626
  const innerOffset = firstC ? firstC.offset : child.offset;
@@ -11366,7 +11628,8 @@ function flattenBlockMapChildren(children, state, externalKeyColumn, externalKey
11366
11628
  items: innerPairs,
11367
11629
  style: "block",
11368
11630
  offset: innerOffset,
11369
- length: (lastC ? lastC.offset + lastC.length : child.offset + child.length) - innerOffset
11631
+ length: (lastC ? lastC.offset + lastC.length : child.offset + child.length) - innerOffset,
11632
+ ...innerTrailing !== void 0 ? { comment: innerTrailing } : {}
11370
11633
  }), innerOffset);
11371
11634
  i = lookahead.endIdx - 1;
11372
11635
  continue;
@@ -11411,10 +11674,10 @@ function flattenBlockMapChildren(children, state, externalKeyColumn, externalKey
11411
11674
  continue;
11412
11675
  }
11413
11676
  if (child.type === "comment") {
11414
- const text = child.source.startsWith("#") ? child.source.slice(1).trim() : child.source;
11415
11677
  items.push({
11416
11678
  kind: "comment",
11417
- comment: text
11679
+ comment: rawCommentText(child.source),
11680
+ offset: child.offset
11418
11681
  });
11419
11682
  continue;
11420
11683
  }
@@ -11699,9 +11962,51 @@ function flattenBlockMapChildren(children, state, externalKeyColumn, externalKey
11699
11962
  * Pattern: node, value-sep, node produces a key:value pair.
11700
11963
  * Pattern: node, value-sep (no node) produces a key:null pair.
11701
11964
  * Pattern: value-sep, node produces a null:value pair.
11965
+ *
11966
+ * Comment attribution (#127): a comment on the same line as the end of the
11967
+ * previous pair attaches to it as the trailing `comment`; an own-line
11968
+ * comment attaches FORWARD to the next pair as `commentBefore` (consecutive
11969
+ * lines join with `\n`); a blank line before a pair (or before its
11970
+ * `commentBefore` block) sets `spaceBefore`. Own-line comments left over
11971
+ * after the last pair are returned so the caller can attach them as the
11972
+ * containing collection's trailing `comment`.
11702
11973
  */
11703
- function buildPairs(items, pairs, text) {
11974
+ function buildPairs(items, pairs, text, escaped) {
11704
11975
  let i = 0;
11976
+ let pending = [];
11977
+ let pendingSpace = false;
11978
+ let lastEnd = -1;
11979
+ let lastNode;
11980
+ let contentColumn = -1;
11981
+ const nodeEnd = (n) => n.offset + n.length;
11982
+ const noteContentColumn = (offset) => {
11983
+ if (contentColumn < 0 && offset >= 0) contentColumn = columnAt(text, offset);
11984
+ };
11985
+ /** Join pending parts: `\n` between lines, an extra `\n` per embedded blank. */
11986
+ const joinPending = (parts) => {
11987
+ if (parts.length === 0) return void 0;
11988
+ let out = parts[0].text;
11989
+ for (let k = 1; k < parts.length; k++) {
11990
+ const part = parts[k];
11991
+ out += part.blankAbove ? `\n\n${part.text}` : `\n${part.text}`;
11992
+ }
11993
+ return out;
11994
+ };
11995
+ /** The pending comment fields for the pair being constructed, then reset. */
11996
+ const takePendingFields = (anchorOffset) => {
11997
+ let commentBefore = joinPending(pending);
11998
+ if (anchorOffset >= 0 && hasBlankLineAbove(text, anchorOffset)) {
11999
+ if (commentBefore !== void 0) commentBefore = `${commentBefore}\n`;
12000
+ else if (!pendingSpace && lastEnd >= 0 && !blankAboveIsKeepChompContent(text, anchorOffset, lastNode)) pendingSpace = true;
12001
+ }
12002
+ const fields = {
12003
+ ...commentBefore !== void 0 ? { commentBefore } : {},
12004
+ ...pendingSpace ? { spaceBefore: true } : {}
12005
+ };
12006
+ pending = [];
12007
+ pendingSpace = false;
12008
+ return fields;
12009
+ };
11705
12010
  while (i < items.length) {
11706
12011
  const item = items[i];
11707
12012
  if (!item) {
@@ -11709,12 +12014,24 @@ function buildPairs(items, pairs, text) {
11709
12014
  continue;
11710
12015
  }
11711
12016
  if (item.kind === "comment") {
11712
- if (pairs.length > 0) {
12017
+ const cOff = item.offset ?? -1;
12018
+ const cText = item.comment ?? "";
12019
+ if (!(cOff < 0 ? true : isOwnLineAt(text, cOff)) && pairs.length > 0) {
11713
12020
  const last = pairs[pairs.length - 1];
11714
12021
  if (last) pairs[pairs.length - 1] = new YamlPair({
11715
12022
  key: last.key,
11716
12023
  value: last.value,
11717
- ...item.comment !== void 0 ? { comment: item.comment } : {}
12024
+ ...last.commentBefore !== void 0 ? { commentBefore: last.commentBefore } : {},
12025
+ comment: last.comment !== void 0 ? `${last.comment}\n${cText}` : cText,
12026
+ ...last.spaceBefore !== void 0 ? { spaceBefore: last.spaceBefore } : {}
12027
+ });
12028
+ } else {
12029
+ const blankAbove = cOff >= 0 && hasBlankLineAbove(text, cOff) && !blankAboveIsKeepChompContent(text, cOff, lastNode);
12030
+ if (blankAbove && pending.length === 0 && lastEnd >= 0) pendingSpace = true;
12031
+ pending.push({
12032
+ text: cText,
12033
+ offset: cOff,
12034
+ blankAbove: blankAbove && pending.length > 0
11718
12035
  });
11719
12036
  }
11720
12037
  i++;
@@ -11723,30 +12040,32 @@ function buildPairs(items, pairs, text) {
11723
12040
  if (item.kind === "value-sep") {
11724
12041
  const valueSepOffset = item.offset ?? 0;
11725
12042
  i++;
12043
+ const pendingFields = takePendingFields(valueSepOffset);
12044
+ noteContentColumn(valueSepOffset);
11726
12045
  const valueNode = consumeValueNodeForNullKey(items, i, text, valueSepOffset);
12046
+ const nullKey = new YamlScalar({
12047
+ value: null,
12048
+ style: "plain",
12049
+ offset: valueSepOffset,
12050
+ length: 0
12051
+ });
11727
12052
  if (valueNode) {
11728
- const nullKey = new YamlScalar({
11729
- value: null,
11730
- style: "plain",
11731
- offset: valueSepOffset,
11732
- length: 0
11733
- });
11734
12053
  pairs.push(new YamlPair({
11735
12054
  key: nullKey,
11736
- value: valueNode.node ?? null
12055
+ value: valueNode.node ?? null,
12056
+ ...pendingFields
11737
12057
  }));
11738
12058
  i = valueNode.nextIdx;
12059
+ lastEnd = valueNode.node ? nodeEnd(valueNode.node) : valueSepOffset + 1;
12060
+ lastNode = valueNode.node ?? void 0;
11739
12061
  } else {
11740
- const nullKey = new YamlScalar({
11741
- value: null,
11742
- style: "plain",
11743
- offset: valueSepOffset,
11744
- length: 0
11745
- });
11746
12062
  pairs.push(new YamlPair({
11747
12063
  key: nullKey,
11748
- value: null
12064
+ value: null,
12065
+ ...pendingFields
11749
12066
  }));
12067
+ lastEnd = valueSepOffset + 1;
12068
+ lastNode = void 0;
11750
12069
  }
11751
12070
  continue;
11752
12071
  }
@@ -11760,62 +12079,109 @@ function buildPairs(items, pairs, text) {
11760
12079
  i++;
11761
12080
  }
11762
12081
  }
11763
- while (i < items.length && items[i]?.kind === "comment") i++;
12082
+ if (keyNode) noteContentColumn(keyNode.offset);
12083
+ const pendingFields = takePendingFields(keyNode ? keyNode.offset : -1);
12084
+ let pairTrailing;
12085
+ while (i < items.length && items[i]?.kind === "comment") {
12086
+ const c = items[i]?.comment;
12087
+ if (c !== void 0) pairTrailing = joinComments(pairTrailing, c);
12088
+ i++;
12089
+ }
12090
+ const keyOrNull = () => keyNode ?? new YamlScalar({
12091
+ value: null,
12092
+ style: "plain",
12093
+ offset: 0,
12094
+ length: 0
12095
+ });
11764
12096
  if (i < items.length && items[i]?.kind === "value-sep") {
12097
+ const sepOffset = items[i]?.offset ?? (keyNode ? nodeEnd(keyNode) : 0);
11765
12098
  i++;
11766
- const valueResult = consumeValueNode(items, i);
12099
+ const valueResult = consumeValueNode(items, i, text, sepOffset);
11767
12100
  if (valueResult) {
12101
+ for (const c of valueResult.sameLineComments) pairTrailing = joinComments(pairTrailing, c);
12102
+ let valNode = valueResult.node;
12103
+ if (valNode !== null && valueResult.leadingComments.length > 0) valNode = withCommentFields(valNode, { commentBefore: valueResult.leadingComments.join("\n") });
11768
12104
  pairs.push(new YamlPair({
11769
- key: keyNode ?? new YamlScalar({
11770
- value: null,
11771
- style: "plain",
11772
- offset: 0,
11773
- length: 0
11774
- }),
11775
- value: valueResult.node ?? null
12105
+ key: keyOrNull(),
12106
+ value: valNode,
12107
+ ...pendingFields,
12108
+ ...pairTrailing !== void 0 ? { comment: pairTrailing } : {}
11776
12109
  }));
11777
12110
  i = valueResult.nextIdx;
11778
- } else pairs.push(new YamlPair({
11779
- key: keyNode ?? new YamlScalar({
12111
+ lastEnd = valNode ? nodeEnd(valNode) : sepOffset + 1;
12112
+ lastNode = valNode ?? void 0;
12113
+ } else {
12114
+ pairs.push(new YamlPair({
12115
+ key: keyOrNull(),
11780
12116
  value: null,
11781
- style: "plain",
11782
- offset: 0,
11783
- length: 0
11784
- }),
11785
- value: null
11786
- }));
11787
- } else pairs.push(new YamlPair({
11788
- key: keyNode ?? new YamlScalar({
12117
+ ...pendingFields,
12118
+ ...pairTrailing !== void 0 ? { comment: pairTrailing } : {}
12119
+ }));
12120
+ lastEnd = sepOffset + 1;
12121
+ lastNode = void 0;
12122
+ }
12123
+ } else {
12124
+ pairs.push(new YamlPair({
12125
+ key: keyOrNull(),
11789
12126
  value: null,
11790
- style: "plain",
11791
- offset: 0,
11792
- length: 0
11793
- }),
11794
- value: null
11795
- }));
12127
+ ...pendingFields,
12128
+ ...pairTrailing !== void 0 ? { comment: pairTrailing } : {}
12129
+ }));
12130
+ lastEnd = keyNode ? nodeEnd(keyNode) : lastEnd;
12131
+ if (keyNode) lastNode = keyNode;
12132
+ }
11796
12133
  continue;
11797
12134
  }
11798
12135
  i++;
11799
12136
  }
12137
+ if (pending.length === 0) return void 0;
12138
+ const withLeadingBlank = (parts) => {
12139
+ const joined = joinPending(parts);
12140
+ const first = parts[0];
12141
+ return joined !== void 0 && first !== void 0 && lastEnd >= 0 && first.offset >= 0 && hasBlankLineAbove(text, first.offset) && !blankAboveIsKeepChompContent(text, first.offset, lastNode) ? `\n${joined}` : joined;
12142
+ };
12143
+ if (escaped !== void 0 && contentColumn > 0) {
12144
+ const kept = [];
12145
+ for (const part of pending) if (part.offset >= 0 && columnAt(text, part.offset) < contentColumn) escaped.push({
12146
+ text: part.text,
12147
+ offset: part.offset
12148
+ });
12149
+ else kept.push(part);
12150
+ return withLeadingBlank(kept);
12151
+ }
12152
+ return withLeadingBlank(pending);
11800
12153
  }
11801
- function consumeValueNode(items, startIdx) {
12154
+ function consumeValueNode(items, startIdx, text, sepOffset) {
12155
+ let peek = startIdx;
12156
+ while (peek < items.length && items[peek]?.kind === "comment") peek++;
12157
+ const candidate = peek < items.length ? items[peek] : void 0;
12158
+ if (candidate?.kind === "node" && peek + 1 < items.length && items[peek + 1]?.kind === "value-sep" && candidate.node !== void 0 && text.slice(sepOffset, candidate.node.offset).includes("\n")) return null;
11802
12159
  let i = startIdx;
12160
+ const sameLineComments = [];
12161
+ const leadingComments = [];
11803
12162
  while (i < items.length) {
11804
12163
  const item = items[i];
11805
12164
  if (!item) break;
11806
12165
  if (item.kind === "comment") {
12166
+ const cText = item.comment ?? "";
12167
+ if (item.offset !== void 0 && sameLineSpan(text, sepOffset, item.offset)) sameLineComments.push(cText);
12168
+ else leadingComments.push(cText);
11807
12169
  i++;
11808
12170
  continue;
11809
12171
  }
11810
12172
  if (item.kind === "node") return {
11811
12173
  node: item.node ?? null,
11812
- nextIdx: i + 1
12174
+ nextIdx: i + 1,
12175
+ sameLineComments,
12176
+ leadingComments
11813
12177
  };
11814
12178
  break;
11815
12179
  }
11816
12180
  return i > startIdx ? {
11817
12181
  node: null,
11818
- nextIdx: i
12182
+ nextIdx: i,
12183
+ sameLineComments,
12184
+ leadingComments
11819
12185
  } : null;
11820
12186
  }
11821
12187
  /**
@@ -12169,11 +12535,59 @@ function composeBlockSeq(cst, state, meta) {
12169
12535
  }
12170
12536
  function composeBlockSeqInner(cst, state, meta) {
12171
12537
  const children = cst.children ?? [];
12172
- const items = [];
12538
+ const rawItems = [];
12173
12539
  let pendingMeta = {};
12174
12540
  let sawEntry = false;
12175
12541
  const seqIndent = lineIndentColumn(state.text, cst.offset);
12176
12542
  let sawNewlineSincePending = false;
12543
+ let pending = [];
12544
+ let pendingSpace = false;
12545
+ let lastItemEnd = -1;
12546
+ let lastItemNode;
12547
+ const joinPending = (parts) => {
12548
+ if (parts.length === 0) return void 0;
12549
+ let out = parts[0].text;
12550
+ for (let k = 1; k < parts.length; k++) {
12551
+ const part = parts[k];
12552
+ out += part.blankAbove ? `\n\n${part.text}` : `\n${part.text}`;
12553
+ }
12554
+ return out;
12555
+ };
12556
+ const acceptOwnLineComment = (cText, cOff) => {
12557
+ const blankAbove = cOff >= 0 && hasBlankLineAbove(state.text, cOff) && !blankAboveIsKeepChompContent(state.text, cOff, lastItemNode);
12558
+ if (blankAbove && pending.length === 0 && lastItemEnd >= 0) pendingSpace = true;
12559
+ pending.push({
12560
+ text: cText,
12561
+ offset: cOff,
12562
+ blankAbove: blankAbove && pending.length > 0
12563
+ });
12564
+ };
12565
+ const items = {
12566
+ get length() {
12567
+ return rawItems.length;
12568
+ },
12569
+ push(node) {
12570
+ let commentBefore = joinPending(pending);
12571
+ if (node.length > 0 && hasBlankLineAbove(state.text, node.offset)) {
12572
+ if (commentBefore !== void 0) commentBefore = `${commentBefore}\n`;
12573
+ else if (!pendingSpace && lastItemEnd >= 0 && !blankAboveIsKeepChompContent(state.text, node.offset, lastItemNode)) pendingSpace = true;
12574
+ }
12575
+ let decorated = node;
12576
+ if (commentBefore !== void 0 || pendingSpace) decorated = withCommentFields(node, {
12577
+ ...commentBefore !== void 0 ? { commentBefore } : {},
12578
+ ...pendingSpace ? { spaceBefore: true } : {}
12579
+ });
12580
+ pending = [];
12581
+ pendingSpace = false;
12582
+ rawItems.push(decorated);
12583
+ lastItemEnd = node.offset + node.length;
12584
+ lastItemNode = node;
12585
+ if (state.escapedComments.length > 0) {
12586
+ for (const ec of state.escapedComments) acceptOwnLineComment(ec.text, ec.offset);
12587
+ state.escapedComments.length = 0;
12588
+ }
12589
+ }
12590
+ };
12177
12591
  for (let ci = 0; ci < children.length; ci++) {
12178
12592
  const child = children[ci];
12179
12593
  if (!child) continue;
@@ -12181,7 +12595,14 @@ function composeBlockSeqInner(cst, state, meta) {
12181
12595
  if (hasMeta(pendingMeta)) sawNewlineSincePending = true;
12182
12596
  continue;
12183
12597
  }
12184
- if (child.type === "comment") continue;
12598
+ if (child.type === "comment") {
12599
+ const cText = rawCommentText(child.source);
12600
+ if (rawItems.length > 0 && !isOwnLineAt(state.text, child.offset)) {
12601
+ const prev = rawItems[rawItems.length - 1];
12602
+ if (prev) rawItems[rawItems.length - 1] = withCommentFields(prev, { comment: cText });
12603
+ } else acceptOwnLineComment(cText, child.offset);
12604
+ continue;
12605
+ }
12185
12606
  if (child.type === "whitespace") {
12186
12607
  if (child.source.trim() === "-") {
12187
12608
  if (sawEntry) {
@@ -12338,14 +12759,32 @@ function composeBlockSeqInner(cst, state, meta) {
12338
12759
  if (pendingMeta.anchor) registerAnchor(scalar, pendingMeta.anchor, state, 0);
12339
12760
  items.push(scalar);
12340
12761
  }
12762
+ const withLeadingBlank = (parts) => {
12763
+ const joined = joinPending(parts);
12764
+ const first = parts[0];
12765
+ return joined !== void 0 && first !== void 0 && lastItemEnd >= 0 && first.offset >= 0 && hasBlankLineAbove(state.text, first.offset) && !blankAboveIsKeepChompContent(state.text, first.offset, lastItemNode) ? `\n${joined}` : joined;
12766
+ };
12767
+ let seqTrailing;
12768
+ if (pending.length > 0) {
12769
+ if (seqIndent > 0) {
12770
+ const kept = [];
12771
+ for (const part of pending) if (part.offset >= 0 && columnAt(state.text, part.offset) < seqIndent) state.escapedComments.push({
12772
+ text: part.text,
12773
+ offset: part.offset
12774
+ });
12775
+ else kept.push(part);
12776
+ seqTrailing = withLeadingBlank(kept);
12777
+ } else seqTrailing = withLeadingBlank(pending);
12778
+ }
12779
+ const seqComment = meta?.comment !== void 0 ? seqTrailing !== void 0 ? `${meta.comment}\n${seqTrailing}` : meta.comment : seqTrailing;
12341
12780
  const seq = new YamlSeq({
12342
- items,
12781
+ items: rawItems,
12343
12782
  style: "block",
12344
12783
  offset: cst.offset,
12345
12784
  length: cst.length,
12346
12785
  ...meta?.tag !== void 0 ? { tag: meta.tag } : {},
12347
12786
  ...meta?.anchor !== void 0 ? { anchor: meta.anchor } : {},
12348
- ...meta?.comment !== void 0 ? { comment: meta.comment } : {}
12787
+ ...seqComment !== void 0 ? { comment: seqComment } : {}
12349
12788
  });
12350
12789
  if (meta?.anchor) registerAnchor(seq, meta.anchor, state, cst.offset);
12351
12790
  return seq;
@@ -12361,24 +12800,26 @@ function composeFlatBlockMap(children, startIdx, parentCst, state, externalFirst
12361
12800
  node: externalFirstKey
12362
12801
  });
12363
12802
  const pairs = [];
12364
- buildPairs(items, pairs, state.text);
12803
+ const trailingComment = buildPairs(items, pairs, state.text, state.escapedComments);
12365
12804
  if (state.options.uniqueKeys) checkDuplicateKeys(pairs, state);
12366
12805
  checkMultilineImplicitKeys(pairs, state);
12367
12806
  const offset = "offset" in externalFirstKey ? externalFirstKey.offset : parentCst.offset;
12807
+ const end = parentCst.offset + parentCst.length;
12808
+ const mapComment = meta?.comment !== void 0 ? trailingComment !== void 0 ? `${meta.comment}\n${trailingComment}` : meta.comment : trailingComment;
12368
12809
  const map = new YamlMap({
12369
12810
  items: pairs,
12370
12811
  style: "block",
12371
12812
  offset,
12372
- length: parentCst.offset + parentCst.length - offset,
12813
+ length: end - offset,
12373
12814
  ...meta?.tag !== void 0 ? { tag: meta.tag } : {},
12374
12815
  ...meta?.anchor !== void 0 ? { anchor: meta.anchor } : {},
12375
- ...meta?.comment !== void 0 ? { comment: meta.comment } : {}
12816
+ ...mapComment !== void 0 ? { comment: mapComment } : {}
12376
12817
  });
12377
12818
  if (meta?.anchor) registerAnchor(map, meta.anchor, state, offset);
12378
12819
  return map;
12379
12820
  }
12380
12821
  //#endregion
12381
- //#region ../../node_modules/.pnpm/@effected+yaml@0.7.0_effect@4.0.0-beta.107/node_modules/@effected/yaml/internal/composer/flow.js
12822
+ //#region ../../node_modules/.pnpm/@effected+yaml@0.8.0_effect@4.0.0-beta.107/node_modules/@effected/yaml/internal/composer/flow.js
12382
12823
  /**
12383
12824
  * Validate that flow collection entries are separated by commas.
12384
12825
  *
@@ -12490,8 +12931,9 @@ function composeFlowMapInner(cst, state, meta, parentBlockColumn) {
12490
12931
  });
12491
12932
  validateFlowContentIndent(cst, state, parentBlockColumn);
12492
12933
  validateFlowSeparators(children, state, "{", "}");
12493
- buildPairs(flattenFlowChildren(children.filter((c) => !(c.type === "whitespace" && (c.source === "{" || c.source === "}" || c.source.trim() === ""))), state), pairs, state.text);
12934
+ const trailingComment = buildPairs(flattenFlowChildren(children.filter((c) => !(c.type === "whitespace" && (c.source === "{" || c.source === "}" || c.source.trim() === ""))), state), pairs, state.text);
12494
12935
  if (state.options.uniqueKeys) checkDuplicateKeys(pairs, state);
12936
+ const mapComment = meta?.comment !== void 0 ? trailingComment !== void 0 ? `${meta.comment}\n${trailingComment}` : meta.comment : trailingComment;
12495
12937
  const map = new YamlMap({
12496
12938
  items: pairs,
12497
12939
  style: "flow",
@@ -12499,7 +12941,7 @@ function composeFlowMapInner(cst, state, meta, parentBlockColumn) {
12499
12941
  length: cst.length,
12500
12942
  ...meta?.tag !== void 0 ? { tag: meta.tag } : {},
12501
12943
  ...meta?.anchor !== void 0 ? { anchor: meta.anchor } : {},
12502
- ...meta?.comment !== void 0 ? { comment: meta.comment } : {}
12944
+ ...mapComment !== void 0 ? { comment: mapComment } : {}
12503
12945
  });
12504
12946
  if (meta?.anchor) registerAnchor(map, meta.anchor, state, cst.offset);
12505
12947
  return map;
@@ -12559,7 +13001,8 @@ function flattenFlowChildren(children, state) {
12559
13001
  if (child.type === "comment") {
12560
13002
  items.push({
12561
13003
  kind: "comment",
12562
- comment: child.source.startsWith("#") ? child.source.slice(1).trim() : child.source
13004
+ comment: rawCommentText(child.source),
13005
+ offset: child.offset
12563
13006
  });
12564
13007
  continue;
12565
13008
  }
@@ -12738,25 +13181,95 @@ function composeFlowSeqInner(cst, state, meta, parentBlockColumn) {
12738
13181
  current.push(child);
12739
13182
  }
12740
13183
  if (current.length > 0) segments.push(current);
13184
+ let seqTrailing;
13185
+ let pending = [];
13186
+ let pendingSpace = false;
13187
+ let lastItemEnd = -1;
13188
+ let pushedIdx = -1;
13189
+ const joinPending = (parts) => {
13190
+ if (parts.length === 0) return void 0;
13191
+ let out = parts[0].text;
13192
+ for (let k = 1; k < parts.length; k++) {
13193
+ const part = parts[k];
13194
+ out += part.blankAbove ? `\n\n${part.text}` : `\n${part.text}`;
13195
+ }
13196
+ return out;
13197
+ };
13198
+ const blankIsBetweenItems = (anchorOffset) => blankLineAboveStart(state.text, anchorOffset) >= lastItemEnd;
13199
+ const acceptOwnLineComment = (cText, cOff) => {
13200
+ const blankAbove = cOff >= 0 && hasBlankLineAbove(state.text, cOff);
13201
+ if (blankAbove && pending.length === 0 && lastItemEnd >= 0 && blankIsBetweenItems(cOff)) pendingSpace = true;
13202
+ pending.push({
13203
+ text: cText,
13204
+ offset: cOff,
13205
+ blankAbove: blankAbove && pending.length > 0
13206
+ });
13207
+ };
13208
+ /** The pending comment fields for the item being pushed, then reset. */
13209
+ const takePendingFields = (anchorOffset) => {
13210
+ let commentBefore = joinPending(pending);
13211
+ if (anchorOffset >= 0 && hasBlankLineAbove(state.text, anchorOffset)) {
13212
+ if (commentBefore !== void 0) commentBefore = `${commentBefore}\n`;
13213
+ else if (!pendingSpace && lastItemEnd >= 0 && blankIsBetweenItems(anchorOffset)) pendingSpace = true;
13214
+ }
13215
+ const fields = {
13216
+ ...commentBefore !== void 0 ? { commentBefore } : {},
13217
+ ...pendingSpace ? { spaceBefore: true } : {}
13218
+ };
13219
+ pending = [];
13220
+ pendingSpace = false;
13221
+ return fields;
13222
+ };
13223
+ const hasPendingFields = (fields) => fields.commentBefore !== void 0 || fields.spaceBefore === true;
12741
13224
  for (const segment of segments) if (segment.some((c) => c.type === "whitespace" && c.source === ":")) {
12742
- const semItems = flattenFlowChildren(segment.filter((c) => !(c.type === "whitespace" && c.source.trim() === "")), state);
13225
+ const content = segment.filter((c) => !(c.type === "whitespace" && c.source.trim() === ""));
13226
+ const semItems = flattenFlowChildren(content, state);
12743
13227
  const pairs = [];
12744
- buildPairs(semItems, pairs, state.text);
13228
+ const segTrailing = buildPairs(semItems, pairs, state.text);
12745
13229
  if (!segment.some((c) => c.type === "whitespace" && c.source === "?")) checkMultilineImplicitKeys(pairs, state, semItems);
12746
13230
  const firstPair = pairs[0];
12747
13231
  if (firstPair) {
13232
+ const segFirst = content[0];
13233
+ const fields = takePendingFields(segFirst !== void 0 ? segFirst.offset : -1);
12748
13234
  const map = new YamlMap({
12749
13235
  items: pairs,
12750
13236
  style: "flow",
12751
13237
  offset: firstPair.key.offset,
12752
- length: 0
13238
+ length: 0,
13239
+ ...fields,
13240
+ ...segTrailing !== void 0 ? { comment: segTrailing } : {}
12753
13241
  });
12754
13242
  items.push(map);
12755
- }
13243
+ pushedIdx = items.length - 1;
13244
+ lastItemEnd = map.offset + map.length;
13245
+ } else if (segTrailing !== void 0) seqTrailing = joinComments(seqTrailing, segTrailing);
12756
13246
  } else {
12757
13247
  const semItems = flattenFlowChildren(segment.filter((c) => !(c.type === "whitespace" && c.source.trim() === "")), state);
12758
- for (const si of semItems) if (si.kind === "node" && si.node) items.push(si.node);
13248
+ for (const si of semItems) {
13249
+ if (si.kind === "comment") {
13250
+ const cText = si.comment ?? "";
13251
+ if (!(si.offset === void 0 ? true : isOwnLineAt(state.text, si.offset)) && pushedIdx >= 0) {
13252
+ const prev = items[pushedIdx];
13253
+ if (prev) items[pushedIdx] = withCommentFields(prev, { comment: cText });
13254
+ } else acceptOwnLineComment(cText, si.offset ?? -1);
13255
+ continue;
13256
+ }
13257
+ if (si.kind === "node" && si.node) {
13258
+ const fields = takePendingFields(si.node.length > 0 ? si.node.offset : -1);
13259
+ const node = hasPendingFields(fields) ? withCommentFields(si.node, fields) : si.node;
13260
+ items.push(node);
13261
+ pushedIdx = items.length - 1;
13262
+ lastItemEnd = si.node.offset + si.node.length;
13263
+ }
13264
+ }
13265
+ }
13266
+ if (pending.length > 0) {
13267
+ const joined = joinPending(pending);
13268
+ const first = pending[0];
13269
+ const withLead = joined !== void 0 && first !== void 0 && lastItemEnd >= 0 && first.offset >= 0 && hasBlankLineAbove(state.text, first.offset) ? `\n${joined}` : joined;
13270
+ if (withLead !== void 0) seqTrailing = joinComments(seqTrailing, withLead);
12759
13271
  }
13272
+ const seqComment = meta?.comment !== void 0 ? seqTrailing !== void 0 ? `${meta.comment}\n${seqTrailing}` : meta.comment : seqTrailing;
12760
13273
  const seq = new YamlSeq({
12761
13274
  items,
12762
13275
  style: "flow",
@@ -12764,13 +13277,13 @@ function composeFlowSeqInner(cst, state, meta, parentBlockColumn) {
12764
13277
  length: cst.length,
12765
13278
  ...meta?.tag !== void 0 ? { tag: meta.tag } : {},
12766
13279
  ...meta?.anchor !== void 0 ? { anchor: meta.anchor } : {},
12767
- ...meta?.comment !== void 0 ? { comment: meta.comment } : {}
13280
+ ...seqComment !== void 0 ? { comment: seqComment } : {}
12768
13281
  });
12769
13282
  if (meta?.anchor) registerAnchor(seq, meta.anchor, state, cst.offset);
12770
13283
  return seq;
12771
13284
  }
12772
13285
  //#endregion
12773
- //#region ../../node_modules/.pnpm/@effected+yaml@0.7.0_effect@4.0.0-beta.107/node_modules/@effected/yaml/internal/composer/document.js
13286
+ //#region ../../node_modules/.pnpm/@effected+yaml@0.8.0_effect@4.0.0-beta.107/node_modules/@effected/yaml/internal/composer/document.js
12774
13287
  /** The flow-composer dispatch wired into every state this module creates. */
12775
13288
  const FLOW = {
12776
13289
  composeFlowMap,
@@ -12894,6 +13407,9 @@ function composeDocument(cst, state, hasSubsequentDocuments = false, nextDocCst)
12894
13407
  const directives = [];
12895
13408
  let contents = null;
12896
13409
  let documentComment;
13410
+ let documentCommentAfter;
13411
+ let lastLeadingCommentOffset = -1;
13412
+ let sawDocEndMarker = false;
12897
13413
  const hasDocStart = children.some((c) => c.type === "whitespace" && c.source === "---");
12898
13414
  let i = 0;
12899
13415
  const meta = {};
@@ -12929,6 +13445,7 @@ function composeDocument(cst, state, hasSubsequentDocuments = false, nextDocCst)
12929
13445
  }
12930
13446
  if (child.type === "newline" && hasMeta(meta)) sawNewlineSinceMeta = true;
12931
13447
  if (child.type === "whitespace" || child.type === "newline") {
13448
+ if (child.type === "whitespace" && child.source === "...") sawDocEndMarker = true;
12932
13449
  if (child.type === "whitespace" && (child.source === "]" || child.source === "}")) state.errors.push({
12933
13450
  code: "MalformedFlowCollection",
12934
13451
  message: `Unexpected flow indicator '${child.source}' at document level`,
@@ -12938,8 +13455,18 @@ function composeDocument(cst, state, hasSubsequentDocuments = false, nextDocCst)
12938
13455
  i++;
12939
13456
  continue;
12940
13457
  }
12941
- if (child.type === "comment" && contents === null) {
12942
- documentComment = child.source.startsWith("#") ? child.source.slice(1).trim() : child.source;
13458
+ if (child.type === "comment" && contents === null && !sawDocEndMarker) {
13459
+ const text = rawCommentText(child.source);
13460
+ if (documentComment !== void 0 && hasBlankLineAbove(state.text, child.offset)) documentComment = `${documentComment}\n`;
13461
+ documentComment = documentComment === void 0 ? text : `${documentComment}\n${text}`;
13462
+ lastLeadingCommentOffset = child.offset;
13463
+ i++;
13464
+ continue;
13465
+ }
13466
+ if (child.type === "comment") {
13467
+ const text = rawCommentText(child.source);
13468
+ if (documentCommentAfter !== void 0 && hasBlankLineAbove(state.text, child.offset)) documentCommentAfter = `${documentCommentAfter}\n`;
13469
+ documentCommentAfter = documentCommentAfter === void 0 ? text : `${documentCommentAfter}\n${text}`;
12943
13470
  i++;
12944
13471
  continue;
12945
13472
  }
@@ -13158,6 +13685,8 @@ function composeDocument(cst, state, hasSubsequentDocuments = false, nextDocCst)
13158
13685
  break;
13159
13686
  }
13160
13687
  }
13688
+ if (documentComment !== void 0 && contents !== null && hasBlankLineBelow(state.text, lastLeadingCommentOffset)) documentComment = `${documentComment}\n`;
13689
+ state.escapedComments.length = 0;
13161
13690
  return {
13162
13691
  contents,
13163
13692
  errors: [...state.errors],
@@ -13166,7 +13695,8 @@ function composeDocument(cst, state, hasSubsequentDocuments = false, nextDocCst)
13166
13695
  hasDocumentStart: hasDocStart,
13167
13696
  hasDocumentEnd: hasDocEnd,
13168
13697
  hasDocumentStartTab: hasDocStartTab,
13169
- ...documentComment !== void 0 ? { comment: documentComment } : {}
13698
+ ...documentComment !== void 0 ? { comment: documentComment } : {},
13699
+ ...documentCommentAfter !== void 0 ? { commentAfter: documentCommentAfter } : {}
13170
13700
  };
13171
13701
  }
13172
13702
  /**
@@ -13331,8 +13861,9 @@ function decorateSourceMultiline(node, text) {
13331
13861
  style: node.style,
13332
13862
  ...node.tag !== void 0 ? { tag: node.tag } : {},
13333
13863
  ...node.anchor !== void 0 ? { anchor: node.anchor } : {},
13334
- ...node.comment !== void 0 ? { comment: node.comment } : {},
13864
+ ...commentProps(node),
13335
13865
  ...node.chomp !== void 0 ? { chomp: node.chomp } : {},
13866
+ ...node.blockIndent !== void 0 ? { blockIndent: node.blockIndent } : {},
13336
13867
  ...node.raw !== void 0 ? { raw: node.raw } : {},
13337
13868
  sourceMultiline: true,
13338
13869
  offset: node.offset,
@@ -13343,7 +13874,7 @@ function decorateSourceMultiline(node, text) {
13343
13874
  const newItems = node.items.map((pair) => new YamlPair({
13344
13875
  key: decorateSourceMultiline(pair.key, text) ?? pair.key,
13345
13876
  value: pair.value === null ? null : decorateSourceMultiline(pair.value, text),
13346
- ...pair.comment !== void 0 ? { comment: pair.comment } : {}
13877
+ ...commentProps(pair)
13347
13878
  }));
13348
13879
  const multiline = isSourceMultiline(text, node.offset, node.length);
13349
13880
  return new YamlMap({
@@ -13351,7 +13882,7 @@ function decorateSourceMultiline(node, text) {
13351
13882
  style: node.style,
13352
13883
  ...node.tag !== void 0 ? { tag: node.tag } : {},
13353
13884
  ...node.anchor !== void 0 ? { anchor: node.anchor } : {},
13354
- ...node.comment !== void 0 ? { comment: node.comment } : {},
13885
+ ...commentProps(node),
13355
13886
  ...multiline ? { sourceMultiline: true } : {},
13356
13887
  offset: node.offset,
13357
13888
  length: node.length
@@ -13365,7 +13896,7 @@ function decorateSourceMultiline(node, text) {
13365
13896
  style: node.style,
13366
13897
  ...node.tag !== void 0 ? { tag: node.tag } : {},
13367
13898
  ...node.anchor !== void 0 ? { anchor: node.anchor } : {},
13368
- ...node.comment !== void 0 ? { comment: node.comment } : {},
13899
+ ...commentProps(node),
13369
13900
  ...multiline ? { sourceMultiline: true } : {},
13370
13901
  offset: node.offset,
13371
13902
  length: node.length
@@ -13382,6 +13913,7 @@ function decorateDocumentSourceMultiline(doc, text) {
13382
13913
  warnings: doc.warnings,
13383
13914
  directives: doc.directives,
13384
13915
  ...doc.comment !== void 0 ? { comment: doc.comment } : {},
13916
+ ...doc.commentAfter !== void 0 ? { commentAfter: doc.commentAfter } : {},
13385
13917
  hasDocumentStart: doc.hasDocumentStart,
13386
13918
  hasDocumentEnd: doc.hasDocumentEnd,
13387
13919
  hasDocumentStartTab: doc.hasDocumentStartTab
@@ -13404,12 +13936,29 @@ const EMPTY_DOCUMENT = {
13404
13936
  * state and therefore appear in the returned document's `errors`.
13405
13937
  */
13406
13938
  function composeFirstDocument(text, options) {
13939
+ return composeFirstDocumentCounted(text, options).document;
13940
+ }
13941
+ /**
13942
+ * {@link composeFirstDocument} plus the CST-level document count of the whole
13943
+ * stream, from the single CST parse the compose already performs — no second
13944
+ * walk, and correct where a regex on `---` is not (a `---` inside a block
13945
+ * scalar or quoted string is content, not a document marker). Callers that
13946
+ * must refuse multi-document input (the `YamlFormat` single-document
13947
+ * contract) read `documentCount` instead of re-parsing.
13948
+ */
13949
+ function composeFirstDocumentCounted(text, options) {
13407
13950
  const cstNodes = parseCSTAll(text);
13408
13951
  const state = createState(text, FLOW, options);
13409
13952
  validateCrossDocumentDirectives(cstNodes, state);
13410
13953
  const doc = cstNodes[0];
13411
- if (!doc) return EMPTY_DOCUMENT;
13412
- return decorateDocumentSourceMultiline(composeDocument(doc, state, cstNodes.length > 1, cstNodes[1]), text);
13954
+ if (!doc) return {
13955
+ document: EMPTY_DOCUMENT,
13956
+ documentCount: 0
13957
+ };
13958
+ return {
13959
+ document: decorateDocumentSourceMultiline(composeDocument(doc, state, cstNodes.length > 1, cstNodes[1]), text),
13960
+ documentCount: cstNodes.length
13961
+ };
13413
13962
  }
13414
13963
  /**
13415
13964
  * Compose every document of `text` with full error recovery — v3
@@ -13436,7 +13985,7 @@ function composeAllDocuments(text, options) {
13436
13985
  };
13437
13986
  }
13438
13987
  //#endregion
13439
- //#region ../../node_modules/.pnpm/@effected+yaml@0.7.0_effect@4.0.0-beta.107/node_modules/@effected/yaml/internal/fold.js
13988
+ //#region ../../node_modules/.pnpm/@effected+yaml@0.8.0_effect@4.0.0-beta.107/node_modules/@effected/yaml/internal/fold.js
13440
13989
  /**
13441
13990
  * Column-based line folding for a single logical scalar line (YAML 1.2 flow
13442
13991
  * folding, §7.3 / §8.2.1). Breaks the content at "safe" single-space
@@ -13612,12 +14161,18 @@ function renderSingleQuotedMultiline(s, indent) {
13612
14161
  * @param explicitChomp - Original chomp indicator from the AST, when known.
13613
14162
  * `keep` (`+`) and `strip` (`-`) preserve trailing-newline semantics that
13614
14163
  * cannot be inferred from the resolved value alone.
14164
+ * @param preserveKeep - Re-emit a REDUNDANT explicit `+` (a keep header whose
14165
+ * value ends in exactly one newline, where clip would read identically) —
14166
+ * fidelity-path header preservation; canonical mode passes false.
14167
+ * @param explicitIndent - Explicit indentation-indicator digit from the AST,
14168
+ * re-emitted only when it matches the rendered indent (fidelity path).
13615
14169
  */
13616
- function renderBlockLiteral(s, indent, explicitChomp, parentPosition) {
14170
+ function renderBlockLiteral(s, indent, explicitChomp, parentPosition, preserveKeep = false, explicitIndent) {
13617
14171
  let chomp = "";
13618
14172
  const onlyNewlines = s.length > 0 && /^\n+$/.test(s);
13619
14173
  if (s.endsWith("\n\n") || onlyNewlines && explicitChomp === "keep") chomp = "+";
13620
14174
  else if (!s.endsWith("\n")) chomp = "-";
14175
+ else if (preserveKeep && explicitChomp === "keep") chomp = "+";
13621
14176
  const lines = s.split("\n");
13622
14177
  if (s.endsWith("\n")) lines.pop();
13623
14178
  let indentIndicator = "";
@@ -13625,6 +14180,7 @@ function renderBlockLiteral(s, indent, explicitChomp, parentPosition) {
13625
14180
  const hasContent = firstContent !== void 0;
13626
14181
  if (firstContent?.startsWith(" ") || lines.length > 0 && lines[0] === "" && hasContent) indentIndicator = String(indent.length);
13627
14182
  else if (!hasContent && chomp === "+" && parentPosition === "block-map-value" && indent.length > 0) indentIndicator = String(indent.length);
14183
+ else if (explicitIndent !== void 0 && explicitIndent === indent.length) indentIndicator = String(explicitIndent);
13628
14184
  return `|${indentIndicator}${chomp}\n${lines.map((l) => l === "" ? "" : `${indent}${l}`).join("\n")}`;
13629
14185
  }
13630
14186
  /**
@@ -13635,34 +14191,39 @@ function renderBlockLiteral(s, indent, explicitChomp, parentPosition) {
13635
14191
  * the output must contain an empty line (double newline). Each empty line
13636
14192
  * in the value already produces the correct number of blank lines.
13637
14193
  */
13638
- function renderBlockFolded(s, indent) {
14194
+ function renderBlockFolded(s, indent, explicitChomp, explicitIndent) {
13639
14195
  let chomp = "";
13640
14196
  if (s.endsWith("\n\n")) chomp = "+";
13641
14197
  else if (!s.endsWith("\n")) chomp = "-";
14198
+ else if (explicitChomp === "keep") chomp = "+";
13642
14199
  const valueLines = s.split("\n");
13643
14200
  if (s.endsWith("\n")) valueLines.pop();
13644
14201
  let indentIndicator = "";
13645
14202
  const firstContent = valueLines.find((l) => l !== "");
13646
14203
  if (firstContent?.startsWith(" ") || valueLines.length >= 2 && valueLines[0] === "" && valueLines[1] === "" && firstContent !== void 0) indentIndicator = String(indent.length);
14204
+ else if (explicitIndent !== void 0 && explicitIndent === indent.length) indentIndicator = String(explicitIndent);
13647
14205
  const outputLines = [];
14206
+ let lastContentIdx = -1;
14207
+ for (let i = valueLines.length - 1; i >= 0; i--) if (valueLines[i] !== "") {
14208
+ lastContentIdx = i;
14209
+ break;
14210
+ }
13648
14211
  let prevNonEmpty = false;
13649
14212
  let prevMoreIndented = false;
14213
+ let pendingCompensation = false;
13650
14214
  for (let i = 0; i < valueLines.length; i++) {
13651
14215
  const line = valueLines[i];
13652
14216
  if (line === "") {
13653
- if (prevNonEmpty && !prevMoreIndented) {
13654
- let nextContentMoreIndented = false;
13655
- for (let j = i + 1; j < valueLines.length; j++) if (valueLines[j] !== "") {
13656
- nextContentMoreIndented = valueLines[j].startsWith(" ") || valueLines[j].startsWith(" ");
13657
- break;
13658
- }
13659
- if (!nextContentMoreIndented) outputLines.push("");
13660
- }
14217
+ if (prevNonEmpty && !prevMoreIndented && i < lastContentIdx) pendingCompensation = true;
13661
14218
  outputLines.push("");
13662
14219
  prevNonEmpty = false;
13663
14220
  prevMoreIndented = false;
13664
14221
  } else {
13665
14222
  const isMoreIndented = line.startsWith(" ") || line.startsWith(" ");
14223
+ if (pendingCompensation) {
14224
+ if (!isMoreIndented) outputLines.push("");
14225
+ pendingCompensation = false;
14226
+ }
13666
14227
  if (prevNonEmpty && !isMoreIndented) outputLines.push("");
13667
14228
  outputLines.push(`${indent}${line}`);
13668
14229
  prevNonEmpty = true;
@@ -13672,7 +14233,7 @@ function renderBlockFolded(s, indent) {
13672
14233
  return `>${indentIndicator}${chomp}\n${outputLines.join("\n")}`;
13673
14234
  }
13674
14235
  //#endregion
13675
- //#region ../../node_modules/.pnpm/@effected+yaml@0.7.0_effect@4.0.0-beta.107/node_modules/@effected/yaml/internal/stringifier.js
14236
+ //#region ../../node_modules/.pnpm/@effected+yaml@0.8.0_effect@4.0.0-beta.107/node_modules/@effected/yaml/internal/stringifier.js
13676
14237
  /**
13677
14238
  * Thrown by the stringifier on its failure paths (circular references). The
13678
14239
  * facade catches this and materializes the public stringify error.
@@ -13700,6 +14261,27 @@ var StringifyDepthExceeded = class extends Error {
13700
14261
  this.name = "StringifyDepthExceeded";
13701
14262
  }
13702
14263
  };
14264
+ /**
14265
+ * YAML 1.2 §8.1.3 caps an implicit block-mapping key: the `:` indicator must
14266
+ * appear at most 1024 characters after the start of the key. A key whose
14267
+ * RENDERED form (quotes and escapes count, the source scalar does not) is
14268
+ * longer than this must spill to explicit-key form (`? key` / `: value`) or
14269
+ * strict parsers reject the output. Matches the reference `yaml` package
14270
+ * (`stringifyPair`: `str.length > 1024`, block context only — flow contexts
14271
+ * never spill): a rendered key of exactly 1024 characters stays implicit.
14272
+ */
14273
+ const IMPLICIT_KEY_MAX_LENGTH = 1024;
14274
+ /**
14275
+ * Continuation-line padding for explicit-key compact notation. Structurally
14276
+ * the width of the `? ` / `: ` indicators — two columns — and deliberately
14277
+ * NOT `ctx.indent`: compact continuation lines must align with the first
14278
+ * item, which always starts two columns in, so any other pad silently
14279
+ * re-nests (or corrupts) the value on reparse once `indent !== 2`. This is a
14280
+ * recorded divergence from the reference `yaml` package, which pads these
14281
+ * lines with the configured indent and emits output its own strict parser
14282
+ * misreads or rejects at indent ≠ 2.
14283
+ */
14284
+ const EXPLICIT_COMPACT_PAD = " ";
13703
14285
  const NULL_RE = /^(?:null|Null|NULL|~)$/;
13704
14286
  const TRUE_RE = /^(?:true|True|TRUE)$/;
13705
14287
  const FALSE_RE = /^(?:false|False|FALSE)$/;
@@ -13847,7 +14429,9 @@ function renderSingleQuoted(s) {
13847
14429
  * Block literal and block folded styles are always accepted for single-line
13848
14430
  * strings even though the output is unusual.
13849
14431
  */
13850
- function renderString(s, style, indent, ignoreType = false, canonical = false, explicitChomp, parentPosition, quoteStyle = "single") {
14432
+ function renderString(s, style, indent, ignoreType = false, canonical = false, explicitChomp, parentPosition, quoteStyle = "single", explicitIndent) {
14433
+ const fidelity = !canonical;
14434
+ const fidelityIndent = fidelity ? explicitIndent : void 0;
13851
14435
  if (s.includes("\n")) {
13852
14436
  let hasControl = false;
13853
14437
  for (let i = 0; i < s.length; i++) {
@@ -13863,14 +14447,14 @@ function renderString(s, style, indent, ignoreType = false, canonical = false, e
13863
14447
  if (hasInteriorTrailingWhitespace(s)) return renderDoubleQuoted(s, canonical);
13864
14448
  if (hasNewlineSpacesTab(s)) return renderDoubleQuoted(s, canonical);
13865
14449
  }
13866
- if (style === "block-literal") return renderBlockLiteral(s, indent, explicitChomp, parentPosition);
13867
- if (style === "block-folded") return renderBlockFolded(s, indent);
14450
+ if (style === "block-literal") return renderBlockLiteral(s, indent, explicitChomp, parentPosition, fidelity, fidelityIndent);
14451
+ if (style === "block-folded") return renderBlockFolded(s, indent, fidelity ? explicitChomp : void 0, fidelityIndent);
13868
14452
  if (style === "plain" || style === "single-quoted") {
13869
14453
  if (canonical) {
13870
14454
  const sq = renderSingleQuotedMultiline(s, indent);
13871
14455
  if (sq !== null) return sq;
13872
14456
  }
13873
- return renderBlockLiteral(s, indent, explicitChomp, parentPosition);
14457
+ return renderBlockLiteral(s, indent, explicitChomp, parentPosition, fidelity, fidelityIndent);
13874
14458
  }
13875
14459
  return renderDoubleQuoted(s, canonical);
13876
14460
  }
@@ -13886,8 +14470,8 @@ function renderString(s, style, indent, ignoreType = false, canonical = false, e
13886
14470
  return s;
13887
14471
  case "single-quoted": return renderSingleQuoted(s);
13888
14472
  case "double-quoted": return renderDoubleQuoted(s, canonical);
13889
- case "block-literal": return renderBlockLiteral(s, indent, explicitChomp, parentPosition);
13890
- case "block-folded": return renderBlockFolded(s, indent);
14473
+ case "block-literal": return renderBlockLiteral(s, indent, explicitChomp, parentPosition, fidelity, fidelityIndent);
14474
+ case "block-folded": return renderBlockFolded(s, indent, fidelity ? explicitChomp : void 0, fidelityIndent);
13891
14475
  }
13892
14476
  }
13893
14477
  /**
@@ -14017,6 +14601,18 @@ function stringifyObjectLines(obj, ctx, depth) {
14017
14601
  const keyStr = renderKey(k);
14018
14602
  const val = obj[k];
14019
14603
  const valLines = stringifyLines(val, ctx, depth + 1);
14604
+ if (keyStr.length > IMPLICIT_KEY_MAX_LENGTH) {
14605
+ lines.push(`? ${keyStr}`);
14606
+ if (valLines.length === 1) lines.push(`: ${valLines[0]}`);
14607
+ else if (valLines[0].startsWith("|") || valLines[0].startsWith(">") || typeof val === "string") {
14608
+ lines.push(`: ${valLines[0]}`);
14609
+ for (let i = 1; i < valLines.length; i++) lines.push(valLines[i]);
14610
+ } else {
14611
+ lines.push(`: ${valLines[0]}`);
14612
+ for (let i = 1; i < valLines.length; i++) lines.push(valLines[i] === "" ? valLines[i] : `${EXPLICIT_COMPACT_PAD}${valLines[i]}`);
14613
+ }
14614
+ continue;
14615
+ }
14020
14616
  if (valLines.length === 1 && !isBlockCollection(val, ctx)) lines.push(`${keyStr}: ${valLines[0]}`);
14021
14617
  else {
14022
14618
  const first = valLines[0];
@@ -14089,7 +14685,9 @@ effect.Schema.Class("YamlStringifyOptions")({
14089
14685
  * Error-recovery parse failure: aggregates every fatal {@link YamlDiagnostic}
14090
14686
  * encountered, so a single failure reports the whole batch. Raised by
14091
14687
  * {@link Yaml.parse}, {@link Yaml.parseAll}, `YamlDocument.parse`/`parseAll`
14092
- * and the decode direction of the schema factories.
14688
+ * and the decode direction of the schema factories. The error itself has no
14689
+ * `code` field: read the code from the diagnostics —
14690
+ * `error.diagnostics[0].code` is the primary failure.
14093
14691
  *
14094
14692
  * @public
14095
14693
  */
@@ -14107,7 +14705,8 @@ var YamlParseError = class extends effect.Schema.TaggedError()("YamlParseError",
14107
14705
  * Stringification failure (the circular-reference guard), carrying structured
14108
14706
  * {@link YamlDiagnostic} entries and the offending value. Raised by
14109
14707
  * {@link Yaml.stringify}, `YamlDocument#stringify` and the encode direction of
14110
- * the schema factories.
14708
+ * the schema factories. The error itself has no `code` field: read the code
14709
+ * from the diagnostics — `error.diagnostics[0].code` is the primary failure.
14111
14710
  *
14112
14711
  * @public
14113
14712
  */
@@ -14205,6 +14804,35 @@ const parseResultImpl = (text, options) => {
14205
14804
  }
14206
14805
  };
14207
14806
  /**
14807
+ * Synchronous multi-document parse returning a `Result`. Mirrors
14808
+ * {@link parseResultImpl} over the whole stream: stream-level
14809
+ * directive-placement errors and every document's failure records aggregate
14810
+ * into one {@link YamlParseError}; each document's value is extracted against
14811
+ * its own independent anchor map (anchors are document-scoped in a stream),
14812
+ * with the alias-expansion budget materialized as a typed failure.
14813
+ */
14814
+ const parseAllResultImpl = (text, options) => {
14815
+ const { documents, streamErrors } = composeAllDocuments(text, toParseInput(options));
14816
+ const uniqueKeys = options?.uniqueKeys ?? true;
14817
+ const failures = [...streamErrors.filter((e) => isFatalCode(e.code)), ...documents.flatMap((d) => failureRecords(d, uniqueKeys))];
14818
+ if (failures.length > 0) return effect.Result.fail(new YamlParseError({
14819
+ diagnostics: toDiagnostics(text, failures),
14820
+ input: text
14821
+ }));
14822
+ const maxAliasCount = options?.maxAliasCount ?? 100;
14823
+ const values = [];
14824
+ for (const d of documents) {
14825
+ const anchors = /* @__PURE__ */ new Map();
14826
+ try {
14827
+ values.push(nodeToJsValue(d.contents, anchors, maxAliasCount));
14828
+ } catch (defect) {
14829
+ if (defect instanceof AliasExpansionBudgetExceeded) return effect.Result.fail(aliasCountExceededError(defect.message, text));
14830
+ throw defect;
14831
+ }
14832
+ }
14833
+ return effect.Result.succeed(values);
14834
+ };
14835
+ /**
14208
14836
  * Synchronous stringify returning a `Result`. Mirrors {@link Yaml.stringify}
14209
14837
  * without the Effect wrapper: a circular reference or a value nested past the
14210
14838
  * recursion budget yields a `Failure` carrying a typed {@link YamlStringifyError},
@@ -14230,19 +14858,6 @@ const failureRecords = (doc, uniqueKeys) => {
14230
14858
  if (fatal.length > 0) return fatal;
14231
14859
  return uniqueKeys ? doc.warnings.filter((w) => w.code === "DuplicateKey") : [];
14232
14860
  };
14233
- /**
14234
- * Extract a document's plain-JS value with an alias-expansion budget derived
14235
- * from `maxAliasCount`, materializing a "billion laughs" blow-up as a typed
14236
- * fatal {@link YamlParseError} (`AliasCountExceeded`) instead of letting the
14237
- * heap-exhausting expansion escape as an unhandled defect.
14238
- */
14239
- const extractDocumentValue = (contents, anchors, maxAliasCount, text) => effect.Effect.try({
14240
- try: () => nodeToJsValue(contents, anchors, maxAliasCount),
14241
- catch: (defect) => {
14242
- if (defect instanceof AliasExpansionBudgetExceeded) return aliasCountExceededError(defect.message, text);
14243
- throw defect;
14244
- }
14245
- });
14246
14861
  const stringifyOrFail = (value, options) => effect.Effect.try({
14247
14862
  try: () => stringifyValue(value, toStringifyInput(options)),
14248
14863
  catch: (defect) => {
@@ -14301,23 +14916,11 @@ var Yaml = class Yaml {
14301
14916
  * A "billion laughs" alias-expansion blow-up in any document also fails
14302
14917
  * through {@link YamlParseError} with an `AliasCountExceeded` diagnostic,
14303
14918
  * never as an unhandled defect.
14919
+ *
14920
+ * Defined in terms of {@link Yaml.parseAllResult} — synchronous callers
14921
+ * can use that variant directly.
14304
14922
  */
14305
- static parseAll = effect.Effect.fn("Yaml.parseAll")(function* (text, options) {
14306
- const { documents, streamErrors } = composeAllDocuments(text, toParseInput(options));
14307
- const uniqueKeys = options?.uniqueKeys ?? true;
14308
- const failures = [...streamErrors.filter((e) => e.code === "InvalidDirective"), ...documents.flatMap((d) => failureRecords(d, uniqueKeys))];
14309
- if (failures.length > 0) return yield* new YamlParseError({
14310
- diagnostics: toDiagnostics(text, failures),
14311
- input: text
14312
- });
14313
- const maxAliasCount = options?.maxAliasCount ?? 100;
14314
- const values = [];
14315
- for (const d of documents) {
14316
- const anchors = buildAnchorMap(d.contents);
14317
- values.push(yield* extractDocumentValue(d.contents, anchors, maxAliasCount, text));
14318
- }
14319
- return values;
14320
- });
14923
+ static parseAll = effect.Effect.fn("Yaml.parseAll")((text, options) => effect.Effect.fromResult(Yaml.parseAllResult(text, options)));
14321
14924
  /**
14322
14925
  * Stringify a plain JavaScript value as YAML. Fails with
14323
14926
  * {@link YamlStringifyError} on circular references (`CircularReference`)
@@ -14373,6 +14976,48 @@ var Yaml = class Yaml {
14373
14976
  return parseResultImpl(text, options);
14374
14977
  }
14375
14978
  /**
14979
+ * Synchronous multi-document parse, returning a `Result` instead of an
14980
+ * `Effect` — the {@link Yaml.parseResult} counterpart to
14981
+ * {@link Yaml.parseAll}. Empty input succeeds with `[null]` (the engine
14982
+ * reads `""` as one empty document, exactly as {@link Yaml.parse} yields
14983
+ * `null` for it); a single-document stream succeeds with a one-element
14984
+ * array whose value is exactly what {@link Yaml.parseResult} yields.
14985
+ *
14986
+ * @remarks
14987
+ * This is the package's single multi-document parse path.
14988
+ * {@link Yaml.parseAll} is defined in terms of it (`Effect.fromResult`
14989
+ * behind the named span), so the two variants cannot diverge. Anchors are
14990
+ * document-scoped: each document's aliases resolve against its own anchor
14991
+ * map, never a neighbor's.
14992
+ *
14993
+ * Fails with the aggregate {@link YamlParseError} when **any** document in
14994
+ * the stream carries a fatal diagnostic (or a stream-level
14995
+ * directive-placement error), which makes it a whole-stream validity
14996
+ * check: a `Success` means every document parsed clean. Preserves the
14997
+ * package contract — malformed and adversarial input (including a
14998
+ * "billion laughs" alias bomb in any document) fails typed, never as a
14999
+ * defect; the method never throws.
15000
+ *
15001
+ * @example
15002
+ * ```ts
15003
+ * import { Yaml } from "@effected/yaml";
15004
+ * import { Result } from "effect";
15005
+ *
15006
+ * // Whole-stream validity check: fails if ANY document is invalid.
15007
+ * const result = Yaml.parseAllResult("a: 1\n---\nb: 2\n");
15008
+ * if (Result.isSuccess(result)) {
15009
+ * result.success; // [{ a: 1 }, { b: 2 }]
15010
+ * } else {
15011
+ * result.failure; // YamlParseError aggregating every fatal diagnostic
15012
+ * }
15013
+ * ```
15014
+ *
15015
+ * @public
15016
+ */
15017
+ static parseAllResult(text, options) {
15018
+ return parseAllResultImpl(text, options);
15019
+ }
15020
+ /**
14376
15021
  * Synchronous stringify, returning a `Result` instead of an `Effect`.
14377
15022
  * The pure counterpart to {@link Yaml.stringify} for config-time callers
14378
15023
  * that cannot `await`.
@@ -14624,7 +15269,7 @@ function deepEqualValues(a, b) {
14624
15269
  return false;
14625
15270
  }
14626
15271
  //#endregion
14627
- //#region ../../node_modules/.pnpm/@effected+lockfiles@0.4.0_@effected+jsonc@0.6.0_effect@4.0.0-beta.107__@effected+npm@0._83da5ef372786d059bed7f4a907143ef/node_modules/@effected/lockfiles/internal/documents.js
15272
+ //#region ../../node_modules/.pnpm/@effected+lockfiles@0.4.1_@effected+jsonc@0.6.0_effect@4.0.0-beta.107__@effected+npm@0._0858c2cd87fcfa2cb556a350de7e385b/node_modules/@effected/lockfiles/internal/documents.js
14628
15273
  /**
14629
15274
  * An empty YAML document composes to `null` (`Yaml.parseAll("")` is `[null]`,
14630
15275
  * and the trailing document of an env-only `pnpm-lock.yaml` is `null` too).
@@ -14694,7 +15339,7 @@ const selectSoleDocument = (content) => effect.Effect.gen(function* () {
14694
15339
  };
14695
15340
  });
14696
15341
  //#endregion
14697
- //#region ../../node_modules/.pnpm/@effected+lockfiles@0.4.0_@effected+jsonc@0.6.0_effect@4.0.0-beta.107__@effected+npm@0._83da5ef372786d059bed7f4a907143ef/node_modules/@effected/lockfiles/internal/pnpm.js
15342
+ //#region ../../node_modules/.pnpm/@effected+lockfiles@0.4.1_@effected+jsonc@0.6.0_effect@4.0.0-beta.107__@effected+npm@0._0858c2cd87fcfa2cb556a350de7e385b/node_modules/@effected/lockfiles/internal/pnpm.js
14698
15343
  const PnpmImporterDeps = effect.Schema.optionalKey(effect.Schema.Record(effect.Schema.String, effect.Schema.Struct({
14699
15344
  specifier: effect.Schema.String,
14700
15345
  version: effect.Schema.String
@@ -14819,7 +15464,7 @@ const toFields$1 = (raw) => effect.Effect.gen(function* () {
14819
15464
  };
14820
15465
  });
14821
15466
  //#endregion
14822
- //#region ../../node_modules/.pnpm/@effected+lockfiles@0.4.0_@effected+jsonc@0.6.0_effect@4.0.0-beta.107__@effected+npm@0._83da5ef372786d059bed7f4a907143ef/node_modules/@effected/lockfiles/internal/yarn.js
15467
+ //#region ../../node_modules/.pnpm/@effected+lockfiles@0.4.1_@effected+jsonc@0.6.0_effect@4.0.0-beta.107__@effected+npm@0._0858c2cd87fcfa2cb556a350de7e385b/node_modules/@effected/lockfiles/internal/yarn.js
14823
15468
  const YarnLockfileRaw = effect.Schema.Record(effect.Schema.String, effect.Schema.Unknown);
14824
15469
  const DepRecord = effect.Schema.optionalKey(effect.Schema.Record(effect.Schema.String, effect.Schema.String));
14825
15470
  const YarnEntry = effect.Schema.Struct({
@@ -14942,7 +15587,7 @@ const cleanYarnDeps = (deps) => {
14942
15587
  return Object.fromEntries(Object.entries(deps).map(([name, value]) => [name, value.startsWith("npm:") ? value.slice(4) : value]));
14943
15588
  };
14944
15589
  //#endregion
14945
- //#region ../../node_modules/.pnpm/@effected+lockfiles@0.4.0_@effected+jsonc@0.6.0_effect@4.0.0-beta.107__@effected+npm@0._83da5ef372786d059bed7f4a907143ef/node_modules/@effected/lockfiles/Lockfile.js
15590
+ //#region ../../node_modules/.pnpm/@effected+lockfiles@0.4.1_@effected+jsonc@0.6.0_effect@4.0.0-beta.107__@effected+npm@0._0858c2cd87fcfa2cb556a350de7e385b/node_modules/@effected/lockfiles/Lockfile.js
14946
15591
  const EMPTY_IMPORTERS = [];
14947
15592
  /**
14948
15593
  * Failure of `Lockfile.parse`: the given content is not a valid lockfile of
@@ -15186,7 +15831,7 @@ var Lockfile = class Lockfile extends effect.Schema.Class("Lockfile")({
15186
15831
  }
15187
15832
  };
15188
15833
  //#endregion
15189
- //#region ../../node_modules/.pnpm/@effected+lockfiles@0.4.0_@effected+jsonc@0.6.0_effect@4.0.0-beta.107__@effected+npm@0._83da5ef372786d059bed7f4a907143ef/node_modules/@effected/lockfiles/LockfileIntegrity.js
15834
+ //#region ../../node_modules/.pnpm/@effected+lockfiles@0.4.1_@effected+jsonc@0.6.0_effect@4.0.0-beta.107__@effected+npm@0._0858c2cd87fcfa2cb556a350de7e385b/node_modules/@effected/lockfiles/LockfileIntegrity.js
15190
15835
  /**
15191
15836
  * The minimal manifest shape {@link LockfileIntegrity.compare} checks a
15192
15837
  * lockfile against: a package name plus the four optional dependency maps.
@@ -17985,7 +18630,7 @@ var Package = class Package extends effect.Schema.Class("Package")({
17985
18630
  }
17986
18631
  };
17987
18632
  //#endregion
17988
- //#region ../../node_modules/.pnpm/@effected+workspaces@0.11.1_@effected+jsonc@0.6.0_effect@4.0.0-beta.107__effect@4.0.0-beta.107/node_modules/@effected/workspaces/WorkspacePackage.js
18633
+ //#region ../../node_modules/.pnpm/@effected+workspaces@0.11.2_@effected+jsonc@0.6.0_effect@4.0.0-beta.107__effect@4.0.0-beta.107/node_modules/@effected/workspaces/WorkspacePackage.js
17989
18634
  const EMPTY$1 = Object.freeze(Object.create(null));
17990
18635
  const EMPTY_MANIFEST = Object.freeze(Object.create(null));
17991
18636
  /**
@@ -18583,7 +19228,7 @@ var Walker$1 = class {
18583
19228
  static findRoot = findRoot$1;
18584
19229
  };
18585
19230
  //#endregion
18586
- //#region ../../node_modules/.pnpm/@effected+workspaces@0.11.1_@effected+jsonc@0.6.0_effect@4.0.0-beta.107__effect@4.0.0-beta.107/node_modules/@effected/workspaces/WorkspaceRoot.js
19231
+ //#region ../../node_modules/.pnpm/@effected+workspaces@0.11.2_@effected+jsonc@0.6.0_effect@4.0.0-beta.107__effect@4.0.0-beta.107/node_modules/@effected/workspaces/WorkspaceRoot.js
18587
19232
  /**
18588
19233
  * The marker filenames {@link WorkspaceRoot} probes for, in priority order.
18589
19234
  *
@@ -18770,7 +19415,7 @@ var WorkspaceRoot = class WorkspaceRoot extends effect.Context.Service()("@effec
18770
19415
  static layerTest = (root) => effect.Layer.effect(WorkspaceRoot, WorkspaceRoot.makeTest(root)).pipe(effect.Layer.provide(effect.Path.layer));
18771
19416
  };
18772
19417
  //#endregion
18773
- //#region ../../node_modules/.pnpm/@effected+workspaces@0.11.1_@effected+jsonc@0.6.0_effect@4.0.0-beta.107__effect@4.0.0-beta.107/node_modules/@effected/workspaces/internal/limits.js
19418
+ //#region ../../node_modules/.pnpm/@effected+workspaces@0.11.2_@effected+jsonc@0.6.0_effect@4.0.0-beta.107__effect@4.0.0-beta.107/node_modules/@effected/workspaces/internal/limits.js
18774
19419
  /**
18775
19420
  * Hard ceiling on directories the enumerator will visit for one pattern set.
18776
19421
  * Guards the pathological case a depth cap alone does not: a wide, shallow
@@ -18788,7 +19433,7 @@ const MAX_ENUMERATION_ENTRIES = 1e5;
18788
19433
  */
18789
19434
  const PRUNED_DIRECTORIES = /* @__PURE__ */ new Set([".git", "node_modules"]);
18790
19435
  //#endregion
18791
- //#region ../../node_modules/.pnpm/@effected+workspaces@0.11.1_@effected+jsonc@0.6.0_effect@4.0.0-beta.107__effect@4.0.0-beta.107/node_modules/@effected/workspaces/internal/traverse.js
19436
+ //#region ../../node_modules/.pnpm/@effected+workspaces@0.11.2_@effected+jsonc@0.6.0_effect@4.0.0-beta.107__effect@4.0.0-beta.107/node_modules/@effected/workspaces/internal/traverse.js
18792
19437
  /** Directory names never descended into. */
18793
19438
  const isPruned = (entry) => PRUNED_DIRECTORIES.has(entry);
18794
19439
  /** Join root-relative POSIX segments; `""` is the root itself. */
@@ -18878,7 +19523,7 @@ var Traversal = class {
18878
19523
  }
18879
19524
  };
18880
19525
  //#endregion
18881
- //#region ../../node_modules/.pnpm/@effected+workspaces@0.11.1_@effected+jsonc@0.6.0_effect@4.0.0-beta.107__effect@4.0.0-beta.107/node_modules/@effected/workspaces/internal/enumerate.js
19526
+ //#region ../../node_modules/.pnpm/@effected+workspaces@0.11.2_@effected+jsonc@0.6.0_effect@4.0.0-beta.107__effect@4.0.0-beta.107/node_modules/@effected/workspaces/internal/enumerate.js
18882
19527
  /** Strip a trailing slash from `GlobPattern.enumerationPrefix` to get a relative directory. */
18883
19528
  const baseOf = (pattern) => pattern.enumerationPrefix.replace(/\/$/, "");
18884
19529
  /**
@@ -18948,7 +19593,7 @@ const enumerate = (root, globs, options) => effect.Effect.gen(function* () {
18948
19593
  return results;
18949
19594
  });
18950
19595
  //#endregion
18951
- //#region ../../node_modules/.pnpm/@effected+workspaces@0.11.1_@effected+jsonc@0.6.0_effect@4.0.0-beta.107__effect@4.0.0-beta.107/node_modules/@effected/workspaces/internal/patterns.js
19596
+ //#region ../../node_modules/.pnpm/@effected+workspaces@0.11.2_@effected+jsonc@0.6.0_effect@4.0.0-beta.107__effect@4.0.0-beta.107/node_modules/@effected/workspaces/internal/patterns.js
18952
19597
  const stringsOf = (value) => Array.isArray(value) ? value.filter((entry) => typeof entry === "string") : void 0;
18953
19598
  /** The `packages:` list of a `pnpm-workspace.yaml` document. Total on a parsed document. */
18954
19599
  const pnpmPatternsOf = (document) => {
@@ -19005,7 +19650,7 @@ const readPatterns = (root) => effect.Effect.gen(function* () {
19005
19650
  return manifestPatternsOf(manifest);
19006
19651
  });
19007
19652
  //#endregion
19008
- //#region ../../node_modules/.pnpm/@effected+workspaces@0.11.1_@effected+jsonc@0.6.0_effect@4.0.0-beta.107__effect@4.0.0-beta.107/node_modules/@effected/workspaces/WorkspaceDiscovery.js
19653
+ //#region ../../node_modules/.pnpm/@effected+workspaces@0.11.2_@effected+jsonc@0.6.0_effect@4.0.0-beta.107__effect@4.0.0-beta.107/node_modules/@effected/workspaces/WorkspaceDiscovery.js
19009
19654
  /**
19010
19655
  * Raised when a workspace member's `package.json` cannot be read, parsed, or
19011
19656
  * used — it is missing, malformed, or lacks a `name` or `version`.
@@ -19461,7 +20106,7 @@ var WorkspaceDiscovery = class WorkspaceDiscovery extends effect.Context.Service
19461
20106
  };
19462
20107
  const isStringRecord$2 = (value) => value !== null && typeof value === "object" && !Array.isArray(value) && Object.values(value).every((entry) => typeof entry === "string");
19463
20108
  //#endregion
19464
- //#region ../../node_modules/.pnpm/@effected+workspaces@0.11.1_@effected+jsonc@0.6.0_effect@4.0.0-beta.107__effect@4.0.0-beta.107/node_modules/@effected/workspaces/DependencyGraph.js
20109
+ //#region ../../node_modules/.pnpm/@effected+workspaces@0.11.2_@effected+jsonc@0.6.0_effect@4.0.0-beta.107__effect@4.0.0-beta.107/node_modules/@effected/workspaces/DependencyGraph.js
19465
20110
  /**
19466
20111
  * Raised when the workspace dependency graph cannot be topologically ordered
19467
20112
  * because it contains a cycle.
@@ -22953,7 +23598,7 @@ var Git = class Git extends effect.Context.Service()("@effected/git/Git") {
22953
23598
  static layerTest = (overrides = {}) => effect.Layer.succeed(Git, Git.makeTest(overrides));
22954
23599
  };
22955
23600
  //#endregion
22956
- //#region ../../node_modules/.pnpm/@effected+workspaces@0.11.1_@effected+jsonc@0.6.0_effect@4.0.0-beta.107__effect@4.0.0-beta.107/node_modules/@effected/workspaces/ChangeDetector.js
23601
+ //#region ../../node_modules/.pnpm/@effected+workspaces@0.11.2_@effected+jsonc@0.6.0_effect@4.0.0-beta.107__effect@4.0.0-beta.107/node_modules/@effected/workspaces/ChangeDetector.js
22957
23602
  /**
22958
23603
  * Which git refs to compare, and whether to fold in the working tree.
22959
23604
  *
@@ -23209,7 +23854,7 @@ function resolveFromCatalog(catalogs, wantedDependency) {
23209
23854
  };
23210
23855
  }
23211
23856
  //#endregion
23212
- //#region ../../node_modules/.pnpm/@effected+workspaces@0.11.1_@effected+jsonc@0.6.0_effect@4.0.0-beta.107__effect@4.0.0-beta.107/node_modules/@effected/workspaces/internal/catalogs.js
23857
+ //#region ../../node_modules/.pnpm/@effected+workspaces@0.11.2_@effected+jsonc@0.6.0_effect@4.0.0-beta.107__effect@4.0.0-beta.107/node_modules/@effected/workspaces/internal/catalogs.js
23213
23858
  /** Project a pnpm-workspace manifest's `catalog` / `catalogs` fields into a `Catalogs` map. */
23214
23859
  const inlineCatalogs = (manifest) => {
23215
23860
  if (manifest.catalog === void 0 && manifest.catalogs === void 0) return {};
@@ -23273,7 +23918,7 @@ const rangeOf = (catalogs, dependency, specifier) => {
23273
23918
  });
23274
23919
  };
23275
23920
  //#endregion
23276
- //#region ../../node_modules/.pnpm/@effected+workspaces@0.11.1_@effected+jsonc@0.6.0_effect@4.0.0-beta.107__effect@4.0.0-beta.107/node_modules/@effected/workspaces/ConfigDependencyHooks.js
23921
+ //#region ../../node_modules/.pnpm/@effected+workspaces@0.11.2_@effected+jsonc@0.6.0_effect@4.0.0-beta.107__effect@4.0.0-beta.107/node_modules/@effected/workspaces/ConfigDependencyHooks.js
23277
23922
  /** Whether `value` is a non-null, non-array object. */
23278
23923
  const isObject$2 = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
23279
23924
  /**
@@ -23684,7 +24329,7 @@ var ConfigDependencyHooks = class ConfigDependencyHooks extends effect.Context.S
23684
24329
  }));
23685
24330
  };
23686
24331
  //#endregion
23687
- //#region ../../node_modules/.pnpm/@effected+workspaces@0.11.1_@effected+jsonc@0.6.0_effect@4.0.0-beta.107__effect@4.0.0-beta.107/node_modules/@effected/workspaces/PackageManagerName.js
24332
+ //#region ../../node_modules/.pnpm/@effected+workspaces@0.11.2_@effected+jsonc@0.6.0_effect@4.0.0-beta.107__effect@4.0.0-beta.107/node_modules/@effected/workspaces/PackageManagerName.js
23688
24333
  /**
23689
24334
  * The four package managers this package understands.
23690
24335
  *
@@ -24012,7 +24657,7 @@ var PackageManagerDetector = class PackageManagerDetector extends effect.Context
24012
24657
  static layerTest = (overrides = {}) => effect.Layer.succeed(PackageManagerDetector, PackageManagerDetector.makeTest(overrides));
24013
24658
  };
24014
24659
  //#endregion
24015
- //#region ../../node_modules/.pnpm/@effected+workspaces@0.11.1_@effected+jsonc@0.6.0_effect@4.0.0-beta.107__effect@4.0.0-beta.107/node_modules/@effected/workspaces/LockfileReader.js
24660
+ //#region ../../node_modules/.pnpm/@effected+workspaces@0.11.2_@effected+jsonc@0.6.0_effect@4.0.0-beta.107__effect@4.0.0-beta.107/node_modules/@effected/workspaces/LockfileReader.js
24016
24661
  /**
24017
24662
  * Raised when the workspace's lockfile cannot be read off disk.
24018
24663
  *
@@ -24192,7 +24837,7 @@ var LockfileReader = class LockfileReader extends effect.Context.Service()("@eff
24192
24837
  static layerTest = (overrides = {}) => effect.Layer.succeed(LockfileReader, LockfileReader.makeTest(overrides));
24193
24838
  };
24194
24839
  //#endregion
24195
- //#region ../../node_modules/.pnpm/@effected+workspaces@0.11.1_@effected+jsonc@0.6.0_effect@4.0.0-beta.107__effect@4.0.0-beta.107/node_modules/@effected/workspaces/Publishability.js
24840
+ //#region ../../node_modules/.pnpm/@effected+workspaces@0.11.2_@effected+jsonc@0.6.0_effect@4.0.0-beta.107__effect@4.0.0-beta.107/node_modules/@effected/workspaces/Publishability.js
24196
24841
  /** The public npm registry, used when `publishConfig.registry` says nothing. */
24197
24842
  const DEFAULT_REGISTRY = "https://registry.npmjs.org/";
24198
24843
  /**
@@ -24351,7 +24996,7 @@ var PublishabilityDetector = class extends effect.Context.Service()("@effected/w
24351
24996
  static layerNone = effect.Layer.succeed(this, this.none);
24352
24997
  };
24353
24998
  //#endregion
24354
- //#region ../../node_modules/.pnpm/@effected+workspaces@0.11.1_@effected+jsonc@0.6.0_effect@4.0.0-beta.107__effect@4.0.0-beta.107/node_modules/@effected/workspaces/internal/importerVersions.js
24999
+ //#region ../../node_modules/.pnpm/@effected+workspaces@0.11.2_@effected+jsonc@0.6.0_effect@4.0.0-beta.107__effect@4.0.0-beta.107/node_modules/@effected/workspaces/internal/importerVersions.js
24355
25000
  /**
24356
25001
  * Strip pnpm's peer-disambiguation suffix from a recorded importer version.
24357
25002
  *
@@ -24437,7 +25082,7 @@ const unanimousVersionOf = (index, dependency) => {
24437
25082
  return agreed;
24438
25083
  };
24439
25084
  //#endregion
24440
- //#region ../../node_modules/.pnpm/@effected+workspaces@0.11.1_@effected+jsonc@0.6.0_effect@4.0.0-beta.107__effect@4.0.0-beta.107/node_modules/@effected/workspaces/WorkspaceCatalogs.js
25085
+ //#region ../../node_modules/.pnpm/@effected+workspaces@0.11.2_@effected+jsonc@0.6.0_effect@4.0.0-beta.107__effect@4.0.0-beta.107/node_modules/@effected/workspaces/WorkspaceCatalogs.js
24441
25086
  /**
24442
25087
  * An immutable, fully-normalized catalog collection — the one catalog
24443
25088
  * resolution semantic in the package.
@@ -24964,7 +25609,7 @@ var WorkspaceCatalogs = class WorkspaceCatalogs extends effect.Context.Service()
24964
25609
  }));
24965
25610
  };
24966
25611
  //#endregion
24967
- //#region ../../node_modules/.pnpm/@effected+workspaces@0.11.1_@effected+jsonc@0.6.0_effect@4.0.0-beta.107__effect@4.0.0-beta.107/node_modules/@effected/workspaces/WorkspaceStateSnapshot.js
25612
+ //#region ../../node_modules/.pnpm/@effected+workspaces@0.11.2_@effected+jsonc@0.6.0_effect@4.0.0-beta.107__effect@4.0.0-beta.107/node_modules/@effected/workspaces/WorkspaceStateSnapshot.js
24968
25613
  const EMPTY = Object.freeze(Object.create(null));
24969
25614
  const DependencyMap = effect.Schema.Record(effect.Schema.String, effect.Schema.String).pipe(effect.Schema.withDecodingDefaultKey(effect.Effect.succeed(EMPTY)), effect.Schema.withConstructorDefault(effect.Effect.succeed(EMPTY)));
24970
25615
  /**
@@ -25187,7 +25832,7 @@ var WorkspaceStateSnapshot = class extends effect.Schema.Class("WorkspaceStateSn
25187
25832
  }
25188
25833
  };
25189
25834
  //#endregion
25190
- //#region ../../node_modules/.pnpm/@effected+workspaces@0.11.1_@effected+jsonc@0.6.0_effect@4.0.0-beta.107__effect@4.0.0-beta.107/node_modules/@effected/workspaces/WorkspaceSnapshots.js
25835
+ //#region ../../node_modules/.pnpm/@effected+workspaces@0.11.2_@effected+jsonc@0.6.0_effect@4.0.0-beta.107__effect@4.0.0-beta.107/node_modules/@effected/workspaces/WorkspaceSnapshots.js
25191
25836
  /** Whether `value` is a non-null, non-array object. */
25192
25837
  const isObject = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
25193
25838
  /** Whether every value in a record is a string — a usable dependency map. */
@@ -25464,7 +26109,7 @@ var WorkspaceSnapshots = class WorkspaceSnapshots extends effect.Context.Service
25464
26109
  static layerTest = (overrides = {}) => effect.Layer.succeed(WorkspaceSnapshots, WorkspaceSnapshots.makeTest(overrides));
25465
26110
  };
25466
26111
  //#endregion
25467
- //#region ../../node_modules/.pnpm/@effected+workspaces@0.11.1_@effected+jsonc@0.6.0_effect@4.0.0-beta.107__effect@4.0.0-beta.107/node_modules/@effected/workspaces/Workspaces.js
26112
+ //#region ../../node_modules/.pnpm/@effected+workspaces@0.11.2_@effected+jsonc@0.6.0_effect@4.0.0-beta.107__effect@4.0.0-beta.107/node_modules/@effected/workspaces/Workspaces.js
25468
26113
  const compose = (options, catalogsFactory) => {
25469
26114
  const roots = WorkspaceRoot.layer;
25470
26115
  const detector = PackageManagerDetector.layer;