@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.
@@ -2338,7 +2338,7 @@ var GlobSet = class GlobSet extends effect.Schema.Class("GlobSet")(effect.Schema
2338
2338
  }
2339
2339
  };
2340
2340
  //#endregion
2341
- //#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
2341
+ //#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
2342
2342
  /**
2343
2343
  * Extension data specific to bun lockfiles, attached to `Lockfile.extension`
2344
2344
  * when the format is `"bun"`.
@@ -2359,7 +2359,7 @@ var BunExtension = class extends effect.Schema.Class("BunExtension")({
2359
2359
  trustedDependencies: effect.Schema.optionalKey(effect.Schema.Array(effect.Schema.String))
2360
2360
  }) {};
2361
2361
  //#endregion
2362
- //#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
2362
+ //#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
2363
2363
  /**
2364
2364
  * Contract for resolving pnpm `catalog:` dependency specifiers to concrete
2365
2365
  * version ranges.
@@ -2395,7 +2395,7 @@ var BunExtension = class extends effect.Schema.Class("BunExtension")({
2395
2395
  *
2396
2396
  * @public
2397
2397
  */
2398
- var CatalogResolver = class CatalogResolver extends effect.Context.Service()("@effected/npm/CatalogResolver") {
2398
+ var CatalogResolver$1 = class CatalogResolver extends effect.Context.Service()("@effected/npm/CatalogResolver") {
2399
2399
  /**
2400
2400
  * No-op default: `rangeOf` always succeeds with `Option.none()`, never
2401
2401
  * consulting an actual catalog. A pure `Layer.succeed`, bound to a const
@@ -2405,7 +2405,7 @@ var CatalogResolver = class CatalogResolver extends effect.Context.Service()("@e
2405
2405
  static noop = effect.Layer.succeed(CatalogResolver, { rangeOf: () => effect.Effect.succeed(effect.Option.none()) });
2406
2406
  };
2407
2407
  //#endregion
2408
- //#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
2408
+ //#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
2409
2409
  /**
2410
2410
  * Raised when a `catalog:` or `workspace:` specifier cannot be resolved
2411
2411
  * because the resolution mechanism itself failed — not for an ordinary
@@ -2419,7 +2419,7 @@ var CatalogResolver = class CatalogResolver extends effect.Context.Service()("@e
2419
2419
  *
2420
2420
  * @public
2421
2421
  */
2422
- var DependencyResolutionError = class extends effect.Schema.TaggedErrorClass()("DependencyResolutionError", {
2422
+ var DependencyResolutionError$1 = class extends effect.Schema.TaggedErrorClass()("DependencyResolutionError", {
2423
2423
  specifier: effect.Schema.String,
2424
2424
  cause: effect.Schema.Defect()
2425
2425
  }) {
@@ -2457,7 +2457,7 @@ var DependencyResolutionError = class extends effect.Schema.TaggedErrorClass()("
2457
2457
  *
2458
2458
  * @public
2459
2459
  */
2460
- var WorkspaceResolver = class WorkspaceResolver extends effect.Context.Service()("@effected/npm/WorkspaceResolver") {
2460
+ var WorkspaceResolver$1 = class WorkspaceResolver extends effect.Context.Service()("@effected/npm/WorkspaceResolver") {
2461
2461
  /**
2462
2462
  * No-op default: `versionOf` always succeeds with `Option.none()`, never
2463
2463
  * consulting an actual workspace. A pure `Layer.succeed`, bound to a
@@ -2466,7 +2466,7 @@ var WorkspaceResolver = class WorkspaceResolver extends effect.Context.Service()
2466
2466
  static noop = effect.Layer.succeed(WorkspaceResolver, { versionOf: () => effect.Effect.succeed(effect.Option.none()) });
2467
2467
  };
2468
2468
  //#endregion
2469
- //#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
2469
+ //#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
2470
2470
  /**
2471
2471
  * Raised when a workspace's catalogs cannot be assembled — a `pnpm-workspace.yaml`
2472
2472
  * that is unreadable or not valid YAML, a root `package.json` `workspaces` field
@@ -2509,15 +2509,7 @@ var CatalogAssemblyError = class extends effect.Schema.TaggedErrorClass()("Catal
2509
2509
  return `Failed to assemble catalogs from ${this.source} ${this.path}`;
2510
2510
  }
2511
2511
  };
2512
- //#endregion
2513
- //#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
2514
- /**
2515
- * The short dependency kind: which dependency map an entry came from, named the
2516
- * way consumers branch on it.
2517
- *
2518
- * @public
2519
- */
2520
- const DependencyKind = effect.Schema.Literals([
2512
+ effect.Schema.Literals([
2521
2513
  "prod",
2522
2514
  "dev",
2523
2515
  "peer",
@@ -2529,7 +2521,7 @@ const DependencyKind = effect.Schema.Literals([
2529
2521
  *
2530
2522
  * @public
2531
2523
  */
2532
- const DependencyField = effect.Schema.Literals([
2524
+ const DependencyField$1 = effect.Schema.Literals([
2533
2525
  "dependencies",
2534
2526
  "devDependencies",
2535
2527
  "peerDependencies",
@@ -2542,7 +2534,7 @@ Object.fromEntries(Object.entries({
2542
2534
  optional: "optionalDependencies"
2543
2535
  }).map(([kind, field]) => [field, kind]));
2544
2536
  //#endregion
2545
- //#region ../../node_modules/.pnpm/@effected+semver@0.3.1_effect@4.0.0-beta.101/node_modules/@effected/semver/internal/desugar.js
2537
+ //#region ../../node_modules/.pnpm/@effected+semver@0.3.2_effect@4.0.0-beta.101/node_modules/@effected/semver/internal/desugar.js
2546
2538
  const sv = (major, minor, patch, prerelease = [], build = []) => ({
2547
2539
  major,
2548
2540
  minor,
@@ -2631,7 +2623,7 @@ const desugarHyphen = (lower, upper) => {
2631
2623
  return [comp(">=", lowerVersion)];
2632
2624
  };
2633
2625
  //#endregion
2634
- //#region ../../node_modules/.pnpm/@effected+semver@0.3.1_effect@4.0.0-beta.101/node_modules/@effected/semver/internal/grammar.js
2626
+ //#region ../../node_modules/.pnpm/@effected+semver@0.3.2_effect@4.0.0-beta.101/node_modules/@effected/semver/internal/grammar.js
2635
2627
  /** Private control-flow exception; never escapes the entry points. */
2636
2628
  var ParseFailure = class {
2637
2629
  position;
@@ -2916,7 +2908,7 @@ const parseRangeComparators = (s) => {
2916
2908
  * Parse a range expression into comparator sets (OR of ANDs). The empty
2917
2909
  * string parses as the match-all range.
2918
2910
  */
2919
- const parseRange$1 = (raw) => {
2911
+ const parseRange$2 = (raw) => {
2920
2912
  const trimmed = raw.trim();
2921
2913
  if (trimmed.length === 0) return {
2922
2914
  ok: true,
@@ -3031,7 +3023,7 @@ const formatComparator = (c) => {
3031
3023
  /** Print comparator sets as `a b || c d`. */
3032
3024
  const formatRange = (sets) => sets.map((set) => set.map(formatComparator).join(" ")).join(" || ");
3033
3025
  //#endregion
3034
- //#region ../../node_modules/.pnpm/@effected+semver@0.3.1_effect@4.0.0-beta.101/node_modules/@effected/semver/internal/order.js
3026
+ //#region ../../node_modules/.pnpm/@effected+semver@0.3.2_effect@4.0.0-beta.101/node_modules/@effected/semver/internal/order.js
3035
3027
  /**
3036
3028
  * Compare two prerelease identifiers per SemVer 2.0.0 §11: numeric
3037
3029
  * identifiers always have lower precedence than alphanumeric ones; numerics
@@ -3084,7 +3076,7 @@ const compareBuild = (a, b) => {
3084
3076
  return 0;
3085
3077
  };
3086
3078
  //#endregion
3087
- //#region ../../node_modules/.pnpm/@effected+semver@0.3.1_effect@4.0.0-beta.101/node_modules/@effected/semver/SemVer.js
3079
+ //#region ../../node_modules/.pnpm/@effected+semver@0.3.2_effect@4.0.0-beta.101/node_modules/@effected/semver/SemVer.js
3088
3080
  /**
3089
3081
  * Indicates that a string could not be parsed as a valid SemVer 2.0.0 version.
3090
3082
  *
@@ -3595,7 +3587,7 @@ var SemVerBump = class {
3595
3587
  }
3596
3588
  };
3597
3589
  //#endregion
3598
- //#region ../../node_modules/.pnpm/@effected+semver@0.3.1_effect@4.0.0-beta.101/node_modules/@effected/semver/Comparator.js
3590
+ //#region ../../node_modules/.pnpm/@effected+semver@0.3.2_effect@4.0.0-beta.101/node_modules/@effected/semver/Comparator.js
3599
3591
  /**
3600
3592
  * Indicates that a string could not be parsed as a single comparator.
3601
3593
  *
@@ -3729,7 +3721,7 @@ var Comparator = class Comparator extends effect.Schema.Class("Comparator")({
3729
3721
  }
3730
3722
  };
3731
3723
  //#endregion
3732
- //#region ../../node_modules/.pnpm/@effected+semver@0.3.1_effect@4.0.0-beta.101/node_modules/@effected/semver/internal/normalize.js
3724
+ //#region ../../node_modules/.pnpm/@effected+semver@0.3.2_effect@4.0.0-beta.101/node_modules/@effected/semver/internal/normalize.js
3733
3725
  const operatorWeight = (op) => {
3734
3726
  switch (op) {
3735
3727
  case ">=": return 0;
@@ -3760,7 +3752,7 @@ const normalizeComparatorSet = (set) => sortComparators(removeDuplicates(set));
3760
3752
  /** Normalize every comparator set in a range: sort and deduplicate each independently. */
3761
3753
  const normalizeSets = (sets) => sets.map(normalizeComparatorSet);
3762
3754
  //#endregion
3763
- //#region ../../node_modules/.pnpm/@effected+semver@0.3.1_effect@4.0.0-beta.101/node_modules/@effected/semver/Range.js
3755
+ //#region ../../node_modules/.pnpm/@effected+semver@0.3.2_effect@4.0.0-beta.101/node_modules/@effected/semver/Range.js
3764
3756
  /**
3765
3757
  * Indicates that a string could not be parsed as a range expression.
3766
3758
  *
@@ -3815,7 +3807,7 @@ sets: effect.Schema.Array(effect.Schema.Array(Comparator)) }) {
3815
3807
  */
3816
3808
  static FromString = effect.Schema.String.pipe(effect.Schema.decodeTo(Range, effect.SchemaTransformation.transformOrFail({
3817
3809
  decode: (input) => {
3818
- const result = parseRange$1(input);
3810
+ const result = parseRange$2(input);
3819
3811
  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}` }));
3820
3812
  },
3821
3813
  encode: (parts) => effect.Effect.succeed(formatRange(parts.sets))
@@ -3846,7 +3838,7 @@ sets: effect.Schema.Array(effect.Schema.Array(Comparator)) }) {
3846
3838
  * with {@link InvalidRangeError}.
3847
3839
  */
3848
3840
  static parseResult(input) {
3849
- const result = parseRange$1(input);
3841
+ const result = parseRange$2(input);
3850
3842
  if (!result.ok) return effect.Result.fail(new InvalidRangeError({
3851
3843
  input: result.input,
3852
3844
  position: result.position
@@ -3868,17 +3860,54 @@ sets: effect.Schema.Array(effect.Schema.Array(Comparator)) }) {
3868
3860
  /**
3869
3861
  * Test whether a version satisfies a range; see {@link Range.test} for the
3870
3862
  * prerelease matching rule. Dual API.
3863
+ *
3864
+ * @remarks
3865
+ * **Data-first order is `(version, range)`** — the version being tested
3866
+ * comes first, the range it is tested against second. The data-last form
3867
+ * takes the range: `Range.satisfies(range)` applied to a version.
3868
+ *
3869
+ * Worth stating because the two parameters are distinct classes and the
3870
+ * order is not recoverable from the call site. TypeScript rejects a flipped
3871
+ * call outright, so this only bites callers without type checking — which
3872
+ * includes the untyped `node --input-type=module` probes this repo's own
3873
+ * evidence ladder calls for. There, `Range.satisfies(range, version)`
3874
+ * dispatches data-first, binds the `Range` to `version`, and dies with
3875
+ * `TypeError: range.test is not a function` — a message naming the
3876
+ * parameter that received the *version*, so it reads as a defect inside
3877
+ * this package rather than a caller error.
3878
+ *
3879
+ * The same order and the same hazard apply to `Range.filter`,
3880
+ * {@link Range.maxSatisfying} and {@link Range.minSatisfying}: subject
3881
+ * first, range second.
3871
3882
  */
3872
3883
  static satisfies = effect.Function.dual(2, (version, range) => range.test(version));
3873
- /** Filter versions that satisfy a range, preserving order. Dual API. */
3884
+ /**
3885
+ * Filter versions that satisfy a range, preserving order. Dual API.
3886
+ *
3887
+ * @remarks
3888
+ * Data-first order is `(versions, range)` — see {@link Range.satisfies}
3889
+ * for why the order is spelled out.
3890
+ */
3874
3891
  static filter = effect.Function.dual(2, (versions, range) => range.filter(versions));
3875
- /** Highest satisfying version, or `Option.none()`. Dual API. */
3892
+ /**
3893
+ * Highest satisfying version, or `Option.none()`. Dual API.
3894
+ *
3895
+ * @remarks
3896
+ * Data-first order is `(versions, range)` — see {@link Range.satisfies}
3897
+ * for why the order is spelled out.
3898
+ */
3876
3899
  static maxSatisfying = effect.Function.dual(2, (versions, range) => {
3877
3900
  let best;
3878
3901
  for (const v of versions) if (range.test(v) && (best === void 0 || v.gt(best))) best = v;
3879
3902
  return best === void 0 ? effect.Option.none() : effect.Option.some(best);
3880
3903
  });
3881
- /** Lowest satisfying version, or `Option.none()`. Dual API. */
3904
+ /**
3905
+ * Lowest satisfying version, or `Option.none()`. Dual API.
3906
+ *
3907
+ * @remarks
3908
+ * Data-first order is `(versions, range)` — see {@link Range.satisfies}
3909
+ * for why the order is spelled out.
3910
+ */
3882
3911
  static minSatisfying = effect.Function.dual(2, (versions, range) => {
3883
3912
  let best;
3884
3913
  for (const v of versions) if (range.test(v) && (best === void 0 || v.lt(best))) best = v;
@@ -4088,7 +4117,7 @@ const isComparatorSetSubset = (sub, sup) => {
4088
4117
  return true;
4089
4118
  };
4090
4119
  //#endregion
4091
- //#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
4120
+ //#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
4092
4121
  /**
4093
4122
  * Indicates that a string could not be parsed as a valid dependency specifier.
4094
4123
  *
@@ -4097,50 +4126,50 @@ const isComparatorSetSubset = (sub, sup) => {
4097
4126
  *
4098
4127
  * @public
4099
4128
  */
4100
- var InvalidDependencySpecifierError = class extends effect.Schema.TaggedErrorClass()("InvalidDependencySpecifierError", {
4129
+ var InvalidDependencySpecifierError$1 = class extends effect.Schema.TaggedErrorClass()("InvalidDependencySpecifierError", {
4101
4130
  /** The raw input string that failed validation. */
4102
4131
  input: effect.Schema.String }) {
4103
4132
  get message() {
4104
4133
  return `Invalid dependency specifier "${this.input}": not a recognized specifier`;
4105
4134
  }
4106
4135
  };
4107
- const CATALOG_PREFIX = "catalog:";
4108
- const WORKSPACE_PREFIX = "workspace:";
4109
- const isBarePath = (value) => value.startsWith("./") || value.startsWith("../") || value.startsWith("~/") || value.startsWith("/");
4110
- const isGitHubShorthand = (value) => !value.startsWith(".") && !value.startsWith("~") && !value.startsWith("/") && /^[a-zA-Z0-9_.-]+\/[a-zA-Z0-9_.-]+(#.*)?$/.test(value);
4111
- const isGit = (value) => value.startsWith("git+") || value.startsWith("git://") || value.startsWith("github:") || value.startsWith("gist:") || value.startsWith("bitbucket:") || value.startsWith("gitlab:") || isGitHubShorthand(value);
4112
- const isLocal = (value) => value.startsWith("file:") || value.startsWith("link:") || value.startsWith("portal:") || isBarePath(value);
4113
- const isLink = (value) => value.startsWith("link:");
4114
- const isPortal = (value) => value.startsWith("portal:");
4115
- const isCatalog = (value) => value.startsWith(CATALOG_PREFIX);
4116
- const isWorkspace = (value) => value.startsWith(WORKSPACE_PREFIX);
4117
- const isUrl$1 = (value) => value.startsWith("http://") || value.startsWith("https://");
4118
- const parseRange = (value) => {
4136
+ const CATALOG_PREFIX$1 = "catalog:";
4137
+ const WORKSPACE_PREFIX$1 = "workspace:";
4138
+ const isBarePath$1 = (value) => value.startsWith("./") || value.startsWith("../") || value.startsWith("~/") || value.startsWith("/");
4139
+ const isGitHubShorthand$1 = (value) => !value.startsWith(".") && !value.startsWith("~") && !value.startsWith("/") && /^[a-zA-Z0-9_.-]+\/[a-zA-Z0-9_.-]+(#.*)?$/.test(value);
4140
+ 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);
4141
+ const isLocal$1 = (value) => value.startsWith("file:") || value.startsWith("link:") || value.startsWith("portal:") || isBarePath$1(value);
4142
+ const isLink$1 = (value) => value.startsWith("link:");
4143
+ const isPortal$1 = (value) => value.startsWith("portal:");
4144
+ const isCatalog$1 = (value) => value.startsWith(CATALOG_PREFIX$1);
4145
+ const isWorkspace$1 = (value) => value.startsWith(WORKSPACE_PREFIX$1);
4146
+ const isUrl$2 = (value) => value.startsWith("http://") || value.startsWith("https://");
4147
+ const parseRange$1 = (value) => {
4119
4148
  const exit = effect.Schema.decodeUnknownExit(Range$2.FromString)(value);
4120
4149
  return effect.Exit.isSuccess(exit) ? effect.Option.some(exit.value) : effect.Option.none();
4121
4150
  };
4122
- const isRange = (value) => effect.Option.isSome(parseRange(value));
4123
- const protocolOf = (value) => {
4124
- if (value.startsWith(CATALOG_PREFIX)) return "catalog";
4125
- if (value.startsWith(WORKSPACE_PREFIX)) return "workspace";
4151
+ const isRange$1 = (value) => effect.Option.isSome(parseRange$1(value));
4152
+ const protocolOf$1 = (value) => {
4153
+ if (value.startsWith(CATALOG_PREFIX$1)) return "catalog";
4154
+ if (value.startsWith(WORKSPACE_PREFIX$1)) return "workspace";
4126
4155
  if (value.startsWith("link:")) return "link";
4127
4156
  if (value.startsWith("portal:")) return "portal";
4128
- if (value.startsWith("file:") || isBarePath(value)) return "file";
4157
+ if (value.startsWith("file:") || isBarePath$1(value)) return "file";
4129
4158
  if (value.startsWith("npm:")) return "npm";
4130
- if (isGit(value)) return "git";
4131
- if (isUrl$1(value)) return "url";
4132
- if (isRange(value)) return "range";
4159
+ if (isGit$1(value)) return "git";
4160
+ if (isUrl$2(value)) return "url";
4161
+ if (isRange$1(value)) return "range";
4133
4162
  if (/^[a-zA-Z][a-zA-Z0-9._-]*$/.test(value)) return "tag";
4134
4163
  return "unknown";
4135
4164
  };
4136
- const isTag = (value) => protocolOf(value) === "tag";
4137
- const catalogNameOf$1 = (specifier) => {
4138
- if (!isCatalog(specifier)) return effect.Option.none();
4165
+ const isTag$1 = (value) => protocolOf$1(value) === "tag";
4166
+ const catalogNameOf$2 = (specifier) => {
4167
+ if (!isCatalog$1(specifier)) return effect.Option.none();
4139
4168
  const rest = specifier.slice(8).trim();
4140
4169
  return rest.length === 0 ? effect.Option.none() : effect.Option.some(rest);
4141
4170
  };
4142
- const projectRangeModifier = (range, version) => range === "*" || range === "" ? version : range === "~" ? `~${version}` : range === "^" ? `^${version}` : range;
4143
- const splitWorkspaceRest = (rest) => {
4171
+ const projectRangeModifier$1 = (range, version) => range === "*" || range === "" ? version : range === "~" ? `~${version}` : range === "^" ? `^${version}` : range;
4172
+ const splitWorkspaceRest$1 = (rest) => {
4144
4173
  const at = rest.lastIndexOf("@");
4145
4174
  return at > 0 ? {
4146
4175
  target: rest.slice(0, at),
@@ -4150,15 +4179,15 @@ const splitWorkspaceRest = (rest) => {
4150
4179
  range: rest
4151
4180
  };
4152
4181
  };
4153
- const projectWorkspaceRange = (rest, version) => {
4154
- const { target, range } = splitWorkspaceRest(rest);
4155
- const projected = projectRangeModifier(range, version);
4182
+ const projectWorkspaceRange$1 = (rest, version) => {
4183
+ const { target, range } = splitWorkspaceRest$1(rest);
4184
+ const projected = projectRangeModifier$1(range, version);
4156
4185
  return target === void 0 ? projected : `npm:${target}@${projected}`;
4157
4186
  };
4158
- const resolveWorkspace = (specifier, version) => isWorkspace(specifier) ? projectWorkspaceRange(specifier.slice(10), version) : specifier;
4159
- const workspaceTargetOf = (specifier) => {
4160
- if (!isWorkspace(specifier)) return effect.Option.none();
4161
- const { target } = splitWorkspaceRest(specifier.slice(10));
4187
+ const resolveWorkspace$1 = (specifier, version) => isWorkspace$1(specifier) ? projectWorkspaceRange$1(specifier.slice(10), version) : specifier;
4188
+ const workspaceTargetOf$1 = (specifier) => {
4189
+ if (!isWorkspace$1(specifier)) return effect.Option.none();
4190
+ const { target } = splitWorkspaceRest$1(specifier.slice(10));
4162
4191
  return target === void 0 ? effect.Option.none() : effect.Option.some(target);
4163
4192
  };
4164
4193
  /**
@@ -4168,14 +4197,14 @@ const workspaceTargetOf = (specifier) => {
4168
4197
  *
4169
4198
  * @public
4170
4199
  */
4171
- const isValidDependencySpecifier = (value) => value.length > 0 && protocolOf(value) !== "unknown";
4200
+ const isValidDependencySpecifier$1 = (value) => value.length > 0 && protocolOf$1(value) !== "unknown";
4172
4201
  /**
4173
4202
  * A `catalog:` reference. `name` carries the catalog name, or `Option.none()`
4174
4203
  * for the default catalog (`catalog:`).
4175
4204
  *
4176
4205
  * @public
4177
4206
  */
4178
- var CatalogSpecifier = class extends effect.Schema.TaggedClass()("catalog", {
4207
+ var CatalogSpecifier$1 = class extends effect.Schema.TaggedClass()("catalog", {
4179
4208
  /** The original specifier string. */
4180
4209
  raw: effect.Schema.String,
4181
4210
  /** The catalog name, or `Option.none()` for the default catalog. */
@@ -4187,7 +4216,7 @@ var CatalogSpecifier = class extends effect.Schema.TaggedClass()("catalog", {
4187
4216
  *
4188
4217
  * @public
4189
4218
  */
4190
- var WorkspaceSpecifier = class extends effect.Schema.TaggedClass()("workspace", {
4219
+ var WorkspaceSpecifier$1 = class extends effect.Schema.TaggedClass()("workspace", {
4191
4220
  /** The original specifier string. */
4192
4221
  raw: effect.Schema.String,
4193
4222
  /** The part after `workspace:` (e.g. `*`, `^1.2.3`, or an alias form). */
@@ -4211,7 +4240,7 @@ var WorkspaceSpecifier = class extends effect.Schema.TaggedClass()("workspace",
4211
4240
  * specifier points at (the alias target's version for the alias form).
4212
4241
  */
4213
4242
  resolve(version) {
4214
- return projectWorkspaceRange(this.range, version);
4243
+ return projectWorkspaceRange$1(this.range, version);
4215
4244
  }
4216
4245
  };
4217
4246
  /**
@@ -4219,7 +4248,7 @@ var WorkspaceSpecifier = class extends effect.Schema.TaggedClass()("workspace",
4219
4248
  *
4220
4249
  * @public
4221
4250
  */
4222
- var RangeSpecifier = class extends effect.Schema.TaggedClass()("range", {
4251
+ var RangeSpecifier$1 = class extends effect.Schema.TaggedClass()("range", {
4223
4252
  /** The original specifier string. */
4224
4253
  raw: effect.Schema.String }) {};
4225
4254
  /**
@@ -4227,7 +4256,7 @@ raw: effect.Schema.String }) {};
4227
4256
  *
4228
4257
  * @public
4229
4258
  */
4230
- var DistTagSpecifier = class extends effect.Schema.TaggedClass()("dist-tag", {
4259
+ var DistTagSpecifier$1 = class extends effect.Schema.TaggedClass()("dist-tag", {
4231
4260
  /** The original specifier string (also the tag name). */
4232
4261
  raw: effect.Schema.String }) {};
4233
4262
  /**
@@ -4236,35 +4265,35 @@ raw: effect.Schema.String }) {};
4236
4265
  *
4237
4266
  * @public
4238
4267
  */
4239
- var RawSpecifier = class extends effect.Schema.TaggedClass()("raw", {
4268
+ var RawSpecifier$1 = class extends effect.Schema.TaggedClass()("raw", {
4240
4269
  /** The original specifier string. */
4241
4270
  raw: effect.Schema.String }) {};
4242
- const Classified = effect.Schema.Union([
4243
- CatalogSpecifier,
4244
- WorkspaceSpecifier,
4245
- RangeSpecifier,
4246
- DistTagSpecifier,
4247
- RawSpecifier
4271
+ const Classified$1 = effect.Schema.Union([
4272
+ CatalogSpecifier$1,
4273
+ WorkspaceSpecifier$1,
4274
+ RangeSpecifier$1,
4275
+ DistTagSpecifier$1,
4276
+ RawSpecifier$1
4248
4277
  ]);
4249
- const classify$1 = (value) => {
4250
- if (isCatalog(value)) return CatalogSpecifier.make({
4278
+ const classify$2 = (value) => {
4279
+ if (isCatalog$1(value)) return CatalogSpecifier$1.make({
4251
4280
  raw: value,
4252
- name: catalogNameOf$1(value)
4281
+ name: catalogNameOf$2(value)
4253
4282
  });
4254
- if (isWorkspace(value)) return WorkspaceSpecifier.make({
4283
+ if (isWorkspace$1(value)) return WorkspaceSpecifier$1.make({
4255
4284
  raw: value,
4256
4285
  range: value.slice(10)
4257
4286
  });
4258
- if (isRange(value)) return RangeSpecifier.make({ raw: value });
4259
- if (isTag(value)) return DistTagSpecifier.make({ raw: value });
4260
- return RawSpecifier.make({ raw: value });
4287
+ if (isRange$1(value)) return RangeSpecifier$1.make({ raw: value });
4288
+ if (isTag$1(value)) return DistTagSpecifier$1.make({ raw: value });
4289
+ return RawSpecifier$1.make({ raw: value });
4261
4290
  };
4262
- const fromString = effect.Schema.String.pipe(effect.Schema.decodeTo(Classified, effect.SchemaTransformation.transformOrFail({
4263
- 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}"` })),
4291
+ const fromString$1 = effect.Schema.String.pipe(effect.Schema.decodeTo(Classified$1, effect.SchemaTransformation.transformOrFail({
4292
+ 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}"` })),
4264
4293
  encode: (classified) => effect.Effect.succeed(classified.raw)
4265
4294
  })));
4266
- 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"));
4267
- const decode$3 = (input) => effect.Schema.decodeUnknownEffect(brandedSpecifier)(input).pipe(effect.Effect.mapError(() => new InvalidDependencySpecifierError({ input })));
4295
+ 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"));
4296
+ const decode$5 = (input) => effect.Schema.decodeUnknownEffect(brandedSpecifier$1)(input).pipe(effect.Effect.mapError(() => new InvalidDependencySpecifierError$1({ input })));
4268
4297
  /**
4269
4298
  * A valid dependency version specifier, carrying the protocol taxonomy statics
4270
4299
  * (`DependencySpecifier.protocolOf` and friends) that classify any specifier
@@ -4275,43 +4304,43 @@ const decode$3 = (input) => effect.Schema.decodeUnknownEffect(brandedSpecifier)(
4275
4304
  *
4276
4305
  * @public
4277
4306
  */
4278
- const DependencySpecifier = Object.assign(brandedSpecifier, {
4279
- protocolOf,
4280
- parseRange,
4281
- isRange,
4282
- isTag,
4283
- isGit,
4284
- isUrl: isUrl$1,
4285
- isLocal,
4286
- isLink,
4287
- isPortal,
4288
- isCatalog,
4289
- isWorkspace,
4290
- catalogNameOf: catalogNameOf$1,
4291
- resolveWorkspace,
4292
- workspaceTargetOf,
4293
- isValid: isValidDependencySpecifier,
4294
- decode: decode$3,
4295
- FromString: fromString
4307
+ const DependencySpecifier$1 = Object.assign(brandedSpecifier$1, {
4308
+ protocolOf: protocolOf$1,
4309
+ parseRange: parseRange$1,
4310
+ isRange: isRange$1,
4311
+ isTag: isTag$1,
4312
+ isGit: isGit$1,
4313
+ isUrl: isUrl$2,
4314
+ isLocal: isLocal$1,
4315
+ isLink: isLink$1,
4316
+ isPortal: isPortal$1,
4317
+ isCatalog: isCatalog$1,
4318
+ isWorkspace: isWorkspace$1,
4319
+ catalogNameOf: catalogNameOf$2,
4320
+ resolveWorkspace: resolveWorkspace$1,
4321
+ workspaceTargetOf: workspaceTargetOf$1,
4322
+ isValid: isValidDependencySpecifier$1,
4323
+ decode: decode$5,
4324
+ FromString: fromString$1
4296
4325
  });
4297
4326
  //#endregion
4298
- //#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
4299
- const SRI_RE = /^(sha1|sha256|sha384|sha512)-[A-Za-z0-9+/]+={0,2}$/;
4300
- const COREPACK_RE = /^(sha1|sha224|sha256|sha384|sha512)\.[0-9a-f]+$/;
4301
- const YARN_RE = /^[0-9]+(c[0-9]+)?\/[0-9a-f]+$/;
4302
- const isSri = (value) => SRI_RE.test(value);
4303
- const isCorepack = (value) => COREPACK_RE.test(value);
4304
- const isYarnChecksum = (value) => YARN_RE.test(value);
4327
+ //#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
4328
+ const SRI_RE$1 = /^(sha1|sha256|sha384|sha512)-[A-Za-z0-9+/]+={0,2}$/;
4329
+ const COREPACK_RE$1 = /^(sha1|sha224|sha256|sha384|sha512)\.[0-9a-f]+$/;
4330
+ const YARN_RE$1 = /^[0-9]+(c[0-9]+)?\/[0-9a-f]+$/;
4331
+ const isSri$1 = (value) => SRI_RE$1.test(value);
4332
+ const isCorepack$1 = (value) => COREPACK_RE$1.test(value);
4333
+ const isYarnChecksum$1 = (value) => YARN_RE$1.test(value);
4305
4334
  /**
4306
4335
  * Whether a string is a valid integrity hash in the SRI (`<algo>-<base64>`),
4307
4336
  * corepack (`<algo>.<hex>`) or yarn (`<cachekey>/<hex>`) form.
4308
4337
  *
4309
4338
  * @public
4310
4339
  */
4311
- const isValidIntegrityHash = (value) => isSri(value) || isCorepack(value) || isYarnChecksum(value);
4312
- const algorithmOf = (value) => {
4313
- if (isSri(value)) return effect.Option.some(value.slice(0, value.indexOf("-")));
4314
- if (isCorepack(value)) return effect.Option.some(value.slice(0, value.indexOf(".")));
4340
+ const isValidIntegrityHash$1 = (value) => isSri$1(value) || isCorepack$1(value) || isYarnChecksum$1(value);
4341
+ const algorithmOf$1 = (value) => {
4342
+ if (isSri$1(value)) return effect.Option.some(value.slice(0, value.indexOf("-")));
4343
+ if (isCorepack$1(value)) return effect.Option.some(value.slice(0, value.indexOf(".")));
4315
4344
  return effect.Option.none();
4316
4345
  };
4317
4346
  /**
@@ -4322,15 +4351,15 @@ const algorithmOf = (value) => {
4322
4351
  *
4323
4352
  * @public
4324
4353
  */
4325
- var InvalidIntegrityHashError = class extends effect.Schema.TaggedErrorClass()("InvalidIntegrityHashError", {
4354
+ var InvalidIntegrityHashError$1 = class extends effect.Schema.TaggedErrorClass()("InvalidIntegrityHashError", {
4326
4355
  /** The raw input string that failed validation. */
4327
4356
  input: effect.Schema.String }) {
4328
4357
  get message() {
4329
4358
  return `Invalid integrity hash "${this.input}": expected an SRI (<algo>-<base64>), corepack (<algo>.<hex>) or yarn (<cachekey>/<hex>) form`;
4330
4359
  }
4331
4360
  };
4332
- 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"));
4333
- const decode$2 = (input) => effect.Schema.decodeUnknownEffect(brandedIntegrity)(input).pipe(effect.Effect.mapError(() => new InvalidIntegrityHashError({ input })));
4361
+ 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"));
4362
+ const decode$4 = (input) => effect.Schema.decodeUnknownEffect(brandedIntegrity$1)(input).pipe(effect.Effect.mapError(() => new InvalidIntegrityHashError$1({ input })));
4334
4363
  /**
4335
4364
  * A subresource-integrity hash, covering the SRI (`sha512-<base64>`), corepack
4336
4365
  * (`sha512.<hex>`) and yarn (`10c0/<hex>`) textual forms, carrying taxonomy
@@ -4339,66 +4368,15 @@ const decode$2 = (input) => effect.Schema.decodeUnknownEffect(brandedIntegrity)(
4339
4368
  *
4340
4369
  * @public
4341
4370
  */
4342
- const IntegrityHash = Object.assign(brandedIntegrity, {
4343
- isSri,
4344
- isCorepack,
4345
- isYarnChecksum,
4346
- isValid: isValidIntegrityHash,
4347
- algorithmOf,
4348
- decode: decode$2
4371
+ const IntegrityHash$1 = Object.assign(brandedIntegrity$1, {
4372
+ isSri: isSri$1,
4373
+ isCorepack: isCorepack$1,
4374
+ isYarnChecksum: isYarnChecksum$1,
4375
+ isValid: isValidIntegrityHash$1,
4376
+ algorithmOf: algorithmOf$1,
4377
+ decode: decode$4
4349
4378
  });
4350
- /**
4351
- * {@link (IntegrityHash:variable)} narrowed to the corepack `<algo>.<hex>` form
4352
- * — `sha512.deadbeef`, and corepack's own sha224 default pins
4353
- * (`sha224.877304e3…`). An SRI (`sha512-<base64>`) or yarn (`10c0/<hex>`)
4354
- * hash, both valid `IntegrityHash` values, fails this schema.
4355
- *
4356
- * @remarks
4357
- * The corepack pin tail (`<name>@<version>+<integrity>`) is the one place the
4358
- * kit meets this form, and two schemas name it: `PackageManagerPin.integrity`
4359
- * here and `@effected/package-json`'s `PackageManager.integrity`. Both consume
4360
- * **this** schema — the restriction existed privately in each module until they
4361
- * were consolidated, and a private copy is exactly how the two drift (the
4362
- * widening that admitted sha224 had to be made twice).
4363
- *
4364
- * It decodes to the same {@link IntegrityHashBrand} the unrestricted schema
4365
- * does, so a corepack-validated value assigns anywhere an `IntegrityHash` is
4366
- * expected; there is no second brand. Reach for
4367
- * `IntegrityHash.isCorepack(value)` to ask the same question about a raw
4368
- * string without decoding.
4369
- *
4370
- * That single brand is also why sharing this schema is not type-enforced, and
4371
- * the consequence is sharper than it looks: a `Schema.check` is **erased from
4372
- * the built type**, so this schema and the unrestricted one are the same
4373
- * declared type. A consumer that quietly reverts to a private copy compiles
4374
- * clean, and — if the copy is faithful — passes every rejection test too.
4375
- * Neither `tsc` nor behaviour can see the re-fork.
4376
- *
4377
- * What does see it is **object identity**, so each consumer's suite asserts
4378
- * that its field schema IS this export:
4379
- * `PackageManagerPin.fields.integrity.schema === CorepackIntegrityHash` (an
4380
- * `optionalKey` field keeps the inner schema on `.schema`), and
4381
- * `PackageManager.fields.integrity.value === CorepackIntegrityHash` on the
4382
- * `@effected/package-json` side (a `Schema.Option` keeps it on `.value`). Both
4383
- * assertions carry a control against the unrestricted brand, so they discriminate
4384
- * rather than passing on any schema at all. That identity assertion is the only
4385
- * thing standing between the two surfaces and a silent re-fork; do not replace
4386
- * it with a behavioural test, which cannot fail.
4387
- *
4388
- * @example
4389
- * ```ts
4390
- * import { CorepackIntegrityHash } from "@effected/npm";
4391
- * import { Schema } from "effect";
4392
- *
4393
- * const decode = Schema.decodeUnknownExit(CorepackIntegrityHash);
4394
- *
4395
- * decode("sha512.deadbeef"); // success
4396
- * decode("sha512-3q2+7w=="); // failure — SRI form
4397
- * ```
4398
- *
4399
- * @public
4400
- */
4401
- const CorepackIntegrityHash = brandedIntegrity.pipe(effect.Schema.check(effect.Schema.makeFilter((value) => isCorepack(value) ? void 0 : "Expected a corepack (<algo>.<hex>) integrity hash")));
4379
+ brandedIntegrity$1.pipe(effect.Schema.check(effect.Schema.makeFilter((value) => isCorepack$1(value) ? void 0 : "Expected a corepack (<algo>.<hex>) integrity hash")));
4402
4380
  effect.Schema.Literals([
4403
4381
  "npm",
4404
4382
  "pnpm",
@@ -4594,7 +4572,678 @@ var LocalExec = class LocalExec extends effect.Context.Service()("@effected/comm
4594
4572
  static layerTest = (overrides = {}) => effect.Layer.succeed(LocalExec, LocalExec.makeTest(overrides));
4595
4573
  };
4596
4574
  //#endregion
4597
- //#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
4575
+ //#region ../../node_modules/.pnpm/@effected+commands@0.3.1_effect@4.0.0-beta.101/node_modules/@effected/commands/Redaction.js
4576
+ /**
4577
+ * Argument tokens whose *following* positional (or `=`-joined value) is a
4578
+ * secret. Lowercase; matching is case-insensitive.
4579
+ *
4580
+ * @remarks
4581
+ * This is the heuristic backstop, not the primary mechanism — it can only know
4582
+ * about flags someone thought to list. The primary mechanism is
4583
+ * {@link Redaction.applyArgs}, which redacts by **value**: the caller says what
4584
+ * its secrets are and every occurrence goes, whatever flag carried it.
4585
+ *
4586
+ * @public
4587
+ */
4588
+ const SECRET_FLAGS = /* @__PURE__ */ new Set([
4589
+ "--access-token",
4590
+ "--api-key",
4591
+ "--auth",
4592
+ "--auth-token",
4593
+ "--otp",
4594
+ "--password",
4595
+ "--registry-token",
4596
+ "--token"
4597
+ ]);
4598
+ /**
4599
+ * npm config keys whose value is a credential (`//registry/:_authToken`,
4600
+ * `//registry/:_password`).
4601
+ */
4602
+ const AUTH_KEY = /:(?:_authtoken|_password)$/i;
4603
+ /**
4604
+ * The distinct, non-empty secret values, longest first.
4605
+ *
4606
+ * @remarks
4607
+ * Longest-first is load-bearing: redacting `"ab"` before `"abcd"` rewrites
4608
+ * `"abcd"` to `"***cd"`, leaking `"cd"` — a fragment of the longer secret.
4609
+ * Empty values are dropped because `"abc".split("").join("***")` would insert
4610
+ * the placeholder between every character.
4611
+ */
4612
+ const prepare = (secrets) => [...new Set(secrets.map(effect.Redacted.value))].filter((value) => value.length > 0).sort((a, b) => b.length - a.length);
4613
+ /** Replaces each prepared value with {@link REDACTED}, literally (never as a pattern). */
4614
+ const replaceAll = (text, values) => {
4615
+ let out = text;
4616
+ for (const value of values) out = out.split(value).join("***");
4617
+ return out;
4618
+ };
4619
+ const apply = (text, secrets) => secrets.length === 0 ? text : replaceAll(text, prepare(secrets));
4620
+ const applyArgs = (args, secrets) => {
4621
+ if (secrets.length === 0) return args;
4622
+ const values = prepare(secrets);
4623
+ return args.map((arg) => replaceAll(arg, values));
4624
+ };
4625
+ /** Whether `name` introduces a credential value. */
4626
+ const isSecretName = (name, extra) => {
4627
+ const lower = name.toLowerCase();
4628
+ return SECRET_FLAGS.has(lower) || extra.has(lower) || AUTH_KEY.test(name);
4629
+ };
4630
+ const scrubArgs = (args, options) => {
4631
+ const extra = new Set((options?.flags ?? []).map((flag) => flag.toLowerCase()));
4632
+ const out = [];
4633
+ for (let index = 0; index < args.length; index++) {
4634
+ const arg = args[index] ?? "";
4635
+ const equals = arg.indexOf("=");
4636
+ if (equals > 0 && isSecretName(arg.slice(0, equals), extra)) {
4637
+ out.push(`${arg.slice(0, equals)}=***`);
4638
+ continue;
4639
+ }
4640
+ out.push(arg);
4641
+ if (isSecretName(arg, extra) && index + 1 < args.length) {
4642
+ out.push("***");
4643
+ index++;
4644
+ }
4645
+ }
4646
+ return out;
4647
+ };
4648
+ /**
4649
+ * Secret scrubbing for command arguments and captured output.
4650
+ *
4651
+ * @remarks
4652
+ * Two mechanisms, deliberately layered. {@link Redaction.apply} and
4653
+ * {@link Redaction.applyArgs} redact **by value** — the caller declares its
4654
+ * secrets as `Redacted` and every occurrence is removed wherever it appears.
4655
+ * {@link Redaction.scrubArgs} is a **flag heuristic** that runs in addition, for
4656
+ * the secrets a caller forgot to declare.
4657
+ *
4658
+ * @public
4659
+ */
4660
+ var Redaction = class {
4661
+ constructor() {}
4662
+ /**
4663
+ * Replaces every occurrence of every secret's value in `text` with
4664
+ * {@link REDACTED}.
4665
+ *
4666
+ * @remarks
4667
+ * Exact, literal matching — no pattern compilation, no encoding-aware search. A
4668
+ * secret that reaches the text base64-encoded, URL-encoded, or split across a
4669
+ * line break is **not** found; declare the encoded form as a secret too if that
4670
+ * is a real risk.
4671
+ *
4672
+ * A secret composed only of the placeholder's own characters (`*`, `**`, `***`)
4673
+ * cannot be fully removed, because the replacement reintroduces it. That is a
4674
+ * documented limitation, not a defect.
4675
+ */
4676
+ static apply = apply;
4677
+ /**
4678
+ * {@link Redaction.apply} over each entry of an argv array. An entry is
4679
+ * redacted whether it *is* a secret or merely *contains* one
4680
+ * (`--url=https://u:s3cr3t@host`).
4681
+ */
4682
+ static applyArgs = applyArgs;
4683
+ /**
4684
+ * Heuristic backstop: redact any argv value that is introduced by a known
4685
+ * secret-bearing flag or npm auth key, in either the separated
4686
+ * (`--token abc`) or inline (`--token=abc`) form.
4687
+ *
4688
+ * @remarks
4689
+ * This catches secrets the caller forgot to declare; it cannot catch a flag
4690
+ * nobody listed. Prefer {@link Redaction.applyArgs} with the actual
4691
+ * `Redacted` values — this runs *in addition*, never instead.
4692
+ */
4693
+ static scrubArgs = scrubArgs;
4694
+ /** Flags treated as secret-bearing by {@link Redaction.scrubArgs}. See {@link SECRET_FLAGS}. */
4695
+ static SECRET_FLAGS = SECRET_FLAGS;
4696
+ };
4697
+ //#endregion
4698
+ //#region ../../node_modules/.pnpm/@effected+commands@0.3.1_effect@4.0.0-beta.101/node_modules/@effected/commands/internal/capture.js
4699
+ /**
4700
+ * Raised when a captured stream exceeds its byte budget.
4701
+ *
4702
+ * @remarks
4703
+ * Internal and never exported from the package: `Run` maps it to the public
4704
+ * `CommandOutputError`. `Data.TaggedError` is appropriate precisely because it
4705
+ * never escapes — it is an in-process signal, not a contract.
4706
+ */
4707
+ var OutputTooLarge = class extends effect.Data.TaggedError("OutputTooLarge") {};
4708
+ /**
4709
+ * Collects a byte stream into a string, failing once more than `limit` bytes
4710
+ * have arrived.
4711
+ *
4712
+ * @remarks
4713
+ * The budget is enforced **during** accumulation, not after: checking the
4714
+ * length of an already-collected string would mean the memory was already
4715
+ * spent, which is the exact failure the budget exists to prevent. Counting is
4716
+ * on raw bytes, before decoding, because bytes are what the process actually
4717
+ * produced.
4718
+ */
4719
+ const collectBounded = (stream, limit) => effect.Effect.gen(function* () {
4720
+ const seen = yield* effect.Ref.make(0);
4721
+ 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)));
4722
+ return yield* effect.Stream.mkString(effect.Stream.decodeText(bounded));
4723
+ });
4724
+ //#endregion
4725
+ //#region ../../node_modules/.pnpm/@effected+commands@0.3.1_effect@4.0.0-beta.101/node_modules/@effected/commands/Run.js
4726
+ /**
4727
+ * Default ceiling on captured bytes per stream (16 MiB).
4728
+ *
4729
+ * @remarks
4730
+ * Collecting a child's output without a bound is a memory-exhaustion vector.
4731
+ * Output genuinely larger than this belongs on {@link Run.stream}, which never
4732
+ * accumulates.
4733
+ *
4734
+ * @public
4735
+ */
4736
+ const DEFAULT_MAX_OUTPUT_BYTES = 16777216;
4737
+ /** Characters shown from the tail of captured output in an error message. */
4738
+ const MAX_MESSAGE_CHARS = 2e3;
4739
+ /**
4740
+ * What one completed run produced.
4741
+ *
4742
+ * @public
4743
+ */
4744
+ var CommandOutput = class extends effect.Schema.Class("CommandOutput")({
4745
+ /** Captured standard output, redacted. */
4746
+ stdout: effect.Schema.String,
4747
+ /** Captured standard error, redacted. */
4748
+ stderr: effect.Schema.String,
4749
+ /** The process exit code. A non-zero value is NOT an error at this level. */
4750
+ exitCode: effect.Schema.Number
4751
+ }) {
4752
+ /** Whether the process exited zero. */
4753
+ get succeeded() {
4754
+ return this.exitCode === 0;
4755
+ }
4756
+ };
4757
+ /** The executable and argv an error should report for `command`. */
4758
+ const describeCommand = (command) => {
4759
+ if (effect_unstable_process.ChildProcess.isStandardCommand(command)) return {
4760
+ command: command.command,
4761
+ args: command.args
4762
+ };
4763
+ const left = describeCommand(command.left);
4764
+ const right = describeCommand(command.right);
4765
+ return {
4766
+ command: `${left.command} | ${right.command}`,
4767
+ args: []
4768
+ };
4769
+ };
4770
+ /** argv as an error should store it: declared secrets removed, then the flag heuristic. */
4771
+ const safeArgs = (args, secrets) => Redaction.scrubArgs(Redaction.applyArgs(args, secrets ?? []));
4772
+ /** Captured text as an error should store it. */
4773
+ const safeText = (text, secrets) => Redaction.apply(text, secrets ?? []);
4774
+ /** Tail-bounded rendering: tools write warnings first and the real error last. */
4775
+ const tail = (text) => {
4776
+ const trimmed = text.trim();
4777
+ if (trimmed.length <= MAX_MESSAGE_CHARS) return trimmed;
4778
+ return `...[${trimmed.length - MAX_MESSAGE_CHARS} chars truncated from head]...\n${trimmed.slice(-2e3)}`;
4779
+ };
4780
+ /**
4781
+ * A command that could not be run, or that ran and failed.
4782
+ *
4783
+ * @remarks
4784
+ * `kind` is the routing surface, never the message: `"nonZero"` (the process
4785
+ * ran and exited non-zero), `"spawn"` (it never started — the executable is
4786
+ * missing, or the platform refused), `"timeout"` (a caller-supplied ceiling
4787
+ * elapsed). Composed retry and fallback logic branches on `kind`; nothing in
4788
+ * this package asks a caller to match on prose.
4789
+ *
4790
+ * `args` is **always** stored redacted.
4791
+ *
4792
+ * @public
4793
+ */
4794
+ var CommandFailedError = class CommandFailedError extends effect.Schema.TaggedErrorClass()("CommandFailedError", {
4795
+ /** Why it failed. */
4796
+ kind: effect.Schema.Literals([
4797
+ "nonZero",
4798
+ "spawn",
4799
+ "timeout"
4800
+ ]),
4801
+ /** The executable (or `"a | b"` for a pipeline). */
4802
+ command: effect.Schema.String,
4803
+ /** argv, redacted. */
4804
+ args: effect.Schema.Array(effect.Schema.String),
4805
+ /** The exit code, when the process ran. */
4806
+ exitCode: effect.Schema.optionalKey(effect.Schema.Number),
4807
+ /** Captured standard error, redacted, when the process ran. */
4808
+ stderr: effect.Schema.optionalKey(effect.Schema.String),
4809
+ /** Captured standard output, redacted, when the process ran. */
4810
+ stdout: effect.Schema.optionalKey(effect.Schema.String),
4811
+ /** The absorbed platform failure, for `"spawn"`. */
4812
+ cause: effect.Schema.optionalKey(effect.Schema.Defect())
4813
+ }) {
4814
+ /** The process ran and exited non-zero. */
4815
+ static nonZero = (command, output, secrets) => {
4816
+ const described = describeCommand(command);
4817
+ return new CommandFailedError({
4818
+ kind: "nonZero",
4819
+ command: described.command,
4820
+ args: safeArgs(described.args, secrets),
4821
+ exitCode: output.exitCode,
4822
+ stderr: output.stderr,
4823
+ stdout: output.stdout
4824
+ });
4825
+ };
4826
+ /** The process never started. */
4827
+ static spawn = (command, cause, secrets) => {
4828
+ const described = describeCommand(command);
4829
+ return new CommandFailedError({
4830
+ kind: "spawn",
4831
+ command: described.command,
4832
+ args: safeArgs(described.args, secrets),
4833
+ cause
4834
+ });
4835
+ };
4836
+ /** A caller-supplied ceiling elapsed; the child was killed with its scope. */
4837
+ static timedOut = (command, secrets) => {
4838
+ const described = describeCommand(command);
4839
+ return new CommandFailedError({
4840
+ kind: "timeout",
4841
+ command: described.command,
4842
+ args: safeArgs(described.args, secrets)
4843
+ });
4844
+ };
4845
+ /**
4846
+ * Whether this is a spawn failure caused by the executable not existing —
4847
+ * the structural "tool is not installed" signal.
4848
+ */
4849
+ get notFound() {
4850
+ return this.kind === "spawn" && this.cause instanceof effect.PlatformError.PlatformError && this.cause.reason._tag === "NotFound";
4851
+ }
4852
+ /** Names the command and surfaces the tail of whichever stream carries the cause. */
4853
+ get message() {
4854
+ const parts = [`Command "${this.args.length > 0 ? `${this.command} ${this.args.join(" ")}` : this.command}" failed`];
4855
+ if (this.kind === "timeout") parts.push("(timed out)");
4856
+ if (this.exitCode !== void 0) parts.push(`(exit ${this.exitCode})`);
4857
+ const stream = this.stderr?.trim() ? this.stderr : this.stdout?.trim() ? this.stdout : void 0;
4858
+ if (stream !== void 0) parts.push(`:\n${tail(stream)}`);
4859
+ return parts.join(" ");
4860
+ }
4861
+ };
4862
+ /**
4863
+ * A command ran, but its output could not be used.
4864
+ *
4865
+ * @remarks
4866
+ * Separate from {@link CommandFailedError} because the process itself
4867
+ * succeeded: `"notJson"` (stdout is not JSON), `"schema"` (it is JSON but does
4868
+ * not decode), `"tooLarge"` (capture exceeded its byte budget). Keeping the two
4869
+ * distinguishable is the point — a schema drift and a crashed tool call for
4870
+ * different responses.
4871
+ *
4872
+ * The context fields (`exitCode`, `stderr`, `stdout`) are populated by
4873
+ * {@link Run.jsonLine}, whose payload framing parses regardless of exit code —
4874
+ * when no payload arrives, the exit code and captured streams are the only
4875
+ * evidence of what actually went wrong. Both streams are **always** stored
4876
+ * redacted.
4877
+ *
4878
+ * @public
4879
+ */
4880
+ var CommandOutputError = class extends effect.Schema.TaggedErrorClass()("CommandOutputError", {
4881
+ /** Which way the output was unusable. */
4882
+ kind: effect.Schema.Literals([
4883
+ "notJson",
4884
+ "schema",
4885
+ "tooLarge"
4886
+ ]),
4887
+ /** The executable that produced it. */
4888
+ command: effect.Schema.String,
4889
+ /** The underlying parse or decode failure. */
4890
+ cause: effect.Schema.optionalKey(effect.Schema.Defect()),
4891
+ /** The exit code, when the combinator parses independently of it. */
4892
+ exitCode: effect.Schema.optionalKey(effect.Schema.Number),
4893
+ /** Captured standard error, redacted, when the process ran. */
4894
+ stderr: effect.Schema.optionalKey(effect.Schema.String),
4895
+ /** Captured standard output, redacted, when the process ran. */
4896
+ stdout: effect.Schema.optionalKey(effect.Schema.String)
4897
+ }) {
4898
+ get message() {
4899
+ const parts = [];
4900
+ if (this.kind === "notJson") parts.push(`Command "${this.command}" did not produce JSON`);
4901
+ else if (this.kind === "schema") parts.push(`Command "${this.command}" produced JSON that did not match the expected schema`);
4902
+ else parts.push(`Command "${this.command}" produced more output than the configured limit`);
4903
+ if (this.exitCode !== void 0) parts.push(`(exit ${this.exitCode})`);
4904
+ if (this.stderr !== void 0 && this.stderr.trim().length > 0) parts.push(`:\n${tail(this.stderr)}`);
4905
+ return parts.join(" ");
4906
+ }
4907
+ };
4908
+ /** Spawns, collects both streams concurrently, and awaits exit. */
4909
+ const collectRaw = (command, options, tee) => effect.Effect.scoped(effect.Effect.gen(function* () {
4910
+ const handle = yield* (yield* effect_unstable_process.ChildProcessSpawner.ChildProcessSpawner).spawn(command);
4911
+ const limit = options?.maxOutputBytes ?? 16777216;
4912
+ const out = tee === void 0 ? handle.stdout : effect.Stream.tapSink(handle.stdout, tee.stdout());
4913
+ const err = tee === void 0 ? handle.stderr : effect.Stream.tapSink(handle.stderr, tee.stderr());
4914
+ const [stdout, stderr, exitCode] = yield* effect.Effect.all([
4915
+ collectBounded(out, limit),
4916
+ collectBounded(err, limit),
4917
+ handle.exitCode
4918
+ ], { concurrency: "unbounded" });
4919
+ const secrets = options?.redact;
4920
+ return CommandOutput.make({
4921
+ stdout: safeText(stdout, secrets),
4922
+ stderr: safeText(stderr, secrets),
4923
+ exitCode: Number(exitCode)
4924
+ });
4925
+ }));
4926
+ /** Maps the raw failure modes onto this package's taxonomy, and applies any ceiling. */
4927
+ const collectClassified = (command, options, tee) => {
4928
+ const described = describeCommand(command);
4929
+ const classified = collectRaw(command, options, tee).pipe(effect.Effect.catch((error) => effect.Effect.fail(error instanceof OutputTooLarge ? new CommandOutputError({
4930
+ kind: "tooLarge",
4931
+ command: described.command,
4932
+ cause: error
4933
+ }) : CommandFailedError.spawn(command, error, options?.redact))));
4934
+ return options?.timeout === void 0 ? classified : effect.Effect.timeoutOrElse(classified, {
4935
+ duration: options.timeout,
4936
+ orElse: () => effect.Effect.fail(CommandFailedError.timedOut(command, options.redact))
4937
+ });
4938
+ };
4939
+ /** Fails a run whose process exited non-zero. */
4940
+ const requireZero = (command, output, options) => output.succeeded ? effect.Effect.succeed(output) : effect.Effect.fail(CommandFailedError.nonZero(command, output, options?.redact));
4941
+ /** Span attributes: what ran and how many arguments — never the arguments. */
4942
+ const annotate = (command) => {
4943
+ const described = describeCommand(command);
4944
+ return effect.Effect.annotateCurrentSpan({
4945
+ command: described.command,
4946
+ argc: described.args.length
4947
+ });
4948
+ };
4949
+ const collect = effect.Effect.fn("Run.collect")(function* (command, options) {
4950
+ yield* annotate(command);
4951
+ return yield* collectClassified(command, options, void 0);
4952
+ });
4953
+ const collectTee = effect.Effect.fn("Run.collectTee")(function* (command, options) {
4954
+ yield* annotate(command);
4955
+ const stdio = yield* effect.Stdio.Stdio;
4956
+ return yield* collectClassified(command, options, stdio);
4957
+ });
4958
+ const text$4 = effect.Effect.fn("Run.text")(function* (command, options) {
4959
+ yield* annotate(command);
4960
+ const output = yield* collectClassified(command, options, void 0);
4961
+ return (yield* requireZero(command, output, options)).stdout.trim();
4962
+ });
4963
+ const lines = effect.Effect.fn("Run.lines")(function* (command, options) {
4964
+ yield* annotate(command);
4965
+ const output = yield* collectClassified(command, options, void 0);
4966
+ return (yield* requireZero(command, output, options)).stdout.split(/\r?\n/).map((line) => line.trim()).filter((line) => line.length > 0);
4967
+ });
4968
+ const json = effect.Effect.fn("Run.json")(function* (command, schema, options) {
4969
+ yield* annotate(command);
4970
+ const described = describeCommand(command);
4971
+ const output = yield* collectClassified(command, options, void 0);
4972
+ const checked = yield* requireZero(command, output, options);
4973
+ const parsed = yield* effect.Effect.try({
4974
+ try: () => JSON.parse(checked.stdout),
4975
+ catch: (cause) => new CommandOutputError({
4976
+ kind: "notJson",
4977
+ command: described.command,
4978
+ cause
4979
+ })
4980
+ });
4981
+ return yield* effect.Schema.decodeUnknownEffect(schema)(parsed).pipe(effect.Effect.catch((cause) => effect.Effect.fail(new CommandOutputError({
4982
+ kind: "schema",
4983
+ command: described.command,
4984
+ cause
4985
+ }))));
4986
+ });
4987
+ const jsonLine = effect.Effect.fn("Run.jsonLine")(function* (command, schema, options) {
4988
+ yield* annotate(command);
4989
+ const described = describeCommand(command);
4990
+ const output = yield* collectClassified(command, options, void 0);
4991
+ const context = {
4992
+ exitCode: output.exitCode,
4993
+ stderr: output.stderr,
4994
+ stdout: output.stdout
4995
+ };
4996
+ const candidates = output.stdout.split(/\r?\n/).filter((candidate) => candidate.trim().length > 0);
4997
+ if (candidates.length === 0) return yield* effect.Effect.fail(new CommandOutputError({
4998
+ kind: "notJson",
4999
+ command: described.command,
5000
+ cause: /* @__PURE__ */ new Error("stdout carried no non-empty line"),
5001
+ ...context
5002
+ }));
5003
+ let notJsonCause;
5004
+ let schemaCause;
5005
+ for (let index = candidates.length - 1; index >= 0; index--) {
5006
+ const candidate = candidates[index];
5007
+ if (candidate === void 0) continue;
5008
+ let parsed;
5009
+ try {
5010
+ parsed = JSON.parse(candidate);
5011
+ } catch (cause) {
5012
+ notJsonCause ??= cause;
5013
+ continue;
5014
+ }
5015
+ const decoded = yield* effect.Effect.result(effect.Schema.decodeUnknownEffect(schema)(parsed));
5016
+ if (effect.Result.isSuccess(decoded)) return decoded.success;
5017
+ schemaCause ??= decoded.failure;
5018
+ }
5019
+ return yield* effect.Effect.fail(schemaCause !== void 0 ? new CommandOutputError({
5020
+ kind: "schema",
5021
+ command: described.command,
5022
+ cause: schemaCause,
5023
+ ...context
5024
+ }) : new CommandOutputError({
5025
+ kind: "notJson",
5026
+ command: described.command,
5027
+ cause: notJsonCause,
5028
+ ...context
5029
+ }));
5030
+ });
5031
+ const exitCode = effect.Effect.fn("Run.exitCode")(function* (command, options) {
5032
+ yield* annotate(command);
5033
+ return (yield* collectClassified(command, options, void 0)).exitCode;
5034
+ });
5035
+ const succeeds = effect.Effect.fn("Run.succeeds")(function* (command, options) {
5036
+ yield* annotate(command);
5037
+ return yield* collectClassified(command, options, void 0).pipe(effect.Effect.map((output) => output.succeeded), effect.Effect.catch(() => effect.Effect.succeed(false)));
5038
+ });
5039
+ const detach = effect.Effect.fn("Run.detach")(function* (command) {
5040
+ yield* annotate(command);
5041
+ return yield* effect.Effect.scoped(effect.Effect.gen(function* () {
5042
+ const handle = yield* (yield* effect_unstable_process.ChildProcessSpawner.ChildProcessSpawner).spawn(command);
5043
+ yield* handle.unref;
5044
+ return handle.pid;
5045
+ })).pipe(effect.Effect.catch((error) => effect.Effect.fail(CommandFailedError.spawn(command, error))));
5046
+ });
5047
+ 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)));
5048
+ const extendEnv = effect.Function.dual(2, (self, env) => {
5049
+ if (effect_unstable_process.ChildProcess.isStandardCommand(self)) {
5050
+ const merged = self.options.env === void 0 ? env : {
5051
+ ...self.options.env,
5052
+ ...env
5053
+ };
5054
+ return effect_unstable_process.ChildProcess.make(self.command, self.args, {
5055
+ ...self.options,
5056
+ env: merged,
5057
+ extendEnv: true
5058
+ });
5059
+ }
5060
+ return effect_unstable_process.ChildProcess.pipeTo(extendEnv(self.left, env), extendEnv(self.right, env), self.options);
5061
+ });
5062
+ /**
5063
+ * Structured running of core `ChildProcess.Command` values.
5064
+ *
5065
+ * @remarks
5066
+ * These are free functions over core's contract, **not** a service: core's
5067
+ * `ChildProcessSpawner` already is the subprocess service, and wrapping it in a
5068
+ * second one is the re-declaration this package exists not to repeat. Tests
5069
+ * stub the spawner (`ChildProcessSpawner.make(mockSpawn)`), not these.
5070
+ *
5071
+ * A non-zero exit is a *result* for {@link Run.collect}, {@link Run.exitCode},
5072
+ * {@link Run.succeeds} and {@link Run.jsonLine}, and a typed *failure* for
5073
+ * {@link Run.text}, {@link Run.lines} and {@link Run.json} — the split is
5074
+ * deliberate, matching core (where a non-zero exit is a success) at the
5075
+ * reporting level while giving the interpreting helpers the ergonomics callers
5076
+ * actually want.
5077
+ *
5078
+ * The interpreting helpers also **trim**: {@link Run.text} strips leading and
5079
+ * trailing whitespace from the whole result — not just a trailing newline —
5080
+ * and {@link Run.lines} trims each line. Fixed-column output whose first
5081
+ * column can be whitespace (`git status --porcelain`) silently loses that
5082
+ * column through either, producing plausible wrong values rather than an
5083
+ * error. Parse that kind of output from the untrimmed `stdout` of
5084
+ * {@link Run.collect}'s {@link CommandOutput} instead.
5085
+ *
5086
+ * @public
5087
+ */
5088
+ var Run = class {
5089
+ constructor() {}
5090
+ /**
5091
+ * Spawns `command`, collects stdout and stderr concurrently, and resolves
5092
+ * with the {@link CommandOutput} once the process exits.
5093
+ *
5094
+ * @remarks
5095
+ * A non-zero exit is a *result* here, not a failure — see {@link Run}'s
5096
+ * remarks for the split against {@link Run.text}, {@link Run.lines} and
5097
+ * {@link Run.json}.
5098
+ */
5099
+ static collect = collect;
5100
+ /**
5101
+ * Like {@link Run.collect}, but also tees each stream to the `Stdio` in `R`
5102
+ * as it arrives, for a caller that wants live output alongside the captured
5103
+ * {@link CommandOutput}.
5104
+ */
5105
+ static collectTee = collectTee;
5106
+ /**
5107
+ * Runs `command` and resolves with trimmed stdout on a zero exit.
5108
+ *
5109
+ * @remarks
5110
+ * A non-zero exit is a typed failure here — {@link CommandFailedError} —
5111
+ * unlike {@link Run.collect}, {@link Run.exitCode} and {@link Run.succeeds},
5112
+ * which treat it as a result.
5113
+ *
5114
+ * The trim strips **leading and trailing whitespace**, not just the trailing
5115
+ * newline. For parse-sensitive output where leading whitespace is data
5116
+ * (`git status --porcelain`, whose first entry's status column it would
5117
+ * silently eat), use {@link Run.collect} and read its {@link CommandOutput}'s
5118
+ * untrimmed `stdout` instead.
5119
+ */
5120
+ static text = text$4;
5121
+ /**
5122
+ * Runs `command` and resolves with stdout split into trimmed, non-empty
5123
+ * lines on a zero exit.
5124
+ *
5125
+ * @remarks
5126
+ * A non-zero exit is a typed failure here — {@link CommandFailedError} —
5127
+ * matching {@link Run.text} and {@link Run.json}.
5128
+ */
5129
+ static lines = lines;
5130
+ /**
5131
+ * Runs `command`, parses stdout as JSON and decodes it against `schema` on
5132
+ * a zero exit.
5133
+ *
5134
+ * @remarks
5135
+ * Fails with {@link CommandOutputError} when stdout is not JSON or does not
5136
+ * decode; a non-zero exit fails with {@link CommandFailedError}, matching
5137
+ * {@link Run.text} and {@link Run.lines}.
5138
+ *
5139
+ * This parses the **whole** of stdout and requires a zero exit. For a
5140
+ * protocol payload located by scanning stdout lines from the end — tolerant
5141
+ * of noise around it and of a non-zero exit — use {@link Run.jsonLine}
5142
+ * instead.
5143
+ */
5144
+ static json = json;
5145
+ /**
5146
+ * Runs `command` and, **scanning stdout lines from the end**, resolves with
5147
+ * the first line that both parses as JSON and decodes against `schema` —
5148
+ * the framing variant of {@link Run.json}, for a child that reports through
5149
+ * a single JSON protocol payload near the end of its output.
5150
+ *
5151
+ * @remarks
5152
+ * The framing tolerates noise on **both sides** of the payload: noise before
5153
+ * it (a subprocess-loaded hook's own `console.log`, a tool's warnings) and
5154
+ * noise after it (a hook logging from `process.on("exit", ...)` fires after
5155
+ * the payload has flushed — the trigger for widening the old "last non-empty
5156
+ * line must decode" contract, spencerbeggs/effected#292). Lines are split on
5157
+ * `\r?\n`, whitespace-only lines are dropped, and the scan runs from the last
5158
+ * line backwards until one decodes. The tolerance is positional, not
5159
+ * volumetric: the whole of stdout is still captured under
5160
+ * {@link RunOptions.maxOutputBytes} (default
5161
+ * {@link DEFAULT_MAX_OUTPUT_BYTES}, 16 MiB), so a child whose noise exceeds
5162
+ * the ceiling fails typed as `"tooLarge"` before any line is examined —
5163
+ * raise the ceiling for a child known to be loud in volume.
5164
+ *
5165
+ * The scan's consequence: when **multiple** lines decode under `schema`, the
5166
+ * **last** one wins. A child must therefore never emit two schema-valid
5167
+ * lines, and a consumer schema should be shaped so an accidental log line
5168
+ * cannot satisfy it — a discriminated envelope with a required literal field
5169
+ * (`ok: true | false`, the shape `@effected/workspaces`' `ReplayPayload`
5170
+ * uses) rather than a permissive record a stray `console.log(someObject)`
5171
+ * might match.
5172
+ *
5173
+ * Unlike {@link Run.json}, this parses **regardless of the exit code** — a
5174
+ * deliberate posture, not an oversight. A protocol payload discriminates
5175
+ * success in-band (its own `ok` field, its own error shape), so the payload
5176
+ * outranks the exit code: a child that crashes *after* flushing its payload
5177
+ * still reported, and a caller that wants exit-code semantics has
5178
+ * {@link Run.json}. When no line decodes anywhere, the typed
5179
+ * {@link CommandOutputError} carries the exit code and both captured streams
5180
+ * (redacted) as context, so the failure is diagnosable without re-running.
5181
+ * Its `kind` preserves the near-miss diagnostic: `"schema"` when at least
5182
+ * one line parsed as JSON but none decoded — with the **last parseable
5183
+ * line's** decode failure as `cause`, that line being the most probable
5184
+ * intended payload — and `"notJson"` only when no non-empty line was JSON at
5185
+ * all (carrying the last non-empty line's parse error). A spawn failure or
5186
+ * an opted-in timeout still fails with {@link CommandFailedError}.
5187
+ */
5188
+ static jsonLine = jsonLine;
5189
+ /**
5190
+ * Runs `command` and resolves with its exit code alone.
5191
+ *
5192
+ * @remarks
5193
+ * A non-zero exit is a *result* here, not a failure — see {@link Run}'s
5194
+ * remarks for the split against {@link Run.text}, {@link Run.lines} and
5195
+ * {@link Run.json}.
5196
+ */
5197
+ static exitCode = exitCode;
5198
+ /**
5199
+ * Runs `command` and resolves with whether it exited zero, collapsing a
5200
+ * spawn or other classified failure to `false` rather than propagating it.
5201
+ */
5202
+ static succeeds = succeeds;
5203
+ /** Decoded stdout lines as they arrive, for output too large or too long-lived to collect. */
5204
+ static stream = stream;
5205
+ /**
5206
+ * Spawns `command` and resolves with its pid without waiting for exit.
5207
+ *
5208
+ * @remarks
5209
+ * Unrefs the child **before** this scope closes, so it survives the
5210
+ * caller's scope closing — the Node backend's release skips the kill for an
5211
+ * unref'd child, and reversing that order kills it with the scope instead.
5212
+ * Fails with {@link CommandFailedError} if the process never starts.
5213
+ */
5214
+ static detach = detach;
5215
+ /**
5216
+ * Adds environment variables to a command WITHOUT losing the parent
5217
+ * environment: merges `env` over any existing command environment (new values
5218
+ * win, matching core's `ChildProcess.setEnv`) and sets `extendEnv: true`.
5219
+ *
5220
+ * @remarks
5221
+ * This combinator exists because of a core trap: `ChildProcess.setEnv` merges
5222
+ * into `options.env` but never sets `extendEnv`, and the Node spawner resolves
5223
+ * the child environment as `extendEnv ? { ...process.env, ...env } : env` — so
5224
+ * a command built with bare `setEnv({ SOME_VAR: x })` spawns a child whose
5225
+ * ENTIRE environment is that one variable: no `PATH`, no `HOME`. The failure is
5226
+ * silent at the type level and surfaces as "spawned tool cannot find its own
5227
+ * binary" at runtime.
5228
+ *
5229
+ * Deliberately forces `extendEnv: true` even where construction set it `false`
5230
+ * — inheriting the parent environment is this combinator's entire purpose. A
5231
+ * caller who wants a hermetic environment uses core's `setEnv` or construction
5232
+ * options (`ChildProcess.make(cmd, args, { env, extendEnv: false })`) directly.
5233
+ *
5234
+ * For a pipeline, applies to every command in the pipeline (mirroring core's
5235
+ * `setEnv`), preserving the pipe's own options. Composes core's public
5236
+ * vocabulary (`ChildProcess.make`, `ChildProcess.pipeTo`) — it re-declares
5237
+ * nothing.
5238
+ */
5239
+ static extendEnv = extendEnv;
5240
+ /** Default ceiling on captured bytes per stream. See {@link DEFAULT_MAX_OUTPUT_BYTES}. */
5241
+ static DEFAULT_MAX_OUTPUT_BYTES = DEFAULT_MAX_OUTPUT_BYTES;
5242
+ /** The placeholder written in place of a redacted secret. See {@link REDACTED}. */
5243
+ static REDACTED = "***";
5244
+ };
5245
+ //#endregion
5246
+ //#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
4598
5247
  const MS_PER_MINUTE = 6e4;
4599
5248
  /**
4600
5249
  * A source's partial contribution to a {@link ReleaseAgeGate}: the effective
@@ -4764,7 +5413,7 @@ var ReleaseAgeGate = class ReleaseAgeGate extends effect.Schema.Class("ReleaseAg
4764
5413
  }
4765
5414
  };
4766
5415
  //#endregion
4767
- //#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
5416
+ //#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
4768
5417
  /**
4769
5418
  * One declared dependency of one workspace importer, as the lockfile records it.
4770
5419
  *
@@ -4796,13 +5445,13 @@ var ReleaseAgeGate = class ReleaseAgeGate extends effect.Schema.Class("ReleaseAg
4796
5445
  */
4797
5446
  var ImporterDependency = class extends effect.Schema.Class("ImporterDependency")({
4798
5447
  name: effect.Schema.NonEmptyString,
4799
- specifier: DependencySpecifier.FromString,
5448
+ specifier: DependencySpecifier$1.FromString,
4800
5449
  version: effect.Schema.optionalKey(effect.Schema.String),
4801
5450
  peerSuffix: effect.Schema.optionalKey(effect.Schema.String),
4802
- depType: DependencyField
5451
+ depType: DependencyField$1
4803
5452
  }) {};
4804
5453
  //#endregion
4805
- //#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
5454
+ //#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
4806
5455
  /**
4807
5456
  * One workspace importer's declared dependencies, as the lockfile records them.
4808
5457
  *
@@ -4826,7 +5475,7 @@ var LockfileImporter = class extends effect.Schema.Class("LockfileImporter")({
4826
5475
  dependencies: effect.Schema.Array(ImporterDependency)
4827
5476
  }) {};
4828
5477
  //#endregion
4829
- //#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
5478
+ //#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
4830
5479
  const EMPTY_DEPENDENCIES = {};
4831
5480
  /**
4832
5481
  * A package resolved from a lockfile.
@@ -4855,13 +5504,13 @@ const EMPTY_DEPENDENCIES = {};
4855
5504
  var ResolvedPackage = class extends effect.Schema.Class("ResolvedPackage")({
4856
5505
  name: effect.Schema.NonEmptyString,
4857
5506
  version: effect.Schema.String,
4858
- integrity: effect.Schema.optionalKey(IntegrityHash),
5507
+ integrity: effect.Schema.optionalKey(IntegrityHash$1),
4859
5508
  isWorkspace: effect.Schema.Boolean,
4860
5509
  relativePath: effect.Schema.optionalKey(effect.Schema.String),
4861
5510
  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)))
4862
5511
  }) {};
4863
5512
  //#endregion
4864
- //#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
5513
+ //#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
4865
5514
  /**
4866
5515
  * A directed dependency edge between two workspace packages as recorded in
4867
5516
  * the lockfile.
@@ -4879,11 +5528,11 @@ var ResolvedPackage = class extends effect.Schema.Class("ResolvedPackage")({
4879
5528
  var WorkspaceDependency = class extends effect.Schema.Class("WorkspaceDependency")({
4880
5529
  from: effect.Schema.NonEmptyString,
4881
5530
  to: effect.Schema.NonEmptyString,
4882
- depType: DependencyField,
5531
+ depType: DependencyField$1,
4883
5532
  constraint: effect.Schema.String
4884
5533
  }) {};
4885
5534
  //#endregion
4886
- //#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
5535
+ //#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
4887
5536
  /**
4888
5537
  * Extension data specific to pnpm lockfiles, attached to `Lockfile.extension`
4889
5538
  * when the format is `"pnpm"`.
@@ -4908,7 +5557,7 @@ var PnpmExtension = class extends effect.Schema.Class("PnpmExtension")({
4908
5557
  }))
4909
5558
  }) {};
4910
5559
  //#endregion
4911
- //#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
5560
+ //#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
4912
5561
  /**
4913
5562
  * The lockfile formats this package parses: bun's `bun.lock` (JSONC), npm's
4914
5563
  * `package-lock.json` (v2/v3 JSON), pnpm's `pnpm-lock.yaml` and yarn Berry's
@@ -4946,7 +5595,7 @@ const FILENAMES = {
4946
5595
  */
4947
5596
  const filenameFor = (format) => FILENAMES[format][0];
4948
5597
  //#endregion
4949
- //#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
5598
+ //#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
4950
5599
  /**
4951
5600
  * The four dependency sections of a manifest, in a stable order — the shared
4952
5601
  * dependency-sections table (v3's `DEP_SECTIONS`). Each entry is both the
@@ -4981,9 +5630,9 @@ const DEP_TYPES = [
4981
5630
  */
4982
5631
  const toIntegrityHash = (raw) => {
4983
5632
  if (raw === void 0) return effect.Effect.succeed(void 0);
4984
- return effect.Schema.decodeUnknownEffect(IntegrityHash)(raw).pipe(effect.Effect.mapError(validationFailure));
5633
+ return effect.Schema.decodeUnknownEffect(IntegrityHash$1)(raw).pipe(effect.Effect.mapError(validationFailure));
4985
5634
  };
4986
- const decodeSpecifier = effect.Schema.decodeUnknownExit(DependencySpecifier.FromString);
5635
+ const decodeSpecifier = effect.Schema.decodeUnknownExit(DependencySpecifier$1.FromString);
4987
5636
  /**
4988
5637
  * Split pnpm's peer-disambiguation suffix off a recorded string: everything
4989
5638
  * from the first `(` on is suffix, since package names and versions never
@@ -6875,7 +7524,7 @@ var JsoncModifier = class {
6875
7524
  });
6876
7525
  };
6877
7526
  //#endregion
6878
- //#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
7527
+ //#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
6879
7528
  const DepRecord$2 = effect.Schema.optionalKey(effect.Schema.Record(effect.Schema.String, effect.Schema.String));
6880
7529
  const BunWorkspaceEntry = effect.Schema.Struct({
6881
7530
  name: effect.Schema.optionalKey(effect.Schema.String),
@@ -6968,7 +7617,7 @@ const toFields$3 = (raw) => effect.Effect.gen(function* () {
6968
7617
  };
6969
7618
  });
6970
7619
  //#endregion
6971
- //#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
7620
+ //#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
6972
7621
  const DepRecord$1 = effect.Schema.optionalKey(effect.Schema.Record(effect.Schema.String, effect.Schema.String));
6973
7622
  const NpmPackageEntry = effect.Schema.Struct({
6974
7623
  name: effect.Schema.optionalKey(effect.Schema.String),
@@ -13890,7 +14539,7 @@ function deepEqualValues(a, b) {
13890
14539
  return false;
13891
14540
  }
13892
14541
  //#endregion
13893
- //#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
14542
+ //#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
13894
14543
  /**
13895
14544
  * An empty YAML document composes to `null` (`Yaml.parseAll("")` is `[null]`,
13896
14545
  * and the trailing document of an env-only `pnpm-lock.yaml` is `null` too).
@@ -13960,7 +14609,7 @@ const selectSoleDocument = (content) => effect.Effect.gen(function* () {
13960
14609
  };
13961
14610
  });
13962
14611
  //#endregion
13963
- //#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
14612
+ //#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
13964
14613
  const PnpmImporterDeps = effect.Schema.optionalKey(effect.Schema.Record(effect.Schema.String, effect.Schema.Struct({
13965
14614
  specifier: effect.Schema.String,
13966
14615
  version: effect.Schema.String
@@ -14085,7 +14734,7 @@ const toFields$1 = (raw) => effect.Effect.gen(function* () {
14085
14734
  };
14086
14735
  });
14087
14736
  //#endregion
14088
- //#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
14737
+ //#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
14089
14738
  const YarnLockfileRaw = effect.Schema.Record(effect.Schema.String, effect.Schema.Unknown);
14090
14739
  const DepRecord = effect.Schema.optionalKey(effect.Schema.Record(effect.Schema.String, effect.Schema.String));
14091
14740
  const YarnEntry = effect.Schema.Struct({
@@ -14208,7 +14857,7 @@ const cleanYarnDeps = (deps) => {
14208
14857
  return Object.fromEntries(Object.entries(deps).map(([name, value]) => [name, value.startsWith("npm:") ? value.slice(4) : value]));
14209
14858
  };
14210
14859
  //#endregion
14211
- //#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
14860
+ //#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
14212
14861
  const EMPTY_IMPORTERS = [];
14213
14862
  /**
14214
14863
  * Failure of `Lockfile.parse`: the given content is not a valid lockfile of
@@ -14452,7 +15101,7 @@ var Lockfile = class Lockfile extends effect.Schema.Class("Lockfile")({
14452
15101
  }
14453
15102
  };
14454
15103
  //#endregion
14455
- //#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
15104
+ //#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
14456
15105
  /**
14457
15106
  * The minimal manifest shape {@link LockfileIntegrity.compare} checks a
14458
15107
  * lockfile against: a package name plus the four optional dependency maps.
@@ -14500,7 +15149,7 @@ var LockfileIntegrity = class LockfileIntegrity extends effect.Schema.Class("Loc
14500
15149
  dependency: effect.Schema.String,
14501
15150
  constraint: effect.Schema.String,
14502
15151
  resolved: effect.Schema.String,
14503
- depType: DependencyField
15152
+ depType: DependencyField$1
14504
15153
  }))
14505
15154
  }) {
14506
15155
  /**
@@ -14568,7 +15217,424 @@ var LockfileIntegrity = class LockfileIntegrity extends effect.Schema.Class("Loc
14568
15217
  }
14569
15218
  };
14570
15219
  //#endregion
14571
- //#region ../../node_modules/.pnpm/@effected+package-json@0.7.2_effect@4.0.0-beta.101/node_modules/@effected/package-json/Dependency.js
15220
+ //#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
15221
+ /**
15222
+ * Contract for resolving pnpm `catalog:` dependency specifiers to concrete
15223
+ * version ranges.
15224
+ *
15225
+ * `rangeOf` takes a package name and an optional catalog name
15226
+ * (`Option.none()` selects the default catalog) and returns the configured
15227
+ * range as `Option.some`, or `Option.none()` when the specifier is absent
15228
+ * from the catalog. By convention the error channel is reserved for a
15229
+ * failure in the resolution mechanism itself — an unmatched package or
15230
+ * catalog name is an `Option.none()` success, never an error. A failure to
15231
+ * *assemble* the catalogs (an unreadable or malformed catalog source)
15232
+ * surfaces typed as a {@link CatalogAssemblyError}; any other mechanism
15233
+ * failure is a {@link DependencyResolutionError}.
15234
+ *
15235
+ * This is a contract-only service: {@link CatalogResolver.noop} is the sole
15236
+ * implementation this package ships, and it resolves nothing. Real consumers
15237
+ * (e.g. `@effected/workspaces`) provide a working implementation at the
15238
+ * application boundary.
15239
+ *
15240
+ * @example
15241
+ * ```ts
15242
+ * import { Effect, Option } from "effect";
15243
+ * import { CatalogResolver } from "@effected/npm";
15244
+ *
15245
+ * const program = Effect.gen(function* () {
15246
+ * const resolver = yield* CatalogResolver;
15247
+ * return yield* resolver.rangeOf("effect", Option.none());
15248
+ * });
15249
+ *
15250
+ * Effect.runPromise(Effect.provide(program, CatalogResolver.noop));
15251
+ * // => Option.none()
15252
+ * ```
15253
+ *
15254
+ * @public
15255
+ */
15256
+ var CatalogResolver = class CatalogResolver extends effect.Context.Service()("@effected/npm/CatalogResolver") {
15257
+ /**
15258
+ * No-op default: `rangeOf` always succeeds with `Option.none()`, never
15259
+ * consulting an actual catalog. A pure `Layer.succeed`, bound to a const
15260
+ * so it memoizes by reference — the layer is built once, not once per
15261
+ * reference to `CatalogResolver.noop`.
15262
+ */
15263
+ static noop = effect.Layer.succeed(CatalogResolver, { rangeOf: () => effect.Effect.succeed(effect.Option.none()) });
15264
+ };
15265
+ effect.Schema.TaggedErrorClass()("DependencyResolutionError", {
15266
+ specifier: effect.Schema.String,
15267
+ cause: effect.Schema.Defect()
15268
+ });
15269
+ /**
15270
+ * Contract for resolving pnpm `workspace:` dependency specifiers to concrete
15271
+ * versions.
15272
+ *
15273
+ * `versionOf` takes a workspace package name and returns its concrete
15274
+ * version (the range modifier stripped) as `Option.some`, or
15275
+ * `Option.none()` when the name is not a known workspace member.
15276
+ *
15277
+ * This is a contract-only service: {@link WorkspaceResolver.noop} is the
15278
+ * sole implementation this package ships, and it resolves nothing. Real
15279
+ * consumers (e.g. `@effected/workspaces`) provide a working implementation
15280
+ * at the application boundary.
15281
+ *
15282
+ * @example
15283
+ * ```ts
15284
+ * import { Effect } from "effect";
15285
+ * import { WorkspaceResolver } from "@effected/npm";
15286
+ *
15287
+ * const program = Effect.gen(function* () {
15288
+ * const resolver = yield* WorkspaceResolver;
15289
+ * return yield* resolver.versionOf("@effected/semver");
15290
+ * });
15291
+ *
15292
+ * Effect.runPromise(Effect.provide(program, WorkspaceResolver.noop));
15293
+ * // => Option.none()
15294
+ * ```
15295
+ *
15296
+ * @public
15297
+ */
15298
+ var WorkspaceResolver = class WorkspaceResolver extends effect.Context.Service()("@effected/npm/WorkspaceResolver") {
15299
+ /**
15300
+ * No-op default: `versionOf` always succeeds with `Option.none()`, never
15301
+ * consulting an actual workspace. A pure `Layer.succeed`, bound to a
15302
+ * const so it memoizes by reference.
15303
+ */
15304
+ static noop = effect.Layer.succeed(WorkspaceResolver, { versionOf: () => effect.Effect.succeed(effect.Option.none()) });
15305
+ };
15306
+ //#endregion
15307
+ //#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
15308
+ /**
15309
+ * The short dependency kind: which dependency map an entry came from, named the
15310
+ * way consumers branch on it.
15311
+ *
15312
+ * @public
15313
+ */
15314
+ const DependencyKind = effect.Schema.Literals([
15315
+ "prod",
15316
+ "dev",
15317
+ "peer",
15318
+ "optional"
15319
+ ]);
15320
+ effect.Schema.Literals([
15321
+ "dependencies",
15322
+ "devDependencies",
15323
+ "peerDependencies",
15324
+ "optionalDependencies"
15325
+ ]);
15326
+ Object.fromEntries(Object.entries({
15327
+ prod: "dependencies",
15328
+ dev: "devDependencies",
15329
+ peer: "peerDependencies",
15330
+ optional: "optionalDependencies"
15331
+ }).map(([kind, field]) => [field, kind]));
15332
+ //#endregion
15333
+ //#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
15334
+ /**
15335
+ * Indicates that a string could not be parsed as a valid dependency specifier.
15336
+ *
15337
+ * Raised by {@link DependencySpecifier.decode}. The offending string is
15338
+ * preserved on `input`.
15339
+ *
15340
+ * @public
15341
+ */
15342
+ var InvalidDependencySpecifierError = class extends effect.Schema.TaggedErrorClass()("InvalidDependencySpecifierError", {
15343
+ /** The raw input string that failed validation. */
15344
+ input: effect.Schema.String }) {
15345
+ get message() {
15346
+ return `Invalid dependency specifier "${this.input}": not a recognized specifier`;
15347
+ }
15348
+ };
15349
+ const CATALOG_PREFIX = "catalog:";
15350
+ const WORKSPACE_PREFIX = "workspace:";
15351
+ const isBarePath = (value) => value.startsWith("./") || value.startsWith("../") || value.startsWith("~/") || value.startsWith("/");
15352
+ const isGitHubShorthand = (value) => !value.startsWith(".") && !value.startsWith("~") && !value.startsWith("/") && /^[a-zA-Z0-9_.-]+\/[a-zA-Z0-9_.-]+(#.*)?$/.test(value);
15353
+ const isGit = (value) => value.startsWith("git+") || value.startsWith("git://") || value.startsWith("github:") || value.startsWith("gist:") || value.startsWith("bitbucket:") || value.startsWith("gitlab:") || isGitHubShorthand(value);
15354
+ const isLocal = (value) => value.startsWith("file:") || value.startsWith("link:") || value.startsWith("portal:") || isBarePath(value);
15355
+ const isLink = (value) => value.startsWith("link:");
15356
+ const isPortal = (value) => value.startsWith("portal:");
15357
+ const isCatalog = (value) => value.startsWith(CATALOG_PREFIX);
15358
+ const isWorkspace = (value) => value.startsWith(WORKSPACE_PREFIX);
15359
+ const isUrl$1 = (value) => value.startsWith("http://") || value.startsWith("https://");
15360
+ const parseRange = (value) => {
15361
+ const exit = effect.Schema.decodeUnknownExit(Range$2.FromString)(value);
15362
+ return effect.Exit.isSuccess(exit) ? effect.Option.some(exit.value) : effect.Option.none();
15363
+ };
15364
+ const isRange = (value) => effect.Option.isSome(parseRange(value));
15365
+ const protocolOf = (value) => {
15366
+ if (value.startsWith(CATALOG_PREFIX)) return "catalog";
15367
+ if (value.startsWith(WORKSPACE_PREFIX)) return "workspace";
15368
+ if (value.startsWith("link:")) return "link";
15369
+ if (value.startsWith("portal:")) return "portal";
15370
+ if (value.startsWith("file:") || isBarePath(value)) return "file";
15371
+ if (value.startsWith("npm:")) return "npm";
15372
+ if (isGit(value)) return "git";
15373
+ if (isUrl$1(value)) return "url";
15374
+ if (isRange(value)) return "range";
15375
+ if (/^[a-zA-Z][a-zA-Z0-9._-]*$/.test(value)) return "tag";
15376
+ return "unknown";
15377
+ };
15378
+ const isTag = (value) => protocolOf(value) === "tag";
15379
+ const catalogNameOf$1 = (specifier) => {
15380
+ if (!isCatalog(specifier)) return effect.Option.none();
15381
+ const rest = specifier.slice(8).trim();
15382
+ return rest.length === 0 ? effect.Option.none() : effect.Option.some(rest);
15383
+ };
15384
+ const projectRangeModifier = (range, version) => range === "*" || range === "" ? version : range === "~" ? `~${version}` : range === "^" ? `^${version}` : range;
15385
+ const splitWorkspaceRest = (rest) => {
15386
+ const at = rest.lastIndexOf("@");
15387
+ return at > 0 ? {
15388
+ target: rest.slice(0, at),
15389
+ range: rest.slice(at + 1)
15390
+ } : {
15391
+ target: void 0,
15392
+ range: rest
15393
+ };
15394
+ };
15395
+ const projectWorkspaceRange = (rest, version) => {
15396
+ const { target, range } = splitWorkspaceRest(rest);
15397
+ const projected = projectRangeModifier(range, version);
15398
+ return target === void 0 ? projected : `npm:${target}@${projected}`;
15399
+ };
15400
+ const resolveWorkspace = (specifier, version) => isWorkspace(specifier) ? projectWorkspaceRange(specifier.slice(10), version) : specifier;
15401
+ const workspaceTargetOf = (specifier) => {
15402
+ if (!isWorkspace(specifier)) return effect.Option.none();
15403
+ const { target } = splitWorkspaceRest(specifier.slice(10));
15404
+ return target === void 0 ? effect.Option.none() : effect.Option.some(target);
15405
+ };
15406
+ /**
15407
+ * Whether a string is a recognized dependency specifier: a semver range, exact
15408
+ * version, dist-tag, URL, git ref, GitHub shorthand, file path, or an
15409
+ * `npm:` / `catalog:` / `workspace:` protocol.
15410
+ *
15411
+ * @public
15412
+ */
15413
+ const isValidDependencySpecifier = (value) => value.length > 0 && protocolOf(value) !== "unknown";
15414
+ /**
15415
+ * A `catalog:` reference. `name` carries the catalog name, or `Option.none()`
15416
+ * for the default catalog (`catalog:`).
15417
+ *
15418
+ * @public
15419
+ */
15420
+ var CatalogSpecifier = class extends effect.Schema.TaggedClass()("catalog", {
15421
+ /** The original specifier string. */
15422
+ raw: effect.Schema.String,
15423
+ /** The catalog name, or `Option.none()` for the default catalog. */
15424
+ name: effect.Schema.Option(effect.Schema.String)
15425
+ }) {};
15426
+ /**
15427
+ * A `workspace:` reference. `range` carries the part after `workspace:` — a
15428
+ * range modifier (`*`, `^`, `~`), a concrete range, or an alias form.
15429
+ *
15430
+ * @public
15431
+ */
15432
+ var WorkspaceSpecifier = class extends effect.Schema.TaggedClass()("workspace", {
15433
+ /** The original specifier string. */
15434
+ raw: effect.Schema.String,
15435
+ /** The part after `workspace:` (e.g. `*`, `^1.2.3`, or an alias form). */
15436
+ range: effect.Schema.String
15437
+ }) {
15438
+ /**
15439
+ * The pnpm publish-time projection of this specifier against a concrete
15440
+ * workspace version: `*` (or an empty range) becomes `version`, `~` becomes
15441
+ * `~version`, `^` becomes `^version`, and a pinned range passes through
15442
+ * unchanged. The alias form (`workspace:<name>@<range>`) becomes pnpm's
15443
+ * publish-time aliased dependency `npm:<name>@<projected>`, with the range
15444
+ * modifier projected the same way — `version` must then be the TARGET
15445
+ * package's version (see `DependencySpecifier.workspaceTargetOf`).
15446
+ *
15447
+ * @remarks
15448
+ * The same projection as `DependencySpecifier.resolveWorkspace`, applied to
15449
+ * this instance's already-extracted `range`; the two share one internal
15450
+ * implementation.
15451
+ *
15452
+ * @param version - The concrete version of the workspace package the
15453
+ * specifier points at (the alias target's version for the alias form).
15454
+ */
15455
+ resolve(version) {
15456
+ return projectWorkspaceRange(this.range, version);
15457
+ }
15458
+ };
15459
+ /**
15460
+ * A plain semver range or exact version (e.g. `^1.2.3`, `1.x`, `>=1 <2`).
15461
+ *
15462
+ * @public
15463
+ */
15464
+ var RangeSpecifier = class extends effect.Schema.TaggedClass()("range", {
15465
+ /** The original specifier string. */
15466
+ raw: effect.Schema.String }) {};
15467
+ /**
15468
+ * A bare dist-tag (e.g. `latest`, `next`).
15469
+ *
15470
+ * @public
15471
+ */
15472
+ var DistTagSpecifier = class extends effect.Schema.TaggedClass()("dist-tag", {
15473
+ /** The original specifier string (also the tag name). */
15474
+ raw: effect.Schema.String }) {};
15475
+ /**
15476
+ * The honest fallback for `file:` / `link:` / `portal:` / git / URL / `npm:`
15477
+ * forms this concept does not further interpret.
15478
+ *
15479
+ * @public
15480
+ */
15481
+ var RawSpecifier = class extends effect.Schema.TaggedClass()("raw", {
15482
+ /** The original specifier string. */
15483
+ raw: effect.Schema.String }) {};
15484
+ const Classified = effect.Schema.Union([
15485
+ CatalogSpecifier,
15486
+ WorkspaceSpecifier,
15487
+ RangeSpecifier,
15488
+ DistTagSpecifier,
15489
+ RawSpecifier
15490
+ ]);
15491
+ const classify$1 = (value) => {
15492
+ if (isCatalog(value)) return CatalogSpecifier.make({
15493
+ raw: value,
15494
+ name: catalogNameOf$1(value)
15495
+ });
15496
+ if (isWorkspace(value)) return WorkspaceSpecifier.make({
15497
+ raw: value,
15498
+ range: value.slice(10)
15499
+ });
15500
+ if (isRange(value)) return RangeSpecifier.make({ raw: value });
15501
+ if (isTag(value)) return DistTagSpecifier.make({ raw: value });
15502
+ return RawSpecifier.make({ raw: value });
15503
+ };
15504
+ const fromString = effect.Schema.String.pipe(effect.Schema.decodeTo(Classified, effect.SchemaTransformation.transformOrFail({
15505
+ 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}"` })),
15506
+ encode: (classified) => effect.Effect.succeed(classified.raw)
15507
+ })));
15508
+ 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"));
15509
+ const decode$3 = (input) => effect.Schema.decodeUnknownEffect(brandedSpecifier)(input).pipe(effect.Effect.mapError(() => new InvalidDependencySpecifierError({ input })));
15510
+ /**
15511
+ * A valid dependency version specifier, carrying the protocol taxonomy statics
15512
+ * (`DependencySpecifier.protocolOf` and friends) that classify any specifier
15513
+ * string, plus the {@link (DependencySpecifier:variable).FromString} codec that
15514
+ * decodes a string into a {@link ClassifiedSpecifier} tagged union. Use it as a
15515
+ * schema for a specifier field and reach for the statics to inspect a raw
15516
+ * string.
15517
+ *
15518
+ * @public
15519
+ */
15520
+ const DependencySpecifier = Object.assign(brandedSpecifier, {
15521
+ protocolOf,
15522
+ parseRange,
15523
+ isRange,
15524
+ isTag,
15525
+ isGit,
15526
+ isUrl: isUrl$1,
15527
+ isLocal,
15528
+ isLink,
15529
+ isPortal,
15530
+ isCatalog,
15531
+ isWorkspace,
15532
+ catalogNameOf: catalogNameOf$1,
15533
+ resolveWorkspace,
15534
+ workspaceTargetOf,
15535
+ isValid: isValidDependencySpecifier,
15536
+ decode: decode$3,
15537
+ FromString: fromString
15538
+ });
15539
+ //#endregion
15540
+ //#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
15541
+ const SRI_RE = /^(sha1|sha256|sha384|sha512)-[A-Za-z0-9+/]+={0,2}$/;
15542
+ const COREPACK_RE = /^(sha1|sha224|sha256|sha384|sha512)\.[0-9a-f]+$/;
15543
+ const YARN_RE = /^[0-9]+(c[0-9]+)?\/[0-9a-f]+$/;
15544
+ const isSri = (value) => SRI_RE.test(value);
15545
+ const isCorepack = (value) => COREPACK_RE.test(value);
15546
+ const isYarnChecksum = (value) => YARN_RE.test(value);
15547
+ /**
15548
+ * Whether a string is a valid integrity hash in the SRI (`<algo>-<base64>`),
15549
+ * corepack (`<algo>.<hex>`) or yarn (`<cachekey>/<hex>`) form.
15550
+ *
15551
+ * @public
15552
+ */
15553
+ const isValidIntegrityHash = (value) => isSri(value) || isCorepack(value) || isYarnChecksum(value);
15554
+ const algorithmOf = (value) => {
15555
+ if (isSri(value)) return effect.Option.some(value.slice(0, value.indexOf("-")));
15556
+ if (isCorepack(value)) return effect.Option.some(value.slice(0, value.indexOf(".")));
15557
+ return effect.Option.none();
15558
+ };
15559
+ /**
15560
+ * Indicates that a string could not be parsed as a valid integrity hash.
15561
+ *
15562
+ * Raised by {@link IntegrityHash.decode}. The offending string is preserved on
15563
+ * `input`.
15564
+ *
15565
+ * @public
15566
+ */
15567
+ var InvalidIntegrityHashError = class extends effect.Schema.TaggedErrorClass()("InvalidIntegrityHashError", {
15568
+ /** The raw input string that failed validation. */
15569
+ input: effect.Schema.String }) {
15570
+ get message() {
15571
+ return `Invalid integrity hash "${this.input}": expected an SRI (<algo>-<base64>), corepack (<algo>.<hex>) or yarn (<cachekey>/<hex>) form`;
15572
+ }
15573
+ };
15574
+ 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"));
15575
+ const decode$2 = (input) => effect.Schema.decodeUnknownEffect(brandedIntegrity)(input).pipe(effect.Effect.mapError(() => new InvalidIntegrityHashError({ input })));
15576
+ Object.assign(brandedIntegrity, {
15577
+ isSri,
15578
+ isCorepack,
15579
+ isYarnChecksum,
15580
+ isValid: isValidIntegrityHash,
15581
+ algorithmOf,
15582
+ decode: decode$2
15583
+ });
15584
+ /**
15585
+ * {@link (IntegrityHash:variable)} narrowed to the corepack `<algo>.<hex>` form
15586
+ * — `sha512.deadbeef`, and corepack's own sha224 default pins
15587
+ * (`sha224.877304e3…`). An SRI (`sha512-<base64>`) or yarn (`10c0/<hex>`)
15588
+ * hash, both valid `IntegrityHash` values, fails this schema.
15589
+ *
15590
+ * @remarks
15591
+ * The corepack pin tail (`<name>@<version>+<integrity>`) is the one place the
15592
+ * kit meets this form, and two schemas name it: `PackageManagerPin.integrity`
15593
+ * here and `@effected/package-json`'s `PackageManager.integrity`. Both consume
15594
+ * **this** schema — the restriction existed privately in each module until they
15595
+ * were consolidated, and a private copy is exactly how the two drift (the
15596
+ * widening that admitted sha224 had to be made twice).
15597
+ *
15598
+ * It decodes to the same {@link IntegrityHashBrand} the unrestricted schema
15599
+ * does, so a corepack-validated value assigns anywhere an `IntegrityHash` is
15600
+ * expected; there is no second brand. Reach for
15601
+ * `IntegrityHash.isCorepack(value)` to ask the same question about a raw
15602
+ * string without decoding.
15603
+ *
15604
+ * That single brand is also why sharing this schema is not type-enforced, and
15605
+ * the consequence is sharper than it looks: a `Schema.check` is **erased from
15606
+ * the built type**, so this schema and the unrestricted one are the same
15607
+ * declared type. A consumer that quietly reverts to a private copy compiles
15608
+ * clean, and — if the copy is faithful — passes every rejection test too.
15609
+ * Neither `tsc` nor behaviour can see the re-fork.
15610
+ *
15611
+ * What does see it is **object identity**, so each consumer's suite asserts
15612
+ * that its field schema IS this export:
15613
+ * `PackageManagerPin.fields.integrity.schema === CorepackIntegrityHash` (an
15614
+ * `optionalKey` field keeps the inner schema on `.schema`), and
15615
+ * `PackageManager.fields.integrity.value === CorepackIntegrityHash` on the
15616
+ * `@effected/package-json` side (a `Schema.Option` keeps it on `.value`). Both
15617
+ * assertions carry a control against the unrestricted brand, so they discriminate
15618
+ * rather than passing on any schema at all. That identity assertion is the only
15619
+ * thing standing between the two surfaces and a silent re-fork; do not replace
15620
+ * it with a behavioural test, which cannot fail.
15621
+ *
15622
+ * @example
15623
+ * ```ts
15624
+ * import { CorepackIntegrityHash } from "@effected/npm";
15625
+ * import { Schema } from "effect";
15626
+ *
15627
+ * const decode = Schema.decodeUnknownExit(CorepackIntegrityHash);
15628
+ *
15629
+ * decode("sha512.deadbeef"); // success
15630
+ * decode("sha512-3q2+7w=="); // failure — SRI form
15631
+ * ```
15632
+ *
15633
+ * @public
15634
+ */
15635
+ const CorepackIntegrityHash = brandedIntegrity.pipe(effect.Schema.check(effect.Schema.makeFilter((value) => isCorepack(value) ? void 0 : "Expected a corepack (<algo>.<hex>) integrity hash")));
15636
+ //#endregion
15637
+ //#region ../../node_modules/.pnpm/@effected+package-json@0.7.3_effect@4.0.0-beta.101/node_modules/@effected/package-json/Dependency.js
14572
15638
  /**
14573
15639
  * A resolved dependency entry pairing a package name with its version
14574
15640
  * specifier and the `kind` of map it came from (`@effected/npm`'s
@@ -14632,7 +15698,7 @@ var Dependency = class extends effect.Schema.Class("Dependency")({
14632
15698
  }
14633
15699
  };
14634
15700
  //#endregion
14635
- //#region ../../node_modules/.pnpm/@effected+package-json@0.7.2_effect@4.0.0-beta.101/node_modules/@effected/package-json/DevEngines.js
15701
+ //#region ../../node_modules/.pnpm/@effected+package-json@0.7.3_effect@4.0.0-beta.101/node_modules/@effected/package-json/DevEngines.js
14636
15702
  /**
14637
15703
  * A single `devEngines` constraint with a name and optional `version` / `onFail`.
14638
15704
  *
@@ -16187,7 +17253,7 @@ effect.Schema.String.pipe(effect.Schema.decodeTo(SpdxExpressionUnion, effect.Sch
16187
17253
  encode: (expression) => effect.Effect.succeed(serialize$1(expression))
16188
17254
  })));
16189
17255
  //#endregion
16190
- //#region ../../node_modules/.pnpm/@effected+package-json@0.7.2_effect@4.0.0-beta.101/node_modules/@effected/package-json/License.js
17256
+ //#region ../../node_modules/.pnpm/@effected+package-json@0.7.3_effect@4.0.0-beta.101/node_modules/@effected/package-json/License.js
16191
17257
  /**
16192
17258
  * Indicates that a string is not a valid SPDX license identifier or expression.
16193
17259
  *
@@ -16222,7 +17288,7 @@ const isValidSpdx = (value) => {
16222
17288
  */
16223
17289
  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"));
16224
17290
  //#endregion
16225
- //#region ../../node_modules/.pnpm/@effected+package-json@0.7.2_effect@4.0.0-beta.101/node_modules/@effected/package-json/PackageManager.js
17291
+ //#region ../../node_modules/.pnpm/@effected+package-json@0.7.3_effect@4.0.0-beta.101/node_modules/@effected/package-json/PackageManager.js
16226
17292
  const PACKAGE_MANAGER_NAME_RE = /^[a-z]+$/;
16227
17293
  const invalid$1 = (input, message) => effect.Effect.fail(new effect.SchemaIssue.InvalidValue(effect.Option.some(input), { message }));
16228
17294
  /**
@@ -16333,7 +17399,7 @@ var PackageManager = class PackageManager extends effect.Schema.Class("PackageMa
16333
17399
  }
16334
17400
  };
16335
17401
  //#endregion
16336
- //#region ../../node_modules/.pnpm/@effected+package-json@0.7.2_effect@4.0.0-beta.101/node_modules/@effected/package-json/PackageName.js
17402
+ //#region ../../node_modules/.pnpm/@effected+package-json@0.7.3_effect@4.0.0-beta.101/node_modules/@effected/package-json/PackageName.js
16337
17403
  /**
16338
17404
  * Indicates that a string could not be used as a valid npm package name.
16339
17405
  *
@@ -16391,7 +17457,7 @@ const PackageName = Object.assign(effect.Schema.Union([ScopedPackageName, Unscop
16391
17457
  isScoped
16392
17458
  });
16393
17459
  //#endregion
16394
- //#region ../../node_modules/.pnpm/@effected+package-json@0.7.2_effect@4.0.0-beta.101/node_modules/@effected/package-json/Person.js
17460
+ //#region ../../node_modules/.pnpm/@effected+package-json@0.7.3_effect@4.0.0-beta.101/node_modules/@effected/package-json/Person.js
16395
17461
  const parsePersonString = (input) => {
16396
17462
  const emailMatch = input.match(/<([^>]+)>/);
16397
17463
  const urlMatch = input.match(/\(([^)]+)\)/);
@@ -16537,7 +17603,7 @@ var Person = class Person extends effect.Schema.Class("Person")({
16537
17603
  }
16538
17604
  };
16539
17605
  //#endregion
16540
- //#region ../../node_modules/.pnpm/@effected+package-json@0.7.2_effect@4.0.0-beta.101/node_modules/@effected/package-json/Repository.js
17606
+ //#region ../../node_modules/.pnpm/@effected+package-json@0.7.3_effect@4.0.0-beta.101/node_modules/@effected/package-json/Repository.js
16541
17607
  /** The shorthand hosts npm resolves without a scheme. */
16542
17608
  const SHORTHAND_HOSTS = /* @__PURE__ */ new Map([
16543
17609
  ["github", "https://github.com"],
@@ -16712,7 +17778,7 @@ var Bugs = class Bugs extends effect.Schema.Class("Bugs")({
16712
17778
  })));
16713
17779
  };
16714
17780
  //#endregion
16715
- //#region ../../node_modules/.pnpm/@effected+package-json@0.7.2_effect@4.0.0-beta.101/node_modules/@effected/package-json/internal/format.js
17781
+ //#region ../../node_modules/.pnpm/@effected+package-json@0.7.3_effect@4.0.0-beta.101/node_modules/@effected/package-json/internal/format.js
16716
17782
  const KEY_INDEX = new Map([
16717
17783
  "$schema",
16718
17784
  "name",
@@ -16935,7 +18001,7 @@ const renderJson = (raw, options) => {
16935
18001
  return options.newline ? `${json}\n` : json;
16936
18002
  };
16937
18003
  //#endregion
16938
- //#region ../../node_modules/.pnpm/@effected+package-json@0.7.2_effect@4.0.0-beta.101/node_modules/@effected/package-json/Package.js
18004
+ //#region ../../node_modules/.pnpm/@effected+package-json@0.7.3_effect@4.0.0-beta.101/node_modules/@effected/package-json/Package.js
16939
18005
  const toHashMap = effect.SchemaTransformation.transform({
16940
18006
  decode: (record) => effect.HashMap.fromIterable(Object.entries(record)),
16941
18007
  encode: (map) => Object.fromEntries(effect.HashMap.toEntries(map))
@@ -17251,7 +18317,7 @@ var Package = class Package extends effect.Schema.Class("Package")({
17251
18317
  }
17252
18318
  };
17253
18319
  //#endregion
17254
- //#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
18320
+ //#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
17255
18321
  const EMPTY$1 = Object.freeze(Object.create(null));
17256
18322
  const EMPTY_MANIFEST = Object.freeze(Object.create(null));
17257
18323
  /**
@@ -17849,7 +18915,7 @@ var Walker$1 = class {
17849
18915
  static findRoot = findRoot$1;
17850
18916
  };
17851
18917
  //#endregion
17852
- //#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
18918
+ //#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
17853
18919
  /**
17854
18920
  * The marker filenames {@link WorkspaceRoot} probes for, in priority order.
17855
18921
  *
@@ -18036,7 +19102,7 @@ var WorkspaceRoot = class WorkspaceRoot extends effect.Context.Service()("@effec
18036
19102
  static layerTest = (root) => effect.Layer.effect(WorkspaceRoot, WorkspaceRoot.makeTest(root)).pipe(effect.Layer.provide(effect.Path.layer));
18037
19103
  };
18038
19104
  //#endregion
18039
- //#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
19105
+ //#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
18040
19106
  /**
18041
19107
  * Hard ceiling on directories the enumerator will visit for one pattern set.
18042
19108
  * Guards the pathological case a depth cap alone does not: a wide, shallow
@@ -18054,7 +19120,7 @@ const MAX_ENUMERATION_ENTRIES = 1e5;
18054
19120
  */
18055
19121
  const PRUNED_DIRECTORIES = /* @__PURE__ */ new Set([".git", "node_modules"]);
18056
19122
  //#endregion
18057
- //#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
19123
+ //#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
18058
19124
  /** Directory names never descended into. */
18059
19125
  const isPruned = (entry) => PRUNED_DIRECTORIES.has(entry);
18060
19126
  /** Join root-relative POSIX segments; `""` is the root itself. */
@@ -18144,7 +19210,7 @@ var Traversal = class {
18144
19210
  }
18145
19211
  };
18146
19212
  //#endregion
18147
- //#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
19213
+ //#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
18148
19214
  /** Strip a trailing slash from `GlobPattern.enumerationPrefix` to get a relative directory. */
18149
19215
  const baseOf = (pattern) => pattern.enumerationPrefix.replace(/\/$/, "");
18150
19216
  /**
@@ -18214,7 +19280,7 @@ const enumerate = (root, globs, options) => effect.Effect.gen(function* () {
18214
19280
  return results;
18215
19281
  });
18216
19282
  //#endregion
18217
- //#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
19283
+ //#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
18218
19284
  const stringsOf = (value) => Array.isArray(value) ? value.filter((entry) => typeof entry === "string") : void 0;
18219
19285
  /** The `packages:` list of a `pnpm-workspace.yaml` document. Total on a parsed document. */
18220
19286
  const pnpmPatternsOf = (document) => {
@@ -18271,7 +19337,7 @@ const readPatterns = (root) => effect.Effect.gen(function* () {
18271
19337
  return manifestPatternsOf(manifest);
18272
19338
  });
18273
19339
  //#endregion
18274
- //#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
19340
+ //#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
18275
19341
  /**
18276
19342
  * Raised when a workspace member's `package.json` cannot be read, parsed, or
18277
19343
  * used — it is missing, malformed, or lacks a `name` or `version`.
@@ -18524,6 +19590,15 @@ var WorkspaceDiscovery = class WorkspaceDiscovery extends effect.Context.Service
18524
19590
  for (const entry of index) if (filePath.startsWith(entry.prefix)) return effect.Option.some(entry.package);
18525
19591
  return effect.Option.none();
18526
19592
  };
19593
+ const packageIndexes = /* @__PURE__ */ new WeakMap();
19594
+ const packagesByName = (all) => {
19595
+ const cached = packageIndexes.get(all);
19596
+ if (cached !== void 0) return cached;
19597
+ const index = /* @__PURE__ */ new Map();
19598
+ for (const pkg of all) if (!index.has(pkg.name)) index.set(pkg.name, pkg);
19599
+ packageIndexes.set(all, index);
19600
+ return index;
19601
+ };
18527
19602
  return {
18528
19603
  info: effect.Effect.fn("WorkspaceDiscovery.info")(function* () {
18529
19604
  return (yield* memo).info;
@@ -18537,7 +19612,7 @@ var WorkspaceDiscovery = class WorkspaceDiscovery extends effect.Context.Service
18537
19612
  }),
18538
19613
  getPackage: effect.Effect.fn("WorkspaceDiscovery.getPackage")(function* (name) {
18539
19614
  const all = yield* packages;
18540
- const found = all.find((pkg) => pkg.name === name);
19615
+ const found = packagesByName(all).get(name);
18541
19616
  if (found !== void 0) return found;
18542
19617
  return yield* effect.Effect.fail(new PackageNotFoundError({
18543
19618
  name,
@@ -18699,9 +19774,18 @@ var WorkspaceDiscovery = class WorkspaceDiscovery extends effect.Context.Service
18699
19774
  * // `Package.resolve` now resolves `workspace:*` for real.
18700
19775
  * ```
18701
19776
  */
18702
- static workspaceResolver = effect.Layer.effect(WorkspaceResolver, effect.Effect.gen(function* () {
19777
+ static workspaceResolver = effect.Layer.effect(WorkspaceResolver$1, effect.Effect.gen(function* () {
18703
19778
  const discovery = yield* WorkspaceDiscovery;
18704
- 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({
19779
+ const versionIndexes = /* @__PURE__ */ new WeakMap();
19780
+ const versionsByName = (all) => {
19781
+ const cached = versionIndexes.get(all);
19782
+ if (cached !== void 0) return cached;
19783
+ const index = /* @__PURE__ */ new Map();
19784
+ for (const pkg of all) if (!index.has(pkg.name)) index.set(pkg.name, pkg.version);
19785
+ versionIndexes.set(all, index);
19786
+ return index;
19787
+ };
19788
+ return { versionOf: (packageName) => discovery.listPackages().pipe(effect.Effect.map((all) => effect.Option.fromUndefinedOr(versionsByName(all).get(packageName))), effect.Effect.mapError((cause) => new DependencyResolutionError$1({
18705
19789
  specifier: `workspace:${packageName}`,
18706
19790
  cause
18707
19791
  }))) };
@@ -18709,7 +19793,7 @@ var WorkspaceDiscovery = class WorkspaceDiscovery extends effect.Context.Service
18709
19793
  };
18710
19794
  const isStringRecord$2 = (value) => value !== null && typeof value === "object" && !Array.isArray(value) && Object.values(value).every((entry) => typeof entry === "string");
18711
19795
  //#endregion
18712
- //#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
19796
+ //#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
18713
19797
  /**
18714
19798
  * Raised when the workspace dependency graph cannot be topologically ordered
18715
19799
  * because it contains a cycle.
@@ -20351,7 +21435,7 @@ var Git = class Git extends effect.Context.Service()("@effected/git/Git") {
20351
21435
  static layerTest = (overrides = {}) => effect.Layer.succeed(Git, Git.makeTest(overrides));
20352
21436
  };
20353
21437
  //#endregion
20354
- //#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
21438
+ //#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
20355
21439
  /**
20356
21440
  * Which git refs to compare, and whether to fold in the working tree.
20357
21441
  *
@@ -20480,8 +21564,12 @@ var ChangeDetector = class ChangeDetector extends effect.Context.Service()("@eff
20480
21564
  static layer = effect.Layer.effect(ChangeDetector, ChangeDetector.make);
20481
21565
  };
20482
21566
  `${process.platform}${process.arch}${process.version.split(".")[0].substring(1)}`;
21567
+ Object.freeze({
21568
+ gh: "https://npm.pkg.github.com/",
21569
+ npmjs: "https://registry.npmjs.org/"
21570
+ });
20483
21571
  //#endregion
20484
- //#region ../../node_modules/.pnpm/@pnpm+error@1100.1.0/node_modules/@pnpm/error/lib/index.js
21572
+ //#region ../../node_modules/.pnpm/@pnpm+error@1100.1.1/node_modules/@pnpm/error/lib/index.js
20485
21573
  var PnpmError = class extends Error {
20486
21574
  code;
20487
21575
  hint;
@@ -20496,7 +21584,7 @@ var PnpmError = class extends Error {
20496
21584
  }
20497
21585
  };
20498
21586
  //#endregion
20499
- //#region ../../node_modules/.pnpm/@pnpm+catalogs.config@1100.0.3/node_modules/@pnpm/catalogs.config/lib/getCatalogsFromWorkspaceManifest.js
21587
+ //#region ../../node_modules/.pnpm/@pnpm+catalogs.config@1100.0.4/node_modules/@pnpm/catalogs.config/lib/getCatalogsFromWorkspaceManifest.js
20500
21588
  function getCatalogsFromWorkspaceManifest(workspaceManifest) {
20501
21589
  if (workspaceManifest == null) return {};
20502
21590
  checkDefaultCatalogIsDefinedOnce(workspaceManifest);
@@ -20509,7 +21597,7 @@ function checkDefaultCatalogIsDefinedOnce(manifest) {
20509
21597
  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.");
20510
21598
  }
20511
21599
  //#endregion
20512
- //#region ../../node_modules/.pnpm/@pnpm+catalogs.config@1100.0.3/node_modules/@pnpm/catalogs.config/lib/mergeCatalogs.js
21600
+ //#region ../../node_modules/.pnpm/@pnpm+catalogs.config@1100.0.4/node_modules/@pnpm/catalogs.config/lib/mergeCatalogs.js
20513
21601
  /**
20514
21602
  * Deep-merges catalog definitions, later arguments taking precedence over
20515
21603
  * earlier ones at the individual entry level. Use it to fold the catalog
@@ -20603,7 +21691,7 @@ function resolveFromCatalog(catalogs, wantedDependency) {
20603
21691
  };
20604
21692
  }
20605
21693
  //#endregion
20606
- //#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
21694
+ //#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
20607
21695
  /** Project a pnpm-workspace manifest's `catalog` / `catalogs` fields into a `Catalogs` map. */
20608
21696
  const inlineCatalogs = (manifest) => {
20609
21697
  if (manifest.catalog === void 0 && manifest.catalogs === void 0) return {};
@@ -20667,7 +21755,7 @@ const rangeOf = (catalogs, dependency, specifier) => {
20667
21755
  });
20668
21756
  };
20669
21757
  //#endregion
20670
- //#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
21758
+ //#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
20671
21759
  /** Whether `value` is a non-null, non-array object. */
20672
21760
  const isObject$2 = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
20673
21761
  /**
@@ -20760,6 +21848,137 @@ const updateConfigOf = (mod) => {
20760
21848
  }
20761
21849
  };
20762
21850
  /**
21851
+ * The subprocess replay program {@link ConfigDependencyHooks.layerSubprocess}
21852
+ * hands to `node --input-type=module -e`.
21853
+ *
21854
+ * @remarks
21855
+ * A **static** string constant, deliberately: a bundler compiles a *computed*
21856
+ * dynamic `import()` into a context module that cannot resolve a runtime path
21857
+ * (`Cannot find module 'file:///…'`), so the computed import has to run in a
21858
+ * child process whose program text carries **no interpolated runtime value** —
21859
+ * the workspace root, the seed and the dependency names all arrive via argv
21860
+ * (`process.argv.slice(1)` under `-e`), never spliced into the script.
21861
+ *
21862
+ * The script mirrors this module's in-process semantics exactly so the two
21863
+ * layers are drop-in interchangeable: `pnpmfile.mjs` before `pnpmfile.cjs`
21864
+ * (pnpm 11's loader order), the `ERR_MODULE_NOT_FOUND`-for-the-candidate-itself
21865
+ * skip discrimination (`err.url` equality), the same hook-locator shapes, the
21866
+ * same tolerant threading of returned data (`configOf` / `finiteNumberOr` /
21867
+ * `stringArrayOr` clones below), and the same synchronous hook call. Only the
21868
+ * *mechanism* failures are reported: the script prints one final line of JSON —
21869
+ * `{ ok: true, config }` on success, `{ ok: false, name, message, stack? }`
21870
+ * naming the offending dependency on a load/replay failure — and exits through
21871
+ * the write callback so the payload is flushed even if a hook left the event
21872
+ * loop occupied. The final-line framing tolerates a hook's own `console.log`
21873
+ * noise on stdout.
21874
+ */
21875
+ const REPLAY_SCRIPT = `
21876
+ const [root, seedJson, ...names] = process.argv.slice(1);
21877
+ const { pathToFileURL } = await import("node:url");
21878
+ const { join } = await import("node:path");
21879
+ const isObject = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
21880
+ const finiteNumberOr = (value, fallback) => (typeof value === "number" && Number.isFinite(value) ? value : fallback);
21881
+ const stringArrayOr = (value, fallback) =>
21882
+ Array.isArray(value) && value.every((entry) => typeof entry === "string") ? value : fallback;
21883
+ const configOf = (value, fallback) =>
21884
+ isObject(value)
21885
+ ? {
21886
+ catalog: isObject(value.catalog) ? value.catalog : fallback.catalog,
21887
+ catalogs: isObject(value.catalogs) ? value.catalogs : fallback.catalogs,
21888
+ minimumReleaseAge: finiteNumberOr(value.minimumReleaseAge, fallback.minimumReleaseAge),
21889
+ minimumReleaseAgeExclude: stringArrayOr(value.minimumReleaseAgeExclude, fallback.minimumReleaseAgeExclude),
21890
+ }
21891
+ : fallback;
21892
+ const failure = (name, cause) => ({
21893
+ ok: false,
21894
+ name,
21895
+ message: cause instanceof Error ? cause.message : String(cause),
21896
+ ...(cause instanceof Error && typeof cause.stack === "string" ? { stack: cause.stack } : {}),
21897
+ });
21898
+ const replay = async () => {
21899
+ let catalog = {};
21900
+ const catalogs = {};
21901
+ for (const [name, entries] of Object.entries(JSON.parse(seedJson))) {
21902
+ if (name === "default") catalog = { ...entries };
21903
+ else catalogs[name] = { ...entries };
21904
+ }
21905
+ let config = { catalog, catalogs, minimumReleaseAge: undefined, minimumReleaseAgeExclude: undefined };
21906
+ for (const name of names) {
21907
+ let loaded;
21908
+ let found = false;
21909
+ for (const filename of ["pnpmfile.mjs", "pnpmfile.cjs"]) {
21910
+ const candidate = pathToFileURL(join(root, "node_modules", ".pnpm-config", name, filename)).href;
21911
+ try {
21912
+ loaded = await import(candidate);
21913
+ found = true;
21914
+ break;
21915
+ } catch (cause) {
21916
+ const url =
21917
+ isObject(cause) && cause.code === "ERR_MODULE_NOT_FOUND" && typeof cause.url === "string"
21918
+ ? cause.url
21919
+ : undefined;
21920
+ if (url === candidate) continue;
21921
+ return failure(name, cause);
21922
+ }
21923
+ }
21924
+ if (!found) continue;
21925
+ let hook;
21926
+ for (const candidate of [loaded, isObject(loaded) ? loaded.default : undefined]) {
21927
+ if (!isObject(candidate)) continue;
21928
+ if (isObject(candidate.hooks) && typeof candidate.hooks.updateConfig === "function") {
21929
+ hook = candidate.hooks.updateConfig;
21930
+ break;
21931
+ }
21932
+ if (typeof candidate.updateConfig === "function") {
21933
+ hook = candidate.updateConfig;
21934
+ break;
21935
+ }
21936
+ }
21937
+ if (hook === undefined) continue;
21938
+ try {
21939
+ config = configOf(hook(config), config);
21940
+ } catch (cause) {
21941
+ return failure(name, cause);
21942
+ }
21943
+ }
21944
+ return { ok: true, config };
21945
+ };
21946
+ const payload = await replay();
21947
+ process.stdout.write("\\n" + JSON.stringify(payload) + "\\n", () => process.exit(0));
21948
+ `;
21949
+ /**
21950
+ * The ceiling on one subprocess replay. A config dependency's `updateConfig`
21951
+ * reads and rewrites a config object — no install work, no network — so thirty
21952
+ * seconds is generous. Without a ceiling a pnpmfile that loops or awaits a
21953
+ * promise that never settles hangs `inject`, and through it the one memoized
21954
+ * {@link WorkspaceCatalogs} assemble pass every catalog read blocks on. Expiry
21955
+ * kills the child (`Run` scopes it) and surfaces as a `CommandFailedError`
21956
+ * through the same typed transport-failure path as any other mechanism failure.
21957
+ */
21958
+ const REPLAY_TIMEOUT = effect.Duration.seconds(30);
21959
+ /**
21960
+ * The subprocess protocol payload — the child's final stdout line, framed and
21961
+ * parsed by `Run.jsonLine`. The envelope is strict (a payload without a usable
21962
+ * `ok` discriminant is a mechanism failure, typed); the `config` slice inside a
21963
+ * success stays `Unknown` because a hook's returned *data* is tolerantly
21964
+ * threaded (`configOf`), never fatal.
21965
+ */
21966
+ const ReplayPayload = effect.Schema.Union([effect.Schema.Struct({
21967
+ ok: effect.Schema.Literal(true),
21968
+ config: effect.Schema.Unknown
21969
+ }), effect.Schema.Struct({
21970
+ ok: effect.Schema.Literal(false),
21971
+ name: effect.Schema.optionalKey(effect.Schema.String),
21972
+ message: effect.Schema.optionalKey(effect.Schema.String),
21973
+ stack: effect.Schema.optionalKey(effect.Schema.String)
21974
+ })]);
21975
+ /** Rebuild the subprocess's serialized failure as an `Error`, preserving the child-side stack when it carried one. */
21976
+ const replayFailureCause = (payload) => {
21977
+ const error = new Error(payload.message ?? "config dependency hook replay failed");
21978
+ if (payload.stack !== void 0) error.stack = payload.stack;
21979
+ return error;
21980
+ };
21981
+ /**
20763
21982
  * Replays a workspace's `configDependencies` `updateConfig` hooks over the inline
20764
21983
  * catalogs — the opt-in seam that lets hook-injected catalogs participate in
20765
21984
  * assembly.
@@ -20852,9 +22071,98 @@ var ConfigDependencyHooks = class ConfigDependencyHooks extends effect.Context.S
20852
22071
  releaseAge: releaseAgeOf(config)
20853
22072
  };
20854
22073
  }) });
22074
+ /**
22075
+ * The subprocess layer: replays each config dependency's pnpmfile in a `node`
22076
+ * child process instead of an in-process dynamic `import()`, with identical
22077
+ * typed semantics to {@link ConfigDependencyHooks.layerLive} — the two are
22078
+ * drop-in interchangeable.
22079
+ *
22080
+ * @remarks
22081
+ * `layerLive` computes the `import()` path at runtime, and a bundler (rspack,
22082
+ * for one) compiles a *computed* dynamic import into a context module that
22083
+ * throws `Cannot find module 'file:///…'` at runtime — so in any bundled
22084
+ * consumer, a GitHub Action above all, the in-process replay is unreachable.
22085
+ * This layer keeps every computed load out of the bundle graph: the replay
22086
+ * program is a **static** string constant passed via argv
22087
+ * (`node --input-type=module -e <script> <root> <seed> <...names>`), and the
22088
+ * child process performs the computed imports where no bundler rewrote them.
22089
+ * A subprocess also keeps config-dependency code out of the consumer's own
22090
+ * process.
22091
+ *
22092
+ * The contract's semantics are unchanged, not the downstream fail-open shape:
22093
+ * an empty `configDependencies` returns the seed without spawning anything; a
22094
+ * `..` path segment in a dependency name fails typed **before** any spawn; a
22095
+ * missing pnpmfile (neither `.mjs` nor `.cjs`) is the one legitimate skip,
22096
+ * discriminated inside the child by `err.url` equality exactly as
22097
+ * `layerLive` discriminates in process; any other load failure — a syntax
22098
+ * error, a throwing top level, an `ERR_MODULE_NOT_FOUND` for a module the
22099
+ * pnpmfile itself imports — and a hook that throws when called are serialized
22100
+ * back per-name and surface typed as a `hooks`-source `CatalogAssemblyError`
22101
+ * naming that dependency. A hook's returned *data* stays tolerantly threaded
22102
+ * (last well-formed write wins), never fatal. Spawn and transport failures —
22103
+ * `node` absent, a non-zero exit without a result payload, unparseable
22104
+ * output — fail typed too, never a defect and never a silent skip.
22105
+ *
22106
+ * Two bounds this layer imposes that `layerLive` cannot: the replay is
22107
+ * given thirty seconds (a pnpmfile that loops or awaits forever fails typed
22108
+ * instead of hanging the memoized assemble pass — a subprocess is killable,
22109
+ * while `layerLive`'s in-process synchronous hook call is not interruptible
22110
+ * by any means, so the asymmetry is inherent, not a parity violation), and
22111
+ * the child's stdout is captured under `Run.jsonLine`'s 16 MiB default
22112
+ * ceiling (a hook that logs more than that fails typed as `tooLarge`, where
22113
+ * `layerLive` — which captures nothing — would succeed).
22114
+ *
22115
+ * Catalog folding and normalization stay in the **parent** (the same
22116
+ * `@pnpm/catalogs`-derived path `layerLive` uses); the child returns only the
22117
+ * raw threaded config slice, since the script cannot import kit code.
22118
+ *
22119
+ * Requires core's `ChildProcessSpawner`, resolved when the layer is built —
22120
+ * the consumer provides it once at the edge (`@effect/platform-node`'s
22121
+ * `NodeServices.layer`), the same discharge `@effected/git` uses. Wired by
22122
+ * `WorkspaceCatalogs.layerWithConfigDependenciesSubprocess` /
22123
+ * `Workspaces.layerWithConfigDependenciesSubprocess`.
22124
+ */
22125
+ static layerSubprocess = effect.Layer.effect(ConfigDependencyHooks, effect.Effect.gen(function* () {
22126
+ const spawner = yield* effect_unstable_process.ChildProcessSpawner.ChildProcessSpawner;
22127
+ return { inject: (root, configDependencies, seed) => effect.Effect.gen(function* () {
22128
+ const names = Object.keys(configDependencies);
22129
+ if (names.length === 0) return {
22130
+ catalogs: seed,
22131
+ releaseAge: {}
22132
+ };
22133
+ for (const name of names) if (hasTraversalSegment(name)) return yield* effect.Effect.fail(new CatalogAssemblyError({
22134
+ source: "hooks",
22135
+ path: name,
22136
+ cause: /* @__PURE__ */ new Error(`config dependency name has a '..' path segment: ${name}`)
22137
+ }));
22138
+ const command = effect_unstable_process.ChildProcess.make("node", [
22139
+ "--input-type=module",
22140
+ "-e",
22141
+ REPLAY_SCRIPT,
22142
+ root,
22143
+ JSON.stringify(seed),
22144
+ ...names
22145
+ ]);
22146
+ 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({
22147
+ source: "hooks",
22148
+ path: root,
22149
+ cause
22150
+ }))));
22151
+ if (payload.ok === false) return yield* effect.Effect.fail(new CatalogAssemblyError({
22152
+ source: "hooks",
22153
+ path: payload.name ?? root,
22154
+ cause: replayFailureCause(payload)
22155
+ }));
22156
+ const config = configOf(payload.config, seedToConfig(seed));
22157
+ return {
22158
+ catalogs: configToEntries(config),
22159
+ releaseAge: releaseAgeOf(config)
22160
+ };
22161
+ }) };
22162
+ }));
20855
22163
  };
20856
22164
  //#endregion
20857
- //#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
22165
+ //#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
20858
22166
  /**
20859
22167
  * The four package managers this package understands.
20860
22168
  *
@@ -21182,7 +22490,7 @@ var PackageManagerDetector = class PackageManagerDetector extends effect.Context
21182
22490
  static layerTest = (overrides = {}) => effect.Layer.succeed(PackageManagerDetector, PackageManagerDetector.makeTest(overrides));
21183
22491
  };
21184
22492
  //#endregion
21185
- //#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
22493
+ //#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
21186
22494
  /**
21187
22495
  * Raised when the workspace's lockfile cannot be read off disk.
21188
22496
  *
@@ -21362,7 +22670,7 @@ var LockfileReader = class LockfileReader extends effect.Context.Service()("@eff
21362
22670
  static layerTest = (overrides = {}) => effect.Layer.succeed(LockfileReader, LockfileReader.makeTest(overrides));
21363
22671
  };
21364
22672
  //#endregion
21365
- //#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
22673
+ //#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
21366
22674
  /** The public npm registry, used when `publishConfig.registry` says nothing. */
21367
22675
  const DEFAULT_REGISTRY = "https://registry.npmjs.org/";
21368
22676
  /**
@@ -21521,7 +22829,7 @@ var PublishabilityDetector = class extends effect.Context.Service()("@effected/w
21521
22829
  static layerNone = effect.Layer.succeed(this, this.none);
21522
22830
  };
21523
22831
  //#endregion
21524
- //#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
22832
+ //#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
21525
22833
  /**
21526
22834
  * Strip pnpm's peer-disambiguation suffix from a recorded importer version.
21527
22835
  *
@@ -21607,7 +22915,7 @@ const unanimousVersionOf = (index, dependency) => {
21607
22915
  return agreed;
21608
22916
  };
21609
22917
  //#endregion
21610
- //#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
22918
+ //#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
21611
22919
  /**
21612
22920
  * An immutable, fully-normalized catalog collection — the one catalog
21613
22921
  * resolution semantic in the package.
@@ -22028,6 +23336,24 @@ var WorkspaceCatalogs = class WorkspaceCatalogs extends effect.Context.Service()
22028
23336
  */
22029
23337
  static layerWithConfigDependencies = (options) => effect.Layer.effect(WorkspaceCatalogs, WorkspaceCatalogs.make(options)).pipe(effect.Layer.provide(ConfigDependencyHooks.layerLive));
22030
23338
  /**
23339
+ * The opt-in layer that replays config-dependency `pnpmfile` hooks in a
23340
+ * `node` **child process**: it wires
23341
+ * {@link ConfigDependencyHooks.layerSubprocess} in place of the in-process
23342
+ * `layerLive`.
23343
+ *
23344
+ * @remarks
23345
+ * Same typed semantics as {@link WorkspaceCatalogs.layerWithConfigDependencies}
23346
+ * — the two hook layers are drop-in interchangeable — but the replay's
23347
+ * computed dynamic `import()` runs in the subprocess, so it survives bundling
23348
+ * (a bundler compiles a computed in-process `import()` into a context module
23349
+ * that cannot resolve at runtime — every bundled GitHub Action hits this).
23350
+ * The cost is one extra requirement: core's `ChildProcessSpawner`, provided
23351
+ * once at the edge (`@effect/platform-node`'s `NodeServices.layer`) — the
23352
+ * same sanctioned R-widening as `Workspaces.layerWithGit`. Parameterized, so
23353
+ * bind it to a `const` and reuse it.
23354
+ */
23355
+ static layerWithConfigDependenciesSubprocess = (options) => effect.Layer.effect(WorkspaceCatalogs, WorkspaceCatalogs.make(options)).pipe(effect.Layer.provide(ConfigDependencyHooks.layerSubprocess));
23356
+ /**
22031
23357
  * A test double satisfying the full {@link WorkspaceCatalogsShape} with no
22032
23358
  * filesystem, lockfile read, or hook replay.
22033
23359
  *
@@ -22104,9 +23430,9 @@ var WorkspaceCatalogs = class WorkspaceCatalogs extends effect.Context.Service()
22104
23430
  * consumers to `_tag`-sniff `unknown`); only the remaining mechanism failure,
22105
23431
  * an unfindable workspace root, is wrapped as `DependencyResolutionError`.
22106
23432
  */
22107
- static catalogResolver = effect.Layer.effect(CatalogResolver, effect.Effect.gen(function* () {
23433
+ static catalogResolver = effect.Layer.effect(CatalogResolver$1, effect.Effect.gen(function* () {
22108
23434
  const catalogs = yield* WorkspaceCatalogs;
22109
- 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({
23435
+ 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({
22110
23436
  specifier: effect.Option.match(catalog, {
22111
23437
  onNone: () => "catalog:",
22112
23438
  onSome: (name) => `catalog:${name}`
@@ -22116,7 +23442,7 @@ var WorkspaceCatalogs = class WorkspaceCatalogs extends effect.Context.Service()
22116
23442
  }));
22117
23443
  };
22118
23444
  //#endregion
22119
- //#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
23445
+ //#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
22120
23446
  const EMPTY = Object.freeze(Object.create(null));
22121
23447
  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)));
22122
23448
  /**
@@ -22295,7 +23621,7 @@ var WorkspaceStateSnapshot = class extends effect.Schema.Class("WorkspaceStateSn
22295
23621
  * resolving to `Option.none()` so the caller falls back to the raw string.
22296
23622
  */
22297
23623
  #resolveWith(dependency, specifier, onUnresolvedCatalog) {
22298
- const exit = effect.Schema.decodeUnknownExit(DependencySpecifier.FromString)(specifier);
23624
+ const exit = effect.Schema.decodeUnknownExit(DependencySpecifier$1.FromString)(specifier);
22299
23625
  if (!effect.Exit.isSuccess(exit)) return effect.Option.none();
22300
23626
  const classified = exit.value;
22301
23627
  switch (classified._tag) {
@@ -22320,7 +23646,7 @@ var WorkspaceStateSnapshot = class extends effect.Schema.Class("WorkspaceStateSn
22320
23646
  * `rangeOf` never fails.
22321
23647
  */
22322
23648
  get catalogResolver() {
22323
- if (this.#catalogResolver === void 0) this.#catalogResolver = effect.Layer.succeed(CatalogResolver, { rangeOf: (packageName, catalog) => effect.Effect.succeed(this.catalogs.rangeOf(packageName, catalog)) });
23649
+ if (this.#catalogResolver === void 0) this.#catalogResolver = effect.Layer.succeed(CatalogResolver$1, { rangeOf: (packageName, catalog) => effect.Effect.succeed(this.catalogs.rangeOf(packageName, catalog)) });
22324
23650
  return this.#catalogResolver;
22325
23651
  }
22326
23652
  /**
@@ -22329,7 +23655,7 @@ var WorkspaceStateSnapshot = class extends effect.Schema.Class("WorkspaceStateSn
22329
23655
  * `workspace:` specifiers as of this ref. Built once per instance and cached.
22330
23656
  */
22331
23657
  get workspaceResolver() {
22332
- if (this.#workspaceResolver === void 0) this.#workspaceResolver = effect.Layer.succeed(WorkspaceResolver, { versionOf: (packageName) => effect.Effect.succeed(effect.Option.fromUndefinedOr(this.#versions().get(packageName))) });
23658
+ if (this.#workspaceResolver === void 0) this.#workspaceResolver = effect.Layer.succeed(WorkspaceResolver$1, { versionOf: (packageName) => effect.Effect.succeed(effect.Option.fromUndefinedOr(this.#versions().get(packageName))) });
22333
23659
  return this.#workspaceResolver;
22334
23660
  }
22335
23661
  /** Both snapshot-scoped resolver layers merged. Built once per instance and cached. */
@@ -22339,7 +23665,7 @@ var WorkspaceStateSnapshot = class extends effect.Schema.Class("WorkspaceStateSn
22339
23665
  }
22340
23666
  };
22341
23667
  //#endregion
22342
- //#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
23668
+ //#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
22343
23669
  /** Whether `value` is a non-null, non-array object. */
22344
23670
  const isObject = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
22345
23671
  /** Whether every value in a record is a string — a usable dependency map. */
@@ -22616,7 +23942,7 @@ var WorkspaceSnapshots = class WorkspaceSnapshots extends effect.Context.Service
22616
23942
  static layerTest = (overrides = {}) => effect.Layer.succeed(WorkspaceSnapshots, WorkspaceSnapshots.makeTest(overrides));
22617
23943
  };
22618
23944
  //#endregion
22619
- //#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
23945
+ //#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
22620
23946
  const compose = (options, catalogsFactory) => {
22621
23947
  const roots = WorkspaceRoot.layer;
22622
23948
  const detector = PackageManagerDetector.layer;
@@ -22633,6 +23959,7 @@ const layerWithGit = (options) => {
22633
23959
  };
22634
23960
  const resolvers = effect.Layer.mergeAll(WorkspaceCatalogs.catalogResolver, WorkspaceDiscovery.workspaceResolver);
22635
23961
  const layerWithConfigDependencies = (options) => compose(options, WorkspaceCatalogs.layerWithConfigDependencies);
23962
+ const layerWithConfigDependenciesSubprocess = (options) => compose(options, WorkspaceCatalogs.layerWithConfigDependenciesSubprocess);
22636
23963
  const resolverLayer = (options) => resolvers.pipe(effect.Layer.provide(layerWithConfigDependencies(options)));
22637
23964
  const resolveManifest = effect.Effect.fn("Workspaces.resolveManifest")(function* (manifest, options) {
22638
23965
  return yield* manifest.resolve().pipe(effect.Effect.provide(resolverLayer(options)));
@@ -22714,6 +24041,32 @@ var Workspaces = class {
22714
24041
  */
22715
24042
  static layerWithConfigDependencies = layerWithConfigDependencies;
22716
24043
  /**
24044
+ * The git-free composite with config-dependency hook replay in a `node`
24045
+ * **child process** —
24046
+ * {@link WorkspaceCatalogs.layerWithConfigDependenciesSubprocess} in place of
24047
+ * the in-process replay.
24048
+ *
24049
+ * @remarks
24050
+ * Same typed semantics as {@link Workspaces.layerWithConfigDependencies}; the
24051
+ * difference is mechanism, and it matters in exactly one environment class: a
24052
+ * **bundled** consumer. The in-process replay's computed dynamic `import()`
24053
+ * is compiled by bundlers (rspack among them) into a context module that
24054
+ * throws `Cannot find module 'file:///…'` at runtime, which makes
24055
+ * `WorkspaceCatalogs.releaseAgeGate()` unreachable from any bundled GitHub
24056
+ * Action. Here the computed import runs inside a `node` child process whose
24057
+ * program text is a static string handed over argv, so nothing computed
24058
+ * enters the bundle graph.
24059
+ *
24060
+ * The extra requirement is core's `ChildProcessSpawner`, provided once at
24061
+ * the edge (`@effect/platform-node`'s `NodeServices.layer`) — the same
24062
+ * sanctioned R-widening as {@link Workspaces.layerWithGit}, and the reason
24063
+ * this is a separate composite rather than a flag: a consumer that keeps the
24064
+ * in-process replay should not have to be able to spawn a subprocess.
24065
+ *
24066
+ * **Bind the result to a `const`.**
24067
+ */
24068
+ static layerWithConfigDependenciesSubprocess = layerWithConfigDependenciesSubprocess;
24069
+ /**
22717
24070
  * The git-free composite plus {@link ChangeDetector} and
22718
24071
  * {@link WorkspaceSnapshots}, over `@effected/git`'s `Git` service.
22719
24072
  *
@@ -60547,7 +61900,7 @@ function validatePackages(packages) {
60547
61900
  }
60548
61901
  }
60549
61902
  //#endregion
60550
- //#region ../../node_modules/.pnpm/@changesets+get-dependents-graph@3.0.0-next.8/node_modules/@changesets/get-dependents-graph/dist/index.mjs
61903
+ //#region ../../node_modules/.pnpm/@changesets+get-dependents-graph@3.0.0-next.9/node_modules/@changesets/get-dependents-graph/dist/index.mjs
60551
61904
  var src_default = new Proxy({}, { get(target, color) {
60552
61905
  target[color] ??= (text) => (0, node_util.styleText)(color, text);
60553
61906
  return target[color];
@@ -60667,14 +62020,14 @@ function getDependentsGraph(packages, opts) {
60667
62020
  return simplifiedDependentsGraph;
60668
62021
  }
60669
62022
  //#endregion
60670
- //#region ../../node_modules/.pnpm/@changesets+should-skip-package@1.0.0-next.8/node_modules/@changesets/should-skip-package/dist/index.mjs
62023
+ //#region ../../node_modules/.pnpm/@changesets+should-skip-package@1.0.0-next.9/node_modules/@changesets/should-skip-package/dist/index.mjs
60671
62024
  function shouldSkipPackage({ packageJson }, { ignore, allowPrivatePackages }) {
60672
62025
  if (ignore.includes(packageJson.name)) return true;
60673
62026
  if (packageJson.private && !allowPrivatePackages) return true;
60674
62027
  return !packageJson.version;
60675
62028
  }
60676
62029
  //#endregion
60677
- //#region ../../node_modules/.pnpm/@changesets+config@4.0.0-next.8/node_modules/@changesets/config/dist/index.mjs
62030
+ //#region ../../node_modules/.pnpm/@changesets+config@4.0.0-next.9/node_modules/@changesets/config/dist/index.mjs
60678
62031
  const DEFAULT_CONFIG = {
60679
62032
  lang: void 0,
60680
62033
  message: void 0,
@@ -61416,9 +62769,9 @@ const WrittenConfigSchema = /* @__PURE__ */ object({
61416
62769
  linked: rootKey(PackageGroupSchema, "Packages that should be linked together so when they are being released, they will be released at the same version.", []),
61417
62770
  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"),
61418
62771
  privatePackages: rootKey(/* @__PURE__ */ union([/* @__PURE__ */ object({
61419
- version: /* @__PURE__ */ optional(/* @__PURE__ */ boolean(), true),
62772
+ version: /* @__PURE__ */ optional(/* @__PURE__ */ boolean(), false),
61420
62773
  tag: /* @__PURE__ */ optional(/* @__PURE__ */ boolean(), false)
61421
- }), /* @__PURE__ */ literal(false)]), "Opt in to tracking non-npm / private packages", {}),
62774
+ }), /* @__PURE__ */ boolean()]), "Opt in to tracking non-npm / private packages", {}),
61422
62775
  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),
61423
62776
  snapshot: rootKey(/* @__PURE__ */ object({
61424
62777
  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),
@@ -61442,11 +62795,11 @@ function normalizeWrittenConfig({ packageNames, writtenConfig }) {
61442
62795
  else if (writtenConfig.commit === true) config.commit = ["@changesets/cli/commit", { skipCI: "version" }];
61443
62796
  if (writtenConfig.ignore != null) config.ignore = globMatch(packageNames, writtenConfig.ignore);
61444
62797
  if (typeof writtenConfig.privatePackages !== "object") config.privatePackages = {
61445
- version: writtenConfig.privatePackages ?? true,
61446
- tag: false
62798
+ version: writtenConfig.privatePackages ?? false,
62799
+ tag: writtenConfig.privatePackages ?? false
61447
62800
  };
61448
62801
  else config.privatePackages = {
61449
- version: writtenConfig.privatePackages.version ?? true,
62802
+ version: writtenConfig.privatePackages.version ?? false,
61450
62803
  tag: writtenConfig.privatePackages.tag ?? false
61451
62804
  };
61452
62805
  return config;
@@ -61586,7 +62939,7 @@ async function readConfig(cwd, packages) {
61586
62939
  packages ??= await getPackages(cwd);
61587
62940
  return validateConfig(JSON.parse(await node_fs_promises.readFile(node_path.join(packages.rootDir, ".changeset", "config.json"), "utf8")), packages);
61588
62941
  }
61589
- var version = "4.0.0-next.8";
62942
+ var version = "4.0.0-next.9";
61590
62943
  const defaultConfig = normalizeWrittenConfig({
61591
62944
  packageNames: [],
61592
62945
  writtenConfig: parse(WrittenConfigSchema, {
@@ -62870,7 +64223,7 @@ var InternalError = class extends Error {
62870
64223
  }
62871
64224
  };
62872
64225
  //#endregion
62873
- //#region ../../node_modules/.pnpm/@changesets+git@4.0.0-next.8/node_modules/@changesets/git/dist/index.mjs
64226
+ //#region ../../node_modules/.pnpm/@changesets+git@4.0.0-next.9/node_modules/@changesets/git/dist/index.mjs
62874
64227
  async function getDivergedCommit(cwd, ref) {
62875
64228
  const cmd = await exec("git", [
62876
64229
  "merge-base",
@@ -62894,6 +64247,7 @@ async function getCommitsThatAddFiles(gitPaths, { cwd, short = false }) {
62894
64247
  const [commitSha, parentSha] = (await exec("git", [
62895
64248
  "log",
62896
64249
  "--diff-filter=A",
64250
+ "--follow",
62897
64251
  "--max-count=1",
62898
64252
  short ? "--pretty=format:%h:%p" : "--pretty=format:%H:%p",
62899
64253
  gitPath
@@ -62947,8 +64301,9 @@ async function getChangedChangesetFilesSinceRef({ cwd, ref }) {
62947
64301
  "--no-relative",
62948
64302
  await getDivergedCommit(cwd, ref)
62949
64303
  ], { nodeOptions: { cwd } });
62950
- const tester = /.changeset\/[^/]+\.md$/;
62951
- return cmd.stdout.toString().trim().split("\n").filter((file) => tester.test(file));
64304
+ const rootChangesetsRegex = /\.changeset\/[^/]+\.md$/;
64305
+ const preChangesetsRegex = /\.changeset\/pre\/[^/]+\.md$/;
64306
+ return cmd.stdout.toString().trim().split("\n").filter((file) => rootChangesetsRegex.test(file) || preChangesetsRegex.test(file));
62952
64307
  } catch (err) {
62953
64308
  if (err instanceof GitError) return [];
62954
64309
  throw err;
@@ -65015,7 +66370,7 @@ function applyEdits(text, edits) {
65015
66370
  return text;
65016
66371
  }
65017
66372
  //#endregion
65018
- //#region ../../node_modules/.pnpm/@changesets+apply-release-plan@8.0.0-next.9/node_modules/@changesets/apply-release-plan/dist/index.mjs
66373
+ //#region ../../node_modules/.pnpm/@changesets+apply-release-plan@8.0.0-next.10/node_modules/@changesets/apply-release-plan/dist/index.mjs
65019
66374
  /**
65020
66375
  * A simple JSON editing utility that preserves formatting. They specified operation keys
65021
66376
  * must exist in the JSON for this implementation.
@@ -65234,12 +66589,11 @@ async function applyReleasePlan(releasePlan, packages, config = defaultConfig, s
65234
66589
  ...pkg
65235
66590
  };
65236
66591
  }), changesets, config, cwd, contextDir);
65237
- if (releasePlan.preState != null && snapshot == null) {
65238
- if (releasePlan.preState.mode === "exit") await node_fs_promises.rm(node_path.join(cwd, ".changeset", "pre.json"), {
66592
+ if (releasePlan.preState?.mode === "exit" && snapshot == null) {
66593
+ await node_fs_promises.rm(node_path.join(cwd, ".changeset", "pre.json"), {
65239
66594
  recursive: true,
65240
66595
  force: true
65241
66596
  });
65242
- else await node_fs_promises.writeFile(node_path.join(cwd, ".changeset", "pre.json"), JSON.stringify(releasePlan.preState, null, 2) + "\n");
65243
66597
  touchedFiles.push(node_path.join(cwd, ".changeset", "pre.json"));
65244
66598
  }
65245
66599
  const versionsToUpdate = releases.map((release) => ({
@@ -65276,24 +66630,27 @@ async function applyReleasePlan(releasePlan, packages, config = defaultConfig, s
65276
66630
  if (pkgJsonPath) touchedFiles.push(pkgJsonPath);
65277
66631
  }
65278
66632
  if (filesToFormat.length > 0) await (await getFormatter(config.format, cwd))(filesToFormat);
65279
- if (releasePlan.preState == null || releasePlan.preState.mode === "exit") {
65280
- const changesetFolder = node_path.resolve(cwd, ".changeset");
65281
- await Promise.all(changesets.map(async (changeset) => {
65282
- const changesetPath = node_path.resolve(changesetFolder, `${changeset.id}.md`);
65283
- if (await node_fs_promises.access(changesetPath).then(() => true, () => false)) {
65284
- if (!changeset.releases.some((release) => shouldSkipPackage(packagesByName.get(release.name), {
65285
- ignore: config.ignore,
65286
- allowPrivatePackages: config.privatePackages.version
65287
- }))) {
65288
- touchedFiles.push(changesetPath);
65289
- await node_fs_promises.rm(changesetPath, {
65290
- recursive: true,
65291
- force: true
65292
- });
65293
- }
66633
+ const isPreChangesets = releasePlan.preState?.mode === "pre";
66634
+ if (isPreChangesets && changesets.length > 0) await node_fs_promises.mkdir(node_path.resolve(cwd, ".changeset", "pre"), { recursive: true });
66635
+ await Promise.all(changesets.map(async (changeset) => {
66636
+ const changesetPath = node_path.resolve(cwd, ".changeset", `${changeset.id}.md`);
66637
+ if (await node_fs_promises.access(changesetPath).then(() => true, () => false)) {
66638
+ if (!changeset.releases.some((release) => shouldSkipPackage(packagesByName.get(release.name), {
66639
+ ignore: config.ignore,
66640
+ allowPrivatePackages: config.privatePackages.version
66641
+ }))) if (isPreChangesets) {
66642
+ const newChangesetPath = node_path.resolve(cwd, ".changeset", "pre", `${changeset.id}.md`);
66643
+ await node_fs_promises.rename(changesetPath, newChangesetPath);
66644
+ touchedFiles.push(changesetPath, newChangesetPath);
66645
+ } else {
66646
+ await node_fs_promises.rm(changesetPath, {
66647
+ recursive: true,
66648
+ force: true
66649
+ });
66650
+ touchedFiles.push(changesetPath);
65294
66651
  }
65295
- }));
65296
- }
66652
+ }
66653
+ }));
65297
66654
  return touchedFiles;
65298
66655
  }
65299
66656
  async function getNewChangelogEntry(releasesWithPackage, changesets, config, cwd, contextDir) {
@@ -65365,7 +66722,7 @@ async function updateChangelog(changelogPath, changelog, name) {
65365
66722
  await node_fs_promises.writeFile(changelogPath, newChangelog);
65366
66723
  }
65367
66724
  //#endregion
65368
- //#region ../../node_modules/.pnpm/@changesets+assemble-release-plan@7.0.0-next.9/node_modules/@changesets/assemble-release-plan/dist/index.mjs
66725
+ //#region ../../node_modules/.pnpm/@changesets+assemble-release-plan@7.0.0-next.10/node_modules/@changesets/assemble-release-plan/dist/index.mjs
65369
66726
  function getHighestReleaseType(releases) {
65370
66727
  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`);
65371
66728
  let highestReleaseType = "none";
@@ -65615,7 +66972,7 @@ function getNewVersion(release, preInfo) {
65615
66972
  function assembleReleasePlan(changesets, packages, config, preState, snapshot) {
65616
66973
  const packagesByName = new Map(packages.packages.map((x) => [x.packageJson.name, x]));
65617
66974
  const relevantChangesets = getRelevantChangesets(changesets, packagesByName, config, preState);
65618
- const preInfo = getPreInfo(changesets, packagesByName, config, preState);
66975
+ const preInfo = getPreInfo(packagesByName, config, preState);
65619
66976
  const releases = flattenReleases(relevantChangesets, packagesByName, config);
65620
66977
  const dependencyGraph = getDependentsGraph(packages, { bumpVersionsWithWorkspaceProtocolOnly: config.bumpVersionsWithWorkspaceProtocolOnly });
65621
66978
  let releasesValidated = false;
@@ -65669,10 +67026,7 @@ function getRelevantChangesets(changesets, packagesByName, config, preState) {
65669
67026
  else notSkippedPackages.push(release.name);
65670
67027
  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`);
65671
67028
  }
65672
- if (preState && preState.mode !== "exit") {
65673
- const usedChangesetIds = new Set(preState.changesets);
65674
- return changesets.filter((changeset) => !usedChangesetIds.has(changeset.id));
65675
- }
67029
+ if (preState && preState.mode !== "exit") return changesets.filter((changeset) => !changeset.id.startsWith("pre/"));
65676
67030
  return changesets;
65677
67031
  }
65678
67032
  function getHighestPreVersion(groupKind, packageGroup, packagesByName) {
@@ -65683,12 +67037,8 @@ function getHighestPreVersion(groupKind, packageGroup, packagesByName) {
65683
67037
  }
65684
67038
  return highestPreVersion;
65685
67039
  }
65686
- function getPreInfo(changesets, packagesByName, config, preState) {
67040
+ function getPreInfo(packagesByName, config, preState) {
65687
67041
  if (preState == null) return;
65688
- const updatedPreState = {
65689
- ...preState,
65690
- changesets: changesets.map((changeset) => changeset.id)
65691
- };
65692
67042
  const preVersions = /* @__PURE__ */ new Map();
65693
67043
  for (const [, pkg] of packagesByName) {
65694
67044
  if (shouldSkipPackage(pkg, {
@@ -65706,12 +67056,12 @@ function getPreInfo(changesets, packagesByName, config, preState) {
65706
67056
  for (const linkedPackage of linkedGroup) preVersions.set(linkedPackage, highestPreVersion);
65707
67057
  }
65708
67058
  return {
65709
- state: updatedPreState,
67059
+ state: preState,
65710
67060
  preVersions
65711
67061
  };
65712
67062
  }
65713
67063
  //#endregion
65714
- //#region ../../node_modules/.pnpm/@changesets+pre@3.0.0-next.8/node_modules/@changesets/pre/dist/index.mjs
67064
+ //#region ../../node_modules/.pnpm/@changesets+pre@3.0.0-next.9/node_modules/@changesets/pre/dist/index.mjs
65715
67065
  async function outputFile(filePath, content) {
65716
67066
  await node_fs_promises.mkdir(node_path.dirname(filePath), { recursive: true });
65717
67067
  await node_fs_promises.writeFile(filePath, content, "utf8");
@@ -65734,13 +67084,25 @@ async function readPreState(rootDir) {
65734
67084
  return preState;
65735
67085
  }
65736
67086
  async function migratePreState(rootDir, preState) {
65737
- if (preState.initialVersions == null) return preState;
65738
- delete preState.initialVersions;
67087
+ if (preState.initialVersions == null && preState.changesets == null) return preState;
67088
+ if (preState.initialVersions != null) delete preState.initialVersions;
67089
+ if (preState.changesets != null) {
67090
+ const preChangesetsDir = node_path.resolve(rootDir, ".changeset", "pre");
67091
+ await node_fs_promises.mkdir(preChangesetsDir, { recursive: true });
67092
+ for (const changeset of preState.changesets) {
67093
+ const oldPath = node_path.resolve(rootDir, ".changeset", `${changeset}.md`);
67094
+ const newPath = node_path.resolve(preChangesetsDir, `${changeset}.md`);
67095
+ try {
67096
+ await node_fs_promises.rename(oldPath, newPath);
67097
+ } catch {}
67098
+ }
67099
+ delete preState.changesets;
67100
+ }
65739
67101
  await outputFile(node_path.resolve(rootDir, ".changeset", "pre.json"), JSON.stringify(preState, null, 2) + "\n");
65740
67102
  return preState;
65741
67103
  }
65742
67104
  //#endregion
65743
- //#region ../../node_modules/.pnpm/@changesets+parse@1.0.0-next.9/node_modules/@changesets/parse/dist/index.mjs
67105
+ //#region ../../node_modules/.pnpm/@changesets+parse@1.0.0-next.10/node_modules/@changesets/parse/dist/index.mjs
65744
67106
  const mdRegex = /\s*---([^]*?)\r?\n\s*---(\s*(?:\n|$)[^]*)/;
65745
67107
  const EXAMPLE_FORMAT = `---\n"package-name": patch\n---`;
65746
67108
  const validVersionTypes = [
@@ -65793,7 +67155,7 @@ YAML error: ${e instanceof Error ? e.message : String(e)}\nFrontmatter content:\
65793
67155
  };
65794
67156
  }
65795
67157
  //#endregion
65796
- //#region ../../node_modules/.pnpm/@changesets+read@1.0.0-next.9/node_modules/@changesets/read/dist/index.mjs
67158
+ //#region ../../node_modules/.pnpm/@changesets+read@1.0.0-next.10/node_modules/@changesets/read/dist/index.mjs
65797
67159
  const ignoredMdFiles = [
65798
67160
  /^README\.md$/i,
65799
67161
  "AGENTS.md",
@@ -65804,29 +67166,39 @@ async function filterChangesetsSinceRef(changesets, changesetBase, sinceRef) {
65804
67166
  const newHashes = (await getChangedChangesetFilesSinceRef({
65805
67167
  cwd: changesetBase,
65806
67168
  ref: sinceRef
65807
- })).map((c) => c.split("/").pop());
67169
+ })).map((c) => c.replace(/^.*\.changeset\//, ""));
65808
67170
  return changesets.filter((dir) => newHashes.includes(dir));
65809
67171
  }
65810
67172
  async function readChangesets(rootDir, sinceRef) {
65811
67173
  const changesetBase = node_path.join(rootDir, ".changeset");
65812
- let contents;
67174
+ let changesets = [];
65813
67175
  try {
65814
- contents = await node_fs_promises.readdir(changesetBase);
67176
+ changesets.push(...await node_fs_promises.readdir(changesetBase));
65815
67177
  } catch (err) {
65816
67178
  if (err.code === "ENOENT") throw new Error("There is no .changeset directory in this project", { cause: err });
65817
67179
  throw err;
65818
67180
  }
65819
- if (sinceRef != null) contents = await filterChangesetsSinceRef(contents, changesetBase, sinceRef);
65820
- const changesetContents = contents.filter((file) => !file.startsWith(".") && file.endsWith(".md") && !ignoredMdFiles.some((pattern) => typeof pattern === "string" ? pattern === file : pattern.test(file))).map(async (file) => {
67181
+ try {
67182
+ changesets.push(...(await node_fs_promises.readdir(node_path.join(changesetBase, "pre"))).map((file) => `pre/${file}`));
67183
+ } catch (err) {
67184
+ if (err.code !== "ENOENT") throw err;
67185
+ }
67186
+ console.log(changesets);
67187
+ if (sinceRef != null) changesets = await filterChangesetsSinceRef(changesets, changesetBase, sinceRef);
67188
+ changesets = changesets.filter((file) => {
67189
+ file = node_path.basename(file);
67190
+ return !file.startsWith(".") && file.endsWith(".md") && !ignoredMdFiles.some((pattern) => typeof pattern === "string" ? pattern === file : pattern.test(file));
67191
+ });
67192
+ const changesetContents = changesets.map(async (file) => {
65821
67193
  return {
65822
67194
  ...parseChangesetFile(await node_fs_promises.readFile(node_path.join(changesetBase, file), "utf8")),
65823
- id: file.replace(".md", "")
67195
+ id: file.replace(/\.md$/, "")
65824
67196
  };
65825
67197
  });
65826
67198
  return await Promise.all(changesetContents);
65827
67199
  }
65828
67200
  //#endregion
65829
- //#region ../../node_modules/.pnpm/@changesets+get-release-plan@5.0.0-next.9/node_modules/@changesets/get-release-plan/dist/index.mjs
67201
+ //#region ../../node_modules/.pnpm/@changesets+get-release-plan@5.0.0-next.10/node_modules/@changesets/get-release-plan/dist/index.mjs
65830
67202
  async function getReleasePlan(cwd, sinceRef, passedConfig) {
65831
67203
  const packages = await getPackages(cwd);
65832
67204
  const configResult = await readConfig(packages.rootDir, packages);