@deslop/coding-standards 0.1.1068 → 0.1.1071

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/install.js CHANGED
@@ -1,14 +1,14 @@
1
1
  #!/usr/bin/env node
2
- import { $n as isFunction, $t as causeAnnotate, A as fromIterable$1, An as NodeInspectSymbol, At as String$6, Bn as symbol, Bt as CauseImpl, Cn as makePrimitiveProto, Cr as pipe, Ct as none, Dn as getStackTraceLimit, E as findLast, En as internalCall, Er as pipeArguments, F as isArrayNonEmpty, Fn as formatPath, G as reduce, Gt as Fail, H as match$5, Hn as combine$1, Ht as Done$1, I as isCanonicalArrayIndex, In as formatPropertyKey, It as mapInput, Jn as structure, Jt as ReasonBase, K as some$1, Kn as random, Kt as InterruptorStackTrace, L as isReadonlyArrayNonEmpty, Ln as currentFiberTypeId, Mn as format$1, On as setStackTraceLimit, Pn as formatJson, Qn as isError, Qt as args, R as join$1, S as filter, Sn as makePrimitive$1, Sr as memoizeIdempotent, St as match$4, T as findFirstIndex, Tn as assignProperty, Tr as Prototype$1, Tt as some, U as of, Un as hash, Ut as Error$3, V as map$9, Vt as Die, Wn as number$1, Wt as ExitTypeId, Xn as hasProperty, Xt as TaggedError$2, Yn as symbol$1, Yt as StackTraceKey, Zn as isBoolean$1, Zt as Yield, _ as dedupe, _n as isDone$2, _r as constVoid, _t as getOrUndefined$1, an as constEmptyAnnotations, ar as isNumber, at as succeed$6, bn as isFailReason$1, br as identity, c as startsWith, cn as contE, d as Error$2, dn as exitDie, dr as isTagged, en as causeCombine, er as isIterable, et as fail$5, f as TaggedError$1, fn as exitFail, fr as isUndefined, ft as flatMap$3, g as contains, gn as isDieReason$1, gr as constUndefined, gt as getOrElse, hn as isCause, hr as constTrue, ht as fromUndefinedOr, in as causeFromReasons, ir as isNullish, it as match$3, jn as toStringUnknown, jt as isGreaterThan$1, kn as BaseProto, kt as Number$6, ln as done$1, lt as exists, m as append$1, mn as exitSucceed, mr as constFalse, mt as fromNullishOr, n as make$29, nn as causeEmpty, nr as isNotNullish, on as contA, or as isObject, ot as normalize$1, p as taggedEnum, pn as exitFailCause, pr as isUnknown, qn as string$1, qt as PipeInspectableProto, rn as causeFail, rr as isNotUndefined, rt as isFailure$1, sn as contAll, sr as isObjectKeyword, tn as causeDie, tr as isNotNull, u as trimEnd, un as evaluate, ur as isString, vn as isEffect$1, vr as constant, vt as isNone, w as findFirst, wn as withFiber$1, wr as Class, xn as isInterruptReason, xr as memoize, xt as map$10, y as empty$3, yn as isExit, yr as dual, yt as isSome, zn as equals$1 } from "./MutableRef-WrqsqeER.mjs";
2
+ import { $n as symbol$1, $t as TaggedError$2, A as fromIterable$1, An as getStackTraceLimit, Ar as Prototype$1, Bn as currentFiberTypeId, Cn as isFailReason$1, Cr as constant, Dn as withFiber$1, Dr as memoizeIdempotent, E as findLast, En as makePrimitiveProto, Er as memoize, Et as none, F as isArrayNonEmpty, Fn as format$1, G as reduce, Gn as combine$1, Gt as Done$1, H as match$5, Hn as equals$1, I as isCanonicalArrayIndex, Jt as Fail, K as some$1, Kn as hash, Kt as Error$3, L as isReadonlyArrayNonEmpty, Ln as formatJson, Mn as BaseProto, Mt as Number$6, Nn as NodeInspectSymbol, Nt as String$6, On as assignProperty, Or as pipe, Ot as some, Pn as toStringUnknown, Pt as isGreaterThan$1, Qt as StackTraceKey, R as join$1, Rn as formatPath, S as filter, Sn as isExit, Sr as constVoid, St as isSome, T as findFirstIndex, Tn as makePrimitive$1, Tr as identity, Tt as match$4, U as of, Un as symbol, Ut as CauseImpl, V as map$8, Wt as Die, Xn as string$1, Xt as PipeInspectableProto, Yn as random, Yt as InterruptorStackTrace, Zn as structure, Zt as ReasonBase, _ as dedupe, _n as exitSucceed, _r as isUndefined, _t as fromNullishOr, an as causeEmpty, ar as isIterable, bn as isDone$2, br as constTrue, bt as getOrUndefined$1, c as startsWith, cn as constEmptyAnnotations, cr as isNotUndefined, ct as succeed$6, d as Error$2, dn as contE, dr as isObject, en as Yield, er as hasProperty, et as fail$5, f as TaggedError$1, fn as done$1, fr as isObjectKeyword, ft as exists, g as contains, gn as exitFailCause, gr as isTagged, hn as exitFail, hr as isString$1, ht as flatMap$4, in as causeDie, ir as isFunction, it as isFailure$1, jn as setStackTraceLimit, jr as pipeArguments, kn as internalCall, kr as Class, ln as contA, lr as isNullish, lt as normalize$1, m as append$1, mn as exitDie, n as make$29, nn as causeAnnotate, nr as isBoolean$1, on as causeFail, or as isNotNull, p as taggedEnum, pn as evaluate, qn as number$1, qt as ExitTypeId, rn as causeCombine, rr as isError, sn as causeFromReasons, sr as isNotNullish, st as match$3, tn as args, u as trimEnd, un as contAll, ur as isNumber, vn as isCause, vr as isUnknown, vt as fromUndefinedOr, w as findFirst, wn as isInterruptReason, wr as dual, xn as isEffect$1, xr as constUndefined, xt as isNone, y as empty$3, yn as isDieReason$1, yr as constFalse, yt as getOrElse, zn as formatPropertyKey, zt as mapInput } from "./MutableRef-KfyWrSvW.mjs";
3
+ import * as OS from "node:os";
3
4
  import * as NodeChildProcess from "node:child_process";
4
5
  import { PassThrough } from "node:stream";
5
6
  import * as NodeCrypto from "node:crypto";
6
7
  import * as NFS from "node:fs";
7
- import * as OS from "node:os";
8
8
  import * as Path from "node:path";
9
9
  import * as NodeUrl from "node:url";
10
10
  import * as readline from "node:readline";
11
- //#region ../../node_modules/.pnpm/effect@4.0.2/node_modules/effect/dist/Effectable.js
11
+ //#region ../../node_modules/.pnpm/effect@4.0.4/node_modules/effect/dist/Effectable.js
12
12
  /**
13
13
  * Create a low-level `Effect` prototype.
14
14
  *
@@ -34,7 +34,7 @@ const Prototype = (options) => makePrimitiveProto({
34
34
  [evaluate]: options.evaluate
35
35
  });
36
36
  //#endregion
37
- //#region ../../node_modules/.pnpm/effect@4.0.2/node_modules/effect/dist/Context.js
37
+ //#region ../../node_modules/.pnpm/effect@4.0.4/node_modules/effect/dist/Context.js
38
38
  /**
39
39
  * Runtime type identifier attached to `Context` service keys and used by
40
40
  * `isKey` to recognize them.
@@ -140,7 +140,7 @@ const ServiceProto = {
140
140
  };
141
141
  const cacheKeys = /*#__PURE__*/ new Set();
142
142
  const ReferenceTypeId = "~effect/Context/Reference";
143
- const TypeId$31 = "~effect/Context";
143
+ const TypeId$33 = "~effect/Context";
144
144
  const MaxDepth = 8;
145
145
  const FlattenAfterBaseHits = 8;
