@savvy-web/silk 3.0.4 → 3.0.6

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.
@@ -423,7 +423,7 @@ const trimTrailingSlashes = (s) => {
423
423
  return s.slice(0, end);
424
424
  };
425
425
  //#endregion
426
- //#region ../../node_modules/.pnpm/@effected+glob@0.1.2_effect@4.0.0-beta.99/node_modules/@effected/glob/internal/limits.js
426
+ //#region ../../node_modules/.pnpm/@effected+glob@0.2.0_effect@4.0.0-beta.99/node_modules/@effected/glob/internal/limits.js
427
427
  /** Hard cap on pattern length. Upstream minimatch's MAX_PATTERN_LENGTH (64KB). */
428
428
  const MAX_PATTERN_LENGTH = 1024 * 64;
429
429
  /** Default brace-expansion output budget. Upstream brace-expansion's EXPANSION_MAX. */
@@ -457,7 +457,7 @@ const assertCap = (name, value) => {
457
457
  return value;
458
458
  };
459
459
  //#endregion
460
- //#region ../../node_modules/.pnpm/@effected+glob@0.1.2_effect@4.0.0-beta.99/node_modules/@effected/glob/internal/unescape.js
460
+ //#region ../../node_modules/.pnpm/@effected+glob@0.2.0_effect@4.0.0-beta.99/node_modules/@effected/glob/internal/unescape.js
461
461
  /**
462
462
  * Un-escape a string that has been escaped with `escape`.
463
463
  *
@@ -480,11 +480,11 @@ const unescapePattern = (s, { windowsPathsNoEscape = false, magicalBraces = true
480
480
  return windowsPathsNoEscape ? s.replace(/\[([^/\\{}])\]/g, "$1") : s.replace(/((?!\\).|^)\[([^/\\{}])\]/g, "$1$2").replace(/\\([^/{}])/g, "$1");
481
481
  };
482
482
  //#endregion
483
- //#region ../../node_modules/.pnpm/@effected+glob@0.1.2_effect@4.0.0-beta.99/node_modules/@effected/glob/internal/types.js
483
+ //#region ../../node_modules/.pnpm/@effected+glob@0.2.0_effect@4.0.0-beta.99/node_modules/@effected/glob/internal/types.js
484
484
  /** The globstar marker in a compiled pattern set. */
485
485
  const GLOBSTAR = Symbol("globstar **");
486
486
  //#endregion
