apps 0.0.1-beta.26 → 0.0.1-beta.27

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.
Files changed (56) hide show
  1. package/README.md +6 -6
  2. package/framework-reference.json +1 -1
  3. package/js/{chunk-BTRBOOTD.js → chunk-3TEX4ZND.js} +23 -17
  4. package/js/{chunk-OI7OI2U3.js → chunk-4OD7PHQL.js} +2 -2
  5. package/js/{chunk-AAAMPT6F.js → chunk-65SZ23BK.js} +2 -2
  6. package/js/{chunk-XBG3M64K.js → chunk-6JBTHTI5.js} +1 -1
  7. package/js/{chunk-EXDR4HVM.js → chunk-7AZNPMQH.js} +53 -11
  8. package/js/{chunk-VGEPL4BV.js → chunk-7R5JY5H7.js} +19 -5
  9. package/js/{chunk-4CMJD7AB.js → chunk-AHI26TO6.js} +24 -8
  10. package/js/{chunk-OBXHLFGQ.js → chunk-B5YJQU45.js} +1 -1
  11. package/js/{chunk-T7WRQJUF.js → chunk-BRGF7VFN.js} +2 -2
  12. package/js/{chunk-HQKIPKM5.js → chunk-BTJMXW4I.js} +1 -1
  13. package/js/{chunk-HIYRKEWP.js → chunk-HIJW4LWC.js} +64 -21
  14. package/js/{chunk-DAIW2WM3.js → chunk-KQCMHI3K.js} +3 -3
  15. package/js/{chunk-GH6PY5BQ.js → chunk-M2KEEOIQ.js} +1 -1
  16. package/js/{chunk-TACLXEAE.js → chunk-NSBRV4FJ.js} +1 -1
  17. package/js/{chunk-DM5U7G7V.js → chunk-NXTXZ635.js} +1842 -1840
  18. package/js/{chunk-3YN4UDPB.js → chunk-PTUZSCEV.js} +2 -2
  19. package/js/{chunk-KKGRSXUK.js → chunk-PWF2DRJ3.js} +1 -1
  20. package/js/{chunk-2TP7C25K.js → chunk-SDLIDQXG.js} +3 -3
  21. package/js/{chunk-NXO2GN2T.js → chunk-T2UFJKZR.js} +8 -8
  22. package/js/{chunk-PC5RHPUP.js → chunk-TSLG2WPA.js} +2 -2
  23. package/js/{chunk-WPKXOTKM.js → chunk-TX2XCAL6.js} +3 -3
  24. package/js/{chunk-KNJAOYV4.js → chunk-V2I3MMPM.js} +2 -2
  25. package/js/{chunk-ZVMZWXVF.js → chunk-VUVBMNKC.js} +2 -2
  26. package/js/{chunk-SUY33XAY.js → chunk-WQ5MVBTP.js} +1 -1
  27. package/js/{chunk-LPN4ONWW.js → chunk-XBQTJP76.js} +2 -2
  28. package/js/{chunk-IE6W5RNN.js → chunk-YML53Z7H.js} +2 -2
  29. package/js/{chunk-DUEZ2XCO.js → chunk-YXKXKGN6.js} +3 -3
  30. package/js/{chunk-XIRAIB3P.js → chunk-ZZOCEUTB.js} +4 -4
  31. package/js/client.js +10 -10
  32. package/js/contracts.js +7 -7
  33. package/js/effect.js +19 -19
  34. package/js/graphql.js +21 -21
  35. package/js/host.js +19 -19
  36. package/js/index.js +12 -12
  37. package/js/mcp/effect.js +23 -21
  38. package/js/mcp/stdio.js +21 -21
  39. package/js/mcp.js +29 -24
  40. package/js/openapi.js +15 -15
  41. package/js/react.js +3 -3
  42. package/js/skills/effect.js +3 -3
  43. package/js/skills.js +11 -11
  44. package/js/storage/facet.js +4 -4
  45. package/js/ui/auth/contracts.js +2 -2
  46. package/js/ui/auth.js +5 -5
  47. package/js/ui/contracts.js +4 -4
  48. package/js/ui/serving.js +8 -8
  49. package/package.json +1 -1
  50. package/runtime.json +1 -1
  51. package/types/apps/src/contracts/mcp.d.ts +49 -3
  52. package/types/apps/src/contracts/provider.d.ts +6 -0
  53. package/types/apps/src/implementation/failure-detail.d.ts +3 -2
  54. package/types/apps/src/implementation/mcp-client.d.ts +1 -0
  55. package/types/apps/src/implementation/mcp.d.ts +11 -1
  56. package/types/apps/src/mcp.d.ts +20 -1
@@ -2,84 +2,58 @@ import {
2
2
  __export
3
3
  } from "./chunk-CZ7CSFO4.js";
4
4
 