146
146
  const makeImpl = (cacheRoot, base, overlay, depth) => {
@@ -221,7 +221,7 @@ const Proto$10 = {
221
221
  return flatten(this);
222
222
  },
223
223
  ...PipeInspectableProto,
224
- [TypeId$31]: { _Services: (_) => _ },
224
+ [TypeId$33]: { _Services: (_) => _ },
225
225
  toJSON() {
226
226
  return {
227
227
  _id: "Context",
@@ -277,7 +277,7 @@ const hasSameCache = (self, that) => self.cacheRoot === that.cacheRoot;
277
277
  * @category guards
278
278
  * @since 2.0.0
279
279
  */
280
- const isContext = (u) => hasProperty(u, TypeId$31);
280
+ const isContext = (u) => hasProperty(u, TypeId$33);
281
281
  /**
282
282
  * Checks whether the provided argument is a `Reference`.
283
283
  *
@@ -384,7 +384,8 @@ const addUnsafe = (self, key, service) => {
384
384
  const impl = self;
385
385
  const cacheRoot = cacheKeys.has(key) ? void 0 : impl.cacheRoot;
386
386
  if (impl.depth >= MaxDepth) {
387
- const map = new Map(impl.mapUnsafe);
387
+ const map = new Map(impl._flat ?? impl.base);
388
+ if (!impl._flat) applyOverlays(map, impl.overlay);
388
389
  map.set(key, service);
389
390
  return makeImpl(cacheRoot, map, void 0, 0);
390
391
  }
@@ -685,15 +686,16 @@ const mergeAll$1 = (...ctxs) => {
685
686
  */
686
687
  const Reference = Service;
687
688
  //#endregion
688
- //#region ../../node_modules/.pnpm/effect@4.0.2/node_modules/effect/dist/Duration.js
689
- const TypeId$30 = "~effect/Duration";
689
+ //#region ../../node_modules/.pnpm/effect@4.0.4/node_modules/effect/dist/Duration.js
690
+ const TypeId$32 = "~effect/Duration";
690
691
  const bigint0$2 = /*#__PURE__*/ BigInt(0);
691
692
  const bigint1$2 = /*#__PURE__*/ BigInt(1);
692
693
  const bigint2 = /*#__PURE__*/ BigInt(2);
693
694
  const bigint10$1 = /*#__PURE__*/ BigInt(10);
694
695
  const bigint1e3 = /*#__PURE__*/ BigInt(1e3);
695
- const roundTiesAwayFromZero = (input) => BigInt(input < 0 ? Math.ceil(input - .5) : Math.floor(input + .5));
696
+ const roundTiesAwayFromZero = (input) => BigInt(Math.sign(input) * Math.round(Math.abs(input)));
696
697
  const roundMillisToNanos = (millis) => roundTiesAwayFromZero(millis * 1e6);
698
+ const fromNanosNumber = (nanos) => make$25(Number.isFinite(nanos) ? roundTiesAwayFromZero(nanos) : nanos);
697
699
  const parseNanos = (input, scale) => {
698
700
  const decimalIndex = input.indexOf(".");
699
701
  if (decimalIndex === -1) return BigInt(input) * scale;
@@ -701,8 +703,12 @@ const parseNanos = (input, scale) => {
701
703
  const fractional = input.slice(decimalIndex + 1);
702
704
  const fractionalScale = bigint10$1 ** BigInt(fractional.length);
703
705
  const scaled = (BigInt(input.slice(isNegative ? 1 : 0, decimalIndex)) * fractionalScale + BigInt(fractional)) * scale;
704
- const rounded = scaled / fractionalScale + (scaled % fractionalScale * bigint2 >= fractionalScale ? bigint1$2 : bigint0$2);
705
- return isNegative ? -rounded : rounded;
706
+ return divideTiesAwayFromZero(isNegative ? -scaled : scaled, fractionalScale);
707
+ };
708
+ const divideTiesAwayFromZero = (numerator, denominator) => {
709
+ const absolute = numerator < bigint0$2 ? -numerator : numerator;
710
+ const rounded = absolute / denominator + (absolute % denominator * bigint2 >= denominator ? bigint1$2 : bigint0$2);
711
+ return numerator < bigint0$2 ? -rounded : rounded;
706
712
  };
707
713
  const DURATION_REGEXP = /^(-?\d+(?:\.\d+)?)\s+(nanos?|micros?|millis?|seconds?|minutes?|hours?|days?|weeks?)$/;
708
714
  /**
@@ -763,13 +769,13 @@ const fromInputUnsafe$1 = (input) => {
763
769
  }
764
770
  case "object": {
765
771
  if (input === null) break;
766
- if (TypeId$30 in input) return input;
772
+ if (TypeId$32 in input) return input;
767
773
  if (Array.isArray(input)) {
768
774
  if (input.length !== 2 || !input.every(isNumber)) return invalid$2(input);
769
775
  if (Number.isNaN(input[0]) || Number.isNaN(input[1])) return zero$1;
770
776
  if (input[0] === -Infinity || input[1] === -Infinity) return negativeInfinity;
771
777
  if (input[0] === Infinity || input[1] === Infinity) return infinity;
772
- return make$25(roundTiesAwayFromZero(input[0] * 1e9 + input[1]));
778
+ return fromNanosNumber(input[0] * 1e9 + input[1]);
773
779
  }
774
780
  const obj = input;
775
781
  let millis = 0;
@@ -780,7 +786,7 @@ const fromInputUnsafe$1 = (input) => {
780
786
  if (obj.seconds) millis += obj.seconds * 1e3;
781
787
  if (obj.milliseconds) millis += obj.milliseconds;
782
788
  if (!obj.microseconds && !obj.nanoseconds) return make$25(millis);
783
- return make$25(roundTiesAwayFromZero(millis * 1e6 + (obj.microseconds ?? 0) * 1e3 + (obj.nanoseconds ?? 0)));
789
+ return fromNanosNumber(millis * 1e6 + (obj.microseconds ?? 0) * 1e3 + (obj.nanoseconds ?? 0));
784
790
  }
785
791
  }
786
792
  return invalid$2(input);
@@ -795,7 +801,7 @@ const zeroDurationValue = {
795
801
  const infinityDurationValue = { _tag: "Infinity" };
796
802
  const negativeInfinityDurationValue = { _tag: "NegativeInfinity" };
797
803
  const DurationProto = {
798
- [TypeId$30]: TypeId$30,
804
+ [TypeId$32]: TypeId$32,
799
805
  [symbol$1]() {
800
806
  switch (this.value._tag) {
801
807
  case "Millis": {
@@ -882,7 +888,7 @@ const make$25 = (input) => {
882
888
  * @category guards
883
889
  * @since 2.0.0
884
890
  */
885
- const isDuration = (u) => hasProperty(u, TypeId$30);
891
+ const isDuration = (u) => hasProperty(u, TypeId$32);
886
892
  /**
887
893
  * Checks whether a Duration is finite (not infinite).
888
894
  *
@@ -1217,7 +1223,7 @@ const Equivalence$1 = (self, that) => matchPair(self, that, {
1217
1223
  */
1218
1224
  const equals = /*#__PURE__*/ dual(2, (self, that) => Equivalence$1(self, that));
1219
1225
  //#endregion
1220
- //#region ../../node_modules/.pnpm/effect@4.0.2/node_modules/effect/dist/Scheduler.js
1226
+ //#region ../../node_modules/.pnpm/effect@4.0.4/node_modules/effect/dist/Scheduler.js
1221
1227
  /**
1222
1228
  * Controls how runnable Effect fiber tasks are dispatched.
1223
1229
  *
@@ -1311,6 +1317,15 @@ var PriorityBuckets = class {
1311
1317
  * operation counts to decide when fibers should yield, and is the default
1312
1318
  * scheduler implementation.
1313
1319
  *
1320
+ * **Gotchas**
1321
+ *
1322
+ * On Cloudflare Workers, request-owned scheduler timers can be discarded,
1323
+ * leaving shared fibers suspended. Use `new MixedScheduler("sync")` for the
1324
+ * whole application; see `HttpRouter.toWebHandler` for a recipe.
1325
+ * Sync mode does not yield to the event loop: CPU-heavy work delays other
1326
+ * requests, and I/O-polling loops can exhaust the CPU limit. It does not fix
1327
+ * request-owned timers (such as `Effect.sleep`) or request-bound async contexts.
1328
+ *
1314
1329
  * @stability stable
1315
1330
  * @category models
1316
1331
  * @since 2.0.0
@@ -1445,7 +1460,7 @@ const PreventSchedulerYield = /*#__PURE__*/ Reference("effect/Scheduler/PreventS
1445
1460
  defaultValue: () => false
1446
1461
  });
1447
1462
  //#endregion
1448
- //#region ../../node_modules/.pnpm/effect@4.0.2/node_modules/effect/dist/Tracer.js
1463
+ //#region ../../node_modules/.pnpm/effect@4.0.4/node_modules/effect/dist/Tracer.js
1449
1464
  /**
1450
1465
  * Defines the string key for the parent-span context service.
1451
1466
  *
@@ -1482,11 +1497,11 @@ const ParentSpanKey = "effect/Tracer/ParentSpan";
1482
1497
  */
1483
1498
  const TracerKey = "effect/Tracer";
1484
1499
  //#endregion
1485
- //#region ../../node_modules/.pnpm/effect@4.0.2/node_modules/effect/dist/internal/metric.js
1500
+ //#region ../../node_modules/.pnpm/effect@4.0.4/node_modules/effect/dist/internal/metric.js
1486
1501
  /** @internal */
1487
1502
  const FiberRuntimeMetricsKey = "effect/Metric/FiberRuntimeMetrics";
1488
1503
  //#endregion
1489
- //#region ../../node_modules/.pnpm/effect@4.0.2/node_modules/effect/dist/internal/references.js
1504
+ //#region ../../node_modules/.pnpm/effect@4.0.4/node_modules/effect/dist/internal/references.js
1490
1505
  /** @internal */
1491
1506
  const CurrentStackFrame = /*#__PURE__*/ Reference("effect/References/CurrentStackFrame", {
1492
1507
  fiberCached: true,
@@ -1512,7 +1527,7 @@ const MinimumLogLevel$1 = /*#__PURE__*/ Reference("effect/References/MinimumLogL
1512
1527
  /** @internal */
1513
1528
  const CurrentLogSpans = /*#__PURE__*/ Reference("effect/References/CurrentLogSpans", { defaultValue: () => [] });
1514
1529
  //#endregion
1515
- //#region ../../node_modules/.pnpm/effect@4.0.2/node_modules/effect/dist/internal/effect.js
1530
+ //#region ../../node_modules/.pnpm/effect@4.0.4/node_modules/effect/dist/internal/effect.js
1516
1531
  /** @internal */
1517
1532
  var Interrupt = class extends ReasonBase {
1518
1533
  constructor(fiberId, annotations = constEmptyAnnotations) {
@@ -2226,10 +2241,16 @@ const succeedPayload = function(_value, fiber) {
2226
2241
  return fiber.succeedWith(this.payload);
2227
2242
  };
2228
2243
  const continuationMarksStack = /*#__PURE__*/ (() => {
2244
+ const limit = /*#__PURE__*/ getStackTraceLimit();
2245
+ if (limit === 0) return false;
2229
2246
  const marker = "~effect/Effect/stackProbe";
2230
- return { [marker]: function stackProbe() {
2231
- return (/* @__PURE__ */ new Error()).stack;
2232
- } }[marker]()?.includes("[as " + marker + "]") === true;
2247
+ const probe = { [marker]: function stackProbe() {
2248
+ return /* @__PURE__ */ new Error();
2249
+ } };
2250
+ setStackTraceLimit(1);
2251
+ const error = /*#__PURE__*/ probe[marker]();
2252
+ setStackTraceLimit(limit);
2253
+ return error.stack?.includes("[as " + marker + "]") === true;
2233
2254
  })();
2234
2255
  const mapCont = function(value, fiber) {
2235
2256
  const f = this.payload;
@@ -2290,9 +2311,9 @@ const flatMapEager$1 = /*#__PURE__*/ dual(2, (self, f) => {
2290
2311
  return flatMap$2(self, f);
2291
2312
  });
2292
2313
  /** @internal */
2293
- const map$7 = /*#__PURE__*/ dual(2, (self, f) => new ContImpl(self, mapCont, f));
2314
+ const map$6 = /*#__PURE__*/ dual(2, (self, f) => new ContImpl(self, mapCont, f));
2294
2315
  /** @internal */
2295
- const mapEager$1 = /*#__PURE__*/ dual(2, (self, f) => effectIsExit(self) ? exitMap(self, f) : map$7(self, f));
2316
+ const mapEager$1 = /*#__PURE__*/ dual(2, (self, f) => effectIsExit(self) ? exitMap(self, f) : map$6(self, f));
2296
2317
  /** @internal */
2297
2318
  const catchEager$1 = /*#__PURE__*/ dual(2, (self, f) => {
2298
2319
  if (effectIsExit(self)) {
@@ -2312,6 +2333,8 @@ const exitIsFailure = (self) => self._tag === "Failure";
2312
2333
  /** @internal */
2313
2334
  const exitFilterCause = (self) => self._tag === "Failure" ? succeed$6(self.cause) : fail$5(self);
2314
2335
  /** @internal */
2336
+ const exitHasInterrupts = (self) => self._tag === "Failure" && hasInterrupts(self.cause);
2337
+ /** @internal */
2315
2338
  const exitVoid = /*#__PURE__*/ exitSucceed(void 0);
2316
2339
  /** @internal */
2317
2340
  const exitMap = /*#__PURE__*/ dual(2, (self, f) => self._tag === "Success" ? exitSucceed(f(self.value)) : self);
@@ -2400,7 +2423,7 @@ const catchTags$1 = /*#__PURE__*/ dual((args) => isEffect$1(args[0]), (self, cas
2400
2423
  let keys;
2401
2424
  return catchFilter$1(self, (e) => {
2402
2425
  keys ??= Object.keys(cases);
2403
- return hasProperty(e, "_tag") && isString(e["_tag"]) && keys.includes(e["_tag"]) ? succeed$6(e) : fail$5(e);
2426
+ return hasProperty(e, "_tag") && isString$1(e["_tag"]) && keys.includes(e["_tag"]) ? succeed$6(e) : fail$5(e);
2404
2427
  }, (e) => cases[e["_tag"]](e), orElse);
2405
2428
  });
2406
2429
  /** @internal */
@@ -2689,6 +2712,46 @@ const onExitFilter = /*#__PURE__*/ dual(3, (self, filter, f) => onExit$1(self, (
2689
2712
  }));
2690
2713
  /** @internal */
2691
2714
  const onError$1 = /*#__PURE__*/ dual(2, (self, f) => onExitFilter(self, exitFilterCause, f));
2715
+ const infiniteTTL = /*#__PURE__*/ constant(Infinity);
2716
+ const makeCachedUnsafe = (self, ttlMillis) => {
2717
+ let expiresAt = 0;
2718
+ let exit;
2719
+ let current;
2720
+ const join = (fiber, run) => {
2721
+ run.awaiters++;
2722
+ onExitUnsafe(fiber, () => {
2723
+ if (--run.awaiters > 0 || current !== run) return;
2724
+ current = void 0;
2725
+ return fiberInterrupt(run.fiber);
2726
+ });
2727
+ return fiberJoin(run.fiber);
2728
+ };
2729
+ return [withFiber$1((fiber) => {
2730
+ if (current !== void 0) return fiber === current.fiber ? fiberJoin(current.fiber) : join(fiber, current);
2731
+ if (exit !== void 0 && (expiresAt === Infinity || fiber.getRef(ClockRef).currentTimeMillisUnsafe() < expiresAt)) return exit;
2732
+ exit = void 0;
2733
+ const clock = fiber.getRef(ClockRef);
2734
+ const run = {
2735
+ fiber: new FiberImpl(fiber.context),
2736
+ awaiters: 0
2737
+ };
2738
+ current = run;
2739
+ const joined = join(fiber, run);
2740
+ run.fiber.evaluate(onExitPrimitive$1(self, (exit_) => {
2741
+ if (current !== run) return;
2742
+ current = void 0;
2743
+ if (exitHasInterrupts(exit_)) return;
2744
+ const duration = ttlMillis(exit_);
2745
+ expiresAt = duration === Infinity ? Infinity : clock.currentTimeMillisUnsafe() + duration;
2746
+ exit = exit_;
2747
+ }));
2748
+ return run.fiber._exit ?? joined;
2749
+ }), sync$1(() => {
2750
+ exit = void 0;
2751
+ })];
2752
+ };
2753
+ /** @internal */
2754
+ const cached$1 = (self) => sync$1(() => makeCachedUnsafe(self, infiniteTTL)[0]);
2692
2755
  /** @internal */
2693
2756
  const interrupt$2 = /*#__PURE__*/ withFiber$1((fiber) => failCause$3(causeInterrupt(fiber.id)));
2694
2757
  /** @internal */
@@ -2742,7 +2805,7 @@ const all$1 = (arg, options) => {
2742
2805
  else if (options?.discard) return options.mode === "result" ? forEach$2(Object.values(arg), result$1, options) : forEach$2(Object.values(arg), identity, options);
2743
2806
  return suspend$3(() => {
2744
2807
  const out = {};
2745
- return as$1(forEach$2(Object.entries(arg), ([key, effect]) => map$7(options?.mode === "result" ? result$1(effect) : effect, (value) => {
2808
+ return as$1(forEach$2(Object.entries(arg), ([key, effect]) => map$6(options?.mode === "result" ? result$1(effect) : effect, (value) => {
2746
2809
  assignProperty(out, key, value);
2747
2810
  }), {
2748
2811
  discard: true,
@@ -3275,7 +3338,7 @@ const tracerLogger = /*#__PURE__*/ loggerMake(({ cause, fiber, logLevel, message
3275
3338
  span.event(toStringUnknown(Array.isArray(message) && message.length === 1 ? message[0] : message), clock.currentTimeNanosUnsafe(), attributes);
3276
3339
  });
3277
3340
  //#endregion
3278
- //#region ../../node_modules/.pnpm/effect@4.0.2/node_modules/effect/dist/Cause.js
3341
+ //#region ../../node_modules/.pnpm/effect@4.0.4/node_modules/effect/dist/Cause.js
3279
3342
  /**
3280
3343
  * Narrows a `Reason` to `Fail`.
3281
3344
  *
@@ -3520,7 +3583,7 @@ const hasInterruptsOnly = hasInterruptsOnly$1;
3520
3583
  * @category mapping
3521
3584
  * @since 2.0.0
3522
3585
  */
3523
- const map$6 = causeMap;
3586
+ const map$5 = causeMap;
3524
3587
  /**
3525
3588
  * Collapses a `Cause` into a single `unknown` value, picking the "most
3526
3589
  * important" failure in this order:
@@ -3665,7 +3728,7 @@ const UnknownError = UnknownError$1;
3665
3728
  */
3666
3729
  const reasonAnnotations = reasonAnnotations$1;
3667
3730
  //#endregion
3668
- //#region ../../node_modules/.pnpm/effect@4.0.2/node_modules/effect/dist/Exit.js
3731
+ //#region ../../node_modules/.pnpm/effect@4.0.4/node_modules/effect/dist/Exit.js
3669
3732
  /**
3670
3733
  * Creates a successful Exit containing the given value.
3671
3734
  *
@@ -3942,7 +4005,7 @@ const doneUnsafe = (self, effect) => {
3942
4005
  return true;
3943
4006
  };
3944
4007
  //#endregion
3945
- //#region ../../node_modules/.pnpm/effect@4.0.2/node_modules/effect/dist/References.js
4008
+ //#region ../../node_modules/.pnpm/effect@4.0.4/node_modules/effect/dist/References.js
3946
4009
  /**
3947
4010
  * Context reference for setting the minimum log level threshold. Log entries below this
3948
4011
  * level will be filtered out completely.
@@ -3980,7 +4043,7 @@ const doneUnsafe = (self, effect) => {
3980
4043
  */
3981
4044
  const MinimumLogLevel = MinimumLogLevel$1;
3982
4045
  //#endregion
3983
- //#region ../../node_modules/.pnpm/effect@4.0.2/node_modules/effect/dist/Scope.js
4046
+ //#region ../../node_modules/.pnpm/effect@4.0.4/node_modules/effect/dist/Scope.js
3984
4047
  /**
3985
4048
  * Controls how long resources stay open.
3986
4049
  *
@@ -4236,8 +4299,8 @@ const forkUnsafe = scopeForkUnsafe;
4236
4299
  */
4237
4300
  const close = scopeClose;
4238
4301
  //#endregion
4239
- //#region ../../node_modules/.pnpm/effect@4.0.2/node_modules/effect/dist/Layer.js
4240
- const TypeId$28 = "~effect/Layer";
4302
+ //#region ../../node_modules/.pnpm/effect@4.0.4/node_modules/effect/dist/Layer.js
4303
+ const TypeId$30 = "~effect/Layer";
4241
4304
  const MemoMapTypeId = "~effect/Layer/MemoMap";
4242
4305
  const makeMemoMapEntry = (memoMap, layer) => {
4243
4306
  const entry = {
@@ -4259,7 +4322,7 @@ const memoMapObserve = (entry, scope) => {
4259
4322
  return true;
4260
4323
  };
4261
4324
  const LayerProto = {
4262
- [TypeId$28]: {
4325
+ [TypeId$30]: {
4263
4326
  _ROut: identity,
4264
4327
  _E: identity,
4265
4328
  _RIn: identity
@@ -4516,7 +4579,7 @@ var CurrentMemoMap = class CurrentMemoMap extends (/*#__PURE__*/ Service()("effe
4516
4579
  * @category destructors
4517
4580
  * @since 2.0.0
4518
4581
  */
4519
- const buildWithMemoMap = /*#__PURE__*/ dual(3, (self, memoMap, scope) => provideService$1(map$7(suspend$3(() => self.build(memoMap, scope)), add(CurrentMemoMap, memoMap)), CurrentMemoMap, memoMap));
4582
+ const buildWithMemoMap = /*#__PURE__*/ dual(3, (self, memoMap, scope) => provideService$1(map$6(suspend$3(() => self.build(memoMap, scope)), add(CurrentMemoMap, memoMap)), CurrentMemoMap, memoMap));
4520
4583
  /**
4521
4584
  * Builds a layer using an explicit scope.
4522
4585
  *
@@ -4698,7 +4761,7 @@ const effect = function() {
4698
4761
  if (arguments.length === 1) return (effect) => effectImpl(arguments[0], effect);
4699
4762
  return effectImpl(arguments[0], arguments[1]);
4700
4763
  };
4701
- const effectImpl = (service, effect) => effectContext(map$7(effect, (value) => make$26(service, value)));
4764
+ const effectImpl = (service, effect) => effectContext(map$6(effect, (value) => make$26(service, value)));
4702
4765
  /**
4703
4766
  * Constructs a layer from an effect that produces all services in a `Context`.
4704
4767
  *
@@ -4741,7 +4804,7 @@ const effectImpl = (service, effect) => effectContext(map$7(effect, (value) => m
4741
4804
  const effectContext = (effect) => fromBuildMemo((_, scope) => provide$2(effect, scope));
4742
4805
  const mergeAllEffect = (layers, memoMap, scope) => {
4743
4806
  const parentScope = forkUnsafe(scope, "parallel");
4744
- return forEach$2(layers, (layer) => layer.build(memoMap, forkUnsafe(parentScope, "sequential")), { concurrency: layers.length }).pipe(map$7((context) => mergeAll$1(...context)));
4807
+ return forEach$2(layers, (layer) => layer.build(memoMap, forkUnsafe(parentScope, "sequential")), { concurrency: layers.length }).pipe(map$6((context) => mergeAll$1(...context)));
4745
4808
  };
4746
4809
  /**
4747
4810
  * Combines all the provided layers concurrently, creating a new layer with
@@ -4793,7 +4856,7 @@ const mergeAllEffect = (layers, memoMap, scope) => {
4793
4856
  * @since 2.0.0
4794
4857
  */
4795
4858
  const mergeAll = (...layers) => fromBuild((memoMap, scope) => mergeAllEffect(layers, memoMap, scope));
4796
- const provideWith = (self, that, f) => fromBuild((memoMap, scope) => flatMap$2(Array.isArray(that) ? mergeAllEffect(that, memoMap, scope) : that.build(memoMap, scope), (context) => self.build(memoMap, scope).pipe(provideContext$1(context), map$7((merged) => f(merged, context)))));
4859
+ const provideWith = (self, that, f) => fromBuild((memoMap, scope) => flatMap$2(Array.isArray(that) ? mergeAllEffect(that, memoMap, scope) : that.build(memoMap, scope), (context) => self.build(memoMap, scope).pipe(provideContext$1(context), map$6((merged) => f(merged, context)))));
4797
4860
  /**
4798
4861
  * Feeds the output services of the dependency layer into the requirements of
4799
4862
  * this layer, returning a layer that provides both sets of services.
@@ -4883,13 +4946,13 @@ const provideWith = (self, that, f) => fromBuild((memoMap, scope) => flatMap$2(A
4883
4946
  */
4884
4947
  const provideMerge = /*#__PURE__*/ dual(2, (self, that) => provideWith(self, that, (self, that) => merge$2(that, self)));
4885
4948
  //#endregion
4886
- //#region ../../node_modules/.pnpm/effect@4.0.2/node_modules/effect/dist/internal/dateTime.js
4949
+ //#region ../../node_modules/.pnpm/effect@4.0.4/node_modules/effect/dist/internal/dateTime.js
4887
4950
  /** @internal */
4888
- const TypeId$27 = "~effect/DateTime";
4951
+ const TypeId$29 = "~effect/DateTime";
4889
4952
  /** @internal */
4890
4953
  const TimeZoneTypeId = "~effect/DateTime/TimeZone";
4891
4954
  const Proto$9 = {
4892
- [TypeId$27]: TypeId$27,
4955
+ [TypeId$29]: TypeId$29,
4893
4956
  pipe() {
4894
4957
  return pipeArguments(this, arguments);
4895
4958
  },
@@ -4938,7 +5001,7 @@ const round = /*#__PURE__*/ dual(2, (self, precision) => {
4938
5001
  return Math.round(self * factor) / factor;
4939
5002
  });
4940
5003
  //#endregion
4941
- //#region ../../node_modules/.pnpm/effect@4.0.2/node_modules/effect/dist/internal/random.js
5004
+ //#region ../../node_modules/.pnpm/effect@4.0.4/node_modules/effect/dist/internal/random.js
4942
5005
  /** @internal */
4943
5006
  const nextBetween = (min, max, draw) => {
4944
5007
  const value = draw * (max - min) + min;
@@ -4951,7 +5014,7 @@ const nextBetween = (min, max, draw) => {
4951
5014
  return view.getFloat64(0);
4952
5015
  };
4953
5016
  //#endregion
4954
- //#region ../../node_modules/.pnpm/effect@4.0.2/node_modules/effect/dist/Pull.js
5017
+ //#region ../../node_modules/.pnpm/effect@4.0.4/node_modules/effect/dist/Pull.js
4955
5018
  /**
4956
5019
  * Models one low-level pull step for stream-like consumers.
4957
5020
  *
@@ -5129,12 +5192,12 @@ const matchEffect$1 = /*#__PURE__*/ dual(2, (self, options) => matchCauseEffect$
5129
5192
  }
5130
5193
  }));
5131
5194
  //#endregion
5132
- //#region ../../node_modules/.pnpm/effect@4.0.2/node_modules/effect/dist/internal/layer.js
5195
+ //#region ../../node_modules/.pnpm/effect@4.0.4/node_modules/effect/dist/internal/layer.js
5133
5196
  const provideLayer = (self, layer, options) => scopedWith$1((scope) => flatMap$2(options?.local ? buildWithMemoMap(layer, makeMemoMapUnsafe(), scope) : buildWithScope(layer, scope), (context) => provideContext$1(self, context)));
5134
5197
  /** @internal */
5135
5198
  const provide$1 = /*#__PURE__*/ dual((args) => isEffect$1(args[0]), (self, source, options) => isContext(source) ? provideContext$1(self, source) : provideLayer(self, Array.isArray(source) ? mergeAll(...source) : source, options));
5136
5199
  //#endregion
5137
- //#region ../../node_modules/.pnpm/effect@4.0.2/node_modules/effect/dist/Effect.js
5200
+ //#region ../../node_modules/.pnpm/effect@4.0.4/node_modules/effect/dist/Effect.js
5138
5201
  /**
5139
5202
  * Checks whether a value is an `Effect`.
5140
5203
  *
@@ -6227,7 +6290,7 @@ const exit = exit$1;
6227
6290
  * @category mapping
6228
6291
  * @since 2.0.0
6229
6292
  */
6230
- const map$5 = map$7;
6293
+ const map$4 = map$6;
6231
6294
  /**
6232
6295
  * Replaces the value inside an effect with a constant value.
6233
6296
  *
@@ -7342,6 +7405,63 @@ const onExitPrimitive = onExitPrimitive$1;
7342
7405
  */
7343
7406
  const onExit = onExit$1;
7344
7407
  /**
7408
+ * Returns an effect that lazily computes a result and caches it for subsequent
7409
+ * evaluations.
7410
+ *
7411
+ * **When to use**
7412
+ *
7413
+ * Use when you need an expensive or time-consuming operation to be evaluated
7414
+ * once and reused by later callers.
7415
+ *
7416
+ * **Details**
7417
+ *
7418
+ * This function wraps an effect and ensures that its result is computed only
7419
+ * once. Once the result is computed, it is cached, meaning that subsequent
7420
+ * evaluations of the same effect will return the cached result without
7421
+ * re-executing the logic.
7422
+ *
7423
+ * Concurrent callers share the pending computation, which is interrupted only
7424
+ * once every caller waiting on it has been interrupted. Interrupted
7425
+ * computations are never cached, so the next evaluation starts a fresh
7426
+ * computation.
7427
+ *
7428
+ * **Example** (Memoizing an effect until invalidated)
7429
+ *
7430
+ * ```ts import.meta.vitest
7431
+ * import { Effect } from "effect"
7432
+ * const output: Array<unknown> = []
7433
+ * const record = (value: unknown) => Effect.sync(() => { output.push(value) })
7434
+ *
7435
+ * let i = 1
7436
+ * const expensiveTask = Effect.sync(() => {
7437
+ * void output.push("expensive task...")
7438
+ * return `result ${i++}`
7439
+ * })
7440
+ *
7441
+ * const program = Effect.gen(function*() {
7442
+ * void output.push("non-cached version:")
7443
+ * yield* expensiveTask.pipe(Effect.andThen(record))
7444
+ * yield* expensiveTask.pipe(Effect.andThen(record))
7445
+ * void output.push("cached version:")
7446
+ * const cached = yield* Effect.cached(expensiveTask)
7447
+ * yield* cached.pipe(Effect.andThen(record))
7448
+ * yield* cached.pipe(Effect.andThen(record))
7449
+ * })
7450
+ *
7451
+ * await Effect.runPromise(program)
7452
+ * output // => ["non-cached version:", "expensive task...", "result 1", "expensive task...", "result 2", "cached version:", "expensive task...", "result 3", "result 3"]
7453
+ * ```
7454
+ *
7455
+ * @see {@link cachedWithTTL} for a similar function that includes a
7456
+ * time-to-live duration for the cached value.
7457
+ * @see {@link cachedInvalidateWithTTL} for a similar function that includes an
7458
+ * additional effect for manually invalidating the cached value.
7459
+ * @stability stable
7460
+ * @category caching
7461
+ * @since 2.0.0
7462
+ */
7463
+ const cached = cached$1;
7464
+ /**
7345
7465
  * Returns an effect that is immediately interrupted.
7346
7466
  *
7347
7467
  * **Example** (Creating an interrupted effect)
@@ -7974,7 +8094,7 @@ const catchEager = catchEager$1;
7974
8094
  */
7975
8095
  const fnUntracedEager = fnUntracedEager$1;
7976
8096
  //#endregion
7977
- //#region ../../node_modules/.pnpm/effect@4.0.2/node_modules/effect/dist/BigDecimal.js
8097
+ //#region ../../node_modules/.pnpm/effect@4.0.4/node_modules/effect/dist/BigDecimal.js
7978
8098
  /**
7979
8099
  * Decimal numbers and arithmetic for cases where JavaScript `number` rounding
7980
8100
  * is not precise enough. A `BigDecimal` stores digits as a `bigint` plus a
@@ -7985,9 +8105,9 @@ const fnUntracedEager = fnUntracedEager$1;
7985
8105
  * @stability stable
7986
8106
  * @since 2.0.0
7987
8107
  */
7988
- const TypeId$26 = "~effect/BigDecimal";
8108
+ const TypeId$28 = "~effect/BigDecimal";
7989
8109
  const BigDecimalProto = {
7990
- [TypeId$26]: TypeId$26,
8110
+ [TypeId$28]: TypeId$28,
7991
8111
  [symbol$1]() {
7992
8112
  const normalized = normalize(this);
7993
8113
  return combine$1(string$1(String(normalized.value)), number$1(normalized.scale));
@@ -8035,7 +8155,7 @@ const BigDecimalProto = {
8035
8155
  * @category guards
8036
8156
  * @since 2.0.0
8037
8157
  */
8038
- const isBigDecimal = (u) => hasProperty(u, TypeId$26);
8158
+ const isBigDecimal = (u) => hasProperty(u, TypeId$28);
8039
8159
  /**
8040
8160
  * Creates a `BigDecimal` from a `bigint` value and a safe integer scale.
8041
8161
  *
@@ -8259,7 +8379,7 @@ const toExponential = (n) => {
8259
8379
  */
8260
8380
  const isZero = (n) => n.value === bigint0$1;
8261
8381
  //#endregion
8262
- //#region ../../node_modules/.pnpm/effect@4.0.2/node_modules/effect/dist/BigInt.js
8382
+ //#region ../../node_modules/.pnpm/effect@4.0.4/node_modules/effect/dist/BigInt.js
8263
8383
  /**
8264
8384
  * Exposes the global bigint constructor for JavaScript bigint coercion.
8265
8385
  *
@@ -8289,7 +8409,7 @@ const isZero = (n) => n.value === bigint0$1;
8289
8409
  * @category constructors
8290
8410
  * @since 4.0.0
8291
8411
  */
8292
- const BigInt$2 = globalThis.BigInt;
8412
+ const BigInt$4 = globalThis.BigInt;
8293
8413
  /**
8294
8414
  * Converts a `bigint` to a `number` safely.
8295
8415
  *
@@ -8320,11 +8440,11 @@ const BigInt$2 = globalThis.BigInt;
8320
8440
  * @since 2.0.0
8321
8441
  */
8322
8442
  const toNumber = (b) => {
8323
- if (b > BigInt$2(Number.MAX_SAFE_INTEGER) || b < BigInt$2(Number.MIN_SAFE_INTEGER)) return none();
8443
+ if (b > BigInt$4(Number.MAX_SAFE_INTEGER) || b < BigInt$4(Number.MIN_SAFE_INTEGER)) return none();
8324
8444
  return some(Number(b));
8325
8445
  };
8326
8446
  //#endregion
8327
- //#region ../../node_modules/.pnpm/effect@4.0.2/node_modules/effect/dist/ByteSize.js
8447
+ //#region ../../node_modules/.pnpm/effect@4.0.4/node_modules/effect/dist/ByteSize.js
8328
8448
  const bigint0 = /*#__PURE__*/ BigInt(0);
8329
8449
  const bigint1 = /*#__PURE__*/ BigInt(1);
8330
8450
  const decimalBase = /*#__PURE__*/ BigInt(1e3);
@@ -8573,7 +8693,7 @@ codes[/*#__PURE__*/ "=".charCodeAt(0)] = 0;
8573
8693
  ({ ...BaseProto });
8574
8694
  ({ ...BaseProto });
8575
8695
  //#endregion
8576
- //#region ../../node_modules/.pnpm/effect@4.0.2/node_modules/effect/dist/internal/redacted.js
8696
+ //#region ../../node_modules/.pnpm/effect@4.0.4/node_modules/effect/dist/internal/redacted.js
8577
8697
  /** @internal */
8578
8698
  const redactedRegistry = /*#__PURE__*/ new WeakMap();
8579
8699
  /** @internal */
@@ -8582,7 +8702,7 @@ const value$1 = (self) => {
8582
8702
  else throw new Error("Unable to get redacted value" + (self.label ? ` with label: "${self.label}"` : ""));
8583
8703
  };
8584
8704
  //#endregion
8585
- //#region ../../node_modules/.pnpm/effect@4.0.2/node_modules/effect/dist/Redacted.js
8705
+ //#region ../../node_modules/.pnpm/effect@4.0.4/node_modules/effect/dist/Redacted.js
8586
8706
  /**
8587
8707
  * Wraps sensitive values so normal output does not reveal them.
8588
8708
  *
@@ -8596,7 +8716,7 @@ const value$1 = (self) => {
8596
8716
  * @stability stable
8597
8717
  * @since 3.3.0
8598
8718
  */
8599
- const TypeId$24 = "~effect/Redacted";
8719
+ const TypeId$26 = "~effect/Redacted";
8600
8720
  /**
8601
8721
  * Returns `true` if a value is a `Redacted` wrapper.
8602
8722
  *
@@ -8625,7 +8745,7 @@ const TypeId$24 = "~effect/Redacted";
8625
8745
  * @category guards
8626
8746
  * @since 3.3.0
8627
8747
  */
8628
- const isRedacted = (u) => hasProperty(u, TypeId$24);
8748
+ const isRedacted = (u) => hasProperty(u, TypeId$26);
8629
8749
  /**
8630
8750
  * Creates a `Redacted` wrapper for a sensitive value.
8631
8751
  *
@@ -8660,14 +8780,14 @@ const make$20 = (value, options) => {
8660
8780
  return self;
8661
8781
  };
8662
8782
  const Proto$7 = {
8663
- [TypeId$24]: { _A: (_) => _ },
8783
+ [TypeId$26]: { _A: (_) => _ },
8664
8784
  label: void 0,
8665
8785
  ...PipeInspectableProto,
8666
8786
  toJSON() {
8667
8787
  return this.toString();
8668
8788
  },
8669
8789
  toString() {
8670
- return `<redacted${isString(this.label) ? ":" + this.label : ""}>`;
8790
+ return `<redacted${isString$1(this.label) ? ":" + this.label : ""}>`;
8671
8791
  },
8672
8792
  [symbol$1]() {
8673
8793
  return hash(redactedRegistry.get(this));
@@ -8701,7 +8821,7 @@ const Proto$7 = {
8701
8821
  const value = value$1;
8702
8822
  ({ ...PipeInspectableProto });
8703
8823
  //#endregion
8704
- //#region ../../node_modules/.pnpm/effect@4.0.2/node_modules/effect/dist/internal/schema/annotations.js
8824
+ //#region ../../node_modules/.pnpm/effect@4.0.4/node_modules/effect/dist/internal/schema/annotations.js
8705
8825
  /** @internal */
8706
8826
  function resolve$1(ast) {
8707
8827
  return ast.checks ? ast.checks[ast.checks.length - 1].annotations : ast.annotations;
@@ -8717,7 +8837,7 @@ const getExpected = /*#__PURE__*/ memoize((ast) => {
8717
8837
  return ast.getExpected(getExpected);
8718
8838
  });
8719
8839
  //#endregion
8720
- //#region ../../node_modules/.pnpm/effect@4.0.2/node_modules/effect/dist/internal/schema/parser.js
8840
+ //#region ../../node_modules/.pnpm/effect@4.0.4/node_modules/effect/dist/internal/schema/parser.js
8721
8841
  /** @internal */
8722
8842
  const missing = /*#__PURE__*/ Symbol();
8723
8843
  /** @internal */
@@ -8731,7 +8851,7 @@ const toOption = (value) => value === missing ? none() : some(value);
8731
8851
  /** @internal */
8732
8852
  const fromOptionExit = (option) => option._tag === "None" ? missingExit : succeed$1(option.value);
8733
8853
  //#endregion
8734
- //#region ../../node_modules/.pnpm/effect@4.0.2/node_modules/effect/dist/SchemaIssue.js
8854
+ //#region ../../node_modules/.pnpm/effect@4.0.4/node_modules/effect/dist/SchemaIssue.js
8735
8855
  /**
8736
8856
  * Describes problems found while decoding, encoding, or checking data with
8737
8857
  * schemas.
@@ -8744,7 +8864,7 @@ const fromOptionExit = (option) => option._tag === "None" ? missingExit : succee
8744
8864
  * @stability stable
8745
8865
  * @since 4.0.0
8746
8866
  */
8747
- const TypeId$22 = "~effect/SchemaIssue/Issue";
8867
+ const TypeId$24 = "~effect/SchemaIssue/Issue";
8748
8868
  /**
8749
8869
  * Returns `true` if the given value is an {@link Issue}.
8750
8870
  *
@@ -8775,7 +8895,7 @@ const TypeId$22 = "~effect/SchemaIssue/Issue";
8775
8895
  * @since 4.0.0
8776
8896
  */
8777
8897
  function isIssue(u) {
8778
- return hasProperty(u, TypeId$22) && u[TypeId$22] === TypeId$22;
8898
+ return hasProperty(u, TypeId$24) && u[TypeId$24] === TypeId$24;
8779
8899
  }
8780
8900
  /**
8781
8901
  * Returns `true` when an issue contains an input reported by the schema parser.
@@ -8811,7 +8931,7 @@ function hasInput(issue) {
8811
8931
  return Object.hasOwn(issue, "input");
8812
8932
  }
8813
8933
  var IssueNodeImpl = class {
8814
- [TypeId$22] = TypeId$22;
8934
+ [TypeId$24] = TypeId$24;
8815
8935
  constructor(input, options) {
8816
8936
  if (options?.reportInput === true && input !== missing) this.input = input;
8817
8937
  }
@@ -9042,7 +9162,7 @@ function makeSingle$1(out, input, options) {
9042
9162
  function normalizeFilterOutput(ast, out, input, options) {
9043
9163
  if (Array.isArray(out)) {
9044
9164
  if (!isReadonlyArrayNonEmpty(out)) return;
9045
- return out.length === 1 ? makeFilterIssue(out[0], input, options) : new Composite(ast, map$9(out, (entry) => makeFilterIssue(entry, input, options)), input, options);
9165
+ return out.length === 1 ? makeFilterIssue(out[0], input, options) : new Composite(ast, map$8(out, (entry) => makeFilterIssue(entry, input, options)), input, options);
9046
9166
  }
9047
9167
  return makeSingle$1(out, input, options);
9048
9168
  }
@@ -9228,7 +9348,7 @@ function findMessage(issue) {
9228
9348
  if (typeof message === "string") return message;
9229
9349
  }
9230
9350
  //#endregion
9231
- //#region ../../node_modules/.pnpm/effect@4.0.2/node_modules/effect/dist/internal/schema/cause.js
9351
+ //#region ../../node_modules/.pnpm/effect@4.0.4/node_modules/effect/dist/internal/schema/cause.js
9232
9352
  /** @internal */
9233
9353
  function getSchemaIssue(cause) {
9234
9354
  let issue;
@@ -9245,7 +9365,7 @@ function getSchemaIssueOrThrow(cause, message) {
9245
9365
  return issue;
9246
9366
  }
9247
9367
  //#endregion
9248
- //#region ../../node_modules/.pnpm/effect@4.0.2/node_modules/effect/dist/SchemaGetter.js
9368
+ //#region ../../node_modules/.pnpm/effect@4.0.4/node_modules/effect/dist/SchemaGetter.js
9249
9369
  const makeGetter = (fields) => Object.assign(Object.create(Prototype$1), fields);
9250
9370
  const passthrough_$1 = /*#__PURE__*/ makeGetter({ _tag: "Passthrough" });
9251
9371
  function passthrough$1() {
@@ -9400,7 +9520,7 @@ function Number$4() {
9400
9520
  return transform$2(globalThis.Number);
9401
9521
  }
9402
9522
  //#endregion
9403
- //#region ../../node_modules/.pnpm/effect@4.0.2/node_modules/effect/dist/SchemaTransformation.js
9523
+ //#region ../../node_modules/.pnpm/effect@4.0.4/node_modules/effect/dist/SchemaTransformation.js
9404
9524
  /**
9405
9525
  * Constructs schema middleware from its decode and encode functions.
9406
9526
  *
@@ -9421,7 +9541,7 @@ const Middleware = class extends Class {
9421
9541
  return new Middleware(this.encode, this.decode);
9422
9542
  }
9423
9543
  };
9424
- const TypeId$21 = "~effect/SchemaTransformation/Transformation";
9544
+ const TypeId$23 = "~effect/SchemaTransformation/Transformation";
9425
9545
  /**
9426
9546
  * Constructs a bidirectional schema transformation from its decode and encode getters.
9427
9547
  *
@@ -9430,7 +9550,7 @@ const TypeId$21 = "~effect/SchemaTransformation/Transformation";
9430
9550
  * @since 4.0.0
9431
9551
  */
9432
9552
  const Transformation = class extends Class {
9433
- [TypeId$21] = TypeId$21;
9553
+ [TypeId$23] = TypeId$23;
9434
9554
  _tag = "Transformation";
9435
9555
  decode;
9436
9556
  encode;
@@ -9473,7 +9593,7 @@ const Transformation = class extends Class {
9473
9593
  * @since 4.0.0
9474
9594
  */
9475
9595
  function isTransformation(u) {
9476
- return hasProperty(u, TypeId$21) && u[TypeId$21] === TypeId$21;
9596
+ return hasProperty(u, TypeId$23) && u[TypeId$23] === TypeId$23;
9477
9597
  }
9478
9598
  /**
9479
9599
  * Constructs a `Transformation` from an object with `decode` and `encode`
@@ -9640,7 +9760,7 @@ const defectFromJson = (options) => transform$1({
9640
9760
  encode: makeEncodeDefect(options)
9641
9761
  });
9642
9762
  //#endregion
9643
- //#region ../../node_modules/.pnpm/effect@4.0.2/node_modules/effect/dist/SchemaAST.js
9763
+ //#region ../../node_modules/.pnpm/effect@4.0.4/node_modules/effect/dist/SchemaAST.js
9644
9764
  /**
9645
9765
  * Represents Effect schemas as runtime trees.
9646
9766
  *
@@ -9779,9 +9899,9 @@ const Context = class {
9779
9899
  this.annotations = annotations;
9780
9900
  }
9781
9901
  };
9782
- const TypeId$20 = "~effect/Schema";
9902
+ const TypeId$22 = "~effect/Schema";
9783
9903
  var ASTNodeImpl = class {
9784
- [TypeId$20] = TypeId$20;
9904
+ [TypeId$22] = TypeId$22;
9785
9905
  annotations;
9786
9906
  checks;
9787
9907
  encoding;
@@ -9974,7 +10094,7 @@ const String$4 = class extends ASTNodeImpl {
9974
10094
  _tag = "String";
9975
10095
  /** @internal */
9976
10096
  getParser() {
9977
- return fromRefinement(this, isString);
10097
+ return fromRefinement(this, isString$1);
9978
10098
  }
9979
10099
  /** @internal */
9980
10100
  matchPart(s, options) {
@@ -10239,7 +10359,7 @@ const parseArrayConcurrent = /*#__PURE__*/ iterateConcurrent()(parseArrayOptions
10239
10359
  const wrapPropertyKeyIssue = (s, ast, key, exit) => {
10240
10360
  if (exit.cause.reasons.length === 0) return exit;
10241
10361
  const issue = getSchemaIssue(exit.cause);
10242
- if (issue === void 0) return failCause$2(map$6(exit.cause, (issue) => new Composite(ast, [new Pointer([key], issue)], s.input, s.options)));
10362
+ if (issue === void 0) return failCause$2(map$5(exit.cause, (issue) => new Composite(ast, [new Pointer([key], issue)], s.input, s.options)));
10243
10363
  const pointer = new Pointer([key], issue);
10244
10364
  if (s.options.errors === "all") {
10245
10365
  if (s.issues) s.issues.push(pointer);
@@ -11536,7 +11656,7 @@ const unknownToStringTree = /*#__PURE__*/ new Link(/* @__PURE__ */ new Declarati
11536
11656
  toCodecStringTree: () => void 0
11537
11657
  }), /*#__PURE__*/ passthrough());
11538
11658
  //#endregion
11539
- //#region ../../node_modules/.pnpm/effect@4.0.2/node_modules/effect/dist/internal/schema/interpreter.js
11659
+ //#region ../../node_modules/.pnpm/effect@4.0.4/node_modules/effect/dist/internal/schema/interpreter.js
11540
11660
  const flatMapTransformation = (result, current, f) => result === sameExit ? f(current) : flatMapEager(result, f);
11541
11661
  function compileTransformation(transformation) {
11542
11662
  if (transformation._tag === "Middleware") return (result, current, options) => {
@@ -11560,7 +11680,7 @@ function compileTransformation(transformation) {
11560
11680
  }
11561
11681
  const fromOptionalEffect = (effect) => flatMapEager(effect, fromOptionExit);
11562
11682
  /** @internal */
11563
- const wrapEncoding = (ast, input, options, effect) => catchCause(effect, (cause) => failCauseSync(() => map$6(cause, (issue) => new Encoding(ast, issue, input, options))));
11683
+ const wrapEncoding = (ast, input, options, effect) => catchCause(effect, (cause) => failCauseSync(() => map$5(cause, (issue) => new Encoding(ast, issue, input, options))));
11564
11684
  function makeConstructorParser(descriptor, compile) {
11565
11685
  const transform = compileTransformation(descriptor.link.transformation);
11566
11686
  let sourceParser;
@@ -11671,7 +11791,7 @@ function compile(ast, compile, compileField, base, specialize) {
11671
11791
  };
11672
11792
  }
11673
11793
  //#endregion
11674
- //#region ../../node_modules/.pnpm/effect@4.0.2/node_modules/effect/dist/internal/schema/compilerRegistry.js
11794
+ //#region ../../node_modules/.pnpm/effect@4.0.4/node_modules/effect/dist/internal/schema/compilerRegistry.js
11675
11795
  /** @internal */
11676
11796
  const invalid = /*#__PURE__*/ Symbol();
11677
11797
  const cache = /*#__PURE__*/ new WeakMap();
@@ -11702,7 +11822,7 @@ function resolve(ast) {
11702
11822
  return entry;
11703
11823
  }
11704
11824
  //#endregion
11705
- //#region ../../node_modules/.pnpm/effect@4.0.2/node_modules/effect/dist/SchemaParser.js
11825
+ //#region ../../node_modules/.pnpm/effect@4.0.4/node_modules/effect/dist/SchemaParser.js
11706
11826
  /**
11707
11827
  * Runs schemas against real values.
11708
11828
  *
@@ -11937,12 +12057,12 @@ function makeConstructorSync(ast) {
11937
12057
  const normalCompiler = (ast) => resolve(ast).parser;
11938
12058
  const constructorCompiler = (ast) => resolve(ast).makeEffect;
11939
12059
  //#endregion
11940
- //#region ../../node_modules/.pnpm/effect@4.0.2/node_modules/effect/dist/internal/schema/make.js
12060
+ //#region ../../node_modules/.pnpm/effect@4.0.4/node_modules/effect/dist/internal/schema/make.js
11941
12061
  /** @internal */
11942
- const TypeId$19 = "~effect/Schema/Schema";
12062
+ const TypeId$21 = "~effect/Schema/Schema";
11943
12063
  const RebuildOptions = /*#__PURE__*/ Symbol();
11944
12064
  const SchemaProto = {
11945
- [TypeId$19]: TypeId$19,
12065
+ [TypeId$21]: TypeId$21,
11946
12066
  get make() {
11947
12067
  const value = make$18(this);
11948
12068
  Object.defineProperty(this, "make", {
@@ -11994,7 +12114,7 @@ function make$17(ast, options) {
11994
12114
  return self;
11995
12115
  }
11996
12116
  //#endregion
11997
- //#region ../../node_modules/.pnpm/effect@4.0.2/node_modules/effect/dist/internal/schema/toCodec.js
12117
+ //#region ../../node_modules/.pnpm/effect@4.0.4/node_modules/effect/dist/internal/schema/toCodec.js
11998
12118
  function withoutConstructorDefault(context) {
11999
12119
  return context.constructorDefault === void 0 ? context : new Context(context.isOptional, context.isMutable, void 0, context.annotations);
12000
12120
  }
@@ -12074,7 +12194,7 @@ const toCodecStringTreeAST = /*#__PURE__*/ applyToSelfOrLastLinkEncodingIdempote
12074
12194
  return out;
12075
12195
  }, { stopAt: isCodecArrayFromSingleLink });
12076
12196
  //#endregion
12077
- //#region ../../node_modules/.pnpm/effect@4.0.2/node_modules/effect/dist/Struct.js
12197
+ //#region ../../node_modules/.pnpm/effect@4.0.4/node_modules/effect/dist/Struct.js
12078
12198
  /**
12079
12199
  * Wraps a plain function as a {@link Lambda} value so it can be used with
12080
12200
  * {@link map}, {@link mapPick}, and {@link mapOmit}.
@@ -12114,11 +12234,19 @@ const toCodecStringTreeAST = /*#__PURE__*/ applyToSelfOrLastLinkEncodingIdempote
12114
12234
  */
12115
12235
  const lambda = (f) => f;
12116
12236
  //#endregion
12117
- //#region ../../node_modules/.pnpm/effect@4.0.2/node_modules/effect/dist/internal/schemaError.js
12237
+ //#region ../../node_modules/.pnpm/effect@4.0.4/node_modules/effect/dist/internal/schemaError.js
12118
12238
  const SchemaErrorTypeId = "~effect/Schema/SchemaError";
12239
+ ({ ...BaseProto });
12240
+ ({ ...BaseProto });
12241
+ ({ ...BaseProto });
12242
+ ({ ...BaseProto });
12243
+ ({ ...BaseProto });
12244
+ ({ ...BaseProto });
12245
+ ({ ...BaseProto });
12246
+ ({ ...BaseProto });
12119
12247
  //#endregion
12120
- //#region ../../node_modules/.pnpm/effect@4.0.2/node_modules/effect/dist/Schema.js
12121
- const TypeId$18 = TypeId$19;
12248
+ //#region ../../node_modules/.pnpm/effect@4.0.4/node_modules/effect/dist/Schema.js
12249
+ const TypeId$18 = TypeId$21;
12122
12250
  /**
12123
12251
  * Error thrown or returned when schema decoding or encoding fails.
12124
12252
  *
@@ -12164,16 +12292,25 @@ var SchemaError = class extends (/*#__PURE__*/ TaggedError$1("SchemaError")) {
12164
12292
  get message() {
12165
12293
  return defaultFormatter$1(this.issue);
12166
12294
  }
12295
+ toJSON() {
12296
+ return {
12297
+ _tag: this._tag,
12298
+ message: this.message
12299
+ };
12300
+ }
12301
+ [NodeInspectSymbol]() {
12302
+ return this.toJSON();
12303
+ }
12167
12304
  toString() {
12168
12305
  return `SchemaError(${this.message})`;
12169
12306
  }
12170
12307
  };
12171
12308
  function fromIssueEffect(self) {
12172
12309
  if (effectIsExit(self)) return fromIssueExit(self);
12173
- return catchCause(self, (cause) => failCauseSync(() => map$6(cause, (issue) => new SchemaError(issue))));
12310
+ return catchCause(self, (cause) => failCauseSync(() => map$5(cause, (issue) => new SchemaError(issue))));
12174
12311
  }
12175
12312
  function fromIssueExit(exit) {
12176
- return isSuccess(exit) ? exit : failCause$2(map$6(exit.cause, (issue) => new SchemaError(issue)));
12313
+ return isSuccess(exit) ? exit : failCause$2(map$5(exit.cause, (issue) => new SchemaError(issue)));
12177
12314
  }
12178
12315
  /**
12179
12316
  * Creates a type guard function that checks if a value conforms to a given
@@ -12512,7 +12649,7 @@ function Union(members, options) {
12512
12649
  * @category constructors
12513
12650
  * @since 4.0.0
12514
12651
  */
12515
- function Literals$2(literals) {
12652
+ function Literals(literals) {
12516
12653
  const members = literals.map(Literal);
12517
12654
  return make$16(union(members, void 0, void 0), {
12518
12655
  literals,
@@ -12521,7 +12658,7 @@ function Literals$2(literals) {
12521
12658
  return Union(f(this.members));
12522
12659
  },
12523
12660
  pick(literals) {
12524
- return Literals$2(literals);
12661
+ return Literals(literals);
12525
12662
  },
12526
12663
  transform(to) {
12527
12664
  return Union(members.map((member, index) => member.transform(to[index])));
@@ -12545,7 +12682,7 @@ function decodeTo(to, transformation) {
12545
12682
  };
12546
12683
  }
12547
12684
  /** @internal */
12548
- const TrueLiterals = /*#__PURE__*/ Literals$2([
12685
+ const TrueLiterals = /*#__PURE__*/ Literals([
12549
12686
  "true",
12550
12687
  "yes",
12551
12688
  "on",
@@ -12553,7 +12690,7 @@ const TrueLiterals = /*#__PURE__*/ Literals$2([
12553
12690
  "y"
12554
12691
  ]);
12555
12692
  /** @internal */
12556
- const FalseLiterals = /*#__PURE__*/ Literals$2([
12693
+ const FalseLiterals = /*#__PURE__*/ Literals([
12557
12694
  "false",
12558
12695
  "no",
12559
12696
  "off",
@@ -12561,7 +12698,7 @@ const FalseLiterals = /*#__PURE__*/ Literals$2([
12561
12698
  "n"
12562
12699
  ]);
12563
12700
  /** @internal */
12564
- const BooleanLiterals = /*#__PURE__*/ Literals$2([...TrueLiterals.literals, ...FalseLiterals.literals]).pipe(/*#__PURE__*/ decodeTo(Boolean$3, /*#__PURE__*/ transform$1({
12701
+ const BooleanLiterals = /*#__PURE__*/ Literals([...TrueLiterals.literals, ...FalseLiterals.literals]).pipe(/*#__PURE__*/ decodeTo(Boolean$3, /*#__PURE__*/ transform$1({
12565
12702
  decode: (value) => value === "true" || value === "yes" || value === "on" || value === "1" || value === "y",
12566
12703
  encode: (value) => value ? "true" : "false"
12567
12704
  })));
@@ -12960,7 +13097,7 @@ const Json = /*#__PURE__*/ make$16(/*#__PURE__*/ annotate$1(Json$1, { toCode: ()
12960
13097
  Type: "Schema.Json"
12961
13098
  }) }));
12962
13099
  //#endregion
12963
- //#region ../../node_modules/.pnpm/effect@4.0.2/node_modules/effect/dist/Brand.js
13100
+ //#region ../../node_modules/.pnpm/effect@4.0.4/node_modules/effect/dist/Brand.js
12964
13101
  /**
12965
13102
  * Returns a `Constructor` that **does not apply any runtime checks** and just
12966
13103
  * returns the provided value.
@@ -12985,7 +13122,7 @@ function nominal() {
12985
13122
  });
12986
13123
  }
12987
13124
  //#endregion
12988
- //#region ../../node_modules/.pnpm/effect@4.0.2/node_modules/effect/dist/Fiber.js
13125
+ //#region ../../node_modules/.pnpm/effect@4.0.4/node_modules/effect/dist/Fiber.js
12989
13126
  /**
12990
13127
  * Joins a fiber, blocking until it completes. If the fiber succeeds,
12991
13128
  * returns its value. If it fails, the error is propagated.
@@ -13120,7 +13257,7 @@ const getCurrent = getCurrentFiber;
13120
13257
  */
13121
13258
  const runIn = fiberRunIn;
13122
13259
  //#endregion
13123
- //#region ../../node_modules/.pnpm/effect@4.0.2/node_modules/effect/dist/Latch.js
13260
+ //#region ../../node_modules/.pnpm/effect@4.0.4/node_modules/effect/dist/Latch.js
13124
13261
  /**
13125
13262
  * Creates a `Latch` synchronously, outside of `Effect`.
13126
13263
  *
@@ -13158,7 +13295,7 @@ const runIn = fiberRunIn;
13158
13295
  */
13159
13296
  const makeUnsafe = makeLatchUnsafe;
13160
13297
  //#endregion
13161
- //#region ../../node_modules/.pnpm/effect@4.0.2/node_modules/effect/dist/MutableList.js
13298
+ //#region ../../node_modules/.pnpm/effect@4.0.4/node_modules/effect/dist/MutableList.js
13162
13299
  /**
13163
13300
  * Defines the unique symbol used to represent an empty result when taking elements from a MutableList.
13164
13301
  * This symbol is returned by `take` when the list is empty, allowing for safe type checking.
@@ -13373,7 +13510,7 @@ const take$1 = (self) => {
13373
13510
  return message;
13374
13511
  };
13375
13512
  //#endregion
13376
- //#region ../../node_modules/.pnpm/effect@4.0.2/node_modules/effect/dist/Queue.js
13513
+ //#region ../../node_modules/.pnpm/effect@4.0.4/node_modules/effect/dist/Queue.js
13377
13514
  const TypeId$17 = "~effect/Queue";
13378
13515
  const EnqueueTypeId = "~effect/Queue/Enqueue";
13379
13516
  const DequeueTypeId = "~effect/Queue/Dequeue";
@@ -14169,7 +14306,7 @@ const finalize = (self, exit) => {
14169
14306
  openState.awaiters.clear();
14170
14307
  };
14171
14308
  //#endregion
14172
- //#region ../../node_modules/.pnpm/effect@4.0.2/node_modules/effect/dist/Channel.js
14309
+ //#region ../../node_modules/.pnpm/effect@4.0.4/node_modules/effect/dist/Channel.js
14173
14310
  /**
14174
14311
  * Provides low-level building blocks for streaming data through Effect.
14175
14312
  *
@@ -14359,7 +14496,7 @@ const asyncQueue = (scope, f, options) => make$14({
14359
14496
  * @category constructors
14360
14497
  * @since 4.0.0
14361
14498
  */
14362
- const callbackArray = (f, options) => fromTransform$1((_, scope) => map$5(asyncQueue(scope, f, options), takeAll));
14499
+ const callbackArray = (f, options) => fromTransform$1((_, scope) => map$4(asyncQueue(scope, f, options), takeAll));
14363
14500
  /**
14364
14501
  * Creates a `Channel` that lazily evaluates to another channel.
14365
14502
  *
@@ -14445,9 +14582,9 @@ const empty$1 = /*#__PURE__*/ fromPull$1(/*#__PURE__*/ succeed$2(/*#__PURE__*/ d
14445
14582
  * @category sequencing
14446
14583
  * @since 2.0.0
14447
14584
  */
14448
- const map$4 = /*#__PURE__*/ dual(2, (self, f) => transformPull$1(self, (pull) => sync(() => {
14585
+ const map$3 = /*#__PURE__*/ dual(2, (self, f) => transformPull$1(self, (pull) => sync(() => {
14449
14586
  let i = 0;
14450
- return map$5(pull, (o) => f(o, i++));
14587
+ return map$4(pull, (o) => f(o, i++));
14451
14588
  })));
14452
14589
  /**
14453
14590
  * Maps the done value of this channel using the specified function.
@@ -14749,7 +14886,7 @@ const runFold = /*#__PURE__*/ dual(3, (self, initial, f) => suspend$2(() => {
14749
14886
  */
14750
14887
  const toPullScoped = (self, scope) => toTransform(self)(done(), scope);
14751
14888
  //#endregion
14752
- //#region ../../node_modules/.pnpm/effect@4.0.2/node_modules/effect/dist/PlatformError.js
14889
+ //#region ../../node_modules/.pnpm/effect@4.0.4/node_modules/effect/dist/PlatformError.js
14753
14890
  /**
14754
14891
  * Normalized errors for platform APIs.
14755
14892
  *
@@ -14907,7 +15044,7 @@ const systemError = (options) => new PlatformError(new SystemError(options));
14907
15044
  */
14908
15045
  const badArgument = (options) => new PlatformError(new BadArgument(options));
14909
15046
  //#endregion
14910
- //#region ../../node_modules/.pnpm/effect@4.0.2/node_modules/effect/dist/internal/stream.js
15047
+ //#region ../../node_modules/.pnpm/effect@4.0.4/node_modules/effect/dist/internal/stream.js
14911
15048
  const TypeId$14 = "~effect/Stream";
14912
15049
  const streamVariance = {
14913
15050
  _R: identity,
@@ -14926,7 +15063,7 @@ Stream.prototype = {
14926
15063
  /** @internal */
14927
15064
  const fromChannel$2 = (channel) => new Stream(channel);
14928
15065
  //#endregion
14929
- //#region ../../node_modules/.pnpm/effect@4.0.2/node_modules/effect/dist/Sink.js
15066
+ //#region ../../node_modules/.pnpm/effect@4.0.4/node_modules/effect/dist/Sink.js
14930
15067
  const TypeId$13 = "~effect/Sink";
14931
15068
  const endVoid = /*#__PURE__*/ succeed$2([void 0]);
14932
15069
  const sinkVariance = {
@@ -15115,9 +15252,9 @@ const forEachArray = (f) => fromTransform((upstream) => upstream.pipe(flatMap$1(
15115
15252
  * @category constructors
15116
15253
  * @since 2.0.0
15117
15254
  */
15118
- const unwrap$1 = (effect) => fromChannel$1(unwrap$2(map$5(effect, toChannel$1)));
15255
+ const unwrap$1 = (effect) => fromChannel$1(unwrap$2(map$4(effect, toChannel$1)));
15119
15256
  //#endregion
15120
- //#region ../../node_modules/.pnpm/effect@4.0.2/node_modules/effect/dist/internal/rcRef.js
15257
+ //#region ../../node_modules/.pnpm/effect@4.0.4/node_modules/effect/dist/internal/rcRef.js
15121
15258
  const TypeId$12 = "~effect/RcRef";
15122
15259
  const stateEmpty = { _tag: "Empty" };
15123
15260
  const stateClosed = { _tag: "Closed" };
@@ -15232,7 +15369,7 @@ const release = (self, state) => {
15232
15369
  return void_;
15233
15370
  };
15234
15371
  //#endregion
15235
- //#region ../../node_modules/.pnpm/effect@4.0.2/node_modules/effect/dist/RcRef.js
15372
+ //#region ../../node_modules/.pnpm/effect@4.0.4/node_modules/effect/dist/RcRef.js
15236
15373
  /**
15237
15374
  * Creates an `RcRef` from an acquire effect.
15238
15375
  *
@@ -15328,7 +15465,7 @@ const make$12 = make$13;
15328
15465
  */
15329
15466
  const get = get$1;
15330
15467
  //#endregion
15331
- //#region ../../node_modules/.pnpm/effect@4.0.2/node_modules/effect/dist/Stream.js
15468
+ //#region ../../node_modules/.pnpm/effect@4.0.4/node_modules/effect/dist/Stream.js
15332
15469
  /**
15333
15470
  * Describes effectful sources that emit values over time.
15334
15471
  *
@@ -15556,7 +15693,7 @@ const suspend = (stream) => fromChannel(suspend$1(() => stream().channel));
15556
15693
  * @category constructors
15557
15694
  * @since 2.0.0
15558
15695
  */
15559
- const unwrap = (effect) => fromChannel(unwrap$2(map$5(effect, toChannel)));
15696
+ const unwrap = (effect) => fromChannel(unwrap$2(map$4(effect, toChannel)));
15560
15697
  /**
15561
15698
  * Transforms the elements of this stream using the supplied function.
15562
15699
  *
@@ -15573,9 +15710,9 @@ const unwrap = (effect) => fromChannel(unwrap$2(map$5(effect, toChannel)));
15573
15710
  * @category mapping
15574
15711
  * @since 2.0.0
15575
15712
  */
15576
- const map$3 = /*#__PURE__*/ dual(2, (self, f) => suspend(() => {
15713
+ const map$2 = /*#__PURE__*/ dual(2, (self, f) => suspend(() => {
15577
15714
  let i = 0;
15578
- return fromChannel(map$4(self.channel, map$9((o) => f(o, i++))));
15715
+ return fromChannel(map$3(self.channel, map$8((o) => f(o, i++))));
15579
15716
  }));
15580
15717
  /**
15581
15718
  * Merges two streams, emitting elements from both as they arrive.
@@ -15643,7 +15780,7 @@ const transduce = /*#__PURE__*/ dual(2, (self, sink) => transformPull(self, (ups
15643
15780
  done$2 = fail$2(error);
15644
15781
  return done();
15645
15782
  }));
15646
- const pull = map$5(suspend$2(() => sink.transform(upstreamWithLeftover, scope)), ([value, leftover_]) => {
15783
+ const pull = map$4(suspend$2(() => sink.transform(upstreamWithLeftover, scope)), ([value, leftover_]) => {
15647
15784
  leftover = leftover_;
15648
15785
  return of(value);
15649
15786
  });
@@ -15680,7 +15817,7 @@ const transduce = /*#__PURE__*/ dual(2, (self, sink) => transformPull(self, (ups
15680
15817
  */
15681
15818
  const decodeText = /*#__PURE__*/ dual((args) => isStream(args[0]), (self, options) => suspend(() => {
15682
15819
  const decoder = new TextDecoder(options?.encoding);
15683
- return map$3(self, (chunk) => decoder.decode(chunk, { stream: true }));
15820
+ return map$2(self, (chunk) => decoder.decode(chunk, { stream: true }));
15684
15821
  }));
15685
15822
  /**
15686
15823
  * Splits a stream of strings into lines, handling `\n`, `\r`, and `\r\n` delimiters across chunks.
@@ -15720,7 +15857,7 @@ const splitLines = (self) => self.channel.pipe(pipeTo(splitLines$1()), fromChann
15720
15857
  * @category destructors
15721
15858
  * @since 2.0.0
15722
15859
  */
15723
- const run$3 = /*#__PURE__*/ dual(2, (self, sink) => scopedWith((scope) => toPullScoped(self.channel, scope).pipe(flatMap$1((upstream) => sink.transform(upstream, scope)), map$5(([a]) => a))));
15860
+ const run$3 = /*#__PURE__*/ dual(2, (self, sink) => scopedWith((scope) => toPullScoped(self.channel, scope).pipe(flatMap$1((upstream) => sink.transform(upstream, scope)), map$4(([a]) => a))));
15724
15861
  /**
15725
15862
  * Runs the stream and collects all elements into an array.
15726
15863
  *
@@ -15770,7 +15907,7 @@ const runCollect = (self) => runFold(self.channel, () => [], (acc, chunk) => {
15770
15907
  */
15771
15908
  const mkString = (self) => runFold(self.channel, () => "", (acc, chunk) => acc + chunk.join(""));
15772
15909
  //#endregion
15773
- //#region ../../node_modules/.pnpm/effect@4.0.2/node_modules/effect/dist/FileSystem.js
15910
+ //#region ../../node_modules/.pnpm/effect@4.0.4/node_modules/effect/dist/FileSystem.js
15774
15911
  /**
15775
15912
  * Defines the portable file system service for Effect programs.
15776
15913
  *
@@ -15885,7 +16022,7 @@ const make$11 = (impl) => FileSystem.of({
15885
16022
  sink: (path, options) => pipe(impl.open(path, {
15886
16023
  ...options,
15887
16024
  flag: options?.flag ?? "w"
15888
- }), map$5((file) => forEach((_) => file.writeAll(_))), unwrap$1),
16025
+ }), map$4((file) => forEach((_) => file.writeAll(_))), unwrap$1),
15889
16026
  writeFileString: (path, data, options) => flatMap$1(try_({
15890
16027
  try: () => new TextEncoder().encode(data),
15891
16028
  catch: (cause) => badArgument({
@@ -15956,7 +16093,7 @@ const FileTypeId = "~effect/FileSystem/File";
15956
16093
  */
15957
16094
  var WatchBackend = class extends (/*#__PURE__*/ Service()("effect/FileSystem/WatchBackend")) {};
15958
16095
  //#endregion
15959
- //#region ../../node_modules/.pnpm/effect@4.0.2/node_modules/effect/dist/Path.js
16096
+ //#region ../../node_modules/.pnpm/effect@4.0.4/node_modules/effect/dist/Path.js
15960
16097
  /**
15961
16098
  * Provides path operations through the Effect environment.
15962
16099
  *
@@ -16053,7 +16190,7 @@ const TypeId$9 = "~effect/Path";
16053
16190
  */
16054
16191
  const Path$1 = /*#__PURE__*/ Service("effect/Path");
16055
16192
  //#endregion
16056
- //#region ../../node_modules/.pnpm/effect@4.0.2/node_modules/effect/dist/ConfigProvider.js
16193
+ //#region ../../node_modules/.pnpm/effect@4.0.4/node_modules/effect/dist/ConfigProvider.js
16057
16194
  /**
16058
16195
  * Data sources used by `Config` to load raw configuration values. A
16059
16196
  * `ConfigProvider` reads paths from places such as environment variables,
@@ -16407,7 +16544,7 @@ function trieNodeAt(root, path) {
16407
16544
  return node;
16408
16545
  }
16409
16546
  //#endregion
16410
- //#region ../../node_modules/.pnpm/effect@4.0.2/node_modules/effect/dist/Config.js
16547
+ //#region ../../node_modules/.pnpm/effect@4.0.4/node_modules/effect/dist/Config.js
16411
16548
  /**
16412
16549
  * Descriptions of configuration values that can be read from a
16413
16550
  * `ConfigProvider`. A `Config<T>` explains which keys to read, how to decode
@@ -16718,7 +16855,7 @@ function String$2(name) {
16718
16855
  return schema(String$3, name);
16719
16856
  }
16720
16857
  //#endregion
16721
- //#region ../../node_modules/.pnpm/effect@4.0.2/node_modules/effect/dist/Console.js
16858
+ //#region ../../node_modules/.pnpm/effect@4.0.4/node_modules/effect/dist/Console.js
16722
16859
  /**
16723
16860
  * Context reference for the current console service in the Effect system, allowing access to the active console implementation from within the Effect context.
16724
16861
  *
@@ -16857,7 +16994,7 @@ const log = (...args) => consoleWith((console) => sync$1(() => {
16857
16994
  console.log(...args);
16858
16995
  }));
16859
16996
  //#endregion
16860
- //#region ../../node_modules/.pnpm/effect@4.0.2/node_modules/effect/dist/internal/ulid.js
16997
+ //#region ../../node_modules/.pnpm/effect@4.0.4/node_modules/effect/dist/internal/ulid.js
16861
16998
  const maxTimestamp = 2 ** 48 - 1;
16862
16999
  const base32Chars = "0123456789ABCDEFGHJKMNPQRSTVWXYZ";
16863
17000
  /** @internal */
@@ -16880,7 +17017,7 @@ const ulidString = (timestampMillis, bytes) => {
16880
17017
  return out;
16881
17018
  };
16882
17019
  //#endregion
16883
- //#region ../../node_modules/.pnpm/effect@4.0.2/node_modules/effect/dist/internal/uuid.js
17020
+ //#region ../../node_modules/.pnpm/effect@4.0.4/node_modules/effect/dist/internal/uuid.js
16884
17021
  const hex = (byte) => byte.toString(16).padStart(2, "0");
16885
17022
  /** @internal */
16886
17023
  const stringify = (bytes) => {
@@ -16899,8 +17036,6 @@ function v4Bytes(bytes = randomBytes()) {
16899
17036
  bytes[8] = bytes[8] & 63 | 128;
16900
17037
  return bytes;
16901
17038
  }
16902
- /** @internal */
16903
- const v4String = (bytes) => stringify(bytes === void 0 ? v4Bytes() : v4Bytes(bytes));
16904
17039
  const maxV7Timestamp = 2 ** 48 - 1;
16905
17040
  /** @internal */
16906
17041
  function v7Bytes(timestampMillis, bytes = randomBytes()) {
@@ -16915,10 +17050,8 @@ function v7Bytes(timestampMillis, bytes = randomBytes()) {
16915
17050
  bytes[8] = bytes[8] & 63 | 128;
16916
17051
  return bytes;
16917
17052
  }
16918
- /** @internal */
16919
- const v7String = (timestampMillis, bytes) => stringify(bytes === void 0 ? v7Bytes(timestampMillis) : v7Bytes(timestampMillis, bytes));
16920
17053
  //#endregion
16921
- //#region ../../node_modules/.pnpm/effect@4.0.2/node_modules/effect/dist/Crypto.js
17054
+ //#region ../../node_modules/.pnpm/effect@4.0.4/node_modules/effect/dist/Crypto.js
16922
17055
  /**
16923
17056
  * Defines a platform-independent service for cryptographic operations.
16924
17057
  *
@@ -16992,7 +17125,7 @@ const Crypto = /*#__PURE__*/ Service("effect/Crypto");
16992
17125
  */
16993
17126
  const make$8 = (impl) => {
16994
17127
  const randomBytesUnsafe = impl.randomBytes;
16995
- const randomBytes = (size) => map$5(validateSize("randomBytes", size), randomBytesUnsafe);
17128
+ const randomBytes = (size) => map$4(validateSize("randomBytes", size), randomBytesUnsafe);
16996
17129
  const readUint53 = (bytes) => (bytes[0] & 31) * 2 ** 48 + bytes[1] * 2 ** 40 + bytes[2] * 2 ** 32 + bytes[3] * 2 ** 24 + bytes[4] * 2 ** 16 + bytes[5] * 256 + bytes[6];
16997
17130
  const nextDoubleUnsafe = () => readUint53(randomBytesUnsafe(7)) / 2 ** 53;
16998
17131
  const nextIntUnsafe = () => {
@@ -17031,8 +17164,14 @@ const make$8 = (impl) => {
17031
17164
  }
17032
17165
  return buffer;
17033
17166
  }),
17034
- randomUUIDv4: sync(() => v4String(randomBytesUnsafe(16))),
17035
- randomUUIDv7: clockWith((clock) => succeed$2(v7String(clock.currentTimeMillisUnsafe(), randomBytesUnsafe(16)))),
17167
+ randomUUIDv4: (options) => sync(() => {
17168
+ const bytes = v4Bytes(randomBytesUnsafe(16));
17169
+ return options?.format === "bytes" ? bytes : stringify(bytes);
17170
+ }),
17171
+ randomUUIDv7: (options) => clockWith((clock) => {
17172
+ const bytes = v7Bytes(clock.currentTimeMillisUnsafe(), randomBytesUnsafe(16));
17173
+ return succeed$2(options?.format === "bytes" ? bytes : stringify(bytes));
17174
+ }),
17036
17175
  randomULID: clockWith((clock) => succeed$2(ulidString(clock.currentTimeMillisUnsafe(), randomBytesUnsafe(10))))
17037
17176
  });
17038
17177
  };
@@ -17042,7 +17181,7 @@ const validateSize = (method, size) => Number.isSafeInteger(size) && size >= 0 ?
17042
17181
  description: "size must be a non-negative safe integer"
17043
17182
  }));
17044
17183
  //#endregion
17045
- //#region ../../node_modules/.pnpm/effect@4.0.2/node_modules/effect/dist/Runtime.js
17184
+ //#region ../../node_modules/.pnpm/effect@4.0.4/node_modules/effect/dist/Runtime.js
17046
17185
  /**
17047
17186
  * Helpers for turning an `Effect` program into a host application's main entry
17048
17187
  * point. This module is the low-level layer used by platform adapters to run a
@@ -17333,7 +17472,7 @@ const getErrorReported = (u) => {
17333
17472
  return true;
17334
17473
  };
17335
17474
  //#endregion
17336
- //#region ../../node_modules/.pnpm/effect@4.0.2/node_modules/effect/dist/Stdio.js
17475
+ //#region ../../node_modules/.pnpm/effect@4.0.4/node_modules/effect/dist/Stdio.js
17337
17476
  /**
17338
17477
  * Service contract for command-line arguments and standard input, output, and
17339
17478
  * error output. It lets programs depend on standard I/O through the Effect
@@ -17402,10 +17541,11 @@ const make$7 = (options) => ({
17402
17541
  [TypeId$6]: TypeId$6,
17403
17542
  stdinIsTerminal: succeed$2(false),
17404
17543
  stdoutIsTerminal: succeed$2(false),
17544
+ stderrIsTerminal: succeed$2(false),
17405
17545
  ...options
17406
17546
  });
17407
17547
  //#endregion
17408
- //#region ../../node_modules/.pnpm/effect@4.0.2/node_modules/effect/dist/Terminal.js
17548
+ //#region ../../node_modules/.pnpm/effect@4.0.4/node_modules/effect/dist/Terminal.js
17409
17549
  const TypeId$5 = "~effect/Terminal";
17410
17550
  const QuitErrorTypeId = "~effect/Terminal/QuitError";
17411
17551
  /**
@@ -17488,7 +17628,7 @@ const make$6 = (impl) => Terminal.of({
17488
17628
  [TypeId$5]: TypeId$5
17489
17629
  });
17490
17630
  //#endregion
17491
- //#region ../../node_modules/.pnpm/effect@4.0.2/node_modules/effect/dist/process/ChildProcessSpawner.js
17631
+ //#region ../../node_modules/.pnpm/effect@4.0.4/node_modules/effect/dist/process/ChildProcessSpawner.js
17492
17632
  /**
17493
17633
  * Service boundary for starting and controlling child processes.
17494
17634
  *
@@ -17546,7 +17686,7 @@ const makeHandle = (params) => Object.setPrototypeOf({ ...params }, HandleProto)
17546
17686
  * @since 4.0.0
17547
17687
  */
17548
17688
  const make$5 = (spawn) => {
17549
- const streamString = (command, options) => spawn(command).pipe(map$5((handle) => decodeText(options?.includeStderr === true ? handle.all : handle.stdout)), unwrap);
17689
+ const streamString = (command, options) => spawn(command).pipe(map$4((handle) => decodeText(options?.includeStderr === true ? handle.all : handle.stdout)), unwrap);
17550
17690
  const streamLines = (command, options) => splitLines(streamString(command, options));
17551
17691
  return ChildProcessSpawner.of({
17552
17692
  spawn,
@@ -17566,7 +17706,7 @@ const make$5 = (spawn) => {
17566
17706
  */
17567
17707
  var ChildProcessSpawner = class extends (/*#__PURE__*/ Service()("effect/process/ChildProcessSpawner")) {};
17568
17708
  //#endregion
17569
- //#region ../../node_modules/.pnpm/effect@4.0.2/node_modules/effect/dist/process/ChildProcess.js
17709
+ //#region ../../node_modules/.pnpm/effect@4.0.4/node_modules/effect/dist/process/ChildProcess.js
17570
17710
  /**
17571
17711
  * Describes child processes before they are started.
17572
17712
  *
@@ -17782,7 +17922,7 @@ const concatTokens = (prevTokens, nextTokens, isSeparated) => isSeparated || pre
17782
17922
  ...nextTokens.slice(1)
17783
17923
  ];
17784
17924
  //#endregion
17785
- //#region ../../node_modules/.pnpm/@effect+platform-node-shared@4.0.2_effect@4.0.2/node_modules/@effect/platform-node-shared/dist/internal/nodeChildProcessSpawner.js
17925
+ //#region ../../node_modules/.pnpm/@effect+platform-node-shared@4.0.4_effect@4.0.4/node_modules/@effect/platform-node-shared/dist/internal/nodeChildProcessSpawner.js
17786
17926
  const buildSpawnOptions = (options, base, platform) => {
17787
17927
  const detached = options.detached ?? platform !== "win32";
17788
17928
  return {
@@ -17793,7 +17933,7 @@ const buildSpawnOptions = (options, base, platform) => {
17793
17933
  };
17794
17934
  };
17795
17935
  //#endregion
17796
- //#region ../../node_modules/.pnpm/@effect+platform-node-shared@4.0.2_effect@4.0.2/node_modules/@effect/platform-node-shared/dist/internal/utils.js
17936
+ //#region ../../node_modules/.pnpm/@effect+platform-node-shared@4.0.4_effect@4.0.4/node_modules/@effect/platform-node-shared/dist/internal/utils.js
17797
17937
  /** @internal */
17798
17938
  const handleErrnoException = (module, method) => (err, [path]) => {
17799
17939
  let reason = "Unknown";
@@ -17828,7 +17968,7 @@ const handleErrnoException = (module, method) => (err, [path]) => {
17828
17968
  });
17829
17969
  };
17830
17970
  //#endregion
17831
- //#region ../../node_modules/.pnpm/@effect+platform-node-shared@4.0.2_effect@4.0.2/node_modules/@effect/platform-node-shared/dist/NodeSink.js
17971
+ //#region ../../node_modules/.pnpm/@effect+platform-node-shared@4.0.4_effect@4.0.4/node_modules/@effect/platform-node-shared/dist/NodeSink.js
17832
17972
  /**
17833
17973
  * Creates a `Sink` that writes chunks to a Node writable stream, respecting
17834
17974
  * backpressure, mapping writable errors with `onError`, and ending the stream
@@ -17911,7 +18051,7 @@ const pullIntoWritable = (options) => options.pull.pipe(flatMap$1((chunk) => {
17911
18051
  });
17912
18052
  })));
17913
18053
  //#endregion
17914
- //#region ../../node_modules/.pnpm/@effect+platform-node-shared@4.0.2_effect@4.0.2/node_modules/@effect/platform-node-shared/dist/NodeStream.js
18054
+ //#region ../../node_modules/.pnpm/@effect+platform-node-shared@4.0.4_effect@4.0.4/node_modules/@effect/platform-node-shared/dist/NodeStream.js
17915
18055
  /**
17916
18056
  * Adapters between Node streams and Effect streams, channels, and readables.
17917
18057
  *
@@ -17994,7 +18134,7 @@ const readableToPullUnsafe = (options) => {
17994
18134
  };
17995
18135
  const defaultOnError = (error) => new UnknownError(error);
17996
18136
  //#endregion
17997
- //#region ../../node_modules/.pnpm/@effect+platform-node-shared@4.0.2_effect@4.0.2/node_modules/@effect/platform-node-shared/dist/NodeChildProcessSpawner.js
18137
+ //#region ../../node_modules/.pnpm/@effect+platform-node-shared@4.0.4_effect@4.0.4/node_modules/@effect/platform-node-shared/dist/NodeChildProcessSpawner.js
17998
18138
  const toError = (error) => error instanceof globalThis.Error ? error : new globalThis.Error(String(error));
17999
18139
  const toPlatformError = (method, error, command) => {
18000
18140
  const { commands } = flattenCommand(command);
@@ -18006,6 +18146,11 @@ const toPlatformError = (method, error, command) => {
18006
18146
  };
18007
18147
  const processGroupGraceMillis = 1e3;
18008
18148
  const processGroupPollIntervalMillis = 10;
18149
+ const handleInputErrors = (writable) => {
18150
+ const onError = () => {};
18151
+ writable.on("error", onError);
18152
+ writable.once("close", () => writable.off("error", onError));
18153
+ };
18009
18154
  /** The leader has not exited, or a member of its process group still exists. */
18010
18155
  const isProcessAlive = (childProcess, exitSignal) => {
18011
18156
  if (!isDoneUnsafe(exitSignal)) return true;
@@ -18017,12 +18162,18 @@ const isProcessAlive = (childProcess, exitSignal) => {
18017
18162
  return false;
18018
18163
  }
18019
18164
  };
18020
- const taskkill = (childProcess, onExit = () => {}) => NodeChildProcess.execFile("taskkill", [
18021
- "/pid",
18022
- String(childProcess.pid),
18023
- "/T",
18024
- "/F"
18025
- ], { windowsHide: true }, onExit);
18165
+ const taskkill = (childProcess, onExit = () => {}) => {
18166
+ if (childProcess.exitCode !== null || childProcess.signalCode !== null) {
18167
+ onExit(null);
18168
+ return;
18169
+ }
18170
+ NodeChildProcess.execFile("taskkill", [
18171
+ "/pid",
18172
+ String(childProcess.pid),
18173
+ "/T",
18174
+ "/F"
18175
+ ], { windowsHide: true }, onExit);
18176
+ };
18026
18177
  /**
18027
18178
  * Layer that provides the `NodeChildProcessSpawner` implementation.
18028
18179
  *
@@ -18110,10 +18261,13 @@ const layer$11 = /*#__PURE__*/ effect(ChildProcessSpawner, /* @__PURE__ */ gen(f
18110
18261
  switch (config.type) {
18111
18262
  case "input": {
18112
18263
  let sink = drain;
18113
- if (nodeStream && "write" in nodeStream) sink = fromWritable({
18114
- evaluate: () => nodeStream,
18115
- onError: (error) => toPlatformError(`fromWritable(fd${fd})`, toError(error), command)
18116
- });
18264
+ if (nodeStream && "write" in nodeStream) {
18265
+ handleInputErrors(nodeStream);
18266
+ sink = fromWritable({
18267
+ evaluate: () => nodeStream,
18268
+ onError: (error) => toPlatformError(`fromWritable(fd${fd})`, toError(error), command)
18269
+ });
18270
+ }
18117
18271
  if (config.stream) yield* forkScoped(run$3(config.stream, sink));
18118
18272
  inputSinks.set(fd, sink);
18119
18273
  break;
@@ -18142,12 +18296,15 @@ const layer$11 = /*#__PURE__*/ effect(ChildProcessSpawner, /* @__PURE__ */ gen(f
18142
18296
  });
18143
18297
  const setupChildStdin = (command, childProcess, config) => suspend$2(() => {
18144
18298
  let sink = drain;
18145
- if (isNotNull(childProcess.stdin)) sink = fromWritable({
18146
- evaluate: () => childProcess.stdin,
18147
- onError: (error) => toPlatformError("fromWritable(stdin)", toError(error), command),
18148
- endOnDone: config.endOnDone,
18149
- encoding: config.encoding
18150
- });
18299
+ if (isNotNull(childProcess.stdin)) {
18300
+ handleInputErrors(childProcess.stdin);
18301
+ sink = fromWritable({
18302
+ evaluate: () => childProcess.stdin,
18303
+ onError: (error) => toPlatformError("fromWritable(stdin)", toError(error), command),
18304
+ endOnDone: config.endOnDone,
18305
+ encoding: config.encoding
18306
+ });
18307
+ }
18151
18308
  if (isStream(config.stream)) return as(forkScoped(run$3(config.stream, sink)), sink);
18152
18309
  return succeed$2(sink);
18153
18310
  });
@@ -18321,7 +18478,7 @@ const layer$11 = /*#__PURE__*/ effect(ChildProcessSpawner, /* @__PURE__ */ gen(f
18321
18478
  const stdin = yield* setupChildStdin(cmd, childProcess, stdinConfig);
18322
18479
  const { all, stderr, stdout } = setupChildOutputStreams(cmd, childProcess, stdoutConfig, stderrConfig);
18323
18480
  const { getInputFd, getOutputFd } = yield* setupAdditionalFds(cmd, childProcess, resolvedAdditionalFds);
18324
- const isRunning = map$5(isDone(exitSignal), (done) => !done);
18481
+ const isRunning = map$4(isDone(exitSignal), (done) => !done);
18325
18482
  const exitCode = flatMap$1(_await(exitSignal), ([code, signal]) => {
18326
18483
  if (isNotNull(code)) return succeed$2(ExitCode(code));
18327
18484
  const error = new globalThis.Error(`Process interrupted due to receipt of signal: '${signal}'`);
@@ -18439,7 +18596,7 @@ const flattenCommand = (command) => {
18439
18596
  };
18440
18597
  };
18441
18598
  //#endregion
18442
- //#region ../../node_modules/.pnpm/@effect+platform-node-shared@4.0.2_effect@4.0.2/node_modules/@effect/platform-node-shared/dist/NodeCrypto.js
18599
+ //#region ../../node_modules/.pnpm/@effect+platform-node-shared@4.0.4_effect@4.0.4/node_modules/@effect/platform-node-shared/dist/NodeCrypto.js
18443
18600
  /**
18444
18601
  * Node-compatible implementation of Effect's `Crypto` service.
18445
18602
  *
@@ -18470,7 +18627,7 @@ const digest = (algorithm, data) => try_({
18470
18627
  })
18471
18628
  });
18472
18629
  //#endregion
18473
- //#region ../../node_modules/.pnpm/@effect+platform-node@4.0.2_effect@4.0.2_redis@6.3.0_@opentelemetry+api@1.9.1_/node_modules/@effect/platform-node/dist/NodeCrypto.js
18630
+ //#region ../../node_modules/.pnpm/@effect+platform-node@4.0.4_effect@4.0.4_redis@6.3.0_@opentelemetry+api@1.9.1_/node_modules/@effect/platform-node/dist/NodeCrypto.js
18474
18631
  /**
18475
18632
  * The `NodeCrypto` module provides the Node.js `Crypto` service layer for
18476
18633
  * Effect programs. Provide {@link layer} at the edge of a Node application,
@@ -18497,7 +18654,7 @@ const layer$9 = /* @__PURE__ */ succeed$3(Crypto, /* @__PURE__ */ make$8({
18497
18654
  digest
18498
18655
  }));
18499
18656
  //#endregion
18500
- //#region ../../node_modules/.pnpm/@effect+platform-node-shared@4.0.2_effect@4.0.2/node_modules/@effect/platform-node-shared/dist/NodeFileSystem.js
18657
+ //#region ../../node_modules/.pnpm/@effect+platform-node-shared@4.0.4_effect@4.0.4/node_modules/@effect/platform-node-shared/dist/NodeFileSystem.js
18501
18658
  /**
18502
18659
  * Shared Node-compatible implementation of Effect's `FileSystem` service.
18503
18660
  *
@@ -18520,7 +18677,7 @@ const bigintToNumber = (value, field) => {
18520
18677
  if (!Number.isSafeInteger(number)) throw new RangeError(`${field} exceeds the safe integer range: ${value}`);
18521
18678
  return number;
18522
18679
  };
18523
- const bigintToNumberOption = (value) => flatMap$3(fromNullishOr(value), toNumber);
18680
+ const bigintToNumberOption = (value) => flatMap$4(fromNullishOr(value), toNumber);
18524
18681
  const positionToNumber = (position, method) => try_({
18525
18682
  try: () => bigintToNumber(position, "position"),
18526
18683
  catch: handleBadArgument(method)
@@ -18594,12 +18751,41 @@ const makeTempDirectoryScoped = /*#__PURE__*/ (() => {
18594
18751
  const removeDirectory = /*#__PURE__*/ removeFactory("makeTempDirectoryScoped");
18595
18752
  return (options) => acquireRelease(makeDirectory(options), (directory) => orDie(removeDirectory(directory, { recursive: true })));
18596
18753
  })();
18754
+ const openFlagBits = (flag) => {
18755
+ const { O_APPEND, O_CREAT, O_EXCL, O_RDONLY, O_RDWR, O_TRUNC, O_WRONLY } = NFS.constants;
18756
+ switch (flag) {
18757
+ case "r": return O_RDONLY;
18758
+ case "r+": return O_RDWR;
18759
+ case "w": return O_TRUNC | O_CREAT | O_WRONLY;
18760
+ case "wx": return O_TRUNC | O_CREAT | O_WRONLY | O_EXCL;
18761
+ case "w+": return O_TRUNC | O_CREAT | O_RDWR;
18762
+ case "wx+": return O_TRUNC | O_CREAT | O_RDWR | O_EXCL;
18763
+ case "a": return O_APPEND | O_CREAT | O_WRONLY;
18764
+ case "ax": return O_APPEND | O_CREAT | O_WRONLY | O_EXCL;
18765
+ case "a+": return O_APPEND | O_CREAT | O_RDWR;
18766
+ case "ax+": return O_APPEND | O_CREAT | O_RDWR | O_EXCL;
18767
+ }
18768
+ };
18769
+ const noFollowFlags = (method, flag) => suspend$2(() => {
18770
+ const { O_NOFOLLOW } = NFS.constants;
18771
+ if (process.platform === "win32" || typeof O_NOFOLLOW !== "number" || O_NOFOLLOW === 0) return fail$1(badArgument({
18772
+ module: "FileSystem",
18773
+ method,
18774
+ description: "noFollow is not supported on this platform"
18775
+ }));
18776
+ return succeed$2(openFlagBits(flag) | O_NOFOLLOW);
18777
+ });
18597
18778
  const openFactory = (method) => {
18598
18779
  const nodeOpen = effectify(NFS.open, handleErrnoException("FileSystem", method), handleBadArgument(method));
18599
18780
  const nodeClose = effectify(NFS.close, handleErrnoException("FileSystem", method), handleBadArgument(method));
18600
- return (path, options) => pipe(acquireRelease(nodeOpen(path, options?.flag ?? "r", options?.mode), (fd) => orDie(nodeClose(fd))), map$5((fd) => makeFile(fd, options?.flag?.startsWith("a") ?? false)));
18781
+ return (path, options) => pipe(acquireRelease(options?.noFollow === true ? flatMap$1(noFollowFlags(method, options.flag ?? "r"), (flags) => nodeOpen(path, flags, options.mode)) : nodeOpen(path, options?.flag ?? "r", options?.mode), (fd) => orDie(nodeClose(fd))), map$4((fd) => makeFile(fd, options?.flag?.startsWith("a") ?? false)));
18601
18782
  };
18602
18783
  const open = /*#__PURE__*/ openFactory("open");
18784
+ const negativePosition = (method) => badArgument({
18785
+ module: "FileSystem",
18786
+ method,
18787
+ description: "Cannot read before the start of the file"
18788
+ });
18603
18789
  const makeFile = /*#__PURE__*/ (() => {
18604
18790
  const nodeReadFactory = (method) => effectify(NFS.read, handleErrnoException("FileSystem", method), handleBadArgument(method));
18605
18791
  const nodeRead = /*#__PURE__*/ nodeReadFactory("read");
@@ -18638,10 +18824,15 @@ const makeFile = /*#__PURE__*/ (() => {
18638
18824
  return succeed$2(position);
18639
18825
  });
18640
18826
  }
18641
- read(buffer) {
18827
+ read(buffer, options) {
18642
18828
  return suspend$2(() => {
18829
+ const explicit = options?.position;
18830
+ if (explicit !== void 0) return explicit < BigInt(0) ? fail$1(negativePosition("read")) : nodeRead(this.fd, {
18831
+ buffer,
18832
+ position: explicit
18833
+ });
18643
18834
  const position = this.position;
18644
- return map$5(nodeRead(this.fd, {
18835
+ return map$4(nodeRead(this.fd, {
18645
18836
  buffer,
18646
18837
  position
18647
18838
  }), (bytesRead) => {
@@ -18650,18 +18841,20 @@ const makeFile = /*#__PURE__*/ (() => {
18650
18841
  });
18651
18842
  });
18652
18843
  }
18653
- readAlloc(size) {
18844
+ readAlloc(size, options) {
18654
18845
  return suspend$2(() => {
18655
18846
  try {
18656
18847
  if (!Number.isInteger(size) || size < 0) throw new RangeError("size must be a non-negative integer");
18848
+ const explicit = options?.position;
18849
+ if (explicit !== void 0 && explicit < BigInt(0)) return fail$1(negativePosition("readAlloc"));
18657
18850
  const buffer = Buffer.allocUnsafeSlow(size);
18658
- const position = this.position;
18659
- return map$5(nodeReadAlloc(this.fd, {
18851
+ const position = explicit ?? this.position;
18852
+ return map$4(nodeReadAlloc(this.fd, {
18660
18853
  buffer,
18661
18854
  position
18662
18855
  }), (bytesRead) => {
18663
18856
  if (bytesRead === 0) return none();
18664
- this.position = position + BigInt(bytesRead);
18857
+ if (explicit === void 0) this.position = position + BigInt(bytesRead);
18665
18858
  if (bytesRead === size) return some(buffer);
18666
18859
  const dst = Buffer.allocUnsafeSlow(bytesRead);
18667
18860
  buffer.copy(dst, 0, 0, bytesRead);
@@ -18673,7 +18866,7 @@ const makeFile = /*#__PURE__*/ (() => {
18673
18866
  });
18674
18867
  }
18675
18868
  truncate(length) {
18676
- return map$5(nodeTruncate(this.fd, length || void 0), () => {
18869
+ return map$4(nodeTruncate(this.fd, length || void 0), () => {
18677
18870
  if (!this.append) {
18678
18871
  const len = BigInt(length ?? 0);
18679
18872
  if (this.position > len) this.position = len;
@@ -18683,7 +18876,7 @@ const makeFile = /*#__PURE__*/ (() => {
18683
18876
  write(buffer) {
18684
18877
  return suspend$2(() => {
18685
18878
  const position = this.position;
18686
- return flatMap$1(this.append ? succeed$2(void 0) : positionToNumber(position, "write"), (nodePosition) => map$5(nodeWrite(this.fd, buffer, void 0, void 0, nodePosition), (bytesWritten) => {
18879
+ return flatMap$1(this.append ? succeed$2(void 0) : positionToNumber(position, "write"), (nodePosition) => map$4(nodeWrite(this.fd, buffer, void 0, void 0, nodePosition), (bytesWritten) => {
18687
18880
  if (!this.append) this.position = position + BigInt(bytesWritten);
18688
18881
  return bytesWritten;
18689
18882
  }));
@@ -18827,7 +19020,7 @@ const watchNode = (path, info, options) => callback((queue) => acquireRelease(sy
18827
19020
  });
18828
19021
  return watcher;
18829
19022
  }), (watcher) => sync(() => watcher.close())));
18830
- const watch = (backend, path, options) => stat(path).pipe(map$5((stat) => backend.pipe(flatMap$3((_) => _.register(path, stat, options)), getOrElse(() => watchNode(path, stat, options)))), unwrap);
19023
+ const watch = (backend, path, options) => stat(path).pipe(map$4((stat) => backend.pipe(flatMap$4((_) => _.register(path, stat, options)), getOrElse(() => watchNode(path, stat, options)))), unwrap);
18831
19024
  const writeFile = (path, data, options) => callback$1((resume, signal) => {
18832
19025
  try {
18833
19026
  NFS.writeFile(path, data, {
@@ -18842,7 +19035,7 @@ const writeFile = (path, data, options) => callback$1((resume, signal) => {
18842
19035
  resume(fail$1(handleBadArgument("writeFile")(err)));
18843
19036
  }
18844
19037
  });
18845
- const makeFileSystem = /*#__PURE__*/ map$5(/*#__PURE__*/ serviceOption(WatchBackend), (backend) => make$11({
19038
+ const makeFileSystem = /*#__PURE__*/ map$4(/*#__PURE__*/ serviceOption(WatchBackend), (backend) => make$11({
18846
19039
  access,
18847
19040
  chmod,
18848
19041
  chown,
@@ -18872,7 +19065,7 @@ const makeFileSystem = /*#__PURE__*/ map$5(/*#__PURE__*/ serviceOption(WatchBack
18872
19065
  writeFile
18873
19066
  }));
18874
19067
  //#endregion
18875
- //#region ../../node_modules/.pnpm/@effect+platform-node@4.0.2_effect@4.0.2_redis@6.3.0_@opentelemetry+api@1.9.1_/node_modules/@effect/platform-node/dist/NodeFileSystem.js
19068
+ //#region ../../node_modules/.pnpm/@effect+platform-node@4.0.4_effect@4.0.4_redis@6.3.0_@opentelemetry+api@1.9.1_/node_modules/@effect/platform-node/dist/NodeFileSystem.js
18876
19069
  /**
18877
19070
  * Node.js `FileSystem` layer for programs that perform real filesystem I/O.
18878
19071
  *
@@ -18893,7 +19086,7 @@ const makeFileSystem = /*#__PURE__*/ map$5(/*#__PURE__*/ serviceOption(WatchBack
18893
19086
  */
18894
19087
  const layer$7 = /* @__PURE__ */ effect(FileSystem)(makeFileSystem);
18895
19088
  //#endregion
18896
- //#region ../../node_modules/.pnpm/@effect+platform-node-shared@4.0.2_effect@4.0.2/node_modules/@effect/platform-node-shared/dist/NodePath.js
19089
+ //#region ../../node_modules/.pnpm/@effect+platform-node-shared@4.0.4_effect@4.0.4/node_modules/@effect/platform-node-shared/dist/NodePath.js
18897
19090
  /**
18898
19091
  * Node-backed provider for Effect's `Path` service.
18899
19092
  *
@@ -18932,7 +19125,7 @@ const fileUrlOps = (windows) => ({
18932
19125
  .../*#__PURE__*/ fileUrlOps(true)
18933
19126
  });
18934
19127
  //#endregion
18935
- //#region ../../node_modules/.pnpm/@effect+platform-node@4.0.2_effect@4.0.2_redis@6.3.0_@opentelemetry+api@1.9.1_/node_modules/@effect/platform-node/dist/NodePath.js
19128
+ //#region ../../node_modules/.pnpm/@effect+platform-node@4.0.4_effect@4.0.4_redis@6.3.0_@opentelemetry+api@1.9.1_/node_modules/@effect/platform-node/dist/NodePath.js
18936
19129
  /**
18937
19130
  * Node.js layers for Effect's `Path` service.
18938
19131
  *
@@ -18958,7 +19151,7 @@ const layer$5 = /* @__PURE__ */ succeed$3(Path$1)({
18958
19151
  .../*#__PURE__*/ fileUrlOps(void 0)
18959
19152
  });
18960
19153
  //#endregion
18961
- //#region ../../node_modules/.pnpm/@effect+platform-node@4.0.2_effect@4.0.2_redis@6.3.0_@opentelemetry+api@1.9.1_/node_modules/@effect/platform-node/dist/NodeStdio.js
19154
+ //#region ../../node_modules/.pnpm/@effect+platform-node@4.0.4_effect@4.0.4_redis@6.3.0_@opentelemetry+api@1.9.1_/node_modules/@effect/platform-node/dist/NodeStdio.js
18962
19155
  /**
18963
19156
  * Node.js `Stdio` layer for the current process.
18964
19157
  *
@@ -18982,6 +19175,7 @@ const layer$3 = /* @__PURE__ */ succeed$3(Stdio, /*#__PURE__*/ make$7({
18982
19175
  args: /*#__PURE__*/ sync(() => process.argv.slice(2)),
18983
19176
  stdinIsTerminal: /*#__PURE__*/ sync(() => process.stdin.isTTY === true),
18984
19177
  stdoutIsTerminal: /*#__PURE__*/ sync(() => process.stdout.isTTY === true),
19178
+ stderrIsTerminal: /*#__PURE__*/ sync(() => process.stderr.isTTY === true),
18985
19179
  stdout: (options) => fromWritable({
18986
19180
  evaluate: () => process.stdout,
18987
19181
  onError: (cause) => systemError({
@@ -19015,7 +19209,7 @@ const layer$3 = /* @__PURE__ */ succeed$3(Stdio, /*#__PURE__*/ make$7({
19015
19209
  }));
19016
19210
  /**
19017
19211
  * Provides the default process-backed `Terminal` service, ending key input on
19018
- * Ctrl+C or Ctrl+D.
19212
+ * bare Esc, Ctrl+C, or Ctrl+D.
19019
19213
  *
19020
19214
  * @stability unstable
19021
19215
  * @category layers
@@ -19120,10 +19314,11 @@ const layer$2 = /*#__PURE__*/ effect(Terminal, /*#__PURE__*/ (/* @__PURE__ */ fn
19120
19314
  });
19121
19315
  }))(defaultShouldQuit));
19122
19316
  function defaultShouldQuit(input) {
19123
- return input.key.ctrl && (input.key.name === "c" || input.key.name === "d");
19317
+ const key = input.key;
19318
+ return key.name === "escape" || key.ctrl && (key.name === "c" || key.name === "d");
19124
19319
  }
19125
19320
  //#endregion
19126
- //#region ../../node_modules/.pnpm/@effect+platform-node@4.0.2_effect@4.0.2_redis@6.3.0_@opentelemetry+api@1.9.1_/node_modules/@effect/platform-node/dist/NodeServices.js
19321
+ //#region ../../node_modules/.pnpm/@effect+platform-node@4.0.4_effect@4.0.4_redis@6.3.0_@opentelemetry+api@1.9.1_/node_modules/@effect/platform-node/dist/NodeServices.js
19127
19322
  /**
19128
19323
  * Provides the default Node implementations for child process spawning,
19129
19324
  * filesystem, path, stdio, and terminal services.
@@ -19134,7 +19329,7 @@ function defaultShouldQuit(input) {
19134
19329
  */
19135
19330
  const layer = /*#__PURE__*/ provideMerge(layer$11, /*#__PURE__*/ mergeAll(layer$7, layer$9, layer$5, layer$3, layer$2));
19136
19331
  //#endregion
19137
- //#region ../../node_modules/.pnpm/@effect+platform-node@4.0.2_effect@4.0.2_redis@6.3.0_@opentelemetry+api@1.9.1_/node_modules/@effect/platform-node/dist/NodeRuntime.js
19332
+ //#region ../../node_modules/.pnpm/@effect+platform-node@4.0.4_effect@4.0.4_redis@6.3.0_@opentelemetry+api@1.9.1_/node_modules/@effect/platform-node/dist/NodeRuntime.js
19138
19333
  /**
19139
19334
  * Node.js process runner for Effect programs.
19140
19335
  *
@@ -19188,7 +19383,7 @@ const runMain = /* @__PURE__ */ makeRunMain(({ fiber, teardown }) => {
19188
19383
  process.on("SIGTERM", onSigint);
19189
19384
  });
19190
19385
  //#endregion
19191
- //#region ../../node_modules/.pnpm/effect@4.0.2/node_modules/effect/dist/cli/CliError.js
19386
+ //#region ../../node_modules/.pnpm/effect@4.0.4/node_modules/effect/dist/cli/CliError.js
19192
19387
  /**
19193
19388
  * Defines structured errors for the unstable CLI parser and runner.
19194
19389
  *
@@ -19718,7 +19913,7 @@ var ShowHelp = class extends (/*#__PURE__*/ TaggedError(`${TypeId$3}/ShowHelp`)(
19718
19913
  }
19719
19914
  };
19720
19915
  //#endregion
19721
- //#region ../../node_modules/.pnpm/effect@4.0.2/node_modules/effect/dist/cli/Primitive.js
19916
+ //#region ../../node_modules/.pnpm/effect@4.0.4/node_modules/effect/dist/cli/Primitive.js
19722
19917
  /**
19723
19918
  * Parses raw command-line strings into typed values.
19724
19919
  *
@@ -19915,7 +20110,7 @@ const getChoiceKeys = (primitive) => primitive._tag === "Choice" ? primitive.cho
19915
20110
  */
19916
20111
  const getPathType = (primitive) => primitive._tag === "Path" ? primitive.pathType : void 0;
19917
20112
  //#endregion
19918
- //#region ../../node_modules/.pnpm/effect@4.0.2/node_modules/effect/dist/cli/internal/ansi.js
20113
+ //#region ../../node_modules/.pnpm/effect@4.0.4/node_modules/effect/dist/cli/internal/ansi.js
19919
20114
  /**
19920
20115
  * Internal ANSI escape sequence helpers used by the unstable CLI rendering
19921
20116
  * implementation. This module centralizes the control codes for text styling,
@@ -19999,9 +20194,27 @@ const blackBright = `${ESC}90m`;
19999
20194
  * @internal
20000
20195
  */
20001
20196
  const cyanBright = `${ESC}96m`;
20002
- const annotate = (text, ...styles) => {
20197
+ /**
20198
+ * Wraps `text` in the given styles followed by a reset. When `colors` is
20199
+ * `false` the text is returned unchanged, so callers gate color and style
20200
+ * escapes in one place while cursor and erase controls stay untouched.
20201
+ *
20202
+ * @internal
20203
+ */
20204
+ const annotate = (colors, text, ...styles) => {
20205
+ if (!colors) return text;
20003
20206
  return `${styles.flat().join("")}${text}${reset}`;
20004
20207
  };
20208
+ /**
20209
+ * Detects whether CLI output should use color and style escapes: stdout must
20210
+ * be a TTY and `NO_COLOR` must be unset or empty.
20211
+ *
20212
+ * @internal
20213
+ */
20214
+ const detectColors = () => {
20215
+ const globalProcess = globalThis.process;
20216
+ return typeof globalProcess === "object" && globalProcess !== null && typeof globalProcess.stdout === "object" && globalProcess.stdout !== null && globalProcess.stdout.isTTY === true && !globalProcess.env?.NO_COLOR;
20217
+ };
20005
20218
  const combine = (...styles) => styles;
20006
20219
  /**
20007
20220
  * @internal
@@ -20037,7 +20250,7 @@ const eraseLines = (rows) => {
20037
20250
  return command;
20038
20251
  };
20039
20252
  //#endregion
20040
- //#region ../../node_modules/.pnpm/effect@4.0.2/node_modules/effect/dist/cli/Prompt.js
20253
+ //#region ../../node_modules/.pnpm/effect@4.0.4/node_modules/effect/dist/cli/Prompt.js
20041
20254
  /**
20042
20255
  * Builds interactive terminal prompts for CLI applications.
20043
20256
  *
@@ -20083,13 +20296,19 @@ const windowsTheme = {
20083
20296
  /**
20084
20297
  * Creates a prompt theme using the current platform defaults.
20085
20298
  *
20299
+ * **Details**
20300
+ *
20301
+ * Unless `colors` is provided, it is detected when the theme is created:
20302
+ * colors are enabled when stdout is a TTY and `NO_COLOR` is unset or empty.
20303
+ *
20086
20304
  * @stability unstable
20087
20305
  * @category constructors
20088
20306
  * @since 4.0.0
20089
20307
  */
20090
20308
  const makeTheme = (options) => ({
20091
20309
  ...process.platform === "win32" ? windowsTheme : defaultTheme,
20092
- ...options
20310
+ ...options,
20311
+ colors: options?.colors ?? detectColors()
20093
20312
  });
20094
20313
  /**
20095
20314
  * Context reference for the theme used by built-in prompts.
@@ -20097,20 +20316,25 @@ const makeTheme = (options) => ({
20097
20316
  * **Details**
20098
20317
  *
20099
20318
  * Provide this reference once to theme every prompt in an application. A
20100
- * prompt's `theme` option takes precedence over the context value.
20319
+ * prompt's `theme` option takes precedence over the context value. The
20320
+ * command wizard also reads `colors` from this reference, so provide a theme
20321
+ * with `colors: false` to disable wizard styling.
20322
+ *
20323
+ * The default value is created with `makeTheme` the first time it is read,
20324
+ * so color detection runs once per process. Changes to `NO_COLOR` after the
20325
+ * first prompt do not affect the default theme.
20101
20326
  *
20102
20327
  * @stability unstable
20103
20328
  * @category services
20104
20329
  * @since 4.0.0
20105
20330
  */
20106
20331
  const Theme = /*#__PURE__*/ Reference("effect/cli/Prompt/Theme", { defaultValue: makeTheme });
20107
- const getTheme = (options) => map$5(Theme, (theme) => ({
20332
+ const getTheme = (options) => map$4(Theme, (theme) => ({
20108
20333
  ...theme,
20109
20334
  ...options.theme
20110
20335
  }));
20111
- const annotateLine = (line) => annotate(line, bold);
20112
- const annotateErrorLine = (line, color) => annotate(line, combine(italicized, color));
20113
- const annotateSymbol = (symbol, ...styles) => symbol.length === 0 ? "" : annotate(symbol, ...styles);
20336
+ const annotateErrorLine = (theme, line) => annotate(theme.colors, line, combine(italicized, theme.errorColor));
20337
+ const annotateSymbol = (theme, symbol, ...styles) => symbol.length === 0 ? "" : annotate(theme.colors, symbol, ...styles);
20114
20338
  const separateSymbol = (symbol, text) => symbol.length === 0 ? text : symbol + " " + text;
20115
20339
  const renderPagingPrefix = (theme, showArrowUp, showArrowDown) => {
20116
20340
  const width = Math.max(theme.arrowUp.length, theme.arrowDown.length);
@@ -20338,7 +20562,7 @@ const Int = (options) => {
20338
20562
  * @category combinators
20339
20563
  * @since 4.0.0
20340
20564
  */
20341
- const map$2 = /*#__PURE__*/ dual(2, (self, f) => flatMap(self, (a) => succeed(f(a))));
20565
+ const map$1 = /*#__PURE__*/ dual(2, (self, f) => flatMap(self, (a) => succeed(f(a))));
20342
20566
  /**
20343
20567
  * Creates a password prompt that masks typed input and returns the submitted
20344
20568
  * value wrapped in `Redacted`.
@@ -20347,7 +20571,7 @@ const map$2 = /*#__PURE__*/ dual(2, (self, f) => flatMap(self, (a) => succeed(f(
20347
20571
  * @category constructors
20348
20572
  * @since 4.0.0
20349
20573
  */
20350
- const Password = (options) => basePrompt(options, "password").pipe(map$2(make$20));
20574
+ const Password = (options) => basePrompt(options, "password").pipe(map$1(make$20));
20351
20575
  /**
20352
20576
  * Runs a prompt by reading terminal input and rendering prompt frames until the
20353
20577
  * prompt submits a value.
@@ -20363,7 +20587,7 @@ const Password = (options) => basePrompt(options, "password").pipe(map$2(make$20
20363
20587
  */
20364
20588
  const run$2 = /*#__PURE__*/ fnUntraced(function* (self) {
20365
20589
  const terminal = yield* Terminal;
20366
- const input = yield* terminal.readInput;
20590
+ const input = yield* cached(terminal.readInput);
20367
20591
  return yield* runWithInput(self, terminal, input);
20368
20592
  }, /*#__PURE__*/ mapError(() => new QuitError({})), scoped);
20369
20593
  const getSelectInitialIndex = (choices) => {
@@ -20460,7 +20684,7 @@ const proto = {
20460
20684
  const runWithInput = (prompt, terminal, input) => suspend$2(() => {
20461
20685
  const op = prompt;
20462
20686
  switch (op._tag) {
20463
- case "Loop": return runLoop(op, terminal, input);
20687
+ case "Loop": return flatMap$1(input, (queue) => runLoop(op, terminal, queue));
20464
20688
  case "OnSuccess": return flatMap$1(runWithInput(op.prompt, terminal, input), (a) => runWithInput(op.onSuccess(a), terminal, input));
20465
20689
  case "Succeed": return succeed$2(op.value);
20466
20690
  }
@@ -20474,11 +20698,11 @@ const runLoop = /*#__PURE__*/ fnUntraced(function* (loop, terminal, input) {
20474
20698
  yield* orDie(terminal.display(clear + msg));
20475
20699
  clear = "";
20476
20700
  if (loop.events) {
20477
- const takeInput = take(input).pipe(map$5((input) => ({
20701
+ const takeInput = take(input).pipe(map$4((input) => ({
20478
20702
  _tag: "Input",
20479
20703
  input
20480
20704
  })));
20481
- const result = yield* raceFirst(takeInput, take(loop.events).pipe(map$5((value) => ({
20705
+ const result = yield* raceFirst(takeInput, take(loop.events).pipe(map$4((value) => ({
20482
20706
  _tag: "Event",
20483
20707
  value
20484
20708
  }))));
@@ -20515,7 +20739,7 @@ const eraseText = (text, columns) => {
20515
20739
  };
20516
20740
  const lines = (prompt, columns) => {
20517
20741
  const lines = prompt.split(NEWLINE_REGEXP);
20518
- return columns === 0 ? lines.length : pipe(map$9(lines, (line) => Math.ceil(line.length / columns)), reduce(0, (left, right) => left + right));
20742
+ return columns === 0 ? lines.length : pipe(map$8(lines, (line) => Math.ceil(line.length / columns)), reduce(0, (left, right) => left + right));
20519
20743
  };
20520
20744
  const clearOutputWithError = (outputText, columns, errorText) => {
20521
20745
  if (errorText !== void 0 && errorText.length > 0) return cursorDown(lines(errorText, columns)) + eraseText(`\n${errorText}`, columns) + eraseText(outputText, columns);
@@ -20528,26 +20752,25 @@ const handleConfirmClear = (options) => {
20528
20752
  const columns = yield* (yield* Terminal).columns;
20529
20753
  const figures = yield* getTheme(options);
20530
20754
  const confirmMessage = state.value ? options.placeholder.defaultConfirm : options.placeholder.defaultDeny;
20531
- const promptText = renderConfirmOutput(confirmMessage, figures.prefix, figures.pointerSmall, options, { plain: true });
20755
+ const promptText = renderPrompt(confirmMessage, options.message, figures.prefix, figures.pointerSmall, figures, { plain: true });
20532
20756
  return eraseText(promptText, columns) + (eraseLine + cursorLeft);
20533
20757
  });
20534
20758
  };
20535
- const renderConfirmOutput = (confirm, leadingSymbol, trailingSymbol, options, renderOptions) => renderPrompt(confirm, options.message, leadingSymbol, trailingSymbol, renderOptions);
20536
20759
  const renderConfirmNextFrame = /*#__PURE__*/ fnUntraced(function* (state, options) {
20537
20760
  const figures = yield* getTheme(options);
20538
- const leadingSymbol = annotateSymbol(figures.prefix, figures.primaryColor);
20539
- const trailingSymbol = annotateSymbol(figures.pointerSmall, figures.mutedColor);
20761
+ const leadingSymbol = annotateSymbol(figures, figures.prefix, figures.primaryColor);
20762
+ const trailingSymbol = annotateSymbol(figures, figures.pointerSmall, figures.mutedColor);
20540
20763
  const confirmMessage = state.value ? options.placeholder.defaultConfirm : options.placeholder.defaultDeny;
20541
- const confirm = annotate(confirmMessage, figures.mutedColor);
20542
- const promptMsg = renderConfirmOutput(confirm, leadingSymbol, trailingSymbol, options);
20764
+ const confirm = annotate(figures.colors, confirmMessage, figures.mutedColor);
20765
+ const promptMsg = renderPrompt(confirm, options.message, leadingSymbol, trailingSymbol, figures);
20543
20766
  return cursorHide + promptMsg;
20544
20767
  });
20545
20768
  const renderConfirmSubmission = /*#__PURE__*/ fnUntraced(function* (value, options) {
20546
20769
  const figures = yield* getTheme(options);
20547
- const leadingSymbol = annotateSymbol(figures.tick, figures.successColor);
20548
- const trailingSymbol = annotateSymbol(figures.ellipsis, figures.mutedColor);
20770
+ const leadingSymbol = annotateSymbol(figures, figures.tick, figures.successColor);
20771
+ const trailingSymbol = annotateSymbol(figures, figures.ellipsis, figures.mutedColor);
20549
20772
  const confirmMessage = value ? options.label.confirm : options.label.deny;
20550
- return renderConfirmOutput(confirmMessage, leadingSymbol, trailingSymbol, options) + "\n";
20773
+ return renderPrompt(confirmMessage, options.message, leadingSymbol, trailingSymbol, figures) + "\n";
20551
20774
  });
20552
20775
  const handleConfirmRender = (options) => {
20553
20776
  return (_, action) => {
@@ -20573,7 +20796,7 @@ const handleDateClear = (options) => {
20573
20796
  const figures = yield* getTheme(options);
20574
20797
  const resetCurrentLine = eraseLine + cursorLeft;
20575
20798
  const parts = reduce(state.dateParts, "", (doc, part) => doc + part.toString());
20576
- const promptText = renderDateOutput(figures.prefix, figures.pointerSmall, parts, options, { plain: true });
20799
+ const promptText = renderPrompt(parts, options.message, figures.prefix, figures.pointerSmall, figures, { plain: true });
20577
20800
  const errorText = isSome(state.error) ? match$5(state.error.value.split(NEWLINE_REGEXP), {
20578
20801
  onEmpty: () => "",
20579
20802
  onNonEmpty: (errorLines) => separateSymbol(figures.pointerSmall, errorLines.join("\n"))
@@ -20585,8 +20808,8 @@ const renderDateError = (state, pointer, theme) => {
20585
20808
  if (isSome(state.error)) {
20586
20809
  const errorLines = state.error.value.split(NEWLINE_REGEXP);
20587
20810
  if (isReadonlyArrayNonEmpty(errorLines)) {
20588
- const prefix = annotateSymbol(pointer, theme.errorColor);
20589
- const lines = map$9(errorLines, (str) => annotateErrorLine(str, theme.errorColor));
20811
+ const prefix = annotateSymbol(theme, pointer, theme.errorColor);
20812
+ const lines = map$8(errorLines, (str) => annotateErrorLine(theme, str));
20590
20813
  return cursorSavePosition + "\n" + separateSymbol(prefix, lines.join("\n")) + cursorRestorePosition;
20591
20814
  }
20592
20815
  }
@@ -20597,27 +20820,26 @@ const renderParts = (state, theme, submitted = false) => {
20597
20820
  const partDoc = part.toString();
20598
20821
  if (currentIndex === state.cursor && !submitted) {
20599
20822
  const annotation = combine(underlined, theme.primaryColor);
20600
- return doc + annotate(partDoc, annotation);
20823
+ return doc + annotate(theme.colors, partDoc, annotation);
20601
20824
  }
20602
20825
  return doc + partDoc;
20603
20826
  });
20604
20827
  };
20605
- const renderDateOutput = (leadingSymbol, trailingSymbol, parts, options, renderOptions) => renderPrompt(parts, options.message, leadingSymbol, trailingSymbol, renderOptions);
20606
20828
  const renderDateNextFrame = /*#__PURE__*/ fnUntraced(function* (state, options) {
20607
20829
  const figures = yield* getTheme(options);
20608
- const leadingSymbol = annotateSymbol(figures.prefix, figures.primaryColor);
20609
- const trailingSymbol = annotateSymbol(figures.pointerSmall, figures.mutedColor);
20830
+ const leadingSymbol = annotateSymbol(figures, figures.prefix, figures.primaryColor);
20831
+ const trailingSymbol = annotateSymbol(figures, figures.pointerSmall, figures.mutedColor);
20610
20832
  const parts = renderParts(state, figures);
20611
- const promptMsg = renderDateOutput(leadingSymbol, trailingSymbol, parts, options);
20833
+ const promptMsg = renderPrompt(parts, options.message, leadingSymbol, trailingSymbol, figures);
20612
20834
  const errorMsg = renderDateError(state, figures.pointerSmall, figures);
20613
20835
  return cursorHide + promptMsg + errorMsg;
20614
20836
  });
20615
20837
  const renderDateSubmission = /*#__PURE__*/ fnUntraced(function* (state, options) {
20616
20838
  const figures = yield* getTheme(options);
20617
- const leadingSymbol = annotateSymbol(figures.tick, figures.successColor);
20618
- const trailingSymbol = annotateSymbol(figures.ellipsis, figures.mutedColor);
20839
+ const leadingSymbol = annotateSymbol(figures, figures.tick, figures.successColor);
20840
+ const trailingSymbol = annotateSymbol(figures, figures.ellipsis, figures.mutedColor);
20619
20841
  const parts = renderParts(state, figures, true);
20620
- return renderDateOutput(leadingSymbol, trailingSymbol, parts, options) + "\n";
20842
+ return renderPrompt(parts, options.message, leadingSymbol, trailingSymbol, figures) + "\n";
20621
20843
  });
20622
20844
  const processUp = (state) => {
20623
20845
  state.dateParts[state.cursor].increment();
@@ -20987,7 +21209,7 @@ var Meridiem = class extends DatePart {
20987
21209
  return /A/.test(this.token) ? meridiem.toUpperCase() : meridiem;
20988
21210
  }
20989
21211
  };
20990
- const renderPrompt = (confirm, message, leadingSymbol, trailingSymbol, options) => {
21212
+ const renderPrompt = (confirm, message, leadingSymbol, trailingSymbol, theme, options) => {
20991
21213
  const prefix = leadingSymbol.length === 0 ? "" : leadingSymbol + " ";
20992
21214
  const renderLine = (line) => {
20993
21215
  let output = prefix + line;
@@ -20996,11 +21218,10 @@ const renderPrompt = (confirm, message, leadingSymbol, trailingSymbol, options)
20996
21218
  else if (trailingSymbol.length > 0) output += " ";
20997
21219
  return output;
20998
21220
  };
20999
- const annotate = options?.plain === true ? (line) => line : annotateLine;
21000
21221
  return match$5(message.split(NEWLINE_REGEXP), {
21001
21222
  onEmpty: () => renderLine(""),
21002
21223
  onNonEmpty: (promptLines) => {
21003
- const lines = map$9(promptLines, (line) => annotate(line));
21224
+ const lines = options?.plain === true ? promptLines : map$8(promptLines, (line) => annotate(theme.colors, line, bold));
21004
21225
  return renderLine(lines.join("\n"));
21005
21226
  }
21006
21227
  });
@@ -21008,7 +21229,7 @@ const renderPrompt = (confirm, message, leadingSymbol, trailingSymbol, options)
21008
21229
  const renderChoiceDescription = (choice, isActive, theme, renderOptions) => {
21009
21230
  if (!choice.disabled && choice.description && isActive) {
21010
21231
  const text = theme.descriptionSeparator + choice.description;
21011
- return renderOptions?.plain === true ? text : annotate(text, theme.mutedColor);
21232
+ return renderOptions?.plain === true ? text : annotate(theme.colors, text, theme.mutedColor);
21012
21233
  }
21013
21234
  return "";
21014
21235
  };
@@ -21026,15 +21247,15 @@ const renderNumberInput = (state, submitted, theme, renderOptions) => {
21026
21247
  const value = state.value === "" ? "" : `${state.value}`;
21027
21248
  if (submitted || renderOptions?.plain === true) return value;
21028
21249
  const annotation = isSome(state.error) ? theme.errorColor : combine(underlined, theme.primaryColor);
21029
- return annotate(value, annotation);
21250
+ return annotate(theme.colors, value, annotation);
21030
21251
  };
21031
21252
  const renderNumberError = (state, pointer, theme, renderOptions) => {
21032
21253
  if (isSome(state.error)) return match$5(state.error.value.split(NEWLINE_REGEXP), {
21033
21254
  onEmpty: () => "",
21034
21255
  onNonEmpty: (errorLines) => {
21035
21256
  if (renderOptions?.plain === true) return separateSymbol(pointer, errorLines.join("\n"));
21036
- const prefix = annotateSymbol(pointer, theme.errorColor);
21037
- const lines = map$9(errorLines, (str) => annotateErrorLine(str, theme.errorColor));
21257
+ const prefix = annotateSymbol(theme, pointer, theme.errorColor);
21258
+ const lines = map$8(errorLines, (str) => annotateErrorLine(theme, str));
21038
21259
  return cursorSavePosition + "\n" + separateSymbol(prefix, lines.join("\n")) + cursorRestorePosition;
21039
21260
  }
21040
21261
  });
@@ -21042,19 +21263,19 @@ const renderNumberError = (state, pointer, theme, renderOptions) => {
21042
21263
  };
21043
21264
  const renderNumberOutput = (state, leadingSymbol, trailingSymbol, options, theme, renderOptions, submitted = false) => {
21044
21265
  const value = renderNumberInput(state, submitted, theme, renderOptions);
21045
- return renderPrompt(value, options.message, leadingSymbol, trailingSymbol, renderOptions);
21266
+ return renderPrompt(value, options.message, leadingSymbol, trailingSymbol, theme, renderOptions);
21046
21267
  };
21047
21268
  const renderNumberNextFrame = /*#__PURE__*/ fnUntraced(function* (state, options) {
21048
21269
  const figures = yield* getTheme(options);
21049
- const leadingSymbol = annotateSymbol(figures.prefix, figures.primaryColor);
21050
- const trailingSymbol = annotateSymbol(figures.pointerSmall, figures.mutedColor);
21270
+ const leadingSymbol = annotateSymbol(figures, figures.prefix, figures.primaryColor);
21271
+ const trailingSymbol = annotateSymbol(figures, figures.pointerSmall, figures.mutedColor);
21051
21272
  const errorMsg = renderNumberError(state, figures.pointerSmall, figures);
21052
21273
  return renderNumberOutput(state, leadingSymbol, trailingSymbol, options, figures) + errorMsg;
21053
21274
  });
21054
21275
  const renderNumberSubmission = /*#__PURE__*/ fnUntraced(function* (nextState, options) {
21055
21276
  const figures = yield* getTheme(options);
21056
- const leadingSymbol = annotateSymbol(figures.tick, figures.successColor);
21057
- const trailingSymbol = annotateSymbol(figures.ellipsis, figures.mutedColor);
21277
+ const leadingSymbol = annotateSymbol(figures, figures.tick, figures.successColor);
21278
+ const trailingSymbol = annotateSymbol(figures, figures.ellipsis, figures.mutedColor);
21058
21279
  return renderNumberOutput(nextState, leadingSymbol, trailingSymbol, options, figures, void 0, true) + "\n";
21059
21280
  });
21060
21281
  const processNumberBackspace = (state) => {
@@ -21191,22 +21412,22 @@ const handleProcessFloat = (options) => {
21191
21412
  }
21192
21413
  };
21193
21414
  };
21194
- const renderSelectOutput = (leadingSymbol, trailingSymbol, options, renderOptions) => options.message === void 0 ? void 0 : renderPrompt("", options.message, leadingSymbol, trailingSymbol, renderOptions);
21415
+ const renderSelectOutput = (leadingSymbol, trailingSymbol, options, theme, renderOptions) => options.message === void 0 ? void 0 : renderPrompt("", options.message, leadingSymbol, trailingSymbol, theme, renderOptions);
21195
21416
  const withSelectHeader = (header, body) => header === void 0 ? body : header + "\n" + body;
21196
21417
  const renderChoicePrefix = (state, choices, toDisplay, currentIndex, figures, renderOptions) => {
21197
21418
  const prefix = renderPagingPrefix(figures, currentIndex === toDisplay.startIndex && toDisplay.startIndex > 0, currentIndex === toDisplay.endIndex - 1 && toDisplay.endIndex < choices.length);
21198
21419
  if (renderOptions?.plain === true) return state === currentIndex ? figures.pointer + prefix : prefix + " ".repeat(figures.pointer.length);
21199
21420
  if (choices[currentIndex].disabled) {
21200
21421
  const annotation = combine(bold, figures.mutedColor);
21201
- return state === currentIndex ? annotateSymbol(figures.pointer, annotation) + prefix : prefix + " ".repeat(figures.pointer.length);
21422
+ return state === currentIndex ? annotateSymbol(figures, figures.pointer, annotation) + prefix : prefix + " ".repeat(figures.pointer.length);
21202
21423
  }
21203
- return state === currentIndex ? annotateSymbol(figures.pointer, figures.primaryColor) + prefix : prefix + " ".repeat(figures.pointer.length);
21424
+ return state === currentIndex ? annotateSymbol(figures, figures.pointer, figures.primaryColor) + prefix : prefix + " ".repeat(figures.pointer.length);
21204
21425
  };
21205
21426
  const renderChoiceTitle = (choice, isSelected, theme, renderOptions) => {
21206
21427
  if (renderOptions?.plain === true) return choice.title;
21207
21428
  const title = choice.title;
21208
- if (isSelected) return choice.disabled ? annotate(title, combine(underlined, theme.mutedColor)) : annotate(title, combine(underlined, theme.primaryColor));
21209
- return choice.disabled ? annotate(title, combine(strikethrough, theme.mutedColor)) : title;
21429
+ if (isSelected) return choice.disabled ? annotate(theme.colors, title, combine(underlined, theme.mutedColor)) : annotate(theme.colors, title, combine(underlined, theme.primaryColor));
21430
+ return choice.disabled ? annotate(theme.colors, title, combine(strikethrough, theme.mutedColor)) : title;
21210
21431
  };
21211
21432
  const renderSelectChoices = (state, options, figures, renderOptions) => {
21212
21433
  const choices = options.choices;
@@ -21225,17 +21446,17 @@ const renderSelectChoices = (state, options, figures, renderOptions) => {
21225
21446
  const renderSelectNextFrame = /*#__PURE__*/ fnUntraced(function* (state, options) {
21226
21447
  const figures = yield* getTheme(options);
21227
21448
  const choices = renderSelectChoices(state, options, figures);
21228
- const leadingSymbol = annotateSymbol(figures.prefix, figures.primaryColor);
21229
- const trailingSymbol = annotateSymbol(figures.pointerSmall, figures.mutedColor);
21230
- const promptMsg = renderSelectOutput(leadingSymbol, trailingSymbol, options);
21449
+ const leadingSymbol = annotateSymbol(figures, figures.prefix, figures.primaryColor);
21450
+ const trailingSymbol = annotateSymbol(figures, figures.pointerSmall, figures.mutedColor);
21451
+ const promptMsg = renderSelectOutput(leadingSymbol, trailingSymbol, options, figures);
21231
21452
  return cursorHide + withSelectHeader(promptMsg, choices);
21232
21453
  });
21233
21454
  const renderSelectSubmission = /*#__PURE__*/ fnUntraced(function* (state, options) {
21234
21455
  const figures = yield* getTheme(options);
21235
21456
  const selected = options.choices[state].title;
21236
- const leadingSymbol = annotateSymbol(figures.tick, figures.successColor);
21237
- const trailingSymbol = annotateSymbol(figures.ellipsis, figures.mutedColor);
21238
- return (renderSelectOutput(leadingSymbol, trailingSymbol, options) ?? leadingSymbol) + " " + annotate(selected, figures.submittedColor) + "\n";
21457
+ const leadingSymbol = annotateSymbol(figures, figures.tick, figures.successColor);
21458
+ const trailingSymbol = annotateSymbol(figures, figures.ellipsis, figures.mutedColor);
21459
+ return (renderSelectOutput(leadingSymbol, trailingSymbol, options, figures) ?? leadingSymbol) + " " + annotate(figures.colors, selected, figures.submittedColor) + "\n";
21239
21460
  });
21240
21461
  const processSelectCursorUp = (state, choices) => {
21241
21462
  if (state === 0) return succeed$2(Action$1.NextFrame({ state: choices.length - 1 }));
@@ -21261,7 +21482,7 @@ const handleSelectClear = (options) => fnUntraced(function* (state, _) {
21261
21482
  const columns = yield* (yield* Terminal).columns;
21262
21483
  const figures = yield* getTheme(options);
21263
21484
  const clearPrompt = eraseLine + cursorLeft;
21264
- const promptText = renderSelectOutput(figures.prefix, figures.pointerSmall, options, { plain: true });
21485
+ const promptText = renderSelectOutput(figures.prefix, figures.pointerSmall, options, figures, { plain: true });
21265
21486
  const choicesText = renderSelectChoices(state, options, figures, { plain: true });
21266
21487
  return eraseText(withSelectHeader(promptText, choicesText), columns) + clearPrompt;
21267
21488
  });
@@ -21301,8 +21522,8 @@ const renderTextInput = (nextState, options, theme, submitted, renderOptions) =>
21301
21522
  const annotation = isSome(nextState.error) ? theme.errorColor : submitted ? theme.submittedColor : combine(underlined, theme.primaryColor);
21302
21523
  switch (options.type) {
21303
21524
  case "hidden": return "";
21304
- case "password": return annotateSymbol(theme.passwordMask.repeat(text.length), annotation);
21305
- case "text": return annotate(text, annotation);
21525
+ case "password": return annotateSymbol(theme, theme.passwordMask.repeat(text.length), annotation);
21526
+ case "text": return annotate(theme.colors, text, annotation);
21306
21527
  }
21307
21528
  };
21308
21529
  const renderTextError = (nextState, pointer, theme, renderOptions) => {
@@ -21310,8 +21531,8 @@ const renderTextError = (nextState, pointer, theme, renderOptions) => {
21310
21531
  onEmpty: () => "",
21311
21532
  onNonEmpty: (errorLines) => {
21312
21533
  if (renderOptions?.plain === true) return separateSymbol(pointer, errorLines.join("\n"));
21313
- const prefix = annotateSymbol(pointer, theme.errorColor);
21314
- const lines = map$9(errorLines, (str) => annotateErrorLine(str, theme.errorColor));
21534
+ const prefix = annotateSymbol(theme, pointer, theme.errorColor);
21535
+ const lines = map$8(errorLines, (str) => annotateErrorLine(theme, str));
21315
21536
  return cursorSavePosition + "\n" + separateSymbol(prefix, lines.join("\n")) + cursorRestorePosition;
21316
21537
  }
21317
21538
  });
@@ -21319,12 +21540,12 @@ const renderTextError = (nextState, pointer, theme, renderOptions) => {
21319
21540
  };
21320
21541
  const renderTextOutput = (nextState, leadingSymbol, trailingSymbol, options, theme, renderOptions, submitted = false) => {
21321
21542
  const value = renderTextInput(nextState, options, theme, submitted, renderOptions);
21322
- return renderPrompt(value, options.message, leadingSymbol, trailingSymbol, renderOptions);
21543
+ return renderPrompt(value, options.message, leadingSymbol, trailingSymbol, theme, renderOptions);
21323
21544
  };
21324
21545
  const renderTextNextFrame = /*#__PURE__*/ fnUntraced(function* (state, options) {
21325
21546
  const figures = yield* getTheme(options);
21326
- const leadingSymbol = annotateSymbol(figures.prefix, figures.primaryColor);
21327
- const trailingSymbol = annotateSymbol(figures.pointerSmall, figures.mutedColor);
21547
+ const leadingSymbol = annotateSymbol(figures, figures.prefix, figures.primaryColor);
21548
+ const trailingSymbol = annotateSymbol(figures, figures.pointerSmall, figures.mutedColor);
21328
21549
  const promptMsg = renderTextOutput(state, leadingSymbol, trailingSymbol, options, figures);
21329
21550
  const errorMsg = renderTextError(state, figures.pointerSmall, figures);
21330
21551
  const cursorWidth = options.type === "password" ? figures.passwordMask.length : 1;
@@ -21333,8 +21554,8 @@ const renderTextNextFrame = /*#__PURE__*/ fnUntraced(function* (state, options)
21333
21554
  });
21334
21555
  const renderTextSubmission = /*#__PURE__*/ fnUntraced(function* (state, options) {
21335
21556
  const figures = yield* getTheme(options);
21336
- const leadingSymbol = annotateSymbol(figures.tick, figures.successColor);
21337
- const trailingSymbol = annotateSymbol(figures.ellipsis, figures.mutedColor);
21557
+ const leadingSymbol = annotateSymbol(figures, figures.tick, figures.successColor);
21558
+ const trailingSymbol = annotateSymbol(figures, figures.ellipsis, figures.mutedColor);
21338
21559
  return renderTextOutput(state, leadingSymbol, trailingSymbol, options, figures, void 0, true) + "\n";
21339
21560
  });
21340
21561
  const processTextBackspace = (state) => {
@@ -21472,32 +21693,29 @@ const handleToggleClear = /*#__PURE__*/ fnUntraced(function* (options) {
21472
21693
  const figures = yield* getTheme(options);
21473
21694
  const clearPrompt = eraseLine + cursorLeft;
21474
21695
  const toggleText = options.active + " " + separateSymbol(figures.toggleSeparator, options.inactive);
21475
- const promptText = renderPrompt(toggleText, options.message, figures.prefix, figures.pointerSmall, { plain: true });
21696
+ const promptText = renderPrompt(toggleText, options.message, figures.prefix, figures.pointerSmall, figures, { plain: true });
21476
21697
  return eraseText(promptText, columns) + clearPrompt;
21477
21698
  });
21478
21699
  const renderToggle = (value, options, theme, submitted = false) => {
21479
- const separator = annotateSymbol(theme.toggleSeparator, theme.mutedColor);
21700
+ const separator = annotateSymbol(theme, theme.toggleSeparator, theme.mutedColor);
21480
21701
  const selectedAnnotation = combine(underlined, submitted ? theme.submittedColor : theme.primaryColor);
21481
- const inactive = value ? options.inactive : annotate(options.inactive, selectedAnnotation);
21482
- return (value ? annotate(options.active, selectedAnnotation) : options.active) + " " + separateSymbol(separator, inactive);
21483
- };
21484
- const renderToggleOutput = (toggle, leadingSymbol, trailingSymbol, options) => {
21485
- return renderPrompt(toggle, options.message, leadingSymbol, trailingSymbol);
21702
+ const inactive = value ? options.inactive : annotate(theme.colors, options.inactive, selectedAnnotation);
21703
+ return (value ? annotate(theme.colors, options.active, selectedAnnotation) : options.active) + " " + separateSymbol(separator, inactive);
21486
21704
  };
21487
21705
  const renderToggleNextFrame = /*#__PURE__*/ fnUntraced(function* (state, options) {
21488
21706
  const figures = yield* getTheme(options);
21489
- const leadingSymbol = annotateSymbol(figures.prefix, figures.primaryColor);
21490
- const trailingSymbol = annotateSymbol(figures.pointerSmall, figures.mutedColor);
21707
+ const leadingSymbol = annotateSymbol(figures, figures.prefix, figures.primaryColor);
21708
+ const trailingSymbol = annotateSymbol(figures, figures.pointerSmall, figures.mutedColor);
21491
21709
  const toggle = renderToggle(state, options, figures);
21492
- const promptMsg = renderToggleOutput(toggle, leadingSymbol, trailingSymbol, options);
21710
+ const promptMsg = renderPrompt(toggle, options.message, leadingSymbol, trailingSymbol, figures);
21493
21711
  return cursorHide + promptMsg;
21494
21712
  });
21495
21713
  const renderToggleSubmission = /*#__PURE__*/ fnUntraced(function* (value, options) {
21496
21714
  const figures = yield* getTheme(options);
21497
- const leadingSymbol = annotateSymbol(figures.tick, figures.successColor);
21498
- const trailingSymbol = annotateSymbol(figures.ellipsis, figures.mutedColor);
21715
+ const leadingSymbol = annotateSymbol(figures, figures.tick, figures.successColor);
21716
+ const trailingSymbol = annotateSymbol(figures, figures.ellipsis, figures.mutedColor);
21499
21717
  const toggle = renderToggle(value, options, figures, true);
21500
- return renderToggleOutput(toggle, leadingSymbol, trailingSymbol, options) + "\n";
21718
+ return renderPrompt(toggle, options.message, leadingSymbol, trailingSymbol, figures) + "\n";
21501
21719
  });
21502
21720
  const activate = /*#__PURE__*/ succeed$2(/*#__PURE__*/ Action$1.NextFrame({ state: true }));
21503
21721
  const deactivate = /*#__PURE__*/ succeed$2(/*#__PURE__*/ Action$1.NextFrame({ state: false }));
@@ -21539,7 +21757,7 @@ const entriesToDisplay = (cursor, total, maxVisible) => {
21539
21757
  };
21540
21758
  };
21541
21759
  //#endregion
21542
- //#region ../../node_modules/.pnpm/effect@4.0.2/node_modules/effect/dist/cli/Param.js
21760
+ //#region ../../node_modules/.pnpm/effect@4.0.4/node_modules/effect/dist/cli/Param.js
21543
21761
  const TypeId$1 = "~effect/cli/Param";
21544
21762
  /**
21545
21763
  * Defines the kind discriminator for flag parameters.
@@ -21674,32 +21892,6 @@ const ChoiceWithValue$1 = (kind, name, choices) => makeSingle({
21674
21892
  primitiveType: Choice(choices),
21675
21893
  kind
21676
21894
  });
21677
- /**
21678
- * Constructs command-line params that represent a choice between several
21679
- * string inputs.
21680
- *
21681
- * **Example** (Creating string choices)
21682
- *
21683
- * ```ts import.meta.vitest
21684
- * import { Param } from "effect/cli"
21685
- *
21686
- * const logLevel = Param.Literals(Param.flagKind, "log-level", [
21687
- * "debug",
21688
- * "info",
21689
- * "warn",
21690
- * "error"
21691
- * ])
21692
- * logLevel.kind // => "flag"
21693
- * ```
21694
- *
21695
- * @stability unstable
21696
- * @category constructors
21697
- * @since 4.0.0
21698
- */
21699
- const Literals$1 = (kind, name, choices) => {
21700
- const mappedChoices = choices.map((value) => [value, value]);
21701
- return ChoiceWithValue$1(kind, name, mappedChoices);
21702
- };
21703
21895
  const FLAG_DASH_REGEXP = /^-+/;
21704
21896
  /**
21705
21897
  * Adds an alias to an option.
@@ -21790,8 +21982,8 @@ const withDescription$2 = /*#__PURE__*/ dual(2, (self, description) => {
21790
21982
  * @category combinators
21791
21983
  * @since 4.0.0
21792
21984
  */
21793
- const map$1 = /*#__PURE__*/ dual(2, (self, f) => {
21794
- const parse = (args) => map$5(self.parse(args), ([operands, value]) => [operands, f(value)]);
21985
+ const map = /*#__PURE__*/ dual(2, (self, f) => {
21986
+ const parse = (args) => map$4(self.parse(args), ([operands, value]) => [operands, f(value)]);
21795
21987
  return Object.assign(Object.create(Proto$1), {
21796
21988
  _tag: "Map",
21797
21989
  kind: self.kind,
@@ -21866,7 +22058,7 @@ const transform = (self, f, alternatives = []) => {
21866
22058
  * @category combinators
21867
22059
  * @since 4.0.0
21868
22060
  */
21869
- const mapEffect = /*#__PURE__*/ dual(2, (self, f) => transform(self, (parse) => (args) => flatMap$1(parse(args), ([leftover, a]) => f(a).pipe(map$5((b) => [leftover, b])))));
22061
+ const mapEffect = /*#__PURE__*/ dual(2, (self, f) => transform(self, (parse) => (args) => flatMap$1(parse(args), ([leftover, a]) => f(a).pipe(map$4((b) => [leftover, b])))));
21870
22062
  /**
21871
22063
  * Makes a flag or positional argument optional.
21872
22064
  *
@@ -21893,7 +22085,7 @@ const mapEffect = /*#__PURE__*/ dual(2, (self, f) => transform(self, (parse) =>
21893
22085
  * @since 4.0.0
21894
22086
  */
21895
22087
  const optional$1 = (param) => {
21896
- const parse = (args) => param.parse(args).pipe(map$5(([leftover, value]) => [leftover, some(value)]), catchTags({
22088
+ const parse = (args) => param.parse(args).pipe(map$4(([leftover, value]) => [leftover, some(value)]), catchTags({
21897
22089
  MissingOption: () => succeed$2([args.arguments, none()]),
21898
22090
  MissingArgument: () => succeed$2([args.arguments, none()])
21899
22091
  }));
@@ -21936,7 +22128,7 @@ const optional$1 = (param) => {
21936
22128
  * @since 4.0.0
21937
22129
  */
21938
22130
  const withDefault$1 = /*#__PURE__*/ dual(2, (self, defaultValue) => {
21939
- if (!isEffect(defaultValue)) return map$1(optional$1(self), getOrElse(() => defaultValue));
22131
+ if (!isEffect(defaultValue)) return map(optional$1(self), getOrElse(() => defaultValue));
21940
22132
  return mapEffect(optional$1(self), match$4({
21941
22133
  onNone: () => defaultValue,
21942
22134
  onSome: succeed$2
@@ -22116,7 +22308,7 @@ const matchParam = (param, patterns) => {
22116
22308
  const transformSingle = (param, f) => {
22117
22309
  return matchParam(param, {
22118
22310
  Single: (single) => f(single),
22119
- Map: (mapped) => map$1(transformSingle(mapped.param, f), mapped.f),
22311
+ Map: (mapped) => map(transformSingle(mapped.param, f), mapped.f),
22120
22312
  Transform: (mapped) => transform(transformSingle(mapped.param, f), mapped.f, mapped.alternatives.map((alternative) => () => transformSingle(alternative(), f))),
22121
22313
  Optional: (p) => optional$1(transformSingle(p.param, f)),
22122
22314
  Variadic: (p) => variadic(transformSingle(p.param, f), {
@@ -22180,7 +22372,7 @@ const getParamMetadata = (param) => {
22180
22372
  });
22181
22373
  };
22182
22374
  //#endregion
22183
- //#region ../../node_modules/.pnpm/effect@4.0.2/node_modules/effect/dist/cli/CliOutput.js
22375
+ //#region ../../node_modules/.pnpm/effect@4.0.4/node_modules/effect/dist/cli/CliOutput.js
22184
22376
  /**
22185
22377
  * Formats CLI help and errors as text.
22186
22378
  *
@@ -22257,9 +22449,7 @@ const escapeControlCharacters = (text) => text.replace(/[\u0000-\u0008\u000B\u00
22257
22449
  * @since 4.0.0
22258
22450
  */
22259
22451
  const defaultFormatter = (options) => {
22260
- const globalProcess = globalThis.process;
22261
- const hasProcess = typeof globalProcess === "object" && globalProcess !== null;
22262
- const useColor = options?.colors !== void 0 ? options.colors : hasProcess && typeof globalProcess.stdout === "object" && globalProcess.stdout !== null && globalProcess.stdout.isTTY === true && !globalProcess.env?.NO_COLOR;
22452
+ const useColor = options?.colors ?? detectColors();
22263
22453
  const colors = useColor ? {
22264
22454
  bold: (text) => `\x1b[1m${text}\x1b[0m`,
22265
22455
  dim: (text) => `\x1b[2m${text}\x1b[0m`,
@@ -22312,7 +22502,7 @@ const stripAnsi = (text) => {
22312
22502
  return text.replace(/\u001B\[[0-9;]*m/g, "");
22313
22503
  };
22314
22504
  /**
22315
- * Gets the terminal display width of a string (excluding ANSI codes).
22505
+ * Segments text into grapheme clusters.
22316
22506
  * @internal
22317
22507
  */
22318
22508
  const graphemeSegmenter = /*#__PURE__*/ new Intl.Segmenter(void 0, { granularity: "grapheme" });
@@ -22328,7 +22518,33 @@ const graphemeWidth = (grapheme) => {
22328
22518
  if (emojiPresentation.test(grapheme) || grapheme.includes("️")) return 2;
22329
22519
  return isFullWidthCodePoint(visible.codePointAt(0)) ? 2 : 1;
22330
22520
  };
22331
- const visualLength = (text) => {
22521
+ /**
22522
+ * Measures the number of terminal cells a string occupies.
22523
+ *
22524
+ * **Details**
22525
+ *
22526
+ * Uses the same measurement as built-in help and table rendering. ANSI styling
22527
+ * is stripped before measuring graphemes: zero-width graphemes count as `0`,
22528
+ * emoji presentation sequences and fullwidth characters as `2`, and other
22529
+ * graphemes as `1`.
22530
+ *
22531
+ * **Example** (Measuring terminal-cell widths)
22532
+ *
22533
+ * ```ts import.meta.vitest
22534
+ * import { CliOutput } from "effect/cli"
22535
+ *
22536
+ * CliOutput.displayWidth("file") // => 4
22537
+ * CliOutput.displayWidth("ファイル") // => 8
22538
+ * CliOutput.displayWidth("é") // => 1
22539
+ * CliOutput.displayWidth("1️⃣") // => 2
22540
+ * CliOutput.displayWidth("\u001B[1mbold\u001B[0m") // => 4
22541
+ * ```
22542
+ *
22543
+ * @stability unstable
22544
+ * @category measuring
22545
+ * @since 4.0.3
22546
+ */
22547
+ const displayWidth = (text) => {
22332
22548
  let length = 0;
22333
22549
  for (const { segment } of graphemeSegmenter.segment(stripAnsi(text))) length += graphemeWidth(segment);
22334
22550
  return length;
@@ -22338,7 +22554,7 @@ const visualLength = (text) => {
22338
22554
  * @internal
22339
22555
  */
22340
22556
  const pad = (s, width) => {
22341
- const actualLength = visualLength(s);
22557
+ const actualLength = displayWidth(s);
22342
22558
  const padding = Math.max(0, width - actualLength);
22343
22559
  return s + " ".repeat(padding);
22344
22560
  };
@@ -22347,9 +22563,9 @@ const pad = (s, width) => {
22347
22563
  * @internal
22348
22564
  */
22349
22565
  const renderTable = (rows, widthCap) => {
22350
- const maxColumn = Math.max(...rows.map((r) => visualLength(r.left))) + 4;
22566
+ const maxColumn = Math.max(...rows.map((r) => displayWidth(r.left))) + 4;
22351
22567
  const col = widthCap === void 0 ? maxColumn : Math.min(maxColumn, widthCap);
22352
- return rows.map(({ left, right }) => ` ${pad(left, Math.max(col, visualLength(left) + 1))}${right}`).join("\n");
22568
+ return rows.map(({ left, right }) => ` ${pad(left, Math.max(col, displayWidth(left) + 1))}${right}`).join("\n");
22353
22569
  };
22354
22570
  const formatSubcommandName = (name, alias) => alias ? `${name}, ${alias}` : name;
22355
22571
  /**
@@ -22448,7 +22664,7 @@ const formatHelpDocImpl = (doc, colors) => {
22448
22664
  return sections.join("\n");
22449
22665
  };
22450
22666
  //#endregion
22451
- //#region ../../node_modules/.pnpm/effect@4.0.2/node_modules/effect/dist/cli/internal/completions/bash.js
22667
+ //#region ../../node_modules/.pnpm/effect@4.0.4/node_modules/effect/dist/cli/internal/completions/bash.js
22452
22668
  const escapeForBash = (s) => s.replace(/'/g, "'\\''");
22453
22669
  const sanitizeFunctionName = (s) => s.replace(/[^a-zA-Z0-9_]/g, "_");
22454
22670
  const flagNamesForWordlist = (flag) => {
@@ -22673,7 +22889,7 @@ const generateFunction$1 = (descriptor, parentPath, lines, helperName) => {
22673
22889
  /**
22674
22890
  * @internal
22675
22891
  */
22676
- const generate$3 = (executableName, descriptor) => {
22892
+ const generate$4 = (executableName, descriptor) => {
22677
22893
  const lines = [];
22678
22894
  const safeName = sanitizeFunctionName(executableName);
22679
22895
  const helperName = `_${safeName}--choices`;
@@ -22718,7 +22934,7 @@ const generate$3 = (executableName, descriptor) => {
22718
22934
  return lines.join("\n");
22719
22935
  };
22720
22936
  //#endregion
22721
- //#region ../../node_modules/.pnpm/effect@4.0.2/node_modules/effect/dist/cli/internal/completions/fish.js
22937
+ //#region ../../node_modules/.pnpm/effect@4.0.4/node_modules/effect/dist/cli/internal/completions/fish.js
22722
22938
  const escapeFishString = (s) => s.replace(/\\/g, "\\\\").replace(/'/g, "\\'");
22723
22939
  /** Escape choices for Fish's second expansion of `complete -a`. */
22724
22940
  const escapeFishChoice = (s) => escapeFishString(s.replace(/[^A-Za-z0-9_.,/@%+-]/gu, "\\$&"));
@@ -22852,7 +23068,7 @@ const generateCompletions = (executableName, descriptor, parentPath, lines) => {
22852
23068
  /**
22853
23069
  * @internal
22854
23070
  */
22855
- const generate$2 = (executableName, descriptor) => {
23071
+ const generate$3 = (executableName, descriptor) => {
22856
23072
  const lines = [];
22857
23073
  lines.push(`###-begin-${executableName}-completions-###`);
22858
23074
  lines.push(`#`);
@@ -22868,8 +23084,277 @@ const generate$2 = (executableName, descriptor) => {
22868
23084
  return lines.join("\n");
22869
23085
  };
22870
23086
  //#endregion
22871
- //#region ../../node_modules/.pnpm/effect@4.0.2/node_modules/effect/dist/cli/internal/completions/zsh.js
23087
+ //#region ../../node_modules/.pnpm/effect@4.0.4/node_modules/effect/dist/cli/internal/completions/powershell.js
23088
+ /**
23089
+ * Encode non-ASCII and control characters as `[char]` code units. Windows
23090
+ * PowerShell 5.1 can misread BOM-less UTF-8 as ANSI, turning some bytes into
23091
+ * PowerShell quote delimiters.
23092
+ */
23093
+ const quotePs = (s) => {
23094
+ const parts = [];
23095
+ let literal = "";
23096
+ for (let i = 0; i < s.length; i++) {
23097
+ const code = s.charCodeAt(i);
23098
+ if (code >= 32 && code < 128) {
23099
+ literal += s[i] === "'" ? "''" : s[i];
23100
+ continue;
23101
+ }
23102
+ if (literal !== "" || parts.length === 0) parts.push(`'${literal}'`);
23103
+ literal = "";
23104
+ parts.push(`[char]0x${code.toString(16).toUpperCase().padStart(4, "0")}`);
23105
+ }
23106
+ if (literal !== "" || parts.length === 0) parts.push(`'${literal}'`);
23107
+ return parts.length === 1 ? parts[0] : `(${parts.join(" + ")})`;
23108
+ };
23109
+ const psArray = (items) => `@(${items.map(quotePs).join(", ")})`;
23110
+ const psOptional = (s) => s ? quotePs(s) : "$null";
23111
+ const sanitize$1 = (s) => s.replace(/[^a-zA-Z0-9_]/g, "_");
23112
+ const flagForms = (flag) => [`--${flag.name}`, ...flag.aliases.map((alias) => alias.length === 1 ? `-${alias}` : `--${alias}`)];
23113
+ const valueFields = (type) => `values = ${psArray(type._tag === "Choice" ? type.values : [])}; pathType = ${type._tag === "Path" ? quotePs(type.pathType) : "$null"}`;
23114
+ const flagEntry = (flag) => `@{ name = ${quotePs(flag.name)}; forms = ${psArray(flagForms(flag))}; takesValue = $${flag.type._tag !== "Boolean"}; ${valueFields(flag.type)}; description = ${psOptional(flag.description)} }`;
23115
+ const argumentEntry = (argument) => `@{ name = ${quotePs(argument.name)}; variadic = $${argument.variadic}; ${valueFields(argument.type)}; description = ${psOptional(argument.description)} }`;
23116
+ const pushList = (lines, field, entries) => {
23117
+ if (entries.length === 0) {
23118
+ lines.push(` ${field} = @()`);
23119
+ return;
23120
+ }
23121
+ lines.push(` ${field} = @(`);
23122
+ for (const entry of entries) lines.push(` ${entry}`);
23123
+ lines.push(` )`);
23124
+ };
23125
+ /**
23126
+ * Emit one context per subcommand path. Subcommands are case-sensitive, so
23127
+ * contexts go in an ordinal hashtable instead of a hash literal, whose keys
23128
+ * ignore case.
23129
+ */
23130
+ const generateContexts = (dataName, descriptor, path, lines, seen) => {
23131
+ const key = path.join(" ");
23132
+ if (seen.has(key)) return;
23133
+ seen.add(key);
23134
+ lines.push(`${dataName}[${quotePs(key)}] = @{`);
23135
+ pushList(lines, "subcommands", descriptor.subcommands.map((sub) => `@{ name = ${quotePs(sub.name)}; description = ${psOptional(sub.description)} }`));
23136
+ pushList(lines, "flags", descriptor.flags.map(flagEntry));
23137
+ pushList(lines, "arguments", descriptor.arguments.map(argumentEntry));
23138
+ lines.push(`}`);
23139
+ for (const sub of descriptor.subcommands) generateContexts(dataName, sub, [...path, sub.name], lines, seen);
23140
+ };
23141
+ /**
23142
+ * Replay the committed words with the CLI lexer and parser rules: `--`, short
23143
+ * flag clusters, inline values, boolean literals, negative numbers, and
23144
+ * subcommand selection by the first value only.
23145
+ */
23146
+ const completer = (dataName) => String.raw` param($wordToComplete, $commandAst, $cursorPosition)
23147
+
23148
+ $spec = ${dataName}
23149
+ $results = [System.Collections.Generic.List[System.Management.Automation.CompletionResult]]::new()
23150
+ $booleanLiterals = @('true', 'yes', 'on', '1', 'y', 'false', 'no', 'off', '0', 'n')
23151
+
23152
+ $index = {
23153
+ param($context)
23154
+ $lookup = [hashtable]::new([System.StringComparer]::Ordinal)
23155
+ foreach ($flag in $context.flags) {
23156
+ foreach ($form in $flag.forms) { $lookup[$form] = $flag }
23157
+ }
23158
+ $lookup
23159
+ }
23160
+
23161
+ $add = {
23162
+ param([string]$value, [string]$type, $tooltip, [string]$typed, [string]$textPrefix)
23163
+ if (-not $value.StartsWith($typed, [System.StringComparison]::OrdinalIgnoreCase)) { return }
23164
+ $text = $value
23165
+ if ($value -notmatch '^[\w./:%+=\\-]+$') { $text = "'" + ($value -replace "['\u2018-\u201b]", '$0$0') + "'" }
23166
+ $text = $textPrefix + $text
23167
+ $label = $value
23168
+ if (-not $label) { $label = $text }
23169
+ if (-not $tooltip) { $tooltip = $label }
23170
+ $results.Add([System.Management.Automation.CompletionResult]::new($text, $label, $type, $tooltip))
23171
+ }
23172
+
23173
+ $addValues = {
23174
+ param($entry, [string]$typed, [string]$textPrefix)
23175
+ foreach ($value in $entry.values) {
23176
+ if ($textPrefix -eq '' -and (& $optionLike $value)) { continue }
23177
+ & $add $value 'ParameterValue' $entry.description $typed $textPrefix
23178
+ }
23179
+ if ($entry.pathType) {
23180
+ foreach ($file in [System.Management.Automation.CompletionCompleters]::CompleteFilename($typed)) {
23181
+ if ($entry.pathType -eq 'directory' -and $file.ResultType -ne 'ProviderContainer') { continue }
23182
+ $results.Add([System.Management.Automation.CompletionResult]::new($textPrefix + $file.CompletionText, $file.ListItemText, $file.ResultType, $file.ToolTip))
23183
+ }
23184
+ }
23185
+ }
23186
+
23187
+ $addFlags = {
23188
+ param([string]$typed)
23189
+ foreach ($flag in $context.flags) {
23190
+ if ($used.ContainsKey($flag.name)) { continue }
23191
+ foreach ($form in $flag.forms) {
23192
+ & $add $form 'ParameterName' $flag.description $typed ''
23193
+ }
23194
+ if (-not $flag.takesValue) {
23195
+ $tooltip = $null
23196
+ if ($flag.description) { $tooltip = 'Disable ' + $flag.name }
23197
+ & $add ('--no-' + $flag.name) 'ParameterName' $tooltip $typed ''
23198
+ }
23199
+ }
23200
+ }
23201
+
23202
+ # As in the CLI lexer, nothing after '--' is an option, and negative numbers
23203
+ # and a lone '-' are values.
23204
+ $optionLike = {
23205
+ param([string]$word)
23206
+ -not $endOfOptions -and $word -match '^-.' -and $word -notmatch '^-(\d+\.?\d*|\.\d+)([eE][+-]?\d+)?$'
23207
+ }
23208
+
23209
+ # A typed value that has no candidates completes to itself, so the engine
23210
+ # does not fall back to listing files.
23211
+ $keepTyped = {
23212
+ if ($results.Count -eq 0 -and $current) {
23213
+ $results.Add([System.Management.Automation.CompletionResult]::new($current, $current, 'ParameterValue', $current))
23214
+ }
23215
+ }
23216
+
23217
+ $path = ''
23218
+ $context = $spec[$path]
23219
+ $lookup = & $index $context
23220
+ $used = [hashtable]::new([System.StringComparer]::Ordinal)
23221
+ $pending = $null
23222
+ $endOfOptions = $false
23223
+ $position = 0
23224
+
23225
+ # The engine strips the quotes from a quoted word.
23226
+ $typed = [string]$wordToComplete
23227
+ if ($typed -match '^([''"])(.*?)\1?$') { $typed = $Matches[2] }
23228
+ $current = $null
23229
+
23230
+ $elements = $commandAst.CommandElements
23231
+ for ($i = 1; $i -lt $elements.Count; $i++) {
23232
+ $element = $elements[$i]
23233
+ $word = $element.Extent.Text
23234
+ if ($element -is [System.Management.Automation.Language.StringConstantExpressionAst]) { $word = $element.Value }
23235
+ if ($element.Extent.EndOffset -ge $cursorPosition) {
23236
+ if ($element -is [System.Management.Automation.Language.ConstantExpressionAst] -and $element.Extent.StartOffset -le $cursorPosition) {
23237
+ $current = $element.Extent.Text
23238
+ if ($element.Extent.EndOffset -eq $cursorPosition) { $typed = $word }
23239
+ }
23240
+ break
23241
+ }
23242
+
23243
+ # A flag takes the next word as its value unless it is an option or '--';
23244
+ # a boolean flag only takes a boolean literal.
23245
+ $isOption = & $optionLike $word
23246
+ if ($null -ne $pending) {
23247
+ $flag = $pending
23248
+ $pending = $null
23249
+ if ($flag.takesValue) {
23250
+ if (-not $isOption) { continue }
23251
+ } elseif ($booleanLiterals -ccontains $word) { continue }
23252
+ }
23253
+ if ($endOfOptions) { $position++; continue }
23254
+ if ($word -ceq '--') { $endOfOptions = $true; continue }
23255
+
23256
+ if ($isOption) {
23257
+ $hasValue = $word.Contains('=')
23258
+ if ($hasValue) {
23259
+ $forms = @($word.Substring(0, $word.IndexOf('=')))
23260
+ } elseif ($word.StartsWith('--')) {
23261
+ $forms = @($word)
23262
+ } else {
23263
+ $forms = @(foreach ($char in $word.Substring(1).ToCharArray()) { '-' + $char })
23264
+ }
23265
+ foreach ($form in $forms) {
23266
+ $pending = $null
23267
+ $flag = $lookup[$form]
23268
+ if ($null -eq $flag) {
23269
+ if ($form.StartsWith('--no-')) {
23270
+ $name = $form.Substring(5)
23271
+ $flag = $lookup['--' + $name]
23272
+ if ($null -ne $flag -and -not $flag.takesValue -and $flag.name -ceq $name) { $used[$name] = $true }
23273
+ }
23274
+ continue
23275
+ }
23276
+ $used[$flag.name] = $true
23277
+ if (-not $hasValue) { $pending = $flag }
23278
+ }
23279
+ continue
23280
+ }
23281
+
23282
+ if ($position -eq 0 -and $context.subcommands.name -ccontains $word) {
23283
+ if ($path) { $path = $path + ' ' + $word } else { $path = $word }
23284
+ $context = $spec[$path]
23285
+ $lookup = & $index $context
23286
+ $used = [hashtable]::new([System.StringComparer]::Ordinal)
23287
+ continue
23288
+ }
23289
+ $position++
23290
+ }
23291
+
23292
+ $typedIsOption = & $optionLike $typed
23293
+ if ($null -ne $pending -and $pending.takesValue -and -not $typedIsOption) {
23294
+ & $addValues $pending $typed ''
23295
+ & $keepTyped
23296
+ return $results
23297
+ }
23298
+
23299
+ if ($typedIsOption) {
23300
+ if ($typed -match '^(-[^=]+)=(.*)$') {
23301
+ $form = $Matches[1]
23302
+ $flag = $lookup[$form]
23303
+ if ($null -ne $flag -and $flag.takesValue) {
23304
+ & $addValues $flag $Matches[2] ($form + '=')
23305
+ & $keepTyped
23306
+ }
23307
+ } else {
23308
+ & $addFlags $typed
23309
+ }
23310
+ return $results
23311
+ }
23312
+
23313
+ if (-not $endOfOptions -and $position -eq 0) {
23314
+ foreach ($sub in $context.subcommands) {
23315
+ & $add $sub.name 'Command' $sub.description $typed ''
23316
+ }
23317
+ }
23318
+
23319
+ $arguments = $context.arguments
23320
+ if ($position -lt $arguments.Count) {
23321
+ & $addValues $arguments[$position] $typed ''
23322
+ } elseif ($arguments.Count -gt 0 -and $arguments[-1].variadic) {
23323
+ & $addValues $arguments[-1] $typed ''
23324
+ }
23325
+
23326
+ if (-not $endOfOptions) {
23327
+ & $addFlags $typed
23328
+ }
23329
+ return $results`;
23330
+ /** @internal */
23331
+ const generate$2 = (executableName, descriptor) => {
23332
+ const dataName = `$global:_${sanitize$1(executableName)}_Completions`;
23333
+ const lines = [];
23334
+ lines.push(`###-begin-${executableName}-completions-###`);
23335
+ lines.push(`#`);
23336
+ lines.push(`# Static completion script for PowerShell`);
23337
+ lines.push(`#`);
23338
+ lines.push(`# Installation:`);
23339
+ lines.push(`# ${executableName} --completions powershell > ${executableName}-completion.ps1`);
23340
+ lines.push(`# then add this line to your $PROFILE (use the full path to the file):`);
23341
+ lines.push(`# . <PATH>\\${executableName}-completion.ps1`);
23342
+ lines.push(`#`);
23343
+ lines.push(``);
23344
+ lines.push(`${dataName} = [hashtable]::new([System.StringComparer]::Ordinal)`);
23345
+ generateContexts(dataName, descriptor, [], lines, /* @__PURE__ */ new Set());
23346
+ lines.push(``);
23347
+ lines.push(`Register-ArgumentCompleter -Native -CommandName ${quotePs(executableName)} -ScriptBlock {`);
23348
+ lines.push(completer(dataName));
23349
+ lines.push(`}`);
23350
+ lines.push(``);
23351
+ lines.push(`###-end-${executableName}-completions-###`);
23352
+ return lines.join("\n");
23353
+ };
23354
+ //#endregion
23355
+ //#region ../../node_modules/.pnpm/effect@4.0.4/node_modules/effect/dist/cli/internal/completions/zsh.js
22872
23356
  const escapeZsh = (s) => s.replace(/\\/g, "\\\\").replace(/'/g, "'\\''").replace(/:/g, "\\:");
23357
+ const escapeZshExplanation = (s) => escapeZsh(s).replace(/]/g, "\\]");
22873
23358
  /** Escape choices for the second parse of a Zsh `_arguments` action. */
22874
23359
  const escapeZshChoice = (s) => s.replace(/[^A-Za-z0-9_.,/@%+-]/gu, "\\$&").replace(/'/g, "'\\''");
22875
23360
  const sanitize = (s) => s.replace(/[^a-zA-Z0-9_]/g, "_");
@@ -22906,7 +23391,7 @@ const argAction = (type) => {
22906
23391
  */
22907
23392
  const flagSpecs = (flag) => {
22908
23393
  const specs = [];
22909
- const desc = flag.description ? `[${escapeZsh(flag.description)}]` : "";
23394
+ const desc = flag.description ? `[${escapeZshExplanation(flag.description)}]` : "";
22910
23395
  const action = valueAction(flag.type);
22911
23396
  const excl = `(${allForms(flag).join(" ")})`;
22912
23397
  specs.push(`'${excl}--${flag.name}${desc}${action}'`);
@@ -22915,7 +23400,7 @@ const flagSpecs = (flag) => {
22915
23400
  specs.push(`'${excl}${prefix}${alias}${desc}${action}'`);
22916
23401
  }
22917
23402
  if (flag.type._tag === "Boolean") {
22918
- const negDesc = flag.description ? `[${escapeZsh(`Disable ${flag.name}`)}]` : "";
23403
+ const negDesc = flag.description ? `[${escapeZshExplanation(`Disable ${flag.name}`)}]` : "";
22919
23404
  specs.push(`'${excl}--no-${flag.name}${negDesc}'`);
22920
23405
  }
22921
23406
  return specs;
@@ -23015,12 +23500,12 @@ const generate$1 = (executableName, descriptor) => {
23015
23500
  return lines.join("\n");
23016
23501
  };
23017
23502
  //#endregion
23018
- //#region ../../node_modules/.pnpm/effect@4.0.2/node_modules/effect/dist/cli/Completions.js
23503
+ //#region ../../node_modules/.pnpm/effect@4.0.4/node_modules/effect/dist/cli/Completions.js
23019
23504
  /**
23020
23505
  * The `Completions` module turns a plain description of an Effect CLI command
23021
- * tree into shell completion scripts for Bash, Zsh, and Fish. It is the
23022
- * low-level script generation surface used by the unstable CLI package and by
23023
- * the built-in completions global flag.
23506
+ * tree into shell completion scripts for Bash, Zsh, Fish, and PowerShell. It
23507
+ * is the low-level script generation surface used by the unstable CLI package
23508
+ * and by the built-in completions global flag.
23024
23509
  *
23025
23510
  * @stability unstable
23026
23511
  * @since 4.0.0
@@ -23035,8 +23520,8 @@ const generate$1 = (executableName, descriptor) => {
23035
23520
  *
23036
23521
  * **Details**
23037
23522
  *
23038
- * Dispatches by `shell` to Bash, Zsh, or Fish generation and returns a static
23039
- * script string for `executableName`.
23523
+ * Dispatches by `shell` to Bash, Zsh, Fish, or PowerShell generation and
23524
+ * returns a static script string for `executableName`.
23040
23525
  *
23041
23526
  * @see {@link Shell} for supported shell names
23042
23527
  * @see {@link CommandDescriptor} for the command shape used by completion generation
@@ -23047,13 +23532,14 @@ const generate$1 = (executableName, descriptor) => {
23047
23532
  */
23048
23533
  const generate = (executableName, shell, descriptor) => {
23049
23534
  switch (shell) {
23050
- case "bash": return generate$3(executableName, descriptor);
23535
+ case "bash": return generate$4(executableName, descriptor);
23051
23536
  case "zsh": return generate$1(executableName, descriptor);
23052
- case "fish": return generate$2(executableName, descriptor);
23537
+ case "fish": return generate$3(executableName, descriptor);
23538
+ case "powershell": return generate$2(executableName, descriptor);
23053
23539
  }
23054
23540
  };
23055
23541
  //#endregion
23056
- //#region ../../node_modules/.pnpm/effect@4.0.2/node_modules/effect/dist/cli/Flag.js
23542
+ //#region ../../node_modules/.pnpm/effect@4.0.4/node_modules/effect/dist/cli/Flag.js
23057
23543
  /**
23058
23544
  * Creates a boolean flag that can be enabled or disabled.
23059
23545
  *
@@ -23100,16 +23586,6 @@ const Boolean = (name) => Boolean$1(flagKind, name);
23100
23586
  */
23101
23587
  const ChoiceWithValue = (name, choices) => ChoiceWithValue$1(flagKind, name, choices);
23102
23588
  /**
23103
- * Accepts one of the provided strings. An empty array rejects all input.
23104
- *
23105
- * @see {@link ChoiceWithValue} for mapping accepted strings to different typed values
23106
- *
23107
- * @stability unstable
23108
- * @category constructors
23109
- * @since 4.0.0
23110
- */
23111
- const Literals = (name, literals) => Literals$1(flagKind, name, literals);
23112
- /**
23113
23589
  * Adds an alias to a flag, allowing it to be referenced by multiple names.
23114
23590
  *
23115
23591
  * **Example** (Adding flag aliases)
@@ -23259,33 +23735,8 @@ const optional = (param) => optional$1(param);
23259
23735
  * @since 4.0.0
23260
23736
  */
23261
23737
  const withDefault = withDefault$1;
23262
- /**
23263
- * Transforms the parsed value of a flag using a mapping function.
23264
- *
23265
- * **Example** (Mapping parsed values)
23266
- *
23267
- * ```ts import.meta.vitest
23268
- * import { Flag } from "effect/cli"
23269
- *
23270
- * // Convert string to uppercase
23271
- * const nameFlag = Flag.String("name").pipe(
23272
- * Flag.map((name) => name.toUpperCase())
23273
- * )
23274
- *
23275
- * // Convert port to URL
23276
- * const urlFlag = Flag.Int("port").pipe(
23277
- * Flag.map((port) => `http://localhost:${port}`)
23278
- * )
23279
- * const kinds = [nameFlag.kind, urlFlag.kind] // => ["flag", "flag"]
23280
- * ```
23281
- *
23282
- * @stability unstable
23283
- * @category mapping
23284
- * @since 4.0.0
23285
- */
23286
- const map = /*#__PURE__*/ dual(2, (self, f) => map$1(self, f));
23287
23738
  //#endregion
23288
- //#region ../../node_modules/.pnpm/effect@4.0.2/node_modules/effect/dist/cli/internal/config.js
23739
+ //#region ../../node_modules/.pnpm/effect@4.0.4/node_modules/effect/dist/cli/internal/config.js
23289
23740
  /**
23290
23741
  * Config Internal
23291
23742
  * ================
@@ -23406,7 +23857,7 @@ const reconstructTree = (tree, results) => {
23406
23857
  }
23407
23858
  };
23408
23859
  //#endregion
23409
- //#region ../../node_modules/.pnpm/effect@4.0.2/node_modules/effect/dist/cli/internal/command.js
23860
+ //#region ../../node_modules/.pnpm/effect@4.0.4/node_modules/effect/dist/cli/internal/command.js
23410
23861
  /**
23411
23862
  * Command Implementation
23412
23863
  * ======================
@@ -23477,7 +23928,7 @@ const makeCommand = (options) => {
23477
23928
  if (visible.length === 0) continue;
23478
23929
  subcommandDocs.push({
23479
23930
  group: group.group,
23480
- commands: map$9(visible, (subcommand) => ({
23931
+ commands: map$8(visible, (subcommand) => ({
23481
23932
  name: subcommand.name,
23482
23933
  alias: subcommand.alias,
23483
23934
  shortDescription: subcommand.shortDescription,
@@ -23571,7 +24022,7 @@ const parseParams = /*#__PURE__*/ fnUntraced(function* (parsedArgs, params) {
23571
24022
  return [currentArguments, results];
23572
24023
  });
23573
24024
  //#endregion
23574
- //#region ../../node_modules/.pnpm/effect@4.0.2/node_modules/effect/dist/cli/internal/completions/descriptor.js
24025
+ //#region ../../node_modules/.pnpm/effect@4.0.4/node_modules/effect/dist/cli/internal/completions/descriptor.js
23575
24026
  /**
23576
24027
  * CommandDescriptor — pure-data representation of a command tree for
23577
24028
  * shell completion generation.
@@ -23681,7 +24132,7 @@ const fromCommand = (cmd, inheritedFlags = []) => {
23681
24132
  };
23682
24133
  };
23683
24134
  //#endregion
23684
- //#region ../../node_modules/.pnpm/effect@4.0.2/node_modules/effect/dist/cli/internal/help.js
24135
+ //#region ../../node_modules/.pnpm/effect@4.0.4/node_modules/effect/dist/cli/internal/help.js
23685
24136
  /**
23686
24137
  * Help Documentation
23687
24138
  * ================
@@ -23791,7 +24242,7 @@ const getHelpForCommandPath = (command, commandPath, builtIns) => gen(function*
23791
24242
  };
23792
24243
  });
23793
24244
  //#endregion
23794
- //#region ../../node_modules/.pnpm/effect@4.0.2/node_modules/effect/dist/cli/GlobalFlag.js
24245
+ //#region ../../node_modules/.pnpm/effect@4.0.4/node_modules/effect/dist/cli/GlobalFlag.js
23795
24246
  /**
23796
24247
  * Global flags for Effect CLI command trees. Global flags are parsed outside a
23797
24248
  * single command's local flags and can apply to a command and its descendants.
@@ -23893,20 +24344,22 @@ const Wizard = /*#__PURE__*/ Action({
23893
24344
  *
23894
24345
  * **Details**
23895
24346
  *
23896
- * Accepted values are `bash`, `zsh`, `fish`, and `sh`; `sh` is normalized to
23897
- * `bash`.
24347
+ * Accepted values are `bash`, `zsh`, `fish`, `powershell`, `sh`, and `pwsh`;
24348
+ * `sh` is normalized to `bash` and `pwsh` to `powershell`.
23898
24349
  *
23899
24350
  * @stability unstable
23900
24351
  * @category references
23901
24352
  * @since 4.0.0
23902
24353
  */
23903
24354
  const Completions = /*#__PURE__*/ Action({
23904
- flag: /*#__PURE__*/ Literals("completions", [
23905
- "bash",
23906
- "zsh",
23907
- "fish",
23908
- "sh"
23909
- ]).pipe(optional, /*#__PURE__*/ map((v) => map$10(v, (s) => s === "sh" ? "bash" : s)), /*#__PURE__*/ withMetavar("<bash|zsh|fish|sh>"), /*#__PURE__*/ withDescription$1("Print shell completion script")),
24355
+ flag: /*#__PURE__*/ ChoiceWithValue("completions", [
24356
+ ["bash", "bash"],
24357
+ ["zsh", "zsh"],
24358
+ ["fish", "fish"],
24359
+ ["powershell", "powershell"],
24360
+ ["sh", "bash"],
24361
+ ["pwsh", "powershell"]
24362
+ ]).pipe(optional, /*#__PURE__*/ withMetavar("<bash|zsh|fish|powershell|sh|pwsh>"), /*#__PURE__*/ withDescription$1("Print shell completion script")),
23910
24363
  run: /*#__PURE__*/ fnUntraced(function* (shell, { command }) {
23911
24364
  if (isNone(shell)) return;
23912
24365
  const descriptor = fromCommand(command);
@@ -23972,7 +24425,7 @@ const BuiltIns = [
23972
24425
  LogLevel
23973
24426
  ];
23974
24427
  //#endregion
23975
- //#region ../../node_modules/.pnpm/effect@4.0.2/node_modules/effect/dist/cli/CliConfig.js
24428
+ //#region ../../node_modules/.pnpm/effect@4.0.4/node_modules/effect/dist/cli/CliConfig.js
23976
24429
  /**
23977
24430
  * Configuration for Effect CLI command execution.
23978
24431
  *
@@ -24002,7 +24455,7 @@ var CliConfig = class extends (/*#__PURE__*/ Reference("effect/cli/CliConfig", {
24002
24455
  */
24003
24456
  const defaults = { builtIns: BuiltIns };
24004
24457
  //#endregion
24005
- //#region ../../node_modules/.pnpm/effect@4.0.2/node_modules/effect/dist/cli/internal/lexer.js
24458
+ //#region ../../node_modules/.pnpm/effect@4.0.4/node_modules/effect/dist/cli/internal/lexer.js
24006
24459
  /**
24007
24460
  * @internal
24008
24461
  */
@@ -24064,7 +24517,7 @@ const lexTokens = (args) => {
24064
24517
  return tokens;
24065
24518
  };
24066
24519
  //#endregion
24067
- //#region ../../node_modules/.pnpm/effect@4.0.2/node_modules/effect/dist/cli/internal/auto-suggest.js
24520
+ //#region ../../node_modules/.pnpm/effect@4.0.4/node_modules/effect/dist/cli/internal/auto-suggest.js
24068
24521
  /**
24069
24522
  * Simple Levenshtein distance implementation (small N, no perf worries)
24070
24523
  */
@@ -24092,7 +24545,7 @@ const suggest = (input, candidates) => {
24092
24545
  return distances.filter(([d]) => d === minDistance).map(([, c]) => c);
24093
24546
  };
24094
24547
  //#endregion
24095
- //#region ../../node_modules/.pnpm/effect@4.0.2/node_modules/effect/dist/cli/internal/parser.js
24548
+ //#region ../../node_modules/.pnpm/effect@4.0.4/node_modules/effect/dist/cli/internal/parser.js
24096
24549
  /**
24097
24550
  * Parsing Pipeline for CLI Commands
24098
24551
  * ==================================
@@ -24624,13 +25077,14 @@ const scanCommandLevel = (tokens, context) => {
24624
25077
  return toLeafResult(state);
24625
25078
  };
24626
25079
  //#endregion
24627
- //#region ../../node_modules/.pnpm/effect@4.0.2/node_modules/effect/dist/cli/internal/wizard.js
25080
+ //#region ../../node_modules/.pnpm/effect@4.0.4/node_modules/effect/dist/cli/internal/wizard.js
24628
25081
  const run$1 = /*#__PURE__*/ fnUntraced(function* (command, options) {
24629
25082
  const commandPath = options?.commandPath ?? [command.name];
24630
25083
  const selected = getCommandAtPath(command, commandPath);
24631
25084
  const commandLine = (options?.prefix ?? commandPath).map((value) => commandLineArg(value));
24632
- yield* logCurrentCommand(commandLine);
24633
- yield* promptCommand(selected, commandLine, selected === command ? "ROOT" : selected.name);
25085
+ const { colors } = yield* Theme;
25086
+ yield* logCurrentCommand(commandLine, colors);
25087
+ yield* promptCommand(selected, commandLine, selected === command ? "ROOT" : selected.name, colors);
24634
25088
  return {
24635
25089
  args: commandLine.map((arg) => arg.value),
24636
25090
  displayArgs: commandLine.map((arg) => arg.displayValue)
@@ -24645,19 +25099,19 @@ const getCommandAtPath = (command, commandPath) => {
24645
25099
  }
24646
25100
  return current;
24647
25101
  };
24648
- const promptCommand = /*#__PURE__*/ fnUntraced(function* (command, commandLine, sectionName) {
25102
+ const promptCommand = /*#__PURE__*/ fnUntraced(function* (command, commandLine, sectionName, colors) {
24649
25103
  const impl = toImpl(command);
24650
25104
  const visibleSubcommands = command.subcommands.flatMap((group) => group.commands.filter((child) => !child.unlisted));
24651
25105
  const config = visibleSubcommands.length === 0 ? impl.config : impl.contextConfig;
24652
25106
  if (config.flags.length > 0) {
24653
- yield* log(renderSection(sectionName, "FLAGS"));
25107
+ yield* log(renderSection(sectionName, "FLAGS", colors));
24654
25108
  for (const param of config.flags) commandLine.push(...yield* promptParam(param));
24655
- if (config.arguments.length > 0 || visibleSubcommands.length > 0) yield* logCurrentCommand(commandLine);
25109
+ if (config.arguments.length > 0 || visibleSubcommands.length > 0) yield* logCurrentCommand(commandLine, colors);
24656
25110
  }
24657
25111
  if (config.arguments.length > 0) {
24658
- yield* log(renderSection(sectionName, "ARGUMENTS"));
25112
+ yield* log(renderSection(sectionName, "ARGUMENTS", colors));
24659
25113
  for (const param of config.arguments) commandLine.push(...yield* promptParam(param));
24660
- if (visibleSubcommands.length > 0) yield* logCurrentCommand(commandLine);
25114
+ if (visibleSubcommands.length > 0) yield* logCurrentCommand(commandLine, colors);
24661
25115
  }
24662
25116
  if (visibleSubcommands.length === 0) return;
24663
25117
  const child = yield* run$2(Select({
@@ -24670,8 +25124,8 @@ const promptCommand = /*#__PURE__*/ fnUntraced(function* (command, commandLine,
24670
25124
  }));
24671
25125
  yield* log();
24672
25126
  commandLine.push(commandLineArg(child.name));
24673
- if (hasWizardSteps(child)) yield* logCurrentCommand(commandLine);
24674
- yield* promptCommand(child, commandLine, child.name);
25127
+ if (hasWizardSteps(child)) yield* logCurrentCommand(commandLine, colors);
25128
+ yield* promptCommand(child, commandLine, child.name, colors);
24675
25129
  });
24676
25130
  const hasWizardSteps = (command) => {
24677
25131
  return command.subcommands.some((group) => group.commands.some((child) => !child.unlisted)) || toImpl(command).config.orderedParams.length > 0;
@@ -24711,7 +25165,7 @@ const promptParam = /*#__PURE__*/ fnUntraced(function* (param) {
24711
25165
  const promptSingle = (single) => {
24712
25166
  const message = renderParamMessage(single);
24713
25167
  switch (single.primitiveType._tag) {
24714
- case "Boolean": return map$5(run$2(Confirm({
25168
+ case "Boolean": return map$4(run$2(Confirm({
24715
25169
  message,
24716
25170
  label: {
24717
25171
  confirm: "true",
@@ -24724,7 +25178,7 @@ const promptSingle = (single) => {
24724
25178
  })), (value) => commandLineArg(String(value)));
24725
25179
  case "Choice": {
24726
25180
  const choices = getChoiceKeys(single.primitiveType) ?? [];
24727
- return map$5(run$2(Select({
25181
+ return map$4(run$2(Select({
24728
25182
  message,
24729
25183
  choices: choices.map((choice) => ({
24730
25184
  title: choice,
@@ -24732,11 +25186,11 @@ const promptSingle = (single) => {
24732
25186
  }))
24733
25187
  })), commandLineArg);
24734
25188
  }
24735
- case "Date": return map$5(run$2(Date$1({ message })), (date) => commandLineArg(date.toISOString()));
24736
- case "Finite": return map$5(run$2(Number$1({ message })), (value) => commandLineArg(String(value)));
24737
- case "Int": return map$5(run$2(Int({ message })), (value) => commandLineArg(String(value)));
24738
- case "Redacted": return map$5(run$2(Password({ message })), (value$2) => commandLineArg(value(value$2), "<redacted>"));
24739
- default: return map$5(run$2(String$1({ message })), commandLineArg);
25189
+ case "Date": return map$4(run$2(Date$1({ message })), (date) => commandLineArg(date.toISOString()));
25190
+ case "Finite": return map$4(run$2(Number$1({ message })), (value) => commandLineArg(String(value)));
25191
+ case "Int": return map$4(run$2(Int({ message })), (value) => commandLineArg(String(value)));
25192
+ case "Redacted": return map$4(run$2(Password({ message })), (value$2) => commandLineArg(value(value$2), "<redacted>"));
25193
+ default: return map$4(run$2(String$1({ message })), commandLineArg);
24740
25194
  }
24741
25195
  };
24742
25196
  const commandLineArg = (value, displayValue = value) => ({
@@ -24755,23 +25209,23 @@ const humanize = (name) => {
24755
25209
  if (words.length === 0) return name;
24756
25210
  return [words[0][0].toUpperCase() + words[0].slice(1), ...words.slice(1)].join(" ");
24757
25211
  };
24758
- const logCurrentCommand = (commandLine) => log(renderCommandBlock("Current command", commandLine.map((arg) => arg.displayValue), magenta));
24759
- const renderSection = (commandName, section) => `${annotate(commandName.toUpperCase(), bold, cyanBright)} ${annotate("·", blackBright)} ${annotate(section, bold, white)}`;
24760
- const renderIntroduction = (name, version, summary) => {
25212
+ const logCurrentCommand = (commandLine, colors) => log(renderCommandBlock("Current command", commandLine.map((arg) => arg.displayValue), colors, magenta));
25213
+ const renderSection = (commandName, section, colors) => `${annotate(colors, commandName.toUpperCase(), bold, cyanBright)} ${annotate(colors, "·", blackBright)} ${annotate(colors, section, bold, white)}`;
25214
+ const renderIntroduction = (name, version, summary, colors) => {
24761
25215
  return [
24762
- `${annotate(name, bold, cyanBright)} ${annotate(`v${version}`, white)} ${annotate("· Command wizard", bold, white)}`,
25216
+ `${annotate(colors, name, bold, cyanBright)} ${annotate(colors, `v${version}`, white)} ${annotate(colors, "· Command wizard", bold, white)}`,
24763
25217
  ...summary === void 0 || summary.length === 0 ? [] : [summary],
24764
- annotate("Build a command interactively. Press Ctrl+C to cancel.", blackBright),
25218
+ annotate(colors, "Build a command interactively. Press Ctrl+C to cancel.", blackBright),
24765
25219
  ""
24766
25220
  ].join("\n");
24767
25221
  };
24768
- const renderCompletion = (commandLine) => renderCommandBlock("Command ready", commandLine, cyanBright, green);
24769
- const renderQuit = () => `\n${annotate("Wizard cancelled.", red)}`;
24770
- const renderCommandBlock = (label, commandLine, commandColor, labelColor = white) => {
25222
+ const renderCompletion = (commandLine, colors) => renderCommandBlock("Command ready", commandLine, colors, cyanBright, green);
25223
+ const renderQuit = (colors) => `\n${annotate(colors, "Wizard cancelled.", red)}`;
25224
+ const renderCommandBlock = (label, commandLine, colors, commandColor, labelColor = white) => {
24771
25225
  const lines = wrapCommand(commandLine);
24772
25226
  return [
24773
- annotate(label, bold, labelColor),
24774
- ...lines.map((line) => annotate(line, commandColor)),
25227
+ annotate(colors, label, bold, labelColor),
25228
+ ...lines.map((line) => annotate(colors, line, commandColor)),
24775
25229
  ""
24776
25230
  ].join("\n");
24777
25231
  };
@@ -24794,7 +25248,7 @@ const wrapCommand = (commandLine) => {
24794
25248
  };
24795
25249
  const formatShellArg = (arg) => /^[A-Za-z0-9_./:@%+=,-]+$/.test(arg) ? arg : `'${arg.replaceAll("'", `'"'"'`)}'`;
24796
25250
  //#endregion
24797
- //#region ../../node_modules/.pnpm/effect@4.0.2/node_modules/effect/dist/cli/Command.js
25251
+ //#region ../../node_modules/.pnpm/effect@4.0.4/node_modules/effect/dist/cli/Command.js
24798
25252
  /**
24799
25253
  * Creates a `Command` from a name, an optional configuration, and an optional
24800
25254
  * handler.
@@ -25183,27 +25637,30 @@ const runWith = (command, config) => {
25183
25637
  return entries !== void 0 && entries.length > 0;
25184
25638
  })) continue;
25185
25639
  const [, value] = yield* flag.flag.parse(emptyArgs);
25186
- if (flag === Wizard) return yield* gen(function* () {
25187
- yield* log(renderIntroduction(command.name, config.version, command.description));
25188
- const prefix = [command.name, ...args.filter((arg) => arg !== "--wizard" && !arg.startsWith("--wizard="))];
25189
- const wizardResult = yield* run$1(command, {
25190
- commandPath,
25191
- prefix
25192
- });
25193
- yield* log(renderCompletion(wizardResult.displayArgs));
25194
- if (yield* run$2(Toggle({
25195
- message: "Run this command?",
25196
- initial: true,
25197
- active: "yes",
25198
- inactive: "no"
25199
- }))) {
25200
- yield* log();
25201
- yield* runWith(command, {
25202
- ...config,
25203
- renderErrors: false
25204
- })(wizardResult.args.slice(1));
25205
- }
25206
- }).pipe(catchTag("QuitError", () => log(renderQuit())));
25640
+ if (flag === Wizard) {
25641
+ const { colors } = yield* Theme;
25642
+ return yield* gen(function* () {
25643
+ yield* log(renderIntroduction(command.name, config.version, command.description, colors));
25644
+ const prefix = [command.name, ...args.filter((arg) => arg !== "--wizard" && !arg.startsWith("--wizard="))];
25645
+ const wizardResult = yield* run$1(command, {
25646
+ commandPath,
25647
+ prefix
25648
+ });
25649
+ yield* log(renderCompletion(wizardResult.displayArgs, colors));
25650
+ if (yield* run$2(Toggle({
25651
+ message: "Run this command?",
25652
+ initial: true,
25653
+ active: "yes",
25654
+ inactive: "no"
25655
+ }))) {
25656
+ yield* log();
25657
+ yield* runWith(command, {
25658
+ ...config,
25659
+ renderErrors: false
25660
+ })(wizardResult.args.slice(1));
25661
+ }
25662
+ }).pipe(catchTag("QuitError", () => log(renderQuit(colors))));
25663
+ }
25207
25664
  yield* flag.run(value, handlerCtx);
25208
25665
  return;
25209
25666
  }
@@ -25233,7 +25690,7 @@ const runWith = (command, config) => {
25233
25690
  };
25234
25691
  //#endregion
25235
25692
  //#region package.json
25236
- var version = "0.1.1068";
25693
+ var version = "0.1.1071";
25237
25694
  //#endregion
25238
25695
  //#region src/install.ts
25239
25696
  const cli = pipe(make("deslop-coding-standards", {}, fnUntraced(function* () {
@@ -25304,7 +25761,7 @@ const cli = pipe(make("deslop-coding-standards", {}, fnUntraced(function* () {
25304
25761
  yield* fs.copy(path.join(source, name), target);
25305
25762
  }
25306
25763
  }
25307
- yield* log(`Installed ${join$1(names, ", ")} in ${pipe(targets, map$9((directory) => path.join(root, directory, "skills")), join$1(", "))}.`);
25764
+ yield* log(`Installed ${join$1(names, ", ")} in ${pipe(targets, map$8((directory) => path.join(root, directory, "skills")), join$1(", "))}.`);
25308
25765
  })), withDescription("Install the package’s architecture, engineering, design, testing and review skills at the Git repository root, including linked worktrees. Copy into each existing .agents, .claude and .codex skills directory, always .claude, and .agents when no .codex exists. Replace only package-owned names; preserve other skills and global configuration. Reject destinations outside the repository before copying. Refer to skills by name. Run the latest CLI transiently without adding a dependency. These skills belong in repositories, not global configuration."), withExamples([{
25309
25766
  command: "vpx @deslop/coding-standards@latest",
25310
25767
  description: "Install or refresh this repository’s shared skills without adding a dependency."