universal-plugin 0.13.0 → 0.14.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli.mjs CHANGED
@@ -19,7 +19,7 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
19
19
  var __getOwnPropNames = Object.getOwnPropertyNames;
20
20
  var __getProtoOf = Object.getPrototypeOf;
21
21
  var __hasOwnProp = Object.prototype.hasOwnProperty;
22
- var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports);
22
+ var __commonJSMin$1 = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports);
23
23
  var __copyProps = (to, from, except, desc) => {
24
24
  if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
25
25
  key = keys[i];
@@ -34,7 +34,6 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
34
34
  value: mod,
35
35
  enumerable: true
36
36
  }) : target, mod));
37
- var __require = /* #__PURE__ */ (() => createRequire(import.meta.url))();
38
37
  //#endregion
39
38
  //#region ../../node_modules/.pnpm/commander@15.0.0/node_modules/commander/lib/error.js
40
39
  /**
@@ -3160,7 +3159,7 @@ function cleanCommand() {
3160
3159
  }
3161
3160
  //#endregion
3162
3161
  //#region ../../node_modules/.pnpm/semver@7.8.1/node_modules/semver/internal/constants.js
3163
- var require_constants = /* @__PURE__ */ __commonJSMin(((exports, module) => {
3162
+ var require_constants = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
3164
3163
  module.exports = {
3165
3164
  MAX_LENGTH: 256,
3166
3165
  MAX_SAFE_COMPONENT_LENGTH: 16,
@@ -3183,12 +3182,12 @@ var require_constants = /* @__PURE__ */ __commonJSMin(((exports, module) => {
3183
3182
  }));
3184
3183
  //#endregion
3185
3184
  //#region ../../node_modules/.pnpm/semver@7.8.1/node_modules/semver/internal/debug.js
3186
- var require_debug = /* @__PURE__ */ __commonJSMin(((exports, module) => {
3185
+ var require_debug = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
3187
3186
  module.exports = typeof process === "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG) ? (...args) => console.error("SEMVER", ...args) : () => {};
3188
3187
  }));
3189
3188
  //#endregion
3190
3189
  //#region ../../node_modules/.pnpm/semver@7.8.1/node_modules/semver/internal/re.js
3191
- var require_re = /* @__PURE__ */ __commonJSMin(((exports, module) => {
3190
+ var require_re = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
3192
3191
  const { MAX_SAFE_COMPONENT_LENGTH, MAX_SAFE_BUILD_LENGTH, MAX_LENGTH } = require_constants();
3193
3192
  const debug = require_debug();
3194
3193
  exports = module.exports = {};
@@ -3267,7 +3266,7 @@ var require_re = /* @__PURE__ */ __commonJSMin(((exports, module) => {
3267
3266
  }));
3268
3267
  //#endregion
3269
3268
  //#region ../../node_modules/.pnpm/semver@7.8.1/node_modules/semver/internal/parse-options.js
3270
- var require_parse_options = /* @__PURE__ */ __commonJSMin(((exports, module) => {
3269
+ var require_parse_options = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
3271
3270
  const looseOption = Object.freeze({ loose: true });
3272
3271
  const emptyOpts = Object.freeze({});
3273
3272
  const parseOptions = (options) => {
@@ -3279,7 +3278,7 @@ var require_parse_options = /* @__PURE__ */ __commonJSMin(((exports, module) =>
3279
3278
  }));
3280
3279
  //#endregion
3281
3280
  //#region ../../node_modules/.pnpm/semver@7.8.1/node_modules/semver/internal/identifiers.js
3282
- var require_identifiers = /* @__PURE__ */ __commonJSMin(((exports, module) => {
3281
+ var require_identifiers = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
3283
3282
  const numeric = /^[0-9]+$/;
3284
3283
  const compareIdentifiers = (a, b) => {
3285
3284
  if (typeof a === "number" && typeof b === "number") return a === b ? 0 : a < b ? -1 : 1;
@@ -3299,7 +3298,7 @@ var require_identifiers = /* @__PURE__ */ __commonJSMin(((exports, module) => {
3299
3298
  }));
3300
3299
  //#endregion
3301
3300
  //#region ../../node_modules/.pnpm/semver@7.8.1/node_modules/semver/classes/semver.js
3302
- var require_semver$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
3301
+ var require_semver$1 = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
3303
3302
  const debug = require_debug();
3304
3303
  const { MAX_LENGTH, MAX_SAFE_INTEGER } = require_constants();
3305
3304
  const { safeRe: re, t } = require_re();
@@ -3478,7 +3477,7 @@ var require_semver$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
3478
3477
  }));
3479
3478
  //#endregion
3480
3479
  //#region ../../node_modules/.pnpm/semver@7.8.1/node_modules/semver/functions/parse.js
3481
- var require_parse = /* @__PURE__ */ __commonJSMin(((exports, module) => {
3480
+ var require_parse = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
3482
3481
  const SemVer = require_semver$1();
3483
3482
  const parse = (version, options, throwErrors = false) => {
3484
3483
  if (version instanceof SemVer) return version;
@@ -3493,7 +3492,7 @@ var require_parse = /* @__PURE__ */ __commonJSMin(((exports, module) => {
3493
3492
  }));
3494
3493
  //#endregion
3495
3494
  //#region ../../node_modules/.pnpm/semver@7.8.1/node_modules/semver/functions/valid.js
3496
- var require_valid$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
3495
+ var require_valid$1 = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
3497
3496
  const parse = require_parse();
3498
3497
  const valid = (version, options) => {
3499
3498
  const v = parse(version, options);
@@ -3503,7 +3502,7 @@ var require_valid$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
3503
3502
  }));
3504
3503
  //#endregion
3505
3504
  //#region ../../node_modules/.pnpm/semver@7.8.1/node_modules/semver/functions/clean.js
3506
- var require_clean = /* @__PURE__ */ __commonJSMin(((exports, module) => {
3505
+ var require_clean = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
3507
3506
  const parse = require_parse();
3508
3507
  const clean = (version, options) => {
3509
3508
  const s = parse(version.trim().replace(/^[=v]+/, ""), options);
@@ -3513,7 +3512,7 @@ var require_clean = /* @__PURE__ */ __commonJSMin(((exports, module) => {
3513
3512
  }));
3514
3513
  //#endregion
3515
3514
  //#region ../../node_modules/.pnpm/semver@7.8.1/node_modules/semver/functions/inc.js
3516
- var require_inc = /* @__PURE__ */ __commonJSMin(((exports, module) => {
3515
+ var require_inc = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
3517
3516
  const SemVer = require_semver$1();
3518
3517
  const inc = (version, release, options, identifier, identifierBase) => {
3519
3518
  if (typeof options === "string") {
@@ -3531,7 +3530,7 @@ var require_inc = /* @__PURE__ */ __commonJSMin(((exports, module) => {
3531
3530
  }));
3532
3531
  //#endregion
3533
3532
  //#region ../../node_modules/.pnpm/semver@7.8.1/node_modules/semver/functions/diff.js
3534
- var require_diff = /* @__PURE__ */ __commonJSMin(((exports, module) => {
3533
+ var require_diff = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
3535
3534
  const parse = require_parse();
3536
3535
  const diff = (version1, version2) => {
3537
3536
  const v1 = parse(version1, null, true);
@@ -3559,28 +3558,28 @@ var require_diff = /* @__PURE__ */ __commonJSMin(((exports, module) => {
3559
3558
  }));
3560
3559
  //#endregion
3561
3560
  //#region ../../node_modules/.pnpm/semver@7.8.1/node_modules/semver/functions/major.js
3562
- var require_major = /* @__PURE__ */ __commonJSMin(((exports, module) => {
3561
+ var require_major = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
3563
3562
  const SemVer = require_semver$1();
3564
3563
  const major = (a, loose) => new SemVer(a, loose).major;
3565
3564
  module.exports = major;
3566
3565
  }));
3567
3566
  //#endregion
3568
3567
  //#region ../../node_modules/.pnpm/semver@7.8.1/node_modules/semver/functions/minor.js
3569
- var require_minor = /* @__PURE__ */ __commonJSMin(((exports, module) => {
3568
+ var require_minor = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
3570
3569
  const SemVer = require_semver$1();
3571
3570
  const minor = (a, loose) => new SemVer(a, loose).minor;
3572
3571
  module.exports = minor;
3573
3572
  }));
3574
3573
  //#endregion
3575
3574
  //#region ../../node_modules/.pnpm/semver@7.8.1/node_modules/semver/functions/patch.js
3576
- var require_patch = /* @__PURE__ */ __commonJSMin(((exports, module) => {
3575
+ var require_patch = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
3577
3576
  const SemVer = require_semver$1();
3578
3577
  const patch = (a, loose) => new SemVer(a, loose).patch;
3579
3578
  module.exports = patch;
3580
3579
  }));
3581
3580
  //#endregion
3582
3581
  //#region ../../node_modules/.pnpm/semver@7.8.1/node_modules/semver/functions/prerelease.js
3583
- var require_prerelease = /* @__PURE__ */ __commonJSMin(((exports, module) => {
3582
+ var require_prerelease = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
3584
3583
  const parse = require_parse();
3585
3584
  const prerelease = (version, options) => {
3586
3585
  const parsed = parse(version, options);
@@ -3590,28 +3589,28 @@ var require_prerelease = /* @__PURE__ */ __commonJSMin(((exports, module) => {
3590
3589
  }));
3591
3590
  //#endregion
3592
3591
  //#region ../../node_modules/.pnpm/semver@7.8.1/node_modules/semver/functions/compare.js
3593
- var require_compare = /* @__PURE__ */ __commonJSMin(((exports, module) => {
3592
+ var require_compare = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
3594
3593
  const SemVer = require_semver$1();
3595
3594
  const compare = (a, b, loose) => new SemVer(a, loose).compare(new SemVer(b, loose));
3596
3595
  module.exports = compare;
3597
3596
  }));
3598
3597
  //#endregion
3599
3598
  //#region ../../node_modules/.pnpm/semver@7.8.1/node_modules/semver/functions/rcompare.js
3600
- var require_rcompare = /* @__PURE__ */ __commonJSMin(((exports, module) => {
3599
+ var require_rcompare = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
3601
3600
  const compare = require_compare();
3602
3601
  const rcompare = (a, b, loose) => compare(b, a, loose);
3603
3602
  module.exports = rcompare;
3604
3603
  }));
3605
3604
  //#endregion
3606
3605
  //#region ../../node_modules/.pnpm/semver@7.8.1/node_modules/semver/functions/compare-loose.js
3607
- var require_compare_loose = /* @__PURE__ */ __commonJSMin(((exports, module) => {
3606
+ var require_compare_loose = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
3608
3607
  const compare = require_compare();
3609
3608
  const compareLoose = (a, b) => compare(a, b, true);
3610
3609
  module.exports = compareLoose;
3611
3610
  }));
3612
3611
  //#endregion
3613
3612
  //#region ../../node_modules/.pnpm/semver@7.8.1/node_modules/semver/functions/compare-build.js
3614
- var require_compare_build = /* @__PURE__ */ __commonJSMin(((exports, module) => {
3613
+ var require_compare_build = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
3615
3614
  const SemVer = require_semver$1();
3616
3615
  const compareBuild = (a, b, loose) => {
3617
3616
  const versionA = new SemVer(a, loose);
@@ -3622,63 +3621,63 @@ var require_compare_build = /* @__PURE__ */ __commonJSMin(((exports, module) =>
3622
3621
  }));
3623
3622
  //#endregion
3624
3623
  //#region ../../node_modules/.pnpm/semver@7.8.1/node_modules/semver/functions/sort.js
3625
- var require_sort = /* @__PURE__ */ __commonJSMin(((exports, module) => {
3624
+ var require_sort = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
3626
3625
  const compareBuild = require_compare_build();
3627
3626
  const sort = (list, loose) => list.sort((a, b) => compareBuild(a, b, loose));
3628
3627
  module.exports = sort;
3629
3628
  }));
3630
3629
  //#endregion
3631
3630
  //#region ../../node_modules/.pnpm/semver@7.8.1/node_modules/semver/functions/rsort.js
3632
- var require_rsort = /* @__PURE__ */ __commonJSMin(((exports, module) => {
3631
+ var require_rsort = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
3633
3632
  const compareBuild = require_compare_build();
3634
3633
  const rsort = (list, loose) => list.sort((a, b) => compareBuild(b, a, loose));
3635
3634
  module.exports = rsort;
3636
3635
  }));
3637
3636
  //#endregion
3638
3637
  //#region ../../node_modules/.pnpm/semver@7.8.1/node_modules/semver/functions/gt.js
3639
- var require_gt = /* @__PURE__ */ __commonJSMin(((exports, module) => {
3638
+ var require_gt = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
3640
3639
  const compare = require_compare();
3641
3640
  const gt = (a, b, loose) => compare(a, b, loose) > 0;
3642
3641
  module.exports = gt;
3643
3642
  }));
3644
3643
  //#endregion
3645
3644
  //#region ../../node_modules/.pnpm/semver@7.8.1/node_modules/semver/functions/lt.js
3646
- var require_lt = /* @__PURE__ */ __commonJSMin(((exports, module) => {
3645
+ var require_lt = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
3647
3646
  const compare = require_compare();
3648
3647
  const lt = (a, b, loose) => compare(a, b, loose) < 0;
3649
3648
  module.exports = lt;
3650
3649
  }));
3651
3650
  //#endregion
3652
3651
  //#region ../../node_modules/.pnpm/semver@7.8.1/node_modules/semver/functions/eq.js
3653
- var require_eq = /* @__PURE__ */ __commonJSMin(((exports, module) => {
3652
+ var require_eq = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
3654
3653
  const compare = require_compare();
3655
3654
  const eq = (a, b, loose) => compare(a, b, loose) === 0;
3656
3655
  module.exports = eq;
3657
3656
  }));
3658
3657
  //#endregion
3659
3658
  //#region ../../node_modules/.pnpm/semver@7.8.1/node_modules/semver/functions/neq.js
3660
- var require_neq = /* @__PURE__ */ __commonJSMin(((exports, module) => {
3659
+ var require_neq = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
3661
3660
  const compare = require_compare();
3662
3661
  const neq = (a, b, loose) => compare(a, b, loose) !== 0;
3663
3662
  module.exports = neq;
3664
3663
  }));
3665
3664
  //#endregion
3666
3665
  //#region ../../node_modules/.pnpm/semver@7.8.1/node_modules/semver/functions/gte.js
3667
- var require_gte = /* @__PURE__ */ __commonJSMin(((exports, module) => {
3666
+ var require_gte = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
3668
3667
  const compare = require_compare();
3669
3668
  const gte = (a, b, loose) => compare(a, b, loose) >= 0;
3670
3669
  module.exports = gte;
3671
3670
  }));
3672
3671
  //#endregion
3673
3672
  //#region ../../node_modules/.pnpm/semver@7.8.1/node_modules/semver/functions/lte.js
3674
- var require_lte = /* @__PURE__ */ __commonJSMin(((exports, module) => {
3673
+ var require_lte = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
3675
3674
  const compare = require_compare();
3676
3675
  const lte = (a, b, loose) => compare(a, b, loose) <= 0;
3677
3676
  module.exports = lte;
3678
3677
  }));
3679
3678
  //#endregion
3680
3679
  //#region ../../node_modules/.pnpm/semver@7.8.1/node_modules/semver/functions/cmp.js
3681
- var require_cmp = /* @__PURE__ */ __commonJSMin(((exports, module) => {
3680
+ var require_cmp = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
3682
3681
  const eq = require_eq();
3683
3682
  const neq = require_neq();
3684
3683
  const gt = require_gt();
@@ -3710,7 +3709,7 @@ var require_cmp = /* @__PURE__ */ __commonJSMin(((exports, module) => {
3710
3709
  }));
3711
3710
  //#endregion
3712
3711
  //#region ../../node_modules/.pnpm/semver@7.8.1/node_modules/semver/functions/coerce.js
3713
- var require_coerce = /* @__PURE__ */ __commonJSMin(((exports, module) => {
3712
+ var require_coerce = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
3714
3713
  const SemVer = require_semver$1();
3715
3714
  const parse = require_parse();
3716
3715
  const { safeRe: re, t } = require_re();
@@ -3742,7 +3741,7 @@ var require_coerce = /* @__PURE__ */ __commonJSMin(((exports, module) => {
3742
3741
  }));
3743
3742
  //#endregion
3744
3743
  //#region ../../node_modules/.pnpm/semver@7.8.1/node_modules/semver/functions/truncate.js
3745
- var require_truncate = /* @__PURE__ */ __commonJSMin(((exports, module) => {
3744
+ var require_truncate = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
3746
3745
  const parse = require_parse();
3747
3746
  const constants = require_constants();
3748
3747
  const SemVer = require_semver$1();
@@ -3774,7 +3773,7 @@ var require_truncate = /* @__PURE__ */ __commonJSMin(((exports, module) => {
3774
3773
  }));
3775
3774
  //#endregion
3776
3775
  //#region ../../node_modules/.pnpm/semver@7.8.1/node_modules/semver/internal/lrucache.js
3777
- var require_lrucache = /* @__PURE__ */ __commonJSMin(((exports, module) => {
3776
+ var require_lrucache = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
3778
3777
  var LRUCache = class {
3779
3778
  constructor() {
3780
3779
  this.max = 1e3;
@@ -3807,7 +3806,7 @@ var require_lrucache = /* @__PURE__ */ __commonJSMin(((exports, module) => {
3807
3806
  }));
3808
3807
  //#endregion
3809
3808
  //#region ../../node_modules/.pnpm/semver@7.8.1/node_modules/semver/classes/range.js
3810
- var require_range = /* @__PURE__ */ __commonJSMin(((exports, module) => {
3809
+ var require_range = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
3811
3810
  const SPACE_CHARACTERS = /\s+/g;
3812
3811
  module.exports = class Range {
3813
3812
  constructor(range, options) {
@@ -4087,7 +4086,7 @@ var require_range = /* @__PURE__ */ __commonJSMin(((exports, module) => {
4087
4086
  }));
4088
4087
  //#endregion
4089
4088
  //#region ../../node_modules/.pnpm/semver@7.8.1/node_modules/semver/classes/comparator.js
4090
- var require_comparator = /* @__PURE__ */ __commonJSMin(((exports, module) => {
4089
+ var require_comparator = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
4091
4090
  const ANY = Symbol("SemVer ANY");
4092
4091
  module.exports = class Comparator {
4093
4092
  static get ANY() {
@@ -4159,7 +4158,7 @@ var require_comparator = /* @__PURE__ */ __commonJSMin(((exports, module) => {
4159
4158
  }));
4160
4159
  //#endregion
4161
4160
  //#region ../../node_modules/.pnpm/semver@7.8.1/node_modules/semver/functions/satisfies.js
4162
- var require_satisfies = /* @__PURE__ */ __commonJSMin(((exports, module) => {
4161
+ var require_satisfies = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
4163
4162
  const Range = require_range();
4164
4163
  const satisfies = (version, range, options) => {
4165
4164
  try {
@@ -4173,14 +4172,14 @@ var require_satisfies = /* @__PURE__ */ __commonJSMin(((exports, module) => {
4173
4172
  }));
4174
4173
  //#endregion
4175
4174
  //#region ../../node_modules/.pnpm/semver@7.8.1/node_modules/semver/ranges/to-comparators.js
4176
- var require_to_comparators = /* @__PURE__ */ __commonJSMin(((exports, module) => {
4175
+ var require_to_comparators = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
4177
4176
  const Range = require_range();
4178
4177
  const toComparators = (range, options) => new Range(range, options).set.map((comp) => comp.map((c) => c.value).join(" ").trim().split(" "));
4179
4178
  module.exports = toComparators;
4180
4179
  }));
4181
4180
  //#endregion
4182
4181
  //#region ../../node_modules/.pnpm/semver@7.8.1/node_modules/semver/ranges/max-satisfying.js
4183
- var require_max_satisfying = /* @__PURE__ */ __commonJSMin(((exports, module) => {
4182
+ var require_max_satisfying = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
4184
4183
  const SemVer = require_semver$1();
4185
4184
  const Range = require_range();
4186
4185
  const maxSatisfying = (versions, range, options) => {
@@ -4206,7 +4205,7 @@ var require_max_satisfying = /* @__PURE__ */ __commonJSMin(((exports, module) =>
4206
4205
  }));
4207
4206
  //#endregion
4208
4207
  //#region ../../node_modules/.pnpm/semver@7.8.1/node_modules/semver/ranges/min-satisfying.js
4209
- var require_min_satisfying = /* @__PURE__ */ __commonJSMin(((exports, module) => {
4208
+ var require_min_satisfying = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
4210
4209
  const SemVer = require_semver$1();
4211
4210
  const Range = require_range();
4212
4211
  const minSatisfying = (versions, range, options) => {
@@ -4232,7 +4231,7 @@ var require_min_satisfying = /* @__PURE__ */ __commonJSMin(((exports, module) =>
4232
4231
  }));
4233
4232
  //#endregion
4234
4233
  //#region ../../node_modules/.pnpm/semver@7.8.1/node_modules/semver/ranges/min-version.js
4235
- var require_min_version = /* @__PURE__ */ __commonJSMin(((exports, module) => {
4234
+ var require_min_version = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
4236
4235
  const SemVer = require_semver$1();
4237
4236
  const Range = require_range();
4238
4237
  const gt = require_gt();
@@ -4272,7 +4271,7 @@ var require_min_version = /* @__PURE__ */ __commonJSMin(((exports, module) => {
4272
4271
  }));
4273
4272
  //#endregion
4274
4273
  //#region ../../node_modules/.pnpm/semver@7.8.1/node_modules/semver/ranges/valid.js
4275
- var require_valid = /* @__PURE__ */ __commonJSMin(((exports, module) => {
4274
+ var require_valid = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
4276
4275
  const Range = require_range();
4277
4276
  const validRange = (range, options) => {
4278
4277
  try {
@@ -4285,7 +4284,7 @@ var require_valid = /* @__PURE__ */ __commonJSMin(((exports, module) => {
4285
4284
  }));
4286
4285
  //#endregion
4287
4286
  //#region ../../node_modules/.pnpm/semver@7.8.1/node_modules/semver/ranges/outside.js
4288
- var require_outside = /* @__PURE__ */ __commonJSMin(((exports, module) => {
4287
+ var require_outside = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
4289
4288
  const SemVer = require_semver$1();
4290
4289
  const Comparator = require_comparator();
4291
4290
  const { ANY } = Comparator;
@@ -4338,21 +4337,21 @@ var require_outside = /* @__PURE__ */ __commonJSMin(((exports, module) => {
4338
4337
  }));
4339
4338
  //#endregion
4340
4339
  //#region ../../node_modules/.pnpm/semver@7.8.1/node_modules/semver/ranges/gtr.js
4341
- var require_gtr = /* @__PURE__ */ __commonJSMin(((exports, module) => {
4340
+ var require_gtr = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
4342
4341
  const outside = require_outside();
4343
4342
  const gtr = (version, range, options) => outside(version, range, ">", options);
4344
4343
  module.exports = gtr;
4345
4344
  }));
4346
4345
  //#endregion
4347
4346
  //#region ../../node_modules/.pnpm/semver@7.8.1/node_modules/semver/ranges/ltr.js
4348
- var require_ltr = /* @__PURE__ */ __commonJSMin(((exports, module) => {
4347
+ var require_ltr = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
4349
4348
  const outside = require_outside();
4350
4349
  const ltr = (version, range, options) => outside(version, range, "<", options);
4351
4350
  module.exports = ltr;
4352
4351
  }));
4353
4352
  //#endregion
4354
4353
  //#region ../../node_modules/.pnpm/semver@7.8.1/node_modules/semver/ranges/intersects.js
4355
- var require_intersects = /* @__PURE__ */ __commonJSMin(((exports, module) => {
4354
+ var require_intersects = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
4356
4355
  const Range = require_range();
4357
4356
  const intersects = (r1, r2, options) => {
4358
4357
  r1 = new Range(r1, options);
@@ -4363,7 +4362,7 @@ var require_intersects = /* @__PURE__ */ __commonJSMin(((exports, module) => {
4363
4362
  }));
4364
4363
  //#endregion
4365
4364
  //#region ../../node_modules/.pnpm/semver@7.8.1/node_modules/semver/ranges/simplify.js
4366
- var require_simplify = /* @__PURE__ */ __commonJSMin(((exports, module) => {
4365
+ var require_simplify = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
4367
4366
  const satisfies = require_satisfies();
4368
4367
  const compare = require_compare();
4369
4368
  module.exports = (versions, range, options) => {
@@ -4393,7 +4392,7 @@ var require_simplify = /* @__PURE__ */ __commonJSMin(((exports, module) => {
4393
4392
  }));
4394
4393
  //#endregion
4395
4394
  //#region ../../node_modules/.pnpm/semver@7.8.1/node_modules/semver/ranges/subset.js
4396
- var require_subset = /* @__PURE__ */ __commonJSMin(((exports, module) => {
4395
+ var require_subset = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
4397
4396
  const Range = require_range();
4398
4397
  const Comparator = require_comparator();
4399
4398
  const { ANY } = Comparator;
@@ -4492,7 +4491,7 @@ var require_subset = /* @__PURE__ */ __commonJSMin(((exports, module) => {
4492
4491
  }));
4493
4492
  //#endregion
4494
4493
  //#region src/dependencies/dependencies.ts
4495
- var import_semver = /* @__PURE__ */ __toESM((/* @__PURE__ */ __commonJSMin(((exports, module) => {
4494
+ var import_semver = /* @__PURE__ */ __toESM((/* @__PURE__ */ __commonJSMin$1(((exports, module) => {
4496
4495
  const internalRe = require_re();
4497
4496
  const constants = require_constants();
4498
4497
  const SemVer = require_semver$1();
@@ -6098,7 +6097,7 @@ function schemaRuleViolations(manifest, warnings) {
6098
6097
  const INLINE_LINK = /!?\[[^\]\n]*\]\(\s*<?([^)\s>]+)>?(?:\s+["'(][^)]*)?\)/g;
6099
6098
  /** Reference definitions, `[label]: target`. */
6100
6099
  const REFERENCE_DEFINITION = /^\s{0,3}\[[^\]\n]+\]:\s*<?(\S+?)>?(?:\s|$)/;
6101
- const FENCE = /^\s{0,3}(`{3,}|~{3,})/;
6100
+ const FENCE$1 = /^\s{0,3}(`{3,}|~{3,})/;
6102
6101
  /** The relative links in `content` whose target resolves outside the skill folder. `fileInSkill` is
6103
6102
  * the file's path relative to the skill folder, `/`-separated (`SKILL.md`, `references/a.md`).
6104
6103
  * Fenced code is skipped: a link there is an example, not one the agent follows. */
@@ -6109,7 +6108,7 @@ function escapingLinks(content, fileInSkill) {
6109
6108
  const lines = content.split(/\r?\n/);
6110
6109
  for (let i = 0; i < lines.length; i++) {
6111
6110
  const line = lines[i] ?? "";
6112
- const marker = line.match(FENCE)?.[1];
6111
+ const marker = line.match(FENCE$1)?.[1];
6113
6112
  if (marker !== void 0) {
6114
6113
  if (fence === null) fence = marker[0];
6115
6114
  else if (marker[0] === fence) fence = null;
@@ -6141,6 +6140,38 @@ function leavesSkill(fileDir, target) {
6141
6140
  return false;
6142
6141
  }
6143
6142
  //#endregion
6143
+ //#region src/build/skill-references.ts
6144
+ /** The folder name pnpm gives a skill: `pnpm-<package>-<skill>`, with `/` in the package as `+`. */
6145
+ function pnpmSkillName(packageName, skill) {
6146
+ return `pnpm-${packageName.replace(/\//g, "+")}-${skill}`;
6147
+ }
6148
+ const FENCE = /^\s{0,3}(`{3,}|~{3,})/;
6149
+ /** `/plugin:skill`, bare or alone in an inline code span. A span that holds more (`/p:s --flag`) is a
6150
+ * command example and stays as written. */
6151
+ const REFERENCE = /(`?)(?<![\w/.:@-])\/([a-z0-9][a-z0-9-]*):([a-z0-9][a-z0-9-]*)(?![\w:/-])(`?)/g;
6152
+ const ALREADY = " (pnpm install: `";
6153
+ /** `content` with the pnpm name added after each reference this package can resolve:
6154
+ * `/<plugin>:<skill>` (pnpm install: `pnpm-<package>-<skill>`). A reference that already carries
6155
+ * it, one to another plugin or an unknown skill, and anything inside fenced code is left alone, so
6156
+ * a rebuild changes nothing. Fences are skipped whole: the added text would break a command. */
6157
+ function addPnpmNames(content, target) {
6158
+ let fence = null;
6159
+ return content.split(/(\r?\n)/).map((line) => {
6160
+ const marker = line.match(FENCE)?.[1];
6161
+ if (marker !== void 0) {
6162
+ if (fence === null) fence = marker[0];
6163
+ else if (marker[0] === fence) fence = null;
6164
+ return line;
6165
+ }
6166
+ if (fence !== null) return line;
6167
+ return line.replace(REFERENCE, (match, open, plugin, skill, close, offset) => {
6168
+ if (open !== close || plugin !== target.plugin || !target.skills.has(skill)) return match;
6169
+ if (line.startsWith(ALREADY, offset + match.length)) return match;
6170
+ return `${open === "" ? `\`/${plugin}:${skill}\`` : match}${ALREADY}${pnpmSkillName(target.packageName, skill)}\`)`;
6171
+ });
6172
+ }).join("");
6173
+ }
6174
+ //#endregion
6144
6175
  //#region src/build/build.ts
6145
6176
  /** Where each vendor reads its manifest, relative to the project root. Shared with
6146
6177
  * `plugin init --npm`, which wires exactly these paths into `package.json` `files`. */
@@ -6338,6 +6369,7 @@ function buildPlugin(root, opts = {}) {
6338
6369
  warnings.push(...validateDependencies(declaredDependencies).warnings);
6339
6370
  const skills = readSkills(root, manifest, warnings);
6340
6371
  warnings.push(...skillLinkWarnings(root, skills));
6372
+ writePnpmNames(root, manifest, skills, opts, written);
6341
6373
  const canonicalHooks = readCanonicalHooks(root, componentConfig["hooks"], warnings);
6342
6374
  const declaredMcp = readCanonicalMcpServers(root, componentConfig["mcpServers"], warnings);
6343
6375
  const mcp = declaredMcp ? stripPinMarkers(declaredMcp.servers) : null;
@@ -6577,6 +6609,35 @@ function skillLinkWarnings(root, skills) {
6577
6609
  }
6578
6610
  return warnings;
6579
6611
  }
6612
+ /** Adds the pnpm name beside each `/<plugin>:<skill>` reference to a skill this package ships, in every
6613
+ * Markdown file under a skill. The name comes from the package's own `package.json`; with none, the
6614
+ * references stay as written. A reference to another plugin cannot be resolved here, and is left
6615
+ * without a warning because it is usually a legitimate one. */
6616
+ function writePnpmNames(root, manifest, skills, opts, written) {
6617
+ const packageName = readPackageName(root);
6618
+ if (!packageName || typeof manifest.name !== "string") return;
6619
+ const target = {
6620
+ plugin: manifest.name,
6621
+ packageName,
6622
+ skills: new Set(skills.map((s) => s.name))
6623
+ };
6624
+ for (const skill of skills) for (const file of listFilesRecursive(path$1.dirname(skill.path)).filter((f) => f.endsWith(".md"))) {
6625
+ const before = fs$1.readFileSync(file, "utf8");
6626
+ const after = addPnpmNames(before, target);
6627
+ if (after === before) continue;
6628
+ if (!opts.dryRun) fs$1.writeFileSync(file, after);
6629
+ written.push(file);
6630
+ if (file === skill.path) skill.content = after;
6631
+ }
6632
+ }
6633
+ function readPackageName(root) {
6634
+ try {
6635
+ const name = JSON.parse(fs$1.readFileSync(path$1.join(root, "package.json"), "utf8")).name;
6636
+ return typeof name === "string" && name !== "" ? name : void 0;
6637
+ } catch {
6638
+ return;
6639
+ }
6640
+ }
6580
6641
  function listSkillFiles(dir) {
6581
6642
  return fs$1.readdirSync(dir, { withFileTypes: true }).flatMap((entry) => {
6582
6643
  const entryPath = path$1.join(dir, entry.name);
@@ -7099,7 +7160,116 @@ function summarize(rows) {
7099
7160
  };
7100
7161
  }
7101
7162
  //#endregion
7163
+ //#region src/compile/main-guard.ts
7164
+ /** A script's main guard runs its CLI only when the script is the process's main module. Once a
7165
+ * compile inlines one script into another, every inlined module shares the output file's
7166
+ * `import.meta.url`, so every inlined guard would pass and every inlined CLI would run (issue #192).
7167
+ * The compile keeps the entry's guard and turns the others to `false`.
7168
+ *
7169
+ * Recognized forms:
7170
+ * - `import.meta.main`
7171
+ * - `import.meta.url === pathToFileURL(…).href`, either side, `==` or `===`
7172
+ * - `fileURLToPath(import.meta.url) === …` or `… === fileURLToPath(import.meta.url)` where `…` is
7173
+ * `process.argv[1]` or a call around it, such as `realpathSync(process.argv[1])` */
7174
+ const ARGS = String.raw`\((?:[^()]|\((?:[^()]|\([^()]*\))*\))*\)`;
7175
+ const META_URL = String.raw`import\.meta\.url`;
7176
+ const EQ = String.raw`\s*===?\s*`;
7177
+ const TO_FILE_URL = String.raw`(?:\w+\.)?pathToFileURL${ARGS}\.href`;
7178
+ const FROM_META_URL = String.raw`(?:\w+\.)?fileURLToPath\(\s*${META_URL}\s*\)`;
7179
+ const ARGV = String.raw`process\.argv\[1\]`;
7180
+ const CALL = String.raw`[\w.]+\(\s*`;
7181
+ const ARGV1 = String.raw`(?:${CALL}${CALL}${ARGV}\s*\)\s*\)|${CALL}${ARGV}\s*\)|${ARGV})`;
7182
+ const GUARDS = new RegExp([
7183
+ `${META_URL}${EQ}${TO_FILE_URL}`,
7184
+ `${TO_FILE_URL}${EQ}${META_URL}`,
7185
+ `${FROM_META_URL}${EQ}${ARGV1}`,
7186
+ `${ARGV1}${EQ}${FROM_META_URL}`,
7187
+ String.raw`import\.meta\.main\b`
7188
+ ].join("|"), "g");
7189
+ /** The code with every recognized main guard replaced by `false`, or `undefined` when it has none. */
7190
+ function neutralizeMainGuards(code) {
7191
+ const out = code.replace(GUARDS, "false");
7192
+ return out === code ? void 0 : out;
7193
+ }
7194
+ //#endregion
7195
+ //#region src/compile/tsconfig-diagnosis.ts
7196
+ const failedTsconfig = /Failed to load tsconfig '([^']+)'/;
7197
+ /** The `extends` specifier rolldown could not load, or undefined when the error is not a tsconfig
7198
+ * failure. */
7199
+ function failedExtends(error) {
7200
+ return failedTsconfig.exec(error instanceof Error ? error.message : String(error))?.[1];
7201
+ }
7202
+ function readTsconfig(file) {
7203
+ try {
7204
+ const text = fs$1.readFileSync(file, "utf8").replace(/("(?:[^"\\]|\\.)*")|\/\/[^\n]*|\/\*[\s\S]*?\*\//g, (_m, str) => str ?? "").replace(/,(\s*[}\]])/g, "$1");
7205
+ return JSON.parse(text);
7206
+ } catch {
7207
+ return;
7208
+ }
7209
+ }
7210
+ function referenceFile(from, ref) {
7211
+ const target = path$1.resolve(path$1.dirname(from), ref);
7212
+ return target.endsWith(".json") ? target : path$1.join(target, "tsconfig.json");
7213
+ }
7214
+ function localExtends(from, spec) {
7215
+ for (const candidate of [spec, `${spec}.json`]) {
7216
+ const file = path$1.resolve(path$1.dirname(from), candidate);
7217
+ if (fs$1.existsSync(file) && fs$1.statSync(file).isFile()) return file;
7218
+ }
7219
+ }
7220
+ /** Finds the tsconfig file that declares `spec` in `extends`, walking the tsconfig the entry falls
7221
+ * under: its `extends` chain and its project `references`. */
7222
+ function findExtendsOwner(entry, spec) {
7223
+ let dir = path$1.dirname(entry);
7224
+ let start;
7225
+ for (;;) {
7226
+ const candidate = path$1.join(dir, "tsconfig.json");
7227
+ if (fs$1.existsSync(candidate)) {
7228
+ start = candidate;
7229
+ break;
7230
+ }
7231
+ const parent = path$1.dirname(dir);
7232
+ if (parent === dir) return void 0;
7233
+ dir = parent;
7234
+ }
7235
+ const seen = /* @__PURE__ */ new Set();
7236
+ const visit = (file) => {
7237
+ if (seen.has(file)) return void 0;
7238
+ seen.add(file);
7239
+ const config = readTsconfig(file);
7240
+ if (!config) return void 0;
7241
+ const extended = [config.extends ?? []].flat();
7242
+ if (extended.includes(spec)) return file;
7243
+ for (const e of extended) {
7244
+ const next = e.startsWith(".") ? localExtends(file, e) : void 0;
7245
+ const found = next && visit(next);
7246
+ if (found) return found;
7247
+ }
7248
+ for (const ref of config.references ?? []) {
7249
+ const found = visit(referenceFile(file, ref.path));
7250
+ if (found) return found;
7251
+ }
7252
+ };
7253
+ return visit(start);
7254
+ }
7255
+ /** Explains a tsconfig failure: names the file and the `extends` path, and the usual fix. */
7256
+ function explainTsconfigFailure(entry, root, spec) {
7257
+ const owner = findExtendsOwner(entry, spec);
7258
+ return `${owner ? `${path$1.relative(root, owner) || path$1.basename(owner)} extends` : "a tsconfig extends"} "${spec}", which rolldown could not load.${spec.endsWith(".json") ? "" : " Add the `.json` extension to it: rolldown, unlike tsc, does not resolve an `extends` without one."}`;
7259
+ }
7260
+ //#endregion
7102
7261
  //#region src/compile/rolldown.ts
7262
+ /** Keeps only the entry's main guard, so an entry that imports another script runs one CLI. */
7263
+ function onlyEntryMain() {
7264
+ return {
7265
+ name: "universal-plugin:only-entry-main",
7266
+ transform(code, id) {
7267
+ if (this.getModuleInfo(id)?.isEntry) return null;
7268
+ const out = neutralizeMainGuards(code);
7269
+ return out === void 0 ? null : { code: out };
7270
+ }
7271
+ };
7272
+ }
7103
7273
  /** Compiles an entry with rolldown, the engine under tsdown. Node built-ins stay imports; everything
7104
7274
  * else is inlined, so the file runs from a skill folder with no `node_modules` beside it.
7105
7275
  *
@@ -7113,6 +7283,7 @@ const rolldownCompiler = { async compile(sourcePath, root) {
7113
7283
  input: sourcePath,
7114
7284
  cwd: root,
7115
7285
  platform: "node",
7286
+ plugins: [onlyEntryMain()],
7116
7287
  onLog(_level, log) {
7117
7288
  if (log.code === "UNRESOLVED_IMPORT") unresolved.push(log.message);
7118
7289
  }
@@ -7132,6 +7303,9 @@ const rolldownCompiler = { async compile(sourcePath, root) {
7132
7303
  codeSplitting: false,
7133
7304
  minify: true
7134
7305
  })).output[0].code;
7306
+ } catch (error) {
7307
+ const spec = failedExtends(error);
7308
+ throw spec ? new Error(explainTsconfigFailure(sourcePath, root, spec), { cause: error }) : error;
7135
7309
  } finally {
7136
7310
  await bundle.close();
7137
7311
  }
@@ -8920,151 +9094,416 @@ function initCommand$1(deps = { fs: realInitFs }) {
8920
9094
  return cmd;
8921
9095
  }
8922
9096
  //#endregion
8923
- //#region ../../node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/nodes/identity.js
8924
- var require_identity = /* @__PURE__ */ __commonJSMin(((exports) => {
8925
- const ALIAS = Symbol.for("yaml.alias");
8926
- const DOC = Symbol.for("yaml.document");
8927
- const MAP = Symbol.for("yaml.map");
8928
- const PAIR = Symbol.for("yaml.pair");
8929
- const SCALAR = Symbol.for("yaml.scalar");
8930
- const SEQ = Symbol.for("yaml.seq");
8931
- const NODE_TYPE = Symbol.for("yaml.node.type");
8932
- const isAlias = (node) => !!node && typeof node === "object" && node[NODE_TYPE] === ALIAS;
8933
- const isDocument = (node) => !!node && typeof node === "object" && node[NODE_TYPE] === DOC;
8934
- const isMap = (node) => !!node && typeof node === "object" && node[NODE_TYPE] === MAP;
8935
- const isPair = (node) => !!node && typeof node === "object" && node[NODE_TYPE] === PAIR;
8936
- const isScalar = (node) => !!node && typeof node === "object" && node[NODE_TYPE] === SCALAR;
8937
- const isSeq = (node) => !!node && typeof node === "object" && node[NODE_TYPE] === SEQ;
8938
- function isCollection(node) {
8939
- if (node && typeof node === "object") switch (node[NODE_TYPE]) {
8940
- case MAP:
8941
- case SEQ: return true;
8942
- }
8943
- return false;
8944
- }
8945
- function isNode(node) {
8946
- if (node && typeof node === "object") switch (node[NODE_TYPE]) {
8947
- case ALIAS:
8948
- case MAP:
8949
- case SCALAR:
8950
- case SEQ: return true;
8951
- }
8952
- return false;
8953
- }
8954
- const hasAnchor = (node) => (isScalar(node) || isCollection(node)) && !!node.anchor;
8955
- exports.ALIAS = ALIAS;
8956
- exports.DOC = DOC;
8957
- exports.MAP = MAP;
8958
- exports.NODE_TYPE = NODE_TYPE;
8959
- exports.PAIR = PAIR;
8960
- exports.SCALAR = SCALAR;
8961
- exports.SEQ = SEQ;
8962
- exports.hasAnchor = hasAnchor;
8963
- exports.isAlias = isAlias;
8964
- exports.isCollection = isCollection;
8965
- exports.isDocument = isDocument;
8966
- exports.isMap = isMap;
8967
- exports.isNode = isNode;
8968
- exports.isPair = isPair;
8969
- exports.isScalar = isScalar;
8970
- exports.isSeq = isSeq;
8971
- }));
8972
- //#endregion
8973
- //#region ../../node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/visit.js
8974
- var require_visit = /* @__PURE__ */ __commonJSMin(((exports) => {
8975
- var identity = require_identity();
8976
- const BREAK = Symbol("break visit");
8977
- const SKIP = Symbol("skip children");
8978
- const REMOVE = Symbol("remove node");
8979
- /**
8980
- * Apply a visitor to an AST node or document.
8981
- *
8982
- * Walks through the tree (depth-first) starting from `node`, calling a
8983
- * `visitor` function with three arguments:
8984
- * - `key`: For sequence values and map `Pair`, the node's index in the
8985
- * collection. Within a `Pair`, `'key'` or `'value'`, correspondingly.
8986
- * `null` for the root node.
8987
- * - `node`: The current node.
8988
- * - `path`: The ancestry of the current node.
8989
- *
8990
- * The return value of the visitor may be used to control the traversal:
8991
- * - `undefined` (default): Do nothing and continue
8992
- * - `visit.SKIP`: Do not visit the children of this node, continue with next
8993
- * sibling
8994
- * - `visit.BREAK`: Terminate traversal completely
8995
- * - `visit.REMOVE`: Remove the current node, then continue with the next one
8996
- * - `Node`: Replace the current node, then continue by visiting it
8997
- * - `number`: While iterating the items of a sequence or map, set the index
8998
- * of the next step. This is useful especially if the index of the current
8999
- * node has changed.
9000
- *
9001
- * If `visitor` is a single function, it will be called with all values
9002
- * encountered in the tree, including e.g. `null` values. Alternatively,
9003
- * separate visitor functions may be defined for each `Map`, `Pair`, `Seq`,
9004
- * `Alias` and `Scalar` node. To define the same visitor function for more than
9005
- * one node type, use the `Collection` (map and seq), `Value` (map, seq & scalar)
9006
- * and `Node` (alias, map, seq & scalar) targets. Of all these, only the most
9007
- * specific defined one will be used for each node.
9008
- */
9009
- function visit(node, visitor) {
9010
- const visitor_ = initVisitor(visitor);
9011
- if (identity.isDocument(node)) {
9012
- if (visit_(null, node.contents, visitor_, Object.freeze([node])) === REMOVE) node.contents = null;
9013
- } else visit_(null, node, visitor_, Object.freeze([]));
9097
+ //#region ../../node_modules/.pnpm/@cyberuni+agent-harness@0.7.0/node_modules/@cyberuni/agent-harness/dist/reference-where-CIcUR8xX.js
9098
+ var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports);
9099
+ var __require = /* #__PURE__ */ (() => createRequire(import.meta.url))();
9100
+ function resolveHarnessEnvironment(environment = {}) {
9101
+ return {
9102
+ env: environment.env ?? process.env,
9103
+ homedir: environment.homedir ?? homedir(),
9104
+ cwd: environment.cwd ?? process.cwd(),
9105
+ platform: environment.platform ?? process.platform
9106
+ };
9107
+ }
9108
+ /**
9109
+ * Where a harness keeps plugins at the user level. Paths are computed, not checked: a location may
9110
+ * not exist until the first plugin is installed.
9111
+ */
9112
+ function pluginStorage(harness, environment = {}) {
9113
+ return storages[harness](resolveHarnessEnvironment(environment));
9114
+ }
9115
+ /** `$XDG_CONFIG_HOME`, else `~/.config`, as the `xdg-basedir` package resolves it. */
9116
+ const xdgConfig = ({ env, homedir }) => env.XDG_CONFIG_HOME || join(homedir, ".config");
9117
+ /** The agent plugin folder of the stable VS Code build, per OS (E-VSC-P3). */
9118
+ function vscodeAgentPlugins({ env, homedir, platform }) {
9119
+ if (platform === "win32") {
9120
+ const configDir = win32.join(env.APPDATA || win32.join(homedir, "AppData", "Roaming"), "Code");
9121
+ return {
9122
+ configDir,
9123
+ path: win32.join(configDir, "agentPlugins")
9124
+ };
9014
9125
  }
9015
- /** Terminate visit traversal completely */
9016
- visit.BREAK = BREAK;
9017
- /** Do not visit the children of the current node */
9018
- visit.SKIP = SKIP;
9019
- /** Remove the current node */
9020
- visit.REMOVE = REMOVE;
9021
- function visit_(key, node, visitor, path) {
9022
- const ctrl = callVisitor(key, node, visitor, path);
9023
- if (identity.isNode(ctrl) || identity.isPair(ctrl)) {
9024
- replaceNode(key, path, ctrl);
9025
- return visit_(key, ctrl, visitor, path);
9026
- }
9027
- if (typeof ctrl !== "symbol") {
9028
- if (identity.isCollection(node)) {
9029
- path = Object.freeze(path.concat(node));
9030
- for (let i = 0; i < node.items.length; ++i) {
9031
- const ci = visit_(i, node.items[i], visitor, path);
9032
- if (typeof ci === "number") i = ci - 1;
9033
- else if (ci === BREAK) return BREAK;
9034
- else if (ci === REMOVE) {
9035
- node.items.splice(i, 1);
9036
- i -= 1;
9037
- }
9126
+ const configDir = platform === "darwin" ? join(homedir, "Library", "Application Support", "Code") : join(homedir, ".config", "Code");
9127
+ return {
9128
+ configDir,
9129
+ path: join(configDir, "agentPlugins")
9130
+ };
9131
+ }
9132
+ const storages = {
9133
+ "claude-code": ({ env, homedir }) => {
9134
+ const configDir = env.CLAUDE_CONFIG_DIR || join(homedir, ".claude");
9135
+ const plugins = join(configDir, "plugins");
9136
+ return {
9137
+ harness: "claude-code",
9138
+ configDir,
9139
+ locations: [
9140
+ {
9141
+ kind: "plugin-cache",
9142
+ path: join(plugins, "cache"),
9143
+ description: "Installed plugins as <marketplace>/<plugin>/<version>/",
9144
+ research: "E-CC-P1"
9145
+ },
9146
+ {
9147
+ kind: "marketplaces",
9148
+ path: join(plugins, "marketplaces"),
9149
+ description: "Marketplace checkouts",
9150
+ research: "E-CC-P1"
9151
+ },
9152
+ {
9153
+ kind: "install-record",
9154
+ path: join(plugins, "installed_plugins.json"),
9155
+ description: "Installs keyed by plugin@marketplace, each with scope, installPath, and version",
9156
+ research: "E-CC-P2"
9157
+ },
9158
+ {
9159
+ kind: "enabled-record",
9160
+ path: join(configDir, "settings.json"),
9161
+ description: "User settings; enabledPlugins maps plugin@marketplace to a boolean",
9162
+ research: "E-CC-P3"
9038
9163
  }
9039
- } else if (identity.isPair(node)) {
9040
- path = Object.freeze(path.concat(node));
9041
- const ck = visit_("key", node.key, visitor, path);
9042
- if (ck === BREAK) return BREAK;
9043
- else if (ck === REMOVE) node.key = null;
9044
- const cv = visit_("value", node.value, visitor, path);
9045
- if (cv === BREAK) return BREAK;
9046
- else if (cv === REMOVE) node.value = null;
9047
- }
9048
- }
9049
- return ctrl;
9050
- }
9051
- /**
9052
- * Apply an async visitor to an AST node or document.
9053
- *
9054
- * Walks through the tree (depth-first) starting from `node`, calling a
9055
- * `visitor` function with three arguments:
9056
- * - `key`: For sequence values and map `Pair`, the node's index in the
9057
- * collection. Within a `Pair`, `'key'` or `'value'`, correspondingly.
9058
- * `null` for the root node.
9059
- * - `node`: The current node.
9060
- * - `path`: The ancestry of the current node.
9061
- *
9062
- * The return value of the visitor may be used to control the traversal:
9063
- * - `Promise`: Must resolve to one of the following values
9064
- * - `undefined` (default): Do nothing and continue
9065
- * - `visit.SKIP`: Do not visit the children of this node, continue with next
9066
- * sibling
9067
- * - `visit.BREAK`: Terminate traversal completely
9164
+ ]
9165
+ };
9166
+ },
9167
+ cursor: ({ homedir }) => {
9168
+ const configDir = join(homedir, ".cursor");
9169
+ return {
9170
+ harness: "cursor",
9171
+ configDir,
9172
+ locations: [{
9173
+ kind: "local-plugins",
9174
+ path: join(configDir, "plugins", "local"),
9175
+ description: "Plugins under development, one folder each",
9176
+ research: "E-CUR-P2"
9177
+ }, {
9178
+ kind: "marketplaces",
9179
+ path: join(configDir, "plugins", "marketplaces"),
9180
+ description: "Marketplace checkouts",
9181
+ research: "E-CUR-P3"
9182
+ }]
9183
+ };
9184
+ },
9185
+ codex: ({ env, homedir }) => {
9186
+ const configDir = env.CODEX_HOME || join(homedir, ".codex");
9187
+ return {
9188
+ harness: "codex",
9189
+ configDir,
9190
+ locations: [{
9191
+ kind: "plugin-cache",
9192
+ path: join(configDir, "plugins", "cache"),
9193
+ description: "Installed plugins as <marketplace>/<plugin>/<version>/",
9194
+ research: "E-CODEX-P3"
9195
+ }, {
9196
+ kind: "enabled-record",
9197
+ path: join(configDir, "config.toml"),
9198
+ description: "User config; [plugins.\"<plugin>@<marketplace>\"] tables carry enabled = <bool>",
9199
+ research: "E-CODEX-P2"
9200
+ }]
9201
+ };
9202
+ },
9203
+ "copilot-cli": ({ env, homedir }) => {
9204
+ const configDir = env.COPILOT_HOME || join(homedir, ".copilot");
9205
+ return {
9206
+ harness: "copilot-cli",
9207
+ configDir,
9208
+ locations: [
9209
+ {
9210
+ kind: "installed-plugins",
9211
+ path: join(configDir, "installed-plugins"),
9212
+ description: "Installed plugins as <marketplace>/<plugin>/, or _direct/<source-id>/ for direct installs",
9213
+ research: "E-COPILOT-P9"
9214
+ },
9215
+ {
9216
+ kind: "install-record",
9217
+ path: join(configDir, "config.json"),
9218
+ description: "Application state, including installedPlugins",
9219
+ research: "E-COPILOT-P9"
9220
+ },
9221
+ {
9222
+ kind: "enabled-record",
9223
+ path: join(configDir, "settings.json"),
9224
+ description: "User settings (JSON with comments); enabledPlugins maps plugin specs to a boolean",
9225
+ research: "E-COPILOT-P4"
9226
+ }
9227
+ ]
9228
+ };
9229
+ },
9230
+ opencode: (environment) => {
9231
+ const configDir = join(xdgConfig(environment), "opencode");
9232
+ return {
9233
+ harness: "opencode",
9234
+ configDir,
9235
+ locations: [{
9236
+ kind: "local-plugins",
9237
+ path: join(configDir, "plugins"),
9238
+ description: "JS/TS plugin modules loaded at startup; npm plugins are named in the plugin config array",
9239
+ research: "E-OC-P2"
9240
+ }]
9241
+ };
9242
+ },
9243
+ kilo: (environment) => {
9244
+ const configDir = join(xdgConfig(environment), "kilo");
9245
+ return {
9246
+ harness: "kilo",
9247
+ configDir,
9248
+ locations: [{
9249
+ kind: "local-plugins",
9250
+ path: join(configDir, "plugin"),
9251
+ description: "JS/TS plugin modules loaded at startup; npm plugins are named in the plugin config array",
9252
+ research: "E-KILO-P2"
9253
+ }]
9254
+ };
9255
+ },
9256
+ "gemini-cli": ({ env, homedir }) => {
9257
+ const configDir = join(env.GEMINI_CLI_HOME || homedir, ".gemini");
9258
+ const extensions = join(configDir, "extensions");
9259
+ return {
9260
+ harness: "gemini-cli",
9261
+ configDir,
9262
+ locations: [{
9263
+ kind: "installed-plugins",
9264
+ path: extensions,
9265
+ description: "Installed extensions, one folder each with a gemini-extension.json manifest",
9266
+ research: "E-GEM-P1"
9267
+ }, {
9268
+ kind: "enabled-record",
9269
+ path: join(extensions, "extension-enablement.json"),
9270
+ description: "Per-extension path-glob overrides that enable or disable it by folder, not a boolean",
9271
+ research: "E-GEM-P3"
9272
+ }]
9273
+ };
9274
+ },
9275
+ "qwen-code": ({ env, homedir }) => {
9276
+ const configDir = env.QWEN_HOME || join(homedir, ".qwen");
9277
+ const extensions = join(configDir, "extensions");
9278
+ return {
9279
+ harness: "qwen-code",
9280
+ configDir,
9281
+ locations: [{
9282
+ kind: "installed-plugins",
9283
+ path: extensions,
9284
+ description: "Installed extensions, one folder each with a qwen-extension.json manifest",
9285
+ research: "E-QWEN-P1"
9286
+ }, {
9287
+ kind: "enabled-record",
9288
+ path: join(extensions, "extension-enablement.json"),
9289
+ description: "Extension enable/disable state, inherited from Gemini CLI's format",
9290
+ research: "E-QWEN-P2"
9291
+ }]
9292
+ };
9293
+ },
9294
+ "vscode-copilot": (environment) => {
9295
+ const { configDir, path } = vscodeAgentPlugins(environment);
9296
+ return {
9297
+ harness: "vscode-copilot",
9298
+ configDir,
9299
+ locations: [{
9300
+ kind: "installed-plugins",
9301
+ path,
9302
+ description: "Installed agent plugins as <host>/<org>/<repo>/",
9303
+ research: "E-VSC-P3"
9304
+ }]
9305
+ };
9306
+ },
9307
+ cline: ({ homedir }) => {
9308
+ const configDir = join(homedir, ".cline");
9309
+ return {
9310
+ harness: "cline",
9311
+ configDir,
9312
+ locations: [{
9313
+ kind: "installed-plugins",
9314
+ path: join(configDir, "plugins", "_installed"),
9315
+ description: "Installed plugins, grouped by source: npm, git, remote, or local",
9316
+ research: "E-CLINE-P3"
9317
+ }]
9318
+ };
9319
+ },
9320
+ crush: ({ env, homedir }) => {
9321
+ return {
9322
+ harness: "crush",
9323
+ configDir: env.CRUSH_GLOBAL_CONFIG || join(env.XDG_CONFIG_HOME || join(homedir, ".config"), "crush"),
9324
+ locations: []
9325
+ };
9326
+ },
9327
+ openhands: ({ env, homedir }) => {
9328
+ const configDir = env.OH_PERSISTENCE_DIR || env.OPENHANDS_PERSISTENCE_DIR || join(homedir, ".openhands");
9329
+ const installed = join(configDir, "plugins", "installed");
9330
+ return {
9331
+ harness: "openhands",
9332
+ configDir,
9333
+ locations: [{
9334
+ kind: "installed-plugins",
9335
+ path: installed,
9336
+ description: "Installed plugins, one folder each",
9337
+ research: "E-OH-P3"
9338
+ }, {
9339
+ kind: "enabled-record",
9340
+ path: join(installed, ".installed.json"),
9341
+ description: "Install metadata keyed by plugin name, each with enabled: <bool>",
9342
+ research: "E-OH-P4"
9343
+ }]
9344
+ };
9345
+ },
9346
+ augment: ({ homedir }) => {
9347
+ const configDir = join(homedir, ".augment");
9348
+ return {
9349
+ harness: "augment",
9350
+ configDir,
9351
+ locations: [{
9352
+ kind: "marketplaces",
9353
+ path: join(configDir, "plugins", "marketplaces"),
9354
+ description: "Marketplace checkouts",
9355
+ research: "E-AUG-P2"
9356
+ }, {
9357
+ kind: "enabled-record",
9358
+ path: join(configDir, "settings.json"),
9359
+ description: "User settings; enabledPlugins maps plugin@marketplace to a boolean",
9360
+ research: "E-AUG-P4"
9361
+ }]
9362
+ };
9363
+ }
9364
+ };
9365
+ var require_identity = /* @__PURE__ */ __commonJSMin(((exports) => {
9366
+ const ALIAS = Symbol.for("yaml.alias");
9367
+ const DOC = Symbol.for("yaml.document");
9368
+ const MAP = Symbol.for("yaml.map");
9369
+ const PAIR = Symbol.for("yaml.pair");
9370
+ const SCALAR = Symbol.for("yaml.scalar");
9371
+ const SEQ = Symbol.for("yaml.seq");
9372
+ const NODE_TYPE = Symbol.for("yaml.node.type");
9373
+ const isAlias = (node) => !!node && typeof node === "object" && node[NODE_TYPE] === ALIAS;
9374
+ const isDocument = (node) => !!node && typeof node === "object" && node[NODE_TYPE] === DOC;
9375
+ const isMap = (node) => !!node && typeof node === "object" && node[NODE_TYPE] === MAP;
9376
+ const isPair = (node) => !!node && typeof node === "object" && node[NODE_TYPE] === PAIR;
9377
+ const isScalar = (node) => !!node && typeof node === "object" && node[NODE_TYPE] === SCALAR;
9378
+ const isSeq = (node) => !!node && typeof node === "object" && node[NODE_TYPE] === SEQ;
9379
+ function isCollection(node) {
9380
+ if (node && typeof node === "object") switch (node[NODE_TYPE]) {
9381
+ case MAP:
9382
+ case SEQ: return true;
9383
+ }
9384
+ return false;
9385
+ }
9386
+ function isNode(node) {
9387
+ if (node && typeof node === "object") switch (node[NODE_TYPE]) {
9388
+ case ALIAS:
9389
+ case MAP:
9390
+ case SCALAR:
9391
+ case SEQ: return true;
9392
+ }
9393
+ return false;
9394
+ }
9395
+ const hasAnchor = (node) => (isScalar(node) || isCollection(node)) && !!node.anchor;
9396
+ exports.ALIAS = ALIAS;
9397
+ exports.DOC = DOC;
9398
+ exports.MAP = MAP;
9399
+ exports.NODE_TYPE = NODE_TYPE;
9400
+ exports.PAIR = PAIR;
9401
+ exports.SCALAR = SCALAR;
9402
+ exports.SEQ = SEQ;
9403
+ exports.hasAnchor = hasAnchor;
9404
+ exports.isAlias = isAlias;
9405
+ exports.isCollection = isCollection;
9406
+ exports.isDocument = isDocument;
9407
+ exports.isMap = isMap;
9408
+ exports.isNode = isNode;
9409
+ exports.isPair = isPair;
9410
+ exports.isScalar = isScalar;
9411
+ exports.isSeq = isSeq;
9412
+ }));
9413
+ var require_visit = /* @__PURE__ */ __commonJSMin(((exports) => {
9414
+ var identity = require_identity();
9415
+ const BREAK = Symbol("break visit");
9416
+ const SKIP = Symbol("skip children");
9417
+ const REMOVE = Symbol("remove node");
9418
+ /**
9419
+ * Apply a visitor to an AST node or document.
9420
+ *
9421
+ * Walks through the tree (depth-first) starting from `node`, calling a
9422
+ * `visitor` function with three arguments:
9423
+ * - `key`: For sequence values and map `Pair`, the node's index in the
9424
+ * collection. Within a `Pair`, `'key'` or `'value'`, correspondingly.
9425
+ * `null` for the root node.
9426
+ * - `node`: The current node.
9427
+ * - `path`: The ancestry of the current node.
9428
+ *
9429
+ * The return value of the visitor may be used to control the traversal:
9430
+ * - `undefined` (default): Do nothing and continue
9431
+ * - `visit.SKIP`: Do not visit the children of this node, continue with next
9432
+ * sibling
9433
+ * - `visit.BREAK`: Terminate traversal completely
9434
+ * - `visit.REMOVE`: Remove the current node, then continue with the next one
9435
+ * - `Node`: Replace the current node, then continue by visiting it
9436
+ * - `number`: While iterating the items of a sequence or map, set the index
9437
+ * of the next step. This is useful especially if the index of the current
9438
+ * node has changed.
9439
+ *
9440
+ * If `visitor` is a single function, it will be called with all values
9441
+ * encountered in the tree, including e.g. `null` values. Alternatively,
9442
+ * separate visitor functions may be defined for each `Map`, `Pair`, `Seq`,
9443
+ * `Alias` and `Scalar` node. To define the same visitor function for more than
9444
+ * one node type, use the `Collection` (map and seq), `Value` (map, seq & scalar)
9445
+ * and `Node` (alias, map, seq & scalar) targets. Of all these, only the most
9446
+ * specific defined one will be used for each node.
9447
+ */
9448
+ function visit(node, visitor) {
9449
+ const visitor_ = initVisitor(visitor);
9450
+ if (identity.isDocument(node)) {
9451
+ if (visit_(null, node.contents, visitor_, Object.freeze([node])) === REMOVE) node.contents = null;
9452
+ } else visit_(null, node, visitor_, Object.freeze([]));
9453
+ }
9454
+ /** Terminate visit traversal completely */
9455
+ visit.BREAK = BREAK;
9456
+ /** Do not visit the children of the current node */
9457
+ visit.SKIP = SKIP;
9458
+ /** Remove the current node */
9459
+ visit.REMOVE = REMOVE;
9460
+ function visit_(key, node, visitor, path) {
9461
+ const ctrl = callVisitor(key, node, visitor, path);
9462
+ if (identity.isNode(ctrl) || identity.isPair(ctrl)) {
9463
+ replaceNode(key, path, ctrl);
9464
+ return visit_(key, ctrl, visitor, path);
9465
+ }
9466
+ if (typeof ctrl !== "symbol") {
9467
+ if (identity.isCollection(node)) {
9468
+ path = Object.freeze(path.concat(node));
9469
+ for (let i = 0; i < node.items.length; ++i) {
9470
+ const ci = visit_(i, node.items[i], visitor, path);
9471
+ if (typeof ci === "number") i = ci - 1;
9472
+ else if (ci === BREAK) return BREAK;
9473
+ else if (ci === REMOVE) {
9474
+ node.items.splice(i, 1);
9475
+ i -= 1;
9476
+ }
9477
+ }
9478
+ } else if (identity.isPair(node)) {
9479
+ path = Object.freeze(path.concat(node));
9480
+ const ck = visit_("key", node.key, visitor, path);
9481
+ if (ck === BREAK) return BREAK;
9482
+ else if (ck === REMOVE) node.key = null;
9483
+ const cv = visit_("value", node.value, visitor, path);
9484
+ if (cv === BREAK) return BREAK;
9485
+ else if (cv === REMOVE) node.value = null;
9486
+ }
9487
+ }
9488
+ return ctrl;
9489
+ }
9490
+ /**
9491
+ * Apply an async visitor to an AST node or document.
9492
+ *
9493
+ * Walks through the tree (depth-first) starting from `node`, calling a
9494
+ * `visitor` function with three arguments:
9495
+ * - `key`: For sequence values and map `Pair`, the node's index in the
9496
+ * collection. Within a `Pair`, `'key'` or `'value'`, correspondingly.
9497
+ * `null` for the root node.
9498
+ * - `node`: The current node.
9499
+ * - `path`: The ancestry of the current node.
9500
+ *
9501
+ * The return value of the visitor may be used to control the traversal:
9502
+ * - `Promise`: Must resolve to one of the following values
9503
+ * - `undefined` (default): Do nothing and continue
9504
+ * - `visit.SKIP`: Do not visit the children of this node, continue with next
9505
+ * sibling
9506
+ * - `visit.BREAK`: Terminate traversal completely
9068
9507
  * - `visit.REMOVE`: Remove the current node, then continue with the next one
9069
9508
  * - `Node`: Replace the current node, then continue by visiting it
9070
9509
  * - `number`: While iterating the items of a sequence or map, set the index
@@ -9160,8 +9599,6 @@ var require_visit = /* @__PURE__ */ __commonJSMin(((exports) => {
9160
9599
  exports.visit = visit;
9161
9600
  exports.visitAsync = visitAsync;
9162
9601
  }));
9163
- //#endregion
9164
- //#region ../../node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/doc/directives.js
9165
9602
  var require_directives = /* @__PURE__ */ __commonJSMin(((exports) => {
9166
9603
  var identity = require_identity();
9167
9604
  var visit = require_visit();
@@ -9324,8 +9761,6 @@ var require_directives = /* @__PURE__ */ __commonJSMin(((exports) => {
9324
9761
  Directives.defaultTags = { "!!": "tag:yaml.org,2002:" };
9325
9762
  exports.Directives = Directives;
9326
9763
  }));
9327
- //#endregion
9328
- //#region ../../node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/doc/anchors.js
9329
9764
  var require_anchors = /* @__PURE__ */ __commonJSMin(((exports) => {
9330
9765
  var identity = require_identity();
9331
9766
  var visit = require_visit();
@@ -9391,8 +9826,6 @@ var require_anchors = /* @__PURE__ */ __commonJSMin(((exports) => {
9391
9826
  exports.createNodeAnchors = createNodeAnchors;
9392
9827
  exports.findNewAnchor = findNewAnchor;
9393
9828
  }));
9394
- //#endregion
9395
- //#region ../../node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/doc/applyReviver.js
9396
9829
  var require_applyReviver = /* @__PURE__ */ __commonJSMin(((exports) => {
9397
9830
  /**
9398
9831
  * Applies the JSON.parse reviver algorithm as defined in the ECMA-262 spec,
@@ -9433,8 +9866,6 @@ var require_applyReviver = /* @__PURE__ */ __commonJSMin(((exports) => {
9433
9866
  }
9434
9867
  exports.applyReviver = applyReviver;
9435
9868
  }));
9436
- //#endregion
9437
- //#region ../../node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/nodes/toJS.js
9438
9869
  var require_toJS = /* @__PURE__ */ __commonJSMin(((exports) => {
9439
9870
  var identity = require_identity();
9440
9871
  /**
@@ -9470,8 +9901,6 @@ var require_toJS = /* @__PURE__ */ __commonJSMin(((exports) => {
9470
9901
  }
9471
9902
  exports.toJS = toJS;
9472
9903
  }));
9473
- //#endregion
9474
- //#region ../../node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/nodes/Node.js
9475
9904
  var require_Node = /* @__PURE__ */ __commonJSMin(((exports) => {
9476
9905
  var applyReviver = require_applyReviver();
9477
9906
  var identity = require_identity();
@@ -9504,8 +9933,6 @@ var require_Node = /* @__PURE__ */ __commonJSMin(((exports) => {
9504
9933
  };
9505
9934
  exports.NodeBase = NodeBase;
9506
9935
  }));
9507
- //#endregion
9508
- //#region ../../node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/nodes/Alias.js
9509
9936
  var require_Alias = /* @__PURE__ */ __commonJSMin(((exports) => {
9510
9937
  var anchors = require_anchors();
9511
9938
  var visit = require_visit();
@@ -9540,29 +9967,31 @@ var require_Alias = /* @__PURE__ */ __commonJSMin(((exports) => {
9540
9967
  if (node === this) break;
9541
9968
  if (node.anchor === this.source) found = node;
9542
9969
  }
9970
+ if (found && ctx) {
9971
+ const { anchors, doc, maxAliasCount } = ctx;
9972
+ let data = anchors.get(found);
9973
+ if (!data) {
9974
+ toJS.toJS(found, null, ctx);
9975
+ data = anchors.get(found);
9976
+ }
9977
+ /* istanbul ignore if */
9978
+ if (data?.res === void 0) throw new ReferenceError("This should not happen: Alias anchor was not resolved?");
9979
+ if (maxAliasCount >= 0) {
9980
+ data.count += 1;
9981
+ if (data.aliasCount === 0) data.aliasCount = getAliasCount(doc, found, anchors);
9982
+ if (data.count * data.aliasCount > maxAliasCount) throw new ReferenceError("Excessive alias count indicates a resource exhaustion attack");
9983
+ }
9984
+ }
9543
9985
  return found;
9544
9986
  }
9545
9987
  toJSON(_arg, ctx) {
9546
9988
  if (!ctx) return { source: this.source };
9547
- const { anchors, doc, maxAliasCount } = ctx;
9548
- const source = this.resolve(doc, ctx);
9989
+ const source = this.resolve(ctx.doc, ctx);
9549
9990
  if (!source) {
9550
9991
  const msg = `Unresolved alias (the anchor must be set before the alias): ${this.source}`;
9551
9992
  throw new ReferenceError(msg);
9552
9993
  }
9553
- let data = anchors.get(source);
9554
- if (!data) {
9555
- toJS.toJS(source, null, ctx);
9556
- data = anchors.get(source);
9557
- }
9558
- /* istanbul ignore if */
9559
- if (data?.res === void 0) throw new ReferenceError("This should not happen: Alias anchor was not resolved?");
9560
- if (maxAliasCount >= 0) {
9561
- data.count += 1;
9562
- if (data.aliasCount === 0) data.aliasCount = getAliasCount(doc, source, anchors);
9563
- if (data.count * data.aliasCount > maxAliasCount) throw new ReferenceError("Excessive alias count indicates a resource exhaustion attack");
9564
- }
9565
- return data.res;
9994
+ return ctx.anchors.get(source).res;
9566
9995
  }
9567
9996
  toString(ctx, _onComment, _onChompKeep) {
9568
9997
  const src = `*${this.source}`;
@@ -9598,8 +10027,6 @@ var require_Alias = /* @__PURE__ */ __commonJSMin(((exports) => {
9598
10027
  }
9599
10028
  exports.Alias = Alias;
9600
10029
  }));
9601
- //#endregion
9602
- //#region ../../node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/nodes/Scalar.js
9603
10030
  var require_Scalar = /* @__PURE__ */ __commonJSMin(((exports) => {
9604
10031
  var identity = require_identity();
9605
10032
  var Node = require_Node();
@@ -9625,8 +10052,6 @@ var require_Scalar = /* @__PURE__ */ __commonJSMin(((exports) => {
9625
10052
  exports.Scalar = Scalar;
9626
10053
  exports.isScalarValue = isScalarValue;
9627
10054
  }));
9628
- //#endregion
9629
- //#region ../../node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/doc/createNode.js
9630
10055
  var require_createNode = /* @__PURE__ */ __commonJSMin(((exports) => {
9631
10056
  var Alias = require_Alias();
9632
10057
  var identity = require_identity();
@@ -9688,8 +10113,6 @@ var require_createNode = /* @__PURE__ */ __commonJSMin(((exports) => {
9688
10113
  }
9689
10114
  exports.createNode = createNode;
9690
10115
  }));
9691
- //#endregion
9692
- //#region ../../node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/nodes/Collection.js
9693
10116
  var require_Collection = /* @__PURE__ */ __commonJSMin(((exports) => {
9694
10117
  var createNode = require_createNode();
9695
10118
  var identity = require_identity();
@@ -9809,8 +10232,6 @@ var require_Collection = /* @__PURE__ */ __commonJSMin(((exports) => {
9809
10232
  exports.collectionFromPath = collectionFromPath;
9810
10233
  exports.isEmptyPath = isEmptyPath;
9811
10234
  }));
9812
- //#endregion
9813
- //#region ../../node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/stringify/stringifyComment.js
9814
10235
  var require_stringifyComment = /* @__PURE__ */ __commonJSMin(((exports) => {
9815
10236
  /**
9816
10237
  * Stringifies a comment.
@@ -9829,8 +10250,6 @@ var require_stringifyComment = /* @__PURE__ */ __commonJSMin(((exports) => {
9829
10250
  exports.lineComment = lineComment;
9830
10251
  exports.stringifyComment = stringifyComment;
9831
10252
  }));
9832
- //#endregion
9833
- //#region ../../node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/stringify/foldFlowLines.js
9834
10253
  var require_foldFlowLines = /* @__PURE__ */ __commonJSMin(((exports) => {
9835
10254
  const FOLD_FLOW = "flow";
9836
10255
  const FOLD_BLOCK = "block";
@@ -9949,8 +10368,6 @@ var require_foldFlowLines = /* @__PURE__ */ __commonJSMin(((exports) => {
9949
10368
  exports.FOLD_QUOTED = FOLD_QUOTED;
9950
10369
  exports.foldFlowLines = foldFlowLines;
9951
10370
  }));
9952
- //#endregion
9953
- //#region ../../node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/stringify/stringifyString.js
9954
10371
  var require_stringifyString = /* @__PURE__ */ __commonJSMin(((exports) => {
9955
10372
  var Scalar = require_Scalar();
9956
10373
  var foldFlowLines = require_foldFlowLines();
@@ -10173,8 +10590,6 @@ var require_stringifyString = /* @__PURE__ */ __commonJSMin(((exports) => {
10173
10590
  }
10174
10591
  exports.stringifyString = stringifyString;
10175
10592
  }));
10176
- //#endregion
10177
- //#region ../../node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/stringify/stringify.js
10178
10593
  var require_stringify = /* @__PURE__ */ __commonJSMin(((exports) => {
10179
10594
  var anchors = require_anchors();
10180
10595
  var identity = require_identity();
@@ -10281,8 +10696,6 @@ var require_stringify = /* @__PURE__ */ __commonJSMin(((exports) => {
10281
10696
  exports.createStringifyContext = createStringifyContext;
10282
10697
  exports.stringify = stringify;
10283
10698
  }));
10284
- //#endregion
10285
- //#region ../../node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/stringify/stringifyPair.js
10286
10699
  var require_stringifyPair = /* @__PURE__ */ __commonJSMin(((exports) => {
10287
10700
  var identity = require_identity();
10288
10701
  var Scalar = require_Scalar();
@@ -10378,8 +10791,6 @@ var require_stringifyPair = /* @__PURE__ */ __commonJSMin(((exports) => {
10378
10791
  }
10379
10792
  exports.stringifyPair = stringifyPair;
10380
10793
  }));
10381
- //#endregion
10382
- //#region ../../node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/log.js
10383
10794
  var require_log = /* @__PURE__ */ __commonJSMin(((exports) => {
10384
10795
  var node_process$2 = __require("process");
10385
10796
  function debug(logLevel, ...messages) {
@@ -10394,8 +10805,6 @@ var require_log = /* @__PURE__ */ __commonJSMin(((exports) => {
10394
10805
  exports.debug = debug;
10395
10806
  exports.warn = warn;
10396
10807
  }));
10397
- //#endregion
10398
- //#region ../../node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/schema/yaml-1.1/merge.js
10399
10808
  var require_merge = /* @__PURE__ */ __commonJSMin(((exports) => {
10400
10809
  var identity = require_identity();
10401
10810
  var Scalar = require_Scalar();
@@ -10437,8 +10846,6 @@ var require_merge = /* @__PURE__ */ __commonJSMin(((exports) => {
10437
10846
  exports.isMergeKey = isMergeKey;
10438
10847
  exports.merge = merge;
10439
10848
  }));
10440
- //#endregion
10441
- //#region ../../node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/nodes/addPairToJSMap.js
10442
10849
  var require_addPairToJSMap = /* @__PURE__ */ __commonJSMin(((exports) => {
10443
10850
  var log = require_log();
10444
10851
  var merge = require_merge();
@@ -10488,8 +10895,6 @@ var require_addPairToJSMap = /* @__PURE__ */ __commonJSMin(((exports) => {
10488
10895
  }
10489
10896
  exports.addPairToJSMap = addPairToJSMap;
10490
10897
  }));
10491
- //#endregion
10492
- //#region ../../node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/nodes/Pair.js
10493
10898
  var require_Pair = /* @__PURE__ */ __commonJSMin(((exports) => {
10494
10899
  var createNode = require_createNode();
10495
10900
  var stringifyPair = require_stringifyPair();
@@ -10521,8 +10926,6 @@ var require_Pair = /* @__PURE__ */ __commonJSMin(((exports) => {
10521
10926
  exports.Pair = Pair;
10522
10927
  exports.createPair = createPair;
10523
10928
  }));
10524
- //#endregion
10525
- //#region ../../node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/stringify/stringifyCollection.js
10526
10929
  var require_stringifyCollection = /* @__PURE__ */ __commonJSMin(((exports) => {
10527
10930
  var identity = require_identity();
10528
10931
  var stringify = require_stringify();
@@ -10639,8 +11042,6 @@ var require_stringifyCollection = /* @__PURE__ */ __commonJSMin(((exports) => {
10639
11042
  }
10640
11043
  exports.stringifyCollection = stringifyCollection;
10641
11044
  }));
10642
- //#endregion
10643
- //#region ../../node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/nodes/YAMLMap.js
10644
11045
  var require_YAMLMap = /* @__PURE__ */ __commonJSMin(((exports) => {
10645
11046
  var stringifyCollection = require_stringifyCollection();
10646
11047
  var addPairToJSMap = require_addPairToJSMap();
@@ -10748,8 +11149,6 @@ var require_YAMLMap = /* @__PURE__ */ __commonJSMin(((exports) => {
10748
11149
  exports.YAMLMap = YAMLMap;
10749
11150
  exports.findPair = findPair;
10750
11151
  }));
10751
- //#endregion
10752
- //#region ../../node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/schema/common/map.js
10753
11152
  var require_map = /* @__PURE__ */ __commonJSMin(((exports) => {
10754
11153
  var identity = require_identity();
10755
11154
  var YAMLMap = require_YAMLMap();
@@ -10765,8 +11164,6 @@ var require_map = /* @__PURE__ */ __commonJSMin(((exports) => {
10765
11164
  createNode: (schema, obj, ctx) => YAMLMap.YAMLMap.from(schema, obj, ctx)
10766
11165
  };
10767
11166
  }));
10768
- //#endregion
10769
- //#region ../../node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/nodes/YAMLSeq.js
10770
11167
  var require_YAMLSeq = /* @__PURE__ */ __commonJSMin(((exports) => {
10771
11168
  var createNode = require_createNode();
10772
11169
  var stringifyCollection = require_stringifyCollection();
@@ -10871,8 +11268,6 @@ var require_YAMLSeq = /* @__PURE__ */ __commonJSMin(((exports) => {
10871
11268
  }
10872
11269
  exports.YAMLSeq = YAMLSeq;
10873
11270
  }));
10874
- //#endregion
10875
- //#region ../../node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/schema/common/seq.js
10876
11271
  var require_seq = /* @__PURE__ */ __commonJSMin(((exports) => {
10877
11272
  var identity = require_identity();
10878
11273
  var YAMLSeq = require_YAMLSeq();
@@ -10888,8 +11283,6 @@ var require_seq = /* @__PURE__ */ __commonJSMin(((exports) => {
10888
11283
  createNode: (schema, obj, ctx) => YAMLSeq.YAMLSeq.from(schema, obj, ctx)
10889
11284
  };
10890
11285
  }));
10891
- //#endregion
10892
- //#region ../../node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/schema/common/string.js
10893
11286
  var require_string = /* @__PURE__ */ __commonJSMin(((exports) => {
10894
11287
  var stringifyString = require_stringifyString();
10895
11288
  exports.string = {
@@ -10903,8 +11296,6 @@ var require_string = /* @__PURE__ */ __commonJSMin(((exports) => {
10903
11296
  }
10904
11297
  };
10905
11298
  }));
10906
- //#endregion
10907
- //#region ../../node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/schema/common/null.js
10908
11299
  var require_null = /* @__PURE__ */ __commonJSMin(((exports) => {
10909
11300
  var Scalar = require_Scalar();
10910
11301
  const nullTag = {
@@ -10918,8 +11309,6 @@ var require_null = /* @__PURE__ */ __commonJSMin(((exports) => {
10918
11309
  };
10919
11310
  exports.nullTag = nullTag;
10920
11311
  }));
10921
- //#endregion
10922
- //#region ../../node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/schema/core/bool.js
10923
11312
  var require_bool$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
10924
11313
  var Scalar = require_Scalar();
10925
11314
  const boolTag = {
@@ -10937,8 +11326,6 @@ var require_bool$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
10937
11326
  };
10938
11327
  exports.boolTag = boolTag;
10939
11328
  }));
10940
- //#endregion
10941
- //#region ../../node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/stringify/stringifyNumber.js
10942
11329
  var require_stringifyNumber = /* @__PURE__ */ __commonJSMin(((exports) => {
10943
11330
  function stringifyNumber({ format, minFractionDigits, tag, value }) {
10944
11331
  if (typeof value === "bigint") return String(value);
@@ -10958,8 +11345,6 @@ var require_stringifyNumber = /* @__PURE__ */ __commonJSMin(((exports) => {
10958
11345
  }
10959
11346
  exports.stringifyNumber = stringifyNumber;
10960
11347
  }));
10961
- //#endregion
10962
- //#region ../../node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/schema/core/float.js
10963
11348
  var require_float$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
10964
11349
  var Scalar = require_Scalar();
10965
11350
  var stringifyNumber = require_stringifyNumber();
@@ -10999,8 +11384,6 @@ var require_float$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
10999
11384
  exports.floatExp = floatExp;
11000
11385
  exports.floatNaN = floatNaN;
11001
11386
  }));
11002
- //#endregion
11003
- //#region ../../node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/schema/core/int.js
11004
11387
  var require_int$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
11005
11388
  var stringifyNumber = require_stringifyNumber();
11006
11389
  const intIdentify = (value) => typeof value === "bigint" || Number.isInteger(value);
@@ -11040,8 +11423,6 @@ var require_int$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
11040
11423
  exports.intHex = intHex;
11041
11424
  exports.intOct = intOct;
11042
11425
  }));
11043
- //#endregion
11044
- //#region ../../node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/schema/core/schema.js
11045
11426
  var require_schema$2 = /* @__PURE__ */ __commonJSMin(((exports) => {
11046
11427
  var map = require_map();
11047
11428
  var _null = require_null();
@@ -11064,8 +11445,6 @@ var require_schema$2 = /* @__PURE__ */ __commonJSMin(((exports) => {
11064
11445
  float.float
11065
11446
  ];
11066
11447
  }));
11067
- //#endregion
11068
- //#region ../../node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/schema/json/schema.js
11069
11448
  var require_schema$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
11070
11449
  var Scalar = require_Scalar();
11071
11450
  var map = require_map();
@@ -11126,8 +11505,6 @@ var require_schema$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
11126
11505
  }
11127
11506
  });
11128
11507
  }));
11129
- //#endregion
11130
- //#region ../../node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/schema/yaml-1.1/binary.js
11131
11508
  var require_binary = /* @__PURE__ */ __commonJSMin(((exports) => {
11132
11509
  var node_buffer = __require("buffer");
11133
11510
  var Scalar = require_Scalar();
@@ -11182,8 +11559,6 @@ var require_binary = /* @__PURE__ */ __commonJSMin(((exports) => {
11182
11559
  }
11183
11560
  };
11184
11561
  }));
11185
- //#endregion
11186
- //#region ../../node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/schema/yaml-1.1/pairs.js
11187
11562
  var require_pairs = /* @__PURE__ */ __commonJSMin(((exports) => {
11188
11563
  var identity = require_identity();
11189
11564
  var Pair = require_Pair();
@@ -11243,8 +11618,6 @@ var require_pairs = /* @__PURE__ */ __commonJSMin(((exports) => {
11243
11618
  exports.pairs = pairs;
11244
11619
  exports.resolvePairs = resolvePairs;
11245
11620
  }));
11246
- //#endregion
11247
- //#region ../../node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/schema/yaml-1.1/omap.js
11248
11621
  var require_omap = /* @__PURE__ */ __commonJSMin(((exports) => {
11249
11622
  var identity = require_identity();
11250
11623
  var toJS = require_toJS();
@@ -11308,8 +11681,6 @@ var require_omap = /* @__PURE__ */ __commonJSMin(((exports) => {
11308
11681
  exports.YAMLOMap = YAMLOMap;
11309
11682
  exports.omap = omap;
11310
11683
  }));
11311
- //#endregion
11312
- //#region ../../node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/schema/yaml-1.1/bool.js
11313
11684
  var require_bool = /* @__PURE__ */ __commonJSMin(((exports) => {
11314
11685
  var Scalar = require_Scalar();
11315
11686
  function boolStringify({ value, source }, ctx) {
@@ -11335,8 +11706,6 @@ var require_bool = /* @__PURE__ */ __commonJSMin(((exports) => {
11335
11706
  exports.falseTag = falseTag;
11336
11707
  exports.trueTag = trueTag;
11337
11708
  }));
11338
- //#endregion
11339
- //#region ../../node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/schema/yaml-1.1/float.js
11340
11709
  var require_float = /* @__PURE__ */ __commonJSMin(((exports) => {
11341
11710
  var Scalar = require_Scalar();
11342
11711
  var stringifyNumber = require_stringifyNumber();
@@ -11379,8 +11748,6 @@ var require_float = /* @__PURE__ */ __commonJSMin(((exports) => {
11379
11748
  exports.floatExp = floatExp;
11380
11749
  exports.floatNaN = floatNaN;
11381
11750
  }));
11382
- //#endregion
11383
- //#region ../../node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/schema/yaml-1.1/int.js
11384
11751
  var require_int = /* @__PURE__ */ __commonJSMin(((exports) => {
11385
11752
  var stringifyNumber = require_stringifyNumber();
11386
11753
  const intIdentify = (value) => typeof value === "bigint" || Number.isInteger(value);
@@ -11452,8 +11819,6 @@ var require_int = /* @__PURE__ */ __commonJSMin(((exports) => {
11452
11819
  exports.intHex = intHex;
11453
11820
  exports.intOct = intOct;
11454
11821
  }));
11455
- //#endregion
11456
- //#region ../../node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/schema/yaml-1.1/set.js
11457
11822
  var require_set = /* @__PURE__ */ __commonJSMin(((exports) => {
11458
11823
  var identity = require_identity();
11459
11824
  var Pair = require_Pair();
@@ -11521,8 +11886,6 @@ var require_set = /* @__PURE__ */ __commonJSMin(((exports) => {
11521
11886
  exports.YAMLSet = YAMLSet;
11522
11887
  exports.set = set;
11523
11888
  }));
11524
- //#endregion
11525
- //#region ../../node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/schema/yaml-1.1/timestamp.js
11526
11889
  var require_timestamp = /* @__PURE__ */ __commonJSMin(((exports) => {
11527
11890
  var stringifyNumber = require_stringifyNumber();
11528
11891
  /** Internal types handle bigint as number, because TS can't figure it out. */
@@ -11604,8 +11967,6 @@ var require_timestamp = /* @__PURE__ */ __commonJSMin(((exports) => {
11604
11967
  exports.intTime = intTime;
11605
11968
  exports.timestamp = timestamp;
11606
11969
  }));
11607
- //#endregion
11608
- //#region ../../node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/schema/yaml-1.1/schema.js
11609
11970
  var require_schema = /* @__PURE__ */ __commonJSMin(((exports) => {
11610
11971
  var map = require_map();
11611
11972
  var _null = require_null();
@@ -11644,8 +12005,6 @@ var require_schema = /* @__PURE__ */ __commonJSMin(((exports) => {
11644
12005
  timestamp.timestamp
11645
12006
  ];
11646
12007
  }));
11647
- //#endregion
11648
- //#region ../../node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/schema/tags.js
11649
12008
  var require_tags = /* @__PURE__ */ __commonJSMin(((exports) => {
11650
12009
  var map = require_map();
11651
12010
  var _null = require_null();
@@ -11730,8 +12089,6 @@ var require_tags = /* @__PURE__ */ __commonJSMin(((exports) => {
11730
12089
  exports.coreKnownTags = coreKnownTags;
11731
12090
  exports.getTags = getTags;
11732
12091
  }));
11733
- //#endregion
11734
- //#region ../../node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/schema/Schema.js
11735
12092
  var require_Schema = /* @__PURE__ */ __commonJSMin(((exports) => {
11736
12093
  var identity = require_identity();
11737
12094
  var map = require_map();
@@ -11758,8 +12115,6 @@ var require_Schema = /* @__PURE__ */ __commonJSMin(((exports) => {
11758
12115
  }
11759
12116
  };
11760
12117
  }));
11761
- //#endregion
11762
- //#region ../../node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/stringify/stringifyDocument.js
11763
12118
  var require_stringifyDocument = /* @__PURE__ */ __commonJSMin(((exports) => {
11764
12119
  var identity = require_identity();
11765
12120
  var stringify = require_stringify();
@@ -11820,8 +12175,6 @@ var require_stringifyDocument = /* @__PURE__ */ __commonJSMin(((exports) => {
11820
12175
  }
11821
12176
  exports.stringifyDocument = stringifyDocument;
11822
12177
  }));
11823
- //#endregion
11824
- //#region ../../node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/doc/Document.js
11825
12178
  var require_Document = /* @__PURE__ */ __commonJSMin(((exports) => {
11826
12179
  var Alias = require_Alias();
11827
12180
  var Collection = require_Collection();
@@ -12101,8 +12454,6 @@ var require_Document = /* @__PURE__ */ __commonJSMin(((exports) => {
12101
12454
  }
12102
12455
  exports.Document = Document;
12103
12456
  }));
12104
- //#endregion
12105
- //#region ../../node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/errors.js
12106
12457
  var require_errors = /* @__PURE__ */ __commonJSMin(((exports) => {
12107
12458
  var YAMLError = class extends Error {
12108
12459
  constructor(name, pos, code, message) {
@@ -12154,8 +12505,6 @@ var require_errors = /* @__PURE__ */ __commonJSMin(((exports) => {
12154
12505
  exports.YAMLWarning = YAMLWarning;
12155
12506
  exports.prettifyError = prettifyError;
12156
12507
  }));
12157
- //#endregion
12158
- //#region ../../node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/compose/resolve-props.js
12159
12508
  var require_resolve_props = /* @__PURE__ */ __commonJSMin(((exports) => {
12160
12509
  function resolveProps(tokens, { flow, indicator, next, offset, onError, parentIndent, startOnNewline }) {
12161
12510
  let spaceBefore = false;
@@ -12261,8 +12610,6 @@ var require_resolve_props = /* @__PURE__ */ __commonJSMin(((exports) => {
12261
12610
  }
12262
12611
  exports.resolveProps = resolveProps;
12263
12612
  }));
12264
- //#endregion
12265
- //#region ../../node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/compose/util-contains-newline.js
12266
12613
  var require_util_contains_newline = /* @__PURE__ */ __commonJSMin(((exports) => {
12267
12614
  function containsNewline(key) {
12268
12615
  if (!key) return null;
@@ -12290,8 +12637,6 @@ var require_util_contains_newline = /* @__PURE__ */ __commonJSMin(((exports) =>
12290
12637
  }
12291
12638
  exports.containsNewline = containsNewline;
12292
12639
  }));
12293
- //#endregion
12294
- //#region ../../node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/compose/util-flow-indent-check.js
12295
12640
  var require_util_flow_indent_check = /* @__PURE__ */ __commonJSMin(((exports) => {
12296
12641
  var utilContainsNewline = require_util_contains_newline();
12297
12642
  function flowIndentCheck(indent, fc, onError) {
@@ -12302,8 +12647,6 @@ var require_util_flow_indent_check = /* @__PURE__ */ __commonJSMin(((exports) =>
12302
12647
  }
12303
12648
  exports.flowIndentCheck = flowIndentCheck;
12304
12649
  }));
12305
- //#endregion
12306
- //#region ../../node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/compose/util-map-includes.js
12307
12650
  var require_util_map_includes = /* @__PURE__ */ __commonJSMin(((exports) => {
12308
12651
  var identity = require_identity();
12309
12652
  function mapIncludes(ctx, items, search) {
@@ -12314,8 +12657,6 @@ var require_util_map_includes = /* @__PURE__ */ __commonJSMin(((exports) => {
12314
12657
  }
12315
12658
  exports.mapIncludes = mapIncludes;
12316
12659
  }));
12317
- //#endregion
12318
- //#region ../../node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/compose/resolve-block-map.js
12319
12660
  var require_resolve_block_map = /* @__PURE__ */ __commonJSMin(((exports) => {
12320
12661
  var Pair = require_Pair();
12321
12662
  var YAMLMap = require_YAMLMap();
@@ -12402,8 +12743,6 @@ var require_resolve_block_map = /* @__PURE__ */ __commonJSMin(((exports) => {
12402
12743
  }
12403
12744
  exports.resolveBlockMap = resolveBlockMap;
12404
12745
  }));
12405
- //#endregion
12406
- //#region ../../node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/compose/resolve-block-seq.js
12407
12746
  var require_resolve_block_seq = /* @__PURE__ */ __commonJSMin(((exports) => {
12408
12747
  var YAMLSeq = require_YAMLSeq();
12409
12748
  var resolveProps = require_resolve_props();
@@ -12447,8 +12786,6 @@ var require_resolve_block_seq = /* @__PURE__ */ __commonJSMin(((exports) => {
12447
12786
  }
12448
12787
  exports.resolveBlockSeq = resolveBlockSeq;
12449
12788
  }));
12450
- //#endregion
12451
- //#region ../../node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/compose/resolve-end.js
12452
12789
  var require_resolve_end = /* @__PURE__ */ __commonJSMin(((exports) => {
12453
12790
  function resolveEnd(end, offset, reqSpace, onError) {
12454
12791
  let comment = "";
@@ -12485,8 +12822,6 @@ var require_resolve_end = /* @__PURE__ */ __commonJSMin(((exports) => {
12485
12822
  }
12486
12823
  exports.resolveEnd = resolveEnd;
12487
12824
  }));
12488
- //#endregion
12489
- //#region ../../node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/compose/resolve-flow-collection.js
12490
12825
  var require_resolve_flow_collection = /* @__PURE__ */ __commonJSMin(((exports) => {
12491
12826
  var identity = require_identity();
12492
12827
  var Pair = require_Pair();
@@ -12648,8 +12983,6 @@ var require_resolve_flow_collection = /* @__PURE__ */ __commonJSMin(((exports) =
12648
12983
  }
12649
12984
  exports.resolveFlowCollection = resolveFlowCollection;
12650
12985
  }));
12651
- //#endregion
12652
- //#region ../../node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/compose/compose-collection.js
12653
12986
  var require_compose_collection = /* @__PURE__ */ __commonJSMin(((exports) => {
12654
12987
  var identity = require_identity();
12655
12988
  var Scalar = require_Scalar();
@@ -12700,8 +13033,6 @@ var require_compose_collection = /* @__PURE__ */ __commonJSMin(((exports) => {
12700
13033
  }
12701
13034
  exports.composeCollection = composeCollection;
12702
13035
  }));
12703
- //#endregion
12704
- //#region ../../node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/compose/resolve-block-scalar.js
12705
13036
  var require_resolve_block_scalar = /* @__PURE__ */ __commonJSMin(((exports) => {
12706
13037
  var Scalar = require_Scalar();
12707
13038
  function resolveBlockScalar(ctx, scalar, onError) {
@@ -12877,8 +13208,6 @@ var require_resolve_block_scalar = /* @__PURE__ */ __commonJSMin(((exports) => {
12877
13208
  }
12878
13209
  exports.resolveBlockScalar = resolveBlockScalar;
12879
13210
  }));
12880
- //#endregion
12881
- //#region ../../node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/compose/resolve-flow-scalar.js
12882
13211
  var require_resolve_flow_scalar = /* @__PURE__ */ __commonJSMin(((exports) => {
12883
13212
  var Scalar = require_Scalar();
12884
13213
  var resolveEnd = require_resolve_end();
@@ -12948,40 +13277,41 @@ var require_resolve_flow_scalar = /* @__PURE__ */ __commonJSMin(((exports) => {
12948
13277
  case "`": badChar = `reserved character ${source[0]}`;
12949
13278
  }
12950
13279
  if (badChar) onError(0, "BAD_SCALAR_START", `Plain value cannot start with ${badChar}`);
12951
- return foldLines(source);
13280
+ return unfoldLines(source);
12952
13281
  }
12953
13282
  function singleQuotedValue(source, onError) {
12954
13283
  if (source[source.length - 1] !== "'" || source.length === 1) onError(source.length, "MISSING_CHAR", "Missing closing 'quote");
12955
- return foldLines(source.slice(1, -1)).replace(/''/g, "'");
13284
+ return unfoldLines(source.slice(1, -1)).replace(/''/g, "'");
12956
13285
  }
12957
- function foldLines(source) {
13286
+ function unfoldLines(source) {
13287
+ const line = /(.*?)\r?\n/sy;
13288
+ let match = line.exec(source);
13289
+ if (!match) return source;
12958
13290
  /**
12959
- * The negative lookbehind here and in the `re` RegExp is to
13291
+ * The negative lookbehinds in these RegExps are to
12960
13292
  * prevent causing a polynomial search time in certain cases.
12961
13293
  *
12962
- * The try-catch is for Safari, which doesn't support this yet:
13294
+ * The try-catch is for Safari < 16.4 and other old browsers:
12963
13295
  * https://caniuse.com/js-regexp-lookbehind
12964
13296
  */
12965
- let first, line;
13297
+ let trimEnd, trimBoth;
12966
13298
  try {
12967
- first = /* @__PURE__ */ new RegExp("(.*?)(?<![ ])[ ]*\r?\n", "sy");
12968
- line = /* @__PURE__ */ new RegExp("[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?\n", "sy");
13299
+ trimEnd = /* @__PURE__ */ new RegExp("(?<![ ])[ ]+$");
13300
+ trimBoth = /* @__PURE__ */ new RegExp("^[ ]+|(?<![ ])[ ]+$", "g");
12969
13301
  } catch {
12970
- first = /(.*?)[ \t]*\r?\n/sy;
12971
- line = /[ \t]*(.*?)[ \t]*\r?\n/sy;
13302
+ trimEnd = /[ \t]+$/;
13303
+ trimBoth = /^[ \t]+|[ \t]+$/g;
12972
13304
  }
12973
- let match = first.exec(source);
12974
- if (!match) return source;
12975
- let res = match[1];
13305
+ let res = match[1].replace(trimEnd, "");
12976
13306
  let sep = " ";
12977
- let pos = first.lastIndex;
12978
- line.lastIndex = pos;
13307
+ let pos = line.lastIndex;
12979
13308
  while (match = line.exec(source)) {
12980
- if (match[1] === "") {
13309
+ const lm = match[1].replace(trimBoth, "");
13310
+ if (lm === "") {
12981
13311
  if (sep === "\n") res += sep;
12982
13312
  else sep = "\n";
12983
13313
  } else {
12984
- res += sep + match[1];
13314
+ res += sep + lm;
12985
13315
  sep = " ";
12986
13316
  }
12987
13317
  pos = line.lastIndex;
@@ -13081,8 +13411,6 @@ var require_resolve_flow_scalar = /* @__PURE__ */ __commonJSMin(((exports) => {
13081
13411
  }
13082
13412
  exports.resolveFlowScalar = resolveFlowScalar;
13083
13413
  }));
13084
- //#endregion
13085
- //#region ../../node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/compose/compose-scalar.js
13086
13414
  var require_compose_scalar = /* @__PURE__ */ __commonJSMin(((exports) => {
13087
13415
  var identity = require_identity();
13088
13416
  var Scalar = require_Scalar();
@@ -13142,8 +13470,6 @@ var require_compose_scalar = /* @__PURE__ */ __commonJSMin(((exports) => {
13142
13470
  }
13143
13471
  exports.composeScalar = composeScalar;
13144
13472
  }));
13145
- //#endregion
13146
- //#region ../../node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/compose/util-empty-scalar-position.js
13147
13473
  var require_util_empty_scalar_position = /* @__PURE__ */ __commonJSMin(((exports) => {
13148
13474
  function emptyScalarPosition(offset, before, pos) {
13149
13475
  if (before) {
@@ -13169,8 +13495,6 @@ var require_util_empty_scalar_position = /* @__PURE__ */ __commonJSMin(((exports
13169
13495
  }
13170
13496
  exports.emptyScalarPosition = emptyScalarPosition;
13171
13497
  }));
13172
- //#endregion
13173
- //#region ../../node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/compose/compose-node.js
13174
13498
  var require_compose_node = /* @__PURE__ */ __commonJSMin(((exports) => {
13175
13499
  var Alias = require_Alias();
13176
13500
  var identity = require_identity();
@@ -13260,8 +13584,6 @@ var require_compose_node = /* @__PURE__ */ __commonJSMin(((exports) => {
13260
13584
  exports.composeEmptyNode = composeEmptyNode;
13261
13585
  exports.composeNode = composeNode;
13262
13586
  }));
13263
- //#endregion
13264
- //#region ../../node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/compose/compose-doc.js
13265
13587
  var require_compose_doc = /* @__PURE__ */ __commonJSMin(((exports) => {
13266
13588
  var Document = require_Document();
13267
13589
  var composeNode = require_compose_node();
@@ -13302,8 +13624,6 @@ var require_compose_doc = /* @__PURE__ */ __commonJSMin(((exports) => {
13302
13624
  }
13303
13625
  exports.composeDoc = composeDoc;
13304
13626
  }));
13305
- //#endregion
13306
- //#region ../../node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/compose/composer.js
13307
13627
  var require_composer = /* @__PURE__ */ __commonJSMin(((exports) => {
13308
13628
  var node_process$1 = __require("process");
13309
13629
  var directives = require_directives();
@@ -13500,8 +13820,6 @@ var require_composer = /* @__PURE__ */ __commonJSMin(((exports) => {
13500
13820
  };
13501
13821
  exports.Composer = Composer;
13502
13822
  }));
13503
- //#endregion
13504
- //#region ../../node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/parse/cst-scalar.js
13505
13823
  var require_cst_scalar = /* @__PURE__ */ __commonJSMin(((exports) => {
13506
13824
  var resolveBlockScalar = require_resolve_block_scalar();
13507
13825
  var resolveFlowScalar = require_resolve_flow_scalar();
@@ -13767,8 +14085,6 @@ var require_cst_scalar = /* @__PURE__ */ __commonJSMin(((exports) => {
13767
14085
  exports.resolveAsScalar = resolveAsScalar;
13768
14086
  exports.setScalarValue = setScalarValue;
13769
14087
  }));
13770
- //#endregion
13771
- //#region ../../node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/parse/cst-stringify.js
13772
14088
  var require_cst_stringify = /* @__PURE__ */ __commonJSMin(((exports) => {
13773
14089
  /**
13774
14090
  * Stringify a CST document, token, or collection item
@@ -13818,8 +14134,6 @@ var require_cst_stringify = /* @__PURE__ */ __commonJSMin(((exports) => {
13818
14134
  }
13819
14135
  exports.stringify = stringify;
13820
14136
  }));
13821
- //#endregion
13822
- //#region ../../node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/parse/cst-visit.js
13823
14137
  var require_cst_visit = /* @__PURE__ */ __commonJSMin(((exports) => {
13824
14138
  const BREAK = Symbol("break visit");
13825
14139
  const SKIP = Symbol("skip children");
@@ -13909,8 +14223,6 @@ var require_cst_visit = /* @__PURE__ */ __commonJSMin(((exports) => {
13909
14223
  }
13910
14224
  exports.visit = visit;
13911
14225
  }));
13912
- //#endregion
13913
- //#region ../../node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/parse/cst.js
13914
14226
  var require_cst = /* @__PURE__ */ __commonJSMin(((exports) => {
13915
14227
  var cstScalar = require_cst_scalar();
13916
14228
  var cstStringify = require_cst_stringify();
@@ -13988,8 +14300,6 @@ var require_cst = /* @__PURE__ */ __commonJSMin(((exports) => {
13988
14300
  exports.prettyToken = prettyToken;
13989
14301
  exports.tokenType = tokenType;
13990
14302
  }));
13991
- //#endregion
13992
- //#region ../../node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/parse/lexer.js
13993
14303
  var require_lexer = /* @__PURE__ */ __commonJSMin(((exports) => {
13994
14304
  var cst = require_cst();
13995
14305
  function isEmpty(ch) {
@@ -14521,8 +14831,6 @@ var require_lexer = /* @__PURE__ */ __commonJSMin(((exports) => {
14521
14831
  };
14522
14832
  exports.Lexer = Lexer;
14523
14833
  }));
14524
- //#endregion
14525
- //#region ../../node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/parse/line-counter.js
14526
14834
  var require_line_counter = /* @__PURE__ */ __commonJSMin(((exports) => {
14527
14835
  /**
14528
14836
  * Tracks newlines during parsing in order to provide an efficient API for
@@ -14568,8 +14876,6 @@ var require_line_counter = /* @__PURE__ */ __commonJSMin(((exports) => {
14568
14876
  };
14569
14877
  exports.LineCounter = LineCounter;
14570
14878
  }));
14571
- //#endregion
14572
- //#region ../../node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/parse/parser.js
14573
14879
  var require_parser = /* @__PURE__ */ __commonJSMin(((exports) => {
14574
14880
  var node_process = __require("process");
14575
14881
  var cst = require_cst();
@@ -15216,626 +15522,359 @@ var require_parser = /* @__PURE__ */ __commonJSMin(((exports) => {
15216
15522
  it.start.push(this.sourceToken);
15217
15523
  }
15218
15524
  return;
15219
- case "anchor":
15220
- case "tag":
15221
- if (it.value || this.indent <= seq.indent) break;
15222
- it.start.push(this.sourceToken);
15223
- return;
15224
- case "seq-item-ind":
15225
- if (this.indent !== seq.indent) break;
15226
- if (it.value || includesToken(it.start, "seq-item-ind")) seq.items.push({ start: [this.sourceToken] });
15227
- else it.start.push(this.sourceToken);
15228
- return;
15229
- }
15230
- if (this.indent > seq.indent) {
15231
- const bv = this.startBlockValue(seq);
15232
- if (bv) {
15233
- this.stack.push(bv);
15234
- return;
15235
- }
15236
- }
15237
- yield* this.pop();
15238
- yield* this.step();
15239
- }
15240
- *flowCollection(fc) {
15241
- const it = fc.items[fc.items.length - 1];
15242
- if (this.type === "flow-error-end") {
15243
- let top;
15244
- do {
15245
- yield* this.pop();
15246
- top = this.peek(1);
15247
- } while (top?.type === "flow-collection");
15248
- } else if (fc.end.length === 0) {
15249
- switch (this.type) {
15250
- case "comma":
15251
- case "explicit-key-ind":
15252
- if (!it || it.sep) fc.items.push({ start: [this.sourceToken] });
15253
- else it.start.push(this.sourceToken);
15254
- return;
15255
- case "map-value-ind":
15256
- if (!it || it.value) fc.items.push({
15257
- start: [],
15258
- key: null,
15259
- sep: [this.sourceToken]
15260
- });
15261
- else if (it.sep) it.sep.push(this.sourceToken);
15262
- else Object.assign(it, {
15263
- key: null,
15264
- sep: [this.sourceToken]
15265
- });
15266
- return;
15267
- case "space":
15268
- case "comment":
15269
- case "newline":
15270
- case "anchor":
15271
- case "tag":
15272
- if (!it || it.value) fc.items.push({ start: [this.sourceToken] });
15273
- else if (it.sep) it.sep.push(this.sourceToken);
15274
- else it.start.push(this.sourceToken);
15275
- return;
15276
- case "alias":
15277
- case "scalar":
15278
- case "single-quoted-scalar":
15279
- case "double-quoted-scalar": {
15280
- const fs = this.flowScalar(this.type);
15281
- if (!it || it.value) fc.items.push({
15282
- start: [],
15283
- key: fs,
15284
- sep: []
15285
- });
15286
- else if (it.sep) this.stack.push(fs);
15287
- else Object.assign(it, {
15288
- key: fs,
15289
- sep: []
15290
- });
15291
- return;
15292
- }
15293
- case "flow-map-end":
15294
- case "flow-seq-end":
15295
- fc.end.push(this.sourceToken);
15296
- return;
15297
- }
15298
- const bv = this.startBlockValue(fc);
15299
- /* istanbul ignore else should not happen */
15300
- if (bv) this.stack.push(bv);
15301
- else {
15302
- yield* this.pop();
15303
- yield* this.step();
15304
- }
15305
- } else {
15306
- const parent = this.peek(2);
15307
- if (parent.type === "block-map" && (this.type === "map-value-ind" && parent.indent === fc.indent || this.type === "newline" && !parent.items[parent.items.length - 1].sep)) {
15308
- yield* this.pop();
15309
- yield* this.step();
15310
- } else if (this.type === "map-value-ind" && parent.type !== "flow-collection") {
15311
- const start = getFirstKeyStartProps(getPrevProps(parent));
15312
- fixFlowSeqItems(fc);
15313
- const sep = fc.end.splice(1, fc.end.length);
15314
- sep.push(this.sourceToken);
15315
- const map = {
15316
- type: "block-map",
15317
- offset: fc.offset,
15318
- indent: fc.indent,
15319
- items: [{
15320
- start,
15321
- key: fc,
15322
- sep
15323
- }]
15324
- };
15325
- this.onKeyLine = true;
15326
- this.stack[this.stack.length - 1] = map;
15327
- } else yield* this.lineEnd(fc);
15328
- }
15329
- }
15330
- flowScalar(type) {
15331
- if (this.onNewLine) {
15332
- let nl = this.source.indexOf("\n") + 1;
15333
- while (nl !== 0) {
15334
- this.onNewLine(this.offset + nl);
15335
- nl = this.source.indexOf("\n", nl) + 1;
15336
- }
15337
- }
15338
- return {
15339
- type,
15340
- offset: this.offset,
15341
- indent: this.indent,
15342
- source: this.source
15343
- };
15344
- }
15345
- startBlockValue(parent) {
15346
- switch (this.type) {
15347
- case "alias":
15348
- case "scalar":
15349
- case "single-quoted-scalar":
15350
- case "double-quoted-scalar": return this.flowScalar(this.type);
15351
- case "block-scalar-header": return {
15352
- type: "block-scalar",
15353
- offset: this.offset,
15354
- indent: this.indent,
15355
- props: [this.sourceToken],
15356
- source: ""
15357
- };
15358
- case "flow-map-start":
15359
- case "flow-seq-start": return {
15360
- type: "flow-collection",
15361
- offset: this.offset,
15362
- indent: this.indent,
15363
- start: this.sourceToken,
15364
- items: [],
15365
- end: []
15366
- };
15367
- case "seq-item-ind": return {
15368
- type: "block-seq",
15369
- offset: this.offset,
15370
- indent: this.indent,
15371
- items: [{ start: [this.sourceToken] }]
15372
- };
15373
- case "explicit-key-ind": {
15374
- this.onKeyLine = true;
15375
- const start = getFirstKeyStartProps(getPrevProps(parent));
15376
- start.push(this.sourceToken);
15377
- return {
15378
- type: "block-map",
15379
- offset: this.offset,
15380
- indent: this.indent,
15381
- items: [{
15382
- start,
15383
- explicitKey: true
15384
- }]
15385
- };
15386
- }
15387
- case "map-value-ind": {
15388
- this.onKeyLine = true;
15389
- const start = getFirstKeyStartProps(getPrevProps(parent));
15390
- return {
15391
- type: "block-map",
15392
- offset: this.offset,
15393
- indent: this.indent,
15394
- items: [{
15395
- start,
15396
- key: null,
15397
- sep: [this.sourceToken]
15398
- }]
15399
- };
15400
- }
15525
+ case "anchor":
15526
+ case "tag":
15527
+ if (it.value || this.indent <= seq.indent) break;
15528
+ it.start.push(this.sourceToken);
15529
+ return;
15530
+ case "seq-item-ind":
15531
+ if (this.indent !== seq.indent) break;
15532
+ if (it.value || includesToken(it.start, "seq-item-ind")) seq.items.push({ start: [this.sourceToken] });
15533
+ else it.start.push(this.sourceToken);
15534
+ return;
15401
15535
  }
15402
- return null;
15403
- }
15404
- atIndentedComment(start, indent) {
15405
- if (this.type !== "comment") return false;
15406
- if (this.indent <= indent) return false;
15407
- return start.every((st) => st.type === "newline" || st.type === "space");
15408
- }
15409
- *documentEnd(docEnd) {
15410
- if (this.type !== "doc-mode") {
15411
- if (docEnd.end) docEnd.end.push(this.sourceToken);
15412
- else docEnd.end = [this.sourceToken];
15413
- if (this.type === "newline") yield* this.pop();
15536
+ if (this.indent > seq.indent) {
15537
+ const bv = this.startBlockValue(seq);
15538
+ if (bv) {
15539
+ this.stack.push(bv);
15540
+ return;
15541
+ }
15414
15542
  }
15543
+ yield* this.pop();
15544
+ yield* this.step();
15415
15545
  }
15416
- *lineEnd(token) {
15417
- switch (this.type) {
15418
- case "comma":
15419
- case "doc-start":
15420
- case "doc-end":
15421
- case "flow-seq-end":
15422
- case "flow-map-end":
15423
- case "map-value-ind":
15546
+ *flowCollection(fc) {
15547
+ const it = fc.items[fc.items.length - 1];
15548
+ if (this.type === "flow-error-end") {
15549
+ let top;
15550
+ do {
15424
15551
  yield* this.pop();
15425
- yield* this.step();
15426
- break;
15427
- case "newline": this.onKeyLine = false;
15428
- default:
15429
- if (token.end) token.end.push(this.sourceToken);
15430
- else token.end = [this.sourceToken];
15431
- if (this.type === "newline") yield* this.pop();
15432
- }
15433
- }
15434
- };
15435
- exports.Parser = Parser;
15436
- }));
15437
- //#endregion
15438
- //#region ../../node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/dist/public-api.js
15439
- var require_public_api = /* @__PURE__ */ __commonJSMin(((exports) => {
15440
- var composer = require_composer();
15441
- var Document = require_Document();
15442
- var errors = require_errors();
15443
- var log = require_log();
15444
- var identity = require_identity();
15445
- var lineCounter = require_line_counter();
15446
- var parser = require_parser();
15447
- function parseOptions(options) {
15448
- const prettyErrors = options.prettyErrors !== false;
15449
- return {
15450
- lineCounter: options.lineCounter || prettyErrors && new lineCounter.LineCounter() || null,
15451
- prettyErrors
15452
- };
15453
- }
15454
- /**
15455
- * Parse the input as a stream of YAML documents.
15456
- *
15457
- * Documents should be separated from each other by `...` or `---` marker lines.
15458
- *
15459
- * @returns If an empty `docs` array is returned, it will be of type
15460
- * EmptyStream and contain additional stream information. In
15461
- * TypeScript, you should use `'empty' in docs` as a type guard for it.
15462
- */
15463
- function parseAllDocuments(source, options = {}) {
15464
- const { lineCounter, prettyErrors } = parseOptions(options);
15465
- const parser$1 = new parser.Parser(lineCounter?.addNewLine);
15466
- const composer$1 = new composer.Composer(options);
15467
- const docs = Array.from(composer$1.compose(parser$1.parse(source)));
15468
- if (prettyErrors && lineCounter) for (const doc of docs) {
15469
- doc.errors.forEach(errors.prettifyError(source, lineCounter));
15470
- doc.warnings.forEach(errors.prettifyError(source, lineCounter));
15471
- }
15472
- if (docs.length > 0) return docs;
15473
- return Object.assign([], { empty: true }, composer$1.streamInfo());
15474
- }
15475
- /** Parse an input string into a single YAML.Document */
15476
- function parseDocument(source, options = {}) {
15477
- const { lineCounter, prettyErrors } = parseOptions(options);
15478
- const parser$1 = new parser.Parser(lineCounter?.addNewLine);
15479
- const composer$1 = new composer.Composer(options);
15480
- let doc = null;
15481
- for (const _doc of composer$1.compose(parser$1.parse(source), true, source.length)) if (!doc) doc = _doc;
15482
- else if (doc.options.logLevel !== "silent") {
15483
- doc.errors.push(new errors.YAMLParseError(_doc.range.slice(0, 2), "MULTIPLE_DOCS", "Source contains multiple documents; please use YAML.parseAllDocuments()"));
15484
- break;
15485
- }
15486
- if (prettyErrors && lineCounter) {
15487
- doc.errors.forEach(errors.prettifyError(source, lineCounter));
15488
- doc.warnings.forEach(errors.prettifyError(source, lineCounter));
15489
- }
15490
- return doc;
15491
- }
15492
- function parse(src, reviver, options) {
15493
- let _reviver = void 0;
15494
- if (typeof reviver === "function") _reviver = reviver;
15495
- else if (options === void 0 && reviver && typeof reviver === "object") options = reviver;
15496
- const doc = parseDocument(src, options);
15497
- if (!doc) return null;
15498
- doc.warnings.forEach((warning) => log.warn(doc.options.logLevel, warning));
15499
- if (doc.errors.length > 0) {
15500
- if (doc.options.logLevel !== "silent") throw doc.errors[0];
15501
- else doc.errors = [];
15502
- }
15503
- return doc.toJS(Object.assign({ reviver: _reviver }, options));
15504
- }
15505
- function stringify(value, replacer, options) {
15506
- let _replacer = null;
15507
- if (typeof replacer === "function" || Array.isArray(replacer)) _replacer = replacer;
15508
- else if (options === void 0 && replacer) options = replacer;
15509
- if (typeof options === "string") options = options.length;
15510
- if (typeof options === "number") {
15511
- const indent = Math.round(options);
15512
- options = indent < 1 ? void 0 : indent > 8 ? { indent: 8 } : { indent };
15513
- }
15514
- if (value === void 0) {
15515
- const { keepUndefined } = options ?? replacer ?? {};
15516
- if (!keepUndefined) return void 0;
15517
- }
15518
- if (identity.isDocument(value) && !_replacer) return value.toString(options);
15519
- return new Document.Document(value, _replacer, options).toString(options);
15520
- }
15521
- exports.parse = parse;
15522
- exports.parseAllDocuments = parseAllDocuments;
15523
- exports.parseDocument = parseDocument;
15524
- exports.stringify = stringify;
15525
- }));
15526
- (/* @__PURE__ */ __commonJSMin(((exports) => {
15527
- var composer = require_composer();
15528
- var Document = require_Document();
15529
- var Schema = require_Schema();
15530
- var errors = require_errors();
15531
- var Alias = require_Alias();
15532
- var identity = require_identity();
15533
- var Pair = require_Pair();
15534
- var Scalar = require_Scalar();
15535
- var YAMLMap = require_YAMLMap();
15536
- var YAMLSeq = require_YAMLSeq();
15537
- require_cst();
15538
- var lexer = require_lexer();
15539
- var lineCounter = require_line_counter();
15540
- var parser = require_parser();
15541
- var publicApi = require_public_api();
15542
- var visit = require_visit();
15543
- exports.Composer = composer.Composer;
15544
- exports.Document = Document.Document;
15545
- exports.Schema = Schema.Schema;
15546
- exports.YAMLError = errors.YAMLError;
15547
- exports.YAMLParseError = errors.YAMLParseError;
15548
- exports.YAMLWarning = errors.YAMLWarning;
15549
- exports.Alias = Alias.Alias;
15550
- exports.isAlias = identity.isAlias;
15551
- exports.isCollection = identity.isCollection;
15552
- exports.isDocument = identity.isDocument;
15553
- exports.isMap = identity.isMap;
15554
- exports.isNode = identity.isNode;
15555
- exports.isPair = identity.isPair;
15556
- exports.isScalar = identity.isScalar;
15557
- exports.isSeq = identity.isSeq;
15558
- exports.Pair = Pair.Pair;
15559
- exports.Scalar = Scalar.Scalar;
15560
- exports.YAMLMap = YAMLMap.YAMLMap;
15561
- exports.YAMLSeq = YAMLSeq.YAMLSeq;
15562
- exports.Lexer = lexer.Lexer;
15563
- exports.LineCounter = lineCounter.LineCounter;
15564
- exports.Parser = parser.Parser;
15565
- exports.parse = publicApi.parse;
15566
- exports.parseAllDocuments = publicApi.parseAllDocuments;
15567
- exports.parseDocument = publicApi.parseDocument;
15568
- exports.stringify = publicApi.stringify;
15569
- exports.visit = visit.visit;
15570
- exports.visitAsync = visit.visitAsync;
15571
- })))();
15572
- function resolveHarnessEnvironment(environment = {}) {
15573
- return {
15574
- env: environment.env ?? process.env,
15575
- homedir: environment.homedir ?? homedir(),
15576
- cwd: environment.cwd ?? process.cwd(),
15577
- platform: environment.platform ?? process.platform
15578
- };
15579
- }
15580
- /**
15581
- * Where a harness keeps plugins at the user level. Paths are computed, not checked: a location may
15582
- * not exist until the first plugin is installed.
15583
- */
15584
- function pluginStorage(harness, environment = {}) {
15585
- return storages[harness](resolveHarnessEnvironment(environment));
15586
- }
15587
- /** `$XDG_CONFIG_HOME`, else `~/.config`, as the `xdg-basedir` package resolves it. */
15588
- const xdgConfig = ({ env, homedir }) => env.XDG_CONFIG_HOME || join(homedir, ".config");
15589
- /** The agent plugin folder of the stable VS Code build, per OS (E-VSC-P3). */
15590
- function vscodeAgentPlugins({ env, homedir, platform }) {
15591
- if (platform === "win32") {
15592
- const configDir = win32.join(env.APPDATA || win32.join(homedir, "AppData", "Roaming"), "Code");
15593
- return {
15594
- configDir,
15595
- path: win32.join(configDir, "agentPlugins")
15596
- };
15597
- }
15598
- const configDir = platform === "darwin" ? join(homedir, "Library", "Application Support", "Code") : join(homedir, ".config", "Code");
15599
- return {
15600
- configDir,
15601
- path: join(configDir, "agentPlugins")
15602
- };
15603
- }
15604
- const storages = {
15605
- "claude-code": ({ env, homedir }) => {
15606
- const configDir = env.CLAUDE_CONFIG_DIR || join(homedir, ".claude");
15607
- const plugins = join(configDir, "plugins");
15608
- return {
15609
- harness: "claude-code",
15610
- configDir,
15611
- locations: [
15612
- {
15613
- kind: "plugin-cache",
15614
- path: join(plugins, "cache"),
15615
- description: "Installed plugins as <marketplace>/<plugin>/<version>/",
15616
- research: "E-CC-P1"
15617
- },
15618
- {
15619
- kind: "marketplaces",
15620
- path: join(plugins, "marketplaces"),
15621
- description: "Marketplace checkouts",
15622
- research: "E-CC-P1"
15623
- },
15624
- {
15625
- kind: "install-record",
15626
- path: join(plugins, "installed_plugins.json"),
15627
- description: "Installs keyed by plugin@marketplace, each with scope, installPath, and version",
15628
- research: "E-CC-P2"
15629
- },
15630
- {
15631
- kind: "enabled-record",
15632
- path: join(configDir, "settings.json"),
15633
- description: "User settings; enabledPlugins maps plugin@marketplace to a boolean",
15634
- research: "E-CC-P3"
15552
+ top = this.peek(1);
15553
+ } while (top?.type === "flow-collection");
15554
+ } else if (fc.end.length === 0) {
15555
+ switch (this.type) {
15556
+ case "comma":
15557
+ case "explicit-key-ind":
15558
+ if (!it || it.sep) fc.items.push({ start: [this.sourceToken] });
15559
+ else it.start.push(this.sourceToken);
15560
+ return;
15561
+ case "map-value-ind":
15562
+ if (!it || it.value) fc.items.push({
15563
+ start: [],
15564
+ key: null,
15565
+ sep: [this.sourceToken]
15566
+ });
15567
+ else if (it.sep) it.sep.push(this.sourceToken);
15568
+ else Object.assign(it, {
15569
+ key: null,
15570
+ sep: [this.sourceToken]
15571
+ });
15572
+ return;
15573
+ case "space":
15574
+ case "comment":
15575
+ case "newline":
15576
+ case "anchor":
15577
+ case "tag":
15578
+ if (!it || it.value) fc.items.push({ start: [this.sourceToken] });
15579
+ else if (it.sep) it.sep.push(this.sourceToken);
15580
+ else it.start.push(this.sourceToken);
15581
+ return;
15582
+ case "alias":
15583
+ case "scalar":
15584
+ case "single-quoted-scalar":
15585
+ case "double-quoted-scalar": {
15586
+ const fs = this.flowScalar(this.type);
15587
+ if (!it || it.value) fc.items.push({
15588
+ start: [],
15589
+ key: fs,
15590
+ sep: []
15591
+ });
15592
+ else if (it.sep) this.stack.push(fs);
15593
+ else Object.assign(it, {
15594
+ key: fs,
15595
+ sep: []
15596
+ });
15597
+ return;
15598
+ }
15599
+ case "flow-map-end":
15600
+ case "flow-seq-end":
15601
+ fc.end.push(this.sourceToken);
15602
+ return;
15635
15603
  }
15636
- ]
15637
- };
15638
- },
15639
- cursor: ({ homedir }) => {
15640
- const configDir = join(homedir, ".cursor");
15641
- return {
15642
- harness: "cursor",
15643
- configDir,
15644
- locations: [{
15645
- kind: "local-plugins",
15646
- path: join(configDir, "plugins", "local"),
15647
- description: "Plugins under development, one folder each",
15648
- research: "E-CUR-P2"
15649
- }, {
15650
- kind: "marketplaces",
15651
- path: join(configDir, "plugins", "marketplaces"),
15652
- description: "Marketplace checkouts",
15653
- research: "E-CUR-P3"
15654
- }]
15655
- };
15656
- },
15657
- codex: ({ env, homedir }) => {
15658
- const configDir = env.CODEX_HOME || join(homedir, ".codex");
15659
- return {
15660
- harness: "codex",
15661
- configDir,
15662
- locations: [{
15663
- kind: "plugin-cache",
15664
- path: join(configDir, "plugins", "cache"),
15665
- description: "Installed plugins as <marketplace>/<plugin>/<version>/",
15666
- research: "E-CODEX-P3"
15667
- }, {
15668
- kind: "enabled-record",
15669
- path: join(configDir, "config.toml"),
15670
- description: "User config; [plugins.\"<plugin>@<marketplace>\"] tables carry enabled = <bool>",
15671
- research: "E-CODEX-P2"
15672
- }]
15673
- };
15674
- },
15675
- "copilot-cli": ({ env, homedir }) => {
15676
- const configDir = env.COPILOT_HOME || join(homedir, ".copilot");
15677
- return {
15678
- harness: "copilot-cli",
15679
- configDir,
15680
- locations: [
15681
- {
15682
- kind: "installed-plugins",
15683
- path: join(configDir, "installed-plugins"),
15684
- description: "Installed plugins as <marketplace>/<plugin>/, or _direct/<source-id>/ for direct installs",
15685
- research: "E-COPILOT-P9"
15686
- },
15687
- {
15688
- kind: "install-record",
15689
- path: join(configDir, "config.json"),
15690
- description: "Application state, including installedPlugins",
15691
- research: "E-COPILOT-P9"
15692
- },
15693
- {
15694
- kind: "enabled-record",
15695
- path: join(configDir, "settings.json"),
15696
- description: "User settings (JSON with comments); enabledPlugins maps plugin specs to a boolean",
15697
- research: "E-COPILOT-P4"
15604
+ const bv = this.startBlockValue(fc);
15605
+ /* istanbul ignore else should not happen */
15606
+ if (bv) this.stack.push(bv);
15607
+ else {
15608
+ yield* this.pop();
15609
+ yield* this.step();
15698
15610
  }
15699
- ]
15700
- };
15701
- },
15702
- opencode: (environment) => {
15703
- const configDir = join(xdgConfig(environment), "opencode");
15704
- return {
15705
- harness: "opencode",
15706
- configDir,
15707
- locations: [{
15708
- kind: "local-plugins",
15709
- path: join(configDir, "plugins"),
15710
- description: "JS/TS plugin modules loaded at startup; npm plugins are named in the plugin config array",
15711
- research: "E-OC-P2"
15712
- }]
15713
- };
15714
- },
15715
- kilo: (environment) => {
15716
- const configDir = join(xdgConfig(environment), "kilo");
15717
- return {
15718
- harness: "kilo",
15719
- configDir,
15720
- locations: [{
15721
- kind: "local-plugins",
15722
- path: join(configDir, "plugin"),
15723
- description: "JS/TS plugin modules loaded at startup; npm plugins are named in the plugin config array",
15724
- research: "E-KILO-P2"
15725
- }]
15726
- };
15727
- },
15728
- "gemini-cli": ({ env, homedir }) => {
15729
- const configDir = join(env.GEMINI_CLI_HOME || homedir, ".gemini");
15730
- const extensions = join(configDir, "extensions");
15731
- return {
15732
- harness: "gemini-cli",
15733
- configDir,
15734
- locations: [{
15735
- kind: "installed-plugins",
15736
- path: extensions,
15737
- description: "Installed extensions, one folder each with a gemini-extension.json manifest",
15738
- research: "E-GEM-P1"
15739
- }, {
15740
- kind: "enabled-record",
15741
- path: join(extensions, "extension-enablement.json"),
15742
- description: "Per-extension path-glob overrides that enable or disable it by folder, not a boolean",
15743
- research: "E-GEM-P3"
15744
- }]
15745
- };
15746
- },
15747
- "qwen-code": ({ env, homedir }) => {
15748
- const configDir = env.QWEN_HOME || join(homedir, ".qwen");
15749
- const extensions = join(configDir, "extensions");
15750
- return {
15751
- harness: "qwen-code",
15752
- configDir,
15753
- locations: [{
15754
- kind: "installed-plugins",
15755
- path: extensions,
15756
- description: "Installed extensions, one folder each with a qwen-extension.json manifest",
15757
- research: "E-QWEN-P1"
15758
- }, {
15759
- kind: "enabled-record",
15760
- path: join(extensions, "extension-enablement.json"),
15761
- description: "Extension enable/disable state, inherited from Gemini CLI's format",
15762
- research: "E-QWEN-P2"
15763
- }]
15764
- };
15765
- },
15766
- "vscode-copilot": (environment) => {
15767
- const { configDir, path } = vscodeAgentPlugins(environment);
15768
- return {
15769
- harness: "vscode-copilot",
15770
- configDir,
15771
- locations: [{
15772
- kind: "installed-plugins",
15773
- path,
15774
- description: "Installed agent plugins as <host>/<org>/<repo>/",
15775
- research: "E-VSC-P3"
15776
- }]
15777
- };
15778
- },
15779
- cline: ({ homedir }) => {
15780
- const configDir = join(homedir, ".cline");
15781
- return {
15782
- harness: "cline",
15783
- configDir,
15784
- locations: [{
15785
- kind: "installed-plugins",
15786
- path: join(configDir, "plugins", "_installed"),
15787
- description: "Installed plugins, grouped by source: npm, git, remote, or local",
15788
- research: "E-CLINE-P3"
15789
- }]
15790
- };
15791
- },
15792
- crush: ({ env, homedir }) => {
15793
- return {
15794
- harness: "crush",
15795
- configDir: env.CRUSH_GLOBAL_CONFIG || join(env.XDG_CONFIG_HOME || join(homedir, ".config"), "crush"),
15796
- locations: []
15797
- };
15798
- },
15799
- openhands: ({ env, homedir }) => {
15800
- const configDir = env.OH_PERSISTENCE_DIR || env.OPENHANDS_PERSISTENCE_DIR || join(homedir, ".openhands");
15801
- const installed = join(configDir, "plugins", "installed");
15802
- return {
15803
- harness: "openhands",
15804
- configDir,
15805
- locations: [{
15806
- kind: "installed-plugins",
15807
- path: installed,
15808
- description: "Installed plugins, one folder each",
15809
- research: "E-OH-P3"
15810
- }, {
15811
- kind: "enabled-record",
15812
- path: join(installed, ".installed.json"),
15813
- description: "Install metadata keyed by plugin name, each with enabled: <bool>",
15814
- research: "E-OH-P4"
15815
- }]
15816
- };
15817
- },
15818
- augment: ({ homedir }) => {
15819
- const configDir = join(homedir, ".augment");
15611
+ } else {
15612
+ const parent = this.peek(2);
15613
+ if (parent.type === "block-map" && (this.type === "map-value-ind" && parent.indent === fc.indent || this.type === "newline" && !parent.items[parent.items.length - 1].sep)) {
15614
+ yield* this.pop();
15615
+ yield* this.step();
15616
+ } else if (this.type === "map-value-ind" && parent.type !== "flow-collection") {
15617
+ const start = getFirstKeyStartProps(getPrevProps(parent));
15618
+ fixFlowSeqItems(fc);
15619
+ const sep = fc.end.splice(1, fc.end.length);
15620
+ sep.push(this.sourceToken);
15621
+ const map = {
15622
+ type: "block-map",
15623
+ offset: fc.offset,
15624
+ indent: fc.indent,
15625
+ items: [{
15626
+ start,
15627
+ key: fc,
15628
+ sep
15629
+ }]
15630
+ };
15631
+ this.onKeyLine = true;
15632
+ this.stack[this.stack.length - 1] = map;
15633
+ } else yield* this.lineEnd(fc);
15634
+ }
15635
+ }
15636
+ flowScalar(type) {
15637
+ if (this.onNewLine) {
15638
+ let nl = this.source.indexOf("\n") + 1;
15639
+ while (nl !== 0) {
15640
+ this.onNewLine(this.offset + nl);
15641
+ nl = this.source.indexOf("\n", nl) + 1;
15642
+ }
15643
+ }
15644
+ return {
15645
+ type,
15646
+ offset: this.offset,
15647
+ indent: this.indent,
15648
+ source: this.source
15649
+ };
15650
+ }
15651
+ startBlockValue(parent) {
15652
+ switch (this.type) {
15653
+ case "alias":
15654
+ case "scalar":
15655
+ case "single-quoted-scalar":
15656
+ case "double-quoted-scalar": return this.flowScalar(this.type);
15657
+ case "block-scalar-header": return {
15658
+ type: "block-scalar",
15659
+ offset: this.offset,
15660
+ indent: this.indent,
15661
+ props: [this.sourceToken],
15662
+ source: ""
15663
+ };
15664
+ case "flow-map-start":
15665
+ case "flow-seq-start": return {
15666
+ type: "flow-collection",
15667
+ offset: this.offset,
15668
+ indent: this.indent,
15669
+ start: this.sourceToken,
15670
+ items: [],
15671
+ end: []
15672
+ };
15673
+ case "seq-item-ind": return {
15674
+ type: "block-seq",
15675
+ offset: this.offset,
15676
+ indent: this.indent,
15677
+ items: [{ start: [this.sourceToken] }]
15678
+ };
15679
+ case "explicit-key-ind": {
15680
+ this.onKeyLine = true;
15681
+ const start = getFirstKeyStartProps(getPrevProps(parent));
15682
+ start.push(this.sourceToken);
15683
+ return {
15684
+ type: "block-map",
15685
+ offset: this.offset,
15686
+ indent: this.indent,
15687
+ items: [{
15688
+ start,
15689
+ explicitKey: true
15690
+ }]
15691
+ };
15692
+ }
15693
+ case "map-value-ind": {
15694
+ this.onKeyLine = true;
15695
+ const start = getFirstKeyStartProps(getPrevProps(parent));
15696
+ return {
15697
+ type: "block-map",
15698
+ offset: this.offset,
15699
+ indent: this.indent,
15700
+ items: [{
15701
+ start,
15702
+ key: null,
15703
+ sep: [this.sourceToken]
15704
+ }]
15705
+ };
15706
+ }
15707
+ }
15708
+ return null;
15709
+ }
15710
+ atIndentedComment(start, indent) {
15711
+ if (this.type !== "comment") return false;
15712
+ if (this.indent <= indent) return false;
15713
+ return start.every((st) => st.type === "newline" || st.type === "space");
15714
+ }
15715
+ *documentEnd(docEnd) {
15716
+ if (this.type !== "doc-mode") {
15717
+ if (docEnd.end) docEnd.end.push(this.sourceToken);
15718
+ else docEnd.end = [this.sourceToken];
15719
+ if (this.type === "newline") yield* this.pop();
15720
+ }
15721
+ }
15722
+ *lineEnd(token) {
15723
+ switch (this.type) {
15724
+ case "comma":
15725
+ case "doc-start":
15726
+ case "doc-end":
15727
+ case "flow-seq-end":
15728
+ case "flow-map-end":
15729
+ case "map-value-ind":
15730
+ yield* this.pop();
15731
+ yield* this.step();
15732
+ break;
15733
+ case "newline": this.onKeyLine = false;
15734
+ default:
15735
+ if (token.end) token.end.push(this.sourceToken);
15736
+ else token.end = [this.sourceToken];
15737
+ if (this.type === "newline") yield* this.pop();
15738
+ }
15739
+ }
15740
+ };
15741
+ exports.Parser = Parser;
15742
+ }));
15743
+ var require_public_api = /* @__PURE__ */ __commonJSMin(((exports) => {
15744
+ var composer = require_composer();
15745
+ var Document = require_Document();
15746
+ var errors = require_errors();
15747
+ var log = require_log();
15748
+ var identity = require_identity();
15749
+ var lineCounter = require_line_counter();
15750
+ var parser = require_parser();
15751
+ function parseOptions(options) {
15752
+ const prettyErrors = options.prettyErrors !== false;
15820
15753
  return {
15821
- harness: "augment",
15822
- configDir,
15823
- locations: [{
15824
- kind: "marketplaces",
15825
- path: join(configDir, "plugins", "marketplaces"),
15826
- description: "Marketplace checkouts",
15827
- research: "E-AUG-P2"
15828
- }, {
15829
- kind: "enabled-record",
15830
- path: join(configDir, "settings.json"),
15831
- description: "User settings; enabledPlugins maps plugin@marketplace to a boolean",
15832
- research: "E-AUG-P4"
15833
- }]
15754
+ lineCounter: options.lineCounter || prettyErrors && new lineCounter.LineCounter() || null,
15755
+ prettyErrors
15834
15756
  };
15835
15757
  }
15836
- };
15758
+ /**
15759
+ * Parse the input as a stream of YAML documents.
15760
+ *
15761
+ * Documents should be separated from each other by `...` or `---` marker lines.
15762
+ *
15763
+ * @returns If an empty `docs` array is returned, it will be of type
15764
+ * EmptyStream and contain additional stream information. In
15765
+ * TypeScript, you should use `'empty' in docs` as a type guard for it.
15766
+ */
15767
+ function parseAllDocuments(source, options = {}) {
15768
+ const { lineCounter, prettyErrors } = parseOptions(options);
15769
+ const parser$1 = new parser.Parser(lineCounter?.addNewLine);
15770
+ const composer$1 = new composer.Composer(options);
15771
+ const docs = Array.from(composer$1.compose(parser$1.parse(source)));
15772
+ if (prettyErrors && lineCounter) for (const doc of docs) {
15773
+ doc.errors.forEach(errors.prettifyError(source, lineCounter));
15774
+ doc.warnings.forEach(errors.prettifyError(source, lineCounter));
15775
+ }
15776
+ if (docs.length > 0) return docs;
15777
+ return Object.assign([], { empty: true }, composer$1.streamInfo());
15778
+ }
15779
+ /** Parse an input string into a single YAML.Document */
15780
+ function parseDocument(source, options = {}) {
15781
+ const { lineCounter, prettyErrors } = parseOptions(options);
15782
+ const parser$1 = new parser.Parser(lineCounter?.addNewLine);
15783
+ const composer$1 = new composer.Composer(options);
15784
+ let doc = null;
15785
+ for (const _doc of composer$1.compose(parser$1.parse(source), true, source.length)) if (!doc) doc = _doc;
15786
+ else if (doc.options.logLevel !== "silent") {
15787
+ doc.errors.push(new errors.YAMLParseError(_doc.range.slice(0, 2), "MULTIPLE_DOCS", "Source contains multiple documents; please use YAML.parseAllDocuments()"));
15788
+ break;
15789
+ }
15790
+ if (prettyErrors && lineCounter) {
15791
+ doc.errors.forEach(errors.prettifyError(source, lineCounter));
15792
+ doc.warnings.forEach(errors.prettifyError(source, lineCounter));
15793
+ }
15794
+ return doc;
15795
+ }
15796
+ function parse(src, reviver, options) {
15797
+ let _reviver = void 0;
15798
+ if (typeof reviver === "function") _reviver = reviver;
15799
+ else if (options === void 0 && reviver && typeof reviver === "object") options = reviver;
15800
+ const doc = parseDocument(src, options);
15801
+ if (!doc) return null;
15802
+ doc.warnings.forEach((warning) => log.warn(doc.options.logLevel, warning));
15803
+ if (doc.errors.length > 0) {
15804
+ if (doc.options.logLevel !== "silent") throw doc.errors[0];
15805
+ else doc.errors = [];
15806
+ }
15807
+ return doc.toJS(Object.assign({ reviver: _reviver }, options));
15808
+ }
15809
+ function stringify(value, replacer, options) {
15810
+ let _replacer = null;
15811
+ if (typeof replacer === "function" || Array.isArray(replacer)) _replacer = replacer;
15812
+ else if (options === void 0 && replacer) options = replacer;
15813
+ if (typeof options === "string") options = options.length;
15814
+ if (typeof options === "number") {
15815
+ const indent = Math.round(options);
15816
+ options = indent < 1 ? void 0 : indent > 8 ? { indent: 8 } : { indent };
15817
+ }
15818
+ if (value === void 0) {
15819
+ const { keepUndefined } = options ?? replacer ?? {};
15820
+ if (!keepUndefined) return void 0;
15821
+ }
15822
+ if (identity.isDocument(value) && !_replacer) return value.toString(options);
15823
+ return new Document.Document(value, _replacer, options).toString(options);
15824
+ }
15825
+ exports.parse = parse;
15826
+ exports.parseAllDocuments = parseAllDocuments;
15827
+ exports.parseDocument = parseDocument;
15828
+ exports.stringify = stringify;
15829
+ }));
15830
+ (/* @__PURE__ */ __commonJSMin(((exports) => {
15831
+ var composer = require_composer();
15832
+ var Document = require_Document();
15833
+ var Schema = require_Schema();
15834
+ var errors = require_errors();
15835
+ var Alias = require_Alias();
15836
+ var identity = require_identity();
15837
+ var Pair = require_Pair();
15838
+ var Scalar = require_Scalar();
15839
+ var YAMLMap = require_YAMLMap();
15840
+ var YAMLSeq = require_YAMLSeq();
15841
+ require_cst();
15842
+ var lexer = require_lexer();
15843
+ var lineCounter = require_line_counter();
15844
+ var parser = require_parser();
15845
+ var publicApi = require_public_api();
15846
+ var visit = require_visit();
15847
+ exports.Composer = composer.Composer;
15848
+ exports.Document = Document.Document;
15849
+ exports.Schema = Schema.Schema;
15850
+ exports.YAMLError = errors.YAMLError;
15851
+ exports.YAMLParseError = errors.YAMLParseError;
15852
+ exports.YAMLWarning = errors.YAMLWarning;
15853
+ exports.Alias = Alias.Alias;
15854
+ exports.isAlias = identity.isAlias;
15855
+ exports.isCollection = identity.isCollection;
15856
+ exports.isDocument = identity.isDocument;
15857
+ exports.isMap = identity.isMap;
15858
+ exports.isNode = identity.isNode;
15859
+ exports.isPair = identity.isPair;
15860
+ exports.isScalar = identity.isScalar;
15861
+ exports.isSeq = identity.isSeq;
15862
+ exports.Pair = Pair.Pair;
15863
+ exports.Scalar = Scalar.Scalar;
15864
+ exports.YAMLMap = YAMLMap.YAMLMap;
15865
+ exports.YAMLSeq = YAMLSeq.YAMLSeq;
15866
+ exports.Lexer = lexer.Lexer;
15867
+ exports.LineCounter = lineCounter.LineCounter;
15868
+ exports.Parser = parser.Parser;
15869
+ exports.parse = publicApi.parse;
15870
+ exports.parseAllDocuments = publicApi.parseAllDocuments;
15871
+ exports.parseDocument = publicApi.parseDocument;
15872
+ exports.stringify = publicApi.stringify;
15873
+ exports.visit = visit.visit;
15874
+ exports.visitAsync = visit.visitAsync;
15875
+ })))();
15837
15876
  //#endregion
15838
- //#region ../../node_modules/.pnpm/@cyberuni+agent-harness@0.6.0_typescript@6.0.3/node_modules/@cyberuni/agent-harness/dist/index.js
15877
+ //#region ../../node_modules/.pnpm/@cyberuni+agent-harness@0.7.0/node_modules/@cyberuni/agent-harness/dist/index.js
15839
15878
  const harnessIds = [
15840
15879
  "claude-code",
15841
15880
  "cursor",