5
- // ../../node_modules/.bun/effect@https+++pkg.pr.new+Effect-TS+effect+effect@c7d1ffff31a3e2ae0b0b+a654a55b752bdb24/node_modules/effect/dist/Option.js
6
- var Option_exports = {};
7
- __export(Option_exports, {
8
- Do: () => Do,
9
- all: () => all,
10
- andThen: () => andThen,
11
- as: () => as,
12
- asVoid: () => asVoid,
13
- bind: () => bind2,
14
- bindTo: () => bindTo2,
15
- composeK: () => composeK,
16
- contains: () => contains,
17
- containsWith: () => containsWith,
18
- exists: () => exists,
19
- filter: () => filter,
20
- filterMap: () => filterMap,
21
- firstSomeOf: () => firstSomeOf,
22
- flatMap: () => flatMap,
23
- flatMapNullishOr: () => flatMapNullishOr,
24
- flatten: () => flatten,
25
- fromIterable: () => fromIterable,
26
- fromNullOr: () => fromNullOr,
27
- fromNullishOr: () => fromNullishOr,
28
- fromUndefinedOr: () => fromUndefinedOr,
29
- gen: () => gen,
30
- getFailure: () => getFailure2,
31
- getOrElse: () => getOrElse,
32
- getOrNull: () => getOrNull,
33
- getOrThrow: () => getOrThrow,
34
- getOrThrowWith: () => getOrThrowWith,
35
- getOrUndefined: () => getOrUndefined,
36
- getSuccess: () => getSuccess2,
37
- isNone: () => isNone2,
38
- isOption: () => isOption2,
39
- isSome: () => isSome2,
40
- let: () => let_2,
41
- lift2: () => lift2,
42
- liftNullishOr: () => liftNullishOr,
43
- liftPredicate: () => liftPredicate,
44
- liftThrowable: () => liftThrowable,
45
- makeCombinerFailFast: () => makeCombinerFailFast,
46
- makeEquivalence: () => makeEquivalence,
47
- makeOrder: () => makeOrder,
48
- makeReducer: () => makeReducer,
49
- makeReducerFailFast: () => makeReducerFailFast,
50
- map: () => map,
51
- match: () => match,
52
- none: () => none2,
53
- orElse: () => orElse,
54
- orElseResult: () => orElseResult,
55
- orElseSome: () => orElseSome,
56
- partitionMap: () => partitionMap,
57
- product: () => product,
58
- productMany: () => productMany,
59
- reduceCompact: () => reduceCompact,
60
- some: () => some3,
61
- tap: () => tap,
62
- toArray: () => toArray,
63
- toRefinement: () => toRefinement,
64
- void: () => void_,
65
- zipLeft: () => zipLeft,
66
- zipRight: () => zipRight,
67
- zipWith: () => zipWith
5
+ // ../../node_modules/.bun/effect@https+++pkg.pr.new+Effect-TS+effect+effect@c7d1ffff31a3e2ae0b0b+a654a55b752bdb24/node_modules/effect/dist/Predicate.js
6
+ var Predicate_exports = {};
7
+ __export(Predicate_exports, {
8
+ Struct: () => Struct,
9
+ Tuple: () => Tuple,
10
+ and: () => and,
11
+ compose: () => compose,
12
+ eqv: () => eqv,
13
+ every: () => every,
14
+ hasProperty: () => hasProperty,
15
+ implies: () => implies,
16
+ isBigInt: () => isBigInt,
17
+ isBoolean: () => isBoolean,
18
+ isDate: () => isDate,
19
+ isError: () => isError,
20
+ isFunction: () => isFunction,
21
+ isIterable: () => isIterable,
22
+ isMap: () => isMap,
23
+ isNever: () => isNever,
24
+ isNotNull: () => isNotNull,
25
+ isNotNullish: () => isNotNullish,
26
+ isNotUndefined: () => isNotUndefined,
27
+ isNull: () => isNull,
28
+ isNullish: () => isNullish,
29
+ isNumber: () => isNumber,
30
+ isObject: () => isObject,
31
+ isObjectKeyword: () => isObjectKeyword,
32
+ isObjectOrArray: () => isObjectOrArray,
33
+ isPromise: () => isPromise,
34
+ isPromiseLike: () => isPromiseLike,
35
+ isPropertyKey: () => isPropertyKey,
36
+ isReadonlyObject: () => isReadonlyObject,
37
+ isRegExp: () => isRegExp,
38
+ isSet: () => isSet,
39
+ isString: () => isString,
40
+ isSymbol: () => isSymbol,
41
+ isTagged: () => isTagged,
42
+ isTruthy: () => isTruthy,
43
+ isTupleOf: () => isTupleOf,
44
+ isTupleOfAtLeast: () => isTupleOfAtLeast,
45
+ isUint8Array: () => isUint8Array,
46
+ isUndefined: () => isUndefined,
47
+ isUnknown: () => isUnknown,
48
+ mapInput: () => mapInput,
49
+ nand: () => nand,
50
+ nor: () => nor,
51
+ not: () => not,
52
+ or: () => or,
53
+ some: () => some,
54
+ xor: () => xor
68
55
  });
69
56
 
70
- // ../../node_modules/.bun/effect@https+++pkg.pr.new+Effect-TS+effect+effect@c7d1ffff31a3e2ae0b0b+a654a55b752bdb24/node_modules/effect/dist/Combiner.js
71
- function make(combine5) {
72
- return {
73
- combine: combine5
74
- };
75
- }
76
- function min(order) {
77
- return make((self, that) => order(self, that) === -1 ? self : that);
78
- }
79
- function max(order) {
80
- return make((self, that) => order(self, that) === 1 ? self : that);
81
- }
82
-
83
57
  // ../../node_modules/.bun/effect@https+++pkg.pr.new+Effect-TS+effect+effect@c7d1ffff31a3e2ae0b0b+a654a55b752bdb24/node_modules/effect/dist/Pipeable.js
84
58
  var pipeArguments = (self, args2) => {
85
59
  switch (args2.length) {
@@ -236,80 +210,7 @@ function memoizeIdempotent(f) {
236
210
  };
237
211
  }
238
212
 
239
- // ../../node_modules/.bun/effect@https+++pkg.pr.new+Effect-TS+effect+effect@c7d1ffff31a3e2ae0b0b+a654a55b752bdb24/node_modules/effect/dist/internal/equal.js
240
- var getAllObjectKeys = (obj) => {
241
- const keys4 = new Set(Reflect.ownKeys(obj));
242
- if (obj.constructor === Object) return keys4;
243
- if (obj instanceof Error) {
244
- keys4.delete("stack");
245
- }
246
- const proto = Object.getPrototypeOf(obj);
247
- let current = proto;
248
- while (current !== null && current !== Object.prototype) {
249
- const ownKeys = Reflect.ownKeys(current);
250
- for (let i = 0; i < ownKeys.length; i++) {
251
- keys4.add(ownKeys[i]);
252
- }
253
- current = Object.getPrototypeOf(current);
254
- }
255
- if (keys4.has("constructor") && typeof obj.constructor === "function" && proto === obj.constructor.prototype) {
256
- keys4.delete("constructor");
257
- }
258
- return keys4;
259
- };
260
- var byReferenceInstances = /* @__PURE__ */ new WeakSet();
261
-
262
213
  // ../../node_modules/.bun/effect@https+++pkg.pr.new+Effect-TS+effect+effect@c7d1ffff31a3e2ae0b0b+a654a55b752bdb24/node_modules/effect/dist/Predicate.js
263
- var Predicate_exports = {};
264
- __export(Predicate_exports, {
265
- Struct: () => Struct,
266
- Tuple: () => Tuple,
267
- and: () => and,
268
- compose: () => compose,
269
- eqv: () => eqv,
270
- every: () => every,
271
- hasProperty: () => hasProperty,
272
- implies: () => implies,
273
- isBigInt: () => isBigInt,
274
- isBoolean: () => isBoolean,
275
- isDate: () => isDate,
276
- isError: () => isError,
277
- isFunction: () => isFunction,
278
- isIterable: () => isIterable,
279
- isMap: () => isMap,
280
- isNever: () => isNever,
281
- isNotNull: () => isNotNull,
282
- isNotNullish: () => isNotNullish,
283
- isNotUndefined: () => isNotUndefined,
284
- isNull: () => isNull,
285
- isNullish: () => isNullish,
286
- isNumber: () => isNumber,
287
- isObject: () => isObject,
288
- isObjectKeyword: () => isObjectKeyword,
289
- isObjectOrArray: () => isObjectOrArray,
290
- isPromise: () => isPromise,
291
- isPromiseLike: () => isPromiseLike,
292
- isPropertyKey: () => isPropertyKey,
293
- isReadonlyObject: () => isReadonlyObject,
294
- isRegExp: () => isRegExp,
295
- isSet: () => isSet,
296
- isString: () => isString,
297
- isSymbol: () => isSymbol,
298
- isTagged: () => isTagged,
299
- isTruthy: () => isTruthy,
300
- isTupleOf: () => isTupleOf,
301
- isTupleOfAtLeast: () => isTupleOfAtLeast,
302
- isUint8Array: () => isUint8Array,
303
- isUndefined: () => isUndefined,
304
- isUnknown: () => isUnknown,
305
- mapInput: () => mapInput,
306
- nand: () => nand,
307
- nor: () => nor,
308
- not: () => not,
309
- or: () => or,
310
- some: () => some,
311
- xor: () => xor
312
- });
313
214
  var mapInput = /* @__PURE__ */ dual(2, (self, f) => (b) => self(f(b)));
314
215
  var isTupleOf = /* @__PURE__ */ dual(2, (self, n) => self.length === n);
315
216
  var isTupleOfAtLeast = /* @__PURE__ */ dual(2, (self, n) => self.length >= n);
@@ -455,63 +356,164 @@ function some(collection) {
455
356
  };
456
357
  }
457
358
 
458
- // ../../node_modules/.bun/effect@https+++pkg.pr.new+Effect-TS+effect+effect@c7d1ffff31a3e2ae0b0b+a654a55b752bdb24/node_modules/effect/dist/Hash.js
459
- var symbol = "~effect/Hash";
460
- var hash = (self) => {
461
- switch (typeof self) {
462
- case "number":
463
- return number(self);
464
- case "bigint":
465
- return string(self.toString(10));
466
- case "string":
467
- return string(self);
468
- case "undefined":
469
- return string("undefined");
470
- case "function":
471
- case "object": {
472
- if (self === null) {
473
- return string("null");
474
- } else if (self instanceof Date) {
475
- if (Number.isNaN(self.getTime())) {
476
- return string("Invalid Date");
477
- }
478
- return string(self.toISOString());
479
- } else if (self instanceof RegExp) {
480
- return string(self.toString());
481
- } else {
482
- if (byReferenceInstances.has(self)) {
483
- return random(self);
484
- }
485
- if (hashCache.has(self)) {
486
- return hashCache.get(self);
487
- }
488
- const h = withVisitedTracking(self, () => {
489
- if (isHash(self)) {
490
- return self[symbol]();
491
- } else if (typeof self === "function") {
492
- return random(self);
493
- } else if (self instanceof DataView) {
494
- return array(new Uint8Array(self.buffer, self.byteOffset, self.byteLength));
495
- } else if (Array.isArray(self) || ArrayBuffer.isView(self)) {
496
- return array(self);
497
- } else if (self instanceof Map) {
498
- return hashMap(self);
499
- } else if (self instanceof Set) {
500
- return hashSet(self);
501
- }
502
- return structure(self);
503
- });
504
- hashCache.set(self, h);
505
- return h;
506
- }
507
- }
508
- default:
509
- return string(String(self));
510
- }
511
- };
512
- var random = (self) => {
513
- if (!randomHashCache.has(self)) {
514
- randomHashCache.set(self, number(Math.floor(Math.random() * Number.MAX_SAFE_INTEGER)));
359
+ // ../../node_modules/.bun/effect@https+++pkg.pr.new+Effect-TS+effect+effect@c7d1ffff31a3e2ae0b0b+a654a55b752bdb24/node_modules/effect/dist/Option.js
360
+ var Option_exports = {};
361
+ __export(Option_exports, {
362
+ Do: () => Do,
363
+ all: () => all,
364
+ andThen: () => andThen,
365
+ as: () => as,
366
+ asVoid: () => asVoid,
367
+ bind: () => bind2,
368
+ bindTo: () => bindTo2,
369
+ composeK: () => composeK,
370
+ contains: () => contains,
371
+ containsWith: () => containsWith,
372
+ exists: () => exists,
373
+ filter: () => filter,
374
+ filterMap: () => filterMap,
375
+ firstSomeOf: () => firstSomeOf,
376
+ flatMap: () => flatMap,
377
+ flatMapNullishOr: () => flatMapNullishOr,
378
+ flatten: () => flatten,
379
+ fromIterable: () => fromIterable,
380
+ fromNullOr: () => fromNullOr,
381
+ fromNullishOr: () => fromNullishOr,
382
+ fromUndefinedOr: () => fromUndefinedOr,
383
+ gen: () => gen,
384
+ getFailure: () => getFailure2,
385
+ getOrElse: () => getOrElse,
386
+ getOrNull: () => getOrNull,
387
+ getOrThrow: () => getOrThrow,
388
+ getOrThrowWith: () => getOrThrowWith,
389
+ getOrUndefined: () => getOrUndefined,
390
+ getSuccess: () => getSuccess2,
391
+ isNone: () => isNone2,
392
+ isOption: () => isOption2,
393
+ isSome: () => isSome2,
394
+ let: () => let_2,
395
+ lift2: () => lift2,
396
+ liftNullishOr: () => liftNullishOr,
397
+ liftPredicate: () => liftPredicate,
398
+ liftThrowable: () => liftThrowable,
399
+ makeCombinerFailFast: () => makeCombinerFailFast,
400
+ makeEquivalence: () => makeEquivalence,
401
+ makeOrder: () => makeOrder,
402
+ makeReducer: () => makeReducer,
403
+ makeReducerFailFast: () => makeReducerFailFast,
404
+ map: () => map,
405
+ match: () => match,
406
+ none: () => none2,
407
+ orElse: () => orElse,
408
+ orElseResult: () => orElseResult,
409
+ orElseSome: () => orElseSome,
410
+ partitionMap: () => partitionMap,
411
+ product: () => product,
412
+ productMany: () => productMany,
413
+ reduceCompact: () => reduceCompact,
414
+ some: () => some3,
415
+ tap: () => tap,
416
+ toArray: () => toArray,
417
+ toRefinement: () => toRefinement,
418
+ void: () => void_,
419
+ zipLeft: () => zipLeft,
420
+ zipRight: () => zipRight,
421
+ zipWith: () => zipWith
422
+ });
423
+
424
+ // ../../node_modules/.bun/effect@https+++pkg.pr.new+Effect-TS+effect+effect@c7d1ffff31a3e2ae0b0b+a654a55b752bdb24/node_modules/effect/dist/Combiner.js
425
+ function make(combine5) {
426
+ return {
427
+ combine: combine5
428
+ };
429
+ }
430
+ function min(order) {
431
+ return make((self, that) => order(self, that) === -1 ? self : that);
432
+ }
433
+ function max(order) {
434
+ return make((self, that) => order(self, that) === 1 ? self : that);
435
+ }
436
+
437
+ // ../../node_modules/.bun/effect@https+++pkg.pr.new+Effect-TS+effect+effect@c7d1ffff31a3e2ae0b0b+a654a55b752bdb24/node_modules/effect/dist/internal/equal.js
438
+ var getAllObjectKeys = (obj) => {
439
+ const keys4 = new Set(Reflect.ownKeys(obj));
440
+ if (obj.constructor === Object) return keys4;
441
+ if (obj instanceof Error) {
442
+ keys4.delete("stack");
443
+ }
444
+ const proto = Object.getPrototypeOf(obj);
445
+ let current = proto;
446
+ while (current !== null && current !== Object.prototype) {
447
+ const ownKeys = Reflect.ownKeys(current);
448
+ for (let i = 0; i < ownKeys.length; i++) {
449
+ keys4.add(ownKeys[i]);
450
+ }
451
+ current = Object.getPrototypeOf(current);
452
+ }
453
+ if (keys4.has("constructor") && typeof obj.constructor === "function" && proto === obj.constructor.prototype) {
454
+ keys4.delete("constructor");
455
+ }
456
+ return keys4;
457
+ };
458
+ var byReferenceInstances = /* @__PURE__ */ new WeakSet();
459
+
460
+ // ../../node_modules/.bun/effect@https+++pkg.pr.new+Effect-TS+effect+effect@c7d1ffff31a3e2ae0b0b+a654a55b752bdb24/node_modules/effect/dist/Hash.js
461
+ var symbol = "~effect/Hash";
462
+ var hash = (self) => {
463
+ switch (typeof self) {
464
+ case "number":
465
+ return number(self);
466
+ case "bigint":
467
+ return string(self.toString(10));
468
+ case "string":
469
+ return string(self);
470
+ case "undefined":
471
+ return string("undefined");
472
+ case "function":
473
+ case "object": {
474
+ if (self === null) {
475
+ return string("null");
476
+ } else if (self instanceof Date) {
477
+ if (Number.isNaN(self.getTime())) {
478
+ return string("Invalid Date");
479
+ }
480
+ return string(self.toISOString());
481
+ } else if (self instanceof RegExp) {
482
+ return string(self.toString());
483
+ } else {
484
+ if (byReferenceInstances.has(self)) {
485
+ return random(self);
486
+ }
487
+ if (hashCache.has(self)) {
488
+ return hashCache.get(self);
489
+ }
490
+ const h = withVisitedTracking(self, () => {
491
+ if (isHash(self)) {
492
+ return self[symbol]();
493
+ } else if (typeof self === "function") {
494
+ return random(self);
495
+ } else if (self instanceof DataView) {
496
+ return array(new Uint8Array(self.buffer, self.byteOffset, self.byteLength));
497
+ } else if (Array.isArray(self) || ArrayBuffer.isView(self)) {
498
+ return array(self);
499
+ } else if (self instanceof Map) {
500
+ return hashMap(self);
501
+ } else if (self instanceof Set) {
502
+ return hashSet(self);
503
+ }
504
+ return structure(self);
505
+ });
506
+ hashCache.set(self, h);
507
+ return h;
508
+ }
509
+ }
510
+ default:
511
+ return string(String(self));
512
+ }
513
+ };
514
+ var random = (self) => {
515
+ if (!randomHashCache.has(self)) {
516
+ randomHashCache.set(self, number(Math.floor(Math.random() * Number.MAX_SAFE_INTEGER)));
515
517
  }
516
518
  return randomHashCache.get(self);
517
519
  };
@@ -6701,6 +6703,21 @@ var doneUnsafe = (self, effect2) => {
6701
6703
  };
6702
6704
  var into = /* @__PURE__ */ dual(2, (self, deferred) => uninterruptibleMask((restore) => flatMap3(exit(restore(self)), (exit3) => done2(deferred, exit3))));
6703
6705
 
6706
+ // ../../node_modules/.bun/effect@https+++pkg.pr.new+Effect-TS+effect+effect@c7d1ffff31a3e2ae0b0b+a654a55b752bdb24/node_modules/effect/dist/Clock.js
6707
+ var Clock_exports = {};
6708
+ __export(Clock_exports, {
6709
+ Clock: () => Clock,
6710
+ clockWith: () => clockWith2,
6711
+ currentTimeMillis: () => currentTimeMillis2,
6712
+ currentTimeNanos: () => currentTimeNanos2,
6713
+ monotonicTimeNanos: () => monotonicTimeNanos2
6714
+ });
6715
+ var Clock = ClockRef;
6716
+ var clockWith2 = clockWith;
6717
+ var currentTimeMillis2 = currentTimeMillis;
6718
+ var currentTimeNanos2 = currentTimeNanos;
6719
+ var monotonicTimeNanos2 = monotonicTimeNanos;
6720
+
6704
6721
  // ../../node_modules/.bun/effect@https+++pkg.pr.new+Effect-TS+effect+effect@c7d1ffff31a3e2ae0b0b+a654a55b752bdb24/node_modules/effect/dist/Effect.js
6705
6722
  var Effect_exports = {};
6706
6723
  __export(Effect_exports, {
@@ -7493,21 +7510,6 @@ __export(Cron_exports, {
7493
7510
  sequence: () => sequence
7494
7511
  });
7495
7512
 
7496
- // ../../node_modules/.bun/effect@https+++pkg.pr.new+Effect-TS+effect+effect@c7d1ffff31a3e2ae0b0b+a654a55b752bdb24/node_modules/effect/dist/Clock.js
7497
- var Clock_exports = {};
7498
- __export(Clock_exports, {
7499
- Clock: () => Clock,
7500
- clockWith: () => clockWith2,
7501
- currentTimeMillis: () => currentTimeMillis2,
7502
- currentTimeNanos: () => currentTimeNanos2,
7503
- monotonicTimeNanos: () => monotonicTimeNanos2
7504
- });
7505
- var Clock = ClockRef;
7506
- var clockWith2 = clockWith;
7507
- var currentTimeMillis2 = currentTimeMillis;
7508
- var currentTimeNanos2 = currentTimeNanos;
7509
- var monotonicTimeNanos2 = monotonicTimeNanos;
7510
-
7511
7513
  // ../../node_modules/.bun/effect@https+++pkg.pr.new+Effect-TS+effect+effect@c7d1ffff31a3e2ae0b0b+a654a55b752bdb24/node_modules/effect/dist/internal/dateTime.js
7512
7514
  var TypeId9 = "~effect/DateTime";
7513
7515
  var TimeZoneTypeId = "~effect/DateTime/TimeZone";
@@ -28236,1736 +28238,1736 @@ var toPubSubTake2 = /* @__PURE__ */ dual(2, (self, options) => toPubSubTake(self
28236
28238
  var toQueue = /* @__PURE__ */ dual(2, (self, options) => toQueueArray(self.channel, options));
28237
28239
  var runIntoQueue = /* @__PURE__ */ dual(2, (self, queue) => runIntoQueueArray(self.channel, queue));
28238
28240
 
28239
- // ../../node_modules/.bun/effect@https+++pkg.pr.new+Effect-TS+effect+effect@c7d1ffff31a3e2ae0b0b+a654a55b752bdb24/node_modules/effect/dist/Ref.js
28240
- var Ref_exports = {};
28241
- __export(Ref_exports, {
28242
- get: () => get10,
28243
- getAndSet: () => getAndSet,
28244
- getAndUpdate: () => getAndUpdate,
28245
- getAndUpdateSome: () => getAndUpdateSome,
28246
- getUnsafe: () => getUnsafe5,
28247
- make: () => make38,
28248
- makeUnsafe: () => makeUnsafe10,
28249
- modify: () => modify4,
28250
- modifySome: () => modifySome,
28251
- set: () => set8,
28252
- setAndGet: () => setAndGet,
28253
- update: () => update2,
28254
- updateAndGet: () => updateAndGet,
28255
- updateSome: () => updateSome,
28256
- updateSomeAndGet: () => updateSomeAndGet
28241
+ // ../../node_modules/.bun/effect@https+++pkg.pr.new+Effect-TS+effect+effect@c7d1ffff31a3e2ae0b0b+a654a55b752bdb24/node_modules/effect/dist/Match.js
28242
+ var Match_exports = {};
28243
+ __export(Match_exports, {
28244
+ any: () => any3,
28245
+ bigint: () => bigint,
28246
+ boolean: () => boolean2,
28247
+ date: () => date,
28248
+ defined: () => defined2,
28249
+ discriminator: () => discriminator2,
28250
+ discriminatorStartsWith: () => discriminatorStartsWith2,
28251
+ discriminators: () => discriminators2,
28252
+ discriminatorsExhaustive: () => discriminatorsExhaustive2,
28253
+ exhaustive: () => exhaustive2,
28254
+ fn: () => fn4,
28255
+ instanceOf: () => instanceOf3,
28256
+ instanceOfUnsafe: () => instanceOfUnsafe,
28257
+ is: () => is4,
28258
+ nonEmptyString: () => nonEmptyString2,
28259
+ not: () => not3,
28260
+ null: () => _null,
28261
+ number: () => number3,
28262
+ option: () => option4,
28263
+ orElse: () => orElse4,
28264
+ orElseAbsurd: () => orElseAbsurd2,
28265
+ record: () => record2,
28266
+ result: () => result5,
28267
+ string: () => string3,
28268
+ symbol: () => symbol4,
28269
+ tag: () => tag3,
28270
+ tagStartsWith: () => tagStartsWith2,
28271
+ tags: () => tags2,
28272
+ tagsExhaustive: () => tagsExhaustive2,
28273
+ type: () => type2,
28274
+ typeTags: () => typeTags2,
28275
+ undefined: () => _undefined,
28276
+ value: () => value5,
28277
+ valueTags: () => valueTags2,
28278
+ when: () => when5,
28279
+ whenAnd: () => whenAnd2,
28280
+ whenOr: () => whenOr2,
28281
+ withReturnType: () => withReturnType2
28257
28282
  });
28258
- var TypeId40 = "~effect/Ref";
28259
- var RefProto = {
28283
+
28284
+ // ../../node_modules/.bun/effect@https+++pkg.pr.new+Effect-TS+effect+effect@c7d1ffff31a3e2ae0b0b+a654a55b752bdb24/node_modules/effect/dist/internal/matcher.js
28285
+ var TypeId40 = "~effect/Match/Matcher";
28286
+ var TypeMatcherProto = {
28260
28287
  [TypeId40]: {
28261
- _A: identity
28288
+ _input: identity,
28289
+ _filters: identity,
28290
+ _remaining: identity,
28291
+ _result: identity,
28292
+ _return: identity,
28293
+ _args: identity
28262
28294
  },
28263
- ...PipeInspectableProto,
28264
- toJSON() {
28265
- return {
28266
- _id: "Ref",
28267
- ref: this.ref
28268
- };
28269
- }
28270
- };
28271
- var makeUnsafe10 = (value6) => {
28272
- const self = Object.create(RefProto);
28273
- self.ref = make30(value6);
28274
- return self;
28275
- };
28276
- var make38 = (value6) => sync4(() => makeUnsafe10(value6));
28277
- var get10 = (self) => sync4(() => self.ref.current);
28278
- var set8 = /* @__PURE__ */ dual(2, (self, value6) => sync4(() => set6(self.ref, value6)));
28279
- var getAndSet = /* @__PURE__ */ dual(2, (self, value6) => sync4(() => {
28280
- const current = self.ref.current;
28281
- self.ref.current = value6;
28282
- return current;
28283
- }));
28284
- var getAndUpdate = /* @__PURE__ */ dual(2, (self, f) => sync4(() => {
28285
- const current = self.ref.current;
28286
- self.ref.current = f(current);
28287
- return current;
28288
- }));
28289
- var getAndUpdateSome = /* @__PURE__ */ dual(2, (self, pf) => sync4(() => {
28290
- const current = self.ref.current;
28291
- const option6 = pf(current);
28292
- if (option6._tag === "Some") {
28293
- self.ref.current = option6.value;
28294
- }
28295
- return current;
28296
- }));
28297
- var setAndGet = /* @__PURE__ */ dual(2, (self, value6) => sync4(() => self.ref.current = value6));
28298
- var modify4 = /* @__PURE__ */ dual(2, (self, f) => sync4(() => {
28299
- const [b, a] = f(self.ref.current);
28300
- self.ref.current = a;
28301
- return b;
28302
- }));
28303
- var modifySome = /* @__PURE__ */ dual(2, (self, pf) => modify4(self, (value6) => {
28304
- const [b, option6] = pf(value6);
28305
- return [b, option6._tag === "None" ? value6 : option6.value];
28306
- }));
28307
- var update2 = /* @__PURE__ */ dual(2, (self, f) => sync4(() => {
28308
- self.ref.current = f(self.ref.current);
28309
- }));
28310
- var updateAndGet = /* @__PURE__ */ dual(2, (self, f) => sync4(() => self.ref.current = f(self.ref.current)));
28311
- var updateSome = /* @__PURE__ */ dual(2, (self, f) => sync4(() => {
28312
- const option6 = f(self.ref.current);
28313
- if (option6._tag === "Some") {
28314
- self.ref.current = option6.value;
28315
- }
28316
- }));
28317
- var updateSomeAndGet = /* @__PURE__ */ dual(2, (self, pf) => sync4(() => {
28318
- const option6 = pf(self.ref.current);
28319
- if (option6._tag === "Some") {
28320
- self.ref.current = option6.value;
28321
- }
28322
- return self.ref.current;
28323
- }));
28324
- var getUnsafe5 = (self) => self.ref.current;
28325
-
28326
- // ../../node_modules/.bun/effect@https+++pkg.pr.new+Effect-TS+effect+effect@c7d1ffff31a3e2ae0b0b+a654a55b752bdb24/node_modules/effect/dist/ChannelSchema.js
28327
- var decode2 = (schema2, options) => () => {
28328
- const decode3 = decodeEffect2(NonEmptyArray(schema2), options);
28329
- return fromTransform((upstream, _scope) => succeed7(flatMap5(upstream, (chunk) => decode3(chunk))));
28330
- };
28331
-
28332
- // ../../node_modules/.bun/effect@https+++pkg.pr.new+Effect-TS+effect+effect@c7d1ffff31a3e2ae0b0b+a654a55b752bdb24/node_modules/effect/dist/PlatformError.js
28333
- var TypeId41 = "~effect/PlatformError";
28334
- var BadArgument = class extends (/* @__PURE__ */ TaggedError2("BadArgument")) {
28335
- /**
28336
- * Formats the module, method, and optional description that rejected the argument.
28337
- *
28338
- * **When to use**
28339
- *
28340
- * Use to read the formatted error message for a rejected platform argument.
28341
- *
28342
- * @since 4.0.0
28343
- */
28344
- get message() {
28345
- return `${this.module}.${this.method}${this.description ? `: ${this.description}` : ""}`;
28295
+ _tag: "TypeMatcher",
28296
+ add(_case) {
28297
+ return makeTypeMatcher(this.select, [...this.cases, _case]);
28298
+ },
28299
+ pipe() {
28300
+ return pipeArguments(this, arguments);
28346
28301
  }
28347
28302
  };
28348
- var PlatformError = class extends (/* @__PURE__ */ TaggedError2("PlatformError")) {
28349
- constructor(reason) {
28350
- if ("cause" in reason) {
28351
- super({
28352
- reason,
28353
- cause: reason.cause
28354
- });
28355
- } else {
28356
- super({
28357
- reason
28358
- });
28303
+ function makeTypeMatcher(select, cases) {
28304
+ const matcher = Object.create(TypeMatcherProto);
28305
+ matcher.select = select;
28306
+ matcher.cases = cases;
28307
+ return matcher;
28308
+ }
28309
+ var ValueMatcherProto = {
28310
+ [TypeId40]: {
28311
+ _input: identity,
28312
+ _filters: identity,
28313
+ _result: identity,
28314
+ _return: identity,
28315
+ _flavor: identity
28316
+ },
28317
+ _tag: "ValueMatcher",
28318
+ add(_case) {
28319
+ if (isSuccess2(this.value)) {
28320
+ return this;
28359
28321
  }
28360
- }
28361
- /**
28362
- * Marks this value as a platform error wrapper for runtime guards.
28363
- *
28364
- * **When to use**
28365
- *
28366
- * Use to identify `PlatformError` values through their runtime type marker.
28367
- *
28368
- * @since 4.0.0
28369
- */
28370
- [TypeId41] = TypeId41;
28371
- get message() {
28372
- return this.reason.message;
28322
+ if (_case._tag === "When" && _case.guard(this.provided) === true) {
28323
+ return makeValueMatcher(this.provided, succeed2(_case.evaluate(this.provided)));
28324
+ } else if (_case._tag === "Not" && _case.guard(this.provided) === false) {
28325
+ return makeValueMatcher(this.provided, succeed2(_case.evaluate(this.provided)));
28326
+ }
28327
+ return this;
28328
+ },
28329
+ pipe() {
28330
+ return pipeArguments(this, arguments);
28373
28331
  }
28374
28332
  };
28375
- var badArgument = (options) => new PlatformError(new BadArgument(options));
28376
-
28377
- // ../../node_modules/.bun/effect@https+++pkg.pr.new+Effect-TS+effect+effect@c7d1ffff31a3e2ae0b0b+a654a55b752bdb24/node_modules/effect/dist/FileSystem.js
28378
- var FileSystem = /* @__PURE__ */ Service("effect/FileSystem");
28379
-
28380
- // ../../node_modules/.bun/effect@https+++pkg.pr.new+Effect-TS+effect+effect@c7d1ffff31a3e2ae0b0b+a654a55b752bdb24/node_modules/effect/dist/Path.js
28381
- var TypeId42 = "~effect/Path";
28382
- var Path = /* @__PURE__ */ Service("effect/Path");
28383
- function normalizeStringPosix(path, allowAboveRoot) {
28384
- let res = "";
28385
- let lastSegmentLength = 0;
28386
- let lastSlash = -1;
28387
- let dots = 0;
28388
- let code;
28389
- for (let i = 0; i <= path.length; ++i) {
28390
- if (i < path.length) {
28391
- code = path.charCodeAt(i);
28392
- } else if (code === 47) {
28393
- break;
28394
- } else {
28395
- code = 47;
28396
- }
28397
- if (code === 47) {
28398
- if (lastSlash === i - 1 || dots === 1) {
28399
- } else if (lastSlash !== i - 1 && dots === 2) {
28400
- if (res.length < 2 || lastSegmentLength !== 2 || res.charCodeAt(res.length - 1) !== 46 || res.charCodeAt(res.length - 2) !== 46) {
28401
- if (res.length > 2) {
28402
- const lastSlashIndex = res.lastIndexOf("/");
28403
- if (lastSlashIndex !== res.length - 1) {
28404
- if (lastSlashIndex === -1) {
28405
- res = "";
28406
- lastSegmentLength = 0;
28407
- } else {
28408
- res = res.slice(0, lastSlashIndex);
28409
- lastSegmentLength = res.length - 1 - res.lastIndexOf("/");
28410
- }
28411
- lastSlash = i;
28412
- dots = 0;
28413
- continue;
28414
- }
28415
- } else if (res.length === 2 || res.length === 1) {
28416
- res = "";
28417
- lastSegmentLength = 0;
28418
- lastSlash = i;
28419
- dots = 0;
28420
- continue;
28421
- }
28422
- }
28423
- if (allowAboveRoot) {
28424
- if (res.length > 0) {
28425
- res += "/..";
28426
- } else {
28427
- res = "..";
28428
- }
28429
- lastSegmentLength = 2;
28333
+ function makeValueMatcher(provided, value6) {
28334
+ const matcher = Object.create(ValueMatcherProto);
28335
+ matcher.provided = provided;
28336
+ matcher.value = value6;
28337
+ return matcher;
28338
+ }
28339
+ var makeWhen = (guard, evaluate2) => ({
28340
+ _tag: "When",
28341
+ guard,
28342
+ evaluate: evaluate2
28343
+ });
28344
+ var makeNot = (guard, evaluate2) => ({
28345
+ _tag: "Not",
28346
+ guard,
28347
+ evaluate: evaluate2
28348
+ });
28349
+ var makePredicate = (pattern) => {
28350
+ if (typeof pattern === "function") {
28351
+ return pattern;
28352
+ } else if (Array.isArray(pattern)) {
28353
+ const predicates = pattern.map(makePredicate);
28354
+ const len = predicates.length;
28355
+ return (u) => {
28356
+ if (!Array.isArray(u)) {
28357
+ return false;
28358
+ }
28359
+ for (let i = 0; i < len; i++) {
28360
+ if (predicates[i](u[i]) === false) {
28361
+ return false;
28430
28362
  }
28431
- } else {
28432
- if (res.length > 0) {
28433
- res += "/" + path.slice(lastSlash + 1, i);
28434
- } else {
28435
- res = path.slice(lastSlash + 1, i);
28363
+ }
28364
+ return true;
28365
+ };
28366
+ } else if (pattern !== null && typeof pattern === "object") {
28367
+ const keysAndPredicates = Reflect.ownKeys(pattern).map((key) => [key, makePredicate(pattern[key])]);
28368
+ const len = keysAndPredicates.length;
28369
+ return (u) => {
28370
+ if (typeof u !== "object" || u === null) {
28371
+ return false;
28372
+ }
28373
+ for (let i = 0; i < len; i++) {
28374
+ const [key, predicate] = keysAndPredicates[i];
28375
+ if (!(key in u) || predicate(u[key]) === false) {
28376
+ return false;
28436
28377
  }
28437
- lastSegmentLength = i - lastSlash - 1;
28438
28378
  }
28439
- lastSlash = i;
28440
- dots = 0;
28441
- } else if (code === 46 && dots !== -1) {
28442
- ++dots;
28443
- } else {
28444
- dots = -1;
28445
- }
28379
+ return true;
28380
+ };
28446
28381
  }
28447
- return res;
28448
- }
28449
- function _format(sep, pathObject) {
28450
- const dir = pathObject.dir || pathObject.root;
28451
- const base = pathObject.base || (pathObject.name || "") + (pathObject.ext || "");
28452
- if (!dir) {
28453
- return base;
28454
- }
28455
- if (dir === pathObject.root) {
28456
- return dir + base;
28457
- }
28458
- return dir + sep + base;
28459
- }
28460
- function fromFileUrl(url) {
28461
- if (url.protocol !== "file:") {
28462
- return fail7(new BadArgument({
28463
- module: "Path",
28464
- method: "fromFileUrl",
28465
- description: "URL must be of scheme file"
28466
- }));
28467
- } else if (url.hostname !== "") {
28468
- return fail7(new BadArgument({
28469
- module: "Path",
28470
- method: "fromFileUrl",
28471
- description: "Invalid file URL host"
28472
- }));
28473
- }
28474
- const pathname = url.pathname;
28475
- for (let n = 0; n < pathname.length; n++) {
28476
- if (pathname[n] === "%") {
28477
- const third = pathname.codePointAt(n + 2) | 32;
28478
- if (pathname[n + 1] === "2" && third === 102) {
28479
- return fail7(new BadArgument({
28480
- module: "Path",
28481
- method: "fromFileUrl",
28482
- description: "must not include encoded / characters"
28483
- }));
28382
+ return (u) => u === pattern;
28383
+ };
28384
+ var makeOrPredicate = (patterns) => {
28385
+ const predicates = patterns.map(makePredicate);
28386
+ const len = predicates.length;
28387
+ return (u) => {
28388
+ for (let i = 0; i < len; i++) {
28389
+ if (predicates[i](u) === true) {
28390
+ return true;
28484
28391
  }
28485
28392
  }
28486
- }
28487
- return succeed7(decodeURIComponent(pathname));
28488
- }
28489
- var resolve2 = function resolve3() {
28490
- let resolvedPath = "";
28491
- let resolvedAbsolute = false;
28492
- let cwd = void 0;
28493
- for (let i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) {
28494
- let path;
28495
- if (i >= 0) {
28496
- path = arguments[i];
28497
- } else {
28498
- const process = globalThis.process;
28499
- if (cwd === void 0 && "process" in globalThis && typeof process === "object" && process !== null && typeof process.cwd === "function") {
28500
- cwd = process.cwd();
28393
+ return false;
28394
+ };
28395
+ };
28396
+ var makeAndPredicate = (patterns) => {
28397
+ const predicates = patterns.map(makePredicate);
28398
+ const len = predicates.length;
28399
+ return (u) => {
28400
+ for (let i = 0; i < len; i++) {
28401
+ if (predicates[i](u) === false) {
28402
+ return false;
28501
28403
  }
28502
- path = cwd;
28503
- }
28504
- if (path.length === 0) {
28505
- continue;
28506
28404
  }
28507
- resolvedPath = path + "/" + resolvedPath;
28508
- resolvedAbsolute = path.charCodeAt(0) === 47;
28509
- }
28510
- resolvedPath = normalizeStringPosix(resolvedPath, !resolvedAbsolute);
28511
- if (resolvedAbsolute) {
28512
- if (resolvedPath.length > 0) {
28513
- return "/" + resolvedPath;
28514
- } else {
28515
- return "/";
28405
+ return true;
28406
+ };
28407
+ };
28408
+ var type = () => makeTypeMatcher(identity, []);
28409
+ var fn3 = (select) => makeTypeMatcher(select, []);
28410
+ var value4 = (i) => makeValueMatcher(i, fail2(i));
28411
+ var valueTags = /* @__PURE__ */ dual(2, (input, fields) => {
28412
+ const match10 = tagsExhaustive(fields)(makeTypeMatcher(identity, []));
28413
+ return match10(input);
28414
+ });
28415
+ var typeTags = () => (fields) => {
28416
+ const match10 = tagsExhaustive(fields)(makeTypeMatcher(identity, []));
28417
+ return (input) => match10(input);
28418
+ };
28419
+ var withReturnType = () => (self) => self;
28420
+ var when4 = (pattern, f) => (self) => self.add(makeWhen(makePredicate(pattern), f));
28421
+ var whenOr = (...args2) => (self) => {
28422
+ const onMatch = args2[args2.length - 1];
28423
+ const patterns = args2.slice(0, -1);
28424
+ return self.add(makeWhen(makeOrPredicate(patterns), onMatch));
28425
+ };
28426
+ var whenAnd = (...args2) => (self) => {
28427
+ const onMatch = args2[args2.length - 1];
28428
+ const patterns = args2.slice(0, -1);
28429
+ return self.add(makeWhen(makeAndPredicate(patterns), onMatch));
28430
+ };
28431
+ var discriminator = (field) => (...pattern) => {
28432
+ const f = pattern[pattern.length - 1];
28433
+ const values2 = pattern.slice(0, -1);
28434
+ const pred = values2.length === 1 ? (_) => _ != null && _[field] === values2[0] : (_) => _ != null && values2.includes(_[field]);
28435
+ return (self) => self.add(makeWhen(pred, f));
28436
+ };
28437
+ var discriminatorStartsWith = (field) => (pattern, f) => {
28438
+ const pred = (_) => _ != null && typeof _[field] === "string" && _[field].startsWith(pattern);
28439
+ return (self) => self.add(makeWhen(pred, f));
28440
+ };
28441
+ var discriminators = (field) => (fields) => {
28442
+ const predicate = makeWhen((arg) => arg != null && Object.hasOwn(fields, arg[field]), (data) => fields[data[field]](data));
28443
+ return (self) => self.add(predicate);
28444
+ };
28445
+ var discriminatorsExhaustive = (field) => (fields) => {
28446
+ const addCases = discriminators(field)(fields);
28447
+ return (matcher) => exhaustive(addCases(matcher));
28448
+ };
28449
+ var tag2 = /* @__PURE__ */ discriminator("_tag");
28450
+ var tagStartsWith = /* @__PURE__ */ discriminatorStartsWith("_tag");
28451
+ var tags = /* @__PURE__ */ discriminators("_tag");
28452
+ var tagsExhaustive = /* @__PURE__ */ discriminatorsExhaustive("_tag");
28453
+ var not2 = (pattern, f) => (self) => self.add(makeNot(makePredicate(pattern), f));
28454
+ var nonEmptyString = (u) => typeof u === "string" && u.length > 0;
28455
+ var is3 = (...literals) => {
28456
+ const len = literals.length;
28457
+ return (u) => {
28458
+ for (let i = 0; i < len; i++) {
28459
+ if (u === literals[i]) {
28460
+ return true;
28461
+ }
28516
28462
  }
28517
- } else if (resolvedPath.length > 0) {
28518
- return resolvedPath;
28519
- } else {
28520
- return ".";
28521
- }
28463
+ return false;
28464
+ };
28522
28465
  };
28523
- var CHAR_FORWARD_SLASH = 47;
28524
- function toFileUrl(filepath) {
28525
- const outURL = new URL("file://");
28526
- let resolved2 = resolve2(filepath);
28527
- const filePathLast = filepath.charCodeAt(filepath.length - 1);
28528
- if (filePathLast === CHAR_FORWARD_SLASH && resolved2[resolved2.length - 1] !== "/") {
28529
- resolved2 += "/";
28530
- }
28531
- outURL.pathname = encodePathChars(resolved2);
28532
- return succeed7(outURL);
28533
- }
28534
- var percentRegExp = /%/g;
28535
- var backslashRegExp = /\\/g;
28536
- var newlineRegExp = /\n/g;
28537
- var carriageReturnRegExp = /\r/g;
28538
- var tabRegExp = /\t/g;
28539
- function encodePathChars(filepath) {
28540
- if (filepath.includes("%")) {
28541
- filepath = filepath.replace(percentRegExp, "%25");
28466
+ var any2 = () => true;
28467
+ var defined = (u) => u !== void 0 && u !== null;
28468
+ var instanceOf2 = (constructor) => (u) => u instanceof constructor;
28469
+ var orElse3 = (f) => (self) => {
28470
+ const toResult = result4(self);
28471
+ if (isResult2(toResult)) {
28472
+ return toResult._tag === "Success" ? toResult.success : f(toResult.failure);
28542
28473
  }
28543
- if (filepath.includes("\\")) {
28544
- filepath = filepath.replace(backslashRegExp, "%5C");
28474
+ return (...args2) => {
28475
+ const a = toResult(...args2);
28476
+ return isSuccess2(a) ? a.success : f(a.failure, ...args2);
28477
+ };
28478
+ };
28479
+ var orElseAbsurd = (self) => orElse3(() => {
28480
+ throw new Error("effect/Match/orElseAbsurd: absurd");
28481
+ })(self);
28482
+ var result4 = (self) => {
28483
+ if (self._tag === "ValueMatcher") {
28484
+ return self.value;
28545
28485
  }
28546
- if (filepath.includes("\n")) {
28547
- filepath = filepath.replace(newlineRegExp, "%0A");
28486
+ const len = self.cases.length;
28487
+ if (len === 1) {
28488
+ const _case = self.cases[0];
28489
+ return (...args2) => {
28490
+ const input = self.select(...args2);
28491
+ if (_case._tag === "When" && _case.guard(input) === true) {
28492
+ return succeed2(_case.evaluate(input, ...args2));
28493
+ } else if (_case._tag === "Not" && _case.guard(input) === false) {
28494
+ return succeed2(_case.evaluate(input, ...args2));
28495
+ }
28496
+ return fail2(input);
28497
+ };
28548
28498
  }
28549
- if (filepath.includes("\r")) {
28550
- filepath = filepath.replace(carriageReturnRegExp, "%0D");
28499
+ return (...args2) => {
28500
+ const input = self.select(...args2);
28501
+ for (let i = 0; i < len; i++) {
28502
+ const _case = self.cases[i];
28503
+ if (_case._tag === "When" && _case.guard(input) === true) {
28504
+ return succeed2(_case.evaluate(input, ...args2));
28505
+ } else if (_case._tag === "Not" && _case.guard(input) === false) {
28506
+ return succeed2(_case.evaluate(input, ...args2));
28507
+ }
28508
+ }
28509
+ return fail2(input);
28510
+ };
28511
+ };
28512
+ var option3 = (self) => {
28513
+ const toResult = result4(self);
28514
+ if (isResult2(toResult)) {
28515
+ return match2(toResult, {
28516
+ onFailure: () => none2(),
28517
+ onSuccess: some3
28518
+ });
28551
28519
  }
28552
- if (filepath.includes(" ")) {
28553
- filepath = filepath.replace(tabRegExp, "%09");
28520
+ return (...args2) => match2(toResult(...args2), {
28521
+ onFailure: () => none2(),
28522
+ onSuccess: some3
28523
+ });
28524
+ };
28525
+ var getExhaustiveAbsurdErrorMessage = "effect/match/Match/exhaustive: absurd";
28526
+ var exhaustive = (self) => {
28527
+ const toResult = result4(self);
28528
+ if (isResult2(toResult)) {
28529
+ if (isSuccess2(toResult)) {
28530
+ return toResult.success;
28531
+ }
28532
+ throw new Error(getExhaustiveAbsurdErrorMessage);
28554
28533
  }
28555
- return filepath;
28556
- }
28557
- var posixImpl = /* @__PURE__ */ Path.of({
28558
- [TypeId42]: TypeId42,
28559
- resolve: resolve2,
28560
- normalize(path) {
28561
- if (path.length === 0) return ".";
28562
- const isAbsolute = path.charCodeAt(0) === 47;
28563
- const trailingSeparator = path.charCodeAt(path.length - 1) === 47;
28564
- path = normalizeStringPosix(path, !isAbsolute);
28565
- if (path.length === 0 && !isAbsolute) path = ".";
28566
- if (path.length > 0 && trailingSeparator) path += "/";
28567
- if (isAbsolute) return "/" + path;
28568
- return path;
28569
- },
28570
- isAbsolute(path) {
28571
- return path.length > 0 && path.charCodeAt(0) === 47;
28572
- },
28573
- join() {
28574
- if (arguments.length === 0) {
28575
- return ".";
28534
+ return (...args2) => {
28535
+ const result6 = toResult(...args2);
28536
+ if (isSuccess2(result6)) {
28537
+ return result6.success;
28576
28538
  }
28577
- let joined;
28578
- for (let i = 0; i < arguments.length; ++i) {
28579
- const arg = arguments[i];
28580
- if (arg.length > 0) {
28581
- if (joined === void 0) {
28582
- joined = arg;
28583
- } else {
28584
- joined += "/" + arg;
28585
- }
28586
- }
28587
- }
28588
- if (joined === void 0) {
28589
- return ".";
28590
- }
28591
- return posixImpl.normalize(joined);
28592
- },
28593
- relative(from, to) {
28594
- if (from === to) return "";
28595
- from = posixImpl.resolve(from);
28596
- to = posixImpl.resolve(to);
28597
- if (from === to) return "";
28598
- let fromStart = 1;
28599
- for (; fromStart < from.length; ++fromStart) {
28600
- if (from.charCodeAt(fromStart) !== 47) {
28601
- break;
28602
- }
28603
- }
28604
- const fromEnd = from.length;
28605
- const fromLen = fromEnd - fromStart;
28606
- let toStart = 1;
28607
- for (; toStart < to.length; ++toStart) {
28608
- if (to.charCodeAt(toStart) !== 47) {
28609
- break;
28610
- }
28611
- }
28612
- const toEnd = to.length;
28613
- const toLen = toEnd - toStart;
28614
- const length = fromLen < toLen ? fromLen : toLen;
28615
- let lastCommonSep = -1;
28616
- let i = 0;
28617
- for (; i <= length; ++i) {
28618
- if (i === length) {
28619
- if (toLen > length) {
28620
- if (to.charCodeAt(toStart + i) === 47) {
28621
- return to.slice(toStart + i + 1);
28622
- } else if (i === 0) {
28623
- return to.slice(toStart + i);
28624
- }
28625
- } else if (fromLen > length) {
28626
- if (from.charCodeAt(fromStart + i) === 47) {
28627
- lastCommonSep = i;
28628
- } else if (i === 0) {
28629
- lastCommonSep = 0;
28630
- }
28631
- }
28632
- break;
28633
- }
28634
- const fromCode = from.charCodeAt(fromStart + i);
28635
- const toCode = to.charCodeAt(toStart + i);
28636
- if (fromCode !== toCode) {
28637
- break;
28638
- } else if (fromCode === 47) {
28639
- lastCommonSep = i;
28640
- }
28641
- }
28642
- let out = "";
28643
- for (i = fromStart + lastCommonSep + 1; i <= fromEnd; ++i) {
28644
- if (i === fromEnd || from.charCodeAt(i) === 47) {
28645
- if (out.length === 0) {
28646
- out += "..";
28647
- } else {
28648
- out += "/..";
28649
- }
28650
- }
28651
- }
28652
- if (out.length > 0) {
28653
- return out + to.slice(toStart + lastCommonSep);
28654
- } else {
28655
- toStart += lastCommonSep;
28656
- if (to.charCodeAt(toStart) === 47) {
28657
- ++toStart;
28658
- }
28659
- return to.slice(toStart);
28660
- }
28661
- },
28662
- dirname(path) {
28663
- if (path.length === 0) return ".";
28664
- let code = path.charCodeAt(0);
28665
- const hasRoot = code === 47;
28666
- let end3 = -1;
28667
- let matchedSlash = true;
28668
- for (let i = path.length - 1; i >= 1; --i) {
28669
- code = path.charCodeAt(i);
28670
- if (code === 47) {
28671
- if (!matchedSlash) {
28672
- end3 = i;
28673
- break;
28674
- }
28675
- } else {
28676
- matchedSlash = false;
28677
- }
28678
- }
28679
- if (end3 === -1) return hasRoot ? "/" : ".";
28680
- if (hasRoot && end3 === 1) return "//";
28681
- return path.slice(0, end3);
28682
- },
28683
- basename(path, ext) {
28684
- let start = 0;
28685
- let end3 = -1;
28686
- let matchedSlash = true;
28687
- let i;
28688
- if (ext !== void 0 && ext.length > 0 && ext.length <= path.length) {
28689
- if (ext.length === path.length && ext === path) return "";
28690
- let extIdx = ext.length - 1;
28691
- let firstNonSlashEnd = -1;
28692
- for (i = path.length - 1; i >= 0; --i) {
28693
- const code = path.charCodeAt(i);
28694
- if (code === 47) {
28695
- if (!matchedSlash) {
28696
- start = i + 1;
28697
- break;
28698
- }
28699
- } else {
28700
- if (firstNonSlashEnd === -1) {
28701
- matchedSlash = false;
28702
- firstNonSlashEnd = i + 1;
28703
- }
28704
- if (extIdx >= 0) {
28705
- if (code === ext.charCodeAt(extIdx)) {
28706
- if (--extIdx === -1) {
28707
- end3 = i;
28708
- }
28709
- } else {
28710
- extIdx = -1;
28711
- end3 = firstNonSlashEnd;
28712
- }
28713
- }
28714
- }
28715
- }
28716
- if (start === end3) end3 = firstNonSlashEnd;
28717
- else if (end3 === -1) end3 = path.length;
28718
- return path.slice(start, end3);
28719
- } else {
28720
- for (i = path.length - 1; i >= 0; --i) {
28721
- if (path.charCodeAt(i) === 47) {
28722
- if (!matchedSlash) {
28723
- start = i + 1;
28724
- break;
28725
- }
28726
- } else if (end3 === -1) {
28727
- matchedSlash = false;
28728
- end3 = i + 1;
28729
- }
28730
- }
28731
- if (end3 === -1) return "";
28732
- return path.slice(start, end3);
28733
- }
28734
- },
28735
- extname(path) {
28736
- let startDot = -1;
28737
- let startPart = 0;
28738
- let end3 = -1;
28739
- let matchedSlash = true;
28740
- let preDotState = 0;
28741
- for (let i = path.length - 1; i >= 0; --i) {
28742
- const code = path.charCodeAt(i);
28743
- if (code === 47) {
28744
- if (!matchedSlash) {
28745
- startPart = i + 1;
28746
- break;
28747
- }
28748
- continue;
28749
- }
28750
- if (end3 === -1) {
28751
- matchedSlash = false;
28752
- end3 = i + 1;
28753
- }
28754
- if (code === 46) {
28755
- if (startDot === -1) {
28756
- startDot = i;
28757
- } else if (preDotState !== 1) {
28758
- preDotState = 1;
28759
- }
28760
- } else if (startDot !== -1) {
28761
- preDotState = -1;
28762
- }
28763
- }
28764
- if (startDot === -1 || end3 === -1 || // We saw a non-dot character immediately before the dot
28765
- preDotState === 0 || // The (right-most) trimmed path component is exactly '..'
28766
- preDotState === 1 && startDot === end3 - 1 && startDot === startPart + 1) {
28767
- return "";
28768
- }
28769
- return path.slice(startDot, end3);
28770
- },
28771
- format: function format8(pathObject) {
28772
- if (pathObject === null || typeof pathObject !== "object") {
28773
- throw new TypeError('The "pathObject" argument must be of type Object. Received type ' + typeof pathObject);
28774
- }
28775
- return _format("/", pathObject);
28776
- },
28777
- parse(path) {
28778
- const ret = {
28779
- root: "",
28780
- dir: "",
28781
- base: "",
28782
- ext: "",
28783
- name: ""
28784
- };
28785
- if (path.length === 0) return ret;
28786
- let code = path.charCodeAt(0);
28787
- const isAbsolute = code === 47;
28788
- let start;
28789
- if (isAbsolute) {
28790
- ret.root = "/";
28791
- start = 1;
28792
- } else {
28793
- start = 0;
28794
- }
28795
- let startDot = -1;
28796
- let startPart = 0;
28797
- let end3 = -1;
28798
- let matchedSlash = true;
28799
- let i = path.length - 1;
28800
- let preDotState = 0;
28801
- for (; i >= start; --i) {
28802
- code = path.charCodeAt(i);
28803
- if (code === 47) {
28804
- if (!matchedSlash) {
28805
- startPart = i + 1;
28806
- break;
28807
- }
28808
- continue;
28809
- }
28810
- if (end3 === -1) {
28811
- matchedSlash = false;
28812
- end3 = i + 1;
28813
- }
28814
- if (code === 46) {
28815
- if (startDot === -1) startDot = i;
28816
- else if (preDotState !== 1) preDotState = 1;
28817
- } else if (startDot !== -1) {
28818
- preDotState = -1;
28819
- }
28820
- }
28821
- if (startDot === -1 || end3 === -1 || // We saw a non-dot character immediately before the dot
28822
- preDotState === 0 || // The (right-most) trimmed path component is exactly '..'
28823
- preDotState === 1 && startDot === end3 - 1 && startDot === startPart + 1) {
28824
- if (end3 !== -1) {
28825
- if (startPart === 0 && isAbsolute) ret.base = ret.name = path.slice(1, end3);
28826
- else ret.base = ret.name = path.slice(startPart, end3);
28827
- }
28828
- } else {
28829
- if (startPart === 0 && isAbsolute) {
28830
- ret.name = path.slice(1, startDot);
28831
- ret.base = path.slice(1, end3);
28832
- } else {
28833
- ret.name = path.slice(startPart, startDot);
28834
- ret.base = path.slice(startPart, end3);
28835
- }
28836
- ret.ext = path.slice(startDot, end3);
28837
- }
28838
- if (startPart > 0) ret.dir = path.slice(0, startPart - 1);
28839
- else if (isAbsolute) ret.dir = "/";
28840
- return ret;
28841
- },
28842
- sep: "/",
28843
- fromFileUrl,
28844
- toFileUrl,
28845
- toNamespacedPath: identity
28846
- });
28539
+ throw new Error(getExhaustiveAbsurdErrorMessage);
28540
+ };
28541
+ };
28542
+
28543
+ // ../../node_modules/.bun/effect@https+++pkg.pr.new+Effect-TS+effect+effect@c7d1ffff31a3e2ae0b0b+a654a55b752bdb24/node_modules/effect/dist/Match.js
28544
+ var type2 = type;
28545
+ var fn4 = fn3;
28546
+ var value5 = value4;
28547
+ var valueTags2 = valueTags;
28548
+ var typeTags2 = typeTags;
28549
+ var withReturnType2 = withReturnType;
28550
+ var when5 = when4;
28551
+ var whenOr2 = whenOr;
28552
+ var whenAnd2 = whenAnd;
28553
+ var discriminator2 = discriminator;
28554
+ var discriminatorStartsWith2 = discriminatorStartsWith;
28555
+ var discriminators2 = discriminators;
28556
+ var discriminatorsExhaustive2 = discriminatorsExhaustive;
28557
+ var tag3 = tag2;
28558
+ var tagStartsWith2 = tagStartsWith;
28559
+ var tags2 = tags;
28560
+ var tagsExhaustive2 = tagsExhaustive;
28561
+ var not3 = not2;
28562
+ var nonEmptyString2 = nonEmptyString;
28563
+ var is4 = is3;
28564
+ var string3 = isString;
28565
+ var number3 = isNumber;
28566
+ var any3 = any2;
28567
+ var defined2 = defined;
28568
+ var boolean2 = isBoolean;
28569
+ var _undefined = isUndefined;
28570
+ var _null = isNull;
28571
+ var bigint = isBigInt;
28572
+ var symbol4 = isSymbol;
28573
+ var date = isDate;
28574
+ var record2 = isObject;
28575
+ var instanceOf3 = instanceOf2;
28576
+ var instanceOfUnsafe = instanceOf2;
28577
+ var orElse4 = orElse3;
28578
+ var orElseAbsurd2 = orElseAbsurd;
28579
+ var result5 = result4;
28580
+ var option4 = option3;
28581
+ var exhaustive2 = exhaustive;
28847
28582
 
28848
- // ../../node_modules/.bun/effect@https+++pkg.pr.new+Effect-TS+effect+effect@c7d1ffff31a3e2ae0b0b+a654a55b752bdb24/node_modules/effect/dist/ConfigProvider.js
28849
- function makeValue(value6) {
28850
- return {
28851
- _tag: "Value",
28852
- value: value6
28853
- };
28854
- }
28855
- function makeRecord(keys4, value6) {
28856
- return {
28857
- _tag: "Record",
28858
- keys: keys4,
28859
- value: value6
28860
- };
28861
- }
28862
- function makeArray(length, value6) {
28863
- return {
28864
- _tag: "Array",
28865
- length,
28866
- value: value6
28867
- };
28868
- }
28869
- var ConfigProvider = /* @__PURE__ */ Reference("effect/ConfigProvider", {
28870
- defaultValue: () => fromEnv()
28583
+ // ../../node_modules/.bun/effect@https+++pkg.pr.new+Effect-TS+effect+effect@c7d1ffff31a3e2ae0b0b+a654a55b752bdb24/node_modules/effect/dist/Ref.js
28584
+ var Ref_exports = {};
28585
+ __export(Ref_exports, {
28586
+ get: () => get10,
28587
+ getAndSet: () => getAndSet,
28588
+ getAndUpdate: () => getAndUpdate,
28589
+ getAndUpdateSome: () => getAndUpdateSome,
28590
+ getUnsafe: () => getUnsafe5,
28591
+ make: () => make38,
28592
+ makeUnsafe: () => makeUnsafe10,
28593
+ modify: () => modify4,
28594
+ modifySome: () => modifySome,
28595
+ set: () => set8,
28596
+ setAndGet: () => setAndGet,
28597
+ update: () => update2,
28598
+ updateAndGet: () => updateAndGet,
28599
+ updateSome: () => updateSome,
28600
+ updateSomeAndGet: () => updateSomeAndGet
28871
28601
  });
28872
- var Proto8 = {
28602
+ var TypeId41 = "~effect/Ref";
28603
+ var RefProto = {
28604
+ [TypeId41]: {
28605
+ _A: identity
28606
+ },
28873
28607
  ...PipeInspectableProto,
28874
28608
  toJSON() {
28875
28609
  return {
28876
- _id: "ConfigProvider"
28610
+ _id: "Ref",
28611
+ ref: this.ref
28877
28612
  };
28878
28613
  }
28879
28614
  };
28880
- var identityPath = (path) => path;
28881
- function makeProvider(load, mapInput4) {
28882
- const self = Object.create(Proto8);
28883
- self.load = load;
28884
- self.mapInput = mapInput4;
28615
+ var makeUnsafe10 = (value6) => {
28616
+ const self = Object.create(RefProto);
28617
+ self.ref = make30(value6);
28885
28618
  return self;
28886
- }
28887
- function makeSource(get12, transform4) {
28888
- return makeProvider((path) => get12(transform4(path)), (f) => makeSource(get12, flow(transform4, f)));
28889
- }
28890
- function make39(get12) {
28891
- return makeSource(get12, identityPath);
28892
- }
28893
- function emptyStringAsMissing(value6, preserveEmptyStrings) {
28894
- return value6 === "" && !preserveEmptyStrings ? void 0 : value6;
28895
- }
28896
- function fromEnvRecord(env, options) {
28897
- const preserveEmptyStrings = options?.preserveEmptyStrings === true;
28898
- const trie = buildEnvTrie(env);
28899
- return make39((path) => succeed7(nodeAtEnv(trie, env, path, preserveEmptyStrings)));
28900
- }
28901
- function fromEnv(options) {
28902
- const env = options?.env ?? {
28903
- ...globalThis.process?.env,
28904
- ...import.meta?.env
28905
- };
28906
- return fromEnvRecord(env, {
28907
- preserveEmptyStrings: options?.preserveEmptyStrings
28908
- });
28909
- }
28910
- function buildEnvTrie(env) {
28911
- const trie = {};
28912
- for (const [name, value6] of Object.entries(env)) {
28913
- if (value6 === void 0) continue;
28914
- const segments = name.split("_");
28915
- let node = trie;
28916
- for (const seg of segments) {
28917
- const children = node.children ??= /* @__PURE__ */ Object.create(null);
28918
- node = children[seg] ??= {};
28619
+ };
28620
+ var make38 = (value6) => sync4(() => makeUnsafe10(value6));
28621
+ var get10 = (self) => sync4(() => self.ref.current);
28622
+ var set8 = /* @__PURE__ */ dual(2, (self, value6) => sync4(() => set6(self.ref, value6)));
28623
+ var getAndSet = /* @__PURE__ */ dual(2, (self, value6) => sync4(() => {
28624
+ const current = self.ref.current;
28625
+ self.ref.current = value6;
28626
+ return current;
28627
+ }));
28628
+ var getAndUpdate = /* @__PURE__ */ dual(2, (self, f) => sync4(() => {
28629
+ const current = self.ref.current;
28630
+ self.ref.current = f(current);
28631
+ return current;
28632
+ }));
28633
+ var getAndUpdateSome = /* @__PURE__ */ dual(2, (self, pf) => sync4(() => {
28634
+ const current = self.ref.current;
28635
+ const option6 = pf(current);
28636
+ if (option6._tag === "Some") {
28637
+ self.ref.current = option6.value;
28638
+ }
28639
+ return current;
28640
+ }));
28641
+ var setAndGet = /* @__PURE__ */ dual(2, (self, value6) => sync4(() => self.ref.current = value6));
28642
+ var modify4 = /* @__PURE__ */ dual(2, (self, f) => sync4(() => {
28643
+ const [b, a] = f(self.ref.current);
28644
+ self.ref.current = a;
28645
+ return b;
28646
+ }));
28647
+ var modifySome = /* @__PURE__ */ dual(2, (self, pf) => modify4(self, (value6) => {
28648
+ const [b, option6] = pf(value6);
28649
+ return [b, option6._tag === "None" ? value6 : option6.value];
28650
+ }));
28651
+ var update2 = /* @__PURE__ */ dual(2, (self, f) => sync4(() => {
28652
+ self.ref.current = f(self.ref.current);
28653
+ }));
28654
+ var updateAndGet = /* @__PURE__ */ dual(2, (self, f) => sync4(() => self.ref.current = f(self.ref.current)));
28655
+ var updateSome = /* @__PURE__ */ dual(2, (self, f) => sync4(() => {
28656
+ const option6 = f(self.ref.current);
28657
+ if (option6._tag === "Some") {
28658
+ self.ref.current = option6.value;
28659
+ }
28660
+ }));
28661
+ var updateSomeAndGet = /* @__PURE__ */ dual(2, (self, pf) => sync4(() => {
28662
+ const option6 = pf(self.ref.current);
28663
+ if (option6._tag === "Some") {
28664
+ self.ref.current = option6.value;
28665
+ }
28666
+ return self.ref.current;
28667
+ }));
28668
+ var getUnsafe5 = (self) => self.ref.current;
28669
+
28670
+ // ../../node_modules/.bun/effect@https+++pkg.pr.new+Effect-TS+effect+effect@c7d1ffff31a3e2ae0b0b+a654a55b752bdb24/node_modules/effect/dist/ChannelSchema.js
28671
+ var decode2 = (schema2, options) => () => {
28672
+ const decode3 = decodeEffect2(NonEmptyArray(schema2), options);
28673
+ return fromTransform((upstream, _scope) => succeed7(flatMap5(upstream, (chunk) => decode3(chunk))));
28674
+ };
28675
+
28676
+ // ../../node_modules/.bun/effect@https+++pkg.pr.new+Effect-TS+effect+effect@c7d1ffff31a3e2ae0b0b+a654a55b752bdb24/node_modules/effect/dist/PlatformError.js
28677
+ var TypeId42 = "~effect/PlatformError";
28678
+ var BadArgument = class extends (/* @__PURE__ */ TaggedError2("BadArgument")) {
28679
+ /**
28680
+ * Formats the module, method, and optional description that rejected the argument.
28681
+ *
28682
+ * **When to use**
28683
+ *
28684
+ * Use to read the formatted error message for a rejected platform argument.
28685
+ *
28686
+ * @since 4.0.0
28687
+ */
28688
+ get message() {
28689
+ return `${this.module}.${this.method}${this.description ? `: ${this.description}` : ""}`;
28690
+ }
28691
+ };
28692
+ var PlatformError = class extends (/* @__PURE__ */ TaggedError2("PlatformError")) {
28693
+ constructor(reason) {
28694
+ if ("cause" in reason) {
28695
+ super({
28696
+ reason,
28697
+ cause: reason.cause
28698
+ });
28699
+ } else {
28700
+ super({
28701
+ reason
28702
+ });
28703
+ }
28704
+ }
28705
+ /**
28706
+ * Marks this value as a platform error wrapper for runtime guards.
28707
+ *
28708
+ * **When to use**
28709
+ *
28710
+ * Use to identify `PlatformError` values through their runtime type marker.
28711
+ *
28712
+ * @since 4.0.0
28713
+ */
28714
+ [TypeId42] = TypeId42;
28715
+ get message() {
28716
+ return this.reason.message;
28717
+ }
28718
+ };
28719
+ var badArgument = (options) => new PlatformError(new BadArgument(options));
28720
+
28721
+ // ../../node_modules/.bun/effect@https+++pkg.pr.new+Effect-TS+effect+effect@c7d1ffff31a3e2ae0b0b+a654a55b752bdb24/node_modules/effect/dist/FileSystem.js
28722
+ var FileSystem = /* @__PURE__ */ Service("effect/FileSystem");
28723
+
28724
+ // ../../node_modules/.bun/effect@https+++pkg.pr.new+Effect-TS+effect+effect@c7d1ffff31a3e2ae0b0b+a654a55b752bdb24/node_modules/effect/dist/Path.js
28725
+ var TypeId43 = "~effect/Path";
28726
+ var Path = /* @__PURE__ */ Service("effect/Path");
28727
+ function normalizeStringPosix(path, allowAboveRoot) {
28728
+ let res = "";
28729
+ let lastSegmentLength = 0;
28730
+ let lastSlash = -1;
28731
+ let dots = 0;
28732
+ let code;
28733
+ for (let i = 0; i <= path.length; ++i) {
28734
+ if (i < path.length) {
28735
+ code = path.charCodeAt(i);
28736
+ } else if (code === 47) {
28737
+ break;
28738
+ } else {
28739
+ code = 47;
28740
+ }
28741
+ if (code === 47) {
28742
+ if (lastSlash === i - 1 || dots === 1) {
28743
+ } else if (lastSlash !== i - 1 && dots === 2) {
28744
+ if (res.length < 2 || lastSegmentLength !== 2 || res.charCodeAt(res.length - 1) !== 46 || res.charCodeAt(res.length - 2) !== 46) {
28745
+ if (res.length > 2) {
28746
+ const lastSlashIndex = res.lastIndexOf("/");
28747
+ if (lastSlashIndex !== res.length - 1) {
28748
+ if (lastSlashIndex === -1) {
28749
+ res = "";
28750
+ lastSegmentLength = 0;
28751
+ } else {
28752
+ res = res.slice(0, lastSlashIndex);
28753
+ lastSegmentLength = res.length - 1 - res.lastIndexOf("/");
28754
+ }
28755
+ lastSlash = i;
28756
+ dots = 0;
28757
+ continue;
28758
+ }
28759
+ } else if (res.length === 2 || res.length === 1) {
28760
+ res = "";
28761
+ lastSegmentLength = 0;
28762
+ lastSlash = i;
28763
+ dots = 0;
28764
+ continue;
28765
+ }
28766
+ }
28767
+ if (allowAboveRoot) {
28768
+ if (res.length > 0) {
28769
+ res += "/..";
28770
+ } else {
28771
+ res = "..";
28772
+ }
28773
+ lastSegmentLength = 2;
28774
+ }
28775
+ } else {
28776
+ if (res.length > 0) {
28777
+ res += "/" + path.slice(lastSlash + 1, i);
28778
+ } else {
28779
+ res = path.slice(lastSlash + 1, i);
28780
+ }
28781
+ lastSegmentLength = i - lastSlash - 1;
28782
+ }
28783
+ lastSlash = i;
28784
+ dots = 0;
28785
+ } else if (code === 46 && dots !== -1) {
28786
+ ++dots;
28787
+ } else {
28788
+ dots = -1;
28919
28789
  }
28920
28790
  }
28921
- return trie;
28791
+ return res;
28922
28792
  }
28923
- function nodeAtEnv(trie, env, path, preserveEmptyStrings) {
28924
- const key = path.map(String).join("_");
28925
- const leafValue = emptyStringAsMissing(Object.hasOwn(env, key) ? env[key] : void 0, preserveEmptyStrings);
28926
- const trieNode = trieNodeAt(trie, path);
28927
- const children = trieNode?.children ? Object.keys(trieNode.children) : [];
28928
- if (children.length === 0) {
28929
- return leafValue === void 0 ? void 0 : makeValue(leafValue);
28930
- }
28931
- const allNumeric = children.every(isCanonicalArrayIndex);
28932
- if (allNumeric) {
28933
- const length = Math.max(...children.map((k) => parseInt(k, 10))) + 1;
28934
- return makeArray(length, leafValue);
28793
+ function _format(sep, pathObject) {
28794
+ const dir = pathObject.dir || pathObject.root;
28795
+ const base = pathObject.base || (pathObject.name || "") + (pathObject.ext || "");
28796
+ if (!dir) {
28797
+ return base;
28935
28798
  }
28936
- return makeRecord(new Set(children), leafValue);
28937
- }
28938
- function trieNodeAt(root, path) {
28939
- if (path.length === 0) return root;
28940
- let node = root;
28941
- for (const seg of path) {
28942
- node = node?.children?.[String(seg)];
28943
- if (!node) return void 0;
28799
+ if (dir === pathObject.root) {
28800
+ return dir + base;
28944
28801
  }
28945
- return node;
28802
+ return dir + sep + base;
28946
28803
  }
28947
-
28948
- // ../../node_modules/.bun/effect@https+++pkg.pr.new+Effect-TS+effect+effect@c7d1ffff31a3e2ae0b0b+a654a55b752bdb24/node_modules/effect/dist/Config.js
28949
- var TypeId43 = "~effect/Config";
28950
- var ConfigError = class {
28951
- _tag = "ConfigError";
28952
- name = "ConfigError";
28953
- cause;
28954
- constructor(cause) {
28955
- this.cause = cause;
28804
+ function fromFileUrl(url) {
28805
+ if (url.protocol !== "file:") {
28806
+ return fail7(new BadArgument({
28807
+ module: "Path",
28808
+ method: "fromFileUrl",
28809
+ description: "URL must be of scheme file"
28810
+ }));
28811
+ } else if (url.hostname !== "") {
28812
+ return fail7(new BadArgument({
28813
+ module: "Path",
28814
+ method: "fromFileUrl",
28815
+ description: "Invalid file URL host"
28816
+ }));
28956
28817
  }
28957
- get message() {
28958
- return this.cause.toString();
28818
+ const pathname = url.pathname;
28819
+ for (let n = 0; n < pathname.length; n++) {
28820
+ if (pathname[n] === "%") {
28821
+ const third = pathname.codePointAt(n + 2) | 32;
28822
+ if (pathname[n + 1] === "2" && third === 102) {
28823
+ return fail7(new BadArgument({
28824
+ module: "Path",
28825
+ method: "fromFileUrl",
28826
+ description: "must not include encoded / characters"
28827
+ }));
28828
+ }
28829
+ }
28959
28830
  }
28960
- toString() {
28961
- return `ConfigError(${this.message})`;
28831
+ return succeed7(decodeURIComponent(pathname));
28832
+ }
28833
+ var resolve2 = function resolve3() {
28834
+ let resolvedPath = "";
28835
+ let resolvedAbsolute = false;
28836
+ let cwd = void 0;
28837
+ for (let i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) {
28838
+ let path;
28839
+ if (i >= 0) {
28840
+ path = arguments[i];
28841
+ } else {
28842
+ const process = globalThis.process;
28843
+ if (cwd === void 0 && "process" in globalThis && typeof process === "object" && process !== null && typeof process.cwd === "function") {
28844
+ cwd = process.cwd();
28845
+ }
28846
+ path = cwd;
28847
+ }
28848
+ if (path.length === 0) {
28849
+ continue;
28850
+ }
28851
+ resolvedPath = path + "/" + resolvedPath;
28852
+ resolvedAbsolute = path.charCodeAt(0) === 47;
28962
28853
  }
28963
- };
28964
- var Proto9 = {
28965
- .../* @__PURE__ */ Prototype2({
28966
- label: "Config",
28967
- evaluate(fiber3) {
28968
- return this.parse(fiber3.getRef(ConfigProvider));
28854
+ resolvedPath = normalizeStringPosix(resolvedPath, !resolvedAbsolute);
28855
+ if (resolvedAbsolute) {
28856
+ if (resolvedPath.length > 0) {
28857
+ return "/" + resolvedPath;
28858
+ } else {
28859
+ return "/";
28969
28860
  }
28970
- }),
28971
- [TypeId43]: TypeId43,
28972
- toJSON() {
28973
- return {
28974
- _id: "Config"
28975
- };
28861
+ } else if (resolvedPath.length > 0) {
28862
+ return resolvedPath;
28863
+ } else {
28864
+ return ".";
28976
28865
  }
28977
28866
  };
28978
- function make40(evaluator) {
28979
- const self = Object.create(Proto9);
28980
- self.evaluator = evaluator;
28981
- self.parse = (provider) => evaluator(provider, []).pipe(mapErrorEager2((failure) => failure.error), flatMapEager2((resolution) => resolution._tag === "Resolved" ? succeed7(resolution.value) : fail7(resolution.error)));
28982
- return self;
28867
+ var CHAR_FORWARD_SLASH = 47;
28868
+ function toFileUrl(filepath) {
28869
+ const outURL = new URL("file://");
28870
+ let resolved2 = resolve2(filepath);
28871
+ const filePathLast = filepath.charCodeAt(filepath.length - 1);
28872
+ if (filePathLast === CHAR_FORWARD_SLASH && resolved2[resolved2.length - 1] !== "/") {
28873
+ resolved2 += "/";
28874
+ }
28875
+ outURL.pathname = encodePathChars(resolved2);
28876
+ return succeed7(outURL);
28983
28877
  }
28984
- var evaluateAt = (self, provider, pathPrefix) => self.evaluator(provider, pathPrefix);
28985
- var resolved = (value6, hasInput2) => ({
28986
- _tag: "Resolved",
28987
- value: value6,
28988
- hasInput: hasInput2
28989
- });
28990
- var absent = (error) => ({
28991
- _tag: "Absent",
28992
- error
28993
- });
28994
- var evaluationFailure = (error, hasInput2) => ({
28995
- error,
28996
- hasInput: hasInput2
28997
- });
28998
- var isSourceError = (u) => isTagged(u, "SourceError");
28999
- var catchSourceError = (self, hasInput2) => self.pipe(catchDefect2((defect) => isSourceError(defect) ? fail7(evaluationFailure(new ConfigError(defect), hasInput2)) : die5(defect)));
29000
- var preserveInputEvidence = (self, hasInput2) => {
29001
- if (!hasInput2) return self;
29002
- return self.pipe(mapErrorEager2((failure) => evaluationFailure(failure.error, true)), flatMapEager2((resolution) => resolution._tag === "Resolved" ? succeed7(resolved(resolution.value, true)) : fail7(evaluationFailure(resolution.error, true))));
29003
- };
29004
- var map14 = /* @__PURE__ */ dual(2, (self, f) => {
29005
- return make40((provider, pathPrefix) => map9(evaluateAt(self, provider, pathPrefix), (resolution) => resolution._tag === "Resolved" ? resolved(f(resolution.value), resolution.hasInput) : resolution));
29006
- });
29007
- var orElse3 = /* @__PURE__ */ dual(2, (self, that) => {
29008
- return make40((provider, pathPrefix) => matchEffect3(evaluateAt(self, provider, pathPrefix), {
29009
- onFailure: (failure) => preserveInputEvidence(evaluateAt(that(failure.error), provider, pathPrefix), failure.hasInput),
29010
- onSuccess: (resolution) => resolution._tag === "Absent" ? evaluateAt(that(resolution.error), provider, pathPrefix) : succeed7(resolution)
29011
- }));
29012
- });
29013
- function all5(arg) {
29014
- const configs = globalThis.Array.isArray(arg) ? arg : Symbol.iterator in arg ? [...arg] : arg;
29015
- if (globalThis.Array.isArray(configs)) {
29016
- return make40((provider, pathPrefix) => flatMapEager2(all4(configs.map((config) => result2(evaluateAt(config, provider, pathPrefix)))), resolveArray));
29017
- } else {
29018
- return make40((provider, pathPrefix) => flatMapEager2(all4(map3(configs, (config) => result2(evaluateAt(config, provider, pathPrefix)))), resolveRecord));
28878
+ var percentRegExp = /%/g;
28879
+ var backslashRegExp = /\\/g;
28880
+ var newlineRegExp = /\n/g;
28881
+ var carriageReturnRegExp = /\r/g;
28882
+ var tabRegExp = /\t/g;
28883
+ function encodePathChars(filepath) {
28884
+ if (filepath.includes("%")) {
28885
+ filepath = filepath.replace(percentRegExp, "%25");
28886
+ }
28887
+ if (filepath.includes("\\")) {
28888
+ filepath = filepath.replace(backslashRegExp, "%5C");
28889
+ }
28890
+ if (filepath.includes("\n")) {
28891
+ filepath = filepath.replace(newlineRegExp, "%0A");
28892
+ }
28893
+ if (filepath.includes("\r")) {
28894
+ filepath = filepath.replace(carriageReturnRegExp, "%0D");
28895
+ }
28896
+ if (filepath.includes(" ")) {
28897
+ filepath = filepath.replace(tabRegExp, "%09");
29019
28898
  }
28899
+ return filepath;
29020
28900
  }
29021
- var resolveArray = (results) => {
29022
- const values2 = [];
29023
- let firstFailure;
29024
- let firstAbsent;
29025
- let hasInput2 = false;
29026
- for (const result6 of results) {
29027
- if (isFailure2(result6)) {
29028
- firstFailure ??= result6.failure;
29029
- hasInput2 = hasInput2 || result6.failure.hasInput;
29030
- continue;
28901
+ var posixImpl = /* @__PURE__ */ Path.of({
28902
+ [TypeId43]: TypeId43,
28903
+ resolve: resolve2,
28904
+ normalize(path) {
28905
+ if (path.length === 0) return ".";
28906
+ const isAbsolute = path.charCodeAt(0) === 47;
28907
+ const trailingSeparator = path.charCodeAt(path.length - 1) === 47;
28908
+ path = normalizeStringPosix(path, !isAbsolute);
28909
+ if (path.length === 0 && !isAbsolute) path = ".";
28910
+ if (path.length > 0 && trailingSeparator) path += "/";
28911
+ if (isAbsolute) return "/" + path;
28912
+ return path;
28913
+ },
28914
+ isAbsolute(path) {
28915
+ return path.length > 0 && path.charCodeAt(0) === 47;
28916
+ },
28917
+ join() {
28918
+ if (arguments.length === 0) {
28919
+ return ".";
28920
+ }
28921
+ let joined;
28922
+ for (let i = 0; i < arguments.length; ++i) {
28923
+ const arg = arguments[i];
28924
+ if (arg.length > 0) {
28925
+ if (joined === void 0) {
28926
+ joined = arg;
28927
+ } else {
28928
+ joined += "/" + arg;
28929
+ }
28930
+ }
28931
+ }
28932
+ if (joined === void 0) {
28933
+ return ".";
28934
+ }
28935
+ return posixImpl.normalize(joined);
28936
+ },
28937
+ relative(from, to) {
28938
+ if (from === to) return "";
28939
+ from = posixImpl.resolve(from);
28940
+ to = posixImpl.resolve(to);
28941
+ if (from === to) return "";
28942
+ let fromStart = 1;
28943
+ for (; fromStart < from.length; ++fromStart) {
28944
+ if (from.charCodeAt(fromStart) !== 47) {
28945
+ break;
28946
+ }
28947
+ }
28948
+ const fromEnd = from.length;
28949
+ const fromLen = fromEnd - fromStart;
28950
+ let toStart = 1;
28951
+ for (; toStart < to.length; ++toStart) {
28952
+ if (to.charCodeAt(toStart) !== 47) {
28953
+ break;
28954
+ }
29031
28955
  }
29032
- const resolution = result6.success;
29033
- if (resolution._tag === "Absent") {
29034
- firstAbsent ??= resolution;
29035
- } else {
29036
- values2.push(resolution.value);
29037
- hasInput2 = hasInput2 || resolution.hasInput;
28956
+ const toEnd = to.length;
28957
+ const toLen = toEnd - toStart;
28958
+ const length = fromLen < toLen ? fromLen : toLen;
28959
+ let lastCommonSep = -1;
28960
+ let i = 0;
28961
+ for (; i <= length; ++i) {
28962
+ if (i === length) {
28963
+ if (toLen > length) {
28964
+ if (to.charCodeAt(toStart + i) === 47) {
28965
+ return to.slice(toStart + i + 1);
28966
+ } else if (i === 0) {
28967
+ return to.slice(toStart + i);
28968
+ }
28969
+ } else if (fromLen > length) {
28970
+ if (from.charCodeAt(fromStart + i) === 47) {
28971
+ lastCommonSep = i;
28972
+ } else if (i === 0) {
28973
+ lastCommonSep = 0;
28974
+ }
28975
+ }
28976
+ break;
28977
+ }
28978
+ const fromCode = from.charCodeAt(fromStart + i);
28979
+ const toCode = to.charCodeAt(toStart + i);
28980
+ if (fromCode !== toCode) {
28981
+ break;
28982
+ } else if (fromCode === 47) {
28983
+ lastCommonSep = i;
28984
+ }
29038
28985
  }
29039
- }
29040
- if (firstFailure !== void 0) {
29041
- return fail7(evaluationFailure(firstFailure.error, hasInput2));
29042
- }
29043
- if (firstAbsent !== void 0) {
29044
- return hasInput2 ? fail7(evaluationFailure(firstAbsent.error, true)) : succeed7(firstAbsent);
29045
- }
29046
- return succeed7(resolved(values2, hasInput2));
29047
- };
29048
- var resolveRecord = (results) => {
29049
- const values2 = {};
29050
- let firstFailure;
29051
- let firstAbsent;
29052
- let hasInput2 = false;
29053
- for (const key in results) {
29054
- const result6 = results[key];
29055
- if (isFailure2(result6)) {
29056
- firstFailure ??= result6.failure;
29057
- hasInput2 = hasInput2 || result6.failure.hasInput;
29058
- continue;
28986
+ let out = "";
28987
+ for (i = fromStart + lastCommonSep + 1; i <= fromEnd; ++i) {
28988
+ if (i === fromEnd || from.charCodeAt(i) === 47) {
28989
+ if (out.length === 0) {
28990
+ out += "..";
28991
+ } else {
28992
+ out += "/..";
28993
+ }
28994
+ }
29059
28995
  }
29060
- const resolution = result6.success;
29061
- if (resolution._tag === "Absent") {
29062
- firstAbsent ??= resolution;
28996
+ if (out.length > 0) {
28997
+ return out + to.slice(toStart + lastCommonSep);
29063
28998
  } else {
29064
- assignProperty(values2, key, resolution.value);
29065
- hasInput2 = hasInput2 || resolution.hasInput;
28999
+ toStart += lastCommonSep;
29000
+ if (to.charCodeAt(toStart) === 47) {
29001
+ ++toStart;
29002
+ }
29003
+ return to.slice(toStart);
29066
29004
  }
29067
- }
29068
- if (firstFailure !== void 0) {
29069
- return fail7(evaluationFailure(firstFailure.error, hasInput2));
29070
- }
29071
- if (firstAbsent !== void 0) {
29072
- return hasInput2 ? fail7(evaluationFailure(firstAbsent.error, true)) : succeed7(firstAbsent);
29073
- }
29074
- return succeed7(resolved(values2, hasInput2));
29075
- };
29076
- var withDefault2 = /* @__PURE__ */ dual(2, (self, defaultValue) => {
29077
- return make40((provider, pathPrefix) => mapEager2(evaluateAt(self, provider, pathPrefix), (resolution) => resolution._tag === "Absent" ? resolved(defaultValue, false) : resolution));
29078
- });
29079
- var option3 = (self) => self.pipe(map14(some3), withDefault2(none2()));
29080
- var cursorToString = () => "<configuration>";
29081
- var loadCursor = (provider, path) => provider.load(path).pipe(orDie3, mapEager2((node) => ({
29082
- provider,
29083
- path,
29084
- node,
29085
- toString: cursorToString
29086
- })));
29087
- var loadChildCursor = (cursor, segment) => loadCursor(cursor.provider, [...cursor.path, segment]);
29088
- var getScalar = (node) => node?.value;
29089
- var decodeFromCursor = (ast, decode3) => decodeTo(unknown, ast, new Transformation(transformEffect((input) => decode3(input)), passthrough2()));
29090
- var isScalarInput = (ast) => {
29091
- switch (ast._tag) {
29092
- case "Union":
29093
- return ast.types.every(isScalarInput);
29094
- case "Objects":
29095
- case "Arrays":
29096
- case "Suspend":
29097
- return false;
29098
- default:
29099
- return true;
29100
- }
29101
- };
29102
- var hasProviderInput = (ast, node) => {
29103
- switch (ast._tag) {
29104
- case "Objects":
29105
- return node?._tag === "Record";
29106
- case "Arrays":
29107
- return node?._tag === "Array";
29108
- case "Union":
29109
- return ast.types.some((ast2) => hasProviderInput(ast2, node));
29110
- case "Suspend":
29111
- return hasProviderInput(ast.thunk(), node);
29112
- default:
29113
- return getScalar(node) !== void 0;
29114
- }
29115
- };
29116
- var toConfigCursorAST = /* @__PURE__ */ memoize((root) => {
29117
- const seen = /* @__PURE__ */ new WeakSet();
29118
- const recur2 = applyToSelfOrLastLinkEncoding((ast) => {
29119
- seen.add(ast);
29120
- switch (ast._tag) {
29121
- case "Objects": {
29122
- const matchesIndex = ast.indexSignatures.map((is5) => _is(is5.parameter));
29123
- const materialize = fnUntraced2(function* (cursor) {
29124
- if (cursor.node?._tag !== "Record") {
29125
- return void 0;
29005
+ },
29006
+ dirname(path) {
29007
+ if (path.length === 0) return ".";
29008
+ let code = path.charCodeAt(0);
29009
+ const hasRoot = code === 47;
29010
+ let end3 = -1;
29011
+ let matchedSlash = true;
29012
+ for (let i = path.length - 1; i >= 1; --i) {
29013
+ code = path.charCodeAt(i);
29014
+ if (code === 47) {
29015
+ if (!matchedSlash) {
29016
+ end3 = i;
29017
+ break;
29018
+ }
29019
+ } else {
29020
+ matchedSlash = false;
29021
+ }
29022
+ }
29023
+ if (end3 === -1) return hasRoot ? "/" : ".";
29024
+ if (hasRoot && end3 === 1) return "//";
29025
+ return path.slice(0, end3);
29026
+ },
29027
+ basename(path, ext) {
29028
+ let start = 0;
29029
+ let end3 = -1;
29030
+ let matchedSlash = true;
29031
+ let i;
29032
+ if (ext !== void 0 && ext.length > 0 && ext.length <= path.length) {
29033
+ if (ext.length === path.length && ext === path) return "";
29034
+ let extIdx = ext.length - 1;
29035
+ let firstNonSlashEnd = -1;
29036
+ for (i = path.length - 1; i >= 0; --i) {
29037
+ const code = path.charCodeAt(i);
29038
+ if (code === 47) {
29039
+ if (!matchedSlash) {
29040
+ start = i + 1;
29041
+ break;
29126
29042
  }
29127
- const node = cursor.node;
29128
- const keys4 = /* @__PURE__ */ new Set();
29129
- for (const property of ast.propertySignatures) {
29130
- if (typeof property.name === "string") keys4.add(property.name);
29043
+ } else {
29044
+ if (firstNonSlashEnd === -1) {
29045
+ matchedSlash = false;
29046
+ firstNonSlashEnd = i + 1;
29131
29047
  }
29132
- if (matchesIndex.length > 0) {
29133
- for (const key of node.keys) {
29134
- if (matchesIndex.some((matches) => matches(key))) keys4.add(key);
29048
+ if (extIdx >= 0) {
29049
+ if (code === ext.charCodeAt(extIdx)) {
29050
+ if (--extIdx === -1) {
29051
+ end3 = i;
29052
+ }
29053
+ } else {
29054
+ extIdx = -1;
29055
+ end3 = firstNonSlashEnd;
29135
29056
  }
29136
29057
  }
29137
- const out = {};
29138
- for (const key of keys4) {
29139
- const child = yield* loadChildCursor(cursor, key);
29140
- if (child.node !== void 0) assignProperty(out, key, child);
29141
- }
29142
- return out;
29143
- });
29144
- return decodeFromCursor(ast.recur(recur2, (ast2) => ast2), materialize);
29058
+ }
29145
29059
  }
29146
- case "Arrays": {
29147
- const materialize = fnUntraced2(function* (cursor) {
29148
- if (cursor.node?._tag !== "Array") {
29149
- return void 0;
29150
- }
29151
- const out = [];
29152
- for (let i = 0; i < cursor.node.length; i++) {
29153
- out.push(yield* loadChildCursor(cursor, i));
29060
+ if (start === end3) end3 = firstNonSlashEnd;
29061
+ else if (end3 === -1) end3 = path.length;
29062
+ return path.slice(start, end3);
29063
+ } else {
29064
+ for (i = path.length - 1; i >= 0; --i) {
29065
+ if (path.charCodeAt(i) === 47) {
29066
+ if (!matchedSlash) {
29067
+ start = i + 1;
29068
+ break;
29154
29069
  }
29155
- return out;
29156
- });
29157
- return decodeFromCursor(ast.recur(recur2), materialize);
29070
+ } else if (end3 === -1) {
29071
+ matchedSlash = false;
29072
+ end3 = i + 1;
29073
+ }
29158
29074
  }
29159
- case "Union":
29160
- for (const member of ast.types) {
29161
- recur2(member);
29075
+ if (end3 === -1) return "";
29076
+ return path.slice(start, end3);
29077
+ }
29078
+ },
29079
+ extname(path) {
29080
+ let startDot = -1;
29081
+ let startPart = 0;
29082
+ let end3 = -1;
29083
+ let matchedSlash = true;
29084
+ let preDotState = 0;
29085
+ for (let i = path.length - 1; i >= 0; --i) {
29086
+ const code = path.charCodeAt(i);
29087
+ if (code === 47) {
29088
+ if (!matchedSlash) {
29089
+ startPart = i + 1;
29090
+ break;
29091
+ }
29092
+ continue;
29093
+ }
29094
+ if (end3 === -1) {
29095
+ matchedSlash = false;
29096
+ end3 = i + 1;
29097
+ }
29098
+ if (code === 46) {
29099
+ if (startDot === -1) {
29100
+ startDot = i;
29101
+ } else if (preDotState !== 1) {
29102
+ preDotState = 1;
29162
29103
  }
29163
- return isScalarInput(ast) ? decodeFromCursor(ast, (cursor) => succeed7(getScalar(cursor.node))) : ast.recur(recur2);
29164
- case "Suspend": {
29165
- const target = ast.thunk();
29166
- if (!seen.has(target)) recur2(target);
29167
- return ast.recur(recur2);
29104
+ } else if (startDot !== -1) {
29105
+ preDotState = -1;
29168
29106
  }
29169
- case "Declaration":
29170
- case "Any":
29171
- throw new globalThis.Error("Config.schema does not support opaque StringTree encodings", {
29172
- cause: ast
29173
- });
29174
- default:
29175
- return decodeFromCursor(ast, (cursor) => succeed7(getScalar(cursor.node)));
29176
29107
  }
29177
- });
29178
- return recur2(root);
29179
- });
29180
- function schema(codec, path) {
29181
- const codecStringTree = toCodecStringTree2(codec);
29182
- const encodedAst = toEncoded(codecStringTree.ast);
29183
- const decodeCursor = decodeUnknownEffect(make28(toConfigCursorAST(codecStringTree.ast)));
29184
- const localPath = typeof path === "string" ? [path] : path ?? [];
29185
- return make40((provider, pathPrefix) => {
29186
- const fullPath = [...pathPrefix, ...localPath];
29187
- return catchSourceError(loadCursor(provider, fullPath), false).pipe(flatMapEager2((cursor) => {
29188
- const hasInput2 = hasProviderInput(encodedAst, cursor.node);
29189
- return catchSourceError(decodeCursor(cursor).pipe(mapEager2((value6) => resolved(value6, hasInput2)), catchEager2((issue) => {
29190
- const error = new ConfigError(new SchemaError(fullPath.length > 0 ? new Pointer(fullPath, issue) : issue));
29191
- return hasInput2 ? fail7(evaluationFailure(error, true)) : succeed7(absent(error));
29192
- })), hasInput2);
29193
- }));
29194
- });
29195
- }
29196
- var isPath = (u) => isString(u) || globalThis.Array.isArray(u);
29197
- function String7(name) {
29198
- return schema(String6, name);
29199
- }
29200
- function Int2(name) {
29201
- return schema(Int, name);
29202
- }
29203
- function Literals2(literals, name) {
29204
- return schema(Literals(literals), name);
29205
- }
29206
- function Array3(value6, pathOrOptions, options) {
29207
- const hasPath = isPath(pathOrOptions);
29208
- const resolvedOptions = hasPath ? options : pathOrOptions;
29209
- const array2 = ArraySchema(value6);
29210
- const separator = resolvedOptions?.separator ?? ",";
29211
- const arrayString = String6.pipe(decodeTo2(toCodecStringTree2(array2), {
29212
- decode: split(resolvedOptions),
29213
- encode: passthrough2({
29214
- strict: false
29215
- }).compose(transform((input) => input.join(separator)))
29216
- }));
29217
- return schema(Union2([arrayString, array2]), hasPath ? pathOrOptions : void 0);
29218
- }
29219
- function Record2(key, value6, pathOrOptions, options) {
29220
- const hasPath = isPath(pathOrOptions);
29221
- const record3 = Record(key, value6);
29222
- const split3 = splitKeyValue2(hasPath ? options : pathOrOptions);
29223
- const recordString = String6.pipe(decodeTo2(toCodecStringTree2(record3), {
29224
- decode: split3.decode,
29225
- encode: passthrough2({
29226
- strict: false
29227
- }).compose(split3.encode)
29228
- }));
29229
- return schema(Union2([record3, recordString]), hasPath ? pathOrOptions : void 0);
29230
- }
29231
- function Boolean4(name) {
29232
- return schema(BooleanLiterals, name);
29233
- }
29234
- function URL3(name) {
29235
- return schema(URL2, name);
29236
- }
29237
-
29238
- // ../../node_modules/.bun/effect@https+++pkg.pr.new+Effect-TS+effect+effect@c7d1ffff31a3e2ae0b0b+a654a55b752bdb24/node_modules/effect/dist/ErrorReporter.js
29239
- var ignore5 = "~effect/ErrorReporter/ignore";
29240
-
29241
- // ../../node_modules/.bun/effect@https+++pkg.pr.new+Effect-TS+effect+effect@c7d1ffff31a3e2ae0b0b+a654a55b752bdb24/node_modules/effect/dist/FiberSet.js
29242
- var FiberSet_exports = {};
29243
- __export(FiberSet_exports, {
29244
- add: () => add4,
29245
- addUnsafe: () => addUnsafe2,
29246
- awaitEmpty: () => awaitEmpty,
29247
- clear: () => clear4,
29248
- isFiberSet: () => isFiberSet,
29249
- join: () => join3,
29250
- make: () => make41,
29251
- makeRuntime: () => makeRuntime,
29252
- makeRuntimePromise: () => makeRuntimePromise,
29253
- run: () => run3,
29254
- runtime: () => runtime,
29255
- runtimePromise: () => runtimePromise,
29256
- size: () => size8
29257
- });
29258
- var TypeId44 = "~effect/FiberSet";
29259
- var isFiberSet = (u) => hasProperty(u, TypeId44);
29260
- var Proto10 = {
29261
- [TypeId44]: TypeId44,
29262
- [Symbol.iterator]() {
29263
- if (this.state._tag === "Closed") {
29264
- return empty2();
29108
+ if (startDot === -1 || end3 === -1 || // We saw a non-dot character immediately before the dot
29109
+ preDotState === 0 || // The (right-most) trimmed path component is exactly '..'
29110
+ preDotState === 1 && startDot === end3 - 1 && startDot === startPart + 1) {
29111
+ return "";
29265
29112
  }
29266
- return this.state.backing[Symbol.iterator]();
29113
+ return path.slice(startDot, end3);
29267
29114
  },
29268
- ...PipeInspectableProto,
29269
- toJSON() {
29270
- return {
29271
- _id: "FiberSet",
29272
- state: this.state
29273
- };
29274
- }
29275
- };
29276
- var makeUnsafe11 = (backing, deferred) => {
29277
- const self = Object.create(Proto10);
29278
- self.state = {
29279
- _tag: "Open",
29280
- backing
29281
- };
29282
- self.deferred = deferred;
29283
- return self;
29284
- };
29285
- var make41 = () => acquireRelease2(sync4(() => makeUnsafe11(/* @__PURE__ */ new Set(), makeUnsafe2())), (set10) => suspend3(() => {
29286
- const state = set10.state;
29287
- if (state._tag === "Closed") return void_5;
29288
- set10.state = {
29289
- _tag: "Closed"
29290
- };
29291
- const fibers = state.backing;
29292
- return interruptAll(fibers).pipe(into(set10.deferred));
29293
- }));
29294
- var makeRuntime = () => flatMap5(make41(), (self) => runtime(self)());
29295
- var makeRuntimePromise = () => flatMap5(make41(), (self) => runtimePromise(self)());
29296
- var internalFiberId = -1;
29297
- var isInternalInterruption = /* @__PURE__ */ toPredicate(/* @__PURE__ */ compose2(filterInterruptors, /* @__PURE__ */ has2(internalFiberId)));
29298
- var addUnsafe2 = /* @__PURE__ */ dual((args2) => isFiberSet(args2[0]), (self, fiber3, options) => {
29299
- if (self.state._tag === "Closed") {
29300
- fiber3.interruptUnsafe(internalFiberId);
29301
- return;
29302
- } else if (self.state.backing.has(fiber3)) {
29303
- return;
29304
- }
29305
- self.state.backing.add(fiber3);
29306
- fiber3.addObserver((exit3) => {
29307
- if (self.state._tag === "Closed") {
29308
- return;
29309
- }
29310
- self.state.backing.delete(fiber3);
29311
- if (isFailure4(exit3) && (options?.propagateInterruption === true ? !isInternalInterruption(exit3.cause) : !hasInterruptsOnly2(exit3.cause))) {
29312
- doneUnsafe(self.deferred, exit3);
29115
+ format: function format8(pathObject) {
29116
+ if (pathObject === null || typeof pathObject !== "object") {
29117
+ throw new TypeError('The "pathObject" argument must be of type Object. Received type ' + typeof pathObject);
29313
29118
  }
29314
- });
29315
- });
29316
- var add4 = /* @__PURE__ */ dual((args2) => isFiberSet(args2[0]), (self, fiber3, options) => sync4(() => addUnsafe2(self, fiber3, options)));
29317
- var clear4 = (self) => suspend3(() => {
29318
- if (self.state._tag === "Closed") {
29319
- return void_5;
29320
- }
29321
- return interruptAllAs(self.state.backing, internalFiberId);
29322
- });
29323
- var constInterruptedFiber = /* @__PURE__ */ (function() {
29324
- let fiber3 = void 0;
29325
- return () => {
29326
- if (fiber3 === void 0) {
29327
- fiber3 = runFork2(interrupt5);
29119
+ return _format("/", pathObject);
29120
+ },
29121
+ parse(path) {
29122
+ const ret = {
29123
+ root: "",
29124
+ dir: "",
29125
+ base: "",
29126
+ ext: "",
29127
+ name: ""
29128
+ };
29129
+ if (path.length === 0) return ret;
29130
+ let code = path.charCodeAt(0);
29131
+ const isAbsolute = code === 47;
29132
+ let start;
29133
+ if (isAbsolute) {
29134
+ ret.root = "/";
29135
+ start = 1;
29136
+ } else {
29137
+ start = 0;
29328
29138
  }
29329
- return fiber3;
29330
- };
29331
- })();
29332
- var run3 = function() {
29333
- const self = arguments[0];
29334
- if (!isEffect2(arguments[1])) {
29335
- const options = arguments[1];
29336
- return (effect2) => runImpl(self, effect2, options);
29337
- }
29338
- return runImpl(self, arguments[1], arguments[2]);
29339
- };
29340
- var runImpl = (self, effect2, options) => withFiber2((parent) => {
29341
- if (self.state._tag === "Closed") {
29342
- return sync4(constInterruptedFiber);
29343
- }
29344
- const fiber3 = runForkWith2(parent.context)(effect2);
29345
- addUnsafe2(self, fiber3, options);
29346
- return succeed7(fiber3);
29347
- });
29348
- var runtime = (self) => () => map9(context2(), (services) => {
29349
- const runFork3 = runForkWith2(services);
29350
- return (effect2, options) => {
29351
- if (self.state._tag === "Closed") {
29352
- return constInterruptedFiber();
29139
+ let startDot = -1;
29140
+ let startPart = 0;
29141
+ let end3 = -1;
29142
+ let matchedSlash = true;
29143
+ let i = path.length - 1;
29144
+ let preDotState = 0;
29145
+ for (; i >= start; --i) {
29146
+ code = path.charCodeAt(i);
29147
+ if (code === 47) {
29148
+ if (!matchedSlash) {
29149
+ startPart = i + 1;
29150
+ break;
29151
+ }
29152
+ continue;
29153
+ }
29154
+ if (end3 === -1) {
29155
+ matchedSlash = false;
29156
+ end3 = i + 1;
29157
+ }
29158
+ if (code === 46) {
29159
+ if (startDot === -1) startDot = i;
29160
+ else if (preDotState !== 1) preDotState = 1;
29161
+ } else if (startDot !== -1) {
29162
+ preDotState = -1;
29163
+ }
29353
29164
  }
29354
- const fiber3 = runFork3(effect2, options);
29355
- addUnsafe2(self, fiber3, options);
29356
- return fiber3;
29357
- };
29358
- });
29359
- var runtimePromise = (self) => () => map9(runtime(self)(), (runFork3) => (effect2, options) => new Promise((resolve4, reject) => runFork3(effect2, options).addObserver((exit3) => {
29360
- if (isSuccess4(exit3)) {
29361
- resolve4(exit3.value);
29362
- } else {
29363
- reject(squash(exit3.cause));
29364
- }
29365
- })));
29366
- var size8 = (self) => sync4(() => self.state._tag === "Closed" ? 0 : self.state.backing.size);
29367
- var join3 = (self) => _await(self.deferred);
29368
- var awaitEmpty = (self) => whileLoop2({
29369
- while: () => self.state._tag === "Open" && self.state.backing.size > 0,
29370
- body: () => await_(headUnsafe(self)),
29371
- step: constVoid
29165
+ if (startDot === -1 || end3 === -1 || // We saw a non-dot character immediately before the dot
29166
+ preDotState === 0 || // The (right-most) trimmed path component is exactly '..'
29167
+ preDotState === 1 && startDot === end3 - 1 && startDot === startPart + 1) {
29168
+ if (end3 !== -1) {
29169
+ if (startPart === 0 && isAbsolute) ret.base = ret.name = path.slice(1, end3);
29170
+ else ret.base = ret.name = path.slice(startPart, end3);
29171
+ }
29172
+ } else {
29173
+ if (startPart === 0 && isAbsolute) {
29174
+ ret.name = path.slice(1, startDot);
29175
+ ret.base = path.slice(1, end3);
29176
+ } else {
29177
+ ret.name = path.slice(startPart, startDot);
29178
+ ret.base = path.slice(startPart, end3);
29179
+ }
29180
+ ret.ext = path.slice(startDot, end3);
29181
+ }
29182
+ if (startPart > 0) ret.dir = path.slice(0, startPart - 1);
29183
+ else if (isAbsolute) ret.dir = "/";
29184
+ return ret;
29185
+ },
29186
+ sep: "/",
29187
+ fromFileUrl,
29188
+ toFileUrl,
29189
+ toNamespacedPath: identity
29372
29190
  });
29373
29191
 
29374
- // ../../node_modules/.bun/effect@https+++pkg.pr.new+Effect-TS+effect+effect@c7d1ffff31a3e2ae0b0b+a654a55b752bdb24/node_modules/effect/dist/PrimaryKey.js
29375
- var symbol4 = "~effect/PrimaryKey";
29376
-
29377
- // ../../node_modules/.bun/effect@https+++pkg.pr.new+Effect-TS+effect+effect@c7d1ffff31a3e2ae0b0b+a654a55b752bdb24/node_modules/effect/dist/Logger.js
29378
- var Logger_exports = {};
29379
- __export(Logger_exports, {
29380
- CurrentLoggers: () => CurrentLoggers2,
29381
- LogToStderr: () => LogToStderr2,
29382
- batched: () => batched,
29383
- consoleJson: () => consoleJson,
29384
- consoleLogFmt: () => consoleLogFmt,
29385
- consolePretty: () => consolePretty2,
29386
- consolePrettyBrowser: () => consolePrettyBrowser,
29387
- consolePrettyTty: () => consolePrettyTty,
29388
- consoleStructured: () => consoleStructured,
29389
- defaultLogger: () => defaultLogger2,
29390
- formatJson: () => formatJson2,
29391
- formatLogFmt: () => formatLogFmt,
29392
- formatSimple: () => formatSimple,
29393
- formatStructured: () => formatStructured,
29394
- isLogger: () => isLogger,
29395
- layer: () => layer,
29396
- make: () => make42,
29397
- map: () => map15,
29398
- toFile: () => toFile,
29399
- tracerLogger: () => tracerLogger2,
29400
- withConsoleError: () => withConsoleError,
29401
- withConsoleLog: () => withConsoleLog,
29402
- withLeveledConsole: () => withLeveledConsole
29403
- });
29404
- var TypeId45 = "~effect/Logger";
29405
- var isLogger = (u) => hasProperty(u, TypeId45);
29406
- var CurrentLoggers2 = CurrentLoggers;
29407
- var LogToStderr2 = LogToStderr;
29408
- var map15 = /* @__PURE__ */ dual(2, (self, f) => loggerMake((options) => f(self.log(options))));
29409
- var withConsoleLog = (self) => loggerMake((options) => {
29410
- const console = options.fiber.getRef(ConsoleRef);
29411
- return console.log(self.log(options));
29412
- });
29413
- var withConsoleError = (self) => loggerMake((options) => {
29414
- const console = options.fiber.getRef(ConsoleRef);
29415
- return console.error(self.log(options));
29416
- });
29417
- var withLeveledConsole = (self) => loggerMake((options) => {
29418
- const console = options.fiber.getRef(ConsoleRef);
29419
- const output = self.log(options);
29420
- switch (options.logLevel) {
29421
- case "Debug":
29422
- return console.debug(output);
29423
- case "Info":
29424
- return console.info(output);
29425
- case "Trace":
29426
- return console.trace(output);
29427
- case "Warn":
29428
- return console.warn(output);
29429
- case "Error":
29430
- case "Fatal":
29431
- return console.error(output);
29432
- default:
29433
- return console.log(output);
29434
- }
29192
+ // ../../node_modules/.bun/effect@https+++pkg.pr.new+Effect-TS+effect+effect@c7d1ffff31a3e2ae0b0b+a654a55b752bdb24/node_modules/effect/dist/ConfigProvider.js
29193
+ function makeValue(value6) {
29194
+ return {
29195
+ _tag: "Value",
29196
+ value: value6
29197
+ };
29198
+ }
29199
+ function makeRecord(keys4, value6) {
29200
+ return {
29201
+ _tag: "Record",
29202
+ keys: keys4,
29203
+ value: value6
29204
+ };
29205
+ }
29206
+ function makeArray(length, value6) {
29207
+ return {
29208
+ _tag: "Array",
29209
+ length,
29210
+ value: value6
29211
+ };
29212
+ }
29213
+ var ConfigProvider = /* @__PURE__ */ Reference("effect/ConfigProvider", {
29214
+ defaultValue: () => fromEnv()
29435
29215
  });
29436
- var textOnly = /^[^\s"=]*$/;
29437
- var escapeDoubleQuotes = (s) => `"${s.replace(/\\([\s\S])|(")/g, "\\$1$2")}"`;
29438
- var formatFiberId = (fiberId3) => `#${fiberId3}`;
29439
- var format9 = (quoteValue, space) => ({
29440
- cause,
29441
- date: date2,
29442
- fiber: fiber3,
29443
- logLevel,
29444
- message
29445
- }) => {
29446
- const formatUnknown = (value6) => typeof value6 === "string" ? value6 : format(value6, {
29447
- space
29448
- });
29449
- const formatValue = (value6) => value6.match(textOnly) ? value6 : quoteValue(value6);
29450
- const format10 = (label, value6) => `${formatLabel(label)}=${formatValue(value6)}`;
29451
- const append4 = (label, value6) => " " + format10(label, value6);
29452
- let out = format10("timestamp", date2.toISOString());
29453
- out += append4("level", logLevel.toUpperCase());
29454
- out += append4("fiber", formatFiberId(fiber3.id));
29455
- const messages = ensure(message);
29456
- for (let i = 0; i < messages.length; i++) {
29457
- out += append4("message", formatUnknown(messages[i]));
29458
- }
29459
- if (cause.reasons.length > 0) {
29460
- out += append4("cause", causePretty(cause));
29461
- }
29462
- const now2 = date2.getTime();
29463
- const spans = fiber3.getRef(CurrentLogSpans2);
29464
- for (const span2 of spans) {
29465
- out += " " + formatLogSpan(span2, now2);
29466
- }
29467
- const annotations2 = fiber3.getRef(CurrentLogAnnotations2);
29468
- for (const [label, value6] of Object.entries(annotations2)) {
29469
- out += append4(label, formatUnknown(value6));
29216
+ var Proto8 = {
29217
+ ...PipeInspectableProto,
29218
+ toJSON() {
29219
+ return {
29220
+ _id: "ConfigProvider"
29221
+ };
29470
29222
  }
29471
- return out;
29472
29223
  };
29473
- var make42 = loggerMake;
29474
- var defaultLogger2 = defaultLogger;
29475
- var formatSimple = /* @__PURE__ */ loggerMake(/* @__PURE__ */ format9(escapeDoubleQuotes));
29476
- var formatLogFmt = /* @__PURE__ */ loggerMake(/* @__PURE__ */ format9(JSON.stringify, 0));
29477
- var formatStructured = /* @__PURE__ */ loggerMake(({
29478
- cause,
29479
- date: date2,
29480
- fiber: fiber3,
29481
- logLevel,
29482
- message
29483
- }) => {
29484
- const annotationsObj = {};
29485
- const spansObj = {};
29486
- const annotations2 = fiber3.getRef(CurrentLogAnnotations2);
29487
- for (const [key, value6] of Object.entries(annotations2)) {
29488
- assignProperty(annotationsObj, key, structuredMessage(value6));
29489
- }
29490
- const now2 = date2.getTime();
29491
- const spans = fiber3.getRef(CurrentLogSpans2);
29492
- for (const [label, timestamp] of spans) {
29493
- assignProperty(spansObj, label, now2 - timestamp);
29494
- }
29495
- const messageArr = ensure(message);
29496
- return {
29497
- message: messageArr.length === 1 ? structuredMessage(messageArr[0]) : messageArr.map(structuredMessage),
29498
- level: logLevel.toUpperCase(),
29499
- timestamp: date2.toISOString(),
29500
- cause: cause.reasons.length > 0 ? causePretty(cause) : void 0,
29501
- annotations: annotationsObj,
29502
- spans: spansObj,
29503
- fiberId: formatFiberId(fiber3.id)
29224
+ var identityPath = (path) => path;
29225
+ function makeProvider(load, mapInput4) {
29226
+ const self = Object.create(Proto8);
29227
+ self.load = load;
29228
+ self.mapInput = mapInput4;
29229
+ return self;
29230
+ }
29231
+ function makeSource(get12, transform4) {
29232
+ return makeProvider((path) => get12(transform4(path)), (f) => makeSource(get12, flow(transform4, f)));
29233
+ }
29234
+ function make39(get12) {
29235
+ return makeSource(get12, identityPath);
29236
+ }
29237
+ function emptyStringAsMissing(value6, preserveEmptyStrings) {
29238
+ return value6 === "" && !preserveEmptyStrings ? void 0 : value6;
29239
+ }
29240
+ function fromEnvRecord(env, options) {
29241
+ const preserveEmptyStrings = options?.preserveEmptyStrings === true;
29242
+ const trie = buildEnvTrie(env);
29243
+ return make39((path) => succeed7(nodeAtEnv(trie, env, path, preserveEmptyStrings)));
29244
+ }
29245
+ function fromEnv(options) {
29246
+ const env = options?.env ?? {
29247
+ ...globalThis.process?.env,
29248
+ ...import.meta?.env
29504
29249
  };
29505
- });
29506
- var formatJson2 = /* @__PURE__ */ map15(formatStructured, formatJson);
29507
- var batched = /* @__PURE__ */ dual(2, (self, options) => flatMap3(scope, (scope3) => {
29508
- let buffer3 = [];
29509
- const flush2 = suspend(() => {
29510
- if (buffer3.length === 0) {
29511
- return void_3;
29512
- }
29513
- const arr = buffer3;
29514
- buffer3 = [];
29515
- return options.flush(arr);
29250
+ return fromEnvRecord(env, {
29251
+ preserveEmptyStrings: options?.preserveEmptyStrings
29516
29252
  });
29517
- return uninterruptibleMask((restore) => restore(sleep(options.window).pipe(andThen3(flush2), forever2)).pipe(forkDetach, flatMap3((fiber3) => scopeAddFinalizerExit(scope3, () => fiberInterrupt(fiber3))), andThen3(addFinalizer(() => flush2)), as2(loggerMake((options2) => {
29518
- buffer3.push(self.log(options2));
29519
- }))));
29520
- }));
29521
- var consolePretty2 = consolePretty;
29522
- var consolePrettyBrowser = prettyLoggerBrowser;
29523
- var consolePrettyTty = prettyLoggerTty;
29524
- var consoleLogFmt = /* @__PURE__ */ withConsoleLog(formatLogFmt);
29525
- var consoleStructured = /* @__PURE__ */ withConsoleLog(formatStructured);
29526
- var consoleJson = /* @__PURE__ */ withConsoleLog(formatJson2);
29527
- var tracerLogger2 = tracerLogger;
29528
- var layer = (loggers, options) => effect(CurrentLoggers2, withFiber(fnUntraced(function* (fiber3) {
29529
- const currentLoggers = new Set(options?.mergeWithExisting === true ? fiber3.getRef(CurrentLoggers) : []);
29530
- for (const logger of loggers) {
29531
- currentLoggers.add(isEffect(logger) ? yield* logger : logger);
29253
+ }
29254
+ function buildEnvTrie(env) {
29255
+ const trie = {};
29256
+ for (const [name, value6] of Object.entries(env)) {
29257
+ if (value6 === void 0) continue;
29258
+ const segments = name.split("_");
29259
+ let node = trie;
29260
+ for (const seg of segments) {
29261
+ const children = node.children ??= /* @__PURE__ */ Object.create(null);
29262
+ node = children[seg] ??= {};
29263
+ }
29264
+ }
29265
+ return trie;
29266
+ }
29267
+ function nodeAtEnv(trie, env, path, preserveEmptyStrings) {
29268
+ const key = path.map(String).join("_");
29269
+ const leafValue = emptyStringAsMissing(Object.hasOwn(env, key) ? env[key] : void 0, preserveEmptyStrings);
29270
+ const trieNode = trieNodeAt(trie, path);
29271
+ const children = trieNode?.children ? Object.keys(trieNode.children) : [];
29272
+ if (children.length === 0) {
29273
+ return leafValue === void 0 ? void 0 : makeValue(leafValue);
29274
+ }
29275
+ const allNumeric = children.every(isCanonicalArrayIndex);
29276
+ if (allNumeric) {
29277
+ const length = Math.max(...children.map((k) => parseInt(k, 10))) + 1;
29278
+ return makeArray(length, leafValue);
29532
29279
  }
29533
- return currentLoggers;
29534
- })));
29535
- var toFile = /* @__PURE__ */ dual((args2) => isLogger(args2[0]), (self, path, options) => gen3(function* () {
29536
- const fs = yield* FileSystem;
29537
- const logFile = yield* fs.open(path, {
29538
- flag: "a+",
29539
- ...options
29540
- });
29541
- const encoder2 = new TextEncoder();
29542
- return yield* batched(self, {
29543
- window: options?.batchWindow ?? 1e3,
29544
- flush: (output) => ignore(logFile.writeAll(encoder2.encode(output.join("\n") + "\n")))
29545
- });
29546
- }));
29280
+ return makeRecord(new Set(children), leafValue);
29281
+ }
29282
+ function trieNodeAt(root, path) {
29283
+ if (path.length === 0) return root;
29284
+ let node = root;
29285
+ for (const seg of path) {
29286
+ node = node?.children?.[String(seg)];
29287
+ if (!node) return void 0;
29288
+ }
29289
+ return node;
29290
+ }
29547
29291
 
29548
- // ../../node_modules/.bun/effect@https+++pkg.pr.new+Effect-TS+effect+effect@c7d1ffff31a3e2ae0b0b+a654a55b752bdb24/node_modules/effect/dist/ManagedRuntime.js
29549
- var ManagedRuntime_exports = {};
29550
- __export(ManagedRuntime_exports, {
29551
- isManagedRuntime: () => isManagedRuntime,
29552
- make: () => make43
29553
- });
29554
- var TypeId46 = "~effect/ManagedRuntime";
29555
- var isManagedRuntime = (input) => hasProperty(input, TypeId46);
29556
- var make43 = (layer2, options) => {
29557
- const memoMap = options?.memoMap ?? makeMemoMapUnsafe();
29558
- const scope3 = makeUnsafe3("parallel");
29559
- const layerScope = forkUnsafe2(scope3, "sequential");
29560
- const defaultRunOptions = {
29561
- onFiberStart: runIn(scope3)
29562
- };
29563
- const mergeRunOptions = (options2) => options2 ? {
29564
- ...options2,
29565
- onFiberStart: options2.onFiberStart ? (fiber3) => {
29566
- defaultRunOptions.onFiberStart(fiber3);
29567
- options2.onFiberStart(fiber3);
29568
- } : defaultRunOptions.onFiberStart
29569
- } : defaultRunOptions;
29570
- let buildFiber;
29571
- const contextEffect = withFiber2((fiber3) => {
29572
- if (!buildFiber) {
29573
- buildFiber = runFork2(tap6(buildWithMemoMap(layer2, memoMap, layerScope), (context3) => sync4(() => {
29574
- self.cachedContext = context3;
29575
- })), {
29576
- ...defaultRunOptions,
29577
- scheduler: fiber3.cache.scheduler
29578
- });
29579
- }
29580
- return flatten5(await_(buildFiber));
29581
- });
29582
- const self = {
29583
- [TypeId46]: TypeId46,
29584
- memoMap,
29585
- scope: scope3,
29586
- contextEffect,
29587
- cachedContext: void 0,
29588
- context() {
29589
- return self.cachedContext === void 0 ? runPromise2(self.contextEffect) : Promise.resolve(self.cachedContext);
29590
- },
29591
- dispose() {
29592
- return runPromise2(self.disposeEffect);
29593
- },
29594
- [Symbol.asyncDispose]() {
29595
- return self.dispose();
29596
- },
29597
- disposeEffect: suspend3(() => {
29598
- ;
29599
- self.contextEffect = die5("ManagedRuntime disposed");
29600
- self.cachedContext = void 0;
29601
- return close(self.scope, void_4);
29602
- }),
29603
- runFork(effect2, options2) {
29604
- return self.cachedContext === void 0 ? runFork2(provide7(self, effect2), mergeRunOptions(options2)) : runForkWith2(self.cachedContext)(effect2, mergeRunOptions(options2));
29605
- },
29606
- runCallback(effect2, options2) {
29607
- return self.cachedContext === void 0 ? runCallback2(provide7(self, effect2), mergeRunOptions(options2)) : runCallbackWith2(self.cachedContext)(effect2, mergeRunOptions(options2));
29608
- },
29609
- runSyncExit(effect2) {
29610
- return self.cachedContext === void 0 ? runSyncExit2(provide7(self, effect2)) : runSyncExitWith2(self.cachedContext)(effect2);
29611
- },
29612
- runSync(effect2) {
29613
- return self.cachedContext === void 0 ? runSync2(provide7(self, effect2)) : runSyncWith2(self.cachedContext)(effect2);
29614
- },
29615
- runPromiseExit(effect2, options2) {
29616
- return self.cachedContext === void 0 ? runPromiseExit2(provide7(self, effect2), mergeRunOptions(options2)) : runPromiseExitWith2(self.cachedContext)(effect2, mergeRunOptions(options2));
29617
- },
29618
- runPromise(effect2, options2) {
29619
- return self.cachedContext === void 0 ? runPromise2(provide7(self, effect2), mergeRunOptions(options2)) : runPromiseWith2(self.cachedContext)(effect2, mergeRunOptions(options2));
29292
+ // ../../node_modules/.bun/effect@https+++pkg.pr.new+Effect-TS+effect+effect@c7d1ffff31a3e2ae0b0b+a654a55b752bdb24/node_modules/effect/dist/Config.js
29293
+ var TypeId44 = "~effect/Config";
29294
+ var ConfigError = class {
29295
+ _tag = "ConfigError";
29296
+ name = "ConfigError";
29297
+ cause;
29298
+ constructor(cause) {
29299
+ this.cause = cause;
29300
+ }
29301
+ get message() {
29302
+ return this.cause.toString();
29303
+ }
29304
+ toString() {
29305
+ return `ConfigError(${this.message})`;
29306
+ }
29307
+ };
29308
+ var Proto9 = {
29309
+ .../* @__PURE__ */ Prototype2({
29310
+ label: "Config",
29311
+ evaluate(fiber3) {
29312
+ return this.parse(fiber3.getRef(ConfigProvider));
29620
29313
  }
29621
- };
29622
- return self;
29314
+ }),
29315
+ [TypeId44]: TypeId44,
29316
+ toJSON() {
29317
+ return {
29318
+ _id: "Config"
29319
+ };
29320
+ }
29623
29321
  };
29624
- function provide7(managed, effect2) {
29625
- return flatMap5(managed.contextEffect, (context3) => provideContext2(effect2, context3));
29322
+ function make40(evaluator) {
29323
+ const self = Object.create(Proto9);
29324
+ self.evaluator = evaluator;
29325
+ self.parse = (provider) => evaluator(provider, []).pipe(mapErrorEager2((failure) => failure.error), flatMapEager2((resolution) => resolution._tag === "Resolved" ? succeed7(resolution.value) : fail7(resolution.error)));
29326
+ return self;
29626
29327
  }
29627
-
29628
- // ../../node_modules/.bun/effect@https+++pkg.pr.new+Effect-TS+effect+effect@c7d1ffff31a3e2ae0b0b+a654a55b752bdb24/node_modules/effect/dist/Match.js
29629
- var Match_exports = {};
29630
- __export(Match_exports, {
29631
- any: () => any3,
29632
- bigint: () => bigint,
29633
- boolean: () => boolean2,
29634
- date: () => date,
29635
- defined: () => defined2,
29636
- discriminator: () => discriminator2,
29637
- discriminatorStartsWith: () => discriminatorStartsWith2,
29638
- discriminators: () => discriminators2,
29639
- discriminatorsExhaustive: () => discriminatorsExhaustive2,
29640
- exhaustive: () => exhaustive2,
29641
- fn: () => fn4,
29642
- instanceOf: () => instanceOf3,
29643
- instanceOfUnsafe: () => instanceOfUnsafe,
29644
- is: () => is4,
29645
- nonEmptyString: () => nonEmptyString2,
29646
- not: () => not3,
29647
- null: () => _null,
29648
- number: () => number3,
29649
- option: () => option5,
29650
- orElse: () => orElse5,
29651
- orElseAbsurd: () => orElseAbsurd2,
29652
- record: () => record2,
29653
- result: () => result5,
29654
- string: () => string3,
29655
- symbol: () => symbol5,
29656
- tag: () => tag3,
29657
- tagStartsWith: () => tagStartsWith2,
29658
- tags: () => tags2,
29659
- tagsExhaustive: () => tagsExhaustive2,
29660
- type: () => type2,
29661
- typeTags: () => typeTags2,
29662
- undefined: () => _undefined,
29663
- value: () => value5,
29664
- valueTags: () => valueTags2,
29665
- when: () => when5,
29666
- whenAnd: () => whenAnd2,
29667
- whenOr: () => whenOr2,
29668
- withReturnType: () => withReturnType2
29328
+ var evaluateAt = (self, provider, pathPrefix) => self.evaluator(provider, pathPrefix);
29329
+ var resolved = (value6, hasInput2) => ({
29330
+ _tag: "Resolved",
29331
+ value: value6,
29332
+ hasInput: hasInput2
29669
29333
  });
29670
-
29671
- // ../../node_modules/.bun/effect@https+++pkg.pr.new+Effect-TS+effect+effect@c7d1ffff31a3e2ae0b0b+a654a55b752bdb24/node_modules/effect/dist/internal/matcher.js
29672
- var TypeId47 = "~effect/Match/Matcher";
29673
- var TypeMatcherProto = {
29674
- [TypeId47]: {
29675
- _input: identity,
29676
- _filters: identity,
29677
- _remaining: identity,
29678
- _result: identity,
29679
- _return: identity,
29680
- _args: identity
29681
- },
29682
- _tag: "TypeMatcher",
29683
- add(_case) {
29684
- return makeTypeMatcher(this.select, [...this.cases, _case]);
29685
- },
29686
- pipe() {
29687
- return pipeArguments(this, arguments);
29688
- }
29334
+ var absent = (error) => ({
29335
+ _tag: "Absent",
29336
+ error
29337
+ });
29338
+ var evaluationFailure = (error, hasInput2) => ({
29339
+ error,
29340
+ hasInput: hasInput2
29341
+ });
29342
+ var isSourceError = (u) => isTagged(u, "SourceError");
29343
+ var catchSourceError = (self, hasInput2) => self.pipe(catchDefect2((defect) => isSourceError(defect) ? fail7(evaluationFailure(new ConfigError(defect), hasInput2)) : die5(defect)));
29344
+ var preserveInputEvidence = (self, hasInput2) => {
29345
+ if (!hasInput2) return self;
29346
+ return self.pipe(mapErrorEager2((failure) => evaluationFailure(failure.error, true)), flatMapEager2((resolution) => resolution._tag === "Resolved" ? succeed7(resolved(resolution.value, true)) : fail7(evaluationFailure(resolution.error, true))));
29689
29347
  };
29690
- function makeTypeMatcher(select, cases) {
29691
- const matcher = Object.create(TypeMatcherProto);
29692
- matcher.select = select;
29693
- matcher.cases = cases;
29694
- return matcher;
29348
+ var map14 = /* @__PURE__ */ dual(2, (self, f) => {
29349
+ return make40((provider, pathPrefix) => map9(evaluateAt(self, provider, pathPrefix), (resolution) => resolution._tag === "Resolved" ? resolved(f(resolution.value), resolution.hasInput) : resolution));
29350
+ });
29351
+ var orElse5 = /* @__PURE__ */ dual(2, (self, that) => {
29352
+ return make40((provider, pathPrefix) => matchEffect3(evaluateAt(self, provider, pathPrefix), {
29353
+ onFailure: (failure) => preserveInputEvidence(evaluateAt(that(failure.error), provider, pathPrefix), failure.hasInput),
29354
+ onSuccess: (resolution) => resolution._tag === "Absent" ? evaluateAt(that(resolution.error), provider, pathPrefix) : succeed7(resolution)
29355
+ }));
29356
+ });
29357
+ function all5(arg) {
29358
+ const configs = globalThis.Array.isArray(arg) ? arg : Symbol.iterator in arg ? [...arg] : arg;
29359
+ if (globalThis.Array.isArray(configs)) {
29360
+ return make40((provider, pathPrefix) => flatMapEager2(all4(configs.map((config) => result2(evaluateAt(config, provider, pathPrefix)))), resolveArray));
29361
+ } else {
29362
+ return make40((provider, pathPrefix) => flatMapEager2(all4(map3(configs, (config) => result2(evaluateAt(config, provider, pathPrefix)))), resolveRecord));
29363
+ }
29695
29364
  }
29696
- var ValueMatcherProto = {
29697
- [TypeId47]: {
29698
- _input: identity,
29699
- _filters: identity,
29700
- _result: identity,
29701
- _return: identity,
29702
- _flavor: identity
29703
- },
29704
- _tag: "ValueMatcher",
29705
- add(_case) {
29706
- if (isSuccess2(this.value)) {
29707
- return this;
29365
+ var resolveArray = (results) => {
29366
+ const values2 = [];
29367
+ let firstFailure;
29368
+ let firstAbsent;
29369
+ let hasInput2 = false;
29370
+ for (const result6 of results) {
29371
+ if (isFailure2(result6)) {
29372
+ firstFailure ??= result6.failure;
29373
+ hasInput2 = hasInput2 || result6.failure.hasInput;
29374
+ continue;
29375
+ }
29376
+ const resolution = result6.success;
29377
+ if (resolution._tag === "Absent") {
29378
+ firstAbsent ??= resolution;
29379
+ } else {
29380
+ values2.push(resolution.value);
29381
+ hasInput2 = hasInput2 || resolution.hasInput;
29382
+ }
29383
+ }
29384
+ if (firstFailure !== void 0) {
29385
+ return fail7(evaluationFailure(firstFailure.error, hasInput2));
29386
+ }
29387
+ if (firstAbsent !== void 0) {
29388
+ return hasInput2 ? fail7(evaluationFailure(firstAbsent.error, true)) : succeed7(firstAbsent);
29389
+ }
29390
+ return succeed7(resolved(values2, hasInput2));
29391
+ };
29392
+ var resolveRecord = (results) => {
29393
+ const values2 = {};
29394
+ let firstFailure;
29395
+ let firstAbsent;
29396
+ let hasInput2 = false;
29397
+ for (const key in results) {
29398
+ const result6 = results[key];
29399
+ if (isFailure2(result6)) {
29400
+ firstFailure ??= result6.failure;
29401
+ hasInput2 = hasInput2 || result6.failure.hasInput;
29402
+ continue;
29708
29403
  }
29709
- if (_case._tag === "When" && _case.guard(this.provided) === true) {
29710
- return makeValueMatcher(this.provided, succeed2(_case.evaluate(this.provided)));
29711
- } else if (_case._tag === "Not" && _case.guard(this.provided) === false) {
29712
- return makeValueMatcher(this.provided, succeed2(_case.evaluate(this.provided)));
29404
+ const resolution = result6.success;
29405
+ if (resolution._tag === "Absent") {
29406
+ firstAbsent ??= resolution;
29407
+ } else {
29408
+ assignProperty(values2, key, resolution.value);
29409
+ hasInput2 = hasInput2 || resolution.hasInput;
29713
29410
  }
29714
- return this;
29715
- },
29716
- pipe() {
29717
- return pipeArguments(this, arguments);
29718
29411
  }
29412
+ if (firstFailure !== void 0) {
29413
+ return fail7(evaluationFailure(firstFailure.error, hasInput2));
29414
+ }
29415
+ if (firstAbsent !== void 0) {
29416
+ return hasInput2 ? fail7(evaluationFailure(firstAbsent.error, true)) : succeed7(firstAbsent);
29417
+ }
29418
+ return succeed7(resolved(values2, hasInput2));
29719
29419
  };
29720
- function makeValueMatcher(provided, value6) {
29721
- const matcher = Object.create(ValueMatcherProto);
29722
- matcher.provided = provided;
29723
- matcher.value = value6;
29724
- return matcher;
29725
- }
29726
- var makeWhen = (guard, evaluate2) => ({
29727
- _tag: "When",
29728
- guard,
29729
- evaluate: evaluate2
29730
- });
29731
- var makeNot = (guard, evaluate2) => ({
29732
- _tag: "Not",
29733
- guard,
29734
- evaluate: evaluate2
29420
+ var withDefault2 = /* @__PURE__ */ dual(2, (self, defaultValue) => {
29421
+ return make40((provider, pathPrefix) => mapEager2(evaluateAt(self, provider, pathPrefix), (resolution) => resolution._tag === "Absent" ? resolved(defaultValue, false) : resolution));
29735
29422
  });
29736
- var makePredicate = (pattern) => {
29737
- if (typeof pattern === "function") {
29738
- return pattern;
29739
- } else if (Array.isArray(pattern)) {
29740
- const predicates = pattern.map(makePredicate);
29741
- const len = predicates.length;
29742
- return (u) => {
29743
- if (!Array.isArray(u)) {
29744
- return false;
29745
- }
29746
- for (let i = 0; i < len; i++) {
29747
- if (predicates[i](u[i]) === false) {
29748
- return false;
29749
- }
29750
- }
29423
+ var option5 = (self) => self.pipe(map14(some3), withDefault2(none2()));
29424
+ var cursorToString = () => "<configuration>";
29425
+ var loadCursor = (provider, path) => provider.load(path).pipe(orDie3, mapEager2((node) => ({
29426
+ provider,
29427
+ path,
29428
+ node,
29429
+ toString: cursorToString
29430
+ })));
29431
+ var loadChildCursor = (cursor, segment) => loadCursor(cursor.provider, [...cursor.path, segment]);
29432
+ var getScalar = (node) => node?.value;
29433
+ var decodeFromCursor = (ast, decode3) => decodeTo(unknown, ast, new Transformation(transformEffect((input) => decode3(input)), passthrough2()));
29434
+ var isScalarInput = (ast) => {
29435
+ switch (ast._tag) {
29436
+ case "Union":
29437
+ return ast.types.every(isScalarInput);
29438
+ case "Objects":
29439
+ case "Arrays":
29440
+ case "Suspend":
29441
+ return false;
29442
+ default:
29751
29443
  return true;
29752
- };
29753
- } else if (pattern !== null && typeof pattern === "object") {
29754
- const keysAndPredicates = Reflect.ownKeys(pattern).map((key) => [key, makePredicate(pattern[key])]);
29755
- const len = keysAndPredicates.length;
29756
- return (u) => {
29757
- if (typeof u !== "object" || u === null) {
29758
- return false;
29444
+ }
29445
+ };
29446
+ var hasProviderInput = (ast, node) => {
29447
+ switch (ast._tag) {
29448
+ case "Objects":
29449
+ return node?._tag === "Record";
29450
+ case "Arrays":
29451
+ return node?._tag === "Array";
29452
+ case "Union":
29453
+ return ast.types.some((ast2) => hasProviderInput(ast2, node));
29454
+ case "Suspend":
29455
+ return hasProviderInput(ast.thunk(), node);
29456
+ default:
29457
+ return getScalar(node) !== void 0;
29458
+ }
29459
+ };
29460
+ var toConfigCursorAST = /* @__PURE__ */ memoize((root) => {
29461
+ const seen = /* @__PURE__ */ new WeakSet();
29462
+ const recur2 = applyToSelfOrLastLinkEncoding((ast) => {
29463
+ seen.add(ast);
29464
+ switch (ast._tag) {
29465
+ case "Objects": {
29466
+ const matchesIndex = ast.indexSignatures.map((is5) => _is(is5.parameter));
29467
+ const materialize = fnUntraced2(function* (cursor) {
29468
+ if (cursor.node?._tag !== "Record") {
29469
+ return void 0;
29470
+ }
29471
+ const node = cursor.node;
29472
+ const keys4 = /* @__PURE__ */ new Set();
29473
+ for (const property of ast.propertySignatures) {
29474
+ if (typeof property.name === "string") keys4.add(property.name);
29475
+ }
29476
+ if (matchesIndex.length > 0) {
29477
+ for (const key of node.keys) {
29478
+ if (matchesIndex.some((matches) => matches(key))) keys4.add(key);
29479
+ }
29480
+ }
29481
+ const out = {};
29482
+ for (const key of keys4) {
29483
+ const child = yield* loadChildCursor(cursor, key);
29484
+ if (child.node !== void 0) assignProperty(out, key, child);
29485
+ }
29486
+ return out;
29487
+ });
29488
+ return decodeFromCursor(ast.recur(recur2, (ast2) => ast2), materialize);
29759
29489
  }
29760
- for (let i = 0; i < len; i++) {
29761
- const [key, predicate] = keysAndPredicates[i];
29762
- if (!(key in u) || predicate(u[key]) === false) {
29763
- return false;
29490
+ case "Arrays": {
29491
+ const materialize = fnUntraced2(function* (cursor) {
29492
+ if (cursor.node?._tag !== "Array") {
29493
+ return void 0;
29494
+ }
29495
+ const out = [];
29496
+ for (let i = 0; i < cursor.node.length; i++) {
29497
+ out.push(yield* loadChildCursor(cursor, i));
29498
+ }
29499
+ return out;
29500
+ });
29501
+ return decodeFromCursor(ast.recur(recur2), materialize);
29502
+ }
29503
+ case "Union":
29504
+ for (const member of ast.types) {
29505
+ recur2(member);
29764
29506
  }
29507
+ return isScalarInput(ast) ? decodeFromCursor(ast, (cursor) => succeed7(getScalar(cursor.node))) : ast.recur(recur2);
29508
+ case "Suspend": {
29509
+ const target = ast.thunk();
29510
+ if (!seen.has(target)) recur2(target);
29511
+ return ast.recur(recur2);
29765
29512
  }
29766
- return true;
29513
+ case "Declaration":
29514
+ case "Any":
29515
+ throw new globalThis.Error("Config.schema does not support opaque StringTree encodings", {
29516
+ cause: ast
29517
+ });
29518
+ default:
29519
+ return decodeFromCursor(ast, (cursor) => succeed7(getScalar(cursor.node)));
29520
+ }
29521
+ });
29522
+ return recur2(root);
29523
+ });
29524
+ function schema(codec, path) {
29525
+ const codecStringTree = toCodecStringTree2(codec);
29526
+ const encodedAst = toEncoded(codecStringTree.ast);
29527
+ const decodeCursor = decodeUnknownEffect(make28(toConfigCursorAST(codecStringTree.ast)));
29528
+ const localPath = typeof path === "string" ? [path] : path ?? [];
29529
+ return make40((provider, pathPrefix) => {
29530
+ const fullPath = [...pathPrefix, ...localPath];
29531
+ return catchSourceError(loadCursor(provider, fullPath), false).pipe(flatMapEager2((cursor) => {
29532
+ const hasInput2 = hasProviderInput(encodedAst, cursor.node);
29533
+ return catchSourceError(decodeCursor(cursor).pipe(mapEager2((value6) => resolved(value6, hasInput2)), catchEager2((issue) => {
29534
+ const error = new ConfigError(new SchemaError(fullPath.length > 0 ? new Pointer(fullPath, issue) : issue));
29535
+ return hasInput2 ? fail7(evaluationFailure(error, true)) : succeed7(absent(error));
29536
+ })), hasInput2);
29537
+ }));
29538
+ });
29539
+ }
29540
+ var isPath = (u) => isString(u) || globalThis.Array.isArray(u);
29541
+ function String7(name) {
29542
+ return schema(String6, name);
29543
+ }
29544
+ function Int2(name) {
29545
+ return schema(Int, name);
29546
+ }
29547
+ function Literals2(literals, name) {
29548
+ return schema(Literals(literals), name);
29549
+ }
29550
+ function Array3(value6, pathOrOptions, options) {
29551
+ const hasPath = isPath(pathOrOptions);
29552
+ const resolvedOptions = hasPath ? options : pathOrOptions;
29553
+ const array2 = ArraySchema(value6);
29554
+ const separator = resolvedOptions?.separator ?? ",";
29555
+ const arrayString = String6.pipe(decodeTo2(toCodecStringTree2(array2), {
29556
+ decode: split(resolvedOptions),
29557
+ encode: passthrough2({
29558
+ strict: false
29559
+ }).compose(transform((input) => input.join(separator)))
29560
+ }));
29561
+ return schema(Union2([arrayString, array2]), hasPath ? pathOrOptions : void 0);
29562
+ }
29563
+ function Record2(key, value6, pathOrOptions, options) {
29564
+ const hasPath = isPath(pathOrOptions);
29565
+ const record3 = Record(key, value6);
29566
+ const split3 = splitKeyValue2(hasPath ? options : pathOrOptions);
29567
+ const recordString = String6.pipe(decodeTo2(toCodecStringTree2(record3), {
29568
+ decode: split3.decode,
29569
+ encode: passthrough2({
29570
+ strict: false
29571
+ }).compose(split3.encode)
29572
+ }));
29573
+ return schema(Union2([record3, recordString]), hasPath ? pathOrOptions : void 0);
29574
+ }
29575
+ function Boolean4(name) {
29576
+ return schema(BooleanLiterals, name);
29577
+ }
29578
+ function URL3(name) {
29579
+ return schema(URL2, name);
29580
+ }
29581
+
29582
+ // ../../node_modules/.bun/effect@https+++pkg.pr.new+Effect-TS+effect+effect@c7d1ffff31a3e2ae0b0b+a654a55b752bdb24/node_modules/effect/dist/ErrorReporter.js
29583
+ var ignore5 = "~effect/ErrorReporter/ignore";
29584
+
29585
+ // ../../node_modules/.bun/effect@https+++pkg.pr.new+Effect-TS+effect+effect@c7d1ffff31a3e2ae0b0b+a654a55b752bdb24/node_modules/effect/dist/FiberSet.js
29586
+ var FiberSet_exports = {};
29587
+ __export(FiberSet_exports, {
29588
+ add: () => add4,
29589
+ addUnsafe: () => addUnsafe2,
29590
+ awaitEmpty: () => awaitEmpty,
29591
+ clear: () => clear4,
29592
+ isFiberSet: () => isFiberSet,
29593
+ join: () => join3,
29594
+ make: () => make41,
29595
+ makeRuntime: () => makeRuntime,
29596
+ makeRuntimePromise: () => makeRuntimePromise,
29597
+ run: () => run3,
29598
+ runtime: () => runtime,
29599
+ runtimePromise: () => runtimePromise,
29600
+ size: () => size8
29601
+ });
29602
+ var TypeId45 = "~effect/FiberSet";
29603
+ var isFiberSet = (u) => hasProperty(u, TypeId45);
29604
+ var Proto10 = {
29605
+ [TypeId45]: TypeId45,
29606
+ [Symbol.iterator]() {
29607
+ if (this.state._tag === "Closed") {
29608
+ return empty2();
29609
+ }
29610
+ return this.state.backing[Symbol.iterator]();
29611
+ },
29612
+ ...PipeInspectableProto,
29613
+ toJSON() {
29614
+ return {
29615
+ _id: "FiberSet",
29616
+ state: this.state
29767
29617
  };
29768
29618
  }
29769
- return (u) => u === pattern;
29770
29619
  };
29771
- var makeOrPredicate = (patterns) => {
29772
- const predicates = patterns.map(makePredicate);
29773
- const len = predicates.length;
29774
- return (u) => {
29775
- for (let i = 0; i < len; i++) {
29776
- if (predicates[i](u) === true) {
29777
- return true;
29778
- }
29779
- }
29780
- return false;
29620
+ var makeUnsafe11 = (backing, deferred) => {
29621
+ const self = Object.create(Proto10);
29622
+ self.state = {
29623
+ _tag: "Open",
29624
+ backing
29781
29625
  };
29626
+ self.deferred = deferred;
29627
+ return self;
29782
29628
  };
29783
- var makeAndPredicate = (patterns) => {
29784
- const predicates = patterns.map(makePredicate);
29785
- const len = predicates.length;
29786
- return (u) => {
29787
- for (let i = 0; i < len; i++) {
29788
- if (predicates[i](u) === false) {
29789
- return false;
29790
- }
29629
+ var make41 = () => acquireRelease2(sync4(() => makeUnsafe11(/* @__PURE__ */ new Set(), makeUnsafe2())), (set10) => suspend3(() => {
29630
+ const state = set10.state;
29631
+ if (state._tag === "Closed") return void_5;
29632
+ set10.state = {
29633
+ _tag: "Closed"
29634
+ };
29635
+ const fibers = state.backing;
29636
+ return interruptAll(fibers).pipe(into(set10.deferred));
29637
+ }));
29638
+ var makeRuntime = () => flatMap5(make41(), (self) => runtime(self)());
29639
+ var makeRuntimePromise = () => flatMap5(make41(), (self) => runtimePromise(self)());
29640
+ var internalFiberId = -1;
29641
+ var isInternalInterruption = /* @__PURE__ */ toPredicate(/* @__PURE__ */ compose2(filterInterruptors, /* @__PURE__ */ has2(internalFiberId)));
29642
+ var addUnsafe2 = /* @__PURE__ */ dual((args2) => isFiberSet(args2[0]), (self, fiber3, options) => {
29643
+ if (self.state._tag === "Closed") {
29644
+ fiber3.interruptUnsafe(internalFiberId);
29645
+ return;
29646
+ } else if (self.state.backing.has(fiber3)) {
29647
+ return;
29648
+ }
29649
+ self.state.backing.add(fiber3);
29650
+ fiber3.addObserver((exit3) => {
29651
+ if (self.state._tag === "Closed") {
29652
+ return;
29791
29653
  }
29792
- return true;
29654
+ self.state.backing.delete(fiber3);
29655
+ if (isFailure4(exit3) && (options?.propagateInterruption === true ? !isInternalInterruption(exit3.cause) : !hasInterruptsOnly2(exit3.cause))) {
29656
+ doneUnsafe(self.deferred, exit3);
29657
+ }
29658
+ });
29659
+ });
29660
+ var add4 = /* @__PURE__ */ dual((args2) => isFiberSet(args2[0]), (self, fiber3, options) => sync4(() => addUnsafe2(self, fiber3, options)));
29661
+ var clear4 = (self) => suspend3(() => {
29662
+ if (self.state._tag === "Closed") {
29663
+ return void_5;
29664
+ }
29665
+ return interruptAllAs(self.state.backing, internalFiberId);
29666
+ });
29667
+ var constInterruptedFiber = /* @__PURE__ */ (function() {
29668
+ let fiber3 = void 0;
29669
+ return () => {
29670
+ if (fiber3 === void 0) {
29671
+ fiber3 = runFork2(interrupt5);
29672
+ }
29673
+ return fiber3;
29793
29674
  };
29675
+ })();
29676
+ var run3 = function() {
29677
+ const self = arguments[0];
29678
+ if (!isEffect2(arguments[1])) {
29679
+ const options = arguments[1];
29680
+ return (effect2) => runImpl(self, effect2, options);
29681
+ }
29682
+ return runImpl(self, arguments[1], arguments[2]);
29794
29683
  };
29795
- var type = () => makeTypeMatcher(identity, []);
29796
- var fn3 = (select) => makeTypeMatcher(select, []);
29797
- var value4 = (i) => makeValueMatcher(i, fail2(i));
29798
- var valueTags = /* @__PURE__ */ dual(2, (input, fields) => {
29799
- const match10 = tagsExhaustive(fields)(makeTypeMatcher(identity, []));
29800
- return match10(input);
29684
+ var runImpl = (self, effect2, options) => withFiber2((parent) => {
29685
+ if (self.state._tag === "Closed") {
29686
+ return sync4(constInterruptedFiber);
29687
+ }
29688
+ const fiber3 = runForkWith2(parent.context)(effect2);
29689
+ addUnsafe2(self, fiber3, options);
29690
+ return succeed7(fiber3);
29801
29691
  });
29802
- var typeTags = () => (fields) => {
29803
- const match10 = tagsExhaustive(fields)(makeTypeMatcher(identity, []));
29804
- return (input) => match10(input);
29805
- };
29806
- var withReturnType = () => (self) => self;
29807
- var when4 = (pattern, f) => (self) => self.add(makeWhen(makePredicate(pattern), f));
29808
- var whenOr = (...args2) => (self) => {
29809
- const onMatch = args2[args2.length - 1];
29810
- const patterns = args2.slice(0, -1);
29811
- return self.add(makeWhen(makeOrPredicate(patterns), onMatch));
29812
- };
29813
- var whenAnd = (...args2) => (self) => {
29814
- const onMatch = args2[args2.length - 1];
29815
- const patterns = args2.slice(0, -1);
29816
- return self.add(makeWhen(makeAndPredicate(patterns), onMatch));
29817
- };
29818
- var discriminator = (field) => (...pattern) => {
29819
- const f = pattern[pattern.length - 1];
29820
- const values2 = pattern.slice(0, -1);
29821
- const pred = values2.length === 1 ? (_) => _ != null && _[field] === values2[0] : (_) => _ != null && values2.includes(_[field]);
29822
- return (self) => self.add(makeWhen(pred, f));
29823
- };
29824
- var discriminatorStartsWith = (field) => (pattern, f) => {
29825
- const pred = (_) => _ != null && typeof _[field] === "string" && _[field].startsWith(pattern);
29826
- return (self) => self.add(makeWhen(pred, f));
29827
- };
29828
- var discriminators = (field) => (fields) => {
29829
- const predicate = makeWhen((arg) => arg != null && Object.hasOwn(fields, arg[field]), (data) => fields[data[field]](data));
29830
- return (self) => self.add(predicate);
29831
- };
29832
- var discriminatorsExhaustive = (field) => (fields) => {
29833
- const addCases = discriminators(field)(fields);
29834
- return (matcher) => exhaustive(addCases(matcher));
29835
- };
29836
- var tag2 = /* @__PURE__ */ discriminator("_tag");
29837
- var tagStartsWith = /* @__PURE__ */ discriminatorStartsWith("_tag");
29838
- var tags = /* @__PURE__ */ discriminators("_tag");
29839
- var tagsExhaustive = /* @__PURE__ */ discriminatorsExhaustive("_tag");
29840
- var not2 = (pattern, f) => (self) => self.add(makeNot(makePredicate(pattern), f));
29841
- var nonEmptyString = (u) => typeof u === "string" && u.length > 0;
29842
- var is3 = (...literals) => {
29843
- const len = literals.length;
29844
- return (u) => {
29845
- for (let i = 0; i < len; i++) {
29846
- if (u === literals[i]) {
29847
- return true;
29848
- }
29692
+ var runtime = (self) => () => map9(context2(), (services) => {
29693
+ const runFork3 = runForkWith2(services);
29694
+ return (effect2, options) => {
29695
+ if (self.state._tag === "Closed") {
29696
+ return constInterruptedFiber();
29849
29697
  }
29850
- return false;
29698
+ const fiber3 = runFork3(effect2, options);
29699
+ addUnsafe2(self, fiber3, options);
29700
+ return fiber3;
29851
29701
  };
29852
- };
29853
- var any2 = () => true;
29854
- var defined = (u) => u !== void 0 && u !== null;
29855
- var instanceOf2 = (constructor) => (u) => u instanceof constructor;
29856
- var orElse4 = (f) => (self) => {
29857
- const toResult = result4(self);
29858
- if (isResult2(toResult)) {
29859
- return toResult._tag === "Success" ? toResult.success : f(toResult.failure);
29702
+ });
29703
+ var runtimePromise = (self) => () => map9(runtime(self)(), (runFork3) => (effect2, options) => new Promise((resolve4, reject) => runFork3(effect2, options).addObserver((exit3) => {
29704
+ if (isSuccess4(exit3)) {
29705
+ resolve4(exit3.value);
29706
+ } else {
29707
+ reject(squash(exit3.cause));
29708
+ }
29709
+ })));
29710
+ var size8 = (self) => sync4(() => self.state._tag === "Closed" ? 0 : self.state.backing.size);
29711
+ var join3 = (self) => _await(self.deferred);
29712
+ var awaitEmpty = (self) => whileLoop2({
29713
+ while: () => self.state._tag === "Open" && self.state.backing.size > 0,
29714
+ body: () => await_(headUnsafe(self)),
29715
+ step: constVoid
29716
+ });
29717
+
29718
+ // ../../node_modules/.bun/effect@https+++pkg.pr.new+Effect-TS+effect+effect@c7d1ffff31a3e2ae0b0b+a654a55b752bdb24/node_modules/effect/dist/PrimaryKey.js
29719
+ var symbol5 = "~effect/PrimaryKey";
29720
+
29721
+ // ../../node_modules/.bun/effect@https+++pkg.pr.new+Effect-TS+effect+effect@c7d1ffff31a3e2ae0b0b+a654a55b752bdb24/node_modules/effect/dist/Logger.js
29722
+ var Logger_exports = {};
29723
+ __export(Logger_exports, {
29724
+ CurrentLoggers: () => CurrentLoggers2,
29725
+ LogToStderr: () => LogToStderr2,
29726
+ batched: () => batched,
29727
+ consoleJson: () => consoleJson,
29728
+ consoleLogFmt: () => consoleLogFmt,
29729
+ consolePretty: () => consolePretty2,
29730
+ consolePrettyBrowser: () => consolePrettyBrowser,
29731
+ consolePrettyTty: () => consolePrettyTty,
29732
+ consoleStructured: () => consoleStructured,
29733
+ defaultLogger: () => defaultLogger2,
29734
+ formatJson: () => formatJson2,
29735
+ formatLogFmt: () => formatLogFmt,
29736
+ formatSimple: () => formatSimple,
29737
+ formatStructured: () => formatStructured,
29738
+ isLogger: () => isLogger,
29739
+ layer: () => layer,
29740
+ make: () => make42,
29741
+ map: () => map15,
29742
+ toFile: () => toFile,
29743
+ tracerLogger: () => tracerLogger2,
29744
+ withConsoleError: () => withConsoleError,
29745
+ withConsoleLog: () => withConsoleLog,
29746
+ withLeveledConsole: () => withLeveledConsole
29747
+ });
29748
+ var TypeId46 = "~effect/Logger";
29749
+ var isLogger = (u) => hasProperty(u, TypeId46);
29750
+ var CurrentLoggers2 = CurrentLoggers;
29751
+ var LogToStderr2 = LogToStderr;
29752
+ var map15 = /* @__PURE__ */ dual(2, (self, f) => loggerMake((options) => f(self.log(options))));
29753
+ var withConsoleLog = (self) => loggerMake((options) => {
29754
+ const console = options.fiber.getRef(ConsoleRef);
29755
+ return console.log(self.log(options));
29756
+ });
29757
+ var withConsoleError = (self) => loggerMake((options) => {
29758
+ const console = options.fiber.getRef(ConsoleRef);
29759
+ return console.error(self.log(options));
29760
+ });
29761
+ var withLeveledConsole = (self) => loggerMake((options) => {
29762
+ const console = options.fiber.getRef(ConsoleRef);
29763
+ const output = self.log(options);
29764
+ switch (options.logLevel) {
29765
+ case "Debug":
29766
+ return console.debug(output);
29767
+ case "Info":
29768
+ return console.info(output);
29769
+ case "Trace":
29770
+ return console.trace(output);
29771
+ case "Warn":
29772
+ return console.warn(output);
29773
+ case "Error":
29774
+ case "Fatal":
29775
+ return console.error(output);
29776
+ default:
29777
+ return console.log(output);
29778
+ }
29779
+ });
29780
+ var textOnly = /^[^\s"=]*$/;
29781
+ var escapeDoubleQuotes = (s) => `"${s.replace(/\\([\s\S])|(")/g, "\\$1$2")}"`;
29782
+ var formatFiberId = (fiberId3) => `#${fiberId3}`;
29783
+ var format9 = (quoteValue, space) => ({
29784
+ cause,
29785
+ date: date2,
29786
+ fiber: fiber3,
29787
+ logLevel,
29788
+ message
29789
+ }) => {
29790
+ const formatUnknown = (value6) => typeof value6 === "string" ? value6 : format(value6, {
29791
+ space
29792
+ });
29793
+ const formatValue = (value6) => value6.match(textOnly) ? value6 : quoteValue(value6);
29794
+ const format10 = (label, value6) => `${formatLabel(label)}=${formatValue(value6)}`;
29795
+ const append4 = (label, value6) => " " + format10(label, value6);
29796
+ let out = format10("timestamp", date2.toISOString());
29797
+ out += append4("level", logLevel.toUpperCase());
29798
+ out += append4("fiber", formatFiberId(fiber3.id));
29799
+ const messages = ensure(message);
29800
+ for (let i = 0; i < messages.length; i++) {
29801
+ out += append4("message", formatUnknown(messages[i]));
29860
29802
  }
29861
- return (...args2) => {
29862
- const a = toResult(...args2);
29863
- return isSuccess2(a) ? a.success : f(a.failure, ...args2);
29864
- };
29803
+ if (cause.reasons.length > 0) {
29804
+ out += append4("cause", causePretty(cause));
29805
+ }
29806
+ const now2 = date2.getTime();
29807
+ const spans = fiber3.getRef(CurrentLogSpans2);
29808
+ for (const span2 of spans) {
29809
+ out += " " + formatLogSpan(span2, now2);
29810
+ }
29811
+ const annotations2 = fiber3.getRef(CurrentLogAnnotations2);
29812
+ for (const [label, value6] of Object.entries(annotations2)) {
29813
+ out += append4(label, formatUnknown(value6));
29814
+ }
29815
+ return out;
29865
29816
  };
29866
- var orElseAbsurd = (self) => orElse4(() => {
29867
- throw new Error("effect/Match/orElseAbsurd: absurd");
29868
- })(self);
29869
- var result4 = (self) => {
29870
- if (self._tag === "ValueMatcher") {
29871
- return self.value;
29817
+ var make42 = loggerMake;
29818
+ var defaultLogger2 = defaultLogger;
29819
+ var formatSimple = /* @__PURE__ */ loggerMake(/* @__PURE__ */ format9(escapeDoubleQuotes));
29820
+ var formatLogFmt = /* @__PURE__ */ loggerMake(/* @__PURE__ */ format9(JSON.stringify, 0));
29821
+ var formatStructured = /* @__PURE__ */ loggerMake(({
29822
+ cause,
29823
+ date: date2,
29824
+ fiber: fiber3,
29825
+ logLevel,
29826
+ message
29827
+ }) => {
29828
+ const annotationsObj = {};
29829
+ const spansObj = {};
29830
+ const annotations2 = fiber3.getRef(CurrentLogAnnotations2);
29831
+ for (const [key, value6] of Object.entries(annotations2)) {
29832
+ assignProperty(annotationsObj, key, structuredMessage(value6));
29872
29833
  }
29873
- const len = self.cases.length;
29874
- if (len === 1) {
29875
- const _case = self.cases[0];
29876
- return (...args2) => {
29877
- const input = self.select(...args2);
29878
- if (_case._tag === "When" && _case.guard(input) === true) {
29879
- return succeed2(_case.evaluate(input, ...args2));
29880
- } else if (_case._tag === "Not" && _case.guard(input) === false) {
29881
- return succeed2(_case.evaluate(input, ...args2));
29882
- }
29883
- return fail2(input);
29884
- };
29834
+ const now2 = date2.getTime();
29835
+ const spans = fiber3.getRef(CurrentLogSpans2);
29836
+ for (const [label, timestamp] of spans) {
29837
+ assignProperty(spansObj, label, now2 - timestamp);
29885
29838
  }
29886
- return (...args2) => {
29887
- const input = self.select(...args2);
29888
- for (let i = 0; i < len; i++) {
29889
- const _case = self.cases[i];
29890
- if (_case._tag === "When" && _case.guard(input) === true) {
29891
- return succeed2(_case.evaluate(input, ...args2));
29892
- } else if (_case._tag === "Not" && _case.guard(input) === false) {
29893
- return succeed2(_case.evaluate(input, ...args2));
29894
- }
29895
- }
29896
- return fail2(input);
29839
+ const messageArr = ensure(message);
29840
+ return {
29841
+ message: messageArr.length === 1 ? structuredMessage(messageArr[0]) : messageArr.map(structuredMessage),
29842
+ level: logLevel.toUpperCase(),
29843
+ timestamp: date2.toISOString(),
29844
+ cause: cause.reasons.length > 0 ? causePretty(cause) : void 0,
29845
+ annotations: annotationsObj,
29846
+ spans: spansObj,
29847
+ fiberId: formatFiberId(fiber3.id)
29897
29848
  };
29898
- };
29899
- var option4 = (self) => {
29900
- const toResult = result4(self);
29901
- if (isResult2(toResult)) {
29902
- return match2(toResult, {
29903
- onFailure: () => none2(),
29904
- onSuccess: some3
29905
- });
29849
+ });
29850
+ var formatJson2 = /* @__PURE__ */ map15(formatStructured, formatJson);
29851
+ var batched = /* @__PURE__ */ dual(2, (self, options) => flatMap3(scope, (scope3) => {
29852
+ let buffer3 = [];
29853
+ const flush2 = suspend(() => {
29854
+ if (buffer3.length === 0) {
29855
+ return void_3;
29856
+ }
29857
+ const arr = buffer3;
29858
+ buffer3 = [];
29859
+ return options.flush(arr);
29860
+ });
29861
+ return uninterruptibleMask((restore) => restore(sleep(options.window).pipe(andThen3(flush2), forever2)).pipe(forkDetach, flatMap3((fiber3) => scopeAddFinalizerExit(scope3, () => fiberInterrupt(fiber3))), andThen3(addFinalizer(() => flush2)), as2(loggerMake((options2) => {
29862
+ buffer3.push(self.log(options2));
29863
+ }))));
29864
+ }));
29865
+ var consolePretty2 = consolePretty;
29866
+ var consolePrettyBrowser = prettyLoggerBrowser;
29867
+ var consolePrettyTty = prettyLoggerTty;
29868
+ var consoleLogFmt = /* @__PURE__ */ withConsoleLog(formatLogFmt);
29869
+ var consoleStructured = /* @__PURE__ */ withConsoleLog(formatStructured);
29870
+ var consoleJson = /* @__PURE__ */ withConsoleLog(formatJson2);
29871
+ var tracerLogger2 = tracerLogger;
29872
+ var layer = (loggers, options) => effect(CurrentLoggers2, withFiber(fnUntraced(function* (fiber3) {
29873
+ const currentLoggers = new Set(options?.mergeWithExisting === true ? fiber3.getRef(CurrentLoggers) : []);
29874
+ for (const logger of loggers) {
29875
+ currentLoggers.add(isEffect(logger) ? yield* logger : logger);
29906
29876
  }
29907
- return (...args2) => match2(toResult(...args2), {
29908
- onFailure: () => none2(),
29909
- onSuccess: some3
29877
+ return currentLoggers;
29878
+ })));
29879
+ var toFile = /* @__PURE__ */ dual((args2) => isLogger(args2[0]), (self, path, options) => gen3(function* () {
29880
+ const fs = yield* FileSystem;
29881
+ const logFile = yield* fs.open(path, {
29882
+ flag: "a+",
29883
+ ...options
29910
29884
  });
29911
- };
29912
- var getExhaustiveAbsurdErrorMessage = "effect/match/Match/exhaustive: absurd";
29913
- var exhaustive = (self) => {
29914
- const toResult = result4(self);
29915
- if (isResult2(toResult)) {
29916
- if (isSuccess2(toResult)) {
29917
- return toResult.success;
29885
+ const encoder2 = new TextEncoder();
29886
+ return yield* batched(self, {
29887
+ window: options?.batchWindow ?? 1e3,
29888
+ flush: (output) => ignore(logFile.writeAll(encoder2.encode(output.join("\n") + "\n")))
29889
+ });
29890
+ }));
29891
+
29892
+ // ../../node_modules/.bun/effect@https+++pkg.pr.new+Effect-TS+effect+effect@c7d1ffff31a3e2ae0b0b+a654a55b752bdb24/node_modules/effect/dist/ManagedRuntime.js
29893
+ var ManagedRuntime_exports = {};
29894
+ __export(ManagedRuntime_exports, {
29895
+ isManagedRuntime: () => isManagedRuntime,
29896
+ make: () => make43
29897
+ });
29898
+ var TypeId47 = "~effect/ManagedRuntime";
29899
+ var isManagedRuntime = (input) => hasProperty(input, TypeId47);
29900
+ var make43 = (layer2, options) => {
29901
+ const memoMap = options?.memoMap ?? makeMemoMapUnsafe();
29902
+ const scope3 = makeUnsafe3("parallel");
29903
+ const layerScope = forkUnsafe2(scope3, "sequential");
29904
+ const defaultRunOptions = {
29905
+ onFiberStart: runIn(scope3)
29906
+ };
29907
+ const mergeRunOptions = (options2) => options2 ? {
29908
+ ...options2,
29909
+ onFiberStart: options2.onFiberStart ? (fiber3) => {
29910
+ defaultRunOptions.onFiberStart(fiber3);
29911
+ options2.onFiberStart(fiber3);
29912
+ } : defaultRunOptions.onFiberStart
29913
+ } : defaultRunOptions;
29914
+ let buildFiber;
29915
+ const contextEffect = withFiber2((fiber3) => {
29916
+ if (!buildFiber) {
29917
+ buildFiber = runFork2(tap6(buildWithMemoMap(layer2, memoMap, layerScope), (context3) => sync4(() => {
29918
+ self.cachedContext = context3;
29919
+ })), {
29920
+ ...defaultRunOptions,
29921
+ scheduler: fiber3.cache.scheduler
29922
+ });
29918
29923
  }
29919
- throw new Error(getExhaustiveAbsurdErrorMessage);
29920
- }
29921
- return (...args2) => {
29922
- const result6 = toResult(...args2);
29923
- if (isSuccess2(result6)) {
29924
- return result6.success;
29924
+ return flatten5(await_(buildFiber));
29925
+ });
29926
+ const self = {
29927
+ [TypeId47]: TypeId47,
29928
+ memoMap,
29929
+ scope: scope3,
29930
+ contextEffect,
29931
+ cachedContext: void 0,
29932
+ context() {
29933
+ return self.cachedContext === void 0 ? runPromise2(self.contextEffect) : Promise.resolve(self.cachedContext);
29934
+ },
29935
+ dispose() {
29936
+ return runPromise2(self.disposeEffect);
29937
+ },
29938
+ [Symbol.asyncDispose]() {
29939
+ return self.dispose();
29940
+ },
29941
+ disposeEffect: suspend3(() => {
29942
+ ;
29943
+ self.contextEffect = die5("ManagedRuntime disposed");
29944
+ self.cachedContext = void 0;
29945
+ return close(self.scope, void_4);
29946
+ }),
29947
+ runFork(effect2, options2) {
29948
+ return self.cachedContext === void 0 ? runFork2(provide7(self, effect2), mergeRunOptions(options2)) : runForkWith2(self.cachedContext)(effect2, mergeRunOptions(options2));
29949
+ },
29950
+ runCallback(effect2, options2) {
29951
+ return self.cachedContext === void 0 ? runCallback2(provide7(self, effect2), mergeRunOptions(options2)) : runCallbackWith2(self.cachedContext)(effect2, mergeRunOptions(options2));
29952
+ },
29953
+ runSyncExit(effect2) {
29954
+ return self.cachedContext === void 0 ? runSyncExit2(provide7(self, effect2)) : runSyncExitWith2(self.cachedContext)(effect2);
29955
+ },
29956
+ runSync(effect2) {
29957
+ return self.cachedContext === void 0 ? runSync2(provide7(self, effect2)) : runSyncWith2(self.cachedContext)(effect2);
29958
+ },
29959
+ runPromiseExit(effect2, options2) {
29960
+ return self.cachedContext === void 0 ? runPromiseExit2(provide7(self, effect2), mergeRunOptions(options2)) : runPromiseExitWith2(self.cachedContext)(effect2, mergeRunOptions(options2));
29961
+ },
29962
+ runPromise(effect2, options2) {
29963
+ return self.cachedContext === void 0 ? runPromise2(provide7(self, effect2), mergeRunOptions(options2)) : runPromiseWith2(self.cachedContext)(effect2, mergeRunOptions(options2));
29925
29964
  }
29926
- throw new Error(getExhaustiveAbsurdErrorMessage);
29927
29965
  };
29966
+ return self;
29928
29967
  };
29929
-
29930
- // ../../node_modules/.bun/effect@https+++pkg.pr.new+Effect-TS+effect+effect@c7d1ffff31a3e2ae0b0b+a654a55b752bdb24/node_modules/effect/dist/Match.js
29931
- var type2 = type;
29932
- var fn4 = fn3;
29933
- var value5 = value4;
29934
- var valueTags2 = valueTags;
29935
- var typeTags2 = typeTags;
29936
- var withReturnType2 = withReturnType;
29937
- var when5 = when4;
29938
- var whenOr2 = whenOr;
29939
- var whenAnd2 = whenAnd;
29940
- var discriminator2 = discriminator;
29941
- var discriminatorStartsWith2 = discriminatorStartsWith;
29942
- var discriminators2 = discriminators;
29943
- var discriminatorsExhaustive2 = discriminatorsExhaustive;
29944
- var tag3 = tag2;
29945
- var tagStartsWith2 = tagStartsWith;
29946
- var tags2 = tags;
29947
- var tagsExhaustive2 = tagsExhaustive;
29948
- var not3 = not2;
29949
- var nonEmptyString2 = nonEmptyString;
29950
- var is4 = is3;
29951
- var string3 = isString;
29952
- var number3 = isNumber;
29953
- var any3 = any2;
29954
- var defined2 = defined;
29955
- var boolean2 = isBoolean;
29956
- var _undefined = isUndefined;
29957
- var _null = isNull;
29958
- var bigint = isBigInt;
29959
- var symbol5 = isSymbol;
29960
- var date = isDate;
29961
- var record2 = isObject;
29962
- var instanceOf3 = instanceOf2;
29963
- var instanceOfUnsafe = instanceOf2;
29964
- var orElse5 = orElse4;
29965
- var orElseAbsurd2 = orElseAbsurd;
29966
- var result5 = result4;
29967
- var option5 = option4;
29968
- var exhaustive2 = exhaustive;
29968
+ function provide7(managed, effect2) {
29969
+ return flatMap5(managed.contextEffect, (context3) => provideContext2(effect2, context3));
29970
+ }
29969
29971
 
29970
29972
  // ../../node_modules/.bun/effect@https+++pkg.pr.new+Effect-TS+effect+effect@c7d1ffff31a3e2ae0b0b+a654a55b752bdb24/node_modules/effect/dist/UndefinedOr.js
29971
29973
  var map16 = /* @__PURE__ */ dual(2, (self, f) => self === void 0 ? void 0 : f(self));
@@ -30441,10 +30443,10 @@ export {
30441
30443
  FileSystem,
30442
30444
  Path,
30443
30445
  map14 as map5,
30444
- orElse3 as orElse,
30446
+ orElse5 as orElse,
30445
30447
  all5 as all,
30446
30448
  withDefault2,
30447
- option3 as option,
30449
+ option5 as option,
30448
30450
  schema,
30449
30451
  String7 as String2,
30450
30452
  Int2,
@@ -30459,7 +30461,7 @@ export {
30459
30461
  runtime,
30460
30462
  awaitEmpty,
30461
30463
  FiberSet_exports,
30462
- symbol4 as symbol3,
30464
+ symbol5 as symbol3,
30463
30465
  make42 as make8,
30464
30466
  layer,
30465
30467
  Logger_exports,