487
- //#region ../../node_modules/.pnpm/@effected+glob@0.1.2_effect@4.0.0-beta.99/node_modules/@effected/glob/internal/escape.js
487
+ //#region ../../node_modules/.pnpm/@effected+glob@0.2.0_effect@4.0.0-beta.99/node_modules/@effected/glob/internal/escape.js
488
488
  /**
489
489
  * Escape all magic characters in a glob pattern.
490
490
  *
@@ -502,13 +502,13 @@ const escapePattern = (s, { windowsPathsNoEscape = false, magicalBraces = false
502
502
  return windowsPathsNoEscape ? s.replace(/[?*()[\]]/g, "[$&]") : s.replace(/[?*()[\]\\]/g, "\\$&");
503
503
  };
504
504
  //#endregion
505
- //#region ../../node_modules/.pnpm/@effected+glob@0.1.2_effect@4.0.0-beta.99/node_modules/@effected/glob/internal/assertValidPattern.js
505
+ //#region ../../node_modules/.pnpm/@effected+glob@0.2.0_effect@4.0.0-beta.99/node_modules/@effected/glob/internal/assertValidPattern.js
506
506
  const assertValidPattern = (pattern) => {
507
507
  if (typeof pattern !== "string") throw new TypeError("invalid pattern");
508
508
  if (pattern.length > 65536) throw new GuardExceeded("PatternTooLong", MAX_PATTERN_LENGTH, pattern.length);
509
509
  };
510
510
  //#endregion
511
- //#region ../../node_modules/.pnpm/@effected+glob@0.1.2_effect@4.0.0-beta.99/node_modules/@effected/glob/internal/braceExpressions.js
511
+ //#region ../../node_modules/.pnpm/@effected+glob@0.2.0_effect@4.0.0-beta.99/node_modules/@effected/glob/internal/braceExpressions.js
512
512
  const posixClasses = {
513
513
  "[:alnum:]": ["\\p{L}\\p{Nl}\\p{Nd}", true],
514
514
  "[:alpha:]": ["\\p{L}\\p{Nl}", true],
@@ -631,7 +631,7 @@ const parseClass = (glob, position) => {
631
631
  ];
632
632
  };
633
633
  //#endregion
634
- //#region ../../node_modules/.pnpm/@effected+glob@0.1.2_effect@4.0.0-beta.99/node_modules/@effected/glob/internal/ast.js
634
+ //#region ../../node_modules/.pnpm/@effected+glob@0.2.0_effect@4.0.0-beta.99/node_modules/@effected/glob/internal/ast.js
635
635
  const types = /* @__PURE__ */ new Set([
636
636
  "!",
637
637
  "?",
@@ -1148,7 +1148,7 @@ var AST = class AST {
1148
1148
  }
1149
1149
  };
1150
1150
  //#endregion
1151
- //#region ../../node_modules/.pnpm/@effected+glob@0.1.2_effect@4.0.0-beta.99/node_modules/@effected/glob/internal/balancedMatch.js
1151
+ //#region ../../node_modules/.pnpm/@effected+glob@0.2.0_effect@4.0.0-beta.99/node_modules/@effected/glob/internal/balancedMatch.js
1152
1152
  const maybeMatch = (reg, str) => {
1153
1153
  const m = str.match(reg);
1154
1154
  return m ? m[0] : null;
@@ -1206,7 +1206,7 @@ const range = (a, b, str) => {
1206
1206
  return result;
1207
1207
  };
1208
1208
  //#endregion
1209
- //#region ../../node_modules/.pnpm/@effected+glob@0.1.2_effect@4.0.0-beta.99/node_modules/@effected/glob/internal/braceExpansion.js
1209
+ //#region ../../node_modules/.pnpm/@effected+glob@0.2.0_effect@4.0.0-beta.99/node_modules/@effected/glob/internal/braceExpansion.js
1210
1210
  const escSlash = `\0SLASH${Math.random()}\0`;
1211
1211
  const escOpen = `\0OPEN${Math.random()}\0`;
1212
1212
  const escClose = `\0CLOSE${Math.random()}\0`;
@@ -1353,7 +1353,7 @@ function expand_(str, max, isTopInput, depth) {
1353
1353
  }
1354
1354
  }
1355
1355
  //#endregion
1356
- //#region ../../node_modules/.pnpm/@effected+glob@0.1.2_effect@4.0.0-beta.99/node_modules/@effected/glob/internal/minimatch.js
1356
+ //#region ../../node_modules/.pnpm/@effected+glob@0.2.0_effect@4.0.0-beta.99/node_modules/@effected/glob/internal/minimatch.js
1357
1357
  const starDotExtRE = /^\*+([^+@!?*[(]*)$/;
1358
1358
  const starDotExtTest = (ext) => (f) => !f.startsWith(".") && f.endsWith(ext);
1359
1359
  const starDotExtTestDot = (ext) => (f) => f.endsWith(ext);
@@ -1924,7 +1924,7 @@ var Minimatch = class {
1924
1924
  }
1925
1925
  };
1926
1926
  //#endregion
1927
- //#region ../../node_modules/.pnpm/@effected+glob@0.1.2_effect@4.0.0-beta.99/node_modules/@effected/glob/GlobPattern.js
1927
+ //#region ../../node_modules/.pnpm/@effected+glob@0.2.0_effect@4.0.0-beta.99/node_modules/@effected/glob/GlobPattern.js
1928
1928
  /**
1929
1929
  * Typed failure raised when a glob pattern trips a compile-time guard:
1930
1930
  * over-length, brace-expansion budget exhaustion, or nesting past the depth
@@ -2053,17 +2053,30 @@ var GlobPattern = class GlobPattern extends effect.Schema.Class("GlobPattern")(e
2053
2053
  return this.#engine;
2054
2054
  }
2055
2055
  /**
2056
- * Compile a pattern under the given options — the package's fallible
2057
- * boundary. Guard trips (over-length, expansion budget, nesting depth)
2058
- * fail typed with {@link GlobPatternError}; invalid options never reach
2059
- * here (they throw at `GlobPatternOptions.make`, a wiring defect).
2056
+ * Compile a pattern under the given options, synchronously — the package's
2057
+ * fallible boundary in its primitive form. Compilation is pure
2058
+ * string→predicate work with no IO, no services and no async step, so the
2059
+ * sync form is the real primitive and {@link GlobPattern.compile} is
2060
+ * derived from it.
2061
+ *
2062
+ * Total: never throws for pattern input. Guard trips (over-length,
2063
+ * expansion budget, nesting depth) come back as a `Result` failure holding
2064
+ * {@link GlobPatternError}; invalid *options* never reach here (they throw
2065
+ * at `GlobPatternOptions.make`, a wiring defect).
2060
2066
  *
2061
2067
  * The pattern must also compile under DEFAULT options, whatever the
2062
2068
  * effective options are — permissive options (say `nobrace` over a brace
2063
2069
  * bomb) do not admit a defaults-rejected pattern; the same typed error
2064
2070
  * surfaces instead.
2071
+ *
2072
+ * @remarks
2073
+ * For synchronous call sites that cannot host an Effect — a lint-staged
2074
+ * handler, a config predicate — this removes the
2075
+ * `Effect.runSync(Effect.result(...))` escape hatch: pair it with
2076
+ * `Result.isSuccess` and read `.success` directly. Effect call sites should
2077
+ * prefer {@link GlobPattern.compile}, which carries the tracing span.
2065
2078
  */
2066
- static compile = effect.Effect.fn("GlobPattern.compile")(function* (source, options) {
2079
+ static compileResult(source, options) {
2067
2080
  const engineOptions = toEngineOptions(options);
2068
2081
  try {
2069
2082
  new Minimatch(source, {});
@@ -2071,16 +2084,30 @@ var GlobPattern = class GlobPattern extends effect.Schema.Class("GlobPattern")(e
2071
2084
  const pattern = new GlobPattern({ source });
2072
2085
  pattern.#engine = engine;
2073
2086
  pattern.#engineOptions = engineOptions;
2074
- return pattern;
2087
+ return effect.Result.succeed(pattern);
2075
2088
  } catch (e) {
2076
- if (isGuardExceeded(e)) return yield* new GlobPatternError({
2089
+ if (isGuardExceeded(e)) return effect.Result.fail(new GlobPatternError({
2077
2090
  pattern: source,
2078
2091
  reason: e.reason,
2079
2092
  limit: e.limit,
2080
2093
  actual: e.actual
2081
- });
2094
+ }));
2082
2095
  throw e;
2083
2096
  }
2097
+ }
2098
+ /**
2099
+ * Compile a pattern under the given options — the package's fallible
2100
+ * boundary, and the form Effect call sites should reach for. Guard trips
2101
+ * (over-length, expansion budget, nesting depth) fail typed with
2102
+ * {@link GlobPatternError}; invalid options never reach here (they throw at
2103
+ * `GlobPatternOptions.make`, a wiring defect).
2104
+ *
2105
+ * Defined in terms of {@link GlobPattern.compileResult} — synchronous
2106
+ * callers can use that variant directly. Same semantics, same errors; this
2107
+ * form adds only the `GlobPattern.compile` tracing span.
2108
+ */
2109
+ static compile = effect.Effect.fn("GlobPattern.compile")(function* (source, options) {
2110
+ return yield* effect.Effect.fromResult(GlobPattern.compileResult(source, options));
2084
2111
  });
2085
2112
  /**
2086
2113
  * Whether `candidate` matches this pattern. Total: never throws, never
@@ -2176,7 +2203,7 @@ var GlobPattern = class GlobPattern extends effect.Schema.Class("GlobPattern")(e
2176
2203
  })));
2177
2204
  };
2178
2205
  //#endregion
2179
- //#region ../../node_modules/.pnpm/@effected+glob@0.1.2_effect@4.0.0-beta.99/node_modules/@effected/glob/GlobSet.js
2206
+ //#region ../../node_modules/.pnpm/@effected+glob@0.2.0_effect@4.0.0-beta.99/node_modules/@effected/glob/GlobSet.js
2180
2207
  const exclusionTarget = (pattern) => pattern.startsWith("!") ? pattern.slice(1) : void 0;
2181
2208
  const allCompileUnderDefaults = (patterns) => {
2182
2209
  for (const pattern of patterns) {
@@ -2251,27 +2278,53 @@ var GlobSet = class GlobSet extends effect.Schema.Class("GlobSet")(effect.Schema
2251
2278
  return this.#literalSet;
2252
2279
  }
2253
2280
  /**
2254
- * Compile a pattern set — with {@link GlobPattern.compile}, the package's
2255
- * only other fallible boundary. Fails typed on the FIRST uncompilable
2256
- * member, with the error's `pattern` field naming the offending source
2257
- * pattern (bang included for exclusions).
2281
+ * Compile a pattern set, synchronously the primitive form, mirroring
2282
+ * {@link GlobPattern.compileResult}. Set compilation is pure
2283
+ * string→predicate work with no IO and no async step, so the sync form is
2284
+ * the real primitive and {@link GlobSet.compile} is derived from it.
2285
+ *
2286
+ * Total: never throws for pattern input. Fails on the FIRST uncompilable
2287
+ * member, coming back as a `Result` failure whose {@link GlobPatternError}
2288
+ * names the offending source pattern in `pattern` (bang included for
2289
+ * exclusions).
2290
+ *
2291
+ * @remarks
2292
+ * For synchronous call sites that cannot host an Effect — a lint-staged
2293
+ * handler, a config predicate — this removes the
2294
+ * `Effect.runSync(Effect.result(...))` escape hatch: pair it with
2295
+ * `Result.isSuccess` and read `.success` directly. Effect call sites should
2296
+ * prefer {@link GlobSet.compile}, which carries the tracing span.
2258
2297
  */
2259
- static compile = effect.Effect.fn("GlobSet.compile")(function* (patterns) {
2298
+ static compileResult(patterns) {
2260
2299
  for (const pattern of patterns) {
2261
2300
  const target = exclusionTarget(pattern) ?? pattern;
2262
2301
  try {
2263
2302
  new Minimatch(target, {});
2264
2303
  } catch (e) {
2265
- if (isGuardExceeded(e)) return yield* new GlobPatternError({
2304
+ if (isGuardExceeded(e)) return effect.Result.fail(new GlobPatternError({
2266
2305
  pattern,
2267
2306
  reason: e.reason,
2268
2307
  limit: e.limit,
2269
2308
  actual: e.actual
2270
- });
2309
+ }));
2271
2310
  throw e;
2272
2311
  }
2273
2312
  }
2274
- return new GlobSet({ patterns });
2313
+ return effect.Result.succeed(new GlobSet({ patterns }));
2314
+ }
2315
+ /**
2316
+ * Compile a pattern set — with {@link GlobPattern.compile}, the package's
2317
+ * only other fallible boundary, and the form Effect call sites should reach
2318
+ * for. Fails typed on the FIRST uncompilable member, with the error's
2319
+ * `pattern` field naming the offending source pattern (bang included for
2320
+ * exclusions).
2321
+ *
2322
+ * Defined in terms of {@link GlobSet.compileResult} — synchronous callers
2323
+ * can use that variant directly. Same semantics, same errors; this form
2324
+ * adds only the `GlobSet.compile` tracing span.
2325
+ */
2326
+ static compile = effect.Effect.fn("GlobSet.compile")(function* (patterns) {
2327
+ return yield* effect.Effect.fromResult(GlobSet.compileResult(patterns));
2275
2328
  });
2276
2329
  /**
2277
2330
  * Whether `candidate` matches the set: some include accepts it (literal
@@ -2304,7 +2357,7 @@ var GlobSet = class GlobSet extends effect.Schema.Class("GlobSet")(effect.Schema
2304
2357
  }
2305
2358
  };
2306
2359
  //#endregion
2307
- //#region ../../node_modules/.pnpm/@effected+lockfiles@0.1.5_@effected+jsonc@0.4.0_effect@4.0.0-beta.99__@effected+npm@0.2_b1d671782d9bef489a2d22b7bd2ef126/node_modules/@effected/lockfiles/BunExtension.js
2360
+ //#region ../../node_modules/.pnpm/@effected+lockfiles@0.1.9_@effected+jsonc@0.5.0_effect@4.0.0-beta.99__@effected+npm@0.3_d470055e7ca4b6a23d413cae592e2835/node_modules/@effected/lockfiles/BunExtension.js
2308
2361
  /**
2309
2362
  * Extension data specific to bun lockfiles, attached to `Lockfile.extension`
2310
2363
  * when the format is `"bun"`.
@@ -2325,7 +2378,7 @@ var BunExtension = class extends effect.Schema.Class("BunExtension")({
2325
2378
  trustedDependencies: effect.Schema.optionalKey(effect.Schema.Array(effect.Schema.String))
2326
2379
  }) {};
2327
2380
  //#endregion
2328
- //#region ../../node_modules/.pnpm/@effected+npm@0.2.1_@effected+semver@0.1.1_effect@4.0.0-beta.99__effect@4.0.0-beta.99/node_modules/@effected/npm/CatalogResolver.js
2381
+ //#region ../../node_modules/.pnpm/@effected+npm@0.3.0_@effected+semver@0.2.0_effect@4.0.0-beta.99__effect@4.0.0-beta.99/node_modules/@effected/npm/CatalogResolver.js
2329
2382
  /**
2330
2383
  * Contract for resolving pnpm `catalog:` dependency specifiers to concrete
2331
2384
  * version ranges.
@@ -2371,7 +2424,7 @@ var CatalogResolver = class CatalogResolver extends effect.Context.Service()("@e
2371
2424
  static noop = effect.Layer.succeed(CatalogResolver, { rangeOf: () => effect.Effect.succeed(effect.Option.none()) });
2372
2425
  };
2373
2426
  //#endregion
2374
- //#region ../../node_modules/.pnpm/@effected+npm@0.2.1_@effected+semver@0.1.1_effect@4.0.0-beta.99__effect@4.0.0-beta.99/node_modules/@effected/npm/WorkspaceResolver.js
2427
+ //#region ../../node_modules/.pnpm/@effected+npm@0.3.0_@effected+semver@0.2.0_effect@4.0.0-beta.99__effect@4.0.0-beta.99/node_modules/@effected/npm/WorkspaceResolver.js
2375
2428
  /**
2376
2429
  * Raised when a `catalog:` or `workspace:` specifier cannot be resolved
2377
2430
  * because the resolution mechanism itself failed — not for an ordinary
@@ -2432,7 +2485,7 @@ var WorkspaceResolver = class WorkspaceResolver extends effect.Context.Service()
2432
2485
  static noop = effect.Layer.succeed(WorkspaceResolver, { versionOf: () => effect.Effect.succeed(effect.Option.none()) });
2433
2486
  };
2434
2487
  //#endregion
2435
- //#region ../../node_modules/.pnpm/@effected+npm@0.2.1_@effected+semver@0.1.1_effect@4.0.0-beta.99__effect@4.0.0-beta.99/node_modules/@effected/npm/CatalogAssemblyError.js
2488
+ //#region ../../node_modules/.pnpm/@effected+npm@0.3.0_@effected+semver@0.2.0_effect@4.0.0-beta.99__effect@4.0.0-beta.99/node_modules/@effected/npm/CatalogAssemblyError.js
2436
2489
  /**
2437
2490
  * Raised when a workspace's catalogs cannot be assembled — a `pnpm-workspace.yaml`
2438
2491
  * that is unreadable or not valid YAML, a root `package.json` `workspaces` field
@@ -2476,7 +2529,7 @@ var CatalogAssemblyError = class extends effect.Schema.TaggedErrorClass()("Catal
2476
2529
  }
2477
2530
  };
2478
2531
  //#endregion
2479
- //#region ../../node_modules/.pnpm/@effected+npm@0.2.1_@effected+semver@0.1.1_effect@4.0.0-beta.99__effect@4.0.0-beta.99/node_modules/@effected/npm/DependencySection.js
2532
+ //#region ../../node_modules/.pnpm/@effected+npm@0.3.0_@effected+semver@0.2.0_effect@4.0.0-beta.99__effect@4.0.0-beta.99/node_modules/@effected/npm/DependencySection.js
2480
2533
  /**
2481
2534
  * The short dependency kind: which dependency map an entry came from, named the
2482
2535
  * way consumers branch on it.
@@ -2508,7 +2561,7 @@ Object.fromEntries(Object.entries({
2508
2561
  optional: "optionalDependencies"
2509
2562
  }).map(([kind, field]) => [field, kind]));
2510
2563
  //#endregion
2511
- //#region ../../node_modules/.pnpm/@effected+semver@0.1.1_effect@4.0.0-beta.99/node_modules/@effected/semver/internal/desugar.js
2564
+ //#region ../../node_modules/.pnpm/@effected+semver@0.2.0_effect@4.0.0-beta.99/node_modules/@effected/semver/internal/desugar.js
2512
2565
  const sv = (major, minor, patch, prerelease = [], build = []) => ({
2513
2566
  major,
2514
2567
  minor,
@@ -2597,7 +2650,7 @@ const desugarHyphen = (lower, upper) => {
2597
2650
  return [comp(">=", lowerVersion)];
2598
2651
  };
2599
2652
  //#endregion
2600
- //#region ../../node_modules/.pnpm/@effected+semver@0.1.1_effect@4.0.0-beta.99/node_modules/@effected/semver/internal/grammar.js
2653
+ //#region ../../node_modules/.pnpm/@effected+semver@0.2.0_effect@4.0.0-beta.99/node_modules/@effected/semver/internal/grammar.js
2601
2654
  /** Private control-flow exception; never escapes the entry points. */
2602
2655
  var ParseFailure = class {
2603
2656
  position;
@@ -2992,7 +3045,7 @@ const formatComparator = (c) => {
2992
3045
  /** Print comparator sets as `a b || c d`. */
2993
3046
  const formatRange = (sets) => sets.map((set) => set.map(formatComparator).join(" ")).join(" || ");
2994
3047
  //#endregion
2995
- //#region ../../node_modules/.pnpm/@effected+semver@0.1.1_effect@4.0.0-beta.99/node_modules/@effected/semver/internal/order.js
3048
+ //#region ../../node_modules/.pnpm/@effected+semver@0.2.0_effect@4.0.0-beta.99/node_modules/@effected/semver/internal/order.js
2996
3049
  /**
2997
3050
  * Compare two prerelease identifiers per SemVer 2.0.0 §11: numeric
2998
3051
  * identifiers always have lower precedence than alphanumeric ones; numerics
@@ -3045,7 +3098,7 @@ const compareBuild = (a, b) => {
3045
3098
  return 0;
3046
3099
  };
3047
3100
  //#endregion
3048
- //#region ../../node_modules/.pnpm/@effected+semver@0.1.1_effect@4.0.0-beta.99/node_modules/@effected/semver/SemVer.js
3101
+ //#region ../../node_modules/.pnpm/@effected+semver@0.2.0_effect@4.0.0-beta.99/node_modules/@effected/semver/SemVer.js
3049
3102
  /**
3050
3103
  * Indicates that a string could not be parsed as a valid SemVer 2.0.0 version.
3051
3104
  *
@@ -3126,23 +3179,57 @@ var SemVer = class SemVer extends effect.Schema.Class("SemVer")({
3126
3179
  encode: (parts) => effect.Effect.succeed(formatVersion(parts))
3127
3180
  })));
3128
3181
  /**
3129
- * Parse a strict SemVer 2.0.0 version string.
3182
+ * Parse a strict SemVer 2.0.0 version string, synchronously, returning a
3183
+ * `Result` instead of an `Effect`.
3130
3184
  *
3131
3185
  * Rejects `v`/`V` prefixes, `=` prefixes, leading zeros on numeric
3132
3186
  * identifiers and partially consumed input.
3133
3187
  *
3188
+ * @remarks
3189
+ * {@link SemVer.parse} is defined in terms of this function; the two never
3190
+ * diverge. Reach for the `Effect` variant inside Effect code — it carries
3191
+ * the `SemVer.parse` tracing span — and for this one at synchronous
3192
+ * boundaries.
3193
+ *
3194
+ * @example
3195
+ * ```ts
3196
+ * import { SemVer } from "@effected/semver";
3197
+ * import { Result } from "effect";
3198
+ *
3199
+ * const ok = SemVer.parseResult("1.2.3");
3200
+ * if (Result.isSuccess(ok)) {
3201
+ * console.log(ok.success.major); // => 1
3202
+ * }
3203
+ *
3204
+ * const bad = SemVer.parseResult("v1.2.3");
3205
+ * if (Result.isFailure(bad)) {
3206
+ * console.log(bad.failure._tag); // => "InvalidVersionError"
3207
+ * }
3208
+ * ```
3209
+ *
3134
3210
  * @param input - the version string to parse
3135
- * @returns the parsed {@link SemVer}. Fails with {@link InvalidVersionError}
3136
- * when `input` is not a valid version string.
3211
+ * @returns a `Result` succeeding with the parsed {@link SemVer}, or failing
3212
+ * with {@link InvalidVersionError} when `input` is not a valid version
3213
+ * string.
3137
3214
  */
3138
- static parse = effect.Effect.fn("SemVer.parse")(function* (input) {
3215
+ static parseResult(input) {
3139
3216
  const result = parseVersion(input);
3140
- if (!result.ok) return yield* new InvalidVersionError({
3217
+ if (!result.ok) return effect.Result.fail(new InvalidVersionError({
3141
3218
  input: result.input,
3142
3219
  position: result.position
3143
- });
3144
- return SemVer.make(result.value);
3145
- });
3220
+ }));
3221
+ return effect.Result.succeed(SemVer.make(result.value));
3222
+ }
3223
+ /**
3224
+ * Parse a strict SemVer 2.0.0 version string. Defined in terms of
3225
+ * {@link SemVer.parseResult} — synchronous callers can use that variant
3226
+ * directly.
3227
+ *
3228
+ * @param input - the version string to parse
3229
+ * @returns the parsed {@link SemVer}. Fails with {@link InvalidVersionError}
3230
+ * when `input` is not a valid version string.
3231
+ */
3232
+ static parse = effect.Effect.fn("SemVer.parse")((input) => effect.Effect.fromResult(SemVer.parseResult(input)));
3146
3233
  /**
3147
3234
  * Positional convenience constructor: `SemVer.of(1, 2, 3)`.
3148
3235
  *
@@ -3446,7 +3533,7 @@ var SemVerBump = class {
3446
3533
  }
3447
3534
  };
3448
3535
  //#endregion
3449
- //#region ../../node_modules/.pnpm/@effected+semver@0.1.1_effect@4.0.0-beta.99/node_modules/@effected/semver/Comparator.js
3536
+ //#region ../../node_modules/.pnpm/@effected+semver@0.2.0_effect@4.0.0-beta.99/node_modules/@effected/semver/Comparator.js
3450
3537
  /**
3451
3538
  * Indicates that a string could not be parsed as a single comparator.
3452
3539
  *
@@ -3513,18 +3600,52 @@ var Comparator = class Comparator extends effect.Schema.Class("Comparator")({
3513
3600
  },
3514
3601
  encode: (parts) => effect.Effect.succeed(formatComparator(parts))
3515
3602
  })));
3516
- /** Parse a comparator string (e.g. `">=1.2.3"`). */
3517
- static parse = effect.Effect.fn("Comparator.parse")(function* (input) {
3603
+ /**
3604
+ * Parse a comparator string (e.g. `">=1.2.3"`), synchronously, returning a
3605
+ * `Result` instead of an `Effect`.
3606
+ *
3607
+ * @remarks
3608
+ * {@link Comparator.parse} is defined in terms of this function; the two
3609
+ * never diverge. Reach for the `Effect` variant inside Effect code — it
3610
+ * carries the `Comparator.parse` tracing span — and for this one at
3611
+ * synchronous boundaries.
3612
+ *
3613
+ * @example
3614
+ * ```ts
3615
+ * import { Comparator } from "@effected/semver";
3616
+ * import { Result } from "effect";
3617
+ *
3618
+ * const ok = Comparator.parseResult(">=1.2.3");
3619
+ * if (Result.isSuccess(ok)) {
3620
+ * console.log(ok.success.operator); // => ">="
3621
+ * }
3622
+ * ```
3623
+ *
3624
+ * @param input - the comparator string to parse
3625
+ * @returns a `Result` succeeding with the parsed {@link Comparator}, or
3626
+ * failing with {@link InvalidComparatorError}.
3627
+ */
3628
+ static parseResult(input) {
3518
3629
  const result = parseComparator(input);
3519
- if (!result.ok) return yield* new InvalidComparatorError({
3630
+ if (!result.ok) return effect.Result.fail(new InvalidComparatorError({
3520
3631
  input: result.input,
3521
3632
  position: result.position
3522
- });
3523
- return Comparator.make({
3633
+ }));
3634
+ return effect.Result.succeed(Comparator.make({
3524
3635
  operator: result.value.operator,
3525
3636
  version: SemVer.make(result.value.version)
3526
- });
3527
- });
3637
+ }));
3638
+ }
3639
+ /**
3640
+ * Parse a comparator string (e.g. `">=1.2.3"`). Defined in terms of
3641
+ * {@link Comparator.parseResult} — synchronous callers can use that variant
3642
+ * directly.
3643
+ *
3644
+ * @param input - the comparator string to parse
3645
+ * @returns the parsed {@link Comparator}. Fails with
3646
+ * {@link InvalidComparatorError}.
3647
+ */
3648
+ static parse = effect.Effect.fn("Comparator.parse")((input) => effect.Effect.fromResult(Comparator.parseResult(input)));
3528
3649
  /** Test whether a version satisfies this comparator. */
3529
3650
  test(version) {
3530
3651
  const cmp = version.compare(this.version);
@@ -3546,7 +3667,7 @@ var Comparator = class Comparator extends effect.Schema.Class("Comparator")({
3546
3667
  }
3547
3668
  };
3548
3669
  //#endregion
3549
- //#region ../../node_modules/.pnpm/@effected+semver@0.1.1_effect@4.0.0-beta.99/node_modules/@effected/semver/internal/normalize.js
3670
+ //#region ../../node_modules/.pnpm/@effected+semver@0.2.0_effect@4.0.0-beta.99/node_modules/@effected/semver/internal/normalize.js
3550
3671
  const operatorWeight = (op) => {
3551
3672
  switch (op) {
3552
3673
  case ">=": return 0;
@@ -3577,7 +3698,7 @@ const normalizeComparatorSet = (set) => sortComparators(removeDuplicates(set));
3577
3698
  /** Normalize every comparator set in a range: sort and deduplicate each independently. */
3578
3699
  const normalizeSets = (sets) => sets.map(normalizeComparatorSet);
3579
3700
  //#endregion
3580
- //#region ../../node_modules/.pnpm/@effected+semver@0.1.1_effect@4.0.0-beta.99/node_modules/@effected/semver/Range.js
3701
+ //#region ../../node_modules/.pnpm/@effected+semver@0.2.0_effect@4.0.0-beta.99/node_modules/@effected/semver/Range.js
3581
3702
  /**
3582
3703
  * Indicates that a string could not be parsed as a range expression.
3583
3704
  *
@@ -3637,18 +3758,51 @@ sets: effect.Schema.Array(effect.Schema.Array(Comparator)) }) {
3637
3758
  },
3638
3759
  encode: (parts) => effect.Effect.succeed(formatRange(parts.sets))
3639
3760
  })));
3640
- /** Parse a range expression and normalize its comparator sets. */
3641
- static parse = effect.Effect.fn("Range.parse")(function* (input) {
3761
+ /**
3762
+ * Parse a range expression and normalize its comparator sets,
3763
+ * synchronously, returning a `Result` instead of an `Effect`.
3764
+ *
3765
+ * @remarks
3766
+ * {@link Range.parse} is defined in terms of this function; the two never
3767
+ * diverge. Reach for the `Effect` variant inside Effect code — it carries
3768
+ * the `Range.parse` tracing span — and for this one at synchronous
3769
+ * boundaries.
3770
+ *
3771
+ * @example
3772
+ * ```ts
3773
+ * import { Range } from "@effected/semver";
3774
+ * import { Result } from "effect";
3775
+ *
3776
+ * const ok = Range.parseResult("^1.0.0");
3777
+ * if (Result.isSuccess(ok)) {
3778
+ * console.log(ok.success.toString()); // => ">=1.0.0 <2.0.0-0"
3779
+ * }
3780
+ * ```
3781
+ *
3782
+ * @param input - the range expression to parse
3783
+ * @returns a `Result` succeeding with the parsed {@link Range}, or failing
3784
+ * with {@link InvalidRangeError}.
3785
+ */
3786
+ static parseResult(input) {
3642
3787
  const result = parseRange$1(input);
3643
- if (!result.ok) return yield* new InvalidRangeError({
3788
+ if (!result.ok) return effect.Result.fail(new InvalidRangeError({
3644
3789
  input: result.input,
3645
3790
  position: result.position
3646
- });
3647
- return Range.make({ sets: normalizeSets(result.value).map((set) => set.map((c) => Comparator.make({
3791
+ }));
3792
+ return effect.Result.succeed(Range.make({ sets: normalizeSets(result.value).map((set) => set.map((c) => Comparator.make({
3648
3793
  operator: c.operator,
3649
3794
  version: SemVer.make(c.version)
3650
- }))) });
3651
- });
3795
+ }))) }));
3796
+ }
3797
+ /**
3798
+ * Parse a range expression and normalize its comparator sets. Defined in
3799
+ * terms of {@link Range.parseResult} — synchronous callers can use that
3800
+ * variant directly.
3801
+ *
3802
+ * @param input - the range expression to parse
3803
+ * @returns the parsed {@link Range}. Fails with {@link InvalidRangeError}.
3804
+ */
3805
+ static parse = effect.Effect.fn("Range.parse")((input) => effect.Effect.fromResult(Range.parseResult(input)));
3652
3806
  /**
3653
3807
  * Test whether a version satisfies a range; see {@link Range.test} for the
3654
3808
  * prerelease matching rule. Dual API.
@@ -3675,19 +3829,49 @@ sets: effect.Schema.Array(effect.Schema.Array(Comparator)) }) {
3675
3829
  static union = effect.Function.dual(2, (self, that) => Range.make({ sets: [...self.sets, ...that.sets] }));
3676
3830
  /**
3677
3831
  * Intersect two ranges via a cross-product of their comparator sets,
3678
- * keeping only satisfiable combinations. Fails with
3832
+ * keeping only satisfiable combinations, synchronously, returning a
3833
+ * `Result` instead of an `Effect`. Fails with
3679
3834
  * {@link UnsatisfiableConstraintError} when no satisfiable set remains —
3680
3835
  * an honest typed failure instead of an unsatisfiable range. Dual API.
3836
+ *
3837
+ * @remarks
3838
+ * {@link Range.intersect} is defined in terms of this function; the two
3839
+ * never diverge. Reach for the `Effect` variant inside Effect code — it
3840
+ * carries the `Range.intersect` tracing span — and for this one at
3841
+ * synchronous boundaries.
3842
+ *
3843
+ * @example
3844
+ * ```ts
3845
+ * import { Range } from "@effected/semver";
3846
+ * import { Result } from "effect";
3847
+ *
3848
+ * const a = Result.getOrThrow(Range.parseResult("^1.0.0"));
3849
+ * const b = Result.getOrThrow(Range.parseResult(">=1.5.0"));
3850
+ * const merged = Range.intersectResult(a, b);
3851
+ * if (Result.isSuccess(merged)) {
3852
+ * console.log(merged.success.toString()); // => ">=1.0.0 <2.0.0-0 >=1.5.0"
3853
+ * }
3854
+ * ```
3681
3855
  */
3682
- static intersect = effect.Function.dual(2, effect.Effect.fn("Range.intersect")(function* (self, that) {
3856
+ static intersectResult = effect.Function.dual(2, (self, that) => {
3683
3857
  const candidates = [];
3684
3858
  for (const setA of self.sets) for (const setB of that.sets) {
3685
3859
  const merged = [...setA, ...setB];
3686
3860
  if (isSetSatisfiable(merged)) candidates.push(merged);
3687
3861
  }
3688
- if (candidates.length === 0) return yield* new UnsatisfiableConstraintError({ constraints: [self, that] });
3689
- return Range.make({ sets: candidates });
3690
- }));
3862
+ if (candidates.length === 0) return effect.Result.fail(new UnsatisfiableConstraintError({ constraints: [self, that] }));
3863
+ return effect.Result.succeed(Range.make({ sets: candidates }));
3864
+ });
3865
+ /**
3866
+ * Intersect two ranges via a cross-product of their comparator sets,
3867
+ * keeping only satisfiable combinations. Fails with
3868
+ * {@link UnsatisfiableConstraintError} when no satisfiable set remains —
3869
+ * an honest typed failure instead of an unsatisfiable range. Dual API.
3870
+ *
3871
+ * Defined in terms of {@link Range.intersectResult} — synchronous callers
3872
+ * can use that variant directly.
3873
+ */
3874
+ static intersect = effect.Function.dual(2, effect.Effect.fn("Range.intersect")((self, that) => effect.Effect.fromResult(Range.intersectResult(self, that))));
3691
3875
  /**
3692
3876
  * Check whether every version matched by `sub` is also matched by `sup`.
3693
3877
  * Dual API.
@@ -3846,7 +4030,7 @@ const isComparatorSetSubset = (sub, sup) => {
3846
4030
  return true;
3847
4031
  };
3848
4032
  //#endregion
3849
- //#region ../../node_modules/.pnpm/@effected+npm@0.2.1_@effected+semver@0.1.1_effect@4.0.0-beta.99__effect@4.0.0-beta.99/node_modules/@effected/npm/DependencySpecifier.js
4033
+ //#region ../../node_modules/.pnpm/@effected+npm@0.3.0_@effected+semver@0.2.0_effect@4.0.0-beta.99__effect@4.0.0-beta.99/node_modules/@effected/npm/DependencySpecifier.js
3850
4034
  /**
3851
4035
  * Indicates that a string could not be parsed as a valid dependency specifier.
3852
4036
  *
@@ -4053,7 +4237,7 @@ const DependencySpecifier = Object.assign(brandedSpecifier, {
4053
4237
  FromString: fromString
4054
4238
  });
4055
4239
  //#endregion
4056
- //#region ../../node_modules/.pnpm/@effected+npm@0.2.1_@effected+semver@0.1.1_effect@4.0.0-beta.99__effect@4.0.0-beta.99/node_modules/@effected/npm/IntegrityHash.js
4240
+ //#region ../../node_modules/.pnpm/@effected+npm@0.3.0_@effected+semver@0.2.0_effect@4.0.0-beta.99__effect@4.0.0-beta.99/node_modules/@effected/npm/IntegrityHash.js
4057
4241
  const SRI_RE = /^(sha1|sha256|sha384|sha512)-[A-Za-z0-9+/]+={0,2}$/;
4058
4242
  const COREPACK_RE = /^(sha1|sha256|sha384|sha512)\.[0-9a-f]+$/;
4059
4243
  const YARN_RE = /^[0-9]+(c[0-9]+)?\/[0-9a-f]+$/;
@@ -4106,7 +4290,175 @@ const IntegrityHash = Object.assign(brandedIntegrity, {
4106
4290
  decode: decode$2
4107
4291
  });
4108
4292
  //#endregion
4109
- //#region ../../node_modules/.pnpm/@effected+lockfiles@0.1.5_@effected+jsonc@0.4.0_effect@4.0.0-beta.99__@effected+npm@0.2_b1d671782d9bef489a2d22b7bd2ef126/node_modules/@effected/lockfiles/ImporterDependency.js
4293
+ //#region ../../node_modules/.pnpm/@effected+npm@0.3.0_@effected+semver@0.2.0_effect@4.0.0-beta.99__effect@4.0.0-beta.99/node_modules/@effected/npm/ReleaseAgeGate.js
4294
+ const MS_PER_MINUTE = 6e4;
4295
+ /**
4296
+ * A source's partial contribution to a {@link ReleaseAgeGate}: the effective
4297
+ * gate is assembled from more than one place (inline `pnpm-workspace.yaml`
4298
+ * keys, replayed `updateConfig` hooks, `pnpm config get` output), and each
4299
+ * source may set the age, the exclude list, both, or neither. Absent fields
4300
+ * contribute nothing to the combination.
4301
+ *
4302
+ * Deliberately permissive: unlike {@link ReleaseAgeGate} it does not constrain
4303
+ * `ageMinutes` to be non-negative, because the raw values arrive from arbitrary
4304
+ * config sources and {@link ReleaseAgeGate.combine} is the single authority
4305
+ * that clamps them.
4306
+ *
4307
+ * @public
4308
+ */
4309
+ const PartialReleaseAgeGate = effect.Schema.Struct({
4310
+ /** Minutes a release must age; absent means this source sets no age. */
4311
+ ageMinutes: effect.Schema.optionalKey(effect.Schema.Number),
4312
+ /** Exempt package-name patterns; absent means this source adds no exemptions. */
4313
+ exclude: effect.Schema.optionalKey(effect.Schema.Array(effect.Schema.String))
4314
+ });
4315
+ const AgeMinutes = effect.Schema.Number.check(effect.Schema.isGreaterThanOrEqualTo(0), effect.Schema.isFinite());
4316
+ const matchesPattern = (name, pattern) => {
4317
+ if (pattern === name) return true;
4318
+ if (!pattern.includes("*")) return false;
4319
+ let nameIndex = 0;
4320
+ let patternIndex = 0;
4321
+ let starIndex = -1;
4322
+ let retryNameIndex = 0;
4323
+ while (nameIndex < name.length) if (pattern[patternIndex] === "*") {
4324
+ starIndex = patternIndex;
4325
+ patternIndex += 1;
4326
+ retryNameIndex = nameIndex;
4327
+ } else if (pattern[patternIndex] === name[nameIndex]) {
4328
+ patternIndex += 1;
4329
+ nameIndex += 1;
4330
+ } else if (starIndex !== -1) {
4331
+ patternIndex = starIndex + 1;
4332
+ retryNameIndex += 1;
4333
+ nameIndex = retryNameIndex;
4334
+ } else return false;
4335
+ while (pattern[patternIndex] === "*") patternIndex += 1;
4336
+ return patternIndex === pattern.length;
4337
+ };
4338
+ const matchesExclude = (name, patterns) => patterns.some((pattern) => matchesPattern(name, pattern));
4339
+ /**
4340
+ * pnpm's publish-time release-age gate: the number of minutes a published
4341
+ * version must age before it is eligible, and the set of package-name patterns
4342
+ * exempt from the gate. Mirrors pnpm's `minimumReleaseAge` /
4343
+ * `minimumReleaseAgeExclude` config so a resolver can drop too-young candidate
4344
+ * versions before picking, avoiding `ERR_PNPM_NO_MATURE_MATCHING_VERSION`.
4345
+ *
4346
+ * `ageMinutes` is constrained non-negative and finite; a `ReleaseAgeGate` with
4347
+ * `ageMinutes <= 0` is an inert gate that filters nothing. Assemble a gate from
4348
+ * multiple config sources with {@link ReleaseAgeGate.combine}, and apply it to
4349
+ * a package's candidate versions with {@link ReleaseAgeGate.filterVersions}.
4350
+ *
4351
+ * @example
4352
+ * ```ts
4353
+ * import { ReleaseAgeGate } from "@effected/npm";
4354
+ *
4355
+ * const gate = ReleaseAgeGate.combine(
4356
+ * { ageMinutes: 1440 },
4357
+ * { exclude: ["@my-scope/*"] },
4358
+ * );
4359
+ * // gate.ageMinutes === 1440, gate.exclude === ["@my-scope/*"]
4360
+ *
4361
+ * const eligible = gate.filterVersions(
4362
+ * ["1.0.0", "1.0.1"],
4363
+ * { "1.0.0": "2020-01-01T00:00:00Z", "1.0.1": "2026-07-21T00:00:00Z" },
4364
+ * "prettier",
4365
+ * Date.now(),
4366
+ * );
4367
+ * ```
4368
+ *
4369
+ * @public
4370
+ */
4371
+ var ReleaseAgeGate = class ReleaseAgeGate extends effect.Schema.Class("ReleaseAgeGate")({
4372
+ /** Minutes a published version must age before it is eligible (non-negative, finite). */
4373
+ ageMinutes: AgeMinutes,
4374
+ /** Package-name patterns exempt from the gate (exact names or `*`-globs). */
4375
+ exclude: effect.Schema.Array(effect.Schema.String)
4376
+ }) {
4377
+ /**
4378
+ * Combine partial contributions from multiple sources into one effective
4379
+ * gate: **strictest age wins** (the maximum of the contributed ages,
4380
+ * clamped to be non-negative) and the exclude sets **union** (deduplicated,
4381
+ * insertion order preserved). A contribution's absent field adds nothing; a
4382
+ * negative or non-finite contributed age is ignored by the clamp. With no
4383
+ * contributions (or only empty ones) the result is the inert zero gate
4384
+ * (`ageMinutes: 0`, `exclude: []`).
4385
+ *
4386
+ * `combine` is total — it never throws on a fractional, negative, or
4387
+ * non-finite contribution — which is why {@link (PartialReleaseAgeGate:variable)}
4388
+ * does not constrain its `ageMinutes` and this method owns the clamp.
4389
+ *
4390
+ * @param contributions - the partial gates to merge, one per source.
4391
+ */
4392
+ static combine(...contributions) {
4393
+ const ages = contributions.map((contribution) => contribution.ageMinutes).filter((age) => typeof age === "number" && Number.isFinite(age));
4394
+ const ageMinutes = ages.length > 0 ? Math.max(0, ...ages) : 0;
4395
+ const exclude = [...new Set(contributions.flatMap((contribution) => contribution.exclude ?? []))];
4396
+ return ReleaseAgeGate.make({
4397
+ ageMinutes,
4398
+ exclude
4399
+ });
4400
+ }
4401
+ /**
4402
+ * Whether a package name matches any of `patterns`, using pnpm's
4403
+ * `@pnpm/matcher` semantics: an exact-name match, or a `*`-glob where `*`
4404
+ * matches any run of characters **including `/`** — so a bare `*` matches a
4405
+ * scoped name like `@scope/pkg`, and `@scope/*` matches every package in a
4406
+ * scope.
4407
+ *
4408
+ * @remarks
4409
+ * This is deliberately **NOT** `@effected/glob`'s minimatch dialect, in
4410
+ * which `*` refuses to cross `/` (there `*` matches `pkg` but not
4411
+ * `@scope/pkg`, and you would need `**`). pnpm treats the package name as a
4412
+ * flat string, so this matcher does too. Do not "fix" this to route through
4413
+ * `@effected/glob`: it would silently change which packages a gate exempts
4414
+ * and diverge from pnpm's own behavior.
4415
+ *
4416
+ * @param name - the package name to test.
4417
+ * @param patterns - the exclude patterns (exact names or `*`-globs).
4418
+ */
4419
+ static matchesExclude(name, patterns) {
4420
+ return matchesExclude(name, patterns);
4421
+ }
4422
+ /**
4423
+ * Whether this gate exempts the given package name from the release-age
4424
+ * check — `ReleaseAgeGate.matchesExclude(name, this.exclude)`.
4425
+ *
4426
+ * @param name - the package name to test.
4427
+ */
4428
+ isExcluded(name) {
4429
+ return matchesExclude(name, this.exclude);
4430
+ }
4431
+ /**
4432
+ * Filter a package's candidate versions to those old enough to pass the
4433
+ * gate, given each version's publish timestamp and a caller-supplied `now`.
4434
+ *
4435
+ * A version is kept when it has a parseable publish timestamp at or before
4436
+ * the cutoff (`now - ageMinutes * 60000`). A version with a **missing or
4437
+ * unparseable** timestamp in `times` is **dropped** — matching pnpm's strict
4438
+ * posture: a version whose age cannot be established is treated as too young.
4439
+ * The clock is the caller's; this method reads no wall clock.
4440
+ *
4441
+ * Returns all versions unchanged (a no-op) when the gate is inert
4442
+ * (`ageMinutes <= 0`) or the package name is excluded.
4443
+ *
4444
+ * @param versions - the candidate version strings.
4445
+ * @param times - a map from version string to its ISO-8601 publish date.
4446
+ * @param name - the package name (checked against the gate's `exclude` list).
4447
+ * @param now - the current time in epoch milliseconds (the caller's clock).
4448
+ */
4449
+ filterVersions(versions, times, name, now) {
4450
+ if (this.ageMinutes <= 0 || this.isExcluded(name)) return versions;
4451
+ const cutoff = now - this.ageMinutes * MS_PER_MINUTE;
4452
+ return versions.filter((version) => {
4453
+ const time = times[version];
4454
+ if (time === void 0) return false;
4455
+ const published = Date.parse(time);
4456
+ return Number.isFinite(published) && published <= cutoff;
4457
+ });
4458
+ }
4459
+ };
4460
+ //#endregion
4461
+ //#region ../../node_modules/.pnpm/@effected+lockfiles@0.1.9_@effected+jsonc@0.5.0_effect@4.0.0-beta.99__@effected+npm@0.3_d470055e7ca4b6a23d413cae592e2835/node_modules/@effected/lockfiles/ImporterDependency.js
4110
4462
  /**
4111
4463
  * One declared dependency of one workspace importer, as the lockfile records it.
4112
4464
  *
@@ -4134,7 +4486,7 @@ var ImporterDependency = class extends effect.Schema.Class("ImporterDependency")
4134
4486
  depType: DependencyField
4135
4487
  }) {};
4136
4488
  //#endregion
4137
- //#region ../../node_modules/.pnpm/@effected+lockfiles@0.1.5_@effected+jsonc@0.4.0_effect@4.0.0-beta.99__@effected+npm@0.2_b1d671782d9bef489a2d22b7bd2ef126/node_modules/@effected/lockfiles/LockfileImporter.js
4489
+ //#region ../../node_modules/.pnpm/@effected+lockfiles@0.1.9_@effected+jsonc@0.5.0_effect@4.0.0-beta.99__@effected+npm@0.3_d470055e7ca4b6a23d413cae592e2835/node_modules/@effected/lockfiles/LockfileImporter.js
4138
4490
  /**
4139
4491
  * One workspace importer's declared dependencies, as the lockfile records them.
4140
4492
  *
@@ -4158,7 +4510,7 @@ var LockfileImporter = class extends effect.Schema.Class("LockfileImporter")({
4158
4510
  dependencies: effect.Schema.Array(ImporterDependency)
4159
4511
  }) {};
4160
4512
  //#endregion
4161
- //#region ../../node_modules/.pnpm/@effected+lockfiles@0.1.5_@effected+jsonc@0.4.0_effect@4.0.0-beta.99__@effected+npm@0.2_b1d671782d9bef489a2d22b7bd2ef126/node_modules/@effected/lockfiles/ResolvedPackage.js
4513
+ //#region ../../node_modules/.pnpm/@effected+lockfiles@0.1.9_@effected+jsonc@0.5.0_effect@4.0.0-beta.99__@effected+npm@0.3_d470055e7ca4b6a23d413cae592e2835/node_modules/@effected/lockfiles/ResolvedPackage.js
4162
4514
  const EMPTY_DEPENDENCIES = {};
4163
4515
  /**
4164
4516
  * A package resolved from a lockfile.
@@ -4193,7 +4545,7 @@ var ResolvedPackage = class extends effect.Schema.Class("ResolvedPackage")({
4193
4545
  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)))
4194
4546
  }) {};
4195
4547
  //#endregion
4196
- //#region ../../node_modules/.pnpm/@effected+lockfiles@0.1.5_@effected+jsonc@0.4.0_effect@4.0.0-beta.99__@effected+npm@0.2_b1d671782d9bef489a2d22b7bd2ef126/node_modules/@effected/lockfiles/WorkspaceDependency.js
4548
+ //#region ../../node_modules/.pnpm/@effected+lockfiles@0.1.9_@effected+jsonc@0.5.0_effect@4.0.0-beta.99__@effected+npm@0.3_d470055e7ca4b6a23d413cae592e2835/node_modules/@effected/lockfiles/WorkspaceDependency.js
4197
4549
  /**
4198
4550
  * A directed dependency edge between two workspace packages as recorded in
4199
4551
  * the lockfile.
@@ -4215,7 +4567,7 @@ var WorkspaceDependency = class extends effect.Schema.Class("WorkspaceDependency
4215
4567
  constraint: effect.Schema.String
4216
4568
  }) {};
4217
4569
  //#endregion
4218
- //#region ../../node_modules/.pnpm/@effected+lockfiles@0.1.5_@effected+jsonc@0.4.0_effect@4.0.0-beta.99__@effected+npm@0.2_b1d671782d9bef489a2d22b7bd2ef126/node_modules/@effected/lockfiles/PnpmExtension.js
4570
+ //#region ../../node_modules/.pnpm/@effected+lockfiles@0.1.9_@effected+jsonc@0.5.0_effect@4.0.0-beta.99__@effected+npm@0.3_d470055e7ca4b6a23d413cae592e2835/node_modules/@effected/lockfiles/PnpmExtension.js
4219
4571
  /**
4220
4572
  * Extension data specific to pnpm lockfiles, attached to `Lockfile.extension`
4221
4573
  * when the format is `"pnpm"`.
@@ -4240,7 +4592,7 @@ var PnpmExtension = class extends effect.Schema.Class("PnpmExtension")({
4240
4592
  }))
4241
4593
  }) {};
4242
4594
  //#endregion
4243
- //#region ../../node_modules/.pnpm/@effected+lockfiles@0.1.5_@effected+jsonc@0.4.0_effect@4.0.0-beta.99__@effected+npm@0.2_b1d671782d9bef489a2d22b7bd2ef126/node_modules/@effected/lockfiles/LockfileFormat.js
4595
+ //#region ../../node_modules/.pnpm/@effected+lockfiles@0.1.9_@effected+jsonc@0.5.0_effect@4.0.0-beta.99__@effected+npm@0.3_d470055e7ca4b6a23d413cae592e2835/node_modules/@effected/lockfiles/LockfileFormat.js
4244
4596
  /**
4245
4597
  * The lockfile formats this package parses: bun's `bun.lock` (JSONC), npm's
4246
4598
  * `package-lock.json` (v2/v3 JSON), pnpm's `pnpm-lock.yaml` and yarn Berry's
@@ -4274,7 +4626,7 @@ const FILENAMES = {
4274
4626
  */
4275
4627
  const filenameFor = (format) => FILENAMES[format];
4276
4628
  //#endregion
4277
- //#region ../../node_modules/.pnpm/@effected+lockfiles@0.1.5_@effected+jsonc@0.4.0_effect@4.0.0-beta.99__@effected+npm@0.2_b1d671782d9bef489a2d22b7bd2ef126/node_modules/@effected/lockfiles/internal/shared.js
4629
+ //#region ../../node_modules/.pnpm/@effected+lockfiles@0.1.9_@effected+jsonc@0.5.0_effect@4.0.0-beta.99__@effected+npm@0.3_d470055e7ca4b6a23d413cae592e2835/node_modules/@effected/lockfiles/internal/shared.js
4278
4630
  /**
4279
4631
  * The four dependency sections of a manifest, in a stable order — the shared
4280
4632
  * dependency-sections table (v3's `DEP_SECTIONS`). Each entry is both the
@@ -4400,7 +4752,7 @@ const extractWorkspaceDeps = (workspaces, workspaceNames) => {
4400
4752
  return deps;
4401
4753
  };
4402
4754
  //#endregion
4403
- //#region ../../node_modules/.pnpm/@effected+jsonc@0.4.0_effect@4.0.0-beta.99/node_modules/@effected/jsonc/JsoncNode.js
4755
+ //#region ../../node_modules/.pnpm/@effected+jsonc@0.5.0_effect@4.0.0-beta.99/node_modules/@effected/jsonc/JsoncNode.js
4404
4756
  /**
4405
4757
  * Discriminator values for JSONC AST node types: the JSON value types
4406
4758
  * (`string`/`number`/`boolean`/`null`), the structural types
@@ -4575,7 +4927,7 @@ function evaluateNode(node, depth) {
4575
4927
  }
4576
4928
  }
4577
4929
  //#endregion
4578
- //#region ../../node_modules/.pnpm/@effected+jsonc@0.4.0_effect@4.0.0-beta.99/node_modules/@effected/jsonc/internal/scanner.js
4930
+ //#region ../../node_modules/.pnpm/@effected+jsonc@0.5.0_effect@4.0.0-beta.99/node_modules/@effected/jsonc/internal/scanner.js
4579
4931
  const isWhitespace = (ch) => ch === 32 || ch === 9 || ch === 11 || ch === 12 || ch === 160 || ch === 65279;
4580
4932
  const isLineBreak$1 = (ch) => ch === 10 || ch === 13 || ch === 8232 || ch === 8233;
4581
4933
  const isDigit$1 = (ch) => ch >= 48 && ch <= 57;
@@ -4871,7 +5223,7 @@ const createScanner$2 = (text, ignoreTrivia = false) => {
4871
5223
  };
4872
5224
  };
4873
5225
  //#endregion
4874
- //#region ../../node_modules/.pnpm/@effected+jsonc@0.4.0_effect@4.0.0-beta.99/node_modules/@effected/jsonc/internal/skip.js
5226
+ //#region ../../node_modules/.pnpm/@effected+jsonc@0.5.0_effect@4.0.0-beta.99/node_modules/@effected/jsonc/internal/skip.js
4875
5227
  /**
4876
5228
  * Iteratively consume the value beginning at the cursor's current token and
4877
5229
  * return its tight end offset (excludes trailing whitespace/comments).
@@ -4901,7 +5253,7 @@ const skipBalancedValue = (cursor) => {
4901
5253
  return end;
4902
5254
  };
4903
5255
  //#endregion
4904
- //#region ../../node_modules/.pnpm/@effected+jsonc@0.4.0_effect@4.0.0-beta.99/node_modules/@effected/jsonc/internal/parser.js
5256
+ //#region ../../node_modules/.pnpm/@effected+jsonc@0.5.0_effect@4.0.0-beta.99/node_modules/@effected/jsonc/internal/parser.js
4905
5257
  /**
4906
5258
  * The public parse-error code vocabulary. The facade builds its `@public`
4907
5259
  * `JsoncParseErrorCode` schema from this array; the parser produces these codes
@@ -5314,7 +5666,7 @@ const parseTree$2 = (text, flags) => {
5314
5666
  };
5315
5667
  };
5316
5668
  //#endregion
5317
- //#region ../../node_modules/.pnpm/@effected+jsonc@0.4.0_effect@4.0.0-beta.99/node_modules/@effected/jsonc/Jsonc.js
5669
+ //#region ../../node_modules/.pnpm/@effected+jsonc@0.5.0_effect@4.0.0-beta.99/node_modules/@effected/jsonc/Jsonc.js
5318
5670
  /**
5319
5671
  * The single public parse-error code vocabulary, appearing as the `code` field
5320
5672
  * of {@link JsoncParseErrorDetail}.
@@ -5539,9 +5891,57 @@ var Jsonc = class Jsonc {
5539
5891
  */
5540
5892
  static parse = effect.Effect.fn("Jsonc.parse")((text, options) => effect.Effect.fromResult(Jsonc.parseResult(text, options)));
5541
5893
  /**
5894
+ * Parse JSONC into an immutable {@link JsoncNode} AST, synchronously,
5895
+ * returning a `Result` instead of an `Effect`. `Option.none()` for empty
5896
+ * input (with `allowEmptyContent`); the aggregate {@link JsoncParseError}
5897
+ * for malformed input. Pure — parsing is fundamentally synchronous, so
5898
+ * non-Effect consumers (a plain config loader, a build script) can call
5899
+ * this directly instead of wrapping
5900
+ * `Effect.runSync(Effect.result(Jsonc.parseTree(text)))`.
5901
+ *
5902
+ * @remarks
5903
+ * {@link Jsonc.parseTree} is defined in terms of this function; the two
5904
+ * never diverge. Reach for the `Effect` variant inside Effect code — it
5905
+ * carries the `Jsonc.parseTree` tracing span — and for this one at
5906
+ * synchronous boundaries.
5907
+ *
5908
+ * @example
5909
+ * ```ts
5910
+ * import { Jsonc } from "@effected/jsonc";
5911
+ * import { Option, Result } from "effect";
5912
+ *
5913
+ * const ok = Jsonc.parseTreeResult('{ "port": 3000 // dev\n }');
5914
+ * if (Result.isSuccess(ok) && Option.isSome(ok.success)) {
5915
+ * console.log(ok.success.value.type); // => "object"
5916
+ * }
5917
+ *
5918
+ * const bad = Jsonc.parseTreeResult("{ bad }");
5919
+ * if (Result.isFailure(bad)) {
5920
+ * console.log(bad.failure._tag); // => "JsoncParseError"
5921
+ * }
5922
+ * ```
5923
+ *
5924
+ * @param text - The JSONC source to parse.
5925
+ * @param options - Optional {@link JsoncParseOptions}; defaults apply for
5926
+ * omitted fields.
5927
+ * @returns A `Result` succeeding with `Option.some(root)` (or
5928
+ * `Option.none()` for empty input), or failing with the aggregate
5929
+ * {@link JsoncParseError}.
5930
+ */
5931
+ static parseTreeResult(text, options) {
5932
+ const { root, errors } = parseTree$2(text, toFlags(options));
5933
+ if (errors.length > 0) return effect.Result.fail(new JsoncParseError({
5934
+ errors: toDetails(text, errors),
5935
+ input: text
5936
+ }));
5937
+ return effect.Result.succeed(root !== void 0 ? effect.Option.some(root) : effect.Option.none());
5938
+ }
5939
+ /**
5542
5940
  * Parse JSONC into an immutable {@link JsoncNode} AST. `Option.none()` for
5543
5941
  * empty input (with `allowEmptyContent`); the aggregate
5544
- * {@link JsoncParseError} for malformed input.
5942
+ * {@link JsoncParseError} for malformed input. Defined in terms of
5943
+ * {@link Jsonc.parseTreeResult} — synchronous callers can use that variant
5944
+ * directly.
5545
5945
  *
5546
5946
  * @param text - The JSONC source to parse.
5547
5947
  * @param options - Optional {@link JsoncParseOptions}; defaults apply for
@@ -5550,14 +5950,7 @@ var Jsonc = class Jsonc {
5550
5950
  * `Option.none()` for empty input), or fails with the aggregate
5551
5951
  * {@link JsoncParseError}.
5552
5952
  */
5553
- static parseTree = effect.Effect.fn("Jsonc.parseTree")(function* (text, options) {
5554
- const { root, errors } = parseTree$2(text, toFlags(options));
5555
- if (errors.length > 0) return yield* new JsoncParseError({
5556
- errors: toDetails(text, errors),
5557
- input: text
5558
- });
5559
- return root !== void 0 ? effect.Option.some(root) : effect.Option.none();
5560
- });
5953
+ static parseTree = effect.Effect.fn("Jsonc.parseTree")((text, options) => effect.Effect.fromResult(Jsonc.parseTreeResult(text, options)));
5561
5954
  /**
5562
5955
  * Stringify a plain JavaScript value as JSON text, synchronously, returning
5563
5956
  * a `Result` instead of an `Effect`. With no options the output is
@@ -5877,7 +6270,7 @@ var JsoncEdit = class extends effect.Schema.Class("JsoncEdit")({
5877
6270
  }
5878
6271
  };
5879
6272
  //#endregion
5880
- //#region ../../node_modules/.pnpm/@effected+jsonc@0.4.0_effect@4.0.0-beta.99/node_modules/@effected/jsonc/internal/navigate.js
6273
+ //#region ../../node_modules/.pnpm/@effected+jsonc@0.5.0_effect@4.0.0-beta.99/node_modules/@effected/jsonc/internal/navigate.js
5881
6274
  /**
5882
6275
  * Resolve `path` against `text`, returning where the target is (or where it
5883
6276
  * would be inserted). `path` must be non-empty — the whole-document case is
@@ -6004,7 +6397,7 @@ function navigate(text, path) {
6004
6397
  return { _tag: "NoOp" };
6005
6398
  }
6006
6399
  //#endregion
6007
- //#region ../../node_modules/.pnpm/@effected+jsonc@0.4.0_effect@4.0.0-beta.99/node_modules/@effected/jsonc/JsoncModifier.js
6400
+ //#region ../../node_modules/.pnpm/@effected+jsonc@0.5.0_effect@4.0.0-beta.99/node_modules/@effected/jsonc/JsoncModifier.js
6008
6401
  /**
6009
6402
  * Raised when `JsoncModifier.modify` cannot navigate the requested path: the
6010
6403
  * value at `depth` is not the container kind (`expected`) the next path segment
@@ -6132,7 +6525,7 @@ var JsoncModifier = class {
6132
6525
  });
6133
6526
  };
6134
6527
  //#endregion
6135
- //#region ../../node_modules/.pnpm/@effected+lockfiles@0.1.5_@effected+jsonc@0.4.0_effect@4.0.0-beta.99__@effected+npm@0.2_b1d671782d9bef489a2d22b7bd2ef126/node_modules/@effected/lockfiles/internal/bun.js
6528
+ //#region ../../node_modules/.pnpm/@effected+lockfiles@0.1.9_@effected+jsonc@0.5.0_effect@4.0.0-beta.99__@effected+npm@0.3_d470055e7ca4b6a23d413cae592e2835/node_modules/@effected/lockfiles/internal/bun.js
6136
6529
  const DepRecord$2 = effect.Schema.optionalKey(effect.Schema.Record(effect.Schema.String, effect.Schema.String));
6137
6530
  const BunWorkspaceEntry = effect.Schema.Struct({
6138
6531
  name: effect.Schema.optionalKey(effect.Schema.String),
@@ -6225,7 +6618,7 @@ const toFields$3 = (raw) => effect.Effect.gen(function* () {
6225
6618
  };
6226
6619
  });
6227
6620
  //#endregion
6228
- //#region ../../node_modules/.pnpm/@effected+lockfiles@0.1.5_@effected+jsonc@0.4.0_effect@4.0.0-beta.99__@effected+npm@0.2_b1d671782d9bef489a2d22b7bd2ef126/node_modules/@effected/lockfiles/internal/npm.js
6621
+ //#region ../../node_modules/.pnpm/@effected+lockfiles@0.1.9_@effected+jsonc@0.5.0_effect@4.0.0-beta.99__@effected+npm@0.3_d470055e7ca4b6a23d413cae592e2835/node_modules/@effected/lockfiles/internal/npm.js
6229
6622
  const DepRecord$1 = effect.Schema.optionalKey(effect.Schema.Record(effect.Schema.String, effect.Schema.String));
6230
6623
  const NpmPackageEntry = effect.Schema.Struct({
6231
6624
  name: effect.Schema.optionalKey(effect.Schema.String),
@@ -6323,7 +6716,7 @@ const toFields$2 = (raw) => effect.Effect.gen(function* () {
6323
6716
  };
6324
6717
  });
6325
6718
  //#endregion
6326
- //#region ../../node_modules/.pnpm/@effected+yaml@0.4.0_effect@4.0.0-beta.99/node_modules/@effected/yaml/YamlNode.js
6719
+ //#region ../../node_modules/.pnpm/@effected+yaml@0.5.0_effect@4.0.0-beta.99/node_modules/@effected/yaml/YamlNode.js
6327
6720
  /**
6328
6721
  * YAML scalar presentation styles.
6329
6722
  *
@@ -6343,6 +6736,16 @@ const ScalarStyle = effect.Schema.Literals([
6343
6736
  */
6344
6737
  const CollectionStyle = effect.Schema.Literals(["block", "flow"]);
6345
6738
  /**
6739
+ * Quote characters available to the stringifier's plain-scalar fallback: the
6740
+ * style a `plain`-styled scalar is rendered in when it turns out to require
6741
+ * quoting. Referenced by the `quoteStyle` field of `YamlStringifyOptions`;
6742
+ * unlike `ScalarStyle` it is a stringify-option vocabulary, never a property
6743
+ * of a composed node.
6744
+ *
6745
+ * @public
6746
+ */
6747
+ const QuoteStyle = effect.Schema.Literals(["single", "double"]);
6748
+ /**
6346
6749
  * Block-scalar chomping indicators (`-` strip, default clip, `+` keep).
6347
6750
  * Referenced by the {@link YamlScalar} `chomp` field schema.
6348
6751
  *
@@ -6715,7 +7118,7 @@ function nodeToValue(node, anchors, budget, counting = false) {
6715
7118
  return null;
6716
7119
  }
6717
7120
  //#endregion
6718
- //#region ../../node_modules/.pnpm/@effected+yaml@0.4.0_effect@4.0.0-beta.99/node_modules/@effected/yaml/internal/diagnostics.js
7121
+ //#region ../../node_modules/.pnpm/@effected+yaml@0.5.0_effect@4.0.0-beta.99/node_modules/@effected/yaml/internal/diagnostics.js
6719
7122
  /** Error codes emitted by the lexer stage. */
6720
7123
  const YAML_LEX_ERROR_CODES = [
6721
7124
  "UnexpectedCharacter",
@@ -6793,7 +7196,7 @@ function isFatalCode(code) {
6793
7196
  return FATAL_CODES.has(code);
6794
7197
  }
6795
7198
  //#endregion
6796
- //#region ../../node_modules/.pnpm/@effected+yaml@0.4.0_effect@4.0.0-beta.99/node_modules/@effected/yaml/YamlDiagnostic.js
7199
+ //#region ../../node_modules/.pnpm/@effected+yaml@0.5.0_effect@4.0.0-beta.99/node_modules/@effected/yaml/YamlDiagnostic.js
6797
7200
  /**
6798
7201
  * Error codes emitted by the lexer stage.
6799
7202
  *
@@ -6914,7 +7317,7 @@ function lineChar(text, offset) {
6914
7317
  };
6915
7318
  }
6916
7319
  //#endregion
6917
- //#region ../../node_modules/.pnpm/@effected+yaml@0.4.0_effect@4.0.0-beta.99/node_modules/@effected/yaml/internal/composer/anchors.js
7320
+ //#region ../../node_modules/.pnpm/@effected+yaml@0.5.0_effect@4.0.0-beta.99/node_modules/@effected/yaml/internal/composer/anchors.js
6918
7321
  /**
6919
7322
  * Check if a pending anchor is being applied to an alias node (invalid in YAML 1.2 §3.2.2).
6920
7323
  * Aliases represent references to existing anchored nodes and cannot have their own anchors.
@@ -7007,7 +7410,7 @@ function collectAnchors(node, anchors) {
7007
7410
  }
7008
7411
  }
7009
7412
  //#endregion
7010
- //#region ../../node_modules/.pnpm/@effected+yaml@0.4.0_effect@4.0.0-beta.99/node_modules/@effected/yaml/internal/lexer.js
7413
+ //#region ../../node_modules/.pnpm/@effected+yaml@0.5.0_effect@4.0.0-beta.99/node_modules/@effected/yaml/internal/lexer.js
7011
7414
  /**
7012
7415
  * Create a new YAML scanner for the given source text.
7013
7416
  *
@@ -7964,7 +8367,7 @@ function lexAll(text) {
7964
8367
  return tokens;
7965
8368
  }
7966
8369
  //#endregion
7967
- //#region ../../node_modules/.pnpm/@effected+yaml@0.4.0_effect@4.0.0-beta.99/node_modules/@effected/yaml/internal/cst-parser.js
8370
+ //#region ../../node_modules/.pnpm/@effected+yaml@0.5.0_effect@4.0.0-beta.99/node_modules/@effected/yaml/internal/cst-parser.js
7968
8371
  /**
7969
8372
  * Hardening: cap CST nesting so hostile inputs cannot overflow the stack
7970
8373
  * while the tree is being BUILT. Set slightly above the composer's
@@ -8676,7 +9079,7 @@ function parseCSTAll(text) {
8676
9079
  return parseDocuments(lexAll(text), text);
8677
9080
  }
8678
9081
  //#endregion
8679
- //#region ../../node_modules/.pnpm/@effected+yaml@0.4.0_effect@4.0.0-beta.99/node_modules/@effected/yaml/internal/composer/state.js
9082
+ //#region ../../node_modules/.pnpm/@effected+yaml@0.5.0_effect@4.0.0-beta.99/node_modules/@effected/yaml/internal/composer/state.js
8680
9083
  let lineStartsText;
8681
9084
  let lineStartsCache = [];
8682
9085
  function getLineStarts(text) {
@@ -8782,7 +9185,7 @@ function exitNesting(state) {
8782
9185
  state.depth--;
8783
9186
  }
8784
9187
  //#endregion
8785
- //#region ../../node_modules/.pnpm/@effected+yaml@0.4.0_effect@4.0.0-beta.99/node_modules/@effected/yaml/internal/composer/tags.js
9188
+ //#region ../../node_modules/.pnpm/@effected+yaml@0.5.0_effect@4.0.0-beta.99/node_modules/@effected/yaml/internal/composer/tags.js
8786
9189
  /**
8787
9190
  * Resolve a tag shorthand using the document's %TAG directives.
8788
9191
  * For example, with `%TAG !! tag:example.com,2000:app/`, the tag `!!int`
@@ -8868,7 +9271,7 @@ function validateTagHandlesInDocument(docCst, state) {
8868
9271
  }
8869
9272
  }
8870
9273
  //#endregion
8871
- //#region ../../node_modules/.pnpm/@effected+yaml@0.4.0_effect@4.0.0-beta.99/node_modules/@effected/yaml/internal/composer/scalars.js
9274
+ //#region ../../node_modules/.pnpm/@effected+yaml@0.5.0_effect@4.0.0-beta.99/node_modules/@effected/yaml/internal/composer/scalars.js
8872
9275
  const NULL_RE$1 = /^(?:null|Null|NULL|~)$/;
8873
9276
  const TRUE_RE$1 = /^(?:true|True|TRUE)$/;
8874
9277
  const FALSE_RE$1 = /^(?:false|False|FALSE)$/;
@@ -9746,7 +10149,7 @@ function shouldPreserveRaw(rawValue, value) {
9746
10149
  return false;
9747
10150
  }
9748
10151
  //#endregion
9749
- //#region ../../node_modules/.pnpm/@effected+yaml@0.4.0_effect@4.0.0-beta.99/node_modules/@effected/yaml/internal/composer/block.js
10152
+ //#region ../../node_modules/.pnpm/@effected+yaml@0.5.0_effect@4.0.0-beta.99/node_modules/@effected/yaml/internal/composer/block.js
9750
10153
  /**
9751
10154
  * Compose a block map from its CST children, with an optional external first key.
9752
10155
  *
@@ -10894,7 +11297,7 @@ function composeFlatBlockMap(children, startIdx, parentCst, state, externalFirst
10894
11297
  return map;
10895
11298
  }
10896
11299
  //#endregion
10897
- //#region ../../node_modules/.pnpm/@effected+yaml@0.4.0_effect@4.0.0-beta.99/node_modules/@effected/yaml/internal/composer/flow.js
11300
+ //#region ../../node_modules/.pnpm/@effected+yaml@0.5.0_effect@4.0.0-beta.99/node_modules/@effected/yaml/internal/composer/flow.js
10898
11301
  /**
10899
11302
  * Validate that flow collection entries are separated by commas.
10900
11303
  *
@@ -11286,7 +11689,7 @@ function composeFlowSeqInner(cst, state, meta, parentBlockColumn) {
11286
11689
  return seq;
11287
11690
  }
11288
11691
  //#endregion
11289
- //#region ../../node_modules/.pnpm/@effected+yaml@0.4.0_effect@4.0.0-beta.99/node_modules/@effected/yaml/internal/composer/document.js
11692
+ //#region ../../node_modules/.pnpm/@effected+yaml@0.5.0_effect@4.0.0-beta.99/node_modules/@effected/yaml/internal/composer/document.js
11290
11693
  /** The flow-composer dispatch wired into every state this module creates. */
11291
11694
  const FLOW = {
11292
11695
  composeFlowMap,
@@ -11952,7 +12355,7 @@ function composeAllDocuments(text, options) {
11952
12355
  };
11953
12356
  }
11954
12357
  //#endregion
11955
- //#region ../../node_modules/.pnpm/@effected+yaml@0.4.0_effect@4.0.0-beta.99/node_modules/@effected/yaml/internal/fold.js
12358
+ //#region ../../node_modules/.pnpm/@effected+yaml@0.5.0_effect@4.0.0-beta.99/node_modules/@effected/yaml/internal/fold.js
11956
12359
  /**
11957
12360
  * Column-based line folding for a single logical scalar line (YAML 1.2 flow
11958
12361
  * folding, §7.3 / §8.2.1). Breaks the content at "safe" single-space
@@ -12188,7 +12591,7 @@ function renderBlockFolded(s, indent) {
12188
12591
  return `>${indentIndicator}${chomp}\n${outputLines.join("\n")}`;
12189
12592
  }
12190
12593
  //#endregion
12191
- //#region ../../node_modules/.pnpm/@effected+yaml@0.4.0_effect@4.0.0-beta.99/node_modules/@effected/yaml/internal/stringifier.js
12594
+ //#region ../../node_modules/.pnpm/@effected+yaml@0.5.0_effect@4.0.0-beta.99/node_modules/@effected/yaml/internal/stringifier.js
12192
12595
  /**
12193
12596
  * Thrown by the stringifier on its failure paths (circular references). The
12194
12597
  * facade catches this and materializes the public stringify error.
@@ -12294,7 +12697,10 @@ function requiresQuoting(s, ignoreType = false) {
12294
12697
  if (s.includes(" #") || s.includes(" #")) return true;
12295
12698
  const last = s[s.length - 1];
12296
12699
  if (last === " " || last === " ") return true;
12297
- for (let i = 0; i < s.length; i++) if (isControlChar(s.charCodeAt(i))) return true;
12700
+ for (let i = 0; i < s.length; i++) {
12701
+ const code = s.charCodeAt(i);
12702
+ if (code === 9 || code === 13 || isControlChar(code)) return true;
12703
+ }
12298
12704
  return false;
12299
12705
  }
12300
12706
  /**
@@ -12351,11 +12757,13 @@ function renderSingleQuoted(s) {
12351
12757
  *
12352
12758
  * Multi-line strings are routed to block styles regardless of the requested
12353
12759
  * style (except double-quoted). For single-line strings, plain style delegates
12354
- * to {@link requiresQuoting} and falls back to double-quoted when the value
12355
- * would be ambiguous. Block literal and block folded styles are always
12356
- * accepted for single-line strings even though the output is unusual.
12760
+ * to {@link requiresQuoting} and falls back to `quoteStyle` (single-quoted by
12761
+ * default, double-quoted when the caller asked for it) or to double-quoted
12762
+ * regardless when the value needs YAML escapes single quotes cannot express.
12763
+ * Block literal and block folded styles are always accepted for single-line
12764
+ * strings even though the output is unusual.
12357
12765
  */
12358
- function renderString(s, style, indent, ignoreType = false, canonical = false, explicitChomp, parentPosition) {
12766
+ function renderString(s, style, indent, ignoreType = false, canonical = false, explicitChomp, parentPosition, quoteStyle = "single") {
12359
12767
  if (s.includes("\n")) {
12360
12768
  let hasControl = false;
12361
12769
  for (let i = 0; i < s.length; i++) {
@@ -12389,7 +12797,7 @@ function renderString(s, style, indent, ignoreType = false, canonical = false, e
12389
12797
  if (requiresQuoting(s, ignoreType)) {
12390
12798
  if (s.includes(" ") || s.includes("\r")) return renderDoubleQuoted(s, canonical);
12391
12799
  for (let i = 0; i < s.length; i++) if (isControlChar(s.charCodeAt(i))) return renderDoubleQuoted(s, canonical);
12392
- return renderSingleQuoted(s);
12800
+ return quoteStyle === "double" ? renderDoubleQuoted(s, canonical) : renderSingleQuoted(s);
12393
12801
  }
12394
12802
  return s;
12395
12803
  case "single-quoted": return renderSingleQuoted(s);
@@ -12429,6 +12837,7 @@ function createContext(options) {
12429
12837
  defaultCollectionStyle: options?.defaultCollectionStyle ?? "block",
12430
12838
  sortKeys: options?.sortKeys ?? false,
12431
12839
  indentSequences: options?.indentSequences ?? false,
12840
+ quoteStyle: options?.quoteStyle ?? "single",
12432
12841
  forceDefaultStyles: options?.forceDefaultStyles ?? false,
12433
12842
  seen: /* @__PURE__ */ new Set()
12434
12843
  };
@@ -12448,7 +12857,7 @@ function stringifyLines(value, ctx, depth, allowFold = true) {
12448
12857
  if (typeof value === "bigint") return [value.toString()];
12449
12858
  if (typeof value === "string") {
12450
12859
  const indentStr = " ".repeat(ctx.indent);
12451
- const rendered = renderString(value, ctx.defaultScalarStyle, indentStr, false, ctx.forceDefaultStyles);
12860
+ const rendered = renderString(value, ctx.defaultScalarStyle, indentStr, false, ctx.forceDefaultStyles, void 0, void 0, ctx.quoteStyle);
12452
12861
  return (allowFold && ctx.lineWidth > 0 ? foldRenderedScalar(rendered, indentStr, ctx.lineWidth) : rendered).split("\n");
12453
12862
  }
12454
12863
  if (Array.isArray(value)) {
@@ -12513,10 +12922,11 @@ function stringifyObjectLines(obj, ctx, depth) {
12513
12922
  const keys = Object.keys(obj);
12514
12923
  if (keys.length === 0) return ["{}"];
12515
12924
  if (ctx.sortKeys) keys.sort();
12925
+ const renderPlainKey = (k) => renderString(k, "plain", "", false, false, void 0, void 0, ctx.quoteStyle);
12516
12926
  if (ctx.defaultCollectionStyle === "flow") return [`{${keys.map((k) => {
12517
- return `${renderString(k, "plain", "")}: ${stringifyLines(obj[k], ctx, depth + 1, false).join(" ")}`;
12927
+ return `${renderPlainKey(k)}: ${stringifyLines(obj[k], ctx, depth + 1, false).join(" ")}`;
12518
12928
  }).join(", ")}}`];
12519
- const renderKey = (k) => k.includes("\n") ? renderDoubleQuoted(k, ctx.forceDefaultStyles) : renderString(k, "plain", "");
12929
+ const renderKey = (k) => k.includes("\n") ? renderDoubleQuoted(k, ctx.forceDefaultStyles) : renderPlainKey(k);
12520
12930
  const pad = " ".repeat(ctx.indent);
12521
12931
  const lines = [];
12522
12932
  for (const k of keys) {
@@ -12564,7 +12974,7 @@ effect.Schema.Class("YamlStringifyOptions")({
12564
12974
  * (`>`) scalars at approximately that column, never block-literal (`|`).
12565
12975
  *
12566
12976
  * Takes effect only through {@link Yaml.stringify} and
12567
- * {@link Yaml.stringifySync} — the two entry points that accept these
12977
+ * {@link Yaml.stringifyResult} — the two entry points that accept these
12568
12978
  * options on the value path. The schema factories ({@link Yaml.fromString},
12569
12979
  * {@link Yaml.schema}, {@link Yaml.YamlFromString}) encode with default
12570
12980
  * stringify options (`lineWidth` `0`), so their output never folds. The
@@ -12577,6 +12987,17 @@ effect.Schema.Class("YamlStringifyOptions")({
12577
12987
  defaultCollectionStyle: effect.Schema.optionalKey(CollectionStyle),
12578
12988
  sortKeys: effect.Schema.optionalKey(effect.Schema.Boolean),
12579
12989
  indentSequences: effect.Schema.optionalKey(effect.Schema.Boolean),
12990
+ /**
12991
+ * Quote style used when a `plain`-styled scalar requires quoting. Default
12992
+ * `"single"` — the released byte-compatible behavior. `"double"` renders
12993
+ * the same scalars double-quoted instead, matching the `yaml` npm
12994
+ * package's `singleQuote: false` output.
12995
+ *
12996
+ * Affects only the plain fallback: scalars that need no quoting stay
12997
+ * plain, and an explicit `defaultScalarStyle` of `"single-quoted"` or
12998
+ * `"double-quoted"` is unaffected.
12999
+ */
13000
+ quoteStyle: effect.Schema.optionalKey(QuoteStyle),
12580
13001
  finalNewline: effect.Schema.optionalKey(effect.Schema.Boolean),
12581
13002
  forceDefaultStyles: effect.Schema.optionalKey(effect.Schema.Boolean)
12582
13003
  });
@@ -12626,6 +13047,7 @@ const toStringifyInput = (options) => options === void 0 ? {} : {
12626
13047
  defaultCollectionStyle: options.defaultCollectionStyle,
12627
13048
  sortKeys: options.sortKeys,
12628
13049
  indentSequences: options.indentSequences,
13050
+ quoteStyle: options.quoteStyle,
12629
13051
  finalNewline: options.finalNewline,
12630
13052
  forceDefaultStyles: options.forceDefaultStyles
12631
13053
  };
@@ -12683,7 +13105,7 @@ const stringifyDefectToError = (defect, value) => {
12683
13105
  * mode (fatal diagnostics, duplicate keys, a "billion laughs" blow-up) yields
12684
13106
  * a `Failure` carrying a typed {@link YamlParseError} — never a throw.
12685
13107
  */
12686
- const parseSyncImpl = (text, options) => {
13108
+ const parseResultImpl = (text, options) => {
12687
13109
  const doc = composeFirstDocument(text, toParseInput(options));
12688
13110
  const failures = failureRecords(doc, options?.uniqueKeys ?? true);
12689
13111
  if (failures.length > 0) return effect.Result.fail(new YamlParseError({
@@ -12704,7 +13126,7 @@ const parseSyncImpl = (text, options) => {
12704
13126
  * recursion budget yields a `Failure` carrying a typed {@link YamlStringifyError},
12705
13127
  * never a thrown defect.
12706
13128
  */
12707
- const stringifySyncImpl = (value, options) => {
13129
+ const stringifyResultImpl = (value, options) => {
12708
13130
  try {
12709
13131
  return effect.Result.succeed(stringifyValue(value, toStringifyInput(options)));
12710
13132
  } catch (defect) {
@@ -12781,17 +13203,11 @@ var Yaml = class Yaml {
12781
13203
  * resolved size grows exponentially relative to `maxAliasCount`) also
12782
13204
  * fails through {@link YamlParseError} with an `AliasCountExceeded`
12783
13205
  * diagnostic, never as an unhandled defect.
13206
+ *
13207
+ * Defined in terms of {@link Yaml.parseResult} — synchronous callers can
13208
+ * use that variant directly.
12784
13209
  */
12785
- static parse = effect.Effect.fn("Yaml.parse")(function* (text, options) {
12786
- const doc = composeFirstDocument(text, toParseInput(options));
12787
- const failures = failureRecords(doc, options?.uniqueKeys ?? true);
12788
- if (failures.length > 0) return yield* new YamlParseError({
12789
- diagnostics: toDiagnostics(text, failures),
12790
- input: text
12791
- });
12792
- const anchors = /* @__PURE__ */ new Map();
12793
- return yield* extractDocumentValue(doc.contents, anchors, options?.maxAliasCount ?? 100, text);
12794
- });
13210
+ static parse = effect.Effect.fn("Yaml.parse")((text, options) => effect.Effect.fromResult(Yaml.parseResult(text, options)));
12795
13211
  /**
12796
13212
  * Parse a multi-document YAML stream into an array of plain JavaScript
12797
13213
  * values (one per document, in order). Any fatal diagnostic in any
@@ -12824,6 +13240,15 @@ var Yaml = class Yaml {
12824
13240
  * or on a value nested deeper than the stringifier's recursion budget
12825
13241
  * (`NestingDepthExceeded`) — both surface through the typed error channel
12826
13242
  * rather than as an unhandled stack-overflow defect.
13243
+ *
13244
+ * @remarks
13245
+ * A `"<<"` object key is emitted **quoted** (`'<<': …`). This is the
13246
+ * opposite of the document path ({@link YamlFormat.format} and
13247
+ * `YamlDocument#stringify`), which leaves a parsed plain `<<` key unquoted
13248
+ * so it keeps its merge-key meaning, and the asymmetry is deliberate: a
13249
+ * `"<<"` key on a plain JavaScript object is an ordinary string key that
13250
+ * never carried merge semantics, so emitting it plain would silently turn
13251
+ * ordinary data into a merge directive.
12827
13252
  */
12828
13253
  static stringify = effect.Effect.fn("Yaml.stringify")(function* (value, options) {
12829
13254
  return yield* stringifyOrFail(value, options);
@@ -12831,8 +13256,14 @@ var Yaml = class Yaml {
12831
13256
  /**
12832
13257
  * Synchronous single-document parse, returning a `Result` instead of
12833
13258
  * an `Effect`. A pure escape hatch for config-time callers that cannot
12834
- * `await` an Effect (a `vitest.config.ts` is the motivating case): it runs
12835
- * the same engine as {@link Yaml.parse} inline.
13259
+ * `await` an Effect (a `vitest.config.ts` is the motivating case).
13260
+ *
13261
+ * @remarks
13262
+ * This is the package's single parse path. {@link Yaml.parse} is defined in
13263
+ * terms of it (`Effect.fromResult` behind the named span), so the two
13264
+ * variants cannot diverge. Reach for the `Effect` variant inside Effect
13265
+ * code — it carries the `Yaml.parse` tracing span — and for this one at
13266
+ * synchronous boundaries.
12836
13267
  *
12837
13268
  * Preserves the package contract — malformed and adversarial input fails
12838
13269
  * typed, never as a defect. Fatal diagnostics, duplicate keys and a
@@ -12844,7 +13275,7 @@ var Yaml = class Yaml {
12844
13275
  * import { Yaml } from "@effected/yaml";
12845
13276
  * import { Result } from "effect";
12846
13277
  *
12847
- * const result = Yaml.parseSync("name: Alice\nage: 30");
13278
+ * const result = Yaml.parseResult("name: Alice\nage: 30");
12848
13279
  * if (Result.isSuccess(result)) {
12849
13280
  * result.success; // { name: "Alice", age: 30 }
12850
13281
  * } else {
@@ -12854,8 +13285,8 @@ var Yaml = class Yaml {
12854
13285
  *
12855
13286
  * @public
12856
13287
  */
12857
- static parseSync(text, options) {
12858
- return parseSyncImpl(text, options);
13288
+ static parseResult(text, options) {
13289
+ return parseResultImpl(text, options);
12859
13290
  }
12860
13291
  /**
12861
13292
  * Synchronous stringify, returning a `Result` instead of an `Effect`.
@@ -12872,7 +13303,7 @@ var Yaml = class Yaml {
12872
13303
  * import { Yaml } from "@effected/yaml";
12873
13304
  * import { Result } from "effect";
12874
13305
  *
12875
- * const result = Yaml.stringifySync({ name: "Alice" });
13306
+ * const result = Yaml.stringifyResult({ name: "Alice" });
12876
13307
  * if (Result.isFailure(result)) {
12877
13308
  * result.failure; // YamlStringifyError
12878
13309
  * } else {
@@ -12882,8 +13313,8 @@ var Yaml = class Yaml {
12882
13313
  *
12883
13314
  * @public
12884
13315
  */
12885
- static stringifySync(value, options) {
12886
- return stringifySyncImpl(value, options);
13316
+ static stringifyResult(value, options) {
13317
+ return stringifyResultImpl(value, options);
12887
13318
  }
12888
13319
  /**
12889
13320
  * Strip comments from YAML text. Without `replaceCh`, comment characters
@@ -13109,7 +13540,7 @@ function deepEqualValues(a, b) {
13109
13540
  return false;
13110
13541
  }
13111
13542
  //#endregion
13112
- //#region ../../node_modules/.pnpm/@effected+lockfiles@0.1.5_@effected+jsonc@0.4.0_effect@4.0.0-beta.99__@effected+npm@0.2_b1d671782d9bef489a2d22b7bd2ef126/node_modules/@effected/lockfiles/internal/documents.js
13543
+ //#region ../../node_modules/.pnpm/@effected+lockfiles@0.1.9_@effected+jsonc@0.5.0_effect@4.0.0-beta.99__@effected+npm@0.3_d470055e7ca4b6a23d413cae592e2835/node_modules/@effected/lockfiles/internal/documents.js
13113
13544
  /**
13114
13545
  * An empty YAML document composes to `null` (`Yaml.parseAll("")` is `[null]`,
13115
13546
  * and the trailing document of an env-only `pnpm-lock.yaml` is `null` too).
@@ -13179,7 +13610,7 @@ const selectSoleDocument = (content) => effect.Effect.gen(function* () {
13179
13610
  };
13180
13611
  });
13181
13612
  //#endregion
13182
- //#region ../../node_modules/.pnpm/@effected+lockfiles@0.1.5_@effected+jsonc@0.4.0_effect@4.0.0-beta.99__@effected+npm@0.2_b1d671782d9bef489a2d22b7bd2ef126/node_modules/@effected/lockfiles/internal/pnpm.js
13613
+ //#region ../../node_modules/.pnpm/@effected+lockfiles@0.1.9_@effected+jsonc@0.5.0_effect@4.0.0-beta.99__@effected+npm@0.3_d470055e7ca4b6a23d413cae592e2835/node_modules/@effected/lockfiles/internal/pnpm.js
13183
13614
  const PnpmImporterDeps = effect.Schema.optionalKey(effect.Schema.Record(effect.Schema.String, effect.Schema.Struct({
13184
13615
  specifier: effect.Schema.String,
13185
13616
  version: effect.Schema.String
@@ -13305,7 +13736,7 @@ const toFields$1 = (raw) => effect.Effect.gen(function* () {
13305
13736
  };
13306
13737
  });
13307
13738
  //#endregion
13308
- //#region ../../node_modules/.pnpm/@effected+lockfiles@0.1.5_@effected+jsonc@0.4.0_effect@4.0.0-beta.99__@effected+npm@0.2_b1d671782d9bef489a2d22b7bd2ef126/node_modules/@effected/lockfiles/internal/yarn.js
13739
+ //#region ../../node_modules/.pnpm/@effected+lockfiles@0.1.9_@effected+jsonc@0.5.0_effect@4.0.0-beta.99__@effected+npm@0.3_d470055e7ca4b6a23d413cae592e2835/node_modules/@effected/lockfiles/internal/yarn.js
13309
13740
  const YarnLockfileRaw = effect.Schema.Record(effect.Schema.String, effect.Schema.Unknown);
13310
13741
  const DepRecord = effect.Schema.optionalKey(effect.Schema.Record(effect.Schema.String, effect.Schema.String));
13311
13742
  const YarnEntry = effect.Schema.Struct({
@@ -13428,7 +13859,7 @@ const cleanYarnDeps = (deps) => {
13428
13859
  return Object.fromEntries(Object.entries(deps).map(([name, value]) => [name, value.startsWith("npm:") ? value.slice(4) : value]));
13429
13860
  };
13430
13861
  //#endregion
13431
- //#region ../../node_modules/.pnpm/@effected+lockfiles@0.1.5_@effected+jsonc@0.4.0_effect@4.0.0-beta.99__@effected+npm@0.2_b1d671782d9bef489a2d22b7bd2ef126/node_modules/@effected/lockfiles/Lockfile.js
13862
+ //#region ../../node_modules/.pnpm/@effected+lockfiles@0.1.9_@effected+jsonc@0.5.0_effect@4.0.0-beta.99__@effected+npm@0.3_d470055e7ca4b6a23d413cae592e2835/node_modules/@effected/lockfiles/Lockfile.js
13432
13863
  const EMPTY_IMPORTERS = [];
13433
13864
  /**
13434
13865
  * Failure of `Lockfile.parse`: the given content is not a valid lockfile of
@@ -13672,7 +14103,7 @@ var Lockfile = class Lockfile extends effect.Schema.Class("Lockfile")({
13672
14103
  }
13673
14104
  };
13674
14105
  //#endregion
13675
- //#region ../../node_modules/.pnpm/@effected+lockfiles@0.1.5_@effected+jsonc@0.4.0_effect@4.0.0-beta.99__@effected+npm@0.2_b1d671782d9bef489a2d22b7bd2ef126/node_modules/@effected/lockfiles/LockfileIntegrity.js
14106
+ //#region ../../node_modules/.pnpm/@effected+lockfiles@0.1.9_@effected+jsonc@0.5.0_effect@4.0.0-beta.99__@effected+npm@0.3_d470055e7ca4b6a23d413cae592e2835/node_modules/@effected/lockfiles/LockfileIntegrity.js
13676
14107
  /**
13677
14108
  * The minimal manifest shape {@link LockfileIntegrity.compare} checks a
13678
14109
  * lockfile against: a package name plus the four optional dependency maps.
@@ -13788,7 +14219,7 @@ var LockfileIntegrity = class LockfileIntegrity extends effect.Schema.Class("Loc
13788
14219
  }
13789
14220
  };
13790
14221
  //#endregion
13791
- //#region ../../node_modules/.pnpm/@effected+package-json@0.3.1_effect@4.0.0-beta.99/node_modules/@effected/package-json/Dependency.js
14222
+ //#region ../../node_modules/.pnpm/@effected+package-json@0.4.2_effect@4.0.0-beta.99/node_modules/@effected/package-json/Dependency.js
13792
14223
  /**
13793
14224
  * A resolved dependency entry pairing a package name with its version
13794
14225
  * specifier and the `kind` of map it came from (`@effected/npm`'s
@@ -13852,7 +14283,7 @@ var Dependency = class extends effect.Schema.Class("Dependency")({
13852
14283
  }
13853
14284
  };
13854
14285
  //#endregion
13855
- //#region ../../node_modules/.pnpm/@effected+package-json@0.3.1_effect@4.0.0-beta.99/node_modules/@effected/package-json/DevEngines.js
14286
+ //#region ../../node_modules/.pnpm/@effected+package-json@0.4.2_effect@4.0.0-beta.99/node_modules/@effected/package-json/DevEngines.js
13856
14287
  /**
13857
14288
  * A single `devEngines` constraint with a name and optional `version` / `onFail`.
13858
14289
  *
@@ -14877,7 +15308,7 @@ var require_parse$2 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
14877
15308
  };
14878
15309
  }));
14879
15310
  //#endregion
14880
- //#region ../../node_modules/.pnpm/@effected+package-json@0.3.1_effect@4.0.0-beta.99/node_modules/@effected/package-json/License.js
15311
+ //#region ../../node_modules/.pnpm/@effected+package-json@0.4.2_effect@4.0.0-beta.99/node_modules/@effected/package-json/License.js
14881
15312
  var import_spdx_expression_parse = /* @__PURE__ */ __toESM((/* @__PURE__ */ __commonJSMin(((exports, module) => {
14882
15313
  var scan = require_scan$1();
14883
15314
  var parse = require_parse$2();
@@ -14924,7 +15355,7 @@ const isValidSpdx = (value) => {
14924
15355
  */
14925
15356
  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"));
14926
15357
  //#endregion
14927
- //#region ../../node_modules/.pnpm/@effected+package-json@0.3.1_effect@4.0.0-beta.99/node_modules/@effected/package-json/PackageManager.js
15358
+ //#region ../../node_modules/.pnpm/@effected+package-json@0.4.2_effect@4.0.0-beta.99/node_modules/@effected/package-json/PackageManager.js
14928
15359
  const PACKAGE_MANAGER_RE = /^([a-z]+)@(\d+\.\d+\.\d+(?:-[a-zA-Z0-9._-]+)?)(?:\+(.+))?$/;
14929
15360
  /**
14930
15361
  * The `packageManager` field only ever carries corepack's `<algo>.<hex>`
@@ -14982,7 +15413,7 @@ var PackageManager = class PackageManager extends effect.Schema.Class("PackageMa
14982
15413
  }
14983
15414
  };
14984
15415
  //#endregion
14985
- //#region ../../node_modules/.pnpm/@effected+package-json@0.3.1_effect@4.0.0-beta.99/node_modules/@effected/package-json/PackageName.js
15416
+ //#region ../../node_modules/.pnpm/@effected+package-json@0.4.2_effect@4.0.0-beta.99/node_modules/@effected/package-json/PackageName.js
14986
15417
  /**
14987
15418
  * Indicates that a string could not be used as a valid npm package name.
14988
15419
  *
@@ -15040,7 +15471,7 @@ const PackageName = Object.assign(effect.Schema.Union([ScopedPackageName, Unscop
15040
15471
  isScoped
15041
15472
  });
15042
15473
  //#endregion
15043
- //#region ../../node_modules/.pnpm/@effected+package-json@0.3.1_effect@4.0.0-beta.99/node_modules/@effected/package-json/Person.js
15474
+ //#region ../../node_modules/.pnpm/@effected+package-json@0.4.2_effect@4.0.0-beta.99/node_modules/@effected/package-json/Person.js
15044
15475
  const parsePersonString = (input) => {
15045
15476
  const emailMatch = input.match(/<([^>]+)>/);
15046
15477
  const urlMatch = input.match(/\(([^)]+)\)/);
@@ -15054,8 +15485,56 @@ const parsePersonString = (input) => {
15054
15485
  ...urlMatch !== null ? { url: urlMatch[1] } : {}
15055
15486
  });
15056
15487
  };
15488
+ const serializePerson = (person) => {
15489
+ let result = person.name;
15490
+ if (person.email !== void 0) result += ` <${person.email}>`;
15491
+ if (person.url !== void 0) result += ` (${person.url})`;
15492
+ return result;
15493
+ };
15494
+ const wireForms = /* @__PURE__ */ new WeakMap();
15495
+ const rememberWire = (person, wire) => {
15496
+ wireForms.set(person, wire);
15497
+ return person;
15498
+ };
15499
+ const KNOWN_KEYS = /* @__PURE__ */ new Set([
15500
+ "name",
15501
+ "email",
15502
+ "url"
15503
+ ]);
15504
+ const sameRest = (a, b) => JSON.stringify(a ?? {}) === JSON.stringify(b ?? {});
15505
+ const isFaithful = (wire, person) => {
15506
+ if (typeof wire === "string") {
15507
+ const parsed = parsePersonString(wire);
15508
+ return parsed.name === person.name && parsed.email === person.email && parsed.url === person.url;
15509
+ }
15510
+ const rest = restOf(wire);
15511
+ return wire.name === person.name && wire.email === person.email && wire.url === person.url && sameRest(rest, person.rest);
15512
+ };
15513
+ const PersonFields = effect.Schema.Struct({
15514
+ name: effect.Schema.String,
15515
+ email: effect.Schema.optionalKey(effect.Schema.String),
15516
+ url: effect.Schema.optionalKey(effect.Schema.String)
15517
+ });
15518
+ const decodePersonFields = effect.Schema.decodeUnknownEffect(PersonFields);
15519
+ const restOf = (raw) => {
15520
+ const rest = {};
15521
+ for (const [key, value] of Object.entries(raw)) if (!KNOWN_KEYS.has(key)) rest[key] = value;
15522
+ return rest;
15523
+ };
15524
+ const encodePersonObject = (person) => {
15525
+ const wire = wireForms.get(person);
15526
+ if (wire !== void 0 && typeof wire !== "string" && isFaithful(wire, person)) return wire;
15527
+ const known = { name: person.name };
15528
+ if (person.email !== void 0) known.email = person.email;
15529
+ if (person.url !== void 0) known.url = person.url;
15530
+ return {
15531
+ ...person.rest ?? {},
15532
+ ...known
15533
+ };
15534
+ };
15057
15535
  /**
15058
- * A structured person object with `name` and optional `email` / `url`.
15536
+ * A structured person object with `name`, optional `email` / `url`, and a
15537
+ * `rest` catch-all preserving any additional keys across a read/write cycle.
15059
15538
  *
15060
15539
  * @public
15061
15540
  */
@@ -15065,29 +15544,77 @@ var Person = class Person extends effect.Schema.Class("Person")({
15065
15544
  /** The optional email address. */
15066
15545
  email: effect.Schema.optionalKey(effect.Schema.String),
15067
15546
  /** The optional homepage URL. */
15068
- url: effect.Schema.optionalKey(effect.Schema.String)
15547
+ url: effect.Schema.optionalKey(effect.Schema.String),
15548
+ /** Any additional keys, preserved verbatim and flattened back on encode. */
15549
+ rest: effect.Schema.optionalKey(effect.Schema.Record(effect.Schema.String, effect.Schema.Unknown))
15069
15550
  }) {
15551
+ /**
15552
+ * The object wire codec: an open JSON object ↔ a {@link Person}, partitioning
15553
+ * unknown keys into `rest` and flattening them back on encode so the on-disk
15554
+ * shape never carries a literal `rest` key.
15555
+ */
15556
+ static schema = effect.Schema.Record(effect.Schema.String, effect.Schema.Unknown).pipe(effect.Schema.decodeTo(effect.Schema.instanceOf(Person), effect.SchemaTransformation.transformOrFail({
15557
+ decode: (raw) => decodePersonFields(raw).pipe(effect.Effect.mapError((error) => error.issue), effect.Effect.map((fields) => {
15558
+ const rest = restOf(raw);
15559
+ return rememberWire(Person.make({
15560
+ ...fields,
15561
+ ...Object.keys(rest).length > 0 ? { rest } : {}
15562
+ }), raw);
15563
+ })),
15564
+ encode: (person) => effect.Effect.succeed(encodePersonObject(person))
15565
+ })));
15070
15566
  /**
15071
15567
  * Schema transformation between the `"Name <email> (url)"` shorthand string
15072
- * and a {@link Person}.
15568
+ * and a {@link Person}. Decoding remembers the input text so that encoding
15569
+ * reproduces it verbatim; see {@link Person.wireStringOf}.
15073
15570
  */
15074
15571
  static FromString = effect.Schema.String.pipe(effect.Schema.decodeTo(effect.Schema.instanceOf(Person), effect.SchemaTransformation.transform({
15075
- decode: (input) => parsePersonString(input),
15572
+ decode: (input) => rememberWire(parsePersonString(input), input),
15076
15573
  encode: (person) => {
15077
- let result = person.name;
15078
- if (person.email !== void 0) result += ` <${person.email}>`;
15079
- if (person.url !== void 0) result += ` (${person.url})`;
15080
- return result;
15574
+ const wire = wireForms.get(person);
15575
+ return typeof wire === "string" && isFaithful(wire, person) ? wire : serializePerson(person);
15081
15576
  }
15082
15577
  })));
15083
15578
  /**
15084
15579
  * The `author` / `contributors` value: either the shorthand string or the
15085
15580
  * structured object, always decoded to a {@link Person}.
15581
+ *
15582
+ * The wire form is preserved across a round trip — a person read from the
15583
+ * shorthand string encodes back to that string, byte for byte, and one read
15584
+ * from an object encodes back to an object with its unknown keys intact.
15585
+ * Formatting a manifest therefore never rewrites one legal encoding into the
15586
+ * other.
15587
+ *
15588
+ * Provenance belongs to the instance, so a person that is *rebuilt* (rather
15589
+ * than carried through unchanged) has none and encodes in the canonical
15590
+ * object form. Editing an unrelated field of the surrounding `Package`
15591
+ * carries the same person instance through and preserves its encoding.
15086
15592
  */
15087
- static FromValue = effect.Schema.Union([Person, Person.FromString]);
15593
+ static FromValue = effect.Schema.Union([Person.schema, effect.Schema.String]).pipe(effect.Schema.decodeTo(effect.Schema.instanceOf(Person), effect.SchemaTransformation.transform({
15594
+ decode: (input) => typeof input === "string" ? rememberWire(parsePersonString(input), input) : input,
15595
+ encode: (person) => {
15596
+ const wire = wireForms.get(person);
15597
+ return typeof wire === "string" && isFaithful(wire, person) ? wire : person;
15598
+ }
15599
+ })));
15600
+ /**
15601
+ * The shorthand text this person was decoded from, when it was decoded from
15602
+ * the string form and still matches its fields; `None` for a person built
15603
+ * from an object or by hand.
15604
+ *
15605
+ * Exposed so callers can tell which encoding a manifest used without
15606
+ * re-reading the file.
15607
+ *
15608
+ * @param person - the person to inspect
15609
+ * @returns the original shorthand text, or `None`
15610
+ */
15611
+ static wireStringOf(person) {
15612
+ const wire = wireForms.get(person);
15613
+ return typeof wire === "string" && isFaithful(wire, person) ? effect.Option.some(wire) : effect.Option.none();
15614
+ }
15088
15615
  };
15089
15616
  //#endregion
15090
- //#region ../../node_modules/.pnpm/@effected+package-json@0.3.1_effect@4.0.0-beta.99/node_modules/@effected/package-json/internal/format.js
15617
+ //#region ../../node_modules/.pnpm/@effected+package-json@0.4.2_effect@4.0.0-beta.99/node_modules/@effected/package-json/internal/format.js
15091
15618
  const KEY_INDEX = new Map([
15092
15619
  "$schema",
15093
15620
  "name",
@@ -15310,7 +15837,7 @@ const renderJson = (raw, options) => {
15310
15837
  return options.newline ? `${json}\n` : json;
15311
15838
  };
15312
15839
  //#endregion
15313
- //#region ../../node_modules/.pnpm/@effected+package-json@0.3.1_effect@4.0.0-beta.99/node_modules/@effected/package-json/Package.js
15840
+ //#region ../../node_modules/.pnpm/@effected+package-json@0.4.2_effect@4.0.0-beta.99/node_modules/@effected/package-json/Package.js
15314
15841
  const toHashMap = effect.SchemaTransformation.transform({
15315
15842
  decode: (record) => effect.HashMap.fromIterable(Object.entries(record)),
15316
15843
  encode: (map) => Object.fromEntries(effect.HashMap.toEntries(map))
@@ -15628,7 +16155,7 @@ var Package = class Package extends effect.Schema.Class("Package")({
15628
16155
  }
15629
16156
  };
15630
16157
  //#endregion
15631
- //#region ../../node_modules/.pnpm/@effected+workspaces@0.4.1_@effected+jsonc@0.4.0_effect@4.0.0-beta.99__effect@4.0.0-beta.99/node_modules/@effected/workspaces/WorkspacePackage.js
16158
+ //#region ../../node_modules/.pnpm/@effected+workspaces@0.6.0_@effected+jsonc@0.5.0_effect@4.0.0-beta.99__effect@4.0.0-beta.99/node_modules/@effected/workspaces/WorkspacePackage.js
15632
16159
  const EMPTY$1 = Object.freeze(Object.create(null));
15633
16160
  const EMPTY_MANIFEST = Object.freeze(Object.create(null));
15634
16161
  /**
@@ -15703,10 +16230,12 @@ var WorkspaceManifestError = class extends effect.Schema.TaggedErrorClass()("Wor
15703
16230
  * path: "/repo/packages/utils",
15704
16231
  * packageJsonPath: "/repo/packages/utils/package.json",
15705
16232
  * relativePath: "packages/utils",
16233
+ * workspaceRoot: "/repo",
15706
16234
  * });
15707
16235
  *
15708
16236
  * pkg.isRootWorkspace; // false
15709
16237
  * pkg.unscopedName; // "utils"
16238
+ * pkg.workspaceRoot; // "/repo"
15710
16239
  * ```
15711
16240
  *
15712
16241
  * @public
@@ -15722,6 +16251,21 @@ var WorkspacePackage = class WorkspacePackage extends effect.Schema.Class("Works
15722
16251
  packageJsonPath: effect.Schema.NonEmptyString,
15723
16252
  /** POSIX path relative to the workspace root; `"."` for the root package. */
15724
16253
  relativePath: effect.Schema.String,
16254
+ /**
16255
+ * Absolute path to the workspace root this package was discovered under.
16256
+ *
16257
+ * @remarks
16258
+ * Carried, not derived. Whoever built this value already knew the root —
16259
+ * `WorkspaceDiscovery` resolved it before enumerating, and the sync entry
16260
+ * point is handed it — so dropping it forced every consumer into per-package
16261
+ * root arithmetic (counting `relativePath` segments and re-ascending that
16262
+ * many `..`). That reconstruction is exact only while `path` and
16263
+ * `relativePath` agree, and it re-derives something the kit never had to
16264
+ * lose.
16265
+ *
16266
+ * For the root package this equals `path`, and `relativePath` is `"."`.
16267
+ */
16268
+ workspaceRoot: effect.Schema.NonEmptyString,
15725
16269
  /** Whether the package is marked private. */
15726
16270
  private: effect.Schema.Boolean.pipe(effect.Schema.withDecodingDefaultKey(effect.Effect.succeed(false)), effect.Schema.withConstructorDefault(effect.Effect.succeed(false))),
15727
16271
  /** Production dependencies. */
@@ -15890,7 +16434,7 @@ var WorkspacePackage = class WorkspacePackage extends effect.Schema.Class("Works
15890
16434
  }
15891
16435
  };
15892
16436
  //#endregion
15893
- //#region ../../node_modules/.pnpm/@effected+walker@0.2.2_@effected+glob@0.1.2_effect@4.0.0-beta.99__effect@4.0.0-beta.99/node_modules/@effected/walker/Descend.js
16437
+ //#region ../../node_modules/.pnpm/@effected+walker@0.3.1_@effected+glob@0.2.0_effect@4.0.0-beta.99__effect@4.0.0-beta.99/node_modules/@effected/walker/Descend.js
15894
16438
  /**
15895
16439
  * Typed failure raised by {@link descend}: a directory mid-walk was unreadable
15896
16440
  * (under `onUnreadable: "fail"`), or the walk descended past `maxDepth`. Depth
@@ -16025,7 +16569,97 @@ const descend = effect.Effect.fn("Walker.descend")(function* (pattern, options)
16025
16569
  return results;
16026
16570
  });
16027
16571
  //#endregion
16028
- //#region ../../node_modules/.pnpm/@effected+walker@0.2.2_@effected+glob@0.1.2_effect@4.0.0-beta.99__effect@4.0.0-beta.99/node_modules/@effected/walker/Walker.js
16572
+ //#region ../../node_modules/.pnpm/@effected+walker@0.3.1_@effected+glob@0.2.0_effect@4.0.0-beta.99__effect@4.0.0-beta.99/node_modules/@effected/walker/Expand.js
16573
+ /**
16574
+ * Typed failure raised by {@link compileAndExpand}: the single error the
16575
+ * compile+expand recipe fails with, so a caller catches one tag rather than
16576
+ * folding two error channels by hand.
16577
+ *
16578
+ * @remarks
16579
+ * One tag, two genuinely different causes — "your pattern is malformed" and
16580
+ * "that directory is unreadable" are different problems with different fixes,
16581
+ * so `cause` keeps the underlying typed error intact
16582
+ * rather than flattening it into a string. Discriminate on `cause._tag`
16583
+ * (`"GlobPatternError"` vs `"DescendError"`), or read
16584
+ * {@link GlobExpansionError.stage} when only the phase matters; either way the
16585
+ * original payload — a guard's `limit`/`actual`, a descent's `path` — is still
16586
+ * there. `cause` is also the native `Error` cause, so error chaining and
16587
+ * stack-printing work without extra wiring.
16588
+ *
16589
+ * @public
16590
+ */
16591
+ var GlobExpansionError = class extends effect.Schema.TaggedErrorClass()("GlobExpansionError", {
16592
+ /** The glob pattern's source text, as handed to {@link compileAndExpand}. */
16593
+ pattern: effect.Schema.String,
16594
+ /** The underlying typed failure, intact: a compile guard trip or a descent failure. */
16595
+ cause: effect.Schema.Union([GlobPatternError, DescendError])
16596
+ }) {
16597
+ /**
16598
+ * Which phase failed — `"compile"` when the pattern itself was rejected,
16599
+ * `"descend"` when the filesystem walk failed. A convenience over
16600
+ * `cause._tag` for callers that only need the phase.
16601
+ */
16602
+ get stage() {
16603
+ return this.cause._tag === "GlobPatternError" ? "compile" : "descend";
16604
+ }
16605
+ get message() {
16606
+ const shown = this.pattern.length > 64 ? `${this.pattern.slice(0, 64)}…` : this.pattern;
16607
+ return `glob expansion of ${JSON.stringify(shown)} failed during ${this.stage}: ${this.cause.message}`;
16608
+ }
16609
+ };
16610
+ /**
16611
+ * Compile a glob pattern and expand it against the filesystem in one call:
16612
+ * matching FILE paths relative to `options.cwd`, POSIX separators, sorted.
16613
+ *
16614
+ * @remarks
16615
+ * The recipe form of {@link descend}. Everything `descend` documents about
16616
+ * traversal holds unchanged — the literal fast-path, the negated-pattern walk
16617
+ * from `cwd`, files-only matching, symlink and prune handling, `maxDepth`,
16618
+ * `onUnreadable` — because this delegates to it. What this adds is the seam:
16619
+ * the pattern arrives as a string, and both failure modes arrive as one
16620
+ * {@link GlobExpansionError} with the underlying error preserved in `cause`.
16621
+ *
16622
+ * A missing base directory, a pattern that climbs above `cwd`, and a pattern
16623
+ * that simply matches nothing are all an EMPTY result, not a failure — zero
16624
+ * matches is a normal glob answer. Only a rejected pattern or a failed walk
16625
+ * produces an error.
16626
+ *
16627
+ * `FileSystem` and `Path` stay in the `R` channel and are **deliberately not
16628
+ * provided here**, even though hand-providing them is the friction this
16629
+ * recipe otherwise removes. `FileSystem` cannot be provided — a library that
16630
+ * picks its own filesystem cannot be tested against a fixture tree. Given
16631
+ * that, providing `Path` internally would not save the caller a layer (they
16632
+ * still supply `FileSystem`), and it would actively break win32: the walk
16633
+ * would join paths POSIX-style against a caller's win32 filesystem. The
16634
+ * consumer's platform layer stays the single place that choice is made.
16635
+ * Provide both once at the application boundary, not per call site.
16636
+ *
16637
+ * @example
16638
+ * ```ts
16639
+ * import { compileAndExpand } from "@effected/walker"
16640
+ * import { GlobPatternOptions } from "@effected/glob"
16641
+ *
16642
+ * const files = yield* compileAndExpand("packages/*​/src/**​/*.ts", {
16643
+ * cwd: "/repo",
16644
+ * glob: GlobPatternOptions.make({ dot: true })
16645
+ * })
16646
+ * ```
16647
+ *
16648
+ * @public
16649
+ */
16650
+ const compileAndExpand = effect.Effect.fn("Walker.compileAndExpand")(function* (pattern, options) {
16651
+ const compiled = GlobPattern.compileResult(pattern, options.glob);
16652
+ if (effect.Result.isFailure(compiled)) return yield* new GlobExpansionError({
16653
+ pattern,
16654
+ cause: compiled.failure
16655
+ });
16656
+ return yield* descend(compiled.success, options).pipe(effect.Effect.mapError((cause) => new GlobExpansionError({
16657
+ pattern,
16658
+ cause
16659
+ })));
16660
+ });
16661
+ //#endregion
16662
+ //#region ../../node_modules/.pnpm/@effected+walker@0.3.1_@effected+glob@0.2.0_effect@4.0.0-beta.99__effect@4.0.0-beta.99/node_modules/@effected/walker/Walker.js
16029
16663
  /**
16030
16664
  * Ascend from `start` toward the filesystem root, yielding each directory,
16031
16665
  * nearest first.
@@ -16039,17 +16673,28 @@ const descend = effect.Effect.fn("Walker.descend")(function* (pattern, options)
16039
16673
  * Bounded twice over: `dirname` is a fixpoint at the root, and `maxDepth` guards
16040
16674
  * a pathological `Path` implementation that never reaches one.
16041
16675
  *
16676
+ * `stopAt` is compared in normalized form — see {@link AscendOptions.stopAt}.
16677
+ * Raw string equality made the ceiling fail OPEN: an unnormalized ceiling
16678
+ * matched nothing and the ascent ran silently to the filesystem root, which is
16679
+ * the unbounded walk the option exists to prevent, with no error to notice it
16680
+ * by. A relative ceiling **dies** for the same reason — resolving one against
16681
+ * `process.cwd()` would reintroduce the silent-wrong-walk failure through a
16682
+ * different door. See {@link AscendOptions.stopAt} for why that is a defect
16683
+ * rather than a typed error; the error channel stays `never`.
16684
+ *
16042
16685
  * @public
16043
16686
  */
16044
16687
  const ascend = (start, options) => effect.Effect.gen(function* () {
16045
16688
  const path = yield* effect.Path.Path;
16046
16689
  const maxDepth = options?.maxDepth ?? 256;
16047
16690
  if (!Number.isInteger(maxDepth) || maxDepth < 1) return yield* effect.Effect.die(/* @__PURE__ */ new Error(`Walker.ascend: maxDepth must be a positive integer, received ${maxDepth}`));
16691
+ if (options?.stopAt !== void 0 && !path.isAbsolute(options.stopAt)) return yield* effect.Effect.die(/* @__PURE__ */ new Error(`Walker.ascend: stopAt must be an absolute path, received ${JSON.stringify(options.stopAt)} (ascending from ${JSON.stringify(start)})`));
16692
+ const ceiling = options?.stopAt === void 0 ? void 0 : path.resolve(options.stopAt);
16048
16693
  const dirs = [];
16049
16694
  let current = start;
16050
16695
  for (let depth = 0; depth < maxDepth; depth++) {
16051
16696
  dirs.push(current);
16052
- if (options?.stopAt !== void 0 && current === options.stopAt) break;
16697
+ if (ceiling !== void 0 && (current === ceiling || path.resolve(current) === ceiling)) break;
16053
16698
  const parent = path.dirname(current);
16054
16699
  if (parent === current) break;
16055
16700
  current = parent;
@@ -16115,7 +16760,7 @@ const Walker$1 = {
16115
16760
  findRoot: findRoot$1
16116
16761
  };
16117
16762
  //#endregion
16118
- //#region ../../node_modules/.pnpm/@effected+workspaces@0.4.1_@effected+jsonc@0.4.0_effect@4.0.0-beta.99__effect@4.0.0-beta.99/node_modules/@effected/workspaces/WorkspaceRoot.js
16763
+ //#region ../../node_modules/.pnpm/@effected+workspaces@0.6.0_@effected+jsonc@0.5.0_effect@4.0.0-beta.99__effect@4.0.0-beta.99/node_modules/@effected/workspaces/WorkspaceRoot.js
16119
16764
  /**
16120
16765
  * The marker filenames {@link WorkspaceRoot} probes for, in priority order.
16121
16766
  *
@@ -16135,11 +16780,22 @@ var WorkspaceRootNotFoundError = class extends effect.Schema.TaggedErrorClass()(
16135
16780
  /** The directory the ascent started from. */
16136
16781
  searchPath: effect.Schema.String,
16137
16782
  /** The marker filenames probed at each ancestor. */
16138
- markers: effect.Schema.Array(effect.Schema.String)
16783
+ markers: effect.Schema.Array(effect.Schema.String),
16784
+ /**
16785
+ * The resolved ceiling the ascent was bounded by, when one was supplied.
16786
+ *
16787
+ * @remarks
16788
+ * Absent means the ascent ran to the filesystem root. Its presence is what
16789
+ * lets a caller tell "there is no workspace root anywhere above me" from
16790
+ * "there is none below the ceiling I set" — two failures that otherwise
16791
+ * render identically.
16792
+ */
16793
+ stopAt: effect.Schema.optionalKey(effect.Schema.String)
16139
16794
  }) {
16140
- /** Renders the search path and probed markers into a one-line message. */
16795
+ /** Renders the search path, probed markers and any ceiling into a one-line message. */
16141
16796
  get message() {
16142
- return `No workspace root above ${this.searchPath} (looked for ${this.markers.join(", ")})`;
16797
+ const bound = this.stopAt === void 0 ? "" : ` up to ${this.stopAt}`;
16798
+ return `No workspace root above ${this.searchPath}${bound} (looked for ${this.markers.join(", ")})`;
16143
16799
  }
16144
16800
  };
16145
16801
  /**
@@ -16162,6 +16818,12 @@ const isWorkspaceRoot = (dir) => effect.Effect.gen(function* () {
16162
16818
  }).pipe(effect.Effect.orElseSucceed(() => ({})));
16163
16819
  return parsed.workspaces !== void 0 && parsed.workspaces !== null;
16164
16820
  });
16821
+ /** Whether `descendant` is `ancestor` itself or lies beneath it, on POSIX or win32 separators. */
16822
+ const isAtOrBelow = (descendant, ancestor) => {
16823
+ if (descendant === ancestor) return true;
16824
+ const prefix = ancestor.endsWith("/") || ancestor.endsWith("\\") ? ancestor : `${ancestor}/`;
16825
+ return descendant.startsWith(prefix) || descendant.startsWith(prefix.replace(/\/$/, "\\"));
16826
+ };
16165
16827
  /**
16166
16828
  * Locates the workspace root by ascending from a starting directory.
16167
16829
  *
@@ -16176,6 +16838,20 @@ const isWorkspaceRoot = (dir) => effect.Effect.gen(function* () {
16176
16838
  * });
16177
16839
  * ```
16178
16840
  *
16841
+ * @example
16842
+ * Bounded: an unmarked fixture directory fails typed instead of escaping into
16843
+ * the enclosing repository.
16844
+ *
16845
+ * ```ts
16846
+ * import { WorkspaceRoot } from "@effected/workspaces";
16847
+ * import { Effect } from "effect";
16848
+ *
16849
+ * const program = Effect.gen(function* () {
16850
+ * const roots = yield* WorkspaceRoot;
16851
+ * return yield* roots.find("/tmp/fixture/packages/a", { stopAt: "/tmp/fixture" });
16852
+ * });
16853
+ * ```
16854
+ *
16179
16855
  * @public
16180
16856
  */
16181
16857
  var WorkspaceRoot = class WorkspaceRoot extends effect.Context.Service()("@effected/workspaces/WorkspaceRoot") {
@@ -16183,24 +16859,95 @@ var WorkspaceRoot = class WorkspaceRoot extends effect.Context.Service()("@effec
16183
16859
  static make = effect.Effect.gen(function* () {
16184
16860
  const fs = yield* effect.FileSystem.FileSystem;
16185
16861
  const path = yield* effect.Path.Path;
16186
- const find = effect.Effect.fn("WorkspaceRoot.find")(function* (cwd) {
16862
+ const find = effect.Effect.fn("WorkspaceRoot.find")(function* (cwd, options) {
16187
16863
  const start = path.resolve(cwd);
16188
- const chain = yield* Walker$1.ascend(start);
16864
+ const ceiling = options?.stopAt === void 0 ? void 0 : path.resolve(options.stopAt);
16865
+ const chain = yield* Walker$1.ascend(start, {
16866
+ ...ceiling === void 0 ? {} : { stopAt: ceiling },
16867
+ ...options?.maxDepth === void 0 ? {} : { maxDepth: options.maxDepth }
16868
+ });
16189
16869
  const found = yield* Walker$1.findRoot(chain, isWorkspaceRoot);
16190
16870
  if (effect.Option.isNone(found)) return yield* effect.Effect.fail(new WorkspaceRootNotFoundError({
16191
16871
  searchPath: start,
16192
- markers: WORKSPACE_MARKERS
16872
+ markers: WORKSPACE_MARKERS,
16873
+ ...ceiling === void 0 ? {} : { stopAt: ceiling }
16193
16874
  }));
16194
16875
  yield* effect.Effect.logDebug("Workspace root found").pipe(effect.Effect.annotateLogs("workspace.root", found.value));
16195
16876
  return found.value;
16196
16877
  });
16197
- return { find: (cwd) => find(cwd).pipe(effect.Effect.provideService(effect.FileSystem.FileSystem, fs), effect.Effect.provideService(effect.Path.Path, path)) };
16878
+ return { find: (cwd, options) => find(cwd, options).pipe(effect.Effect.provideService(effect.FileSystem.FileSystem, fs), effect.Effect.provideService(effect.Path.Path, path)) };
16198
16879
  });
16199
16880
  /** The live layer. */
16200
16881
  static layer = effect.Layer.effect(WorkspaceRoot, WorkspaceRoot.make);
16882
+ /**
16883
+ * A test double resolving every `find` to `root`, with no filesystem.
16884
+ *
16885
+ * @remarks
16886
+ * The nine-copies-of-a-four-line-mock case — a `Layer.succeed` over a `find`
16887
+ * that ignores its arguments and succeeds with a fixed root is what consumers
16888
+ * were writing by hand. The difference is that this double **honours
16889
+ * `stopAt`**: a hand-rolled `find` that ignores the ceiling makes a bounded
16890
+ * call pass under test and fail against the live service, which is the
16891
+ * failure mode the option exists to catch. A `root` above the ceiling fails
16892
+ * here exactly as it would live, with the same
16893
+ * {@link WorkspaceRootNotFoundError}.
16894
+ *
16895
+ * The ceiling is `path.resolve`d through the injected `Path` service before
16896
+ * the comparison, exactly as the live `make` path does — so a `stopAt`
16897
+ * carrying `..` segments bounds the double identically to the live service,
16898
+ * not by raw string. This is why `makeTest` yields an `Effect` requiring
16899
+ * `Path`: it captures the service once at construction, the same shape as
16900
+ * `make`. Consumers reach for {@link WorkspaceRoot.layerTest}, which provides
16901
+ * `Path.layer` internally, so the requirement never surfaces at their call
16902
+ * site.
16903
+ *
16904
+ * `maxDepth` is deliberately NOT modelled: the double does not walk, so it has
16905
+ * no depth to cap, and pretending otherwise would encode a fiction. A suite
16906
+ * exercising the depth guard wants the live service over a fixture tree.
16907
+ *
16908
+ * @param root - The root every unbounded `find` resolves to.
16909
+ */
16910
+ static makeTest = (root) => effect.Effect.gen(function* () {
16911
+ const path = yield* effect.Path.Path;
16912
+ return { find: (cwd, options) => options?.stopAt !== void 0 && !isAtOrBelow(root, path.resolve(options.stopAt)) ? effect.Effect.fail(new WorkspaceRootNotFoundError({
16913
+ searchPath: cwd,
16914
+ markers: WORKSPACE_MARKERS,
16915
+ stopAt: options.stopAt
16916
+ })) : effect.Effect.succeed(root) };
16917
+ });
16918
+ /**
16919
+ * The test layer: {@link WorkspaceRoot.makeTest} with `Path.layer` provided.
16920
+ *
16921
+ * @remarks
16922
+ * `makeTest` requires `Path` to normalize the `stopAt` ceiling; this layer
16923
+ * supplies core's `Path.layer` internally, so the requirement never reaches a
16924
+ * consumer — the published type stays `Layer.Layer<WorkspaceRoot>`.
16925
+ *
16926
+ * A parameterized layer factory mints a **fresh reference per call**, and
16927
+ * layers memoize by reference — bind the result to a `const` and reuse it
16928
+ * rather than calling `layerTest(...)` at each composition site.
16929
+ *
16930
+ * Pair it with `WorkspaceDiscovery.layerTest` to stand up the whole discovery
16931
+ * path without a filesystem; between them there is nothing left for a
16932
+ * module-level mock of `@effected/workspaces` to do, and a provided layer
16933
+ * keeps the service graph — and its typed errors — intact.
16934
+ *
16935
+ * @example
16936
+ * ```ts
16937
+ * import { WorkspaceDiscovery, WorkspaceRoot } from "@effected/workspaces";
16938
+ * import { Effect } from "effect";
16939
+ *
16940
+ * const TestRoot = WorkspaceRoot.layerTest("/repo");
16941
+ * const TestDiscovery = WorkspaceDiscovery.layerTest({
16942
+ * listPackages: () => Effect.succeed([]),
16943
+ * });
16944
+ * // program.pipe(Effect.provide(TestRoot), Effect.provide(TestDiscovery))
16945
+ * ```
16946
+ */
16947
+ static layerTest = (root) => effect.Layer.effect(WorkspaceRoot, WorkspaceRoot.makeTest(root)).pipe(effect.Layer.provide(effect.Path.layer));
16201
16948
  };
16202
16949
  //#endregion
16203
- //#region ../../node_modules/.pnpm/@effected+workspaces@0.4.1_@effected+jsonc@0.4.0_effect@4.0.0-beta.99__effect@4.0.0-beta.99/node_modules/@effected/workspaces/internal/limits.js
16950
+ //#region ../../node_modules/.pnpm/@effected+workspaces@0.6.0_@effected+jsonc@0.5.0_effect@4.0.0-beta.99__effect@4.0.0-beta.99/node_modules/@effected/workspaces/internal/limits.js
16204
16951
  /**
16205
16952
  * Hard ceiling on directories the enumerator will visit for one pattern set.
16206
16953
  * Guards the pathological case a depth cap alone does not: a wide, shallow
@@ -16218,7 +16965,7 @@ const MAX_ENUMERATION_ENTRIES = 1e5;
16218
16965
  */
16219
16966
  const PRUNED_DIRECTORIES = /* @__PURE__ */ new Set([".git", "node_modules"]);
16220
16967
  //#endregion
16221
- //#region ../../node_modules/.pnpm/@effected+workspaces@0.4.1_@effected+jsonc@0.4.0_effect@4.0.0-beta.99__effect@4.0.0-beta.99/node_modules/@effected/workspaces/internal/traverse.js
16968
+ //#region ../../node_modules/.pnpm/@effected+workspaces@0.6.0_@effected+jsonc@0.5.0_effect@4.0.0-beta.99__effect@4.0.0-beta.99/node_modules/@effected/workspaces/internal/traverse.js
16222
16969
  /** Directory names never descended into. */
16223
16970
  const isPruned = (entry) => PRUNED_DIRECTORIES.has(entry);
16224
16971
  /** Join root-relative POSIX segments; `""` is the root itself. */
@@ -16308,7 +17055,7 @@ var Traversal = class {
16308
17055
  }
16309
17056
  };
16310
17057
  //#endregion
16311
- //#region ../../node_modules/.pnpm/@effected+workspaces@0.4.1_@effected+jsonc@0.4.0_effect@4.0.0-beta.99__effect@4.0.0-beta.99/node_modules/@effected/workspaces/internal/enumerate.js
17058
+ //#region ../../node_modules/.pnpm/@effected+workspaces@0.6.0_@effected+jsonc@0.5.0_effect@4.0.0-beta.99__effect@4.0.0-beta.99/node_modules/@effected/workspaces/internal/enumerate.js
16312
17059
  /** Strip a trailing slash from `GlobPattern.enumerationPrefix` to get a relative directory. */
16313
17060
  const baseOf = (pattern) => pattern.enumerationPrefix.replace(/\/$/, "");
16314
17061
  /**
@@ -16378,7 +17125,7 @@ const enumerate = (root, globs, options) => effect.Effect.gen(function* () {
16378
17125
  return results;
16379
17126
  });
16380
17127
  //#endregion
16381
- //#region ../../node_modules/.pnpm/@effected+workspaces@0.4.1_@effected+jsonc@0.4.0_effect@4.0.0-beta.99__effect@4.0.0-beta.99/node_modules/@effected/workspaces/internal/patterns.js
17128
+ //#region ../../node_modules/.pnpm/@effected+workspaces@0.6.0_@effected+jsonc@0.5.0_effect@4.0.0-beta.99__effect@4.0.0-beta.99/node_modules/@effected/workspaces/internal/patterns.js
16382
17129
  const stringsOf = (value) => Array.isArray(value) ? value.filter((entry) => typeof entry === "string") : void 0;
16383
17130
  /** The `packages:` list of a `pnpm-workspace.yaml` document. Total on a parsed document. */
16384
17131
  const pnpmPatternsOf = (document) => {
@@ -16435,7 +17182,7 @@ const readPatterns = (root) => effect.Effect.gen(function* () {
16435
17182
  return manifestPatternsOf(manifest);
16436
17183
  });
16437
17184
  //#endregion
16438
- //#region ../../node_modules/.pnpm/@effected+workspaces@0.4.1_@effected+jsonc@0.4.0_effect@4.0.0-beta.99__effect@4.0.0-beta.99/node_modules/@effected/workspaces/WorkspaceDiscovery.js
17185
+ //#region ../../node_modules/.pnpm/@effected+workspaces@0.6.0_@effected+jsonc@0.5.0_effect@4.0.0-beta.99__effect@4.0.0-beta.99/node_modules/@effected/workspaces/WorkspaceDiscovery.js
16439
17186
  /**
16440
17187
  * Raised when a workspace member's `package.json` cannot be read, parsed, or
16441
17188
  * used — it is missing, malformed, or lacks a `name` or `version`.
@@ -16613,6 +17360,7 @@ var WorkspaceDiscovery = class WorkspaceDiscovery extends effect.Context.Service
16613
17360
  path: directory,
16614
17361
  packageJsonPath,
16615
17362
  relativePath,
17363
+ workspaceRoot: root,
16616
17364
  manifestRecord: raw,
16617
17365
  ...typeof raw.private === "boolean" ? { private: raw.private } : {},
16618
17366
  ...isStringRecord$2(raw.dependencies) ? { dependencies: raw.dependencies } : {},
@@ -16770,6 +17518,7 @@ var WorkspaceDiscovery = class WorkspaceDiscovery extends effect.Context.Service
16770
17518
  * path: "/repo/packages/utils",
16771
17519
  * packageJsonPath: "/repo/packages/utils/package.json",
16772
17520
  * relativePath: "packages/utils",
17521
+ * workspaceRoot: "/repo",
16773
17522
  * }),
16774
17523
  * ]),
16775
17524
  * });
@@ -16867,7 +17616,7 @@ var WorkspaceDiscovery = class WorkspaceDiscovery extends effect.Context.Service
16867
17616
  };
16868
17617
  const isStringRecord$2 = (value) => value !== null && typeof value === "object" && !Array.isArray(value) && Object.values(value).every((entry) => typeof entry === "string");
16869
17618
  //#endregion
16870
- //#region ../../node_modules/.pnpm/@effected+workspaces@0.4.1_@effected+jsonc@0.4.0_effect@4.0.0-beta.99__effect@4.0.0-beta.99/node_modules/@effected/workspaces/DependencyGraph.js
17619
+ //#region ../../node_modules/.pnpm/@effected+workspaces@0.6.0_@effected+jsonc@0.5.0_effect@4.0.0-beta.99__effect@4.0.0-beta.99/node_modules/@effected/workspaces/DependencyGraph.js
16871
17620
  /**
16872
17621
  * Raised when the workspace dependency graph cannot be topologically ordered
16873
17622
  * because it contains a cycle.
@@ -18465,7 +19214,7 @@ var Git = class extends effect.Context.Service()("@effected/git/Git") {
18465
19214
  }));
18466
19215
  };
18467
19216
  //#endregion
18468
- //#region ../../node_modules/.pnpm/@effected+workspaces@0.4.1_@effected+jsonc@0.4.0_effect@4.0.0-beta.99__effect@4.0.0-beta.99/node_modules/@effected/workspaces/ChangeDetector.js
19217
+ //#region ../../node_modules/.pnpm/@effected+workspaces@0.6.0_@effected+jsonc@0.5.0_effect@4.0.0-beta.99__effect@4.0.0-beta.99/node_modules/@effected/workspaces/ChangeDetector.js
18469
19218
  /**
18470
19219
  * Which git refs to compare, and whether to fold in the working tree.
18471
19220
  *
@@ -18717,7 +19466,7 @@ function resolveFromCatalog(catalogs, wantedDependency) {
18717
19466
  };
18718
19467
  }
18719
19468
  //#endregion
18720
- //#region ../../node_modules/.pnpm/@effected+workspaces@0.4.1_@effected+jsonc@0.4.0_effect@4.0.0-beta.99__effect@4.0.0-beta.99/node_modules/@effected/workspaces/internal/catalogs.js
19469
+ //#region ../../node_modules/.pnpm/@effected+workspaces@0.6.0_@effected+jsonc@0.5.0_effect@4.0.0-beta.99__effect@4.0.0-beta.99/node_modules/@effected/workspaces/internal/catalogs.js
18721
19470
  /** Project a pnpm-workspace manifest's `catalog` / `catalogs` fields into a `Catalogs` map. */
18722
19471
  const inlineCatalogs = (manifest) => {
18723
19472
  if (manifest.catalog === void 0 && manifest.catalogs === void 0) return {};
@@ -18781,7 +19530,7 @@ const rangeOf = (catalogs, dependency, specifier) => {
18781
19530
  });
18782
19531
  };
18783
19532
  //#endregion
18784
- //#region ../../node_modules/.pnpm/@effected+workspaces@0.4.1_@effected+jsonc@0.4.0_effect@4.0.0-beta.99__effect@4.0.0-beta.99/node_modules/@effected/workspaces/ConfigDependencyHooks.js
19533
+ //#region ../../node_modules/.pnpm/@effected+workspaces@0.6.0_@effected+jsonc@0.5.0_effect@4.0.0-beta.99__effect@4.0.0-beta.99/node_modules/@effected/workspaces/ConfigDependencyHooks.js
18785
19534
  /** Whether `value` is a non-null, non-array object. */
18786
19535
  const isObject$2 = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
18787
19536
  /**
@@ -18816,17 +19565,45 @@ const seedToConfig = (seed) => {
18816
19565
  else catalogs[name] = { ...entries };
18817
19566
  return {
18818
19567
  catalog,
18819
- catalogs
19568
+ catalogs,
19569
+ minimumReleaseAge: void 0,
19570
+ minimumReleaseAgeExclude: void 0
18820
19571
  };
18821
19572
  };
18822
- /** Read the catalog slice back out of whatever a hook returned, falling back to the prior config. */
19573
+ /** A finite number if `value` is one, else the prior threaded value a garbage age is dropped, not fatal. */
19574
+ const finiteNumberOr = (value, fallback) => typeof value === "number" && Number.isFinite(value) ? value : fallback;
19575
+ /** A string array if `value` is one, else the prior threaded value — a malformed exclude is dropped, not fatal. */
19576
+ const stringArrayOr = (value, fallback) => Array.isArray(value) && value.every((entry) => typeof entry === "string") ? value : fallback;
19577
+ /**
19578
+ * Read the catalog slice and the release-age keys back out of whatever a hook
19579
+ * returned, threading the prior config as the fallback.
19580
+ *
19581
+ * @remarks
19582
+ * Tolerant by design, matching this seam's discipline: a hook's returned *data*
19583
+ * is normalized, never a typed failure (only a load/replay *mechanism* failure
19584
+ * raises `CatalogAssemblyError`). A hook that omits a key, or returns a
19585
+ * malformed value for it, leaves the prior threaded value in place; a hook that
19586
+ * sets a well-formed key rewrites it — so across hooks the **last well-formed
19587
+ * write wins**, exactly as pnpm's single mutable config object behaves.
19588
+ */
18823
19589
  const configOf = (value, fallback) => {
18824
19590
  if (!isObject$2(value)) return fallback;
18825
19591
  return {
18826
19592
  catalog: isObject$2(value.catalog) ? value.catalog : fallback.catalog,
18827
- catalogs: isObject$2(value.catalogs) ? value.catalogs : fallback.catalogs
19593
+ catalogs: isObject$2(value.catalogs) ? value.catalogs : fallback.catalogs,
19594
+ minimumReleaseAge: finiteNumberOr(value.minimumReleaseAge, fallback.minimumReleaseAge),
19595
+ minimumReleaseAgeExclude: stringArrayOr(value.minimumReleaseAgeExclude, fallback.minimumReleaseAgeExclude)
18828
19596
  };
18829
19597
  };
19598
+ /**
19599
+ * Project the threaded config's release-age keys into a partial gate
19600
+ * contribution, omitting a key the hooks never set (never an explicit
19601
+ * `undefined` — the fields are `optionalKey`).
19602
+ */
19603
+ const releaseAgeOf = (config) => ({
19604
+ ...config.minimumReleaseAge !== void 0 ? { ageMinutes: config.minimumReleaseAge } : {},
19605
+ ...config.minimumReleaseAgeExclude !== void 0 ? { exclude: config.minimumReleaseAgeExclude } : {}
19606
+ });
18830
19607
  /** Fold the hook config back into the normalized `catalog name → dependency → range` record. */
18831
19608
  const configToEntries = (config) => {
18832
19609
  const raw = { ...config.catalogs };
@@ -18866,7 +19643,10 @@ var ConfigDependencyHooks = class ConfigDependencyHooks extends effect.Context.S
18866
19643
  * config dependency. The default {@link WorkspaceCatalogs} layer wires this, so
18867
19644
  * the default catalog path provably executes no config-dependency code.
18868
19645
  */
18869
- static layerNoop = effect.Layer.succeed(ConfigDependencyHooks, { inject: (_root, _configDependencies, seed) => effect.Effect.succeed(seed) });
19646
+ static layerNoop = effect.Layer.succeed(ConfigDependencyHooks, { inject: (_root, _configDependencies, seed) => effect.Effect.succeed({
19647
+ catalogs: seed,
19648
+ releaseAge: {}
19649
+ }) });
18870
19650
  /**
18871
19651
  * The live layer: dynamically imports each config dependency's `pnpmfile.cjs`
18872
19652
  * (in process, no subprocess) and replays its `updateConfig` hook over the
@@ -18875,13 +19655,20 @@ var ConfigDependencyHooks = class ConfigDependencyHooks extends effect.Context.S
18875
19655
  * `hooks`-source `CatalogAssemblyError`, never a silent skip.
18876
19656
  *
18877
19657
  * @remarks
18878
- * Node-coupled by design the `node:fs` / `node:path` / `node:url` imports are
18879
- * the sanctioned Node-only overlay, matching the other seams here. Only ever
18880
- * wired by `WorkspaceCatalogs.layerWithConfigDependencies`.
19658
+ * Runtime-coupled by design, not node-exclusive. The `import()` below loads
19659
+ * **and executes** a config dependency's pnpmfile in-process code execution,
19660
+ * not IO, so no `FileSystem` / `Path` service abstracts it. The `node:path` and
19661
+ * `node:url` imports (`join`, `pathToFileURL`) exist only to build the URL that
19662
+ * `import()` consumes; node and bun both implement those builtins and dynamic
19663
+ * import, so this layer runs on either runtime. Only ever wired by
19664
+ * `WorkspaceCatalogs.layerWithConfigDependencies`.
18881
19665
  */
18882
19666
  static layerLive = effect.Layer.succeed(ConfigDependencyHooks, { inject: (root, configDependencies, seed) => effect.Effect.gen(function* () {
18883
19667
  const names = Object.keys(configDependencies);
18884
- if (names.length === 0) return seed;
19668
+ if (names.length === 0) return {
19669
+ catalogs: seed,
19670
+ releaseAge: {}
19671
+ };
18885
19672
  let config = seedToConfig(seed);
18886
19673
  for (const name of names) {
18887
19674
  if (hasTraversalSegment(name)) return yield* effect.Effect.fail(new CatalogAssemblyError({
@@ -18922,11 +19709,14 @@ var ConfigDependencyHooks = class ConfigDependencyHooks extends effect.Context.S
18922
19709
  })
18923
19710
  });
18924
19711
  }
18925
- return configToEntries(config);
19712
+ return {
19713
+ catalogs: configToEntries(config),
19714
+ releaseAge: releaseAgeOf(config)
19715
+ };
18926
19716
  }) });
18927
19717
  };
18928
19718
  //#endregion
18929
- //#region ../../node_modules/.pnpm/@effected+workspaces@0.4.1_@effected+jsonc@0.4.0_effect@4.0.0-beta.99__effect@4.0.0-beta.99/node_modules/@effected/workspaces/PackageManagerName.js
19719
+ //#region ../../node_modules/.pnpm/@effected+workspaces@0.6.0_@effected+jsonc@0.5.0_effect@4.0.0-beta.99__effect@4.0.0-beta.99/node_modules/@effected/workspaces/PackageManagerName.js
18930
19720
  /**
18931
19721
  * The four package managers this package understands.
18932
19722
  *
@@ -19168,7 +19958,7 @@ var PackageManagerDetector = class PackageManagerDetector extends effect.Context
19168
19958
  static layer = effect.Layer.effect(PackageManagerDetector, PackageManagerDetector.make);
19169
19959
  };
19170
19960
  //#endregion
19171
- //#region ../../node_modules/.pnpm/@effected+workspaces@0.4.1_@effected+jsonc@0.4.0_effect@4.0.0-beta.99__effect@4.0.0-beta.99/node_modules/@effected/workspaces/LockfileReader.js
19961
+ //#region ../../node_modules/.pnpm/@effected+workspaces@0.6.0_@effected+jsonc@0.5.0_effect@4.0.0-beta.99__effect@4.0.0-beta.99/node_modules/@effected/workspaces/LockfileReader.js
19172
19962
  /**
19173
19963
  * Raised when the workspace's lockfile cannot be read off disk.
19174
19964
  *
@@ -19278,7 +20068,7 @@ var LockfileReader = class LockfileReader extends effect.Context.Service()("@eff
19278
20068
  static layer = (options) => effect.Layer.effect(LockfileReader, LockfileReader.make(options));
19279
20069
  };
19280
20070
  //#endregion
19281
- //#region ../../node_modules/.pnpm/@effected+workspaces@0.4.1_@effected+jsonc@0.4.0_effect@4.0.0-beta.99__effect@4.0.0-beta.99/node_modules/@effected/workspaces/Publishability.js
20071
+ //#region ../../node_modules/.pnpm/@effected+workspaces@0.6.0_@effected+jsonc@0.5.0_effect@4.0.0-beta.99__effect@4.0.0-beta.99/node_modules/@effected/workspaces/Publishability.js
19282
20072
  /** The public npm registry, used when `publishConfig.registry` says nothing. */
19283
20073
  const DEFAULT_REGISTRY = "https://registry.npmjs.org/";
19284
20074
  /**
@@ -19378,7 +20168,7 @@ var PublishabilityDetector = class PublishabilityDetector extends effect.Context
19378
20168
  }) });
19379
20169
  };
19380
20170
  //#endregion
19381
- //#region ../../node_modules/.pnpm/@effected+workspaces@0.4.1_@effected+jsonc@0.4.0_effect@4.0.0-beta.99__effect@4.0.0-beta.99/node_modules/@effected/workspaces/WorkspaceCatalogs.js
20171
+ //#region ../../node_modules/.pnpm/@effected+workspaces@0.6.0_@effected+jsonc@0.5.0_effect@4.0.0-beta.99__effect@4.0.0-beta.99/node_modules/@effected/workspaces/WorkspaceCatalogs.js
19382
20172
  /**
19383
20173
  * An immutable, fully-normalized catalog collection — the one catalog
19384
20174
  * resolution semantic in the package.
@@ -19551,6 +20341,37 @@ const configDependenciesOf = (document) => {
19551
20341
  for (const [name, spec] of Object.entries(document.configDependencies)) if (typeof spec === "string") out[name] = spec;
19552
20342
  return out;
19553
20343
  };
20344
+ /**
20345
+ * The inline release-age gate contribution of a parsed `pnpm-workspace.yaml`
20346
+ * document — pnpm's top-level `minimumReleaseAge` (minutes) and
20347
+ * `minimumReleaseAgeExclude` (name patterns) keys, mapped onto
20348
+ * `@effected/npm`'s `PartialReleaseAgeGate` field names
20349
+ * (`ageMinutes` / `exclude`).
20350
+ *
20351
+ * @remarks
20352
+ * **Hard-fail by design**, the same posture as the live catalog-block reader:
20353
+ * a present-but-malformed value (a non-numeric `minimumReleaseAge`, a
20354
+ * `minimumReleaseAgeExclude` that is not a string array) fails typed as a
20355
+ * `CatalogAssemblyError` rather than being silently dropped, because a
20356
+ * silently-ignored gate is the "install refuses a too-young version the
20357
+ * resolver already picked" bug this vocabulary exists to prevent. An absent or
20358
+ * explicitly `null` key contributes nothing; the permissive
20359
+ * `PartialReleaseAgeGate` accepts any finite `ageMinutes` (negatives and
20360
+ * fractions included) — `ReleaseAgeGate.combine` is the single clamping
20361
+ * authority, exactly as on the hook path.
20362
+ */
20363
+ const inlineReleaseAge = (document) => {
20364
+ if (!isObject$1(document)) return effect.Effect.succeed({});
20365
+ const raw = {};
20366
+ if (document.minimumReleaseAge !== void 0 && document.minimumReleaseAge !== null) raw.ageMinutes = document.minimumReleaseAge;
20367
+ if (document.minimumReleaseAgeExclude !== void 0 && document.minimumReleaseAgeExclude !== null) raw.exclude = document.minimumReleaseAgeExclude;
20368
+ if (Object.keys(raw).length === 0) return effect.Effect.succeed({});
20369
+ return effect.Schema.decodeUnknownEffect(PartialReleaseAgeGate)(raw).pipe(effect.Effect.catchTag("SchemaError", (cause) => new CatalogAssemblyError({
20370
+ source: "manifest",
20371
+ path: "pnpm-workspace.yaml",
20372
+ cause
20373
+ })));
20374
+ };
19554
20375
  /** A hard-fail catalog-assembly failure naming the malformed part of a `workspaces` field. */
19555
20376
  const malformed = (source, path, detail) => new CatalogAssemblyError({
19556
20377
  source,
@@ -19671,6 +20492,8 @@ var WorkspaceCatalogs = class WorkspaceCatalogs extends effect.Context.Service()
19671
20492
  const hasPnpmWorkspace = yield* probeExists(workspaceYaml);
19672
20493
  let inline;
19673
20494
  let injected;
20495
+ let inlineGate = {};
20496
+ let hookGate = {};
19674
20497
  if (hasPnpmWorkspace) {
19675
20498
  const text = yield* fs.readFileString(workspaceYaml).pipe(effect.Effect.mapError((cause) => new CatalogAssemblyError({
19676
20499
  source: "manifest",
@@ -19684,11 +20507,16 @@ var WorkspaceCatalogs = class WorkspaceCatalogs extends effect.Context.Service()
19684
20507
  })));
19685
20508
  yield* validatePnpmWorkspaceCatalogs(document);
19686
20509
  inline = CatalogSet.fromCatalogs(inlineCatalogs(catalogBlocksOf(document)));
19687
- const injectedEntries = yield* hooks.inject(root, configDependenciesOf(document), inline.entries);
19688
- injected = CatalogSet.fromCatalogs(injectedEntries);
20510
+ inlineGate = yield* inlineReleaseAge(document);
20511
+ const injection = yield* hooks.inject(root, configDependenciesOf(document), inline.entries);
20512
+ injected = CatalogSet.fromCatalogs(injection.catalogs);
20513
+ hookGate = injection.releaseAge;
19689
20514
  } else {
19690
20515
  const manifestPath = path.join(root, "package.json");
19691
- if (!(yield* probeExists(manifestPath))) return fromLockfile;
20516
+ if (!(yield* probeExists(manifestPath))) return {
20517
+ catalogs: fromLockfile,
20518
+ releaseAgeGate: ReleaseAgeGate.combine()
20519
+ };
19692
20520
  const text = yield* fs.readFileString(manifestPath).pipe(effect.Effect.mapError((cause) => new CatalogAssemblyError({
19693
20521
  source: "manifest",
19694
20522
  path: manifestPath,
@@ -19698,20 +20526,28 @@ var WorkspaceCatalogs = class WorkspaceCatalogs extends effect.Context.Service()
19698
20526
  injected = CatalogSet.empty();
19699
20527
  }
19700
20528
  const assembled = CatalogSet.merge(fromLockfile, inline, injected);
20529
+ const releaseAgeGate = ReleaseAgeGate.combine(inlineGate, hookGate);
19701
20530
  yield* effect.Effect.logDebug("Catalogs assembled").pipe(effect.Effect.annotateLogs({
19702
20531
  "workspace.root": root,
19703
- "workspace.catalogs": Object.keys(assembled.entries).join(",")
20532
+ "workspace.catalogs": Object.keys(assembled.entries).join(","),
20533
+ "workspace.releaseAgeMinutes": releaseAgeGate.ageMinutes
19704
20534
  }));
19705
- return assembled;
20535
+ return {
20536
+ catalogs: assembled,
20537
+ releaseAgeGate
20538
+ };
19706
20539
  });
19707
20540
  const [resolveOnce, invalidate] = yield* effect.Effect.cachedInvalidateWithTTL(assemble, effect.Duration.infinity);
19708
20541
  const memo = effect.Effect.onExit(resolveOnce, (exit) => effect.Exit.isSuccess(exit) ? effect.Effect.void : invalidate);
19709
20542
  return {
19710
20543
  set: effect.Effect.fn("WorkspaceCatalogs.set")(function* () {
19711
- return yield* memo;
20544
+ return (yield* memo).catalogs;
19712
20545
  }),
19713
20546
  resolveSpecifier: effect.Effect.fn("WorkspaceCatalogs.resolveSpecifier")(function* (dependency, specifier) {
19714
- return (yield* memo).resolveSpecifier(dependency, specifier);
20547
+ return (yield* memo).catalogs.resolveSpecifier(dependency, specifier);
20548
+ }),
20549
+ releaseAgeGate: effect.Effect.fn("WorkspaceCatalogs.releaseAgeGate")(function* () {
20550
+ return (yield* memo).releaseAgeGate;
19715
20551
  })
19716
20552
  };
19717
20553
  });
@@ -19762,7 +20598,7 @@ var WorkspaceCatalogs = class WorkspaceCatalogs extends effect.Context.Service()
19762
20598
  }));
19763
20599
  };
19764
20600
  //#endregion
19765
- //#region ../../node_modules/.pnpm/@effected+workspaces@0.4.1_@effected+jsonc@0.4.0_effect@4.0.0-beta.99__effect@4.0.0-beta.99/node_modules/@effected/workspaces/WorkspaceStateSnapshot.js
20601
+ //#region ../../node_modules/.pnpm/@effected+workspaces@0.6.0_@effected+jsonc@0.5.0_effect@4.0.0-beta.99__effect@4.0.0-beta.99/node_modules/@effected/workspaces/WorkspaceStateSnapshot.js
19766
20602
  const EMPTY = Object.freeze(Object.create(null));
19767
20603
  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)));
19768
20604
  /**
@@ -19927,7 +20763,7 @@ var WorkspaceStateSnapshot = class extends effect.Schema.Class("WorkspaceStateSn
19927
20763
  }
19928
20764
  };
19929
20765
  //#endregion
19930
- //#region ../../node_modules/.pnpm/@effected+workspaces@0.4.1_@effected+jsonc@0.4.0_effect@4.0.0-beta.99__effect@4.0.0-beta.99/node_modules/@effected/workspaces/WorkspaceSnapshots.js
20766
+ //#region ../../node_modules/.pnpm/@effected+workspaces@0.6.0_@effected+jsonc@0.5.0_effect@4.0.0-beta.99__effect@4.0.0-beta.99/node_modules/@effected/workspaces/WorkspaceSnapshots.js
19931
20767
  /** Whether `value` is a non-null, non-array object. */
19932
20768
  const isObject = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
19933
20769
  /** Whether every value in a record is a string — a usable dependency map. */
@@ -20119,7 +20955,7 @@ var WorkspaceSnapshots = class WorkspaceSnapshots extends effect.Context.Service
20119
20955
  static layer = (options) => effect.Layer.effect(WorkspaceSnapshots, WorkspaceSnapshots.make(options));
20120
20956
  };
20121
20957
  //#endregion
20122
- //#region ../../node_modules/.pnpm/@effected+workspaces@0.4.1_@effected+jsonc@0.4.0_effect@4.0.0-beta.99__effect@4.0.0-beta.99/node_modules/@effected/workspaces/Workspaces.js
20958
+ //#region ../../node_modules/.pnpm/@effected+workspaces@0.6.0_@effected+jsonc@0.5.0_effect@4.0.0-beta.99__effect@4.0.0-beta.99/node_modules/@effected/workspaces/Workspaces.js
20123
20959
  /**
20124
20960
  * Every service that needs only a filesystem: root, package-manager detection,
20125
20961
  * discovery, lockfile reading, catalogs and publishability.
@@ -20487,34 +21323,15 @@ effect.Layer.effect(PublishabilityDetector, effect.Effect.gen(function* () {
20487
21323
  }) };
20488
21324
  }));
20489
21325
  /**
20490
- * The workspace root a package was discovered against, derived from its own
20491
- * coordinates: `relativePath` is the package directory relative to the
20492
- * discovery root (POSIX, `"."` for the root package), so ascending one level
20493
- * per path segment from `pkg.path` lands exactly on that root.
20494
- *
20495
- * @remarks
20496
- * Derivation is deliberate — probing the filesystem for workspace markers
20497
- * (`WorkspaceRoot.find`) can walk PAST the intended root when that root
20498
- * carries no marker (a fixture tree, a bare directory) and land on an
20499
- * enclosing workspace, silently swapping in that outer root's
20500
- * `.changeset/config.json` and dropping the ignore/mode gating (the #209
20501
- * regression class). The discovery root needs no probing: whoever built the
20502
- * `WorkspacePackage` already knew it.
20503
- */
20504
- const packageRoot = (pkg) => {
20505
- const segments = pkg.relativePath.split("/").filter((segment) => segment !== "" && segment !== ".");
20506
- return segments.length === 0 ? pkg.path : (0, node_path.join)(pkg.path, ...segments.map(() => ".."));
20507
- };
20508
- /**
20509
21326
  * Ignore-aware override of `PublishabilityDetector`. `detect` short-circuits to `[]`
20510
21327
  * for changeset-ignored packages, then dispatches on `ChangesetConfig.mode`:
20511
21328
  * `none` → `[]`; `silk` → `SilkPublishability.detect`; `vanilla` → the library default.
20512
21329
  *
20513
21330
  * @remarks Requires `FileSystem` and {@link ChangesetConfig} at build.
20514
21331
  * The kit's `detect` contract no longer receives the workspace root, so the changeset
20515
- * lookups derive it per package from the package's own discovery coordinates
20516
- * (`pkg.path` ascended by `pkg.relativePath` — never a filesystem marker walk,
20517
- * which could escape an unmarked root and read the wrong `.changeset/config.json`).
21332
+ * lookups read it from `pkg.workspaceRoot` the discovery root the package was found
21333
+ * against, never a filesystem marker walk, which could escape an unmarked root and read
21334
+ * the wrong `.changeset/config.json`.
20518
21335
  *
20519
21336
  * @since 0.4.0
20520
21337
  * @public
@@ -20524,7 +21341,7 @@ const PublishabilityDetectorAdaptiveLive = effect.Layer.effect(PublishabilityDet
20524
21341
  const config = yield* ChangesetConfig;
20525
21342
  const vanilla = yield* effect.Effect.provide(PublishabilityDetector, PublishabilityDetector.layer);
20526
21343
  return { detect: (pkg) => effect.Effect.gen(function* () {
20527
- const root = packageRoot(pkg);
21344
+ const root = pkg.workspaceRoot;
20528
21345
  if (yield* config.isIgnored(pkg.name, root)) return [];
20529
21346
  const mode = yield* config.mode(root);
20530
21347
  if (mode === "none") return [];
@@ -45097,25 +45914,15 @@ function normalizeLegacyOptions(options, configPath) {
45097
45914
  };
45098
45915
  }
45099
45916
  /** Match dotfiles, mirroring the former tinyglobby `dot: true` behavior. */
45100
- const GLOB_OPTIONS = GlobPatternOptions.make({ dot: true });
45917
+ const GLOB_OPTIONS$1 = GlobPatternOptions.make({ dot: true });
45101
45918
  /**
45102
- * Compile `glob` via `@effected/glob`, folding a compile-guard trip
45103
- * (over-length pattern, brace-expansion budget, nesting depth) into a
45104
- * {@link ConfigurationError} naming the offending glob on the typed channel.
45105
- */
45106
- function compileGlob(glob) {
45107
- return GlobPattern.compile(glob, GLOB_OPTIONS).pipe(effect.Effect.mapError((error) => new ConfigurationError({
45108
- field: "glob",
45109
- reason: `Invalid glob pattern ${JSON.stringify(glob)}: ${error.message}`
45110
- })));
45111
- }
45112
45919
  /**
45113
45920
  * Pure attribution helper: does `glob` (under this service's `dot: true`
45114
45921
  * semantics) match the repo-relative POSIX path `rel`? An uncompilable
45115
45922
  * pattern matches nothing.
45116
45923
  */
45117
45924
  function globMatchesRel(glob, rel) {
45118
- const result = effect.Effect.runSync(effect.Effect.result(GlobPattern.compile(glob, GLOB_OPTIONS)));
45925
+ const result = GlobPattern.compileResult(glob, GLOB_OPTIONS$1);
45119
45926
  return effect.Result.isSuccess(result) && result.success.matches(rel);
45120
45927
  }
45121
45928
  /**
@@ -45131,13 +45938,14 @@ function globMatchesRel(glob, rel) {
45131
45938
  * module already speaks POSIX-relative match paths).
45132
45939
  */
45133
45940
  function materializeGlob(glob, cwd) {
45134
- return compileGlob(glob).pipe(effect.Effect.flatMap((pattern) => descend(pattern, {
45941
+ return compileAndExpand(glob, {
45135
45942
  cwd,
45136
- onUnreadable: "skip"
45943
+ onUnreadable: "skip",
45944
+ glob: GLOB_OPTIONS$1
45137
45945
  }).pipe(effect.Effect.mapError((error) => new ConfigurationError({
45138
45946
  field: "glob",
45139
- reason: `Failed to materialize glob ${JSON.stringify(glob)}: ${error.message}`
45140
- })), effect.Effect.provide(effect.Path.layer))));
45947
+ reason: error.stage === "compile" ? `Invalid glob pattern ${JSON.stringify(glob)}: ${error.cause.message}` : `Failed to materialize glob ${JSON.stringify(glob)}: ${error.cause.message}`
45948
+ })), effect.Effect.provide(effect.Path.layer));
45141
45949
  }
45142
45950
  /**
45143
45951
  * Determine whether `child` is the same directory as `parent` or sits inside
@@ -46839,19 +47647,29 @@ var VersionFiles = class VersionFiles {
46839
47647
  }
46840
47648
  };
46841
47649
  /**
47650
+ * Match dotfiles, matching `ConfigInspector`'s glob dialect.
47651
+ *
47652
+ * @remarks
47653
+ * This module previously compiled with minimatch DEFAULTS while
47654
+ * `ConfigInspector` compiled with `dot: true`, so a wildcard segment matching
47655
+ * a dotted directory was attributed to a package but never materialized (or
47656
+ * the reverse). The two paths must agree: attribution and materialization
47657
+ * answer the same question about the same glob.
47658
+ */
47659
+ const GLOB_OPTIONS = GlobPatternOptions.make({ dot: true });
47660
+ /**
46842
47661
  * Expand a glob pattern against the filesystem, returning matching FILE paths
46843
47662
  * relative to `cwd` (POSIX separators), sorted by relative path.
46844
47663
  *
46845
47664
  * @remarks
46846
- * The walk is `@effected/walker`'s `descend` (literal fast path,
47665
+ * The walk is `@effected/walker`'s `compileAndExpand` (literal fast path,
46847
47666
  * `enumerationPrefix` bounding, `node_modules`/`.git` pruning), with
46848
47667
  * `onUnreadable: "skip"` preserving this module's silent-skip policy for
46849
- * unreadable directories. Matching semantics are minimatch DEFAULTS via the
46850
- * compiled pattern notably, wildcards do not match dotfiles, same as the
46851
- * previous `tinyglobby` defaults. An uncompilable pattern expands to no
46852
- * matches. `descend`'s `Path` requirement is satisfied internally with the
46853
- * core POSIX `Path.layer` this module already speaks POSIX relative match
46854
- * paths and node-bound absolute paths throughout.
47668
+ * unreadable directories. Matching semantics are {@link GLOB_OPTIONS}
47669
+ * wildcards DO match dotfiles, aligning this module with `ConfigInspector`. An
47670
+ * uncompilable pattern expands to no matches. The `Path` requirement is
47671
+ * satisfied internally with the core POSIX `Path.layer` this module already
47672
+ * speaks POSIX relative match paths and node-bound absolute paths throughout.
46855
47673
  *
46856
47674
  * @param source - The glob pattern, repo-relative
46857
47675
  * @param cwd - Absolute directory the pattern is resolved against
@@ -46860,13 +47678,11 @@ var VersionFiles = class VersionFiles {
46860
47678
  * @internal
46861
47679
  */
46862
47680
  function expandGlob(source, cwd) {
46863
- return effect.Effect.option(GlobPattern.compile(source)).pipe(effect.Effect.flatMap(effect.Option.match({
46864
- onNone: () => effect.Effect.succeed([]),
46865
- onSome: (pattern) => descend(pattern, {
46866
- cwd,
46867
- onUnreadable: "skip"
46868
- })
46869
- })), effect.Effect.provide(effect.Path.layer));
47681
+ return compileAndExpand(source, {
47682
+ cwd,
47683
+ onUnreadable: "skip",
47684
+ glob: GLOB_OPTIONS
47685
+ }).pipe(effect.Effect.catch((error) => error.stage === "compile" ? effect.Effect.succeed([]) : effect.Effect.fail(error)), effect.Effect.provide(effect.Path.layer));
46870
47686
  }
46871
47687
  /**
46872
47688
  * Read the `version` field from a `package.json` in the given directory.