@deslop/deploy 0.1.1343 → 0.1.1348

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/server.js CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env -S node --max-old-space-size=16384 --heapsnapshot-near-heap-limit=3 --report-on-fatalerror
2
2
  import { createRequire } from "node:module";
3
- import { cwd, execPath, pid, platform } from "node:process";
3
+ import { arch, cwd, execPath, pid, platform } from "node:process";
4
4
  import * as OS from "node:os";
5
5
  import { cpus, hostname, loadavg, totalmem, userInfo } from "node:os";
6
6
  import * as NodeChildProcess from "node:child_process";
@@ -4989,7 +4989,7 @@ const ServiceProto = {
4989
4989
  .../*#__PURE__*/ Prototype({
4990
4990
  label: "Service",
4991
4991
  evaluate(fiber) {
4992
- return exitSucceed(get$13(fiber.context, this));
4992
+ return exitSucceed(get$14(fiber.context, this));
4993
4993
  }
4994
4994
  }),
4995
4995
  toJSON() {
@@ -5005,10 +5005,10 @@ const ServiceProto = {
5005
5005
  return make$93(this, self);
5006
5006
  },
5007
5007
  use(f) {
5008
- return withFiber$1((fiber) => f(get$13(fiber.context, this)));
5008
+ return withFiber$1((fiber) => f(get$14(fiber.context, this)));
5009
5009
  },
5010
5010
  useSync(f) {
5011
- return withFiber$1((fiber) => exitSucceed(f(get$13(fiber.context, this))));
5011
+ return withFiber$1((fiber) => exitSucceed(f(get$14(fiber.context, this))));
5012
5012
  }
5013
5013
  };
5014
5014
  const cacheKeys = /*#__PURE__*/ new Set();
@@ -5387,7 +5387,7 @@ const getUnsafe$1 = /*#__PURE__*/ dual(2, (self, service) => {
5387
5387
  * @category getters
5388
5388
  * @since 2.0.0
5389
5389
  */
5390
- const get$13 = getUnsafe$1;
5390
+ const get$14 = getUnsafe$1;
5391
5391
  const defaultValueCacheKey = "~effect/Context/defaultValue";
5392
5392
  const getDefaultValue = (ref) => {
5393
5393
  if (defaultValueCacheKey in ref) return ref[defaultValueCacheKey];
@@ -6506,7 +6506,7 @@ const has$6 = /*#__PURE__*/ dual(2, (self, key) => Object.hasOwn(self, key));
6506
6506
  * @category getters
6507
6507
  * @since 2.0.0
6508
6508
  */
6509
- const get$12 = /*#__PURE__*/ dual(2, (self, key) => Object.hasOwn(self, key) ? some$1(self[key]) : none());
6509
+ const get$13 = /*#__PURE__*/ dual(2, (self, key) => Object.hasOwn(self, key) ? some$1(self[key]) : none());
6510
6510
  /**
6511
6511
  * Maps a record into another record by applying a transformation function to each of its values.
6512
6512
  *
@@ -7098,7 +7098,7 @@ function isOutOfBounds(i, as) {
7098
7098
  * @category getters
7099
7099
  * @since 2.0.0
7100
7100
  */
7101
- const get$11 = /*#__PURE__*/ dual(2, (self, index) => {
7101
+ const get$12 = /*#__PURE__*/ dual(2, (self, index) => {
7102
7102
  const i = Math.floor(index);
7103
7103
  return isOutOfBounds(i, self) ? none() : some$1(self[i]);
7104
7104
  });
@@ -7159,7 +7159,7 @@ const getUnsafe = /*#__PURE__*/ dual(2, (self, index) => {
7159
7159
  * @category getters
7160
7160
  * @since 2.0.0
7161
7161
  */
7162
- const head = /*#__PURE__*/ get$11(0);
7162
+ const head = /*#__PURE__*/ get$12(0);
7163
7163
  /**
7164
7164
  * Returns the first element of a `NonEmptyReadonlyArray` directly (no `Option`
7165
7165
  * wrapper).
@@ -10673,7 +10673,7 @@ var FiberImpl = class {
10673
10673
  return this._dispatcher ??= this.cache.scheduler.makeDispatcher();
10674
10674
  }
10675
10675
  getRef(ref) {
10676
- return get$13(this.context, ref);
10676
+ return get$14(this.context, ref);
10677
10677
  }
10678
10678
  addObserver(cb) {
10679
10679
  if (this._exit) {
@@ -10855,17 +10855,17 @@ var FiberImpl = class {
10855
10855
  const makeFiberContextCache = (context) => {
10856
10856
  const currentTracer = getOrUndefinedUnsafe(context, TracerKey);
10857
10857
  return {
10858
- scheduler: get$13(context, Scheduler),
10858
+ scheduler: get$14(context, Scheduler),
10859
10859
  tracer: currentTracer,
10860
10860
  tracerContext: currentTracer ? currentTracer["context"] : void 0,
10861
- tracerEnabled: get$13(context, TracerEnabled),
10861
+ tracerEnabled: get$14(context, TracerEnabled),
10862
10862
  span: getOrUndefinedUnsafe(context, ParentSpanKey),
10863
- logLevel: get$13(context, CurrentLogLevel$1),
10864
- minimumLogLevel: get$13(context, MinimumLogLevel$1),
10865
- stackFrame: get$13(context, CurrentStackFrame),
10863
+ logLevel: get$14(context, CurrentLogLevel$1),
10864
+ minimumLogLevel: get$14(context, MinimumLogLevel$1),
10865
+ stackFrame: get$14(context, CurrentStackFrame),
10866
10866
  runtimeMetrics: getOrUndefinedUnsafe(context, FiberRuntimeMetricsKey),
10867
- maxOpsBeforeYield: get$13(context, MaxOpsBeforeYield),
10868
- preventYield: get$13(context, PreventSchedulerYield)
10867
+ maxOpsBeforeYield: get$14(context, MaxOpsBeforeYield),
10868
+ preventYield: get$14(context, PreventSchedulerYield)
10869
10869
  };
10870
10870
  };
10871
10871
  const deferredInterruptCont = {
@@ -11472,6 +11472,8 @@ const provideService$3 = function() {
11472
11472
  };
11473
11473
  const provideServiceImpl = (self, service, implementation) => updateContext$1(self, add$2(service, implementation));
11474
11474
  /** @internal */
11475
+ const provideServiceEffect$1 = /*#__PURE__*/ dual(3, (self, service, acquire) => flatMap$5(acquire, (implementation) => provideService$3(self, service, implementation)));
11476
+ /** @internal */
11475
11477
  const zipWith$1 = /*#__PURE__*/ dual((args) => isEffect$1(args[1]), (self, that, f, options) => options?.concurrent ? map$9(all$2([self, that], { concurrency: 2 }), ([a, a2]) => f(a, a2)) : flatMap$5(self, (a) => map$9(that, (a2) => f(a, a2))));
11476
11478
  /** @internal */
11477
11479
  const filterOrFail$1 = /*#__PURE__*/ dual((args) => isEffect$1(args[0]), (self, predicate, orFailWith) => filterOrElse(self, predicate, orFailWith ? (a) => fail$10(orFailWith(a)) : () => fail$10(new NoSuchElementError())));
@@ -11519,7 +11521,7 @@ const tapCauseFilter = /*#__PURE__*/ dual(3, (self, filter, f) => catchCause$4(s
11519
11521
  /** @internal */
11520
11522
  const tapError$4 = /*#__PURE__*/ dual(2, (self, f) => tapCauseFilter(self, findError$1, (e) => f(e)));
11521
11523
  /** @internal */
11522
- const catchIf$1 = /*#__PURE__*/ dual((args) => isEffect$1(args[0]), (self, predicate, f, orElse) => catchCause$4(self, (cause) => {
11524
+ const catchIf$3 = /*#__PURE__*/ dual((args) => isEffect$1(args[0]), (self, predicate, f, orElse) => catchCause$4(self, (cause) => {
11523
11525
  const error = findRecoverableError(cause);
11524
11526
  if (isFailure$1(error)) return failCause$6(error.failure);
11525
11527
  if (!predicate(error.success)) return orElse ? orElse(error.success) : failCause$6(cause);
@@ -11536,7 +11538,7 @@ const catchFilter$3 = /*#__PURE__*/ dual((args) => isEffect$1(args[0]), (self, f
11536
11538
  /** @internal */
11537
11539
  const catchTag$1 = /*#__PURE__*/ dual((args) => isEffect$1(args[0]), (self, k, f, orElse) => {
11538
11540
  const pred = Array.isArray(k) ? (e) => hasProperty(e, "_tag") && k.includes(e._tag) : isTagged(k);
11539
- return catchIf$1(self, pred, f, orElse);
11541
+ return catchIf$3(self, pred, f, orElse);
11540
11542
  });
11541
11543
  /** @internal */
11542
11544
  const catchTags$2 = /*#__PURE__*/ dual((args) => isEffect$1(args[0]), (self, cases, orElse) => {
@@ -11547,7 +11549,7 @@ const catchTags$2 = /*#__PURE__*/ dual((args) => isEffect$1(args[0]), (self, cas
11547
11549
  }, (e) => cases[e["_tag"]](e), orElse);
11548
11550
  });
11549
11551
  /** @internal */
11550
- const catchReason$3 = /*#__PURE__*/ dual((args) => isEffect$1(args[0]), (self, errorTag, reasonTag, f, orElse) => catchIf$1(self, (e) => isTagged(e, errorTag) && hasProperty(e, "reason") && (orElse !== void 0 || isTagged(e.reason, reasonTag)), (e) => {
11552
+ const catchReason$3 = /*#__PURE__*/ dual((args) => isEffect$1(args[0]), (self, errorTag, reasonTag, f, orElse) => catchIf$3(self, (e) => isTagged(e, errorTag) && hasProperty(e, "reason") && (orElse !== void 0 || isTagged(e.reason, reasonTag)), (e) => {
11551
11553
  const reason = e.reason;
11552
11554
  if (isTagged(reason, reasonTag)) return f(reason, e);
11553
11555
  return orElse ? orElse(reason, e) : fail$10(e);
@@ -12397,11 +12399,11 @@ const NoopSpanProto = {
12397
12399
  const noopSpan = (options) => Object.assign(Object.create(NoopSpanProto), options);
12398
12400
  const filterDisablePropagation = (span) => {
12399
12401
  if (!span) return none();
12400
- return get$13(span.annotations, DisablePropagation) ? span._tag === "Span" ? filterDisablePropagation(getOrUndefined$1(span.parent)) : none() : some$1(span);
12402
+ return get$14(span.annotations, DisablePropagation) ? span._tag === "Span" ? filterDisablePropagation(getOrUndefined$1(span.parent)) : none() : some$1(span);
12401
12403
  };
12402
12404
  /** @internal */
12403
12405
  const makeSpanUnsafe = (fiber, name, options) => {
12404
- const disablePropagation = !fiber.cache.tracerEnabled || options?.annotations && get$13(options.annotations, DisablePropagation);
12406
+ const disablePropagation = !fiber.cache.tracerEnabled || options?.annotations && get$14(options.annotations, DisablePropagation);
12405
12407
  const parent = options?.parent !== void 0 ? some$1(options.parent) : options?.root ? none() : filterDisablePropagation(fiber.cache.span);
12406
12408
  let span;
12407
12409
  if (disablePropagation) span = noopSpan({
@@ -15686,7 +15688,7 @@ const unwrapKey = /*#__PURE__*/ Service$1("effect/Layer/unwrap");
15686
15688
  * @category converting
15687
15689
  * @since 4.0.0
15688
15690
  */
15689
- const unwrap$8 = (self) => flatMap$4(effect(unwrapKey)(self), get$13(unwrapKey));
15691
+ const unwrap$8 = (self) => flatMap$4(effect(unwrapKey)(self), get$14(unwrapKey));
15690
15692
  const mergeAllEffect = (layers, memoMap, scope) => {
15691
15693
  const parentScope = forkUnsafe(scope, "parallel");
15692
15694
  return forEach$2(layers, (layer) => layer.build(memoMap, forkUnsafe(parentScope, "sequential")), { concurrency: layers.length }).pipe(map$9((context) => mergeAll$3(...context)));
@@ -18182,7 +18184,7 @@ const fromIterable$7 = (entries) => {
18182
18184
  * @category getters
18183
18185
  * @since 2.0.0
18184
18186
  */
18185
- const get$10 = /*#__PURE__*/ dual(2, (self, key) => {
18187
+ const get$11 = /*#__PURE__*/ dual(2, (self, key) => {
18186
18188
  if (self.backing.has(key)) return some$1(self.backing.get(key));
18187
18189
  else if (isSimpleKey(key)) return none();
18188
18190
  const hash$3 = hash(key);
@@ -18226,7 +18228,7 @@ const getFromBucket = (self, bucket, key) => {
18226
18228
  * @category predicates
18227
18229
  * @since 2.0.0
18228
18230
  */
18229
- const has$4 = /*#__PURE__*/ dual(2, (self, key) => isSome(get$10(self, key)));
18231
+ const has$4 = /*#__PURE__*/ dual(2, (self, key) => isSome(get$11(self, key)));
18230
18232
  /**
18231
18233
  * Sets a key-value pair in the MutableHashMap, mutating the map in place.
18232
18234
  * If the key already exists, its value is updated.
@@ -20235,7 +20237,7 @@ const catchDefect = catchDefect$1;
20235
20237
  * @category error handling
20236
20238
  * @since 2.0.0
20237
20239
  */
20238
- const catchIf = catchIf$1;
20240
+ const catchIf$2 = catchIf$3;
20239
20241
  /**
20240
20242
  * Recovers from specific errors using a `Filter`.
20241
20243
  *
@@ -21620,6 +21622,63 @@ const updateService = updateService$1;
21620
21622
  */
21621
21623
  const provideService$2 = provideService$3;
21622
21624
  /**
21625
+ * Provides one service to an effect using an effectful acquisition.
21626
+ *
21627
+ * **When to use**
21628
+ *
21629
+ * Use when the service implementation must be created by an effect and its
21630
+ * acquisition failure should remain in the returned effect.
21631
+ *
21632
+ * **Details**
21633
+ *
21634
+ * `provideServiceEffect` runs the acquisition effect to produce the service
21635
+ * implementation, removes that service from the wrapped effect's requirements,
21636
+ * and leaves any other requirements to be provided later. Acquisition failures
21637
+ * are included in the returned effect's error channel.
21638
+ *
21639
+ * **Example** (Providing a service with an effect)
21640
+ *
21641
+ * ```ts import.meta.vitest
21642
+ * import { Context, Effect } from "effect"
21643
+ * const output: Array<unknown> = []
21644
+ *
21645
+ * // Define a database connection service
21646
+ * interface DatabaseConnection {
21647
+ * readonly query: (sql: string) => Effect.Effect<string>
21648
+ * }
21649
+ * const Database = Context.Service<DatabaseConnection>("Database")
21650
+ *
21651
+ * // Effect that creates a database connection
21652
+ * const createConnection = Effect.gen(function*() {
21653
+ * yield* Effect.sync(() => { output.push("Establishing database connection...") })
21654
+ * yield* Effect.sync(() => { output.push("Database connected!") })
21655
+ * return {
21656
+ * query: (sql: string) => Effect.succeed(`Result for: ${sql}`)
21657
+ * }
21658
+ * })
21659
+ *
21660
+ * const program = Effect.gen(function*() {
21661
+ * const db = yield* Effect.service(Database)
21662
+ * return yield* db.query("SELECT * FROM users")
21663
+ * })
21664
+ *
21665
+ * // Provide the service through an effect
21666
+ * const withDatabase = Effect.provideServiceEffect(
21667
+ * program,
21668
+ * Database,
21669
+ * createConnection
21670
+ * )
21671
+ *
21672
+ * void output.push(await Effect.runPromise(withDatabase))
21673
+ * output // => ["Establishing database connection...", "Database connected!", "Result for: SELECT * FROM users"]
21674
+ * ```
21675
+ *
21676
+ * @stability stable
21677
+ * @category providing services
21678
+ * @since 2.0.0
21679
+ */
21680
+ const provideServiceEffect = provideServiceEffect$1;
21681
+ /**
21623
21682
  * Returns the current scope for resource management.
21624
21683
  *
21625
21684
  * **Example** (Accessing the current scope)
@@ -30756,7 +30815,7 @@ var HashMapImpl = class {
30756
30815
  const thatImpl = that;
30757
30816
  if (this.size !== thatImpl.size) return false;
30758
30817
  for (const [key, value] of this) {
30759
- const otherValue = pipe(that, get$9(key));
30818
+ const otherValue = pipe(that, get$10(key));
30760
30819
  if (isNone(otherValue) || !equals$1(value, otherValue.value)) return false;
30761
30820
  }
30762
30821
  return true;
@@ -30802,7 +30861,7 @@ const fromIterable$6 = (entries) => {
30802
30861
  return new HashMapImpl(false, 0, root, size);
30803
30862
  };
30804
30863
  /** @internal */
30805
- const get$9 = /*#__PURE__*/ dual(2, (self, key) => {
30864
+ const get$10 = /*#__PURE__*/ dual(2, (self, key) => {
30806
30865
  return self._root.get(0, hash(key), key);
30807
30866
  });
30808
30867
  /** @internal */
@@ -30919,7 +30978,7 @@ const fromIterable$5 = fromIterable$6;
30919
30978
  * @category getters
30920
30979
  * @since 2.0.0
30921
30980
  */
30922
- const get$8 = get$9;
30981
+ const get$9 = get$10;
30923
30982
  /**
30924
30983
  * Sets the specified key to the specified value using the internal hashing
30925
30984
  * function.
@@ -31638,7 +31697,7 @@ const TypeId$58 = /*#__PURE__*/ Symbol.for("~effect/http/Headers");
31638
31697
  const Proto$19 = /*#__PURE__*/ Object.defineProperties(/*#__PURE__*/ Object.create(null), {
31639
31698
  [TypeId$58]: { value: TypeId$58 },
31640
31699
  [symbolRedactable]: { value(context) {
31641
- return redact$1(this, get$13(context, CurrentRedactedNames$1));
31700
+ return redact$1(this, get$14(context, CurrentRedactedNames$1));
31642
31701
  } },
31643
31702
  toJSON: { value() {
31644
31703
  return redact$2(this);
@@ -31713,6 +31772,18 @@ const fromInput$1 = (input) => {
31713
31772
  */
31714
31773
  const fromRecordUnsafe = (input) => Object.setPrototypeOf(input, Proto$19);
31715
31774
  /**
31775
+ * Gets a header value by name safely.
31776
+ *
31777
+ * **Details**
31778
+ *
31779
+ * The lookup lowercases the provided header name and returns `Option.none()` when absent.
31780
+ *
31781
+ * @stability unstable
31782
+ * @category combinators
31783
+ * @since 4.0.0
31784
+ */
31785
+ const get$8 = /*#__PURE__*/ dual(2, (self, key) => fromUndefinedOr(self[key.toLowerCase()]));
31786
+ /**
31716
31787
  * Returns a new `Headers` collection with the given header set.
31717
31788
  *
31718
31789
  * **Details**
@@ -32068,7 +32139,7 @@ const Proto$18 = {
32068
32139
  [symbolRedactable](context) {
32069
32140
  return {
32070
32141
  _id: "UrlParams",
32071
- params: Object.fromEntries(redact(this, get$13(context, CurrentRedactedNames)))
32142
+ params: Object.fromEntries(redact(this, get$14(context, CurrentRedactedNames)))
32072
32143
  };
32073
32144
  },
32074
32145
  toJSON() {
@@ -32269,7 +32340,7 @@ const decodeQueryKey = (key) => {
32269
32340
  return key;
32270
32341
  }
32271
32342
  };
32272
- const currentRedactedNames = () => get$13(globalThis["~effect/Fiber/currentFiber"]?.context ?? empty$18(), CurrentRedactedNames);
32343
+ const currentRedactedNames = () => get$14(globalThis["~effect/Fiber/currentFiber"]?.context ?? empty$18(), CurrentRedactedNames);
32273
32344
  /**
32274
32345
  * Query parameter names or patterns to redact in inspection, spans and errors.
32275
32346
  *
@@ -43195,7 +43266,7 @@ const defaultTimeToLive = (_, _key) => infinity;
43195
43266
  * @since 4.0.0
43196
43267
  */
43197
43268
  const get$7 = /*#__PURE__*/ dual(2, (self, key) => withFiber$1((fiber) => {
43198
- const oentry = get$10(self.map, key);
43269
+ const oentry = get$11(self.map, key);
43199
43270
  if (isSome(oentry)) {
43200
43271
  remove$3(self.map, key);
43201
43272
  if (!hasExpired(oentry.value, fiber)) {
@@ -43248,7 +43319,7 @@ var EntryImpl = class {
43248
43319
  }
43249
43320
  };
43250
43321
  const removeEntry = (self, key, entry) => {
43251
- const current = get$10(self.map, key);
43322
+ const current = get$11(self.map, key);
43252
43323
  if (isSome(current) && current.value === entry) remove$3(self.map, key);
43253
43324
  };
43254
43325
  const hasExpired = (entry, fiber) => {
@@ -44028,7 +44099,7 @@ const publishUnsafe = /*#__PURE__*/ dual(2, (self, value) => {
44028
44099
  * @since 2.0.0
44029
44100
  */
44030
44101
  const subscribe = (self) => uninterruptible(contextWith((services) => {
44031
- const localScope = get$13(services, Scope);
44102
+ const localScope = get$14(services, Scope);
44032
44103
  const scope = forkUnsafe(self.scope);
44033
44104
  const subscription = makeSubscriptionUnsafe(self.pubsub, self.subscribers, self.strategy, self.ended);
44034
44105
  return addFinalizer$1(scope, unsubscribe(subscription)).pipe(andThen(addFinalizerExit(localScope, (exit) => close(scope, exit))), as(subscription));
@@ -46141,6 +46212,38 @@ const catch_$1 = /*#__PURE__*/ dual(2, (self, f) => catchCauseFilter(self, findR
46141
46212
  */
46142
46213
  const tapError$2 = /*#__PURE__*/ dual(2, (self, f) => transformPull$1(self, (pull) => succeed$5(tapError$3(pull, (err) => isDone$1(err) ? void_$2 : asVoid(f(err))))));
46143
46214
  /**
46215
+ * Recovers from typed channel errors that match a predicate or refinement.
46216
+ *
46217
+ * **When to use**
46218
+ *
46219
+ * Use to recover from typed channel errors when a predicate or refinement
46220
+ * selects the failures that should switch to a recovery channel.
46221
+ *
46222
+ * **Details**
46223
+ *
46224
+ * Matching errors are handled by the recovery function. Non-matching errors
46225
+ * are handled by `orElse` when provided. Without `orElse`, non-matching errors
46226
+ * are re-failed.
46227
+ *
46228
+ * **Gotchas**
46229
+ *
46230
+ * If the cause contains a defect, the handler is skipped and every typed error
46231
+ * is converted to a defect, preserving reason order and interrupts. An
46232
+ * interruption alongside a typed error does not prevent recovery.
46233
+ *
46234
+ * @see {@link catch_ catch} for recovering from every typed channel error
46235
+ * @see {@link catchFilter} for selecting typed errors with a `Filter`
46236
+ * @see {@link catchTag} for selecting tagged typed errors
46237
+ * @see {@link catchCauseFilter} for selecting full causes with a `Filter`
46238
+ *
46239
+ * @stability stable
46240
+ * @category error handling
46241
+ * @since 4.0.0
46242
+ */
46243
+ const catchIf$1 = /*#__PURE__*/ dual((args) => isChannel(args[0]), (self, predicate, f, orElse) => catch_$1(self, (err) => {
46244
+ return predicate(err) ? f(err) : orElse ? orElse(err) : fail$1(err);
46245
+ }));
46246
+ /**
46144
46247
  * Recovers from typed channel errors selected by a `Filter`.
46145
46248
  *
46146
46249
  * **When to use**
@@ -47437,7 +47540,7 @@ const walk = /*#__PURE__*/ fnUntraced(function* (fs, compiled, options) {
47437
47540
  const isUnlisted = (value) => value === "." || value === ".." || isRoot(value);
47438
47541
  const probe = (parent, name, named) => {
47439
47542
  const path = toFsPath(join$2(parent, name));
47440
- return fs.stat(path).pipe(map$7((info) => info.type), catchReason$2("PlatformError", "NotFound", () => fs.readLink(path).pipe(as("SymbolicLink"), catchIf(isNotLink, () => succeed$5(void 0)))), catchIf(named ? isMissing : isIgnorable, () => succeed$5(void 0)), map$7((type) => type === void 0 ? void 0 : {
47543
+ return fs.stat(path).pipe(map$7((info) => info.type), catchReason$2("PlatformError", "NotFound", () => fs.readLink(path).pipe(as("SymbolicLink"), catchIf$2(isNotLink, () => succeed$5(void 0)))), catchIf$2(named ? isMissing : isIgnorable, () => succeed$5(void 0)), map$7((type) => type === void 0 ? void 0 : {
47441
47544
  name,
47442
47545
  type
47443
47546
  }));
@@ -47451,7 +47554,7 @@ const walk = /*#__PURE__*/ fnUntraced(function* (fs, compiled, options) {
47451
47554
  else if (node._tag !== "End") listed = true;
47452
47555
  }
47453
47556
  const probed = listed ? [...literals].filter(isUnlisted) : [...literals];
47454
- return zipWith(listed ? catchIf(fs.readDirectoryEntries(toFsPath(relative)), named ? isMissing : isIgnorable, () => succeed$5([])) : succeed$5([]), forEach$1(probed, (name) => probe(relative, name, named), { concurrency: 16 }), (listing, found) => ({
47557
+ return zipWith(listed ? catchIf$2(fs.readDirectoryEntries(toFsPath(relative)), named ? isMissing : isIgnorable, () => succeed$5([])) : succeed$5([]), forEach$1(probed, (name) => probe(relative, name, named), { concurrency: 16 }), (listing, found) => ({
47455
47558
  entries: sort([...listing, ...found.filter(isNotUndefined)], byName),
47456
47559
  named: named && !listed
47457
47560
  }));
@@ -47476,10 +47579,10 @@ const walk = /*#__PURE__*/ fnUntraced(function* (fs, compiled, options) {
47476
47579
  if (!descend && !needsDirectory(compiled, next) && !excludeNeedsDirectory) return child(false, false);
47477
47580
  if (type !== "Unknown" && type !== "SymbolicLink") return child(type === "Directory", false);
47478
47581
  const path = toFsPath(relative);
47479
- return fs.stat(path).pipe(map$7((info) => info.type === "Directory"), catchIf(isIgnorable, () => succeed$5(false)), flatMap$3((isDirectory) => {
47582
+ return fs.stat(path).pipe(map$7((info) => info.type === "Directory"), catchIf$2(isIgnorable, () => succeed$5(false)), flatMap$3((isDirectory) => {
47480
47583
  const resolved = child(isDirectory, type === "SymbolicLink");
47481
47584
  if (type === "SymbolicLink" || resolved?.next === void 0 || result.globstar.size === 0) return succeed$5(resolved);
47482
- return fs.readLink(path).pipe(as(child(isDirectory, true)), catchIf(isNotLink, () => succeed$5(resolved)));
47585
+ return fs.readLink(path).pipe(as(child(isDirectory, true)), catchIf$2(isNotLink, () => succeed$5(resolved)));
47483
47586
  }));
47484
47587
  };
47485
47588
  let slots = DIRECTORY_CONCURRENCY;
@@ -48023,7 +48126,7 @@ const makeUnsafe$3 = (options) => ({
48023
48126
  */
48024
48127
  const make$66 = (options) => withFiber((fiber) => {
48025
48128
  const context = fiber.context;
48026
- const scope = get$13(context, Scope);
48129
+ const scope = get$14(context, Scope);
48027
48130
  const self = makeUnsafe$3({
48028
48131
  lookup: options.lookup,
48029
48132
  context,
@@ -48090,7 +48193,7 @@ const get$5 = /*#__PURE__*/ dual(2, (self, key) => uninterruptibleMask((restore)
48090
48193
  if (self.state._tag === "Closed") return interrupt$1;
48091
48194
  const state = self.state;
48092
48195
  const parent = getCurrent();
48093
- const o = get$10(state.map, key);
48196
+ const o = get$11(state.map, key);
48094
48197
  let entry;
48095
48198
  if (o._tag === "Some") {
48096
48199
  entry = o.value;
@@ -48124,7 +48227,7 @@ const get$5 = /*#__PURE__*/ dual(2, (self, key) => uninterruptibleMask((restore)
48124
48227
  }));
48125
48228
  const removeInterrupted = (self, key, entry, context) => {
48126
48229
  if (self.state._tag === "Closed") return;
48127
- const o = get$10(self.state.map, key);
48230
+ const o = get$11(self.state.map, key);
48128
48231
  if (o._tag === "None" || o.value !== entry) return;
48129
48232
  remove$3(self.state.map, key);
48130
48233
  if (entry.refCount > 0) return;
@@ -48141,13 +48244,13 @@ const release$1 = (self, key, entry) => suspend$3(() => {
48141
48244
  entry.refCount--;
48142
48245
  if (entry.refCount > 0) return void_$2;
48143
48246
  else if (self.state._tag === "Closed") return closeEntry(entry);
48144
- const o = get$10(self.state.map, key);
48247
+ const o = get$11(self.state.map, key);
48145
48248
  if (o._tag === "None" || o.value !== entry) return closeEntry(entry);
48146
48249
  else if (isZero$1(entry.idleTimeToLive)) {
48147
48250
  remove$3(self.state.map, key);
48148
48251
  return closeEntry(entry);
48149
48252
  } else if (!isFinite$2(entry.idleTimeToLive)) return void_$2;
48150
- const clock = get$13(self.context, Clock);
48253
+ const clock = get$14(self.context, Clock);
48151
48254
  resetExpiresAt(entry, clock);
48152
48255
  if (entry.fiber) return void_$2;
48153
48256
  entry.fiber = uninterruptibleMask(function loop(restore) {
@@ -48155,7 +48258,7 @@ const release$1 = (self, key, entry) => suspend$3(() => {
48155
48258
  const remaining = entry.expiresAt - now;
48156
48259
  if (remaining <= 0) {
48157
48260
  if (self.state._tag === "Closed" || entry.refCount > 0) return void_$2;
48158
- const o = get$10(self.state.map, key);
48261
+ const o = get$11(self.state.map, key);
48159
48262
  if (o._tag === "None" || o.value !== entry) return void_$2;
48160
48263
  remove$3(self.state.map, key);
48161
48264
  return ignoreCause(close(entry.scope, void_$3), {
@@ -48197,7 +48300,7 @@ var RcRefImpl = class {
48197
48300
  /** @internal */
48198
48301
  const make$65 = (options) => withFiber((fiber) => {
48199
48302
  const context = fiber.context;
48200
- const scope = get$13(context, Scope);
48303
+ const scope = get$14(context, Scope);
48201
48304
  const ref = new RcRefImpl(options.acquire, context, scope, options.idleTimeToLive !== void 0 ? fromInputUnsafe$1(options.idleTimeToLive) : void 0);
48202
48305
  return as(addFinalizerExit(scope, () => {
48203
48306
  const state = ref.state;
@@ -49470,6 +49573,47 @@ const catch_ = /*#__PURE__*/ dual(2, (self, f) => fromChannel(catch_$1(self.chan
49470
49573
  */
49471
49574
  const tapError$1 = /*#__PURE__*/ dual(2, (self, f) => self.channel.pipe(tapError$2(f), fromChannel));
49472
49575
  /**
49576
+ * Recovers from errors that match a predicate by switching to a recovery stream.
49577
+ *
49578
+ * **Details**
49579
+ *
49580
+ * When a failure matches the filter, the stream switches to the recovery
49581
+ * stream. Non-matching failures propagate downstream, so the error type is
49582
+ * preserved unless the filter narrows it.
49583
+ *
49584
+ * **Gotchas**
49585
+ *
49586
+ * If the cause contains a defect, the handler is skipped and every typed error
49587
+ * is converted to a defect, preserving reason order and interrupts. An
49588
+ * interruption alongside a typed error does not prevent recovery.
49589
+ *
49590
+ * **Example** (Catching matching failures)
49591
+ *
49592
+ * ```ts import.meta.vitest
49593
+ * import { Effect, Stream } from "effect"
49594
+ *
49595
+ * const stream = Stream.make(1, 2).pipe(
49596
+ * Stream.concat(Stream.fail(42)),
49597
+ * Stream.catchIf(
49598
+ * (error): error is 42 => error === 42,
49599
+ * () => Stream.make(999)
49600
+ * )
49601
+ * )
49602
+ *
49603
+ * const program = Effect.gen(function*() {
49604
+ * const values = yield* Stream.runCollect(stream)
49605
+ * values // => [ 1, 2, 999 ]
49606
+ * })
49607
+ *
49608
+ * await Effect.runPromise(program)
49609
+ * ```
49610
+ *
49611
+ * @stability stable
49612
+ * @category error handling
49613
+ * @since 4.0.0
49614
+ */
49615
+ const catchIf = /*#__PURE__*/ dual((args) => isStream(args[0]), (self, predicate, f, orElse) => fromChannel(catchIf$1(toChannel(self), predicate, (e) => f(e).channel, orElse && ((e) => orElse(e).channel))));
49616
+ /**
49473
49617
  * Recovers from errors that match a `Filter` by switching to a recovery
49474
49618
  * stream.
49475
49619
  *
@@ -53804,7 +53948,7 @@ const make$55 = /*#__PURE__*/ sync(() => {
53804
53948
  };
53805
53949
  const query = (keys, effect) => gen(function* () {
53806
53950
  const services = yield* context();
53807
- const scope = get$13(services, Scope);
53951
+ const scope = get$14(services, Scope);
53808
53952
  const results = yield* make$84();
53809
53953
  const runFork = flow(runForkWith(services), runIn(scope));
53810
53954
  let running = false;
@@ -55194,7 +55338,7 @@ const makeSqliteAcquirers = (options) => {
55194
55338
  }) });
55195
55339
  const rollback = (conn) => {
55196
55340
  if (isTransaction) return isTransaction(conn) ? asVoid(conn.executeUnprepared("ROLLBACK", [], void 0)) : void_$2;
55197
- return conn.executeUnprepared("ROLLBACK", [], void 0).pipe(asVoid, catchIf(isNoTransactionError, () => void_$2));
55341
+ return conn.executeUnprepared("ROLLBACK", [], void 0).pipe(asVoid, catchIf$2(isNoTransactionError, () => void_$2));
55198
55342
  };
55199
55343
  const available = flatMap$3(options.connection, (conn) => {
55200
55344
  if (poisoned === void 0) return succeed$5(conn);
@@ -58245,6 +58389,14 @@ const updateContentLength = (headers, body) => {
58245
58389
  const contentLength = body._tag === "Empty" || body._tag === "FormData" ? void 0 : body.contentLength;
58246
58390
  return contentLength === void 0 ? remove$1(headers, "content-length") : set$2(headers, "content-length", contentLength.toString());
58247
58391
  };
58392
+ /**
58393
+ * @internal
58394
+ */
58395
+ const parseContentLength = (contentLength) => {
58396
+ if (contentLength === null || contentLength === void 0 || !/^\d+$/.test(contentLength)) return;
58397
+ const parsed = Number(contentLength);
58398
+ return Number.isSafeInteger(parsed) ? parsed : void 0;
58399
+ };
58248
58400
  // ../../node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/http/Url.js
58249
58401
  /**
58250
58402
  * Parses and edits platform `URL` values.
@@ -59117,6 +59269,28 @@ const setStatus = /*#__PURE__*/ dual((args) => isHttpServerResponse(args[0]), (s
59117
59269
  * @since 4.0.0
59118
59270
  */
59119
59271
  const omitsBody = (response, withoutBody = false) => withoutBody || response.status === 204 || response.status === 205 || response.status === 304;
59272
+ /**
59273
+ * Converts an `HttpClientResponse` to an `HttpServerResponse`.
59274
+ *
59275
+ * **Details**
59276
+ *
59277
+ * The response body is streamed from the client response. `Set-Cookie` headers are
59278
+ * removed from the header map and represented in the response cookie collection.
59279
+ *
59280
+ * @stability unstable
59281
+ * @category converting
59282
+ * @since 4.0.0
59283
+ */
59284
+ const fromClientResponse = (response) => {
59285
+ const headers = remove$1(response.headers, "set-cookie");
59286
+ return makeResponse$2({
59287
+ status: response.status,
59288
+ headers,
59289
+ cookies: response.cookies,
59290
+ body: stream$2(catchIf(response.stream, isEmptyBodyError, () => empty$6), getOrUndefined$1(get$8(headers, "content-type")), parseContentLength(headers["content-length"]))
59291
+ });
59292
+ };
59293
+ const isEmptyBodyError = (error) => isHttpClientError(error) && error.reason._tag === "EmptyBodyError";
59120
59294
  const Proto$8 = {
59121
59295
  ...PipeInspectableProto,
59122
59296
  [TypeId$20]: TypeId$20,
@@ -61344,7 +61518,7 @@ const isMultipartError = (u) => hasProperty(u, MultipartErrorTypeId);
61344
61518
  * @since 4.0.0
61345
61519
  */
61346
61520
  const makeConfig = (headers) => withFiber((fiber) => {
61347
- const mimeTypes = get$13(fiber.context, FieldMimeTypes);
61521
+ const mimeTypes = get$14(fiber.context, FieldMimeTypes);
61348
61522
  return succeed$5({
61349
61523
  headers,
61350
61524
  maxParts: fiber.getRef(MaxParts),
@@ -63130,7 +63304,7 @@ var MiddlewareImpl = class MiddlewareImpl {
63130
63304
  const stack = [getOrUndefinedUnsafe(context$4, fnContextKey)];
63131
63305
  if (this.dependencies) {
63132
63306
  const memoMap = yield* CurrentMemoMap;
63133
- const scope = get$13(context$4, Scope);
63307
+ const scope = get$14(context$4, Scope);
63134
63308
  const depsContext = yield* buildWithMemoMap(this.dependencies, memoMap, scope);
63135
63309
  stack.push(...getMiddleware$1(depsContext));
63136
63310
  }
@@ -63185,9 +63359,9 @@ const serve = (appLayer, options) => {
63185
63359
  const layerWithRouter = provideMerge(appLayer, options?.routerConfig ? provide$2(layer$20, succeed$6(RouterConfig)(options.routerConfig)) : layer$20);
63186
63360
  return contextWith((context) => {
63187
63361
  const memoMap = CurrentMemoMap.forkOrCreate(context);
63188
- return buildWithMemoMap(layerWithRouter, memoMap, get$13(context, Scope));
63362
+ return buildWithMemoMap(layerWithRouter, memoMap, get$14(context, Scope));
63189
63363
  }).pipe(map$7((context) => {
63190
- const handler = get$13(context, HttpRouter).asHttpEffect();
63364
+ const handler = get$14(context, HttpRouter).asHttpEffect();
63191
63365
  return merge$4(middleware ? serve$1(handler, middleware) : serve$1(handler), succeedContext(context));
63192
63366
  }), unwrap$8, options?.disableListenLog ? identity : withLogAddress);
63193
63367
  };
@@ -65541,7 +65715,7 @@ const Strict = /*#__PURE__*/ Reference("effect/ai/Tool/Strict", { defaultValue:
65541
65715
  * @category getters
65542
65716
  * @since 4.0.0
65543
65717
  */
65544
- const getStrictMode = (tool) => get$13(tool.annotations, Strict);
65718
+ const getStrictMode = (tool) => get$14(tool.annotations, Strict);
65545
65719
  const suspectRx = /"__proto__"\s*:|"constructor"\s*:|\\u/;
65546
65720
  function _parse(text) {
65547
65721
  const obj = JSON.parse(text);
@@ -72969,7 +73143,7 @@ const makeNoSerialization$1 = /*#__PURE__*/ fnUntraced(function* (group, options
72969
73143
  const disableTracing = options?.disableTracing ?? false;
72970
73144
  const generateRequestId = options?.generateRequestId ?? (() => requestIdCounter++);
72971
73145
  const services = yield* context();
72972
- const scope = get$13(services, Scope);
73146
+ const scope = get$14(services, Scope);
72973
73147
  const entries = /* @__PURE__ */ new Map();
72974
73148
  let isShutdown = false;
72975
73149
  yield* addFinalizer$1(scope, withFiber((parent) => {
@@ -73316,7 +73490,7 @@ const makeRpcSchemas = (codecFor) => {
73316
73490
  let entry = cache.get(rpc);
73317
73491
  if (entry !== void 0) return entry;
73318
73492
  const streamSchemas = getStreamSchemas(rpc.successSchema);
73319
- const parseOptions = get$13(rpc.annotations, ParseOptions);
73493
+ const parseOptions = get$14(rpc.annotations, ParseOptions);
73320
73494
  const exitSchema$2 = exitSchema(rpc);
73321
73495
  let decodeDiscardExit;
73322
73496
  entry = {
@@ -79970,7 +80144,7 @@ const makeNoSerialization = /*#__PURE__*/ fnUntraced(function* (group, options)
79970
80144
  const concurrency = options.concurrency ?? "unbounded";
79971
80145
  const disableFatalDefects = options.disableFatalDefects ?? false;
79972
80146
  const services = yield* context();
79973
- const scope = get$13(services, Scope);
80147
+ const scope = get$14(services, Scope);
79974
80148
  const trackFiber = runIn(forkUnsafe(scope, "parallel"));
79975
80149
  const concurrencySemaphore = concurrency === "unbounded" ? void 0 : yield* make$82(concurrency);
79976
80150
  const clients = /* @__PURE__ */ new Map();
@@ -80211,7 +80385,7 @@ const rpcCodecs = (codecFor, rpc) => {
80211
80385
  let codecs = shared ? sharedRpcCodecs.get(rpc) : void 0;
80212
80386
  if (codecs === void 0) {
80213
80387
  const streamSchemas = getStreamSchemas(rpc.successSchema);
80214
- const parseOptions = get$13(rpc.annotations, ParseOptions);
80388
+ const parseOptions = get$14(rpc.annotations, ParseOptions);
80215
80389
  codecs = {
80216
80390
  decode: decodeUnknownEffect(codecFor(rpc.payloadSchema), parseOptions),
80217
80391
  encodeChunk: encodeUnknownEffect(codecFor(NonEmptyArray(isSome(streamSchemas) ? streamSchemas.value.success : Any)), parseOptions),
@@ -80349,7 +80523,7 @@ const make$21 = /*#__PURE__*/ fnUntraced(function* (group, options) {
80349
80523
  const exitSchema$1 = exitSchema(rpc);
80350
80524
  discardSchemas = {
80351
80525
  ...schemas,
80352
- encodeExit: encodeUnknownEffect(codecFor(Exit(Void, exitSchema$1.error, exitSchema$1.defect)), get$13(rpc.annotations, ParseOptions))
80526
+ encodeExit: encodeUnknownEffect(codecFor(Exit(Void, exitSchema$1.error, exitSchema$1.defect)), get$14(rpc.annotations, ParseOptions))
80353
80527
  };
80354
80528
  discardSchemasCache.set(rpc, discardSchemas);
80355
80529
  }
@@ -80929,7 +81103,7 @@ const runMiddleware = (handler, middleware, invocation, request) => {
80929
81103
  if (isSuccess$1(failure) && !hasDies(cause)) {
80930
81104
  const error = failure.success.error;
80931
81105
  if (isHidden(error)) return fail$6(error);
80932
- if (middleware.length === 0 || get$13(reasonAnnotations(failure.success), HandlerFailure)) return failCause$3(cause);
81106
+ if (middleware.length === 0 || get$14(reasonAnnotations(failure.success), HandlerFailure)) return failCause$3(cause);
80933
81107
  if (isMcpError(error)) return rejectWith(error);
80934
81108
  }
80935
81109
  return logError(cause).pipe(andThen(report(cause)), andThen(rejectWith(internalError)));
@@ -81009,7 +81183,7 @@ var McpServer = class McpServer extends (/*#__PURE__*/ Service$1()("effect/ai/Mc
81009
81183
  const queued = {
81010
81184
  notification,
81011
81185
  delivered,
81012
- requestLiveness: get$13(fiber.context, RequestLiveness),
81186
+ requestLiveness: get$14(fiber.context, RequestLiveness),
81013
81187
  requestContext: getOrUndefined(fiber.context, McpRequestContext),
81014
81188
  requestHeaders: getOrUndefined(fiber.context, HttpServerRequest)?.headers
81015
81189
  };
@@ -81019,7 +81193,7 @@ var McpServer = class McpServer extends (/*#__PURE__*/ Service$1()("effect/ai/Mc
81019
81193
  _tag: "Exit",
81020
81194
  exit: void_$3
81021
81195
  }));
81022
- const requestQueue = get$13(fiber.context, RequestNotificationQueue);
81196
+ const requestQueue = get$14(fiber.context, RequestNotificationQueue);
81023
81197
  if (requestQueue !== void 0 && queued.requestContext !== void 0 && isRequestNotification(notification)) {
81024
81198
  offerUnsafe(requestQueue, queued);
81025
81199
  return andThen(_await(delivered), acknowledge);
@@ -82077,7 +82251,7 @@ const registerToolkit = /*#__PURE__*/ fnUntraced(function* (toolkit) {
82077
82251
  const failure = findFail(cause);
82078
82252
  if (isSuccess$1(failure)) {
82079
82253
  const error = failure.success.error;
82080
- const origin = get$13(reasonAnnotations(failure.success), FailureOrigin);
82254
+ const origin = get$14(reasonAnnotations(failure.success), FailureOrigin);
82081
82255
  if (origin === "parameters" && isParameterValidationError(error)) return fail$6(new InvalidParams({ message: error.reason.message }));
82082
82256
  if (origin === "handler" && isDeclaredFailure(error)) return catchCause$2(declaredFailureResult(error), internalToolError);
82083
82257
  }
@@ -82092,10 +82266,10 @@ const registerToolkit = /*#__PURE__*/ fnUntraced(function* (toolkit) {
82092
82266
  outputSchema,
82093
82267
  annotations: {
82094
82268
  ...getOption(tool.annotations, Title).pipe(map$13((title) => ({ title })), getOrUndefined$1),
82095
- readOnlyHint: get$13(tool.annotations, Readonly),
82096
- destructiveHint: get$13(tool.annotations, Destructive),
82097
- idempotentHint: get$13(tool.annotations, Idempotent),
82098
- openWorldHint: get$13(tool.annotations, OpenWorld)
82269
+ readOnlyHint: get$14(tool.annotations, Readonly),
82270
+ destructiveHint: get$14(tool.annotations, Destructive),
82271
+ idempotentHint: get$14(tool.annotations, Idempotent),
82272
+ openWorldHint: get$14(tool.annotations, OpenWorld)
82099
82273
  },
82100
82274
  _meta: toolMeta
82101
82275
  });
@@ -84441,7 +84615,7 @@ const fromDuplex = (open, options) => withFiber((fiber) => {
84441
84615
  writer
84442
84616
  }));
84443
84617
  });
84444
- // ../../node_modules/.pnpm/ws@8.22.2/node_modules/ws/lib/constants.js
84618
+ // ../../node_modules/.pnpm/ws@8.23.0/node_modules/ws/lib/constants.js
84445
84619
  var require_constants = /* @__PURE__ */ __commonJSMin(((exports, module) => {
84446
84620
  const BINARY_TYPES = [
84447
84621
  "nodebuffer",
@@ -84463,7 +84637,7 @@ var require_constants = /* @__PURE__ */ __commonJSMin(((exports, module) => {
84463
84637
  NOOP: () => {}
84464
84638
  };
84465
84639
  }));
84466
- // ../../node_modules/.pnpm/ws@8.22.2/node_modules/ws/lib/buffer-util.js
84640
+ // ../../node_modules/.pnpm/ws@8.23.0/node_modules/ws/lib/buffer-util.js
84467
84641
  var require_buffer_util = /* @__PURE__ */ __commonJSMin(((exports, module) => {
84468
84642
  const { websocketMask, websocketUnmask } = __require("http");
84469
84643
  const { EMPTY_BUFFER } = require_constants();
@@ -84571,7 +84745,7 @@ var require_buffer_util = /* @__PURE__ */ __commonJSMin(((exports, module) => {
84571
84745
  };
84572
84746
  } catch (e) {}
84573
84747
  }));
84574
- // ../../node_modules/.pnpm/ws@8.22.2/node_modules/ws/lib/limiter.js
84748
+ // ../../node_modules/.pnpm/ws@8.23.0/node_modules/ws/lib/limiter.js
84575
84749
  var require_limiter = /* @__PURE__ */ __commonJSMin(((exports, module) => {
84576
84750
  const kDone = Symbol("kDone");
84577
84751
  const kRun = Symbol("kRun");
@@ -84621,7 +84795,7 @@ var require_limiter = /* @__PURE__ */ __commonJSMin(((exports, module) => {
84621
84795
  };
84622
84796
  module.exports = Limiter;
84623
84797
  }));
84624
- // ../../node_modules/.pnpm/ws@8.22.2/node_modules/ws/lib/permessage-deflate.js
84798
+ // ../../node_modules/.pnpm/ws@8.23.0/node_modules/ws/lib/permessage-deflate.js
84625
84799
  var require_permessage_deflate = /* @__PURE__ */ __commonJSMin(((exports, module) => {
84626
84800
  const zlib = __require("zlib");
84627
84801
  const bufferUtil = require_buffer_util();
@@ -84956,7 +85130,7 @@ var require_permessage_deflate = /* @__PURE__ */ __commonJSMin(((exports, module
84956
85130
  this[kCallback](err);
84957
85131
  }
84958
85132
  }));
84959
- // ../../node_modules/.pnpm/ws@8.22.2/node_modules/ws/lib/validation.js
85133
+ // ../../node_modules/.pnpm/ws@8.23.0/node_modules/ws/lib/validation.js
84960
85134
  var require_validation = /* @__PURE__ */ __commonJSMin(((exports, module) => {
84961
85135
  const { isUtf8 } = __require("buffer");
84962
85136
  const { hasBlob } = require_constants();
@@ -85151,7 +85325,7 @@ var require_validation = /* @__PURE__ */ __commonJSMin(((exports, module) => {
85151
85325
  };
85152
85326
  } catch (e) {}
85153
85327
  }));
85154
- // ../../node_modules/.pnpm/ws@8.22.2/node_modules/ws/lib/receiver.js
85328
+ // ../../node_modules/.pnpm/ws@8.23.0/node_modules/ws/lib/receiver.js
85155
85329
  var require_receiver = /* @__PURE__ */ __commonJSMin(((exports, module) => {
85156
85330
  const { Writable } = __require("stream");
85157
85331
  const PerMessageDeflate = require_permessage_deflate();
@@ -85614,7 +85788,7 @@ var require_receiver = /* @__PURE__ */ __commonJSMin(((exports, module) => {
85614
85788
  };
85615
85789
  module.exports = Receiver;
85616
85790
  }));
85617
- // ../../node_modules/.pnpm/ws@8.22.2/node_modules/ws/lib/sender.js
85791
+ // ../../node_modules/.pnpm/ws@8.23.0/node_modules/ws/lib/sender.js
85618
85792
  var require_sender = /* @__PURE__ */ __commonJSMin(((exports, module) => {
85619
85793
  const { Duplex } = __require("stream");
85620
85794
  const { randomFillSync } = __require("crypto");
@@ -86112,7 +86286,7 @@ var require_sender = /* @__PURE__ */ __commonJSMin(((exports, module) => {
86112
86286
  sender.onerror(err);
86113
86287
  }
86114
86288
  }));
86115
- // ../../node_modules/.pnpm/ws@8.22.2/node_modules/ws/lib/event-target.js
86289
+ // ../../node_modules/.pnpm/ws@8.23.0/node_modules/ws/lib/event-target.js
86116
86290
  var require_event_target = /* @__PURE__ */ __commonJSMin(((exports, module) => {
86117
86291
  const { kForOnEventAttribute, kListener } = require_constants();
86118
86292
  const kCode = Symbol("kCode");
@@ -86342,7 +86516,7 @@ var require_event_target = /* @__PURE__ */ __commonJSMin(((exports, module) => {
86342
86516
  else listener.call(thisArg, event);
86343
86517
  }
86344
86518
  }));
86345
- // ../../node_modules/.pnpm/ws@8.22.2/node_modules/ws/lib/extension.js
86519
+ // ../../node_modules/.pnpm/ws@8.23.0/node_modules/ws/lib/extension.js
86346
86520
  var require_extension = /* @__PURE__ */ __commonJSMin(((exports, module) => {
86347
86521
  const { tokenChars } = require_validation();
86348
86522
  /**
@@ -86487,7 +86661,7 @@ var require_extension = /* @__PURE__ */ __commonJSMin(((exports, module) => {
86487
86661
  parse
86488
86662
  };
86489
86663
  }));
86490
- // ../../node_modules/.pnpm/ws@8.22.2/node_modules/ws/lib/websocket.js
86664
+ // ../../node_modules/.pnpm/ws@8.23.0/node_modules/ws/lib/websocket.js
86491
86665
  var require_websocket = /* @__PURE__ */ __commonJSMin(((exports, module) => {
86492
86666
  const EventEmitter = __require("events");
86493
86667
  const https = __require("https");
@@ -86560,12 +86734,15 @@ var require_websocket = /* @__PURE__ */ __commonJSMin(((exports, module) => {
86560
86734
  else protocols = [options.protocols];
86561
86735
  } else protocols = [protocols];
86562
86736
  }
86563
- initAsClient(this, address, protocols, options);
86564
- } else {
86565
- this._autoPong = options.autoPong;
86566
- this._closeTimeout = options.closeTimeout;
86567
- this._isServer = true;
86737
+ options = initAsClient(this, address, protocols, options);
86738
+ } else this._isServer = true;
86739
+ if (options.autoPong) {
86740
+ this._autoPong = true;
86741
+ this._autoPongComplete = () => autoPongComplete(this);
86742
+ this._pendingAutoPongs = 0;
86743
+ this._maxPendingAutoPongs = options.maxPendingAutoPongs | 0;
86568
86744
  }
86745
+ this._closeTimeout = options.closeTimeout;
86569
86746
  }
86570
86747
  /**
86571
86748
  * For historical reasons, the custom "nodebuffer" type is used by the default
@@ -87006,6 +87183,8 @@ var require_websocket = /* @__PURE__ */ __commonJSMin(((exports, module) => {
87006
87183
  * fragments
87007
87184
  * @param {Number} [options.maxPayload=104857600] The maximum allowed message
87008
87185
  * size
87186
+ * @param {Number} [options.maxPendingAutoPongs=60] The maximum number of
87187
+ * pending automatic pongs
87009
87188
  * @param {Number} [options.maxRedirects=10] The maximum number of redirects
87010
87189
  * allowed
87011
87190
  * @param {String} [options.origin] Value of the `Origin` or
@@ -87016,6 +87195,7 @@ var require_websocket = /* @__PURE__ */ __commonJSMin(((exports, module) => {
87016
87195
  * `Sec-WebSocket-Version` header
87017
87196
  * @param {Boolean} [options.skipUTF8Validation=false] Specifies whether or
87018
87197
  * not to skip UTF-8 validation for text and close messages
87198
+ * @return {Object} The resolved options object used for initialization
87019
87199
  * @private
87020
87200
  */
87021
87201
  function initAsClient(websocket, address, protocols, options) {
@@ -87027,6 +87207,7 @@ var require_websocket = /* @__PURE__ */ __commonJSMin(((exports, module) => {
87027
87207
  maxBufferedChunks: 262144,
87028
87208
  maxFragments: 16384,
87029
87209
  maxPayload: 104857600,
87210
+ maxPendingAutoPongs: 60,
87030
87211
  skipUTF8Validation: false,
87031
87212
  perMessageDeflate: true,
87032
87213
  followRedirects: false,
@@ -87042,8 +87223,6 @@ var require_websocket = /* @__PURE__ */ __commonJSMin(((exports, module) => {
87042
87223
  path: void 0,
87043
87224
  port: void 0
87044
87225
  };
87045
- websocket._autoPong = opts.autoPong;
87046
- websocket._closeTimeout = opts.closeTimeout;
87047
87226
  if (!protocolVersions.includes(opts.protocolVersion)) throw new RangeError(`Unsupported protocol version: ${opts.protocolVersion} (supported versions: ${protocolVersions.join(", ")})`);
87048
87227
  let parsedUrl;
87049
87228
  if (address instanceof URL) parsedUrl = address;
@@ -87233,6 +87412,7 @@ var require_websocket = /* @__PURE__ */ __commonJSMin(((exports, module) => {
87233
87412
  });
87234
87413
  if (opts.finishRequest) opts.finishRequest(req, websocket);
87235
87414
  else req.end();
87415
+ return opts;
87236
87416
  }
87237
87417
  /**
87238
87418
  * Emit the `'error'` and `'close'` events.
@@ -87389,10 +87569,25 @@ var require_websocket = /* @__PURE__ */ __commonJSMin(((exports, module) => {
87389
87569
  */
87390
87570
  function receiverOnPing(data) {
87391
87571
  const websocket = this[kWebSocket];
87392
- if (websocket._autoPong) websocket.pong(data, !this._isServer, NOOP);
87572
+ if (websocket._autoPong && websocket.readyState === WebSocket.OPEN) {
87573
+ if (websocket._maxPendingAutoPongs > 0 && websocket._pendingAutoPongs >= websocket._maxPendingAutoPongs) websocket.terminate();
87574
+ else {
87575
+ websocket._pendingAutoPongs++;
87576
+ websocket.pong(data, !this._isServer, websocket._autoPongComplete);
87577
+ }
87578
+ }
87393
87579
  websocket.emit("ping", data);
87394
87580
  }
87395
87581
  /**
87582
+ * The callback for automatic pong responses.
87583
+ *
87584
+ * @param {WebSocket} websocket The WebSocket instance
87585
+ * @private
87586
+ */
87587
+ function autoPongComplete(websocket) {
87588
+ websocket._pendingAutoPongs--;
87589
+ }
87590
+ /**
87396
87591
  * The listener of the `Receiver` `'pong'` event.
87397
87592
  *
87398
87593
  * @param {Buffer} data The data included in the pong frame
@@ -87497,7 +87692,7 @@ var require_websocket = /* @__PURE__ */ __commonJSMin(((exports, module) => {
87497
87692
  }
87498
87693
  }
87499
87694
  }));
87500
- // ../../node_modules/.pnpm/ws@8.22.2/node_modules/ws/lib/stream.js
87695
+ // ../../node_modules/.pnpm/ws@8.23.0/node_modules/ws/lib/stream.js
87501
87696
  var require_stream = /* @__PURE__ */ __commonJSMin(((exports, module) => {
87502
87697
  require_websocket();
87503
87698
  const { Duplex } = __require("stream");
@@ -87612,7 +87807,7 @@ var require_stream = /* @__PURE__ */ __commonJSMin(((exports, module) => {
87612
87807
  }
87613
87808
  module.exports = createWebSocketStream;
87614
87809
  }));
87615
- // ../../node_modules/.pnpm/ws@8.22.2/node_modules/ws/lib/subprotocol.js
87810
+ // ../../node_modules/.pnpm/ws@8.23.0/node_modules/ws/lib/subprotocol.js
87616
87811
  var require_subprotocol = /* @__PURE__ */ __commonJSMin(((exports, module) => {
87617
87812
  const { tokenChars } = require_validation();
87618
87813
  /**
@@ -87650,7 +87845,7 @@ var require_subprotocol = /* @__PURE__ */ __commonJSMin(((exports, module) => {
87650
87845
  }
87651
87846
  module.exports = { parse };
87652
87847
  }));
87653
- // ../../node_modules/.pnpm/ws@8.22.2/node_modules/ws/lib/websocket-server.js
87848
+ // ../../node_modules/.pnpm/ws@8.23.0/node_modules/ws/lib/websocket-server.js
87654
87849
  var require_websocket_server = /* @__PURE__ */ __commonJSMin(((exports, module) => {
87655
87850
  const EventEmitter = __require("events");
87656
87851
  const http = __require("http");
@@ -87695,6 +87890,8 @@ var require_websocket_server = /* @__PURE__ */ __commonJSMin(((exports, module)
87695
87890
  * fragments
87696
87891
  * @param {Number} [options.maxPayload=104857600] The maximum allowed message
87697
87892
  * size
87893
+ * @param {Number} [options.maxPendingAutoPongs=60] The maximum number of
87894
+ * pending automatic pongs
87698
87895
  * @param {Boolean} [options.noServer=false] Enable no server mode
87699
87896
  * @param {String} [options.path] Accept only connections matching this path
87700
87897
  * @param {(Boolean|Object)} [options.perMessageDeflate=false] Enable/disable
@@ -87717,6 +87914,7 @@ var require_websocket_server = /* @__PURE__ */ __commonJSMin(((exports, module)
87717
87914
  maxBufferedChunks: 262144,
87718
87915
  maxFragments: 16384,
87719
87916
  maxPayload: 104857600,
87917
+ maxPendingAutoPongs: 60,
87720
87918
  skipUTF8Validation: false,
87721
87919
  perMessageDeflate: false,
87722
87920
  handleProtocols: null,
@@ -93831,7 +94029,7 @@ const Formatter = /*#__PURE__*/ Reference("effect/cli/CliOutput", { defaultValue
93831
94029
  */
93832
94030
  const defaultPresenter = { present: /*#__PURE__*/ fnUntraced(function* (event) {
93833
94031
  const context$2 = yield* context();
93834
- const formatter = getOrUndefined(context$2, Formatter) ?? defaultFormatter({ colors: get$13(context$2, TerminalCapabilities).canColor });
94032
+ const formatter = getOrUndefined(context$2, Formatter) ?? defaultFormatter({ colors: get$14(context$2, TerminalCapabilities).canColor });
93835
94033
  switch (event._tag) {
93836
94034
  case "Help": return yield* log(formatter.formatHelpDoc(event.helpDoc));
93837
94035
  case "InvalidInvocation":
@@ -96253,7 +96451,7 @@ const defaults = { builtIns: BuiltIns };
96253
96451
  *
96254
96452
  * @internal
96255
96453
  */
96256
- const resolveFormatter = /*#__PURE__*/ contextWith((context) => succeed$5(getOrUndefined(context, Formatter) ?? defaultFormatter({ colors: get$13(context, TerminalCapabilities).canColor })));
96454
+ const resolveFormatter = /*#__PURE__*/ contextWith((context) => succeed$5(getOrUndefined(context, Formatter) ?? defaultFormatter({ colors: get$14(context, TerminalCapabilities).canColor })));
96257
96455
  // ../../node_modules/.pnpm/effect@4.1.4/node_modules/effect/dist/cli/internal/lexer.js
96258
96456
  /**
96259
96457
  * @internal
@@ -98038,7 +98236,7 @@ const toInternalServerError = (request, cause) => new HttpServerError({ reason:
98038
98236
  request,
98039
98237
  cause
98040
98238
  }) });
98041
- const handlePlatformError = (request, self) => catchIf(self, (error) => error.reason._tag === "NotFound", () => fail$6(toRouteNotFoundError(request)), (error) => fail$6(toInternalServerError(request, error)));
98239
+ const handlePlatformError = (request, self) => catchIf$2(self, (error) => error.reason._tag === "NotFound", () => fail$6(toRouteNotFoundError(request)), (error) => fail$6(toInternalServerError(request, error)));
98042
98240
  const acceptsHtml = (accept) => accept !== void 0 && accept.toLowerCase().includes("text/html");
98043
98241
  const stripWeakEtagPrefix = (value) => {
98044
98242
  const trimmed = value.trim();
@@ -105971,7 +106169,7 @@ const prepareTools$1 = /*#__PURE__*/ fnUntraced(function* ({ betas, capabilities
105971
106169
  input_schema,
105972
106170
  ...isNotUndefined(description) ? { description } : void 0,
105973
106171
  ...isNotUndefined(strict) ? { strict } : void 0,
105974
- ...get$13(tool.annotations, DeferLoading) ? { defer_loading: true } : void 0
106172
+ ...get$14(tool.annotations, DeferLoading) ? { defer_loading: true } : void 0
105975
106173
  });
105976
106174
  if (capabilities.supportsStructuredOutput === true) betas.add("structured-outputs-2025-11-13");
105977
106175
  }
@@ -110763,10 +110961,10 @@ const layerFlusher = /*#__PURE__*/ sync$1(Flusher, () => {
110763
110961
  */
110764
110962
  const make$5 = /*#__PURE__*/ fnUntraced(function* (options) {
110765
110963
  const services = yield* context();
110766
- const clock = get$13(services, Clock);
110767
- const scope = get$13(services, Scope);
110964
+ const clock = get$14(services, Clock);
110965
+ const scope = get$14(services, Scope);
110768
110966
  const exportInterval = max$1(fromInputUnsafe$1(options.exportInterval), zero$2);
110769
- const client = get$13(services, HttpClient).pipe(tap((response) => ignore$1(response.arrayBuffer)), tapError((error) => error.response ? ignore$1(error.response.arrayBuffer) : void_$2), filterStatusOk, transformResponse(provideService$2(TracerPropagationEnabled, false)), retryTransient({
110967
+ const client = get$14(services, HttpClient).pipe(tap((response) => ignore$1(response.arrayBuffer)), tapError((error) => error.response ? ignore$1(error.response.arrayBuffer) : void_$2), filterStatusOk, transformResponse(provideService$2(TracerPropagationEnabled, false)), retryTransient({
110770
110968
  schedule: policy,
110771
110969
  times: 3
110772
110970
  }));
@@ -111437,7 +111635,20 @@ const layerRoutes = use((router) => gen(function* () {
111437
111635
  if (isFailure$1(account)) return empty$1(failureOptions(account.failure, 401));
111438
111636
  return yield* schemaJson(Account)(account.success, { headers: { "cache-control": "no-store" } });
111439
111637
  }));
111440
- for (const origin of toArray(issuer)) for (const step of ["sign-in", "sign-out"]) yield* router.add("GET", `/auth/${step}`, map$7(HttpServerRequest, (request) => redirect(`${new URL(`/${step}`, origin).href}?${new URLSearchParams({ next: new URL(request.url, "http://local").searchParams.get("next") ?? canonical })}`)));
111638
+ for (const origin of toArray(issuer)) {
111639
+ yield* router.add("GET", "/auth/sign-in", map$7(HttpServerRequest, (request) => redirect(`${new URL("/sign-in", origin).href}?${new URLSearchParams({ next: new URL(request.url, "http://local").searchParams.get("next") ?? canonical })}`)));
111640
+ const client = yield* HttpClient;
111641
+ yield* router.add("POST", "/auth/sign-out", gen(function* () {
111642
+ const request = yield* HttpServerRequest;
111643
+ if (request.headers["origin"] !== new URL(canonical).origin) return text("Invalid sign-out origin; no changes committed", { status: 403 });
111644
+ const target = new URL("/sign-out", origin);
111645
+ target.search = new URLSearchParams({ next: new URL(request.url, canonical).searchParams.get("next") ?? canonical }).toString();
111646
+ return yield* pipe(client.post(target.href, { headers: {
111647
+ cookie: request.headers["cookie"] ?? "",
111648
+ origin: new URL(origin).origin
111649
+ } }), provideService$2(RequestInit, { redirect: "manual" }), timeout("10 seconds"), map$7(fromClientResponse), tapError$3(() => logWarning("Auth did not confirm sign-out")), catch_$2(() => succeed$5(text("Auth sign-out was not confirmed; the shared session may remain", { status: 503 }))));
111650
+ }));
111651
+ }
111441
111652
  }));
111442
111653
  function layerIcon(icon) {
111443
111654
  const response = succeed$5(text(icon, {
@@ -111595,7 +111806,7 @@ const make$1 = (options) => gen(function* () {
111595
111806
  timeToLive: (exit) => isSuccess(exit) ? prepareCacheTTL : zero$2
111596
111807
  });
111597
111808
  const runStatement = (statement, params, raw) => withFiber((fiber) => {
111598
- const useSafeIntegers = get$13(fiber.context, SafeIntegers);
111809
+ const useSafeIntegers = get$14(fiber.context, SafeIntegers);
111599
111810
  return try_({
111600
111811
  try: () => {
111601
111812
  statement.setReadBigInts(useSafeIntegers);
@@ -111610,7 +111821,7 @@ const make$1 = (options) => gen(function* () {
111610
111821
  });
111611
111822
  });
111612
111823
  const runStatementValues = (statement, params) => withFiber((fiber) => {
111613
- const useSafeIntegers = get$13(fiber.context, SafeIntegers);
111824
+ const useSafeIntegers = get$14(fiber.context, SafeIntegers);
111614
111825
  return try_({
111615
111826
  try: () => {
111616
111827
  statement.setReadBigInts(useSafeIntegers);
@@ -111620,7 +111831,7 @@ const make$1 = (options) => gen(function* () {
111620
111831
  });
111621
111832
  });
111622
111833
  const runStatementValuesUnprepared = (statement, params) => withFiber((fiber) => {
111623
- const useSafeIntegers = get$13(fiber.context, SafeIntegers);
111834
+ const useSafeIntegers = get$14(fiber.context, SafeIntegers);
111624
111835
  return try_({
111625
111836
  try: () => {
111626
111837
  statement.setReadBigInts(useSafeIntegers);
@@ -111767,6 +111978,7 @@ const dataDirectory = gen(function* () {
111767
111978
  mode: 448,
111768
111979
  recursive: true
111769
111980
  });
111981
+ yield* (yield* FileSystem).chmod(directory, 448);
111770
111982
  return directory;
111771
111983
  });
111772
111984
  const retiredSessions = effectDiscard(make$18({})({
@@ -112147,7 +112359,7 @@ function runApp(app) {
112147
112359
  return pipe(String$1(setting.flag), withSchema(setting.schema), withFallbackConfig(schema$1(setting.schema, env)), withDescription(`${setting.description} [${env}]`), optional);
112148
112360
  }));
112149
112361
  const given = map$7(root, (input) => getSomes$1(input));
112150
- return yield* pipe(root, withHandler((input) => flatMap$3(configProvider(getSomes$1(input), metadata.config.port), (values) => provideService$2(server(app), ConfigProvider, values))), withSubcommands([withSubcommands(make$12("service"), [
112362
+ return yield* pipe(root, withHandler((input) => provideServiceEffect(server(app), ConfigProvider, configProvider(getSomes$1(input), metadata.config.port))), withSubcommands([withSubcommands(make$12("service"), [
112151
112363
  make$12("install", {}, fnUntraced(function* () {
112152
112364
  const fs = yield* FileSystem;
112153
112365
  const path = yield* Path$1;
@@ -112841,7 +113053,7 @@ function caddyConfig(rows, storage) {
112841
113053
  return `{\n\tadmin 127.0.0.1:20219\n\tgrace_period 10s\n\tpersist_config off\n\tstorage file_system {\n\t\troot ${encodeSync(fromJsonString(String$6))(storage)}\n\t}\n}\n\n${pipe(rows, filter$5((row) => row.kind === "public"), map$10((row) => `${row.hostname} {\n\tencode\n\treverse_proxy 127.0.0.1:${row.port}\n}\n`), join$4("\n"))}`;
112842
113054
  }
112843
113055
  function ownsMapping(status, row) {
112844
- return !exists(status.AllowFunnel, (permissions) => permissions[`${row.hostname}:${row.port}`] === true) && pipe(status.Web, flatMap$8(get$12(`${row.hostname}:${row.port}`)), exists((value) => size$4(value.Handlers) === 1 && pipe(value.Handlers, get$12("/"), flatMap$8((handler) => handler.Proxy), exists((proxy) => proxy === `http://127.0.0.1:${row.port}`))));
113056
+ return !exists(status.AllowFunnel, (permissions) => permissions[`${row.hostname}:${row.port}`] === true) && pipe(status.Web, flatMap$8(get$13(`${row.hostname}:${row.port}`)), exists((value) => size$4(value.Handlers) === 1 && pipe(value.Handlers, get$13("/"), flatMap$8((handler) => handler.Proxy), exists((proxy) => proxy === `http://127.0.0.1:${row.port}`))));
112845
113057
  }
112846
113058
  function exposureUrl(row) {
112847
113059
  if (row.kind === "tailnet") return `https://${row.hostname}:${row.port}`;
@@ -112954,7 +113166,7 @@ var Exposures = class extends Service$1()("@deslop/deploy/services/exposures/ser
112954
113166
  if (some(current, (row) => row.name === input.name)) return yield* DeployError.make({ message: "Remove the existing owned exposure before changing it" });
112955
113167
  if (some(current, (row) => row.hostname === input.hostname && (row.kind === "public" || row.port === input.port))) return yield* DeployError.make({ message: "This hostname or port already has an owned exposure" });
112956
113168
  if (input.kind === "public" && !input.publicAccess) return yield* DeployError.make({ message: "Explicitly confirm public access before publishing a port" });
112957
- if (input.kind === "public" && platform !== "linux") return yield* DeployError.make({ message: "Public exposure needs a Linux worker; expose this port to the tailnet" });
113169
+ if (input.kind === "public" && (platform !== "linux" || arch !== "x64")) return yield* DeployError.make({ message: "Public exposure needs a Linux x64 worker; expose this port to the tailnet" });
112958
113170
  const exposure = Exposure.make(omit(input, ["publicAccess"]));
112959
113171
  if (exposure.kind === "tailnet") yield* checkTailnet(exposure);
112960
113172
  yield* asStorageDeployError(insertExposure(exposure));
@@ -113211,7 +113423,7 @@ function alias(value$4) {
113211
113423
  return pipe(value(value$4), when("vite-plus", constant("vp")), orElse(() => value$4));
113212
113424
  }
113213
113425
  function shellRest(tokens) {
113214
- const script = pipe(tokens, get$11(2), getOrElse$1(constant("")));
113426
+ const script = pipe(tokens, get$12(2), getOrElse$1(constant("")));
113215
113427
  const shifts = match$8(match$2(/\bshift\b/gu)(script), {
113216
113428
  onNone: constant(0),
113217
113429
  onSome: (matches) => matches.length
@@ -113232,11 +113444,11 @@ function unwrapTokens(tokens, cwd) {
113232
113444
  },
113233
113445
  onSome: (index) => drop$1(tokens, index + 1)
113234
113446
  })), cwd);
113235
- if (contains$1(SHELLS, name) && pipe(tokens, get$11(1), getOrElse$1(constant(""))) === "-c") return unwrapTokens(shellRest(tokens), cwd);
113447
+ if (contains$1(SHELLS, name) && pipe(tokens, get$12(1), getOrElse$1(constant(""))) === "-c") return unwrapTokens(shellRest(tokens), cwd);
113236
113448
  if (contains$1(RUNTIMES, name)) return pipe(tokens, findFirstIndex((token, index) => index > 0 && !isFlag(token)), match$8({
113237
113449
  onNone: () => tokens,
113238
113450
  onSome: (index) => {
113239
- const script = pipe(tokens, get$11(index), getOrElse$1(constant("")));
113451
+ const script = pipe(tokens, get$12(index), getOrElse$1(constant("")));
113240
113452
  const pkg = capture(/.*node_modules\/((?:@[^/]+\/)?[^/.][^/]*)\//u, script);
113241
113453
  const app = orElse$3(capture(/\.deslop\/([^/]+)\//u, script), () => flatMap$8(cwd, (value) => capture(/\/apps\/([^/]+)$/u, value)));
113242
113454
  return [pipe(pkg, orElse$3(() => app), getOrElse$1(() => basename(script))), ...drop$1(tokens, index + 1)];
@@ -113261,7 +113473,7 @@ function scan(name, subject, args, words, values) {
113261
113473
  onSome: (token) => {
113262
113474
  if (isFlag(token)) {
113263
113475
  const parsed = flagParts(token);
113264
- const next = pipe(args, get$11(1), filter$7((value) => !isFlag(value)));
113476
+ const next = pipe(args, get$12(1), filter$7((value) => !isFlag(value)));
113265
113477
  const value = orElse$3(parsed.inline, () => next);
113266
113478
  return scan(name, subject, match(isNone(parsed.inline) && isSome(next), {
113267
113479
  onFalse: () => drop$1(args, 1),
@@ -113297,7 +113509,7 @@ function scan(name, subject, args, words, values) {
113297
113509
  function commandLabel(argv, cwd) {
113298
113510
  const [head = "", ...args] = unwrap(argv, cwd);
113299
113511
  const name = alias(basename(head));
113300
- const subject = pipe(SUBJECT, get$12(name), getOrElse$1(() => empty$15()));
113512
+ const subject = pipe(SUBJECT, get$13(name), getOrElse$1(() => empty$15()));
113301
113513
  const scanned = scan(name, subject, args, [], {});
113302
113514
  if (contains$1(SHELLS, name) && isReadonlyArrayEmpty(scanned.words)) return {
113303
113515
  detail: pipe(cwd, map$13(basename), getOrElse$1(constant(""))),
@@ -113305,7 +113517,7 @@ function commandLabel(argv, cwd) {
113305
113517
  };
113306
113518
  return match$8(scanned.ssh, {
113307
113519
  onNone: () => ({
113308
- detail: join$4([...take$3(scanned.words, 2), ...filter$5(getSomes(map$10(subject, (flag) => get$12(scanned.values, flag))), isNonEmpty$1)], " "),
113520
+ detail: join$4([...take$3(scanned.words, 2), ...filter$5(getSomes(map$10(subject, (flag) => get$13(scanned.values, flag))), isNonEmpty$1)], " "),
113309
113521
  name
113310
113522
  }),
113311
113523
  onSome: (ssh) => {
@@ -113325,7 +113537,7 @@ function sourceBelongsToWorker(source, worker) {
113325
113537
  return source.name === worker || startsWith(`${worker} · `)(source.name);
113326
113538
  }
113327
113539
  function processOwner(cgroup) {
113328
- const container = pipe(cgroup, match$2(/\/(?:docker-|docker\/)([a-f0-9]{12,64})(?:\.scope)?(?:\/|\n|$)/u), flatMap$8((match) => get$11(match, 1)));
113540
+ const container = pipe(cgroup, match$2(/\/(?:docker-|docker\/)([a-f0-9]{12,64})(?:\.scope)?(?:\/|\n|$)/u), flatMap$8((match) => get$12(match, 1)));
113329
113541
  if (isSome(container)) return map$13(container, (id) => AppId.make(`container:${slice(0, 12)(id)}`));
113330
113542
  const segments = split$1(cgroup, /[/\n]/u);
113331
113543
  const service = findLastIndex(segments, endsWith(".service"));
@@ -113398,7 +113610,7 @@ function workloads(items) {
113398
113610
  const attached = filter$5(byUnit[item.worker]?.[`unit:${unit}`] ?? [], (listener) => contains$2(listener.unit, unit));
113399
113611
  const bindings = pipe(item.bindings, getOrElse$1(empty$15), map$10((binding) => ({
113400
113612
  ...item,
113401
- ...pipe(get$8(bySocket, socket(item.worker, {
113613
+ ...pipe(get$9(bySocket, socket(item.worker, {
113402
113614
  address: some$1(binding.address),
113403
113615
  port: some$1(binding.port),
113404
113616
  protocol: some$1(binding.protocol)
@@ -113514,7 +113726,7 @@ function processTree(rows) {
113514
113726
  const visited = empty$5();
113515
113727
  function build(row) {
113516
113728
  add$1(visited, row.pid);
113517
- const below = pipe(get$12(children, `${row.pid}`), getOrElse$1(empty$15), filter$5((child) => !has(visited, child.pid)), map$10(build));
113729
+ const below = pipe(get$13(children, `${row.pid}`), getOrElse$1(empty$15), filter$5((child) => !has(visited, child.pid)), map$10(build));
113518
113730
  const self = {
113519
113731
  children: [],
113520
113732
  command: row.command,
@@ -113671,7 +113883,7 @@ function processStatus(status) {
113671
113883
  return [slice(0, at)(line), trim(slice(at + 1)(line))];
113672
113884
  }));
113673
113885
  function field(name) {
113674
- return pipe(get$12(values, name), filter$7(isNonEmpty$1), getOrUndefined$1);
113886
+ return pipe(get$13(values, name), filter$7(isNonEmpty$1), getOrUndefined$1);
113675
113887
  }
113676
113888
  return {
113677
113889
  memory: decodeSync(ResidentMemoryFromKiB)(split$1(values["VmRSS"] ?? "", /\s+/u)[0] || "0"),
@@ -113744,7 +113956,7 @@ function processUsage(current, previous) {
113744
113956
  });
113745
113957
  const process = {
113746
113958
  ...record.process,
113747
- cpu: pipe(get$8(known, record.process.pid), filter$7((value) => equals$1(value.start, record.start) && isGreaterThan$3(elapsed, zero$2) && isGreaterThanOrEqualTo$3(record.ticks, value.ticks) && exists(previous, (old) => pipe(old.time, distance(current.time), isGreaterThanOrEqualTo$3(PROCESS_INTERVAL)) && pipe(old.time, distance(current.time), isLessThanOrEqualTo$3(seconds(90))))), map$13((value) => clamp(toMillis(subtract(record.ticks, value.ticks)) / toMillis(elapsed) * 100, {
113959
+ cpu: pipe(get$9(known, record.process.pid), filter$7((value) => equals$1(value.start, record.start) && isGreaterThan$3(elapsed, zero$2) && isGreaterThanOrEqualTo$3(record.ticks, value.ticks) && exists(previous, (old) => pipe(old.time, distance(current.time), isGreaterThanOrEqualTo$3(PROCESS_INTERVAL)) && pipe(old.time, distance(current.time), isLessThanOrEqualTo$3(seconds(90))))), map$13((value) => clamp(toMillis(subtract(record.ticks, value.ticks)) / toMillis(elapsed) * 100, {
113748
113960
  maximum: 100,
113749
113961
  minimum: 0
113750
113962
  })))
@@ -113776,7 +113988,7 @@ function launchdProcesses(text, agents) {
113776
113988
  function agent(pid, visited = empty$5()) {
113777
113989
  if (has(visited, pid)) return none();
113778
113990
  add$1(visited, pid);
113779
- return pipe(agents, get$8(pid), orElse$3(() => pipe(parents, get$8(pid), flatMap$8((parent) => agent(parent, visited)))));
113991
+ return pipe(agents, get$9(pid), orElse$3(() => pipe(parents, get$9(pid), flatMap$8((parent) => agent(parent, visited)))));
113780
113992
  }
113781
113993
  return getSomes(map$10(rows, (row) => flatMap$8(agent(row.pid), (unit) => map$13(all$4({
113782
113994
  start: make$78(row.start),
@@ -113951,7 +114163,7 @@ function portItems(sockets, worker, http, source) {
113951
114163
  }];
113952
114164
  }), { concurrency: 8 })));
113953
114165
  return yield* forEach$1(sockets, fnUntraced(function* (socket) {
113954
- const origin = flatMap$8(socket.process, (process) => get$8(metadata, process.pid));
114166
+ const origin = flatMap$8(socket.process, (process) => get$9(metadata, process.pid));
113955
114167
  const unit = flatMap$8(origin, (process) => process.unit);
113956
114168
  const process = flatMap$8(socket.process, (match) => {
113957
114169
  if (!startsWith("node")(match.name)) return liftPredicate(match.name, isNonEmpty$1);
@@ -114076,7 +114288,7 @@ var Inventory = class extends Service$1()("@deslop/deploy/services/inventory/ser
114076
114288
  return map$10(listed.rows, (row) => InventoryItem.make({
114077
114289
  active: row.active === "active",
114078
114290
  detail: `${scope} · ${row.description}`,
114079
- failure: get$12(failures, row.unit),
114291
+ failure: get$13(failures, row.unit),
114080
114292
  health: match(row.active === "failed", {
114081
114293
  onFalse: constant("quiet"),
114082
114294
  onTrue: constant("error")
@@ -114084,9 +114296,9 @@ var Inventory = class extends Service$1()("@deslop/deploy/services/inventory/ser
114084
114296
  id: ItemId.make(`${worker}:${scope}:${row.unit}`),
114085
114297
  kind: "service",
114086
114298
  name: row.unit,
114087
- next: flatten$6(get$8(scheduled, row.unit)),
114299
+ next: flatten$6(get$9(scheduled, row.unit)),
114088
114300
  running: row.active === "activating" || row.active === "deactivating" || row.active === "active" && row.sub === "running",
114089
- scheduled: pipe(scheduled, get$8(row.unit), map$13(constTrue)),
114301
+ scheduled: pipe(scheduled, get$9(row.unit), map$13(constTrue)),
114090
114302
  scope: some$1(scope),
114091
114303
  state: match(row.active === "active", {
114092
114304
  onFalse: () => `${row.active} · ${row.sub}`,
@@ -114223,7 +114435,7 @@ var Inventory = class extends Service$1()("@deslop/deploy/services/inventory/ser
114223
114435
  }
114224
114436
  const records = map$12(launchd.table, (text) => {
114225
114437
  const agents = fromIterable$5(map$10(apps, (app) => [app.pid, app.label]));
114226
- return filter$5(launchdProcesses(text, agents), (record) => record.process.pid === selfProcess || !pipe(agents, get$8(selfProcess), contains$2(record.unit)));
114438
+ return filter$5(launchdProcesses(text, agents), (record) => record.process.pid === selfProcess || !pipe(agents, get$9(selfProcess), contains$2(record.unit)));
114227
114439
  });
114228
114440
  const owned = getOrElse(records, empty$15);
114229
114441
  return {
@@ -114416,7 +114628,7 @@ const SERIES = {
114416
114628
  function counters(stat, uptime, time) {
114417
114629
  const values = decodeSync(CpuCounters)(pipe(stat, split$1("\n"), head, getOrElse$1(constant("")), trim, split$1(/\s+/u), drop$1(1), take$3(8)));
114418
114630
  return {
114419
- cpuIdle: millis((getOrThrow$1(get$11(values, 3)) + getOrThrow$1(get$11(values, 4))) * 10),
114631
+ cpuIdle: millis((getOrThrow$1(get$12(values, 3)) + getOrThrow$1(get$12(values, 4))) * 10),
114420
114632
  cpuTotal: millis(sumAll(values) * 10),
114421
114633
  time,
114422
114634
  uptime: seconds(decodeSync(FiniteFromString)(split$1(uptime, " ")[0]))
@@ -114443,7 +114655,7 @@ function cpuCounters(cpus, uptime, time) {
114443
114655
  }
114444
114656
  function vmStatMemory(text, total) {
114445
114657
  const pages = fromEntries(getSomes(pipe(text, split$1("\n"), map$10((line) => map$13(match$2(/^"?([^":]+)"?:\s+([0-9]+)\.$/u)(trim(line)), (match) => [match[1] ?? "", match[2] ?? ""])))));
114446
- const page = decodeUnknownSync(FiniteFromString)(pipe(match$2(/page size of ([0-9]+) bytes/u)(text), flatMap$8(get$11(1)), getOrUndefined$1));
114658
+ const page = decodeUnknownSync(FiniteFromString)(pipe(match$2(/page size of ([0-9]+) bytes/u)(text), flatMap$8(get$12(1)), getOrUndefined$1));
114447
114659
  const counts = decodeUnknownSync(VmStatPages)(pages);
114448
114660
  return {
114449
114661
  total,
@@ -114590,7 +114802,7 @@ function history(samples, minutes, now) {
114590
114802
  function bandName(id, labels) {
114591
114803
  if (id === "other") return "Low impact";
114592
114804
  if (id === "system") return "System";
114593
- return pipe(labels, get$12(id), getOrElse$1(() => replaceAll(/^service:[a-z]+:(?:deslop-)?|\.service$/gu, "")(replace(/^container:/u, "container ")(id))));
114805
+ return pipe(labels, get$13(id), getOrElse$1(() => replaceAll(/^service:[a-z]+:(?:deslop-)?|\.service$/gu, "")(replace(/^container:/u, "container ")(id))));
114594
114806
  }
114595
114807
  function appCgroup(path, siblings) {
114596
114808
  const name = getOrElse$1(last$1(split$1(path, "/")), constant(""));
@@ -114621,7 +114833,7 @@ function appShares(current, previous) {
114621
114833
  const measured = isGreaterThan$3(elapsed, zero$2) && exists(previous, (old) => pipe(old.time, distance(current.time), isLessThanOrEqualTo$3(seconds(90))));
114622
114834
  return pipe(toEntries(groupBy(toEntries(current.cgroups), (entry) => entry[1].id)), filter$5((entry) => sumAll(map$10(entry[1], (cgroup) => cgroup[1].memory)) >= 1024 ** 2), map$10((entry) => {
114623
114835
  const [id, cgroups] = entry;
114624
- const deltas = getSomes(map$10(cgroups, (cgroup) => pipe(flatMap$8(previous, (old) => get$12(old.cgroups, cgroup[0])), filter$7((old) => measured && isGreaterThanOrEqualTo$3(cgroup[1].usage, old.usage)), map$13((old) => toMicros(subtract(cgroup[1].usage, old.usage))))));
114836
+ const deltas = getSomes(map$10(cgroups, (cgroup) => pipe(flatMap$8(previous, (old) => get$13(old.cgroups, cgroup[0])), filter$7((old) => measured && isGreaterThanOrEqualTo$3(cgroup[1].usage, old.usage)), map$13((old) => toMicros(subtract(cgroup[1].usage, old.usage))))));
114625
114837
  return {
114626
114838
  cpu: match$6(deltas, {
114627
114839
  onEmpty: () => none(),
@@ -114909,7 +115121,7 @@ var Metrics = class extends Service$1()("@deslop/deploy/services/metrics/service
114909
115121
  worker
114910
115122
  });
114911
115123
  const time = yield* now;
114912
- const step = getOrThrow$1(get$12(SERIES, `${toMinutes(query.minutes)}`));
115124
+ const step = getOrThrow$1(get$13(SERIES, `${toMinutes(query.minutes)}`));
114913
115125
  const samples = yield* asDeployError$1(listSeries({
114914
115126
  after: subtractDuration(chartWindow(query.minutes, time).start, step),
114915
115127
  step
@@ -115070,7 +115282,7 @@ var Fleet = class Fleet extends Service$1()("@deslop/deploy/services/fleet/servi
115070
115282
  };
115071
115283
  }), "Fleet.local");
115072
115284
  const remote = fnUntraced(function* (worker, use) {
115073
- const peer = getOrThrow$1(get$12(peers, worker.name));
115285
+ const peer = getOrThrow$1(get$13(peers, worker.name));
115074
115286
  if (!(yield* get$2(peer.connected))) return yield* DeployError.make({ message: "Worker is unreachable" });
115075
115287
  return yield* pipe(use(peer.client), timeout(seconds(15)), withSpan("Fleet.remote", { attributes: { worker: worker.name } }));
115076
115288
  });
@@ -115090,7 +115302,7 @@ var Fleet = class Fleet extends Service$1()("@deslop/deploy/services/fleet/servi
115090
115302
  const time = yield* now;
115091
115303
  const cached = yield* get$2(lastMetrics);
115092
115304
  return [own, ...map$10(workers, (worker) => {
115093
- const saved = get$8(cached, [worker.name, query.minutes]);
115305
+ const saved = get$9(cached, [worker.name, query.minutes]);
115094
115306
  return {
115095
115307
  ...cachedHistory(query, time, saved),
115096
115308
  error: match$8(saved, {
@@ -115136,7 +115348,7 @@ var Fleet = class Fleet extends Service$1()("@deslop/deploy/services/fleet/servi
115136
115348
  worker: worker.name
115137
115349
  })), tapError$3((cause) => logWarning("A worker history could not be read", cause)), catch_$2(fnUntraced(function* (cause) {
115138
115350
  return {
115139
- ...cachedHistory(query, yield* now, get$8(yield* get$2(lastMetrics), [worker.name, query.minutes])),
115351
+ ...cachedHistory(query, yield* now, get$9(yield* get$2(lastMetrics), [worker.name, query.minutes])),
115140
115352
  error: some$1(cause.message),
115141
115353
  stale: true,
115142
115354
  worker: worker.name