@savvy-web/silk 3.4.0 → 3.4.2

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.
@@ -2334,7 +2334,7 @@ var GlobSet = class GlobSet extends effect.Schema.Class("GlobSet")(effect.Schema
2334
2334
  }
2335
2335
  };
2336
2336
  //#endregion
2337
- //#region ../../node_modules/.pnpm/@effected+lockfiles@0.3.1_@effected+jsonc@0.5.2_effect@4.0.0-beta.101__@effected+npm@0._76c3c4c2d3d6f22fa84df3beea811625/node_modules/@effected/lockfiles/BunExtension.js
2337
+ //#region ../../node_modules/.pnpm/@effected+lockfiles@0.3.2_@effected+jsonc@0.5.2_effect@4.0.0-beta.101__@effected+npm@0._3c1784fba62fde9a5bac4cf15387fd04/node_modules/@effected/lockfiles/BunExtension.js
2338
2338
  /**
2339
2339
  * Extension data specific to bun lockfiles, attached to `Lockfile.extension`
2340
2340
  * when the format is `"bun"`.
@@ -2355,7 +2355,7 @@ var BunExtension = class extends effect.Schema.Class("BunExtension")({
2355
2355
  trustedDependencies: effect.Schema.optionalKey(effect.Schema.Array(effect.Schema.String))
2356
2356
  }) {};
2357
2357
  //#endregion
2358
- //#region ../../node_modules/.pnpm/@effected+npm@0.8.1_@effected+semver@0.3.1_effect@4.0.0-beta.101__effect@4.0.0-beta.101/node_modules/@effected/npm/CatalogResolver.js
2358
+ //#region ../../node_modules/.pnpm/@effected+npm@0.8.3_@effected+semver@0.3.2_effect@4.0.0-beta.101__effect@4.0.0-beta.101/node_modules/@effected/npm/CatalogResolver.js
2359
2359
  /**
2360
2360
  * Contract for resolving pnpm `catalog:` dependency specifiers to concrete
2361
2361
  * version ranges.
@@ -2391,7 +2391,7 @@ var BunExtension = class extends effect.Schema.Class("BunExtension")({
2391
2391
  *
2392
2392
  * @public
2393
2393
  */
2394
- var CatalogResolver = class CatalogResolver extends effect.Context.Service()("@effected/npm/CatalogResolver") {
2394
+ var CatalogResolver$1 = class CatalogResolver extends effect.Context.Service()("@effected/npm/CatalogResolver") {
2395
2395
  /**
2396
2396
  * No-op default: `rangeOf` always succeeds with `Option.none()`, never
2397
2397
  * consulting an actual catalog. A pure `Layer.succeed`, bound to a const
@@ -2401,7 +2401,7 @@ var CatalogResolver = class CatalogResolver extends effect.Context.Service()("@e
2401
2401
  static noop = effect.Layer.succeed(CatalogResolver, { rangeOf: () => effect.Effect.succeed(effect.Option.none()) });
2402
2402
  };
2403
2403
  //#endregion
2404
- //#region ../../node_modules/.pnpm/@effected+npm@0.8.1_@effected+semver@0.3.1_effect@4.0.0-beta.101__effect@4.0.0-beta.101/node_modules/@effected/npm/WorkspaceResolver.js
2404
+ //#region ../../node_modules/.pnpm/@effected+npm@0.8.3_@effected+semver@0.3.2_effect@4.0.0-beta.101__effect@4.0.0-beta.101/node_modules/@effected/npm/WorkspaceResolver.js
2405
2405
  /**
2406
2406
  * Raised when a `catalog:` or `workspace:` specifier cannot be resolved
2407
2407
  * because the resolution mechanism itself failed — not for an ordinary
@@ -2415,7 +2415,7 @@ var CatalogResolver = class CatalogResolver extends effect.Context.Service()("@e
2415
2415
  *
2416
2416
  * @public
2417
2417
  */
2418
- var DependencyResolutionError = class extends effect.Schema.TaggedErrorClass()("DependencyResolutionError", {
2418
+ var DependencyResolutionError$1 = class extends effect.Schema.TaggedErrorClass()("DependencyResolutionError", {
2419
2419
  specifier: effect.Schema.String,
2420
2420
  cause: effect.Schema.Defect()
2421
2421
  }) {
@@ -2453,7 +2453,7 @@ var DependencyResolutionError = class extends effect.Schema.TaggedErrorClass()("
2453
2453
  *
2454
2454
  * @public
2455
2455
  */
2456
- var WorkspaceResolver = class WorkspaceResolver extends effect.Context.Service()("@effected/npm/WorkspaceResolver") {
2456
+ var WorkspaceResolver$1 = class WorkspaceResolver extends effect.Context.Service()("@effected/npm/WorkspaceResolver") {
2457
2457
  /**
2458
2458
  * No-op default: `versionOf` always succeeds with `Option.none()`, never
2459
2459
  * consulting an actual workspace. A pure `Layer.succeed`, bound to a
@@ -2462,7 +2462,7 @@ var WorkspaceResolver = class WorkspaceResolver extends effect.Context.Service()
2462
2462
  static noop = effect.Layer.succeed(WorkspaceResolver, { versionOf: () => effect.Effect.succeed(effect.Option.none()) });
2463
2463
  };
2464
2464
  //#endregion
2465
- //#region ../../node_modules/.pnpm/@effected+npm@0.8.1_@effected+semver@0.3.1_effect@4.0.0-beta.101__effect@4.0.0-beta.101/node_modules/@effected/npm/CatalogAssemblyError.js
2465
+ //#region ../../node_modules/.pnpm/@effected+npm@0.8.3_@effected+semver@0.3.2_effect@4.0.0-beta.101__effect@4.0.0-beta.101/node_modules/@effected/npm/CatalogAssemblyError.js
2466
2466
  /**
2467
2467
  * Raised when a workspace's catalogs cannot be assembled — a `pnpm-workspace.yaml`
2468
2468
  * that is unreadable or not valid YAML, a root `package.json` `workspaces` field
@@ -2505,15 +2505,7 @@ var CatalogAssemblyError = class extends effect.Schema.TaggedErrorClass()("Catal
2505
2505
  return `Failed to assemble catalogs from ${this.source} ${this.path}`;
2506
2506
  }
2507
2507
  };
2508
- //#endregion
2509
- //#region ../../node_modules/.pnpm/@effected+npm@0.8.1_@effected+semver@0.3.1_effect@4.0.0-beta.101__effect@4.0.0-beta.101/node_modules/@effected/npm/DependencySection.js
2510
- /**
2511
- * The short dependency kind: which dependency map an entry came from, named the
2512
- * way consumers branch on it.
2513
- *
2514
- * @public
2515
- */
2516
- const DependencyKind = effect.Schema.Literals([
2508
+ effect.Schema.Literals([
2517
2509
  "prod",
2518
2510
  "dev",
2519
2511
  "peer",
@@ -2525,7 +2517,7 @@ const DependencyKind = effect.Schema.Literals([
2525
2517
  *
2526
2518
  * @public
2527
2519
  */
2528
- const DependencyField = effect.Schema.Literals([
2520
+ const DependencyField$1 = effect.Schema.Literals([
2529
2521
  "dependencies",
2530
2522
  "devDependencies",
2531
2523
  "peerDependencies",
@@ -2538,7 +2530,7 @@ Object.fromEntries(Object.entries({
2538
2530
  optional: "optionalDependencies"
2539
2531
  }).map(([kind, field]) => [field, kind]));
2540
2532
  //#endregion
2541
- //#region ../../node_modules/.pnpm/@effected+semver@0.3.1_effect@4.0.0-beta.101/node_modules/@effected/semver/internal/desugar.js
2533
+ //#region ../../node_modules/.pnpm/@effected+semver@0.3.2_effect@4.0.0-beta.101/node_modules/@effected/semver/internal/desugar.js
2542
2534
  const sv = (major, minor, patch, prerelease = [], build = []) => ({
2543
2535
  major,
2544
2536
  minor,
@@ -2627,7 +2619,7 @@ const desugarHyphen = (lower, upper) => {
2627
2619
  return [comp(">=", lowerVersion)];
2628
2620
  };
2629
2621
  //#endregion
2630
- //#region ../../node_modules/.pnpm/@effected+semver@0.3.1_effect@4.0.0-beta.101/node_modules/@effected/semver/internal/grammar.js
2622
+ //#region ../../node_modules/.pnpm/@effected+semver@0.3.2_effect@4.0.0-beta.101/node_modules/@effected/semver/internal/grammar.js
2631
2623
  /** Private control-flow exception; never escapes the entry points. */
2632
2624
  var ParseFailure = class {
2633
2625
  position;
@@ -2912,7 +2904,7 @@ const parseRangeComparators = (s) => {
2912
2904
  * Parse a range expression into comparator sets (OR of ANDs). The empty
2913
2905
  * string parses as the match-all range.
2914
2906
  */
2915
- const parseRange$1 = (raw) => {
2907
+ const parseRange$2 = (raw) => {
2916
2908
  const trimmed = raw.trim();
2917
2909
  if (trimmed.length === 0) return {
2918
2910
  ok: true,
@@ -3027,7 +3019,7 @@ const formatComparator = (c) => {
3027
3019
  /** Print comparator sets as `a b || c d`. */
3028
3020
  const formatRange = (sets) => sets.map((set) => set.map(formatComparator).join(" ")).join(" || ");
3029
3021
  //#endregion
3030
- //#region ../../node_modules/.pnpm/@effected+semver@0.3.1_effect@4.0.0-beta.101/node_modules/@effected/semver/internal/order.js
3022
+ //#region ../../node_modules/.pnpm/@effected+semver@0.3.2_effect@4.0.0-beta.101/node_modules/@effected/semver/internal/order.js
3031
3023
  /**
3032
3024
  * Compare two prerelease identifiers per SemVer 2.0.0 §11: numeric
3033
3025
  * identifiers always have lower precedence than alphanumeric ones; numerics
@@ -3080,7 +3072,7 @@ const compareBuild = (a, b) => {
3080
3072
  return 0;
3081
3073
  };
3082
3074
  //#endregion
3083
- //#region ../../node_modules/.pnpm/@effected+semver@0.3.1_effect@4.0.0-beta.101/node_modules/@effected/semver/SemVer.js
3075
+ //#region ../../node_modules/.pnpm/@effected+semver@0.3.2_effect@4.0.0-beta.101/node_modules/@effected/semver/SemVer.js
3084
3076
  /**
3085
3077
  * Indicates that a string could not be parsed as a valid SemVer 2.0.0 version.
3086
3078
  *
@@ -3591,7 +3583,7 @@ var SemVerBump = class {
3591
3583
  }
3592
3584
  };
3593
3585
  //#endregion
3594
- //#region ../../node_modules/.pnpm/@effected+semver@0.3.1_effect@4.0.0-beta.101/node_modules/@effected/semver/Comparator.js
3586
+ //#region ../../node_modules/.pnpm/@effected+semver@0.3.2_effect@4.0.0-beta.101/node_modules/@effected/semver/Comparator.js
3595
3587
  /**
3596
3588
  * Indicates that a string could not be parsed as a single comparator.
3597
3589
  *
@@ -3725,7 +3717,7 @@ var Comparator = class Comparator extends effect.Schema.Class("Comparator")({
3725
3717
  }
3726
3718
  };
3727
3719
  //#endregion
3728
- //#region ../../node_modules/.pnpm/@effected+semver@0.3.1_effect@4.0.0-beta.101/node_modules/@effected/semver/internal/normalize.js
3720
+ //#region ../../node_modules/.pnpm/@effected+semver@0.3.2_effect@4.0.0-beta.101/node_modules/@effected/semver/internal/normalize.js
3729
3721
  const operatorWeight = (op) => {
3730
3722
  switch (op) {
3731
3723
  case ">=": return 0;
@@ -3756,7 +3748,7 @@ const normalizeComparatorSet = (set) => sortComparators(removeDuplicates(set));
3756
3748
  /** Normalize every comparator set in a range: sort and deduplicate each independently. */
3757
3749
  const normalizeSets = (sets) => sets.map(normalizeComparatorSet);
3758
3750
  //#endregion
3759
- //#region ../../node_modules/.pnpm/@effected+semver@0.3.1_effect@4.0.0-beta.101/node_modules/@effected/semver/Range.js
3751
+ //#region ../../node_modules/.pnpm/@effected+semver@0.3.2_effect@4.0.0-beta.101/node_modules/@effected/semver/Range.js
3760
3752
  /**
3761
3753
  * Indicates that a string could not be parsed as a range expression.
3762
3754
  *
@@ -3811,7 +3803,7 @@ sets: effect.Schema.Array(effect.Schema.Array(Comparator)) }) {
3811
3803
  */
3812
3804
  static FromString = effect.Schema.String.pipe(effect.Schema.decodeTo(Range, effect.SchemaTransformation.transformOrFail({
3813
3805
  decode: (input) => {
3814
- const result = parseRange$1(input);
3806
+ const result = parseRange$2(input);
3815
3807
  return result.ok ? effect.Effect.succeed({ sets: normalizeSets(result.value) }) : effect.Effect.fail(new effect.SchemaIssue.InvalidValue(effect.Option.some(input), { message: `Invalid range expression: "${result.input}" at position ${result.position}` }));
3816
3808
  },
3817
3809
  encode: (parts) => effect.Effect.succeed(formatRange(parts.sets))
@@ -3842,7 +3834,7 @@ sets: effect.Schema.Array(effect.Schema.Array(Comparator)) }) {
3842
3834
  * with {@link InvalidRangeError}.
3843
3835
  */
3844
3836
  static parseResult(input) {
3845
- const result = parseRange$1(input);
3837
+ const result = parseRange$2(input);
3846
3838
  if (!result.ok) return effect.Result.fail(new InvalidRangeError({
3847
3839
  input: result.input,
3848
3840
  position: result.position
@@ -3864,17 +3856,54 @@ sets: effect.Schema.Array(effect.Schema.Array(Comparator)) }) {
3864
3856
  /**
3865
3857
  * Test whether a version satisfies a range; see {@link Range.test} for the
3866
3858
  * prerelease matching rule. Dual API.
3859
+ *
3860
+ * @remarks
3861
+ * **Data-first order is `(version, range)`** — the version being tested
3862
+ * comes first, the range it is tested against second. The data-last form
3863
+ * takes the range: `Range.satisfies(range)` applied to a version.
3864
+ *
3865
+ * Worth stating because the two parameters are distinct classes and the
3866
+ * order is not recoverable from the call site. TypeScript rejects a flipped
3867
+ * call outright, so this only bites callers without type checking — which
3868
+ * includes the untyped `node --input-type=module` probes this repo's own
3869
+ * evidence ladder calls for. There, `Range.satisfies(range, version)`
3870
+ * dispatches data-first, binds the `Range` to `version`, and dies with
3871
+ * `TypeError: range.test is not a function` — a message naming the
3872
+ * parameter that received the *version*, so it reads as a defect inside
3873
+ * this package rather than a caller error.
3874
+ *
3875
+ * The same order and the same hazard apply to `Range.filter`,
3876
+ * {@link Range.maxSatisfying} and {@link Range.minSatisfying}: subject
3877
+ * first, range second.
3867
3878
  */
3868
3879
  static satisfies = effect.Function.dual(2, (version, range) => range.test(version));
3869
- /** Filter versions that satisfy a range, preserving order. Dual API. */
3880
+ /**
3881
+ * Filter versions that satisfy a range, preserving order. Dual API.
3882
+ *
3883
+ * @remarks
3884
+ * Data-first order is `(versions, range)` — see {@link Range.satisfies}
3885
+ * for why the order is spelled out.
3886
+ */
3870
3887
  static filter = effect.Function.dual(2, (versions, range) => range.filter(versions));
3871
- /** Highest satisfying version, or `Option.none()`. Dual API. */
3888
+ /**
3889
+ * Highest satisfying version, or `Option.none()`. Dual API.
3890
+ *
3891
+ * @remarks
3892
+ * Data-first order is `(versions, range)` — see {@link Range.satisfies}
3893
+ * for why the order is spelled out.
3894
+ */
3872
3895
  static maxSatisfying = effect.Function.dual(2, (versions, range) => {
3873
3896
  let best;
3874
3897
  for (const v of versions) if (range.test(v) && (best === void 0 || v.gt(best))) best = v;
3875
3898
  return best === void 0 ? effect.Option.none() : effect.Option.some(best);
3876
3899
  });
3877
- /** Lowest satisfying version, or `Option.none()`. Dual API. */
3900
+ /**
3901
+ * Lowest satisfying version, or `Option.none()`. Dual API.
3902
+ *
3903
+ * @remarks
3904
+ * Data-first order is `(versions, range)` — see {@link Range.satisfies}
3905
+ * for why the order is spelled out.
3906
+ */
3878
3907
  static minSatisfying = effect.Function.dual(2, (versions, range) => {
3879
3908
  let best;
3880
3909
  for (const v of versions) if (range.test(v) && (best === void 0 || v.lt(best))) best = v;
@@ -4084,7 +4113,7 @@ const isComparatorSetSubset = (sub, sup) => {
4084
4113
  return true;
4085
4114
  };
4086
4115
  //#endregion
4087
- //#region ../../node_modules/.pnpm/@effected+npm@0.8.1_@effected+semver@0.3.1_effect@4.0.0-beta.101__effect@4.0.0-beta.101/node_modules/@effected/npm/DependencySpecifier.js
4116
+ //#region ../../node_modules/.pnpm/@effected+npm@0.8.3_@effected+semver@0.3.2_effect@4.0.0-beta.101__effect@4.0.0-beta.101/node_modules/@effected/npm/DependencySpecifier.js
4088
4117
  /**
4089
4118
  * Indicates that a string could not be parsed as a valid dependency specifier.
4090
4119
  *
@@ -4093,50 +4122,50 @@ const isComparatorSetSubset = (sub, sup) => {
4093
4122
  *
4094
4123
  * @public
4095
4124
  */
4096
- var InvalidDependencySpecifierError = class extends effect.Schema.TaggedErrorClass()("InvalidDependencySpecifierError", {
4125
+ var InvalidDependencySpecifierError$1 = class extends effect.Schema.TaggedErrorClass()("InvalidDependencySpecifierError", {
4097
4126
  /** The raw input string that failed validation. */
4098
4127
  input: effect.Schema.String }) {
4099
4128
  get message() {
4100
4129
  return `Invalid dependency specifier "${this.input}": not a recognized specifier`;
4101
4130
  }
4102
4131
  };
4103
- const CATALOG_PREFIX = "catalog:";
4104
- const WORKSPACE_PREFIX = "workspace:";
4105
- const isBarePath = (value) => value.startsWith("./") || value.startsWith("../") || value.startsWith("~/") || value.startsWith("/");
4106
- const isGitHubShorthand = (value) => !value.startsWith(".") && !value.startsWith("~") && !value.startsWith("/") && /^[a-zA-Z0-9_.-]+\/[a-zA-Z0-9_.-]+(#.*)?$/.test(value);
4107
- const isGit = (value) => value.startsWith("git+") || value.startsWith("git://") || value.startsWith("github:") || value.startsWith("gist:") || value.startsWith("bitbucket:") || value.startsWith("gitlab:") || isGitHubShorthand(value);
4108
- const isLocal = (value) => value.startsWith("file:") || value.startsWith("link:") || value.startsWith("portal:") || isBarePath(value);
4109
- const isLink = (value) => value.startsWith("link:");
4110
- const isPortal = (value) => value.startsWith("portal:");
4111
- const isCatalog = (value) => value.startsWith(CATALOG_PREFIX);
4112
- const isWorkspace = (value) => value.startsWith(WORKSPACE_PREFIX);
4113
- const isUrl$1 = (value) => value.startsWith("http://") || value.startsWith("https://");
4114
- const parseRange = (value) => {
4132
+ const CATALOG_PREFIX$1 = "catalog:";
4133
+ const WORKSPACE_PREFIX$1 = "workspace:";
4134
+ const isBarePath$1 = (value) => value.startsWith("./") || value.startsWith("../") || value.startsWith("~/") || value.startsWith("/");
4135
+ const isGitHubShorthand$1 = (value) => !value.startsWith(".") && !value.startsWith("~") && !value.startsWith("/") && /^[a-zA-Z0-9_.-]+\/[a-zA-Z0-9_.-]+(#.*)?$/.test(value);
4136
+ const isGit$1 = (value) => value.startsWith("git+") || value.startsWith("git://") || value.startsWith("github:") || value.startsWith("gist:") || value.startsWith("bitbucket:") || value.startsWith("gitlab:") || isGitHubShorthand$1(value);
4137
+ const isLocal$1 = (value) => value.startsWith("file:") || value.startsWith("link:") || value.startsWith("portal:") || isBarePath$1(value);
4138
+ const isLink$1 = (value) => value.startsWith("link:");
4139
+ const isPortal$1 = (value) => value.startsWith("portal:");
4140
+ const isCatalog$1 = (value) => value.startsWith(CATALOG_PREFIX$1);
4141
+ const isWorkspace$1 = (value) => value.startsWith(WORKSPACE_PREFIX$1);
4142
+ const isUrl$2 = (value) => value.startsWith("http://") || value.startsWith("https://");
4143
+ const parseRange$1 = (value) => {
4115
4144
  const exit = effect.Schema.decodeUnknownExit(Range$2.FromString)(value);
4116
4145
  return effect.Exit.isSuccess(exit) ? effect.Option.some(exit.value) : effect.Option.none();
4117
4146
  };
4118
- const isRange = (value) => effect.Option.isSome(parseRange(value));
4119
- const protocolOf = (value) => {
4120
- if (value.startsWith(CATALOG_PREFIX)) return "catalog";
4121
- if (value.startsWith(WORKSPACE_PREFIX)) return "workspace";
4147
+ const isRange$1 = (value) => effect.Option.isSome(parseRange$1(value));
4148
+ const protocolOf$1 = (value) => {
4149
+ if (value.startsWith(CATALOG_PREFIX$1)) return "catalog";
4150
+ if (value.startsWith(WORKSPACE_PREFIX$1)) return "workspace";
4122
4151
  if (value.startsWith("link:")) return "link";
4123
4152
  if (value.startsWith("portal:")) return "portal";
4124
- if (value.startsWith("file:") || isBarePath(value)) return "file";
4153
+ if (value.startsWith("file:") || isBarePath$1(value)) return "file";
4125
4154
  if (value.startsWith("npm:")) return "npm";
4126
- if (isGit(value)) return "git";
4127
- if (isUrl$1(value)) return "url";
4128
- if (isRange(value)) return "range";
4155
+ if (isGit$1(value)) return "git";
4156
+ if (isUrl$2(value)) return "url";
4157
+ if (isRange$1(value)) return "range";
4129
4158
  if (/^[a-zA-Z][a-zA-Z0-9._-]*$/.test(value)) return "tag";
4130
4159
  return "unknown";
4131
4160
  };
4132
- const isTag = (value) => protocolOf(value) === "tag";
4133
- const catalogNameOf$1 = (specifier) => {
4134
- if (!isCatalog(specifier)) return effect.Option.none();
4161
+ const isTag$1 = (value) => protocolOf$1(value) === "tag";
4162
+ const catalogNameOf$2 = (specifier) => {
4163
+ if (!isCatalog$1(specifier)) return effect.Option.none();
4135
4164
  const rest = specifier.slice(8).trim();
4136
4165
  return rest.length === 0 ? effect.Option.none() : effect.Option.some(rest);
4137
4166
  };
4138
- const projectRangeModifier = (range, version) => range === "*" || range === "" ? version : range === "~" ? `~${version}` : range === "^" ? `^${version}` : range;
4139
- const splitWorkspaceRest = (rest) => {
4167
+ const projectRangeModifier$1 = (range, version) => range === "*" || range === "" ? version : range === "~" ? `~${version}` : range === "^" ? `^${version}` : range;
4168
+ const splitWorkspaceRest$1 = (rest) => {
4140
4169
  const at = rest.lastIndexOf("@");
4141
4170
  return at > 0 ? {
4142
4171
  target: rest.slice(0, at),
@@ -4146,15 +4175,15 @@ const splitWorkspaceRest = (rest) => {
4146
4175
  range: rest
4147
4176
  };
4148
4177
  };
4149
- const projectWorkspaceRange = (rest, version) => {
4150
- const { target, range } = splitWorkspaceRest(rest);
4151
- const projected = projectRangeModifier(range, version);
4178
+ const projectWorkspaceRange$1 = (rest, version) => {
4179
+ const { target, range } = splitWorkspaceRest$1(rest);
4180
+ const projected = projectRangeModifier$1(range, version);
4152
4181
  return target === void 0 ? projected : `npm:${target}@${projected}`;
4153
4182
  };
4154
- const resolveWorkspace = (specifier, version) => isWorkspace(specifier) ? projectWorkspaceRange(specifier.slice(10), version) : specifier;
4155
- const workspaceTargetOf = (specifier) => {
4156
- if (!isWorkspace(specifier)) return effect.Option.none();
4157
- const { target } = splitWorkspaceRest(specifier.slice(10));
4183
+ const resolveWorkspace$1 = (specifier, version) => isWorkspace$1(specifier) ? projectWorkspaceRange$1(specifier.slice(10), version) : specifier;
4184
+ const workspaceTargetOf$1 = (specifier) => {
4185
+ if (!isWorkspace$1(specifier)) return effect.Option.none();
4186
+ const { target } = splitWorkspaceRest$1(specifier.slice(10));
4158
4187
  return target === void 0 ? effect.Option.none() : effect.Option.some(target);
4159
4188
  };
4160
4189
  /**
@@ -4164,14 +4193,14 @@ const workspaceTargetOf = (specifier) => {
4164
4193
  *
4165
4194
  * @public
4166
4195
  */
4167
- const isValidDependencySpecifier = (value) => value.length > 0 && protocolOf(value) !== "unknown";
4196
+ const isValidDependencySpecifier$1 = (value) => value.length > 0 && protocolOf$1(value) !== "unknown";
4168
4197
  /**
4169
4198
  * A `catalog:` reference. `name` carries the catalog name, or `Option.none()`
4170
4199
  * for the default catalog (`catalog:`).
4171
4200
  *
4172
4201
  * @public
4173
4202
  */
4174
- var CatalogSpecifier = class extends effect.Schema.TaggedClass()("catalog", {
4203
+ var CatalogSpecifier$1 = class extends effect.Schema.TaggedClass()("catalog", {
4175
4204
  /** The original specifier string. */
4176
4205
  raw: effect.Schema.String,
4177
4206
  /** The catalog name, or `Option.none()` for the default catalog. */
@@ -4183,7 +4212,7 @@ var CatalogSpecifier = class extends effect.Schema.TaggedClass()("catalog", {
4183
4212
  *
4184
4213
  * @public
4185
4214
  */
4186
- var WorkspaceSpecifier = class extends effect.Schema.TaggedClass()("workspace", {
4215
+ var WorkspaceSpecifier$1 = class extends effect.Schema.TaggedClass()("workspace", {
4187
4216
  /** The original specifier string. */
4188
4217
  raw: effect.Schema.String,
4189
4218
  /** The part after `workspace:` (e.g. `*`, `^1.2.3`, or an alias form). */
@@ -4207,7 +4236,7 @@ var WorkspaceSpecifier = class extends effect.Schema.TaggedClass()("workspace",
4207
4236
  * specifier points at (the alias target's version for the alias form).
4208
4237
  */
4209
4238
  resolve(version) {
4210
- return projectWorkspaceRange(this.range, version);
4239
+ return projectWorkspaceRange$1(this.range, version);
4211
4240
  }
4212
4241
  };
4213
4242
  /**
@@ -4215,7 +4244,7 @@ var WorkspaceSpecifier = class extends effect.Schema.TaggedClass()("workspace",
4215
4244
  *
4216
4245
  * @public
4217
4246
  */
4218
- var RangeSpecifier = class extends effect.Schema.TaggedClass()("range", {
4247
+ var RangeSpecifier$1 = class extends effect.Schema.TaggedClass()("range", {
4219
4248
  /** The original specifier string. */
4220
4249
  raw: effect.Schema.String }) {};
4221
4250
  /**
@@ -4223,7 +4252,7 @@ raw: effect.Schema.String }) {};
4223
4252
  *
4224
4253
  * @public
4225
4254
  */
4226
- var DistTagSpecifier = class extends effect.Schema.TaggedClass()("dist-tag", {
4255
+ var DistTagSpecifier$1 = class extends effect.Schema.TaggedClass()("dist-tag", {
4227
4256
  /** The original specifier string (also the tag name). */
4228
4257
  raw: effect.Schema.String }) {};
4229
4258
  /**
@@ -4232,35 +4261,35 @@ raw: effect.Schema.String }) {};
4232
4261
  *
4233
4262
  * @public
4234
4263
  */
4235
- var RawSpecifier = class extends effect.Schema.TaggedClass()("raw", {
4264
+ var RawSpecifier$1 = class extends effect.Schema.TaggedClass()("raw", {
4236
4265
  /** The original specifier string. */
4237
4266
  raw: effect.Schema.String }) {};
4238
- const Classified = effect.Schema.Union([
4239
- CatalogSpecifier,
4240
- WorkspaceSpecifier,
4241
- RangeSpecifier,
4242
- DistTagSpecifier,
4243
- RawSpecifier
4267
+ const Classified$1 = effect.Schema.Union([
4268
+ CatalogSpecifier$1,
4269
+ WorkspaceSpecifier$1,
4270
+ RangeSpecifier$1,
4271
+ DistTagSpecifier$1,
4272
+ RawSpecifier$1
4244
4273
  ]);
4245
- const classify$1 = (value) => {
4246
- if (isCatalog(value)) return CatalogSpecifier.make({
4274
+ const classify$2 = (value) => {
4275
+ if (isCatalog$1(value)) return CatalogSpecifier$1.make({
4247
4276
  raw: value,
4248
- name: catalogNameOf$1(value)
4277
+ name: catalogNameOf$2(value)
4249
4278
  });
4250
- if (isWorkspace(value)) return WorkspaceSpecifier.make({
4279
+ if (isWorkspace$1(value)) return WorkspaceSpecifier$1.make({
4251
4280
  raw: value,
4252
4281
  range: value.slice(10)
4253
4282
  });
4254
- if (isRange(value)) return RangeSpecifier.make({ raw: value });
4255
- if (isTag(value)) return DistTagSpecifier.make({ raw: value });
4256
- return RawSpecifier.make({ raw: value });
4283
+ if (isRange$1(value)) return RangeSpecifier$1.make({ raw: value });
4284
+ if (isTag$1(value)) return DistTagSpecifier$1.make({ raw: value });
4285
+ return RawSpecifier$1.make({ raw: value });
4257
4286
  };
4258
- const fromString = effect.Schema.String.pipe(effect.Schema.decodeTo(Classified, effect.SchemaTransformation.transformOrFail({
4259
- decode: (input) => isValidDependencySpecifier(input) ? effect.Effect.succeed(classify$1(input)) : effect.Effect.fail(new effect.SchemaIssue.InvalidValue(effect.Option.some(input), { message: `Invalid dependency specifier: "${input}"` })),
4287
+ const fromString$1 = effect.Schema.String.pipe(effect.Schema.decodeTo(Classified$1, effect.SchemaTransformation.transformOrFail({
4288
+ decode: (input) => isValidDependencySpecifier$1(input) ? effect.Effect.succeed(classify$2(input)) : effect.Effect.fail(new effect.SchemaIssue.InvalidValue(effect.Option.some(input), { message: `Invalid dependency specifier: "${input}"` })),
4260
4289
  encode: (classified) => effect.Effect.succeed(classified.raw)
4261
4290
  })));
4262
- const brandedSpecifier = effect.Schema.String.pipe(effect.Schema.check(effect.Schema.makeFilter((value) => isValidDependencySpecifier(value) ? void 0 : "Expected a valid dependency specifier")), effect.Schema.brand("DependencySpecifier"));
4263
- const decode$3 = (input) => effect.Schema.decodeUnknownEffect(brandedSpecifier)(input).pipe(effect.Effect.mapError(() => new InvalidDependencySpecifierError({ input })));
4291
+ const brandedSpecifier$1 = effect.Schema.String.pipe(effect.Schema.check(effect.Schema.makeFilter((value) => isValidDependencySpecifier$1(value) ? void 0 : "Expected a valid dependency specifier")), effect.Schema.brand("DependencySpecifier"));
4292
+ const decode$5 = (input) => effect.Schema.decodeUnknownEffect(brandedSpecifier$1)(input).pipe(effect.Effect.mapError(() => new InvalidDependencySpecifierError$1({ input })));
4264
4293
  /**
4265
4294
  * A valid dependency version specifier, carrying the protocol taxonomy statics
4266
4295
  * (`DependencySpecifier.protocolOf` and friends) that classify any specifier
@@ -4271,43 +4300,43 @@ const decode$3 = (input) => effect.Schema.decodeUnknownEffect(brandedSpecifier)(
4271
4300
  *
4272
4301
  * @public
4273
4302
  */
4274
- const DependencySpecifier = Object.assign(brandedSpecifier, {
4275
- protocolOf,
4276
- parseRange,
4277
- isRange,
4278
- isTag,
4279
- isGit,
4280
- isUrl: isUrl$1,
4281
- isLocal,
4282
- isLink,
4283
- isPortal,
4284
- isCatalog,
4285
- isWorkspace,
4286
- catalogNameOf: catalogNameOf$1,
4287
- resolveWorkspace,
4288
- workspaceTargetOf,
4289
- isValid: isValidDependencySpecifier,
4290
- decode: decode$3,
4291
- FromString: fromString
4303
+ const DependencySpecifier$1 = Object.assign(brandedSpecifier$1, {
4304
+ protocolOf: protocolOf$1,
4305
+ parseRange: parseRange$1,
4306
+ isRange: isRange$1,
4307
+ isTag: isTag$1,
4308
+ isGit: isGit$1,
4309
+ isUrl: isUrl$2,
4310
+ isLocal: isLocal$1,
4311
+ isLink: isLink$1,
4312
+ isPortal: isPortal$1,
4313
+ isCatalog: isCatalog$1,
4314
+ isWorkspace: isWorkspace$1,
4315
+ catalogNameOf: catalogNameOf$2,
4316
+ resolveWorkspace: resolveWorkspace$1,
4317
+ workspaceTargetOf: workspaceTargetOf$1,
4318
+ isValid: isValidDependencySpecifier$1,
4319
+ decode: decode$5,
4320
+ FromString: fromString$1
4292
4321
  });
4293
4322
  //#endregion
4294
- //#region ../../node_modules/.pnpm/@effected+npm@0.8.1_@effected+semver@0.3.1_effect@4.0.0-beta.101__effect@4.0.0-beta.101/node_modules/@effected/npm/IntegrityHash.js
4295
- const SRI_RE = /^(sha1|sha256|sha384|sha512)-[A-Za-z0-9+/]+={0,2}$/;
4296
- const COREPACK_RE = /^(sha1|sha224|sha256|sha384|sha512)\.[0-9a-f]+$/;
4297
- const YARN_RE = /^[0-9]+(c[0-9]+)?\/[0-9a-f]+$/;
4298
- const isSri = (value) => SRI_RE.test(value);
4299
- const isCorepack = (value) => COREPACK_RE.test(value);
4300
- const isYarnChecksum = (value) => YARN_RE.test(value);
4323
+ //#region ../../node_modules/.pnpm/@effected+npm@0.8.3_@effected+semver@0.3.2_effect@4.0.0-beta.101__effect@4.0.0-beta.101/node_modules/@effected/npm/IntegrityHash.js
4324
+ const SRI_RE$1 = /^(sha1|sha256|sha384|sha512)-[A-Za-z0-9+/]+={0,2}$/;
4325
+ const COREPACK_RE$1 = /^(sha1|sha224|sha256|sha384|sha512)\.[0-9a-f]+$/;
4326
+ const YARN_RE$1 = /^[0-9]+(c[0-9]+)?\/[0-9a-f]+$/;
4327
+ const isSri$1 = (value) => SRI_RE$1.test(value);
4328
+ const isCorepack$1 = (value) => COREPACK_RE$1.test(value);
4329
+ const isYarnChecksum$1 = (value) => YARN_RE$1.test(value);
4301
4330
  /**
4302
4331
  * Whether a string is a valid integrity hash in the SRI (`<algo>-<base64>`),
4303
4332
  * corepack (`<algo>.<hex>`) or yarn (`<cachekey>/<hex>`) form.
4304
4333
  *
4305
4334
  * @public
4306
4335
  */
4307
- const isValidIntegrityHash = (value) => isSri(value) || isCorepack(value) || isYarnChecksum(value);
4308
- const algorithmOf = (value) => {
4309
- if (isSri(value)) return effect.Option.some(value.slice(0, value.indexOf("-")));
4310
- if (isCorepack(value)) return effect.Option.some(value.slice(0, value.indexOf(".")));
4336
+ const isValidIntegrityHash$1 = (value) => isSri$1(value) || isCorepack$1(value) || isYarnChecksum$1(value);
4337
+ const algorithmOf$1 = (value) => {
4338
+ if (isSri$1(value)) return effect.Option.some(value.slice(0, value.indexOf("-")));
4339
+ if (isCorepack$1(value)) return effect.Option.some(value.slice(0, value.indexOf(".")));
4311
4340
  return effect.Option.none();
4312
4341
  };
4313
4342
  /**
@@ -4318,15 +4347,15 @@ const algorithmOf = (value) => {
4318
4347
  *
4319
4348
  * @public
4320
4349
  */
4321
- var InvalidIntegrityHashError = class extends effect.Schema.TaggedErrorClass()("InvalidIntegrityHashError", {
4350
+ var InvalidIntegrityHashError$1 = class extends effect.Schema.TaggedErrorClass()("InvalidIntegrityHashError", {
4322
4351
  /** The raw input string that failed validation. */
4323
4352
  input: effect.Schema.String }) {
4324
4353
  get message() {
4325
4354
  return `Invalid integrity hash "${this.input}": expected an SRI (<algo>-<base64>), corepack (<algo>.<hex>) or yarn (<cachekey>/<hex>) form`;
4326
4355
  }
4327
4356
  };
4328
- const brandedIntegrity = effect.Schema.String.pipe(effect.Schema.check(effect.Schema.makeFilter((value) => isValidIntegrityHash(value) ? void 0 : "Expected an SRI, corepack or yarn integrity hash")), effect.Schema.brand("IntegrityHash"));
4329
- const decode$2 = (input) => effect.Schema.decodeUnknownEffect(brandedIntegrity)(input).pipe(effect.Effect.mapError(() => new InvalidIntegrityHashError({ input })));
4357
+ const brandedIntegrity$1 = effect.Schema.String.pipe(effect.Schema.check(effect.Schema.makeFilter((value) => isValidIntegrityHash$1(value) ? void 0 : "Expected an SRI, corepack or yarn integrity hash")), effect.Schema.brand("IntegrityHash"));
4358
+ const decode$4 = (input) => effect.Schema.decodeUnknownEffect(brandedIntegrity$1)(input).pipe(effect.Effect.mapError(() => new InvalidIntegrityHashError$1({ input })));
4330
4359
  /**
4331
4360
  * A subresource-integrity hash, covering the SRI (`sha512-<base64>`), corepack
4332
4361
  * (`sha512.<hex>`) and yarn (`10c0/<hex>`) textual forms, carrying taxonomy
@@ -4335,66 +4364,15 @@ const decode$2 = (input) => effect.Schema.decodeUnknownEffect(brandedIntegrity)(
4335
4364
  *
4336
4365
  * @public
4337
4366
  */
4338
- const IntegrityHash = Object.assign(brandedIntegrity, {
4339
- isSri,
4340
- isCorepack,
4341
- isYarnChecksum,
4342
- isValid: isValidIntegrityHash,
4343
- algorithmOf,
4344
- decode: decode$2
4367
+ const IntegrityHash$1 = Object.assign(brandedIntegrity$1, {
4368
+ isSri: isSri$1,
4369
+ isCorepack: isCorepack$1,
4370
+ isYarnChecksum: isYarnChecksum$1,
4371
+ isValid: isValidIntegrityHash$1,
4372
+ algorithmOf: algorithmOf$1,
4373
+ decode: decode$4
4345
4374
  });
4346
- /**
4347
- * {@link (IntegrityHash:variable)} narrowed to the corepack `<algo>.<hex>` form
4348
- * — `sha512.deadbeef`, and corepack's own sha224 default pins
4349
- * (`sha224.877304e3…`). An SRI (`sha512-<base64>`) or yarn (`10c0/<hex>`)
4350
- * hash, both valid `IntegrityHash` values, fails this schema.
4351
- *
4352
- * @remarks
4353
- * The corepack pin tail (`<name>@<version>+<integrity>`) is the one place the
4354
- * kit meets this form, and two schemas name it: `PackageManagerPin.integrity`
4355
- * here and `@effected/package-json`'s `PackageManager.integrity`. Both consume
4356
- * **this** schema — the restriction existed privately in each module until they
4357
- * were consolidated, and a private copy is exactly how the two drift (the
4358
- * widening that admitted sha224 had to be made twice).
4359
- *
4360
- * It decodes to the same {@link IntegrityHashBrand} the unrestricted schema
4361
- * does, so a corepack-validated value assigns anywhere an `IntegrityHash` is
4362
- * expected; there is no second brand. Reach for
4363
- * `IntegrityHash.isCorepack(value)` to ask the same question about a raw
4364
- * string without decoding.
4365
- *
4366
- * That single brand is also why sharing this schema is not type-enforced, and
4367
- * the consequence is sharper than it looks: a `Schema.check` is **erased from
4368
- * the built type**, so this schema and the unrestricted one are the same
4369
- * declared type. A consumer that quietly reverts to a private copy compiles
4370
- * clean, and — if the copy is faithful — passes every rejection test too.
4371
- * Neither `tsc` nor behaviour can see the re-fork.
4372
- *
4373
- * What does see it is **object identity**, so each consumer's suite asserts
4374
- * that its field schema IS this export:
4375
- * `PackageManagerPin.fields.integrity.schema === CorepackIntegrityHash` (an
4376
- * `optionalKey` field keeps the inner schema on `.schema`), and
4377
- * `PackageManager.fields.integrity.value === CorepackIntegrityHash` on the
4378
- * `@effected/package-json` side (a `Schema.Option` keeps it on `.value`). Both
4379
- * assertions carry a control against the unrestricted brand, so they discriminate
4380
- * rather than passing on any schema at all. That identity assertion is the only
4381
- * thing standing between the two surfaces and a silent re-fork; do not replace
4382
- * it with a behavioural test, which cannot fail.
4383
- *
4384
- * @example
4385
- * ```ts
4386
- * import { CorepackIntegrityHash } from "@effected/npm";
4387
- * import { Schema } from "effect";
4388
- *
4389
- * const decode = Schema.decodeUnknownExit(CorepackIntegrityHash);
4390
- *
4391
- * decode("sha512.deadbeef"); // success
4392
- * decode("sha512-3q2+7w=="); // failure — SRI form
4393
- * ```
4394
- *
4395
- * @public
4396
- */
4397
- const CorepackIntegrityHash = brandedIntegrity.pipe(effect.Schema.check(effect.Schema.makeFilter((value) => isCorepack(value) ? void 0 : "Expected a corepack (<algo>.<hex>) integrity hash")));
4375
+ brandedIntegrity$1.pipe(effect.Schema.check(effect.Schema.makeFilter((value) => isCorepack$1(value) ? void 0 : "Expected a corepack (<algo>.<hex>) integrity hash")));
4398
4376
  effect.Schema.Literals([
4399
4377
  "npm",
4400
4378
  "pnpm",
@@ -4590,7 +4568,678 @@ var LocalExec = class LocalExec extends effect.Context.Service()("@effected/comm
4590
4568
  static layerTest = (overrides = {}) => effect.Layer.succeed(LocalExec, LocalExec.makeTest(overrides));
4591
4569
  };
4592
4570
  //#endregion
4593
- //#region ../../node_modules/.pnpm/@effected+npm@0.8.1_@effected+semver@0.3.1_effect@4.0.0-beta.101__effect@4.0.0-beta.101/node_modules/@effected/npm/ReleaseAgeGate.js
4571
+ //#region ../../node_modules/.pnpm/@effected+commands@0.3.1_effect@4.0.0-beta.101/node_modules/@effected/commands/Redaction.js
4572
+ /**
4573
+ * Argument tokens whose *following* positional (or `=`-joined value) is a
4574
+ * secret. Lowercase; matching is case-insensitive.
4575
+ *
4576
+ * @remarks
4577
+ * This is the heuristic backstop, not the primary mechanism — it can only know
4578
+ * about flags someone thought to list. The primary mechanism is
4579
+ * {@link Redaction.applyArgs}, which redacts by **value**: the caller says what
4580
+ * its secrets are and every occurrence goes, whatever flag carried it.
4581
+ *
4582
+ * @public
4583
+ */
4584
+ const SECRET_FLAGS = /* @__PURE__ */ new Set([
4585
+ "--access-token",
4586
+ "--api-key",
4587
+ "--auth",
4588
+ "--auth-token",
4589
+ "--otp",
4590
+ "--password",
4591
+ "--registry-token",
4592
+ "--token"
4593
+ ]);
4594
+ /**
4595
+ * npm config keys whose value is a credential (`//registry/:_authToken`,
4596
+ * `//registry/:_password`).
4597
+ */
4598
+ const AUTH_KEY = /:(?:_authtoken|_password)$/i;
4599
+ /**
4600
+ * The distinct, non-empty secret values, longest first.
4601
+ *
4602
+ * @remarks
4603
+ * Longest-first is load-bearing: redacting `"ab"` before `"abcd"` rewrites
4604
+ * `"abcd"` to `"***cd"`, leaking `"cd"` — a fragment of the longer secret.
4605
+ * Empty values are dropped because `"abc".split("").join("***")` would insert
4606
+ * the placeholder between every character.
4607
+ */
4608
+ const prepare = (secrets) => [...new Set(secrets.map(effect.Redacted.value))].filter((value) => value.length > 0).sort((a, b) => b.length - a.length);
4609
+ /** Replaces each prepared value with {@link REDACTED}, literally (never as a pattern). */
4610
+ const replaceAll = (text, values) => {
4611
+ let out = text;
4612
+ for (const value of values) out = out.split(value).join("***");
4613
+ return out;
4614
+ };
4615
+ const apply = (text, secrets) => secrets.length === 0 ? text : replaceAll(text, prepare(secrets));
4616
+ const applyArgs = (args, secrets) => {
4617
+ if (secrets.length === 0) return args;
4618
+ const values = prepare(secrets);
4619
+ return args.map((arg) => replaceAll(arg, values));
4620
+ };
4621
+ /** Whether `name` introduces a credential value. */
4622
+ const isSecretName = (name, extra) => {
4623
+ const lower = name.toLowerCase();
4624
+ return SECRET_FLAGS.has(lower) || extra.has(lower) || AUTH_KEY.test(name);
4625
+ };
4626
+ const scrubArgs = (args, options) => {
4627
+ const extra = new Set((options?.flags ?? []).map((flag) => flag.toLowerCase()));
4628
+ const out = [];
4629
+ for (let index = 0; index < args.length; index++) {
4630
+ const arg = args[index] ?? "";
4631
+ const equals = arg.indexOf("=");
4632
+ if (equals > 0 && isSecretName(arg.slice(0, equals), extra)) {
4633
+ out.push(`${arg.slice(0, equals)}=***`);
4634
+ continue;
4635
+ }
4636
+ out.push(arg);
4637
+ if (isSecretName(arg, extra) && index + 1 < args.length) {
4638
+ out.push("***");
4639
+ index++;
4640
+ }
4641
+ }
4642
+ return out;
4643
+ };
4644
+ /**
4645
+ * Secret scrubbing for command arguments and captured output.
4646
+ *
4647
+ * @remarks
4648
+ * Two mechanisms, deliberately layered. {@link Redaction.apply} and
4649
+ * {@link Redaction.applyArgs} redact **by value** — the caller declares its
4650
+ * secrets as `Redacted` and every occurrence is removed wherever it appears.
4651
+ * {@link Redaction.scrubArgs} is a **flag heuristic** that runs in addition, for
4652
+ * the secrets a caller forgot to declare.
4653
+ *
4654
+ * @public
4655
+ */
4656
+ var Redaction = class {
4657
+ constructor() {}
4658
+ /**
4659
+ * Replaces every occurrence of every secret's value in `text` with
4660
+ * {@link REDACTED}.
4661
+ *
4662
+ * @remarks
4663
+ * Exact, literal matching — no pattern compilation, no encoding-aware search. A
4664
+ * secret that reaches the text base64-encoded, URL-encoded, or split across a
4665
+ * line break is **not** found; declare the encoded form as a secret too if that
4666
+ * is a real risk.
4667
+ *
4668
+ * A secret composed only of the placeholder's own characters (`*`, `**`, `***`)
4669
+ * cannot be fully removed, because the replacement reintroduces it. That is a
4670
+ * documented limitation, not a defect.
4671
+ */
4672
+ static apply = apply;
4673
+ /**
4674
+ * {@link Redaction.apply} over each entry of an argv array. An entry is
4675
+ * redacted whether it *is* a secret or merely *contains* one
4676
+ * (`--url=https://u:s3cr3t@host`).
4677
+ */
4678
+ static applyArgs = applyArgs;
4679
+ /**
4680
+ * Heuristic backstop: redact any argv value that is introduced by a known
4681
+ * secret-bearing flag or npm auth key, in either the separated
4682
+ * (`--token abc`) or inline (`--token=abc`) form.
4683
+ *
4684
+ * @remarks
4685
+ * This catches secrets the caller forgot to declare; it cannot catch a flag
4686
+ * nobody listed. Prefer {@link Redaction.applyArgs} with the actual
4687
+ * `Redacted` values — this runs *in addition*, never instead.
4688
+ */
4689
+ static scrubArgs = scrubArgs;
4690
+ /** Flags treated as secret-bearing by {@link Redaction.scrubArgs}. See {@link SECRET_FLAGS}. */
4691
+ static SECRET_FLAGS = SECRET_FLAGS;
4692
+ };
4693
+ //#endregion
4694
+ //#region ../../node_modules/.pnpm/@effected+commands@0.3.1_effect@4.0.0-beta.101/node_modules/@effected/commands/internal/capture.js
4695
+ /**
4696
+ * Raised when a captured stream exceeds its byte budget.
4697
+ *
4698
+ * @remarks
4699
+ * Internal and never exported from the package: `Run` maps it to the public
4700
+ * `CommandOutputError`. `Data.TaggedError` is appropriate precisely because it
4701
+ * never escapes — it is an in-process signal, not a contract.
4702
+ */
4703
+ var OutputTooLarge = class extends effect.Data.TaggedError("OutputTooLarge") {};
4704
+ /**
4705
+ * Collects a byte stream into a string, failing once more than `limit` bytes
4706
+ * have arrived.
4707
+ *
4708
+ * @remarks
4709
+ * The budget is enforced **during** accumulation, not after: checking the
4710
+ * length of an already-collected string would mean the memory was already
4711
+ * spent, which is the exact failure the budget exists to prevent. Counting is
4712
+ * on raw bytes, before decoding, because bytes are what the process actually
4713
+ * produced.
4714
+ */
4715
+ const collectBounded = (stream, limit) => effect.Effect.gen(function* () {
4716
+ const seen = yield* effect.Ref.make(0);
4717
+ const bounded = effect.Stream.mapEffect(stream, (chunk) => effect.Effect.flatMap(effect.Ref.updateAndGet(seen, (total) => total + chunk.length), (total) => total > limit ? effect.Effect.fail(new OutputTooLarge({ limit })) : effect.Effect.succeed(chunk)));
4718
+ return yield* effect.Stream.mkString(effect.Stream.decodeText(bounded));
4719
+ });
4720
+ //#endregion
4721
+ //#region ../../node_modules/.pnpm/@effected+commands@0.3.1_effect@4.0.0-beta.101/node_modules/@effected/commands/Run.js
4722
+ /**
4723
+ * Default ceiling on captured bytes per stream (16 MiB).
4724
+ *
4725
+ * @remarks
4726
+ * Collecting a child's output without a bound is a memory-exhaustion vector.
4727
+ * Output genuinely larger than this belongs on {@link Run.stream}, which never
4728
+ * accumulates.
4729
+ *
4730
+ * @public
4731
+ */
4732
+ const DEFAULT_MAX_OUTPUT_BYTES = 16777216;
4733
+ /** Characters shown from the tail of captured output in an error message. */
4734
+ const MAX_MESSAGE_CHARS = 2e3;
4735
+ /**
4736
+ * What one completed run produced.
4737
+ *
4738
+ * @public
4739
+ */
4740
+ var CommandOutput = class extends effect.Schema.Class("CommandOutput")({
4741
+ /** Captured standard output, redacted. */
4742
+ stdout: effect.Schema.String,
4743
+ /** Captured standard error, redacted. */
4744
+ stderr: effect.Schema.String,
4745
+ /** The process exit code. A non-zero value is NOT an error at this level. */
4746
+ exitCode: effect.Schema.Number
4747
+ }) {
4748
+ /** Whether the process exited zero. */
4749
+ get succeeded() {
4750
+ return this.exitCode === 0;
4751
+ }
4752
+ };
4753
+ /** The executable and argv an error should report for `command`. */
4754
+ const describeCommand = (command) => {
4755
+ if (effect_unstable_process.ChildProcess.isStandardCommand(command)) return {
4756
+ command: command.command,
4757
+ args: command.args
4758
+ };
4759
+ const left = describeCommand(command.left);
4760
+ const right = describeCommand(command.right);
4761
+ return {
4762
+ command: `${left.command} | ${right.command}`,
4763
+ args: []
4764
+ };
4765
+ };
4766
+ /** argv as an error should store it: declared secrets removed, then the flag heuristic. */
4767
+ const safeArgs = (args, secrets) => Redaction.scrubArgs(Redaction.applyArgs(args, secrets ?? []));
4768
+ /** Captured text as an error should store it. */
4769
+ const safeText = (text, secrets) => Redaction.apply(text, secrets ?? []);
4770
+ /** Tail-bounded rendering: tools write warnings first and the real error last. */
4771
+ const tail = (text) => {
4772
+ const trimmed = text.trim();
4773
+ if (trimmed.length <= MAX_MESSAGE_CHARS) return trimmed;
4774
+ return `...[${trimmed.length - MAX_MESSAGE_CHARS} chars truncated from head]...\n${trimmed.slice(-2e3)}`;
4775
+ };
4776
+ /**
4777
+ * A command that could not be run, or that ran and failed.
4778
+ *
4779
+ * @remarks
4780
+ * `kind` is the routing surface, never the message: `"nonZero"` (the process
4781
+ * ran and exited non-zero), `"spawn"` (it never started — the executable is
4782
+ * missing, or the platform refused), `"timeout"` (a caller-supplied ceiling
4783
+ * elapsed). Composed retry and fallback logic branches on `kind`; nothing in
4784
+ * this package asks a caller to match on prose.
4785
+ *
4786
+ * `args` is **always** stored redacted.
4787
+ *
4788
+ * @public
4789
+ */
4790
+ var CommandFailedError = class CommandFailedError extends effect.Schema.TaggedErrorClass()("CommandFailedError", {
4791
+ /** Why it failed. */
4792
+ kind: effect.Schema.Literals([
4793
+ "nonZero",
4794
+ "spawn",
4795
+ "timeout"
4796
+ ]),
4797
+ /** The executable (or `"a | b"` for a pipeline). */
4798
+ command: effect.Schema.String,
4799
+ /** argv, redacted. */
4800
+ args: effect.Schema.Array(effect.Schema.String),
4801
+ /** The exit code, when the process ran. */
4802
+ exitCode: effect.Schema.optionalKey(effect.Schema.Number),
4803
+ /** Captured standard error, redacted, when the process ran. */
4804
+ stderr: effect.Schema.optionalKey(effect.Schema.String),
4805
+ /** Captured standard output, redacted, when the process ran. */
4806
+ stdout: effect.Schema.optionalKey(effect.Schema.String),
4807
+ /** The absorbed platform failure, for `"spawn"`. */
4808
+ cause: effect.Schema.optionalKey(effect.Schema.Defect())
4809
+ }) {
4810
+ /** The process ran and exited non-zero. */
4811
+ static nonZero = (command, output, secrets) => {
4812
+ const described = describeCommand(command);
4813
+ return new CommandFailedError({
4814
+ kind: "nonZero",
4815
+ command: described.command,
4816
+ args: safeArgs(described.args, secrets),
4817
+ exitCode: output.exitCode,
4818
+ stderr: output.stderr,
4819
+ stdout: output.stdout
4820
+ });
4821
+ };
4822
+ /** The process never started. */
4823
+ static spawn = (command, cause, secrets) => {
4824
+ const described = describeCommand(command);
4825
+ return new CommandFailedError({
4826
+ kind: "spawn",
4827
+ command: described.command,
4828
+ args: safeArgs(described.args, secrets),
4829
+ cause
4830
+ });
4831
+ };
4832
+ /** A caller-supplied ceiling elapsed; the child was killed with its scope. */
4833
+ static timedOut = (command, secrets) => {
4834
+ const described = describeCommand(command);
4835
+ return new CommandFailedError({
4836
+ kind: "timeout",
4837
+ command: described.command,
4838
+ args: safeArgs(described.args, secrets)
4839
+ });
4840
+ };
4841
+ /**
4842
+ * Whether this is a spawn failure caused by the executable not existing —
4843
+ * the structural "tool is not installed" signal.
4844
+ */
4845
+ get notFound() {
4846
+ return this.kind === "spawn" && this.cause instanceof effect.PlatformError.PlatformError && this.cause.reason._tag === "NotFound";
4847
+ }
4848
+ /** Names the command and surfaces the tail of whichever stream carries the cause. */
4849
+ get message() {
4850
+ const parts = [`Command "${this.args.length > 0 ? `${this.command} ${this.args.join(" ")}` : this.command}" failed`];
4851
+ if (this.kind === "timeout") parts.push("(timed out)");
4852
+ if (this.exitCode !== void 0) parts.push(`(exit ${this.exitCode})`);
4853
+ const stream = this.stderr?.trim() ? this.stderr : this.stdout?.trim() ? this.stdout : void 0;
4854
+ if (stream !== void 0) parts.push(`:\n${tail(stream)}`);
4855
+ return parts.join(" ");
4856
+ }
4857
+ };
4858
+ /**
4859
+ * A command ran, but its output could not be used.
4860
+ *
4861
+ * @remarks
4862
+ * Separate from {@link CommandFailedError} because the process itself
4863
+ * succeeded: `"notJson"` (stdout is not JSON), `"schema"` (it is JSON but does
4864
+ * not decode), `"tooLarge"` (capture exceeded its byte budget). Keeping the two
4865
+ * distinguishable is the point — a schema drift and a crashed tool call for
4866
+ * different responses.
4867
+ *
4868
+ * The context fields (`exitCode`, `stderr`, `stdout`) are populated by
4869
+ * {@link Run.jsonLine}, whose payload framing parses regardless of exit code —
4870
+ * when no payload arrives, the exit code and captured streams are the only
4871
+ * evidence of what actually went wrong. Both streams are **always** stored
4872
+ * redacted.
4873
+ *
4874
+ * @public
4875
+ */
4876
+ var CommandOutputError = class extends effect.Schema.TaggedErrorClass()("CommandOutputError", {
4877
+ /** Which way the output was unusable. */
4878
+ kind: effect.Schema.Literals([
4879
+ "notJson",
4880
+ "schema",
4881
+ "tooLarge"
4882
+ ]),
4883
+ /** The executable that produced it. */
4884
+ command: effect.Schema.String,
4885
+ /** The underlying parse or decode failure. */
4886
+ cause: effect.Schema.optionalKey(effect.Schema.Defect()),
4887
+ /** The exit code, when the combinator parses independently of it. */
4888
+ exitCode: effect.Schema.optionalKey(effect.Schema.Number),
4889
+ /** Captured standard error, redacted, when the process ran. */
4890
+ stderr: effect.Schema.optionalKey(effect.Schema.String),
4891
+ /** Captured standard output, redacted, when the process ran. */
4892
+ stdout: effect.Schema.optionalKey(effect.Schema.String)
4893
+ }) {
4894
+ get message() {
4895
+ const parts = [];
4896
+ if (this.kind === "notJson") parts.push(`Command "${this.command}" did not produce JSON`);
4897
+ else if (this.kind === "schema") parts.push(`Command "${this.command}" produced JSON that did not match the expected schema`);
4898
+ else parts.push(`Command "${this.command}" produced more output than the configured limit`);
4899
+ if (this.exitCode !== void 0) parts.push(`(exit ${this.exitCode})`);
4900
+ if (this.stderr !== void 0 && this.stderr.trim().length > 0) parts.push(`:\n${tail(this.stderr)}`);
4901
+ return parts.join(" ");
4902
+ }
4903
+ };
4904
+ /** Spawns, collects both streams concurrently, and awaits exit. */
4905
+ const collectRaw = (command, options, tee) => effect.Effect.scoped(effect.Effect.gen(function* () {
4906
+ const handle = yield* (yield* effect_unstable_process.ChildProcessSpawner.ChildProcessSpawner).spawn(command);
4907
+ const limit = options?.maxOutputBytes ?? 16777216;
4908
+ const out = tee === void 0 ? handle.stdout : effect.Stream.tapSink(handle.stdout, tee.stdout());
4909
+ const err = tee === void 0 ? handle.stderr : effect.Stream.tapSink(handle.stderr, tee.stderr());
4910
+ const [stdout, stderr, exitCode] = yield* effect.Effect.all([
4911
+ collectBounded(out, limit),
4912
+ collectBounded(err, limit),
4913
+ handle.exitCode
4914
+ ], { concurrency: "unbounded" });
4915
+ const secrets = options?.redact;
4916
+ return CommandOutput.make({
4917
+ stdout: safeText(stdout, secrets),
4918
+ stderr: safeText(stderr, secrets),
4919
+ exitCode: Number(exitCode)
4920
+ });
4921
+ }));
4922
+ /** Maps the raw failure modes onto this package's taxonomy, and applies any ceiling. */
4923
+ const collectClassified = (command, options, tee) => {
4924
+ const described = describeCommand(command);
4925
+ const classified = collectRaw(command, options, tee).pipe(effect.Effect.catch((error) => effect.Effect.fail(error instanceof OutputTooLarge ? new CommandOutputError({
4926
+ kind: "tooLarge",
4927
+ command: described.command,
4928
+ cause: error
4929
+ }) : CommandFailedError.spawn(command, error, options?.redact))));
4930
+ return options?.timeout === void 0 ? classified : effect.Effect.timeoutOrElse(classified, {
4931
+ duration: options.timeout,
4932
+ orElse: () => effect.Effect.fail(CommandFailedError.timedOut(command, options.redact))
4933
+ });
4934
+ };
4935
+ /** Fails a run whose process exited non-zero. */
4936
+ const requireZero = (command, output, options) => output.succeeded ? effect.Effect.succeed(output) : effect.Effect.fail(CommandFailedError.nonZero(command, output, options?.redact));
4937
+ /** Span attributes: what ran and how many arguments — never the arguments. */
4938
+ const annotate = (command) => {
4939
+ const described = describeCommand(command);
4940
+ return effect.Effect.annotateCurrentSpan({
4941
+ command: described.command,
4942
+ argc: described.args.length
4943
+ });
4944
+ };
4945
+ const collect = effect.Effect.fn("Run.collect")(function* (command, options) {
4946
+ yield* annotate(command);
4947
+ return yield* collectClassified(command, options, void 0);
4948
+ });
4949
+ const collectTee = effect.Effect.fn("Run.collectTee")(function* (command, options) {
4950
+ yield* annotate(command);
4951
+ const stdio = yield* effect.Stdio.Stdio;
4952
+ return yield* collectClassified(command, options, stdio);
4953
+ });
4954
+ const text$4 = effect.Effect.fn("Run.text")(function* (command, options) {
4955
+ yield* annotate(command);
4956
+ const output = yield* collectClassified(command, options, void 0);
4957
+ return (yield* requireZero(command, output, options)).stdout.trim();
4958
+ });
4959
+ const lines = effect.Effect.fn("Run.lines")(function* (command, options) {
4960
+ yield* annotate(command);
4961
+ const output = yield* collectClassified(command, options, void 0);
4962
+ return (yield* requireZero(command, output, options)).stdout.split(/\r?\n/).map((line) => line.trim()).filter((line) => line.length > 0);
4963
+ });
4964
+ const json = effect.Effect.fn("Run.json")(function* (command, schema, options) {
4965
+ yield* annotate(command);
4966
+ const described = describeCommand(command);
4967
+ const output = yield* collectClassified(command, options, void 0);
4968
+ const checked = yield* requireZero(command, output, options);
4969
+ const parsed = yield* effect.Effect.try({
4970
+ try: () => JSON.parse(checked.stdout),
4971
+ catch: (cause) => new CommandOutputError({
4972
+ kind: "notJson",
4973
+ command: described.command,
4974
+ cause
4975
+ })
4976
+ });
4977
+ return yield* effect.Schema.decodeUnknownEffect(schema)(parsed).pipe(effect.Effect.catch((cause) => effect.Effect.fail(new CommandOutputError({
4978
+ kind: "schema",
4979
+ command: described.command,
4980
+ cause
4981
+ }))));
4982
+ });
4983
+ const jsonLine = effect.Effect.fn("Run.jsonLine")(function* (command, schema, options) {
4984
+ yield* annotate(command);
4985
+ const described = describeCommand(command);
4986
+ const output = yield* collectClassified(command, options, void 0);
4987
+ const context = {
4988
+ exitCode: output.exitCode,
4989
+ stderr: output.stderr,
4990
+ stdout: output.stdout
4991
+ };
4992
+ const candidates = output.stdout.split(/\r?\n/).filter((candidate) => candidate.trim().length > 0);
4993
+ if (candidates.length === 0) return yield* effect.Effect.fail(new CommandOutputError({
4994
+ kind: "notJson",
4995
+ command: described.command,
4996
+ cause: /* @__PURE__ */ new Error("stdout carried no non-empty line"),
4997
+ ...context
4998
+ }));
4999
+ let notJsonCause;
5000
+ let schemaCause;
5001
+ for (let index = candidates.length - 1; index >= 0; index--) {
5002
+ const candidate = candidates[index];
5003
+ if (candidate === void 0) continue;
5004
+ let parsed;
5005
+ try {
5006
+ parsed = JSON.parse(candidate);
5007
+ } catch (cause) {
5008
+ notJsonCause ??= cause;
5009
+ continue;
5010
+ }
5011
+ const decoded = yield* effect.Effect.result(effect.Schema.decodeUnknownEffect(schema)(parsed));
5012
+ if (effect.Result.isSuccess(decoded)) return decoded.success;
5013
+ schemaCause ??= decoded.failure;
5014
+ }
5015
+ return yield* effect.Effect.fail(schemaCause !== void 0 ? new CommandOutputError({
5016
+ kind: "schema",
5017
+ command: described.command,
5018
+ cause: schemaCause,
5019
+ ...context
5020
+ }) : new CommandOutputError({
5021
+ kind: "notJson",
5022
+ command: described.command,
5023
+ cause: notJsonCause,
5024
+ ...context
5025
+ }));
5026
+ });
5027
+ const exitCode = effect.Effect.fn("Run.exitCode")(function* (command, options) {
5028
+ yield* annotate(command);
5029
+ return (yield* collectClassified(command, options, void 0)).exitCode;
5030
+ });
5031
+ const succeeds = effect.Effect.fn("Run.succeeds")(function* (command, options) {
5032
+ yield* annotate(command);
5033
+ return yield* collectClassified(command, options, void 0).pipe(effect.Effect.map((output) => output.succeeded), effect.Effect.catch(() => effect.Effect.succeed(false)));
5034
+ });
5035
+ const detach = effect.Effect.fn("Run.detach")(function* (command) {
5036
+ yield* annotate(command);
5037
+ return yield* effect.Effect.scoped(effect.Effect.gen(function* () {
5038
+ const handle = yield* (yield* effect_unstable_process.ChildProcessSpawner.ChildProcessSpawner).spawn(command);
5039
+ yield* handle.unref;
5040
+ return handle.pid;
5041
+ })).pipe(effect.Effect.catch((error) => effect.Effect.fail(CommandFailedError.spawn(command, error))));
5042
+ });
5043
+ const stream = (command, options) => effect.Stream.unwrap(effect.Effect.map(effect_unstable_process.ChildProcessSpawner.ChildProcessSpawner, (spawner) => spawner.streamLines(command, { includeStderr: options?.includeStderr ?? false }))).pipe(effect.Stream.mapError((error) => CommandFailedError.spawn(command, error)));
5044
+ const extendEnv = effect.Function.dual(2, (self, env) => {
5045
+ if (effect_unstable_process.ChildProcess.isStandardCommand(self)) {
5046
+ const merged = self.options.env === void 0 ? env : {
5047
+ ...self.options.env,
5048
+ ...env
5049
+ };
5050
+ return effect_unstable_process.ChildProcess.make(self.command, self.args, {
5051
+ ...self.options,
5052
+ env: merged,
5053
+ extendEnv: true
5054
+ });
5055
+ }
5056
+ return effect_unstable_process.ChildProcess.pipeTo(extendEnv(self.left, env), extendEnv(self.right, env), self.options);
5057
+ });
5058
+ /**
5059
+ * Structured running of core `ChildProcess.Command` values.
5060
+ *
5061
+ * @remarks
5062
+ * These are free functions over core's contract, **not** a service: core's
5063
+ * `ChildProcessSpawner` already is the subprocess service, and wrapping it in a
5064
+ * second one is the re-declaration this package exists not to repeat. Tests
5065
+ * stub the spawner (`ChildProcessSpawner.make(mockSpawn)`), not these.
5066
+ *
5067
+ * A non-zero exit is a *result* for {@link Run.collect}, {@link Run.exitCode},
5068
+ * {@link Run.succeeds} and {@link Run.jsonLine}, and a typed *failure* for
5069
+ * {@link Run.text}, {@link Run.lines} and {@link Run.json} — the split is
5070
+ * deliberate, matching core (where a non-zero exit is a success) at the
5071
+ * reporting level while giving the interpreting helpers the ergonomics callers
5072
+ * actually want.
5073
+ *
5074
+ * The interpreting helpers also **trim**: {@link Run.text} strips leading and
5075
+ * trailing whitespace from the whole result — not just a trailing newline —
5076
+ * and {@link Run.lines} trims each line. Fixed-column output whose first
5077
+ * column can be whitespace (`git status --porcelain`) silently loses that
5078
+ * column through either, producing plausible wrong values rather than an
5079
+ * error. Parse that kind of output from the untrimmed `stdout` of
5080
+ * {@link Run.collect}'s {@link CommandOutput} instead.
5081
+ *
5082
+ * @public
5083
+ */
5084
+ var Run = class {
5085
+ constructor() {}
5086
+ /**
5087
+ * Spawns `command`, collects stdout and stderr concurrently, and resolves
5088
+ * with the {@link CommandOutput} once the process exits.
5089
+ *
5090
+ * @remarks
5091
+ * A non-zero exit is a *result* here, not a failure — see {@link Run}'s
5092
+ * remarks for the split against {@link Run.text}, {@link Run.lines} and
5093
+ * {@link Run.json}.
5094
+ */
5095
+ static collect = collect;
5096
+ /**
5097
+ * Like {@link Run.collect}, but also tees each stream to the `Stdio` in `R`
5098
+ * as it arrives, for a caller that wants live output alongside the captured
5099
+ * {@link CommandOutput}.
5100
+ */
5101
+ static collectTee = collectTee;
5102
+ /**
5103
+ * Runs `command` and resolves with trimmed stdout on a zero exit.
5104
+ *
5105
+ * @remarks
5106
+ * A non-zero exit is a typed failure here — {@link CommandFailedError} —
5107
+ * unlike {@link Run.collect}, {@link Run.exitCode} and {@link Run.succeeds},
5108
+ * which treat it as a result.
5109
+ *
5110
+ * The trim strips **leading and trailing whitespace**, not just the trailing
5111
+ * newline. For parse-sensitive output where leading whitespace is data
5112
+ * (`git status --porcelain`, whose first entry's status column it would
5113
+ * silently eat), use {@link Run.collect} and read its {@link CommandOutput}'s
5114
+ * untrimmed `stdout` instead.
5115
+ */
5116
+ static text = text$4;
5117
+ /**
5118
+ * Runs `command` and resolves with stdout split into trimmed, non-empty
5119
+ * lines on a zero exit.
5120
+ *
5121
+ * @remarks
5122
+ * A non-zero exit is a typed failure here — {@link CommandFailedError} —
5123
+ * matching {@link Run.text} and {@link Run.json}.
5124
+ */
5125
+ static lines = lines;
5126
+ /**
5127
+ * Runs `command`, parses stdout as JSON and decodes it against `schema` on
5128
+ * a zero exit.
5129
+ *
5130
+ * @remarks
5131
+ * Fails with {@link CommandOutputError} when stdout is not JSON or does not
5132
+ * decode; a non-zero exit fails with {@link CommandFailedError}, matching
5133
+ * {@link Run.text} and {@link Run.lines}.
5134
+ *
5135
+ * This parses the **whole** of stdout and requires a zero exit. For a
5136
+ * protocol payload located by scanning stdout lines from the end — tolerant
5137
+ * of noise around it and of a non-zero exit — use {@link Run.jsonLine}
5138
+ * instead.
5139
+ */
5140
+ static json = json;
5141
+ /**
5142
+ * Runs `command` and, **scanning stdout lines from the end**, resolves with
5143
+ * the first line that both parses as JSON and decodes against `schema` —
5144
+ * the framing variant of {@link Run.json}, for a child that reports through
5145
+ * a single JSON protocol payload near the end of its output.
5146
+ *
5147
+ * @remarks
5148
+ * The framing tolerates noise on **both sides** of the payload: noise before
5149
+ * it (a subprocess-loaded hook's own `console.log`, a tool's warnings) and
5150
+ * noise after it (a hook logging from `process.on("exit", ...)` fires after
5151
+ * the payload has flushed — the trigger for widening the old "last non-empty
5152
+ * line must decode" contract, spencerbeggs/effected#292). Lines are split on
5153
+ * `\r?\n`, whitespace-only lines are dropped, and the scan runs from the last
5154
+ * line backwards until one decodes. The tolerance is positional, not
5155
+ * volumetric: the whole of stdout is still captured under
5156
+ * {@link RunOptions.maxOutputBytes} (default
5157
+ * {@link DEFAULT_MAX_OUTPUT_BYTES}, 16 MiB), so a child whose noise exceeds
5158
+ * the ceiling fails typed as `"tooLarge"` before any line is examined —
5159
+ * raise the ceiling for a child known to be loud in volume.
5160
+ *
5161
+ * The scan's consequence: when **multiple** lines decode under `schema`, the
5162
+ * **last** one wins. A child must therefore never emit two schema-valid
5163
+ * lines, and a consumer schema should be shaped so an accidental log line
5164
+ * cannot satisfy it — a discriminated envelope with a required literal field
5165
+ * (`ok: true | false`, the shape `@effected/workspaces`' `ReplayPayload`
5166
+ * uses) rather than a permissive record a stray `console.log(someObject)`
5167
+ * might match.
5168
+ *
5169
+ * Unlike {@link Run.json}, this parses **regardless of the exit code** — a
5170
+ * deliberate posture, not an oversight. A protocol payload discriminates
5171
+ * success in-band (its own `ok` field, its own error shape), so the payload
5172
+ * outranks the exit code: a child that crashes *after* flushing its payload
5173
+ * still reported, and a caller that wants exit-code semantics has
5174
+ * {@link Run.json}. When no line decodes anywhere, the typed
5175
+ * {@link CommandOutputError} carries the exit code and both captured streams
5176
+ * (redacted) as context, so the failure is diagnosable without re-running.
5177
+ * Its `kind` preserves the near-miss diagnostic: `"schema"` when at least
5178
+ * one line parsed as JSON but none decoded — with the **last parseable
5179
+ * line's** decode failure as `cause`, that line being the most probable
5180
+ * intended payload — and `"notJson"` only when no non-empty line was JSON at
5181
+ * all (carrying the last non-empty line's parse error). A spawn failure or
5182
+ * an opted-in timeout still fails with {@link CommandFailedError}.
5183
+ */
5184
+ static jsonLine = jsonLine;
5185
+ /**
5186
+ * Runs `command` and resolves with its exit code alone.
5187
+ *
5188
+ * @remarks
5189
+ * A non-zero exit is a *result* here, not a failure — see {@link Run}'s
5190
+ * remarks for the split against {@link Run.text}, {@link Run.lines} and
5191
+ * {@link Run.json}.
5192
+ */
5193
+ static exitCode = exitCode;
5194
+ /**
5195
+ * Runs `command` and resolves with whether it exited zero, collapsing a
5196
+ * spawn or other classified failure to `false` rather than propagating it.
5197
+ */
5198
+ static succeeds = succeeds;
5199
+ /** Decoded stdout lines as they arrive, for output too large or too long-lived to collect. */
5200
+ static stream = stream;
5201
+ /**
5202
+ * Spawns `command` and resolves with its pid without waiting for exit.
5203
+ *
5204
+ * @remarks
5205
+ * Unrefs the child **before** this scope closes, so it survives the
5206
+ * caller's scope closing — the Node backend's release skips the kill for an
5207
+ * unref'd child, and reversing that order kills it with the scope instead.
5208
+ * Fails with {@link CommandFailedError} if the process never starts.
5209
+ */
5210
+ static detach = detach;
5211
+ /**
5212
+ * Adds environment variables to a command WITHOUT losing the parent
5213
+ * environment: merges `env` over any existing command environment (new values
5214
+ * win, matching core's `ChildProcess.setEnv`) and sets `extendEnv: true`.
5215
+ *
5216
+ * @remarks
5217
+ * This combinator exists because of a core trap: `ChildProcess.setEnv` merges
5218
+ * into `options.env` but never sets `extendEnv`, and the Node spawner resolves
5219
+ * the child environment as `extendEnv ? { ...process.env, ...env } : env` — so
5220
+ * a command built with bare `setEnv({ SOME_VAR: x })` spawns a child whose
5221
+ * ENTIRE environment is that one variable: no `PATH`, no `HOME`. The failure is
5222
+ * silent at the type level and surfaces as "spawned tool cannot find its own
5223
+ * binary" at runtime.
5224
+ *
5225
+ * Deliberately forces `extendEnv: true` even where construction set it `false`
5226
+ * — inheriting the parent environment is this combinator's entire purpose. A
5227
+ * caller who wants a hermetic environment uses core's `setEnv` or construction
5228
+ * options (`ChildProcess.make(cmd, args, { env, extendEnv: false })`) directly.
5229
+ *
5230
+ * For a pipeline, applies to every command in the pipeline (mirroring core's
5231
+ * `setEnv`), preserving the pipe's own options. Composes core's public
5232
+ * vocabulary (`ChildProcess.make`, `ChildProcess.pipeTo`) — it re-declares
5233
+ * nothing.
5234
+ */
5235
+ static extendEnv = extendEnv;
5236
+ /** Default ceiling on captured bytes per stream. See {@link DEFAULT_MAX_OUTPUT_BYTES}. */
5237
+ static DEFAULT_MAX_OUTPUT_BYTES = DEFAULT_MAX_OUTPUT_BYTES;
5238
+ /** The placeholder written in place of a redacted secret. See {@link REDACTED}. */
5239
+ static REDACTED = "***";
5240
+ };
5241
+ //#endregion
5242
+ //#region ../../node_modules/.pnpm/@effected+npm@0.8.3_@effected+semver@0.3.2_effect@4.0.0-beta.101__effect@4.0.0-beta.101/node_modules/@effected/npm/ReleaseAgeGate.js
4594
5243
  const MS_PER_MINUTE = 6e4;
4595
5244
  /**
4596
5245
  * A source's partial contribution to a {@link ReleaseAgeGate}: the effective
@@ -4760,7 +5409,7 @@ var ReleaseAgeGate = class ReleaseAgeGate extends effect.Schema.Class("ReleaseAg
4760
5409
  }
4761
5410
  };
4762
5411
  //#endregion
4763
- //#region ../../node_modules/.pnpm/@effected+lockfiles@0.3.1_@effected+jsonc@0.5.2_effect@4.0.0-beta.101__@effected+npm@0._76c3c4c2d3d6f22fa84df3beea811625/node_modules/@effected/lockfiles/ImporterDependency.js
5412
+ //#region ../../node_modules/.pnpm/@effected+lockfiles@0.3.2_@effected+jsonc@0.5.2_effect@4.0.0-beta.101__@effected+npm@0._3c1784fba62fde9a5bac4cf15387fd04/node_modules/@effected/lockfiles/ImporterDependency.js
4764
5413
  /**
4765
5414
  * One declared dependency of one workspace importer, as the lockfile records it.
4766
5415
  *
@@ -4792,13 +5441,13 @@ var ReleaseAgeGate = class ReleaseAgeGate extends effect.Schema.Class("ReleaseAg
4792
5441
  */
4793
5442
  var ImporterDependency = class extends effect.Schema.Class("ImporterDependency")({
4794
5443
  name: effect.Schema.NonEmptyString,
4795
- specifier: DependencySpecifier.FromString,
5444
+ specifier: DependencySpecifier$1.FromString,
4796
5445
  version: effect.Schema.optionalKey(effect.Schema.String),
4797
5446
  peerSuffix: effect.Schema.optionalKey(effect.Schema.String),
4798
- depType: DependencyField
5447
+ depType: DependencyField$1
4799
5448
  }) {};
4800
5449
  //#endregion
4801
- //#region ../../node_modules/.pnpm/@effected+lockfiles@0.3.1_@effected+jsonc@0.5.2_effect@4.0.0-beta.101__@effected+npm@0._76c3c4c2d3d6f22fa84df3beea811625/node_modules/@effected/lockfiles/LockfileImporter.js
5450
+ //#region ../../node_modules/.pnpm/@effected+lockfiles@0.3.2_@effected+jsonc@0.5.2_effect@4.0.0-beta.101__@effected+npm@0._3c1784fba62fde9a5bac4cf15387fd04/node_modules/@effected/lockfiles/LockfileImporter.js
4802
5451
  /**
4803
5452
  * One workspace importer's declared dependencies, as the lockfile records them.
4804
5453
  *
@@ -4822,7 +5471,7 @@ var LockfileImporter = class extends effect.Schema.Class("LockfileImporter")({
4822
5471
  dependencies: effect.Schema.Array(ImporterDependency)
4823
5472
  }) {};
4824
5473
  //#endregion
4825
- //#region ../../node_modules/.pnpm/@effected+lockfiles@0.3.1_@effected+jsonc@0.5.2_effect@4.0.0-beta.101__@effected+npm@0._76c3c4c2d3d6f22fa84df3beea811625/node_modules/@effected/lockfiles/ResolvedPackage.js
5474
+ //#region ../../node_modules/.pnpm/@effected+lockfiles@0.3.2_@effected+jsonc@0.5.2_effect@4.0.0-beta.101__@effected+npm@0._3c1784fba62fde9a5bac4cf15387fd04/node_modules/@effected/lockfiles/ResolvedPackage.js
4826
5475
  const EMPTY_DEPENDENCIES = {};
4827
5476
  /**
4828
5477
  * A package resolved from a lockfile.
@@ -4851,13 +5500,13 @@ const EMPTY_DEPENDENCIES = {};
4851
5500
  var ResolvedPackage = class extends effect.Schema.Class("ResolvedPackage")({
4852
5501
  name: effect.Schema.NonEmptyString,
4853
5502
  version: effect.Schema.String,
4854
- integrity: effect.Schema.optionalKey(IntegrityHash),
5503
+ integrity: effect.Schema.optionalKey(IntegrityHash$1),
4855
5504
  isWorkspace: effect.Schema.Boolean,
4856
5505
  relativePath: effect.Schema.optionalKey(effect.Schema.String),
4857
5506
  dependencies: effect.Schema.Record(effect.Schema.String, effect.Schema.String).pipe(effect.Schema.withDecodingDefaultKey(effect.Effect.succeed(EMPTY_DEPENDENCIES)), effect.Schema.withConstructorDefault(effect.Effect.succeed(EMPTY_DEPENDENCIES)))
4858
5507
  }) {};
4859
5508
  //#endregion
4860
- //#region ../../node_modules/.pnpm/@effected+lockfiles@0.3.1_@effected+jsonc@0.5.2_effect@4.0.0-beta.101__@effected+npm@0._76c3c4c2d3d6f22fa84df3beea811625/node_modules/@effected/lockfiles/WorkspaceDependency.js
5509
+ //#region ../../node_modules/.pnpm/@effected+lockfiles@0.3.2_@effected+jsonc@0.5.2_effect@4.0.0-beta.101__@effected+npm@0._3c1784fba62fde9a5bac4cf15387fd04/node_modules/@effected/lockfiles/WorkspaceDependency.js
4861
5510
  /**
4862
5511
  * A directed dependency edge between two workspace packages as recorded in
4863
5512
  * the lockfile.
@@ -4875,11 +5524,11 @@ var ResolvedPackage = class extends effect.Schema.Class("ResolvedPackage")({
4875
5524
  var WorkspaceDependency = class extends effect.Schema.Class("WorkspaceDependency")({
4876
5525
  from: effect.Schema.NonEmptyString,
4877
5526
  to: effect.Schema.NonEmptyString,
4878
- depType: DependencyField,
5527
+ depType: DependencyField$1,
4879
5528
  constraint: effect.Schema.String
4880
5529
  }) {};
4881
5530
  //#endregion
4882
- //#region ../../node_modules/.pnpm/@effected+lockfiles@0.3.1_@effected+jsonc@0.5.2_effect@4.0.0-beta.101__@effected+npm@0._76c3c4c2d3d6f22fa84df3beea811625/node_modules/@effected/lockfiles/PnpmExtension.js
5531
+ //#region ../../node_modules/.pnpm/@effected+lockfiles@0.3.2_@effected+jsonc@0.5.2_effect@4.0.0-beta.101__@effected+npm@0._3c1784fba62fde9a5bac4cf15387fd04/node_modules/@effected/lockfiles/PnpmExtension.js
4883
5532
  /**
4884
5533
  * Extension data specific to pnpm lockfiles, attached to `Lockfile.extension`
4885
5534
  * when the format is `"pnpm"`.
@@ -4904,7 +5553,7 @@ var PnpmExtension = class extends effect.Schema.Class("PnpmExtension")({
4904
5553
  }))
4905
5554
  }) {};
4906
5555
  //#endregion
4907
- //#region ../../node_modules/.pnpm/@effected+lockfiles@0.3.1_@effected+jsonc@0.5.2_effect@4.0.0-beta.101__@effected+npm@0._76c3c4c2d3d6f22fa84df3beea811625/node_modules/@effected/lockfiles/LockfileFormat.js
5556
+ //#region ../../node_modules/.pnpm/@effected+lockfiles@0.3.2_@effected+jsonc@0.5.2_effect@4.0.0-beta.101__@effected+npm@0._3c1784fba62fde9a5bac4cf15387fd04/node_modules/@effected/lockfiles/LockfileFormat.js
4908
5557
  /**
4909
5558
  * The lockfile formats this package parses: bun's `bun.lock` (JSONC), npm's
4910
5559
  * `package-lock.json` (v2/v3 JSON), pnpm's `pnpm-lock.yaml` and yarn Berry's
@@ -4942,7 +5591,7 @@ const FILENAMES = {
4942
5591
  */
4943
5592
  const filenameFor = (format) => FILENAMES[format][0];
4944
5593
  //#endregion
4945
- //#region ../../node_modules/.pnpm/@effected+lockfiles@0.3.1_@effected+jsonc@0.5.2_effect@4.0.0-beta.101__@effected+npm@0._76c3c4c2d3d6f22fa84df3beea811625/node_modules/@effected/lockfiles/internal/shared.js
5594
+ //#region ../../node_modules/.pnpm/@effected+lockfiles@0.3.2_@effected+jsonc@0.5.2_effect@4.0.0-beta.101__@effected+npm@0._3c1784fba62fde9a5bac4cf15387fd04/node_modules/@effected/lockfiles/internal/shared.js
4946
5595
  /**
4947
5596
  * The four dependency sections of a manifest, in a stable order — the shared
4948
5597
  * dependency-sections table (v3's `DEP_SECTIONS`). Each entry is both the
@@ -4977,9 +5626,9 @@ const DEP_TYPES = [
4977
5626
  */
4978
5627
  const toIntegrityHash = (raw) => {
4979
5628
  if (raw === void 0) return effect.Effect.succeed(void 0);
4980
- return effect.Schema.decodeUnknownEffect(IntegrityHash)(raw).pipe(effect.Effect.mapError(validationFailure));
5629
+ return effect.Schema.decodeUnknownEffect(IntegrityHash$1)(raw).pipe(effect.Effect.mapError(validationFailure));
4981
5630
  };
4982
- const decodeSpecifier = effect.Schema.decodeUnknownExit(DependencySpecifier.FromString);
5631
+ const decodeSpecifier = effect.Schema.decodeUnknownExit(DependencySpecifier$1.FromString);
4983
5632
  /**
4984
5633
  * Split pnpm's peer-disambiguation suffix off a recorded string: everything
4985
5634
  * from the first `(` on is suffix, since package names and versions never
@@ -6871,7 +7520,7 @@ var JsoncModifier = class {
6871
7520
  });
6872
7521
  };
6873
7522
  //#endregion
6874
- //#region ../../node_modules/.pnpm/@effected+lockfiles@0.3.1_@effected+jsonc@0.5.2_effect@4.0.0-beta.101__@effected+npm@0._76c3c4c2d3d6f22fa84df3beea811625/node_modules/@effected/lockfiles/internal/bun.js
7523
+ //#region ../../node_modules/.pnpm/@effected+lockfiles@0.3.2_@effected+jsonc@0.5.2_effect@4.0.0-beta.101__@effected+npm@0._3c1784fba62fde9a5bac4cf15387fd04/node_modules/@effected/lockfiles/internal/bun.js
6875
7524
  const DepRecord$2 = effect.Schema.optionalKey(effect.Schema.Record(effect.Schema.String, effect.Schema.String));
6876
7525
  const BunWorkspaceEntry = effect.Schema.Struct({
6877
7526
  name: effect.Schema.optionalKey(effect.Schema.String),
@@ -6964,7 +7613,7 @@ const toFields$3 = (raw) => effect.Effect.gen(function* () {
6964
7613
  };
6965
7614
  });
6966
7615
  //#endregion
6967
- //#region ../../node_modules/.pnpm/@effected+lockfiles@0.3.1_@effected+jsonc@0.5.2_effect@4.0.0-beta.101__@effected+npm@0._76c3c4c2d3d6f22fa84df3beea811625/node_modules/@effected/lockfiles/internal/npm.js
7616
+ //#region ../../node_modules/.pnpm/@effected+lockfiles@0.3.2_@effected+jsonc@0.5.2_effect@4.0.0-beta.101__@effected+npm@0._3c1784fba62fde9a5bac4cf15387fd04/node_modules/@effected/lockfiles/internal/npm.js
6968
7617
  const DepRecord$1 = effect.Schema.optionalKey(effect.Schema.Record(effect.Schema.String, effect.Schema.String));
6969
7618
  const NpmPackageEntry = effect.Schema.Struct({
6970
7619
  name: effect.Schema.optionalKey(effect.Schema.String),
@@ -13886,7 +14535,7 @@ function deepEqualValues(a, b) {
13886
14535
  return false;
13887
14536
  }
13888
14537
  //#endregion
13889
- //#region ../../node_modules/.pnpm/@effected+lockfiles@0.3.1_@effected+jsonc@0.5.2_effect@4.0.0-beta.101__@effected+npm@0._76c3c4c2d3d6f22fa84df3beea811625/node_modules/@effected/lockfiles/internal/documents.js
14538
+ //#region ../../node_modules/.pnpm/@effected+lockfiles@0.3.2_@effected+jsonc@0.5.2_effect@4.0.0-beta.101__@effected+npm@0._3c1784fba62fde9a5bac4cf15387fd04/node_modules/@effected/lockfiles/internal/documents.js
13890
14539
  /**
13891
14540
  * An empty YAML document composes to `null` (`Yaml.parseAll("")` is `[null]`,
13892
14541
  * and the trailing document of an env-only `pnpm-lock.yaml` is `null` too).
@@ -13956,7 +14605,7 @@ const selectSoleDocument = (content) => effect.Effect.gen(function* () {
13956
14605
  };
13957
14606
  });
13958
14607
  //#endregion
13959
- //#region ../../node_modules/.pnpm/@effected+lockfiles@0.3.1_@effected+jsonc@0.5.2_effect@4.0.0-beta.101__@effected+npm@0._76c3c4c2d3d6f22fa84df3beea811625/node_modules/@effected/lockfiles/internal/pnpm.js
14608
+ //#region ../../node_modules/.pnpm/@effected+lockfiles@0.3.2_@effected+jsonc@0.5.2_effect@4.0.0-beta.101__@effected+npm@0._3c1784fba62fde9a5bac4cf15387fd04/node_modules/@effected/lockfiles/internal/pnpm.js
13960
14609
  const PnpmImporterDeps = effect.Schema.optionalKey(effect.Schema.Record(effect.Schema.String, effect.Schema.Struct({
13961
14610
  specifier: effect.Schema.String,
13962
14611
  version: effect.Schema.String
@@ -14081,7 +14730,7 @@ const toFields$1 = (raw) => effect.Effect.gen(function* () {
14081
14730
  };
14082
14731
  });
14083
14732
  //#endregion
14084
- //#region ../../node_modules/.pnpm/@effected+lockfiles@0.3.1_@effected+jsonc@0.5.2_effect@4.0.0-beta.101__@effected+npm@0._76c3c4c2d3d6f22fa84df3beea811625/node_modules/@effected/lockfiles/internal/yarn.js
14733
+ //#region ../../node_modules/.pnpm/@effected+lockfiles@0.3.2_@effected+jsonc@0.5.2_effect@4.0.0-beta.101__@effected+npm@0._3c1784fba62fde9a5bac4cf15387fd04/node_modules/@effected/lockfiles/internal/yarn.js
14085
14734
  const YarnLockfileRaw = effect.Schema.Record(effect.Schema.String, effect.Schema.Unknown);
14086
14735
  const DepRecord = effect.Schema.optionalKey(effect.Schema.Record(effect.Schema.String, effect.Schema.String));
14087
14736
  const YarnEntry = effect.Schema.Struct({
@@ -14204,7 +14853,7 @@ const cleanYarnDeps = (deps) => {
14204
14853
  return Object.fromEntries(Object.entries(deps).map(([name, value]) => [name, value.startsWith("npm:") ? value.slice(4) : value]));
14205
14854
  };
14206
14855
  //#endregion
14207
- //#region ../../node_modules/.pnpm/@effected+lockfiles@0.3.1_@effected+jsonc@0.5.2_effect@4.0.0-beta.101__@effected+npm@0._76c3c4c2d3d6f22fa84df3beea811625/node_modules/@effected/lockfiles/Lockfile.js
14856
+ //#region ../../node_modules/.pnpm/@effected+lockfiles@0.3.2_@effected+jsonc@0.5.2_effect@4.0.0-beta.101__@effected+npm@0._3c1784fba62fde9a5bac4cf15387fd04/node_modules/@effected/lockfiles/Lockfile.js
14208
14857
  const EMPTY_IMPORTERS = [];
14209
14858
  /**
14210
14859
  * Failure of `Lockfile.parse`: the given content is not a valid lockfile of
@@ -14448,7 +15097,7 @@ var Lockfile = class Lockfile extends effect.Schema.Class("Lockfile")({
14448
15097
  }
14449
15098
  };
14450
15099
  //#endregion
14451
- //#region ../../node_modules/.pnpm/@effected+lockfiles@0.3.1_@effected+jsonc@0.5.2_effect@4.0.0-beta.101__@effected+npm@0._76c3c4c2d3d6f22fa84df3beea811625/node_modules/@effected/lockfiles/LockfileIntegrity.js
15100
+ //#region ../../node_modules/.pnpm/@effected+lockfiles@0.3.2_@effected+jsonc@0.5.2_effect@4.0.0-beta.101__@effected+npm@0._3c1784fba62fde9a5bac4cf15387fd04/node_modules/@effected/lockfiles/LockfileIntegrity.js
14452
15101
  /**
14453
15102
  * The minimal manifest shape {@link LockfileIntegrity.compare} checks a
14454
15103
  * lockfile against: a package name plus the four optional dependency maps.
@@ -14496,7 +15145,7 @@ var LockfileIntegrity = class LockfileIntegrity extends effect.Schema.Class("Loc
14496
15145
  dependency: effect.Schema.String,
14497
15146
  constraint: effect.Schema.String,
14498
15147
  resolved: effect.Schema.String,
14499
- depType: DependencyField
15148
+ depType: DependencyField$1
14500
15149
  }))
14501
15150
  }) {
14502
15151
  /**
@@ -14564,7 +15213,424 @@ var LockfileIntegrity = class LockfileIntegrity extends effect.Schema.Class("Loc
14564
15213
  }
14565
15214
  };
14566
15215
  //#endregion
14567
- //#region ../../node_modules/.pnpm/@effected+package-json@0.7.2_effect@4.0.0-beta.101/node_modules/@effected/package-json/Dependency.js
15216
+ //#region ../../node_modules/.pnpm/@effected+npm@0.8.2_@effected+semver@0.3.2_effect@4.0.0-beta.101__effect@4.0.0-beta.101/node_modules/@effected/npm/CatalogResolver.js
15217
+ /**
15218
+ * Contract for resolving pnpm `catalog:` dependency specifiers to concrete
15219
+ * version ranges.
15220
+ *
15221
+ * `rangeOf` takes a package name and an optional catalog name
15222
+ * (`Option.none()` selects the default catalog) and returns the configured
15223
+ * range as `Option.some`, or `Option.none()` when the specifier is absent
15224
+ * from the catalog. By convention the error channel is reserved for a
15225
+ * failure in the resolution mechanism itself — an unmatched package or
15226
+ * catalog name is an `Option.none()` success, never an error. A failure to
15227
+ * *assemble* the catalogs (an unreadable or malformed catalog source)
15228
+ * surfaces typed as a {@link CatalogAssemblyError}; any other mechanism
15229
+ * failure is a {@link DependencyResolutionError}.
15230
+ *
15231
+ * This is a contract-only service: {@link CatalogResolver.noop} is the sole
15232
+ * implementation this package ships, and it resolves nothing. Real consumers
15233
+ * (e.g. `@effected/workspaces`) provide a working implementation at the
15234
+ * application boundary.
15235
+ *
15236
+ * @example
15237
+ * ```ts
15238
+ * import { Effect, Option } from "effect";
15239
+ * import { CatalogResolver } from "@effected/npm";
15240
+ *
15241
+ * const program = Effect.gen(function* () {
15242
+ * const resolver = yield* CatalogResolver;
15243
+ * return yield* resolver.rangeOf("effect", Option.none());
15244
+ * });
15245
+ *
15246
+ * Effect.runPromise(Effect.provide(program, CatalogResolver.noop));
15247
+ * // => Option.none()
15248
+ * ```
15249
+ *
15250
+ * @public
15251
+ */
15252
+ var CatalogResolver = class CatalogResolver extends effect.Context.Service()("@effected/npm/CatalogResolver") {
15253
+ /**
15254
+ * No-op default: `rangeOf` always succeeds with `Option.none()`, never
15255
+ * consulting an actual catalog. A pure `Layer.succeed`, bound to a const
15256
+ * so it memoizes by reference — the layer is built once, not once per
15257
+ * reference to `CatalogResolver.noop`.
15258
+ */
15259
+ static noop = effect.Layer.succeed(CatalogResolver, { rangeOf: () => effect.Effect.succeed(effect.Option.none()) });
15260
+ };
15261
+ effect.Schema.TaggedErrorClass()("DependencyResolutionError", {
15262
+ specifier: effect.Schema.String,
15263
+ cause: effect.Schema.Defect()
15264
+ });
15265
+ /**
15266
+ * Contract for resolving pnpm `workspace:` dependency specifiers to concrete
15267
+ * versions.
15268
+ *
15269
+ * `versionOf` takes a workspace package name and returns its concrete
15270
+ * version (the range modifier stripped) as `Option.some`, or
15271
+ * `Option.none()` when the name is not a known workspace member.
15272
+ *
15273
+ * This is a contract-only service: {@link WorkspaceResolver.noop} is the
15274
+ * sole implementation this package ships, and it resolves nothing. Real
15275
+ * consumers (e.g. `@effected/workspaces`) provide a working implementation
15276
+ * at the application boundary.
15277
+ *
15278
+ * @example
15279
+ * ```ts
15280
+ * import { Effect } from "effect";
15281
+ * import { WorkspaceResolver } from "@effected/npm";
15282
+ *
15283
+ * const program = Effect.gen(function* () {
15284
+ * const resolver = yield* WorkspaceResolver;
15285
+ * return yield* resolver.versionOf("@effected/semver");
15286
+ * });
15287
+ *
15288
+ * Effect.runPromise(Effect.provide(program, WorkspaceResolver.noop));
15289
+ * // => Option.none()
15290
+ * ```
15291
+ *
15292
+ * @public
15293
+ */
15294
+ var WorkspaceResolver = class WorkspaceResolver extends effect.Context.Service()("@effected/npm/WorkspaceResolver") {
15295
+ /**
15296
+ * No-op default: `versionOf` always succeeds with `Option.none()`, never
15297
+ * consulting an actual workspace. A pure `Layer.succeed`, bound to a
15298
+ * const so it memoizes by reference.
15299
+ */
15300
+ static noop = effect.Layer.succeed(WorkspaceResolver, { versionOf: () => effect.Effect.succeed(effect.Option.none()) });
15301
+ };
15302
+ //#endregion
15303
+ //#region ../../node_modules/.pnpm/@effected+npm@0.8.2_@effected+semver@0.3.2_effect@4.0.0-beta.101__effect@4.0.0-beta.101/node_modules/@effected/npm/DependencySection.js
15304
+ /**
15305
+ * The short dependency kind: which dependency map an entry came from, named the
15306
+ * way consumers branch on it.
15307
+ *
15308
+ * @public
15309
+ */
15310
+ const DependencyKind = effect.Schema.Literals([
15311
+ "prod",
15312
+ "dev",
15313
+ "peer",
15314
+ "optional"
15315
+ ]);
15316
+ effect.Schema.Literals([
15317
+ "dependencies",
15318
+ "devDependencies",
15319
+ "peerDependencies",
15320
+ "optionalDependencies"
15321
+ ]);
15322
+ Object.fromEntries(Object.entries({
15323
+ prod: "dependencies",
15324
+ dev: "devDependencies",
15325
+ peer: "peerDependencies",
15326
+ optional: "optionalDependencies"
15327
+ }).map(([kind, field]) => [field, kind]));
15328
+ //#endregion
15329
+ //#region ../../node_modules/.pnpm/@effected+npm@0.8.2_@effected+semver@0.3.2_effect@4.0.0-beta.101__effect@4.0.0-beta.101/node_modules/@effected/npm/DependencySpecifier.js
15330
+ /**
15331
+ * Indicates that a string could not be parsed as a valid dependency specifier.
15332
+ *
15333
+ * Raised by {@link DependencySpecifier.decode}. The offending string is
15334
+ * preserved on `input`.
15335
+ *
15336
+ * @public
15337
+ */
15338
+ var InvalidDependencySpecifierError = class extends effect.Schema.TaggedErrorClass()("InvalidDependencySpecifierError", {
15339
+ /** The raw input string that failed validation. */
15340
+ input: effect.Schema.String }) {
15341
+ get message() {
15342
+ return `Invalid dependency specifier "${this.input}": not a recognized specifier`;
15343
+ }
15344
+ };
15345
+ const CATALOG_PREFIX = "catalog:";
15346
+ const WORKSPACE_PREFIX = "workspace:";
15347
+ const isBarePath = (value) => value.startsWith("./") || value.startsWith("../") || value.startsWith("~/") || value.startsWith("/");
15348
+ const isGitHubShorthand = (value) => !value.startsWith(".") && !value.startsWith("~") && !value.startsWith("/") && /^[a-zA-Z0-9_.-]+\/[a-zA-Z0-9_.-]+(#.*)?$/.test(value);
15349
+ const isGit = (value) => value.startsWith("git+") || value.startsWith("git://") || value.startsWith("github:") || value.startsWith("gist:") || value.startsWith("bitbucket:") || value.startsWith("gitlab:") || isGitHubShorthand(value);
15350
+ const isLocal = (value) => value.startsWith("file:") || value.startsWith("link:") || value.startsWith("portal:") || isBarePath(value);
15351
+ const isLink = (value) => value.startsWith("link:");
15352
+ const isPortal = (value) => value.startsWith("portal:");
15353
+ const isCatalog = (value) => value.startsWith(CATALOG_PREFIX);
15354
+ const isWorkspace = (value) => value.startsWith(WORKSPACE_PREFIX);
15355
+ const isUrl$1 = (value) => value.startsWith("http://") || value.startsWith("https://");
15356
+ const parseRange = (value) => {
15357
+ const exit = effect.Schema.decodeUnknownExit(Range$2.FromString)(value);
15358
+ return effect.Exit.isSuccess(exit) ? effect.Option.some(exit.value) : effect.Option.none();
15359
+ };
15360
+ const isRange = (value) => effect.Option.isSome(parseRange(value));
15361
+ const protocolOf = (value) => {
15362
+ if (value.startsWith(CATALOG_PREFIX)) return "catalog";
15363
+ if (value.startsWith(WORKSPACE_PREFIX)) return "workspace";
15364
+ if (value.startsWith("link:")) return "link";
15365
+ if (value.startsWith("portal:")) return "portal";
15366
+ if (value.startsWith("file:") || isBarePath(value)) return "file";
15367
+ if (value.startsWith("npm:")) return "npm";
15368
+ if (isGit(value)) return "git";
15369
+ if (isUrl$1(value)) return "url";
15370
+ if (isRange(value)) return "range";
15371
+ if (/^[a-zA-Z][a-zA-Z0-9._-]*$/.test(value)) return "tag";
15372
+ return "unknown";
15373
+ };
15374
+ const isTag = (value) => protocolOf(value) === "tag";
15375
+ const catalogNameOf$1 = (specifier) => {
15376
+ if (!isCatalog(specifier)) return effect.Option.none();
15377
+ const rest = specifier.slice(8).trim();
15378
+ return rest.length === 0 ? effect.Option.none() : effect.Option.some(rest);
15379
+ };
15380
+ const projectRangeModifier = (range, version) => range === "*" || range === "" ? version : range === "~" ? `~${version}` : range === "^" ? `^${version}` : range;
15381
+ const splitWorkspaceRest = (rest) => {
15382
+ const at = rest.lastIndexOf("@");
15383
+ return at > 0 ? {
15384
+ target: rest.slice(0, at),
15385
+ range: rest.slice(at + 1)
15386
+ } : {
15387
+ target: void 0,
15388
+ range: rest
15389
+ };
15390
+ };
15391
+ const projectWorkspaceRange = (rest, version) => {
15392
+ const { target, range } = splitWorkspaceRest(rest);
15393
+ const projected = projectRangeModifier(range, version);
15394
+ return target === void 0 ? projected : `npm:${target}@${projected}`;
15395
+ };
15396
+ const resolveWorkspace = (specifier, version) => isWorkspace(specifier) ? projectWorkspaceRange(specifier.slice(10), version) : specifier;
15397
+ const workspaceTargetOf = (specifier) => {
15398
+ if (!isWorkspace(specifier)) return effect.Option.none();
15399
+ const { target } = splitWorkspaceRest(specifier.slice(10));
15400
+ return target === void 0 ? effect.Option.none() : effect.Option.some(target);
15401
+ };
15402
+ /**
15403
+ * Whether a string is a recognized dependency specifier: a semver range, exact
15404
+ * version, dist-tag, URL, git ref, GitHub shorthand, file path, or an
15405
+ * `npm:` / `catalog:` / `workspace:` protocol.
15406
+ *
15407
+ * @public
15408
+ */
15409
+ const isValidDependencySpecifier = (value) => value.length > 0 && protocolOf(value) !== "unknown";
15410
+ /**
15411
+ * A `catalog:` reference. `name` carries the catalog name, or `Option.none()`
15412
+ * for the default catalog (`catalog:`).
15413
+ *
15414
+ * @public
15415
+ */
15416
+ var CatalogSpecifier = class extends effect.Schema.TaggedClass()("catalog", {
15417
+ /** The original specifier string. */
15418
+ raw: effect.Schema.String,
15419
+ /** The catalog name, or `Option.none()` for the default catalog. */
15420
+ name: effect.Schema.Option(effect.Schema.String)
15421
+ }) {};
15422
+ /**
15423
+ * A `workspace:` reference. `range` carries the part after `workspace:` — a
15424
+ * range modifier (`*`, `^`, `~`), a concrete range, or an alias form.
15425
+ *
15426
+ * @public
15427
+ */
15428
+ var WorkspaceSpecifier = class extends effect.Schema.TaggedClass()("workspace", {
15429
+ /** The original specifier string. */
15430
+ raw: effect.Schema.String,
15431
+ /** The part after `workspace:` (e.g. `*`, `^1.2.3`, or an alias form). */
15432
+ range: effect.Schema.String
15433
+ }) {
15434
+ /**
15435
+ * The pnpm publish-time projection of this specifier against a concrete
15436
+ * workspace version: `*` (or an empty range) becomes `version`, `~` becomes
15437
+ * `~version`, `^` becomes `^version`, and a pinned range passes through
15438
+ * unchanged. The alias form (`workspace:<name>@<range>`) becomes pnpm's
15439
+ * publish-time aliased dependency `npm:<name>@<projected>`, with the range
15440
+ * modifier projected the same way — `version` must then be the TARGET
15441
+ * package's version (see `DependencySpecifier.workspaceTargetOf`).
15442
+ *
15443
+ * @remarks
15444
+ * The same projection as `DependencySpecifier.resolveWorkspace`, applied to
15445
+ * this instance's already-extracted `range`; the two share one internal
15446
+ * implementation.
15447
+ *
15448
+ * @param version - The concrete version of the workspace package the
15449
+ * specifier points at (the alias target's version for the alias form).
15450
+ */
15451
+ resolve(version) {
15452
+ return projectWorkspaceRange(this.range, version);
15453
+ }
15454
+ };
15455
+ /**
15456
+ * A plain semver range or exact version (e.g. `^1.2.3`, `1.x`, `>=1 <2`).
15457
+ *
15458
+ * @public
15459
+ */
15460
+ var RangeSpecifier = class extends effect.Schema.TaggedClass()("range", {
15461
+ /** The original specifier string. */
15462
+ raw: effect.Schema.String }) {};
15463
+ /**
15464
+ * A bare dist-tag (e.g. `latest`, `next`).
15465
+ *
15466
+ * @public
15467
+ */
15468
+ var DistTagSpecifier = class extends effect.Schema.TaggedClass()("dist-tag", {
15469
+ /** The original specifier string (also the tag name). */
15470
+ raw: effect.Schema.String }) {};
15471
+ /**
15472
+ * The honest fallback for `file:` / `link:` / `portal:` / git / URL / `npm:`
15473
+ * forms this concept does not further interpret.
15474
+ *
15475
+ * @public
15476
+ */
15477
+ var RawSpecifier = class extends effect.Schema.TaggedClass()("raw", {
15478
+ /** The original specifier string. */
15479
+ raw: effect.Schema.String }) {};
15480
+ const Classified = effect.Schema.Union([
15481
+ CatalogSpecifier,
15482
+ WorkspaceSpecifier,
15483
+ RangeSpecifier,
15484
+ DistTagSpecifier,
15485
+ RawSpecifier
15486
+ ]);
15487
+ const classify$1 = (value) => {
15488
+ if (isCatalog(value)) return CatalogSpecifier.make({
15489
+ raw: value,
15490
+ name: catalogNameOf$1(value)
15491
+ });
15492
+ if (isWorkspace(value)) return WorkspaceSpecifier.make({
15493
+ raw: value,
15494
+ range: value.slice(10)
15495
+ });
15496
+ if (isRange(value)) return RangeSpecifier.make({ raw: value });
15497
+ if (isTag(value)) return DistTagSpecifier.make({ raw: value });
15498
+ return RawSpecifier.make({ raw: value });
15499
+ };
15500
+ const fromString = effect.Schema.String.pipe(effect.Schema.decodeTo(Classified, effect.SchemaTransformation.transformOrFail({
15501
+ decode: (input) => isValidDependencySpecifier(input) ? effect.Effect.succeed(classify$1(input)) : effect.Effect.fail(new effect.SchemaIssue.InvalidValue(effect.Option.some(input), { message: `Invalid dependency specifier: "${input}"` })),
15502
+ encode: (classified) => effect.Effect.succeed(classified.raw)
15503
+ })));
15504
+ const brandedSpecifier = effect.Schema.String.pipe(effect.Schema.check(effect.Schema.makeFilter((value) => isValidDependencySpecifier(value) ? void 0 : "Expected a valid dependency specifier")), effect.Schema.brand("DependencySpecifier"));
15505
+ const decode$3 = (input) => effect.Schema.decodeUnknownEffect(brandedSpecifier)(input).pipe(effect.Effect.mapError(() => new InvalidDependencySpecifierError({ input })));
15506
+ /**
15507
+ * A valid dependency version specifier, carrying the protocol taxonomy statics
15508
+ * (`DependencySpecifier.protocolOf` and friends) that classify any specifier
15509
+ * string, plus the {@link (DependencySpecifier:variable).FromString} codec that
15510
+ * decodes a string into a {@link ClassifiedSpecifier} tagged union. Use it as a
15511
+ * schema for a specifier field and reach for the statics to inspect a raw
15512
+ * string.
15513
+ *
15514
+ * @public
15515
+ */
15516
+ const DependencySpecifier = Object.assign(brandedSpecifier, {
15517
+ protocolOf,
15518
+ parseRange,
15519
+ isRange,
15520
+ isTag,
15521
+ isGit,
15522
+ isUrl: isUrl$1,
15523
+ isLocal,
15524
+ isLink,
15525
+ isPortal,
15526
+ isCatalog,
15527
+ isWorkspace,
15528
+ catalogNameOf: catalogNameOf$1,
15529
+ resolveWorkspace,
15530
+ workspaceTargetOf,
15531
+ isValid: isValidDependencySpecifier,
15532
+ decode: decode$3,
15533
+ FromString: fromString
15534
+ });
15535
+ //#endregion
15536
+ //#region ../../node_modules/.pnpm/@effected+npm@0.8.2_@effected+semver@0.3.2_effect@4.0.0-beta.101__effect@4.0.0-beta.101/node_modules/@effected/npm/IntegrityHash.js
15537
+ const SRI_RE = /^(sha1|sha256|sha384|sha512)-[A-Za-z0-9+/]+={0,2}$/;
15538
+ const COREPACK_RE = /^(sha1|sha224|sha256|sha384|sha512)\.[0-9a-f]+$/;
15539
+ const YARN_RE = /^[0-9]+(c[0-9]+)?\/[0-9a-f]+$/;
15540
+ const isSri = (value) => SRI_RE.test(value);
15541
+ const isCorepack = (value) => COREPACK_RE.test(value);
15542
+ const isYarnChecksum = (value) => YARN_RE.test(value);
15543
+ /**
15544
+ * Whether a string is a valid integrity hash in the SRI (`<algo>-<base64>`),
15545
+ * corepack (`<algo>.<hex>`) or yarn (`<cachekey>/<hex>`) form.
15546
+ *
15547
+ * @public
15548
+ */
15549
+ const isValidIntegrityHash = (value) => isSri(value) || isCorepack(value) || isYarnChecksum(value);
15550
+ const algorithmOf = (value) => {
15551
+ if (isSri(value)) return effect.Option.some(value.slice(0, value.indexOf("-")));
15552
+ if (isCorepack(value)) return effect.Option.some(value.slice(0, value.indexOf(".")));
15553
+ return effect.Option.none();
15554
+ };
15555
+ /**
15556
+ * Indicates that a string could not be parsed as a valid integrity hash.
15557
+ *
15558
+ * Raised by {@link IntegrityHash.decode}. The offending string is preserved on
15559
+ * `input`.
15560
+ *
15561
+ * @public
15562
+ */
15563
+ var InvalidIntegrityHashError = class extends effect.Schema.TaggedErrorClass()("InvalidIntegrityHashError", {
15564
+ /** The raw input string that failed validation. */
15565
+ input: effect.Schema.String }) {
15566
+ get message() {
15567
+ return `Invalid integrity hash "${this.input}": expected an SRI (<algo>-<base64>), corepack (<algo>.<hex>) or yarn (<cachekey>/<hex>) form`;
15568
+ }
15569
+ };
15570
+ const brandedIntegrity = effect.Schema.String.pipe(effect.Schema.check(effect.Schema.makeFilter((value) => isValidIntegrityHash(value) ? void 0 : "Expected an SRI, corepack or yarn integrity hash")), effect.Schema.brand("IntegrityHash"));
15571
+ const decode$2 = (input) => effect.Schema.decodeUnknownEffect(brandedIntegrity)(input).pipe(effect.Effect.mapError(() => new InvalidIntegrityHashError({ input })));
15572
+ Object.assign(brandedIntegrity, {
15573
+ isSri,
15574
+ isCorepack,
15575
+ isYarnChecksum,
15576
+ isValid: isValidIntegrityHash,
15577
+ algorithmOf,
15578
+ decode: decode$2
15579
+ });
15580
+ /**
15581
+ * {@link (IntegrityHash:variable)} narrowed to the corepack `<algo>.<hex>` form
15582
+ * — `sha512.deadbeef`, and corepack's own sha224 default pins
15583
+ * (`sha224.877304e3…`). An SRI (`sha512-<base64>`) or yarn (`10c0/<hex>`)
15584
+ * hash, both valid `IntegrityHash` values, fails this schema.
15585
+ *
15586
+ * @remarks
15587
+ * The corepack pin tail (`<name>@<version>+<integrity>`) is the one place the
15588
+ * kit meets this form, and two schemas name it: `PackageManagerPin.integrity`
15589
+ * here and `@effected/package-json`'s `PackageManager.integrity`. Both consume
15590
+ * **this** schema — the restriction existed privately in each module until they
15591
+ * were consolidated, and a private copy is exactly how the two drift (the
15592
+ * widening that admitted sha224 had to be made twice).
15593
+ *
15594
+ * It decodes to the same {@link IntegrityHashBrand} the unrestricted schema
15595
+ * does, so a corepack-validated value assigns anywhere an `IntegrityHash` is
15596
+ * expected; there is no second brand. Reach for
15597
+ * `IntegrityHash.isCorepack(value)` to ask the same question about a raw
15598
+ * string without decoding.
15599
+ *
15600
+ * That single brand is also why sharing this schema is not type-enforced, and
15601
+ * the consequence is sharper than it looks: a `Schema.check` is **erased from
15602
+ * the built type**, so this schema and the unrestricted one are the same
15603
+ * declared type. A consumer that quietly reverts to a private copy compiles
15604
+ * clean, and — if the copy is faithful — passes every rejection test too.
15605
+ * Neither `tsc` nor behaviour can see the re-fork.
15606
+ *
15607
+ * What does see it is **object identity**, so each consumer's suite asserts
15608
+ * that its field schema IS this export:
15609
+ * `PackageManagerPin.fields.integrity.schema === CorepackIntegrityHash` (an
15610
+ * `optionalKey` field keeps the inner schema on `.schema`), and
15611
+ * `PackageManager.fields.integrity.value === CorepackIntegrityHash` on the
15612
+ * `@effected/package-json` side (a `Schema.Option` keeps it on `.value`). Both
15613
+ * assertions carry a control against the unrestricted brand, so they discriminate
15614
+ * rather than passing on any schema at all. That identity assertion is the only
15615
+ * thing standing between the two surfaces and a silent re-fork; do not replace
15616
+ * it with a behavioural test, which cannot fail.
15617
+ *
15618
+ * @example
15619
+ * ```ts
15620
+ * import { CorepackIntegrityHash } from "@effected/npm";
15621
+ * import { Schema } from "effect";
15622
+ *
15623
+ * const decode = Schema.decodeUnknownExit(CorepackIntegrityHash);
15624
+ *
15625
+ * decode("sha512.deadbeef"); // success
15626
+ * decode("sha512-3q2+7w=="); // failure — SRI form
15627
+ * ```
15628
+ *
15629
+ * @public
15630
+ */
15631
+ const CorepackIntegrityHash = brandedIntegrity.pipe(effect.Schema.check(effect.Schema.makeFilter((value) => isCorepack(value) ? void 0 : "Expected a corepack (<algo>.<hex>) integrity hash")));
15632
+ //#endregion
15633
+ //#region ../../node_modules/.pnpm/@effected+package-json@0.7.3_effect@4.0.0-beta.101/node_modules/@effected/package-json/Dependency.js
14568
15634
  /**
14569
15635
  * A resolved dependency entry pairing a package name with its version
14570
15636
  * specifier and the `kind` of map it came from (`@effected/npm`'s
@@ -14628,7 +15694,7 @@ var Dependency = class extends effect.Schema.Class("Dependency")({
14628
15694
  }
14629
15695
  };
14630
15696
  //#endregion
14631
- //#region ../../node_modules/.pnpm/@effected+package-json@0.7.2_effect@4.0.0-beta.101/node_modules/@effected/package-json/DevEngines.js
15697
+ //#region ../../node_modules/.pnpm/@effected+package-json@0.7.3_effect@4.0.0-beta.101/node_modules/@effected/package-json/DevEngines.js
14632
15698
  /**
14633
15699
  * A single `devEngines` constraint with a name and optional `version` / `onFail`.
14634
15700
  *
@@ -16183,7 +17249,7 @@ effect.Schema.String.pipe(effect.Schema.decodeTo(SpdxExpressionUnion, effect.Sch
16183
17249
  encode: (expression) => effect.Effect.succeed(serialize$1(expression))
16184
17250
  })));
16185
17251
  //#endregion
16186
- //#region ../../node_modules/.pnpm/@effected+package-json@0.7.2_effect@4.0.0-beta.101/node_modules/@effected/package-json/License.js
17252
+ //#region ../../node_modules/.pnpm/@effected+package-json@0.7.3_effect@4.0.0-beta.101/node_modules/@effected/package-json/License.js
16187
17253
  /**
16188
17254
  * Indicates that a string is not a valid SPDX license identifier or expression.
16189
17255
  *
@@ -16218,7 +17284,7 @@ const isValidSpdx = (value) => {
16218
17284
  */
16219
17285
  const SpdxLicense = effect.Schema.String.pipe(effect.Schema.check(effect.Schema.makeFilter((value) => isValidSpdx(value) ? void 0 : "Expected a valid SPDX license expression")), effect.Schema.brand("SpdxLicense"));
16220
17286
  //#endregion
16221
- //#region ../../node_modules/.pnpm/@effected+package-json@0.7.2_effect@4.0.0-beta.101/node_modules/@effected/package-json/PackageManager.js
17287
+ //#region ../../node_modules/.pnpm/@effected+package-json@0.7.3_effect@4.0.0-beta.101/node_modules/@effected/package-json/PackageManager.js
16222
17288
  const PACKAGE_MANAGER_NAME_RE = /^[a-z]+$/;
16223
17289
  const invalid$1 = (input, message) => effect.Effect.fail(new effect.SchemaIssue.InvalidValue(effect.Option.some(input), { message }));
16224
17290
  /**
@@ -16329,7 +17395,7 @@ var PackageManager = class PackageManager extends effect.Schema.Class("PackageMa
16329
17395
  }
16330
17396
  };
16331
17397
  //#endregion
16332
- //#region ../../node_modules/.pnpm/@effected+package-json@0.7.2_effect@4.0.0-beta.101/node_modules/@effected/package-json/PackageName.js
17398
+ //#region ../../node_modules/.pnpm/@effected+package-json@0.7.3_effect@4.0.0-beta.101/node_modules/@effected/package-json/PackageName.js
16333
17399
  /**
16334
17400
  * Indicates that a string could not be used as a valid npm package name.
16335
17401
  *
@@ -16387,7 +17453,7 @@ const PackageName = Object.assign(effect.Schema.Union([ScopedPackageName, Unscop
16387
17453
  isScoped
16388
17454
  });
16389
17455
  //#endregion
16390
- //#region ../../node_modules/.pnpm/@effected+package-json@0.7.2_effect@4.0.0-beta.101/node_modules/@effected/package-json/Person.js
17456
+ //#region ../../node_modules/.pnpm/@effected+package-json@0.7.3_effect@4.0.0-beta.101/node_modules/@effected/package-json/Person.js
16391
17457
  const parsePersonString = (input) => {
16392
17458
  const emailMatch = input.match(/<([^>]+)>/);
16393
17459
  const urlMatch = input.match(/\(([^)]+)\)/);
@@ -16533,7 +17599,7 @@ var Person = class Person extends effect.Schema.Class("Person")({
16533
17599
  }
16534
17600
  };
16535
17601
  //#endregion
16536
- //#region ../../node_modules/.pnpm/@effected+package-json@0.7.2_effect@4.0.0-beta.101/node_modules/@effected/package-json/Repository.js
17602
+ //#region ../../node_modules/.pnpm/@effected+package-json@0.7.3_effect@4.0.0-beta.101/node_modules/@effected/package-json/Repository.js
16537
17603
  /** The shorthand hosts npm resolves without a scheme. */
16538
17604
  const SHORTHAND_HOSTS = /* @__PURE__ */ new Map([
16539
17605
  ["github", "https://github.com"],
@@ -16708,7 +17774,7 @@ var Bugs = class Bugs extends effect.Schema.Class("Bugs")({
16708
17774
  })));
16709
17775
  };
16710
17776
  //#endregion
16711
- //#region ../../node_modules/.pnpm/@effected+package-json@0.7.2_effect@4.0.0-beta.101/node_modules/@effected/package-json/internal/format.js
17777
+ //#region ../../node_modules/.pnpm/@effected+package-json@0.7.3_effect@4.0.0-beta.101/node_modules/@effected/package-json/internal/format.js
16712
17778
  const KEY_INDEX = new Map([
16713
17779
  "$schema",
16714
17780
  "name",
@@ -16931,7 +17997,7 @@ const renderJson = (raw, options) => {
16931
17997
  return options.newline ? `${json}\n` : json;
16932
17998
  };
16933
17999
  //#endregion
16934
- //#region ../../node_modules/.pnpm/@effected+package-json@0.7.2_effect@4.0.0-beta.101/node_modules/@effected/package-json/Package.js
18000
+ //#region ../../node_modules/.pnpm/@effected+package-json@0.7.3_effect@4.0.0-beta.101/node_modules/@effected/package-json/Package.js
16935
18001
  const toHashMap = effect.SchemaTransformation.transform({
16936
18002
  decode: (record) => effect.HashMap.fromIterable(Object.entries(record)),
16937
18003
  encode: (map) => Object.fromEntries(effect.HashMap.toEntries(map))
@@ -17247,7 +18313,7 @@ var Package = class Package extends effect.Schema.Class("Package")({
17247
18313
  }
17248
18314
  };
17249
18315
  //#endregion
17250
- //#region ../../node_modules/.pnpm/@effected+workspaces@0.9.4_@effected+jsonc@0.5.2_effect@4.0.0-beta.101__effect@4.0.0-beta.101/node_modules/@effected/workspaces/WorkspacePackage.js
18316
+ //#region ../../node_modules/.pnpm/@effected+workspaces@0.10.0_@effected+jsonc@0.5.2_effect@4.0.0-beta.101__effect@4.0.0-beta.101/node_modules/@effected/workspaces/WorkspacePackage.js
17251
18317
  const EMPTY$1 = Object.freeze(Object.create(null));
17252
18318
  const EMPTY_MANIFEST = Object.freeze(Object.create(null));
17253
18319
  /**
@@ -17845,7 +18911,7 @@ var Walker$1 = class {
17845
18911
  static findRoot = findRoot$1;
17846
18912
  };
17847
18913
  //#endregion
17848
- //#region ../../node_modules/.pnpm/@effected+workspaces@0.9.4_@effected+jsonc@0.5.2_effect@4.0.0-beta.101__effect@4.0.0-beta.101/node_modules/@effected/workspaces/WorkspaceRoot.js
18914
+ //#region ../../node_modules/.pnpm/@effected+workspaces@0.10.0_@effected+jsonc@0.5.2_effect@4.0.0-beta.101__effect@4.0.0-beta.101/node_modules/@effected/workspaces/WorkspaceRoot.js
17849
18915
  /**
17850
18916
  * The marker filenames {@link WorkspaceRoot} probes for, in priority order.
17851
18917
  *
@@ -18032,7 +19098,7 @@ var WorkspaceRoot = class WorkspaceRoot extends effect.Context.Service()("@effec
18032
19098
  static layerTest = (root) => effect.Layer.effect(WorkspaceRoot, WorkspaceRoot.makeTest(root)).pipe(effect.Layer.provide(effect.Path.layer));
18033
19099
  };
18034
19100
  //#endregion
18035
- //#region ../../node_modules/.pnpm/@effected+workspaces@0.9.4_@effected+jsonc@0.5.2_effect@4.0.0-beta.101__effect@4.0.0-beta.101/node_modules/@effected/workspaces/internal/limits.js
19101
+ //#region ../../node_modules/.pnpm/@effected+workspaces@0.10.0_@effected+jsonc@0.5.2_effect@4.0.0-beta.101__effect@4.0.0-beta.101/node_modules/@effected/workspaces/internal/limits.js
18036
19102
  /**
18037
19103
  * Hard ceiling on directories the enumerator will visit for one pattern set.
18038
19104
  * Guards the pathological case a depth cap alone does not: a wide, shallow
@@ -18050,7 +19116,7 @@ const MAX_ENUMERATION_ENTRIES = 1e5;
18050
19116
  */
18051
19117
  const PRUNED_DIRECTORIES = /* @__PURE__ */ new Set([".git", "node_modules"]);
18052
19118
  //#endregion
18053
- //#region ../../node_modules/.pnpm/@effected+workspaces@0.9.4_@effected+jsonc@0.5.2_effect@4.0.0-beta.101__effect@4.0.0-beta.101/node_modules/@effected/workspaces/internal/traverse.js
19119
+ //#region ../../node_modules/.pnpm/@effected+workspaces@0.10.0_@effected+jsonc@0.5.2_effect@4.0.0-beta.101__effect@4.0.0-beta.101/node_modules/@effected/workspaces/internal/traverse.js
18054
19120
  /** Directory names never descended into. */
18055
19121
  const isPruned = (entry) => PRUNED_DIRECTORIES.has(entry);
18056
19122
  /** Join root-relative POSIX segments; `""` is the root itself. */
@@ -18140,7 +19206,7 @@ var Traversal = class {
18140
19206
  }
18141
19207
  };
18142
19208
  //#endregion
18143
- //#region ../../node_modules/.pnpm/@effected+workspaces@0.9.4_@effected+jsonc@0.5.2_effect@4.0.0-beta.101__effect@4.0.0-beta.101/node_modules/@effected/workspaces/internal/enumerate.js
19209
+ //#region ../../node_modules/.pnpm/@effected+workspaces@0.10.0_@effected+jsonc@0.5.2_effect@4.0.0-beta.101__effect@4.0.0-beta.101/node_modules/@effected/workspaces/internal/enumerate.js
18144
19210
  /** Strip a trailing slash from `GlobPattern.enumerationPrefix` to get a relative directory. */
18145
19211
  const baseOf = (pattern) => pattern.enumerationPrefix.replace(/\/$/, "");
18146
19212
  /**
@@ -18210,7 +19276,7 @@ const enumerate = (root, globs, options) => effect.Effect.gen(function* () {
18210
19276
  return results;
18211
19277
  });
18212
19278
  //#endregion
18213
- //#region ../../node_modules/.pnpm/@effected+workspaces@0.9.4_@effected+jsonc@0.5.2_effect@4.0.0-beta.101__effect@4.0.0-beta.101/node_modules/@effected/workspaces/internal/patterns.js
19279
+ //#region ../../node_modules/.pnpm/@effected+workspaces@0.10.0_@effected+jsonc@0.5.2_effect@4.0.0-beta.101__effect@4.0.0-beta.101/node_modules/@effected/workspaces/internal/patterns.js
18214
19280
  const stringsOf = (value) => Array.isArray(value) ? value.filter((entry) => typeof entry === "string") : void 0;
18215
19281
  /** The `packages:` list of a `pnpm-workspace.yaml` document. Total on a parsed document. */
18216
19282
  const pnpmPatternsOf = (document) => {
@@ -18267,7 +19333,7 @@ const readPatterns = (root) => effect.Effect.gen(function* () {
18267
19333
  return manifestPatternsOf(manifest);
18268
19334
  });
18269
19335
  //#endregion
18270
- //#region ../../node_modules/.pnpm/@effected+workspaces@0.9.4_@effected+jsonc@0.5.2_effect@4.0.0-beta.101__effect@4.0.0-beta.101/node_modules/@effected/workspaces/WorkspaceDiscovery.js
19336
+ //#region ../../node_modules/.pnpm/@effected+workspaces@0.10.0_@effected+jsonc@0.5.2_effect@4.0.0-beta.101__effect@4.0.0-beta.101/node_modules/@effected/workspaces/WorkspaceDiscovery.js
18271
19337
  /**
18272
19338
  * Raised when a workspace member's `package.json` cannot be read, parsed, or
18273
19339
  * used — it is missing, malformed, or lacks a `name` or `version`.
@@ -18520,6 +19586,15 @@ var WorkspaceDiscovery = class WorkspaceDiscovery extends effect.Context.Service
18520
19586
  for (const entry of index) if (filePath.startsWith(entry.prefix)) return effect.Option.some(entry.package);
18521
19587
  return effect.Option.none();
18522
19588
  };
19589
+ const packageIndexes = /* @__PURE__ */ new WeakMap();
19590
+ const packagesByName = (all) => {
19591
+ const cached = packageIndexes.get(all);
19592
+ if (cached !== void 0) return cached;
19593
+ const index = /* @__PURE__ */ new Map();
19594
+ for (const pkg of all) if (!index.has(pkg.name)) index.set(pkg.name, pkg);
19595
+ packageIndexes.set(all, index);
19596
+ return index;
19597
+ };
18523
19598
  return {
18524
19599
  info: effect.Effect.fn("WorkspaceDiscovery.info")(function* () {
18525
19600
  return (yield* memo).info;
@@ -18533,7 +19608,7 @@ var WorkspaceDiscovery = class WorkspaceDiscovery extends effect.Context.Service
18533
19608
  }),
18534
19609
  getPackage: effect.Effect.fn("WorkspaceDiscovery.getPackage")(function* (name) {
18535
19610
  const all = yield* packages;
18536
- const found = all.find((pkg) => pkg.name === name);
19611
+ const found = packagesByName(all).get(name);
18537
19612
  if (found !== void 0) return found;
18538
19613
  return yield* effect.Effect.fail(new PackageNotFoundError({
18539
19614
  name,
@@ -18695,9 +19770,18 @@ var WorkspaceDiscovery = class WorkspaceDiscovery extends effect.Context.Service
18695
19770
  * // `Package.resolve` now resolves `workspace:*` for real.
18696
19771
  * ```
18697
19772
  */
18698
- static workspaceResolver = effect.Layer.effect(WorkspaceResolver, effect.Effect.gen(function* () {
19773
+ static workspaceResolver = effect.Layer.effect(WorkspaceResolver$1, effect.Effect.gen(function* () {
18699
19774
  const discovery = yield* WorkspaceDiscovery;
18700
- return { versionOf: (packageName) => discovery.listPackages().pipe(effect.Effect.map((all) => effect.Option.fromUndefinedOr(all.find((pkg) => pkg.name === packageName)?.version)), effect.Effect.mapError((cause) => new DependencyResolutionError({
19775
+ const versionIndexes = /* @__PURE__ */ new WeakMap();
19776
+ const versionsByName = (all) => {
19777
+ const cached = versionIndexes.get(all);
19778
+ if (cached !== void 0) return cached;
19779
+ const index = /* @__PURE__ */ new Map();
19780
+ for (const pkg of all) if (!index.has(pkg.name)) index.set(pkg.name, pkg.version);
19781
+ versionIndexes.set(all, index);
19782
+ return index;
19783
+ };
19784
+ return { versionOf: (packageName) => discovery.listPackages().pipe(effect.Effect.map((all) => effect.Option.fromUndefinedOr(versionsByName(all).get(packageName))), effect.Effect.mapError((cause) => new DependencyResolutionError$1({
18701
19785
  specifier: `workspace:${packageName}`,
18702
19786
  cause
18703
19787
  }))) };
@@ -18705,7 +19789,7 @@ var WorkspaceDiscovery = class WorkspaceDiscovery extends effect.Context.Service
18705
19789
  };
18706
19790
  const isStringRecord$2 = (value) => value !== null && typeof value === "object" && !Array.isArray(value) && Object.values(value).every((entry) => typeof entry === "string");
18707
19791
  //#endregion
18708
- //#region ../../node_modules/.pnpm/@effected+workspaces@0.9.4_@effected+jsonc@0.5.2_effect@4.0.0-beta.101__effect@4.0.0-beta.101/node_modules/@effected/workspaces/DependencyGraph.js
19792
+ //#region ../../node_modules/.pnpm/@effected+workspaces@0.10.0_@effected+jsonc@0.5.2_effect@4.0.0-beta.101__effect@4.0.0-beta.101/node_modules/@effected/workspaces/DependencyGraph.js
18709
19793
  /**
18710
19794
  * Raised when the workspace dependency graph cannot be topologically ordered
18711
19795
  * because it contains a cycle.
@@ -20347,7 +21431,7 @@ var Git = class Git extends effect.Context.Service()("@effected/git/Git") {
20347
21431
  static layerTest = (overrides = {}) => effect.Layer.succeed(Git, Git.makeTest(overrides));
20348
21432
  };
20349
21433
  //#endregion
20350
- //#region ../../node_modules/.pnpm/@effected+workspaces@0.9.4_@effected+jsonc@0.5.2_effect@4.0.0-beta.101__effect@4.0.0-beta.101/node_modules/@effected/workspaces/ChangeDetector.js
21434
+ //#region ../../node_modules/.pnpm/@effected+workspaces@0.10.0_@effected+jsonc@0.5.2_effect@4.0.0-beta.101__effect@4.0.0-beta.101/node_modules/@effected/workspaces/ChangeDetector.js
20351
21435
  /**
20352
21436
  * Which git refs to compare, and whether to fold in the working tree.
20353
21437
  *
@@ -20476,8 +21560,12 @@ var ChangeDetector = class ChangeDetector extends effect.Context.Service()("@eff
20476
21560
  static layer = effect.Layer.effect(ChangeDetector, ChangeDetector.make);
20477
21561
  };
20478
21562
  `${process.platform}${process.arch}${process.version.split(".")[0].substring(1)}`;
21563
+ Object.freeze({
21564
+ gh: "https://npm.pkg.github.com/",
21565
+ npmjs: "https://registry.npmjs.org/"
21566
+ });
20479
21567
  //#endregion
20480
- //#region ../../node_modules/.pnpm/@pnpm+error@1100.1.0/node_modules/@pnpm/error/lib/index.js
21568
+ //#region ../../node_modules/.pnpm/@pnpm+error@1100.1.1/node_modules/@pnpm/error/lib/index.js
20481
21569
  var PnpmError = class extends Error {
20482
21570
  code;
20483
21571
  hint;
@@ -20492,7 +21580,7 @@ var PnpmError = class extends Error {
20492
21580
  }
20493
21581
  };
20494
21582
  //#endregion
20495
- //#region ../../node_modules/.pnpm/@pnpm+catalogs.config@1100.0.3/node_modules/@pnpm/catalogs.config/lib/getCatalogsFromWorkspaceManifest.js
21583
+ //#region ../../node_modules/.pnpm/@pnpm+catalogs.config@1100.0.4/node_modules/@pnpm/catalogs.config/lib/getCatalogsFromWorkspaceManifest.js
20496
21584
  function getCatalogsFromWorkspaceManifest(workspaceManifest) {
20497
21585
  if (workspaceManifest == null) return {};
20498
21586
  checkDefaultCatalogIsDefinedOnce(workspaceManifest);
@@ -20505,7 +21593,7 @@ function checkDefaultCatalogIsDefinedOnce(manifest) {
20505
21593
  if (manifest.catalog != null && manifest.catalogs?.default != null) throw new PnpmError("INVALID_CATALOGS_CONFIGURATION", "The 'default' catalog was defined multiple times. Use the 'catalog' field or 'catalogs.default', but not both.");
20506
21594
  }
20507
21595
  //#endregion
20508
- //#region ../../node_modules/.pnpm/@pnpm+catalogs.config@1100.0.3/node_modules/@pnpm/catalogs.config/lib/mergeCatalogs.js
21596
+ //#region ../../node_modules/.pnpm/@pnpm+catalogs.config@1100.0.4/node_modules/@pnpm/catalogs.config/lib/mergeCatalogs.js
20509
21597
  /**
20510
21598
  * Deep-merges catalog definitions, later arguments taking precedence over
20511
21599
  * earlier ones at the individual entry level. Use it to fold the catalog
@@ -20599,7 +21687,7 @@ function resolveFromCatalog(catalogs, wantedDependency) {
20599
21687
  };
20600
21688
  }
20601
21689
  //#endregion
20602
- //#region ../../node_modules/.pnpm/@effected+workspaces@0.9.4_@effected+jsonc@0.5.2_effect@4.0.0-beta.101__effect@4.0.0-beta.101/node_modules/@effected/workspaces/internal/catalogs.js
21690
+ //#region ../../node_modules/.pnpm/@effected+workspaces@0.10.0_@effected+jsonc@0.5.2_effect@4.0.0-beta.101__effect@4.0.0-beta.101/node_modules/@effected/workspaces/internal/catalogs.js
20603
21691
  /** Project a pnpm-workspace manifest's `catalog` / `catalogs` fields into a `Catalogs` map. */
20604
21692
  const inlineCatalogs = (manifest) => {
20605
21693
  if (manifest.catalog === void 0 && manifest.catalogs === void 0) return {};
@@ -20663,7 +21751,7 @@ const rangeOf = (catalogs, dependency, specifier) => {
20663
21751
  });
20664
21752
  };
20665
21753
  //#endregion
20666
- //#region ../../node_modules/.pnpm/@effected+workspaces@0.9.4_@effected+jsonc@0.5.2_effect@4.0.0-beta.101__effect@4.0.0-beta.101/node_modules/@effected/workspaces/ConfigDependencyHooks.js
21754
+ //#region ../../node_modules/.pnpm/@effected+workspaces@0.10.0_@effected+jsonc@0.5.2_effect@4.0.0-beta.101__effect@4.0.0-beta.101/node_modules/@effected/workspaces/ConfigDependencyHooks.js
20667
21755
  /** Whether `value` is a non-null, non-array object. */
20668
21756
  const isObject$2 = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
20669
21757
  /**
@@ -20756,6 +21844,137 @@ const updateConfigOf = (mod) => {
20756
21844
  }
20757
21845
  };
20758
21846
  /**
21847
+ * The subprocess replay program {@link ConfigDependencyHooks.layerSubprocess}
21848
+ * hands to `node --input-type=module -e`.
21849
+ *
21850
+ * @remarks
21851
+ * A **static** string constant, deliberately: a bundler compiles a *computed*
21852
+ * dynamic `import()` into a context module that cannot resolve a runtime path
21853
+ * (`Cannot find module 'file:///…'`), so the computed import has to run in a
21854
+ * child process whose program text carries **no interpolated runtime value** —
21855
+ * the workspace root, the seed and the dependency names all arrive via argv
21856
+ * (`process.argv.slice(1)` under `-e`), never spliced into the script.
21857
+ *
21858
+ * The script mirrors this module's in-process semantics exactly so the two
21859
+ * layers are drop-in interchangeable: `pnpmfile.mjs` before `pnpmfile.cjs`
21860
+ * (pnpm 11's loader order), the `ERR_MODULE_NOT_FOUND`-for-the-candidate-itself
21861
+ * skip discrimination (`err.url` equality), the same hook-locator shapes, the
21862
+ * same tolerant threading of returned data (`configOf` / `finiteNumberOr` /
21863
+ * `stringArrayOr` clones below), and the same synchronous hook call. Only the
21864
+ * *mechanism* failures are reported: the script prints one final line of JSON —
21865
+ * `{ ok: true, config }` on success, `{ ok: false, name, message, stack? }`
21866
+ * naming the offending dependency on a load/replay failure — and exits through
21867
+ * the write callback so the payload is flushed even if a hook left the event
21868
+ * loop occupied. The final-line framing tolerates a hook's own `console.log`
21869
+ * noise on stdout.
21870
+ */
21871
+ const REPLAY_SCRIPT = `
21872
+ const [root, seedJson, ...names] = process.argv.slice(1);
21873
+ const { pathToFileURL } = await import("node:url");
21874
+ const { join } = await import("node:path");
21875
+ const isObject = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
21876
+ const finiteNumberOr = (value, fallback) => (typeof value === "number" && Number.isFinite(value) ? value : fallback);
21877
+ const stringArrayOr = (value, fallback) =>
21878
+ Array.isArray(value) && value.every((entry) => typeof entry === "string") ? value : fallback;
21879
+ const configOf = (value, fallback) =>
21880
+ isObject(value)
21881
+ ? {
21882
+ catalog: isObject(value.catalog) ? value.catalog : fallback.catalog,
21883
+ catalogs: isObject(value.catalogs) ? value.catalogs : fallback.catalogs,
21884
+ minimumReleaseAge: finiteNumberOr(value.minimumReleaseAge, fallback.minimumReleaseAge),
21885
+ minimumReleaseAgeExclude: stringArrayOr(value.minimumReleaseAgeExclude, fallback.minimumReleaseAgeExclude),
21886
+ }
21887
+ : fallback;
21888
+ const failure = (name, cause) => ({
21889
+ ok: false,
21890
+ name,
21891
+ message: cause instanceof Error ? cause.message : String(cause),
21892
+ ...(cause instanceof Error && typeof cause.stack === "string" ? { stack: cause.stack } : {}),
21893
+ });
21894
+ const replay = async () => {
21895
+ let catalog = {};
21896
+ const catalogs = {};
21897
+ for (const [name, entries] of Object.entries(JSON.parse(seedJson))) {
21898
+ if (name === "default") catalog = { ...entries };
21899
+ else catalogs[name] = { ...entries };
21900
+ }
21901
+ let config = { catalog, catalogs, minimumReleaseAge: undefined, minimumReleaseAgeExclude: undefined };
21902
+ for (const name of names) {
21903
+ let loaded;
21904
+ let found = false;
21905
+ for (const filename of ["pnpmfile.mjs", "pnpmfile.cjs"]) {
21906
+ const candidate = pathToFileURL(join(root, "node_modules", ".pnpm-config", name, filename)).href;
21907
+ try {
21908
+ loaded = await import(candidate);
21909
+ found = true;
21910
+ break;
21911
+ } catch (cause) {
21912
+ const url =
21913
+ isObject(cause) && cause.code === "ERR_MODULE_NOT_FOUND" && typeof cause.url === "string"
21914
+ ? cause.url
21915
+ : undefined;
21916
+ if (url === candidate) continue;
21917
+ return failure(name, cause);
21918
+ }
21919
+ }
21920
+ if (!found) continue;
21921
+ let hook;
21922
+ for (const candidate of [loaded, isObject(loaded) ? loaded.default : undefined]) {
21923
+ if (!isObject(candidate)) continue;
21924
+ if (isObject(candidate.hooks) && typeof candidate.hooks.updateConfig === "function") {
21925
+ hook = candidate.hooks.updateConfig;
21926
+ break;
21927
+ }
21928
+ if (typeof candidate.updateConfig === "function") {
21929
+ hook = candidate.updateConfig;
21930
+ break;
21931
+ }
21932
+ }
21933
+ if (hook === undefined) continue;
21934
+ try {
21935
+ config = configOf(hook(config), config);
21936
+ } catch (cause) {
21937
+ return failure(name, cause);
21938
+ }
21939
+ }
21940
+ return { ok: true, config };
21941
+ };
21942
+ const payload = await replay();
21943
+ process.stdout.write("\\n" + JSON.stringify(payload) + "\\n", () => process.exit(0));
21944
+ `;
21945
+ /**
21946
+ * The ceiling on one subprocess replay. A config dependency's `updateConfig`
21947
+ * reads and rewrites a config object — no install work, no network — so thirty
21948
+ * seconds is generous. Without a ceiling a pnpmfile that loops or awaits a
21949
+ * promise that never settles hangs `inject`, and through it the one memoized
21950
+ * {@link WorkspaceCatalogs} assemble pass every catalog read blocks on. Expiry
21951
+ * kills the child (`Run` scopes it) and surfaces as a `CommandFailedError`
21952
+ * through the same typed transport-failure path as any other mechanism failure.
21953
+ */
21954
+ const REPLAY_TIMEOUT = effect.Duration.seconds(30);
21955
+ /**
21956
+ * The subprocess protocol payload — the child's final stdout line, framed and
21957
+ * parsed by `Run.jsonLine`. The envelope is strict (a payload without a usable
21958
+ * `ok` discriminant is a mechanism failure, typed); the `config` slice inside a
21959
+ * success stays `Unknown` because a hook's returned *data* is tolerantly
21960
+ * threaded (`configOf`), never fatal.
21961
+ */
21962
+ const ReplayPayload = effect.Schema.Union([effect.Schema.Struct({
21963
+ ok: effect.Schema.Literal(true),
21964
+ config: effect.Schema.Unknown
21965
+ }), effect.Schema.Struct({
21966
+ ok: effect.Schema.Literal(false),
21967
+ name: effect.Schema.optionalKey(effect.Schema.String),
21968
+ message: effect.Schema.optionalKey(effect.Schema.String),
21969
+ stack: effect.Schema.optionalKey(effect.Schema.String)
21970
+ })]);
21971
+ /** Rebuild the subprocess's serialized failure as an `Error`, preserving the child-side stack when it carried one. */
21972
+ const replayFailureCause = (payload) => {
21973
+ const error = new Error(payload.message ?? "config dependency hook replay failed");
21974
+ if (payload.stack !== void 0) error.stack = payload.stack;
21975
+ return error;
21976
+ };
21977
+ /**
20759
21978
  * Replays a workspace's `configDependencies` `updateConfig` hooks over the inline
20760
21979
  * catalogs — the opt-in seam that lets hook-injected catalogs participate in
20761
21980
  * assembly.
@@ -20848,9 +22067,98 @@ var ConfigDependencyHooks = class ConfigDependencyHooks extends effect.Context.S
20848
22067
  releaseAge: releaseAgeOf(config)
20849
22068
  };
20850
22069
  }) });
22070
+ /**
22071
+ * The subprocess layer: replays each config dependency's pnpmfile in a `node`
22072
+ * child process instead of an in-process dynamic `import()`, with identical
22073
+ * typed semantics to {@link ConfigDependencyHooks.layerLive} — the two are
22074
+ * drop-in interchangeable.
22075
+ *
22076
+ * @remarks
22077
+ * `layerLive` computes the `import()` path at runtime, and a bundler (rspack,
22078
+ * for one) compiles a *computed* dynamic import into a context module that
22079
+ * throws `Cannot find module 'file:///…'` at runtime — so in any bundled
22080
+ * consumer, a GitHub Action above all, the in-process replay is unreachable.
22081
+ * This layer keeps every computed load out of the bundle graph: the replay
22082
+ * program is a **static** string constant passed via argv
22083
+ * (`node --input-type=module -e <script> <root> <seed> <...names>`), and the
22084
+ * child process performs the computed imports where no bundler rewrote them.
22085
+ * A subprocess also keeps config-dependency code out of the consumer's own
22086
+ * process.
22087
+ *
22088
+ * The contract's semantics are unchanged, not the downstream fail-open shape:
22089
+ * an empty `configDependencies` returns the seed without spawning anything; a
22090
+ * `..` path segment in a dependency name fails typed **before** any spawn; a
22091
+ * missing pnpmfile (neither `.mjs` nor `.cjs`) is the one legitimate skip,
22092
+ * discriminated inside the child by `err.url` equality exactly as
22093
+ * `layerLive` discriminates in process; any other load failure — a syntax
22094
+ * error, a throwing top level, an `ERR_MODULE_NOT_FOUND` for a module the
22095
+ * pnpmfile itself imports — and a hook that throws when called are serialized
22096
+ * back per-name and surface typed as a `hooks`-source `CatalogAssemblyError`
22097
+ * naming that dependency. A hook's returned *data* stays tolerantly threaded
22098
+ * (last well-formed write wins), never fatal. Spawn and transport failures —
22099
+ * `node` absent, a non-zero exit without a result payload, unparseable
22100
+ * output — fail typed too, never a defect and never a silent skip.
22101
+ *
22102
+ * Two bounds this layer imposes that `layerLive` cannot: the replay is
22103
+ * given thirty seconds (a pnpmfile that loops or awaits forever fails typed
22104
+ * instead of hanging the memoized assemble pass — a subprocess is killable,
22105
+ * while `layerLive`'s in-process synchronous hook call is not interruptible
22106
+ * by any means, so the asymmetry is inherent, not a parity violation), and
22107
+ * the child's stdout is captured under `Run.jsonLine`'s 16 MiB default
22108
+ * ceiling (a hook that logs more than that fails typed as `tooLarge`, where
22109
+ * `layerLive` — which captures nothing — would succeed).
22110
+ *
22111
+ * Catalog folding and normalization stay in the **parent** (the same
22112
+ * `@pnpm/catalogs`-derived path `layerLive` uses); the child returns only the
22113
+ * raw threaded config slice, since the script cannot import kit code.
22114
+ *
22115
+ * Requires core's `ChildProcessSpawner`, resolved when the layer is built —
22116
+ * the consumer provides it once at the edge (`@effect/platform-node`'s
22117
+ * `NodeServices.layer`), the same discharge `@effected/git` uses. Wired by
22118
+ * `WorkspaceCatalogs.layerWithConfigDependenciesSubprocess` /
22119
+ * `Workspaces.layerWithConfigDependenciesSubprocess`.
22120
+ */
22121
+ static layerSubprocess = effect.Layer.effect(ConfigDependencyHooks, effect.Effect.gen(function* () {
22122
+ const spawner = yield* effect_unstable_process.ChildProcessSpawner.ChildProcessSpawner;
22123
+ return { inject: (root, configDependencies, seed) => effect.Effect.gen(function* () {
22124
+ const names = Object.keys(configDependencies);
22125
+ if (names.length === 0) return {
22126
+ catalogs: seed,
22127
+ releaseAge: {}
22128
+ };
22129
+ for (const name of names) if (hasTraversalSegment(name)) return yield* effect.Effect.fail(new CatalogAssemblyError({
22130
+ source: "hooks",
22131
+ path: name,
22132
+ cause: /* @__PURE__ */ new Error(`config dependency name has a '..' path segment: ${name}`)
22133
+ }));
22134
+ const command = effect_unstable_process.ChildProcess.make("node", [
22135
+ "--input-type=module",
22136
+ "-e",
22137
+ REPLAY_SCRIPT,
22138
+ root,
22139
+ JSON.stringify(seed),
22140
+ ...names
22141
+ ]);
22142
+ const payload = yield* Run.jsonLine(command, ReplayPayload, { timeout: REPLAY_TIMEOUT }).pipe(effect.Effect.provideService(effect_unstable_process.ChildProcessSpawner.ChildProcessSpawner, spawner), effect.Effect.catch((cause) => effect.Effect.fail(new CatalogAssemblyError({
22143
+ source: "hooks",
22144
+ path: root,
22145
+ cause
22146
+ }))));
22147
+ if (payload.ok === false) return yield* effect.Effect.fail(new CatalogAssemblyError({
22148
+ source: "hooks",
22149
+ path: payload.name ?? root,
22150
+ cause: replayFailureCause(payload)
22151
+ }));
22152
+ const config = configOf(payload.config, seedToConfig(seed));
22153
+ return {
22154
+ catalogs: configToEntries(config),
22155
+ releaseAge: releaseAgeOf(config)
22156
+ };
22157
+ }) };
22158
+ }));
20851
22159
  };
20852
22160
  //#endregion
20853
- //#region ../../node_modules/.pnpm/@effected+workspaces@0.9.4_@effected+jsonc@0.5.2_effect@4.0.0-beta.101__effect@4.0.0-beta.101/node_modules/@effected/workspaces/PackageManagerName.js
22161
+ //#region ../../node_modules/.pnpm/@effected+workspaces@0.10.0_@effected+jsonc@0.5.2_effect@4.0.0-beta.101__effect@4.0.0-beta.101/node_modules/@effected/workspaces/PackageManagerName.js
20854
22162
  /**
20855
22163
  * The four package managers this package understands.
20856
22164
  *
@@ -21178,7 +22486,7 @@ var PackageManagerDetector = class PackageManagerDetector extends effect.Context
21178
22486
  static layerTest = (overrides = {}) => effect.Layer.succeed(PackageManagerDetector, PackageManagerDetector.makeTest(overrides));
21179
22487
  };
21180
22488
  //#endregion
21181
- //#region ../../node_modules/.pnpm/@effected+workspaces@0.9.4_@effected+jsonc@0.5.2_effect@4.0.0-beta.101__effect@4.0.0-beta.101/node_modules/@effected/workspaces/LockfileReader.js
22489
+ //#region ../../node_modules/.pnpm/@effected+workspaces@0.10.0_@effected+jsonc@0.5.2_effect@4.0.0-beta.101__effect@4.0.0-beta.101/node_modules/@effected/workspaces/LockfileReader.js
21182
22490
  /**
21183
22491
  * Raised when the workspace's lockfile cannot be read off disk.
21184
22492
  *
@@ -21358,7 +22666,7 @@ var LockfileReader = class LockfileReader extends effect.Context.Service()("@eff
21358
22666
  static layerTest = (overrides = {}) => effect.Layer.succeed(LockfileReader, LockfileReader.makeTest(overrides));
21359
22667
  };
21360
22668
  //#endregion
21361
- //#region ../../node_modules/.pnpm/@effected+workspaces@0.9.4_@effected+jsonc@0.5.2_effect@4.0.0-beta.101__effect@4.0.0-beta.101/node_modules/@effected/workspaces/Publishability.js
22669
+ //#region ../../node_modules/.pnpm/@effected+workspaces@0.10.0_@effected+jsonc@0.5.2_effect@4.0.0-beta.101__effect@4.0.0-beta.101/node_modules/@effected/workspaces/Publishability.js
21362
22670
  /** The public npm registry, used when `publishConfig.registry` says nothing. */
21363
22671
  const DEFAULT_REGISTRY = "https://registry.npmjs.org/";
21364
22672
  /**
@@ -21517,7 +22825,7 @@ var PublishabilityDetector = class extends effect.Context.Service()("@effected/w
21517
22825
  static layerNone = effect.Layer.succeed(this, this.none);
21518
22826
  };
21519
22827
  //#endregion
21520
- //#region ../../node_modules/.pnpm/@effected+workspaces@0.9.4_@effected+jsonc@0.5.2_effect@4.0.0-beta.101__effect@4.0.0-beta.101/node_modules/@effected/workspaces/internal/importerVersions.js
22828
+ //#region ../../node_modules/.pnpm/@effected+workspaces@0.10.0_@effected+jsonc@0.5.2_effect@4.0.0-beta.101__effect@4.0.0-beta.101/node_modules/@effected/workspaces/internal/importerVersions.js
21521
22829
  /**
21522
22830
  * Strip pnpm's peer-disambiguation suffix from a recorded importer version.
21523
22831
  *
@@ -21603,7 +22911,7 @@ const unanimousVersionOf = (index, dependency) => {
21603
22911
  return agreed;
21604
22912
  };
21605
22913
  //#endregion
21606
- //#region ../../node_modules/.pnpm/@effected+workspaces@0.9.4_@effected+jsonc@0.5.2_effect@4.0.0-beta.101__effect@4.0.0-beta.101/node_modules/@effected/workspaces/WorkspaceCatalogs.js
22914
+ //#region ../../node_modules/.pnpm/@effected+workspaces@0.10.0_@effected+jsonc@0.5.2_effect@4.0.0-beta.101__effect@4.0.0-beta.101/node_modules/@effected/workspaces/WorkspaceCatalogs.js
21607
22915
  /**
21608
22916
  * An immutable, fully-normalized catalog collection — the one catalog
21609
22917
  * resolution semantic in the package.
@@ -22024,6 +23332,24 @@ var WorkspaceCatalogs = class WorkspaceCatalogs extends effect.Context.Service()
22024
23332
  */
22025
23333
  static layerWithConfigDependencies = (options) => effect.Layer.effect(WorkspaceCatalogs, WorkspaceCatalogs.make(options)).pipe(effect.Layer.provide(ConfigDependencyHooks.layerLive));
22026
23334
  /**
23335
+ * The opt-in layer that replays config-dependency `pnpmfile` hooks in a
23336
+ * `node` **child process**: it wires
23337
+ * {@link ConfigDependencyHooks.layerSubprocess} in place of the in-process
23338
+ * `layerLive`.
23339
+ *
23340
+ * @remarks
23341
+ * Same typed semantics as {@link WorkspaceCatalogs.layerWithConfigDependencies}
23342
+ * — the two hook layers are drop-in interchangeable — but the replay's
23343
+ * computed dynamic `import()` runs in the subprocess, so it survives bundling
23344
+ * (a bundler compiles a computed in-process `import()` into a context module
23345
+ * that cannot resolve at runtime — every bundled GitHub Action hits this).
23346
+ * The cost is one extra requirement: core's `ChildProcessSpawner`, provided
23347
+ * once at the edge (`@effect/platform-node`'s `NodeServices.layer`) — the
23348
+ * same sanctioned R-widening as `Workspaces.layerWithGit`. Parameterized, so
23349
+ * bind it to a `const` and reuse it.
23350
+ */
23351
+ static layerWithConfigDependenciesSubprocess = (options) => effect.Layer.effect(WorkspaceCatalogs, WorkspaceCatalogs.make(options)).pipe(effect.Layer.provide(ConfigDependencyHooks.layerSubprocess));
23352
+ /**
22027
23353
  * A test double satisfying the full {@link WorkspaceCatalogsShape} with no
22028
23354
  * filesystem, lockfile read, or hook replay.
22029
23355
  *
@@ -22100,9 +23426,9 @@ var WorkspaceCatalogs = class WorkspaceCatalogs extends effect.Context.Service()
22100
23426
  * consumers to `_tag`-sniff `unknown`); only the remaining mechanism failure,
22101
23427
  * an unfindable workspace root, is wrapped as `DependencyResolutionError`.
22102
23428
  */
22103
- static catalogResolver = effect.Layer.effect(CatalogResolver, effect.Effect.gen(function* () {
23429
+ static catalogResolver = effect.Layer.effect(CatalogResolver$1, effect.Effect.gen(function* () {
22104
23430
  const catalogs = yield* WorkspaceCatalogs;
22105
- return { rangeOf: (packageName, catalog) => catalogs.set().pipe(effect.Effect.map((set) => set.rangeOf(packageName, catalog)), effect.Effect.catchTag("WorkspaceRootNotFoundError", (cause) => effect.Effect.fail(new DependencyResolutionError({
23431
+ return { rangeOf: (packageName, catalog) => catalogs.set().pipe(effect.Effect.map((set) => set.rangeOf(packageName, catalog)), effect.Effect.catchTag("WorkspaceRootNotFoundError", (cause) => effect.Effect.fail(new DependencyResolutionError$1({
22106
23432
  specifier: effect.Option.match(catalog, {
22107
23433
  onNone: () => "catalog:",
22108
23434
  onSome: (name) => `catalog:${name}`
@@ -22112,7 +23438,7 @@ var WorkspaceCatalogs = class WorkspaceCatalogs extends effect.Context.Service()
22112
23438
  }));
22113
23439
  };
22114
23440
  //#endregion
22115
- //#region ../../node_modules/.pnpm/@effected+workspaces@0.9.4_@effected+jsonc@0.5.2_effect@4.0.0-beta.101__effect@4.0.0-beta.101/node_modules/@effected/workspaces/WorkspaceStateSnapshot.js
23441
+ //#region ../../node_modules/.pnpm/@effected+workspaces@0.10.0_@effected+jsonc@0.5.2_effect@4.0.0-beta.101__effect@4.0.0-beta.101/node_modules/@effected/workspaces/WorkspaceStateSnapshot.js
22116
23442
  const EMPTY = Object.freeze(Object.create(null));
22117
23443
  const DependencyMap = effect.Schema.Record(effect.Schema.String, effect.Schema.String).pipe(effect.Schema.withDecodingDefaultKey(effect.Effect.succeed(EMPTY)), effect.Schema.withConstructorDefault(effect.Effect.succeed(EMPTY)));
22118
23444
  /**
@@ -22291,7 +23617,7 @@ var WorkspaceStateSnapshot = class extends effect.Schema.Class("WorkspaceStateSn
22291
23617
  * resolving to `Option.none()` so the caller falls back to the raw string.
22292
23618
  */
22293
23619
  #resolveWith(dependency, specifier, onUnresolvedCatalog) {
22294
- const exit = effect.Schema.decodeUnknownExit(DependencySpecifier.FromString)(specifier);
23620
+ const exit = effect.Schema.decodeUnknownExit(DependencySpecifier$1.FromString)(specifier);
22295
23621
  if (!effect.Exit.isSuccess(exit)) return effect.Option.none();
22296
23622
  const classified = exit.value;
22297
23623
  switch (classified._tag) {
@@ -22316,7 +23642,7 @@ var WorkspaceStateSnapshot = class extends effect.Schema.Class("WorkspaceStateSn
22316
23642
  * `rangeOf` never fails.
22317
23643
  */
22318
23644
  get catalogResolver() {
22319
- if (this.#catalogResolver === void 0) this.#catalogResolver = effect.Layer.succeed(CatalogResolver, { rangeOf: (packageName, catalog) => effect.Effect.succeed(this.catalogs.rangeOf(packageName, catalog)) });
23645
+ if (this.#catalogResolver === void 0) this.#catalogResolver = effect.Layer.succeed(CatalogResolver$1, { rangeOf: (packageName, catalog) => effect.Effect.succeed(this.catalogs.rangeOf(packageName, catalog)) });
22320
23646
  return this.#catalogResolver;
22321
23647
  }
22322
23648
  /**
@@ -22325,7 +23651,7 @@ var WorkspaceStateSnapshot = class extends effect.Schema.Class("WorkspaceStateSn
22325
23651
  * `workspace:` specifiers as of this ref. Built once per instance and cached.
22326
23652
  */
22327
23653
  get workspaceResolver() {
22328
- if (this.#workspaceResolver === void 0) this.#workspaceResolver = effect.Layer.succeed(WorkspaceResolver, { versionOf: (packageName) => effect.Effect.succeed(effect.Option.fromUndefinedOr(this.#versions().get(packageName))) });
23654
+ if (this.#workspaceResolver === void 0) this.#workspaceResolver = effect.Layer.succeed(WorkspaceResolver$1, { versionOf: (packageName) => effect.Effect.succeed(effect.Option.fromUndefinedOr(this.#versions().get(packageName))) });
22329
23655
  return this.#workspaceResolver;
22330
23656
  }
22331
23657
  /** Both snapshot-scoped resolver layers merged. Built once per instance and cached. */
@@ -22335,7 +23661,7 @@ var WorkspaceStateSnapshot = class extends effect.Schema.Class("WorkspaceStateSn
22335
23661
  }
22336
23662
  };
22337
23663
  //#endregion
22338
- //#region ../../node_modules/.pnpm/@effected+workspaces@0.9.4_@effected+jsonc@0.5.2_effect@4.0.0-beta.101__effect@4.0.0-beta.101/node_modules/@effected/workspaces/WorkspaceSnapshots.js
23664
+ //#region ../../node_modules/.pnpm/@effected+workspaces@0.10.0_@effected+jsonc@0.5.2_effect@4.0.0-beta.101__effect@4.0.0-beta.101/node_modules/@effected/workspaces/WorkspaceSnapshots.js
22339
23665
  /** Whether `value` is a non-null, non-array object. */
22340
23666
  const isObject = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
22341
23667
  /** Whether every value in a record is a string — a usable dependency map. */
@@ -22612,7 +23938,7 @@ var WorkspaceSnapshots = class WorkspaceSnapshots extends effect.Context.Service
22612
23938
  static layerTest = (overrides = {}) => effect.Layer.succeed(WorkspaceSnapshots, WorkspaceSnapshots.makeTest(overrides));
22613
23939
  };
22614
23940
  //#endregion
22615
- //#region ../../node_modules/.pnpm/@effected+workspaces@0.9.4_@effected+jsonc@0.5.2_effect@4.0.0-beta.101__effect@4.0.0-beta.101/node_modules/@effected/workspaces/Workspaces.js
23941
+ //#region ../../node_modules/.pnpm/@effected+workspaces@0.10.0_@effected+jsonc@0.5.2_effect@4.0.0-beta.101__effect@4.0.0-beta.101/node_modules/@effected/workspaces/Workspaces.js
22616
23942
  const compose = (options, catalogsFactory) => {
22617
23943
  const roots = WorkspaceRoot.layer;
22618
23944
  const detector = PackageManagerDetector.layer;
@@ -22629,6 +23955,7 @@ const layerWithGit = (options) => {
22629
23955
  };
22630
23956
  const resolvers = effect.Layer.mergeAll(WorkspaceCatalogs.catalogResolver, WorkspaceDiscovery.workspaceResolver);
22631
23957
  const layerWithConfigDependencies = (options) => compose(options, WorkspaceCatalogs.layerWithConfigDependencies);
23958
+ const layerWithConfigDependenciesSubprocess = (options) => compose(options, WorkspaceCatalogs.layerWithConfigDependenciesSubprocess);
22632
23959
  const resolverLayer = (options) => resolvers.pipe(effect.Layer.provide(layerWithConfigDependencies(options)));
22633
23960
  const resolveManifest = effect.Effect.fn("Workspaces.resolveManifest")(function* (manifest, options) {
22634
23961
  return yield* manifest.resolve().pipe(effect.Effect.provide(resolverLayer(options)));
@@ -22710,6 +24037,32 @@ var Workspaces = class {
22710
24037
  */
22711
24038
  static layerWithConfigDependencies = layerWithConfigDependencies;
22712
24039
  /**
24040
+ * The git-free composite with config-dependency hook replay in a `node`
24041
+ * **child process** —
24042
+ * {@link WorkspaceCatalogs.layerWithConfigDependenciesSubprocess} in place of
24043
+ * the in-process replay.
24044
+ *
24045
+ * @remarks
24046
+ * Same typed semantics as {@link Workspaces.layerWithConfigDependencies}; the
24047
+ * difference is mechanism, and it matters in exactly one environment class: a
24048
+ * **bundled** consumer. The in-process replay's computed dynamic `import()`
24049
+ * is compiled by bundlers (rspack among them) into a context module that
24050
+ * throws `Cannot find module 'file:///…'` at runtime, which makes
24051
+ * `WorkspaceCatalogs.releaseAgeGate()` unreachable from any bundled GitHub
24052
+ * Action. Here the computed import runs inside a `node` child process whose
24053
+ * program text is a static string handed over argv, so nothing computed
24054
+ * enters the bundle graph.
24055
+ *
24056
+ * The extra requirement is core's `ChildProcessSpawner`, provided once at
24057
+ * the edge (`@effect/platform-node`'s `NodeServices.layer`) — the same
24058
+ * sanctioned R-widening as {@link Workspaces.layerWithGit}, and the reason
24059
+ * this is a separate composite rather than a flag: a consumer that keeps the
24060
+ * in-process replay should not have to be able to spawn a subprocess.
24061
+ *
24062
+ * **Bind the result to a `const`.**
24063
+ */
24064
+ static layerWithConfigDependenciesSubprocess = layerWithConfigDependenciesSubprocess;
24065
+ /**
22713
24066
  * The git-free composite plus {@link ChangeDetector} and
22714
24067
  * {@link WorkspaceSnapshots}, over `@effected/git`'s `Git` service.
22715
24068
  *
@@ -60543,7 +61896,7 @@ function validatePackages(packages) {
60543
61896
  }
60544
61897
  }
60545
61898
  //#endregion
60546
- //#region ../../node_modules/.pnpm/@changesets+get-dependents-graph@3.0.0-next.8/node_modules/@changesets/get-dependents-graph/dist/index.mjs
61899
+ //#region ../../node_modules/.pnpm/@changesets+get-dependents-graph@3.0.0-next.9/node_modules/@changesets/get-dependents-graph/dist/index.mjs
60547
61900
  var src_default = new Proxy({}, { get(target, color) {
60548
61901
  target[color] ??= (text) => (0, node_util.styleText)(color, text);
60549
61902
  return target[color];
@@ -60663,14 +62016,14 @@ function getDependentsGraph(packages, opts) {
60663
62016
  return simplifiedDependentsGraph;
60664
62017
  }
60665
62018
  //#endregion
60666
- //#region ../../node_modules/.pnpm/@changesets+should-skip-package@1.0.0-next.8/node_modules/@changesets/should-skip-package/dist/index.mjs
62019
+ //#region ../../node_modules/.pnpm/@changesets+should-skip-package@1.0.0-next.9/node_modules/@changesets/should-skip-package/dist/index.mjs
60667
62020
  function shouldSkipPackage({ packageJson }, { ignore, allowPrivatePackages }) {
60668
62021
  if (ignore.includes(packageJson.name)) return true;
60669
62022
  if (packageJson.private && !allowPrivatePackages) return true;
60670
62023
  return !packageJson.version;
60671
62024
  }
60672
62025
  //#endregion
60673
- //#region ../../node_modules/.pnpm/@changesets+config@4.0.0-next.8/node_modules/@changesets/config/dist/index.mjs
62026
+ //#region ../../node_modules/.pnpm/@changesets+config@4.0.0-next.9/node_modules/@changesets/config/dist/index.mjs
60674
62027
  const DEFAULT_CONFIG = {
60675
62028
  lang: void 0,
60676
62029
  message: void 0,
@@ -61412,9 +62765,9 @@ const WrittenConfigSchema = /* @__PURE__ */ object({
61412
62765
  linked: rootKey(PackageGroupSchema, "Packages that should be linked together so when they are being released, they will be released at the same version.", []),
61413
62766
  updateInternalDependencies: rootKey(/* @__PURE__ */ union([/* @__PURE__ */ literal("minor"), /* @__PURE__ */ literal("patch")]), "The minimum bump type to trigger automatic update of internal dependencies that are part of the same release.", "patch"),
61414
62767
  privatePackages: rootKey(/* @__PURE__ */ union([/* @__PURE__ */ object({
61415
- version: /* @__PURE__ */ optional(/* @__PURE__ */ boolean(), true),
62768
+ version: /* @__PURE__ */ optional(/* @__PURE__ */ boolean(), false),
61416
62769
  tag: /* @__PURE__ */ optional(/* @__PURE__ */ boolean(), false)
61417
- }), /* @__PURE__ */ literal(false)]), "Opt in to tracking non-npm / private packages", {}),
62770
+ }), /* @__PURE__ */ boolean()]), "Opt in to tracking non-npm / private packages", {}),
61418
62771
  bumpVersionsWithWorkspaceProtocolOnly: rootKey(/* @__PURE__ */ boolean(), "Determines whether Changesets should only bump dependency ranges that use workspace protocol of packages that are part of the workspace.", false),
61419
62772
  snapshot: rootKey(/* @__PURE__ */ object({
61420
62773
  useCalculatedVersion: /* @__PURE__ */ optional(/* @__PURE__ */ pipe(/* @__PURE__ */ boolean(), /* @__PURE__ */ description("Makes generated snapshot versions use the calculated version (based on the changeset files) as a base version, instead of 0.0.0")), false),
@@ -61438,11 +62791,11 @@ function normalizeWrittenConfig({ packageNames, writtenConfig }) {
61438
62791
  else if (writtenConfig.commit === true) config.commit = ["@changesets/cli/commit", { skipCI: "version" }];
61439
62792
  if (writtenConfig.ignore != null) config.ignore = globMatch(packageNames, writtenConfig.ignore);
61440
62793
  if (typeof writtenConfig.privatePackages !== "object") config.privatePackages = {
61441
- version: writtenConfig.privatePackages ?? true,
61442
- tag: false
62794
+ version: writtenConfig.privatePackages ?? false,
62795
+ tag: writtenConfig.privatePackages ?? false
61443
62796
  };
61444
62797
  else config.privatePackages = {
61445
- version: writtenConfig.privatePackages.version ?? true,
62798
+ version: writtenConfig.privatePackages.version ?? false,
61446
62799
  tag: writtenConfig.privatePackages.tag ?? false
61447
62800
  };
61448
62801
  return config;
@@ -61582,7 +62935,7 @@ async function readConfig(cwd, packages) {
61582
62935
  packages ??= await getPackages(cwd);
61583
62936
  return validateConfig(JSON.parse(await node_fs_promises.readFile(node_path.join(packages.rootDir, ".changeset", "config.json"), "utf8")), packages);
61584
62937
  }
61585
- var version = "4.0.0-next.8";
62938
+ var version = "4.0.0-next.9";
61586
62939
  const defaultConfig = normalizeWrittenConfig({
61587
62940
  packageNames: [],
61588
62941
  writtenConfig: parse(WrittenConfigSchema, {
@@ -62866,7 +64219,7 @@ var InternalError = class extends Error {
62866
64219
  }
62867
64220
  };
62868
64221
  //#endregion
62869
- //#region ../../node_modules/.pnpm/@changesets+git@4.0.0-next.8/node_modules/@changesets/git/dist/index.mjs
64222
+ //#region ../../node_modules/.pnpm/@changesets+git@4.0.0-next.9/node_modules/@changesets/git/dist/index.mjs
62870
64223
  async function getDivergedCommit(cwd, ref) {
62871
64224
  const cmd = await exec("git", [
62872
64225
  "merge-base",
@@ -62890,6 +64243,7 @@ async function getCommitsThatAddFiles(gitPaths, { cwd, short = false }) {
62890
64243
  const [commitSha, parentSha] = (await exec("git", [
62891
64244
  "log",
62892
64245
  "--diff-filter=A",
64246
+ "--follow",
62893
64247
  "--max-count=1",
62894
64248
  short ? "--pretty=format:%h:%p" : "--pretty=format:%H:%p",
62895
64249
  gitPath
@@ -62943,8 +64297,9 @@ async function getChangedChangesetFilesSinceRef({ cwd, ref }) {
62943
64297
  "--no-relative",
62944
64298
  await getDivergedCommit(cwd, ref)
62945
64299
  ], { nodeOptions: { cwd } });
62946
- const tester = /.changeset\/[^/]+\.md$/;
62947
- return cmd.stdout.toString().trim().split("\n").filter((file) => tester.test(file));
64300
+ const rootChangesetsRegex = /\.changeset\/[^/]+\.md$/;
64301
+ const preChangesetsRegex = /\.changeset\/pre\/[^/]+\.md$/;
64302
+ return cmd.stdout.toString().trim().split("\n").filter((file) => rootChangesetsRegex.test(file) || preChangesetsRegex.test(file));
62948
64303
  } catch (err) {
62949
64304
  if (err instanceof GitError) return [];
62950
64305
  throw err;
@@ -65011,7 +66366,7 @@ function applyEdits(text, edits) {
65011
66366
  return text;
65012
66367
  }
65013
66368
  //#endregion
65014
- //#region ../../node_modules/.pnpm/@changesets+apply-release-plan@8.0.0-next.9/node_modules/@changesets/apply-release-plan/dist/index.mjs
66369
+ //#region ../../node_modules/.pnpm/@changesets+apply-release-plan@8.0.0-next.10/node_modules/@changesets/apply-release-plan/dist/index.mjs
65015
66370
  /**
65016
66371
  * A simple JSON editing utility that preserves formatting. They specified operation keys
65017
66372
  * must exist in the JSON for this implementation.
@@ -65230,12 +66585,11 @@ async function applyReleasePlan(releasePlan, packages, config = defaultConfig, s
65230
66585
  ...pkg
65231
66586
  };
65232
66587
  }), changesets, config, cwd, contextDir);
65233
- if (releasePlan.preState != null && snapshot == null) {
65234
- if (releasePlan.preState.mode === "exit") await node_fs_promises.rm(node_path.join(cwd, ".changeset", "pre.json"), {
66588
+ if (releasePlan.preState?.mode === "exit" && snapshot == null) {
66589
+ await node_fs_promises.rm(node_path.join(cwd, ".changeset", "pre.json"), {
65235
66590
  recursive: true,
65236
66591
  force: true
65237
66592
  });
65238
- else await node_fs_promises.writeFile(node_path.join(cwd, ".changeset", "pre.json"), JSON.stringify(releasePlan.preState, null, 2) + "\n");
65239
66593
  touchedFiles.push(node_path.join(cwd, ".changeset", "pre.json"));
65240
66594
  }
65241
66595
  const versionsToUpdate = releases.map((release) => ({
@@ -65272,24 +66626,27 @@ async function applyReleasePlan(releasePlan, packages, config = defaultConfig, s
65272
66626
  if (pkgJsonPath) touchedFiles.push(pkgJsonPath);
65273
66627
  }
65274
66628
  if (filesToFormat.length > 0) await (await getFormatter(config.format, cwd))(filesToFormat);
65275
- if (releasePlan.preState == null || releasePlan.preState.mode === "exit") {
65276
- const changesetFolder = node_path.resolve(cwd, ".changeset");
65277
- await Promise.all(changesets.map(async (changeset) => {
65278
- const changesetPath = node_path.resolve(changesetFolder, `${changeset.id}.md`);
65279
- if (await node_fs_promises.access(changesetPath).then(() => true, () => false)) {
65280
- if (!changeset.releases.some((release) => shouldSkipPackage(packagesByName.get(release.name), {
65281
- ignore: config.ignore,
65282
- allowPrivatePackages: config.privatePackages.version
65283
- }))) {
65284
- touchedFiles.push(changesetPath);
65285
- await node_fs_promises.rm(changesetPath, {
65286
- recursive: true,
65287
- force: true
65288
- });
65289
- }
66629
+ const isPreChangesets = releasePlan.preState?.mode === "pre";
66630
+ if (isPreChangesets && changesets.length > 0) await node_fs_promises.mkdir(node_path.resolve(cwd, ".changeset", "pre"), { recursive: true });
66631
+ await Promise.all(changesets.map(async (changeset) => {
66632
+ const changesetPath = node_path.resolve(cwd, ".changeset", `${changeset.id}.md`);
66633
+ if (await node_fs_promises.access(changesetPath).then(() => true, () => false)) {
66634
+ if (!changeset.releases.some((release) => shouldSkipPackage(packagesByName.get(release.name), {
66635
+ ignore: config.ignore,
66636
+ allowPrivatePackages: config.privatePackages.version
66637
+ }))) if (isPreChangesets) {
66638
+ const newChangesetPath = node_path.resolve(cwd, ".changeset", "pre", `${changeset.id}.md`);
66639
+ await node_fs_promises.rename(changesetPath, newChangesetPath);
66640
+ touchedFiles.push(changesetPath, newChangesetPath);
66641
+ } else {
66642
+ await node_fs_promises.rm(changesetPath, {
66643
+ recursive: true,
66644
+ force: true
66645
+ });
66646
+ touchedFiles.push(changesetPath);
65290
66647
  }
65291
- }));
65292
- }
66648
+ }
66649
+ }));
65293
66650
  return touchedFiles;
65294
66651
  }
65295
66652
  async function getNewChangelogEntry(releasesWithPackage, changesets, config, cwd, contextDir) {
@@ -65361,7 +66718,7 @@ async function updateChangelog(changelogPath, changelog, name) {
65361
66718
  await node_fs_promises.writeFile(changelogPath, newChangelog);
65362
66719
  }
65363
66720
  //#endregion
65364
- //#region ../../node_modules/.pnpm/@changesets+assemble-release-plan@7.0.0-next.9/node_modules/@changesets/assemble-release-plan/dist/index.mjs
66721
+ //#region ../../node_modules/.pnpm/@changesets+assemble-release-plan@7.0.0-next.10/node_modules/@changesets/assemble-release-plan/dist/index.mjs
65365
66722
  function getHighestReleaseType(releases) {
65366
66723
  if (releases.length === 0) throw new Error(`Large internal Changesets error when calculating highest release type in the set of releases. Please contact the maintainers`);
65367
66724
  let highestReleaseType = "none";
@@ -65611,7 +66968,7 @@ function getNewVersion(release, preInfo) {
65611
66968
  function assembleReleasePlan(changesets, packages, config, preState, snapshot) {
65612
66969
  const packagesByName = new Map(packages.packages.map((x) => [x.packageJson.name, x]));
65613
66970
  const relevantChangesets = getRelevantChangesets(changesets, packagesByName, config, preState);
65614
- const preInfo = getPreInfo(changesets, packagesByName, config, preState);
66971
+ const preInfo = getPreInfo(packagesByName, config, preState);
65615
66972
  const releases = flattenReleases(relevantChangesets, packagesByName, config);
65616
66973
  const dependencyGraph = getDependentsGraph(packages, { bumpVersionsWithWorkspaceProtocolOnly: config.bumpVersionsWithWorkspaceProtocolOnly });
65617
66974
  let releasesValidated = false;
@@ -65665,10 +67022,7 @@ function getRelevantChangesets(changesets, packagesByName, config, preState) {
65665
67022
  else notSkippedPackages.push(release.name);
65666
67023
  if (skippedPackages.length > 0 && notSkippedPackages.length > 0) throw new Error(`Found mixed changeset ${changeset.id}\nFound ignored packages: ${skippedPackages.join(" ")}\nFound not ignored packages: ${notSkippedPackages.join(" ")}\nMixed changesets that contain both ignored and not ignored packages are not allowed`);
65667
67024
  }
65668
- if (preState && preState.mode !== "exit") {
65669
- const usedChangesetIds = new Set(preState.changesets);
65670
- return changesets.filter((changeset) => !usedChangesetIds.has(changeset.id));
65671
- }
67025
+ if (preState && preState.mode !== "exit") return changesets.filter((changeset) => !changeset.id.startsWith("pre/"));
65672
67026
  return changesets;
65673
67027
  }
65674
67028
  function getHighestPreVersion(groupKind, packageGroup, packagesByName) {
@@ -65679,12 +67033,8 @@ function getHighestPreVersion(groupKind, packageGroup, packagesByName) {
65679
67033
  }
65680
67034
  return highestPreVersion;
65681
67035
  }
65682
- function getPreInfo(changesets, packagesByName, config, preState) {
67036
+ function getPreInfo(packagesByName, config, preState) {
65683
67037
  if (preState == null) return;
65684
- const updatedPreState = {
65685
- ...preState,
65686
- changesets: changesets.map((changeset) => changeset.id)
65687
- };
65688
67038
  const preVersions = /* @__PURE__ */ new Map();
65689
67039
  for (const [, pkg] of packagesByName) {
65690
67040
  if (shouldSkipPackage(pkg, {
@@ -65702,12 +67052,12 @@ function getPreInfo(changesets, packagesByName, config, preState) {
65702
67052
  for (const linkedPackage of linkedGroup) preVersions.set(linkedPackage, highestPreVersion);
65703
67053
  }
65704
67054
  return {
65705
- state: updatedPreState,
67055
+ state: preState,
65706
67056
  preVersions
65707
67057
  };
65708
67058
  }
65709
67059
  //#endregion
65710
- //#region ../../node_modules/.pnpm/@changesets+pre@3.0.0-next.8/node_modules/@changesets/pre/dist/index.mjs
67060
+ //#region ../../node_modules/.pnpm/@changesets+pre@3.0.0-next.9/node_modules/@changesets/pre/dist/index.mjs
65711
67061
  async function outputFile(filePath, content) {
65712
67062
  await node_fs_promises.mkdir(node_path.dirname(filePath), { recursive: true });
65713
67063
  await node_fs_promises.writeFile(filePath, content, "utf8");
@@ -65730,13 +67080,25 @@ async function readPreState(rootDir) {
65730
67080
  return preState;
65731
67081
  }
65732
67082
  async function migratePreState(rootDir, preState) {
65733
- if (preState.initialVersions == null) return preState;
65734
- delete preState.initialVersions;
67083
+ if (preState.initialVersions == null && preState.changesets == null) return preState;
67084
+ if (preState.initialVersions != null) delete preState.initialVersions;
67085
+ if (preState.changesets != null) {
67086
+ const preChangesetsDir = node_path.resolve(rootDir, ".changeset", "pre");
67087
+ await node_fs_promises.mkdir(preChangesetsDir, { recursive: true });
67088
+ for (const changeset of preState.changesets) {
67089
+ const oldPath = node_path.resolve(rootDir, ".changeset", `${changeset}.md`);
67090
+ const newPath = node_path.resolve(preChangesetsDir, `${changeset}.md`);
67091
+ try {
67092
+ await node_fs_promises.rename(oldPath, newPath);
67093
+ } catch {}
67094
+ }
67095
+ delete preState.changesets;
67096
+ }
65735
67097
  await outputFile(node_path.resolve(rootDir, ".changeset", "pre.json"), JSON.stringify(preState, null, 2) + "\n");
65736
67098
  return preState;
65737
67099
  }
65738
67100
  //#endregion
65739
- //#region ../../node_modules/.pnpm/@changesets+parse@1.0.0-next.9/node_modules/@changesets/parse/dist/index.mjs
67101
+ //#region ../../node_modules/.pnpm/@changesets+parse@1.0.0-next.10/node_modules/@changesets/parse/dist/index.mjs
65740
67102
  const mdRegex = /\s*---([^]*?)\r?\n\s*---(\s*(?:\n|$)[^]*)/;
65741
67103
  const EXAMPLE_FORMAT = `---\n"package-name": patch\n---`;
65742
67104
  const validVersionTypes = [
@@ -65789,7 +67151,7 @@ YAML error: ${e instanceof Error ? e.message : String(e)}\nFrontmatter content:\
65789
67151
  };
65790
67152
  }
65791
67153
  //#endregion
65792
- //#region ../../node_modules/.pnpm/@changesets+read@1.0.0-next.9/node_modules/@changesets/read/dist/index.mjs
67154
+ //#region ../../node_modules/.pnpm/@changesets+read@1.0.0-next.10/node_modules/@changesets/read/dist/index.mjs
65793
67155
  const ignoredMdFiles = [
65794
67156
  /^README\.md$/i,
65795
67157
  "AGENTS.md",
@@ -65800,29 +67162,39 @@ async function filterChangesetsSinceRef(changesets, changesetBase, sinceRef) {
65800
67162
  const newHashes = (await getChangedChangesetFilesSinceRef({
65801
67163
  cwd: changesetBase,
65802
67164
  ref: sinceRef
65803
- })).map((c) => c.split("/").pop());
67165
+ })).map((c) => c.replace(/^.*\.changeset\//, ""));
65804
67166
  return changesets.filter((dir) => newHashes.includes(dir));
65805
67167
  }
65806
67168
  async function readChangesets(rootDir, sinceRef) {
65807
67169
  const changesetBase = node_path.join(rootDir, ".changeset");
65808
- let contents;
67170
+ let changesets = [];
65809
67171
  try {
65810
- contents = await node_fs_promises.readdir(changesetBase);
67172
+ changesets.push(...await node_fs_promises.readdir(changesetBase));
65811
67173
  } catch (err) {
65812
67174
  if (err.code === "ENOENT") throw new Error("There is no .changeset directory in this project", { cause: err });
65813
67175
  throw err;
65814
67176
  }
65815
- if (sinceRef != null) contents = await filterChangesetsSinceRef(contents, changesetBase, sinceRef);
65816
- const changesetContents = contents.filter((file) => !file.startsWith(".") && file.endsWith(".md") && !ignoredMdFiles.some((pattern) => typeof pattern === "string" ? pattern === file : pattern.test(file))).map(async (file) => {
67177
+ try {
67178
+ changesets.push(...(await node_fs_promises.readdir(node_path.join(changesetBase, "pre"))).map((file) => `pre/${file}`));
67179
+ } catch (err) {
67180
+ if (err.code !== "ENOENT") throw err;
67181
+ }
67182
+ console.log(changesets);
67183
+ if (sinceRef != null) changesets = await filterChangesetsSinceRef(changesets, changesetBase, sinceRef);
67184
+ changesets = changesets.filter((file) => {
67185
+ file = node_path.basename(file);
67186
+ return !file.startsWith(".") && file.endsWith(".md") && !ignoredMdFiles.some((pattern) => typeof pattern === "string" ? pattern === file : pattern.test(file));
67187
+ });
67188
+ const changesetContents = changesets.map(async (file) => {
65817
67189
  return {
65818
67190
  ...parseChangesetFile(await node_fs_promises.readFile(node_path.join(changesetBase, file), "utf8")),
65819
- id: file.replace(".md", "")
67191
+ id: file.replace(/\.md$/, "")
65820
67192
  };
65821
67193
  });
65822
67194
  return await Promise.all(changesetContents);
65823
67195
  }
65824
67196
  //#endregion
65825
- //#region ../../node_modules/.pnpm/@changesets+get-release-plan@5.0.0-next.9/node_modules/@changesets/get-release-plan/dist/index.mjs
67197
+ //#region ../../node_modules/.pnpm/@changesets+get-release-plan@5.0.0-next.10/node_modules/@changesets/get-release-plan/dist/index.mjs
65826
67198
  async function getReleasePlan(cwd, sinceRef, passedConfig) {
65827
67199
  const packages = await getPackages(cwd);
65828
67200
  const configResult = await readConfig(packages.rootDir, packages);