@dual-os/github-api 6.0.3 → 6.0.5

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 (66) hide show
  1. package/LICENSE +24 -0
  2. package/README.md +35 -0
  3. package/Runner.js +342 -576
  4. package/Runner.js.map +5 -9
  5. package/bundle-inventory.json +1 -1
  6. package/dist/auth.d.ts +13 -1
  7. package/dist/auth.d.ts.map +1 -1
  8. package/dist/auth.js +5 -3
  9. package/dist/auth.js.map +1 -1
  10. package/dist/channel/github-app-client.d.ts +67 -0
  11. package/dist/channel/github-app-client.d.ts.map +1 -0
  12. package/dist/channel/github-app-client.js +18 -0
  13. package/dist/channel/github-app-client.js.map +9 -0
  14. package/dist/channel/github-app-definition.d.ts +190 -0
  15. package/dist/channel/github-app-definition.d.ts.map +1 -0
  16. package/dist/channel/github-app-definition.js +32 -0
  17. package/dist/channel/github-app-definition.js.map +9 -0
  18. package/dist/channel/github-app.d.ts +126 -0
  19. package/dist/channel/github-app.d.ts.map +1 -0
  20. package/dist/channel/github-app.js +17 -0
  21. package/dist/channel/github-app.js.map +9 -0
  22. package/dist/channel/internal/webhook.d.ts +38 -0
  23. package/dist/channel/internal/webhook.d.ts.map +1 -0
  24. package/dist/channel/internal/webhook.js +22 -0
  25. package/dist/channel/internal/webhook.js.map +9 -0
  26. package/dist/generated/http.js +7 -5
  27. package/dist/generated/http.js.map +1 -1
  28. package/dist/generated/operations.d.ts +1154 -1154
  29. package/dist/generated/operations.d.ts.map +1 -1
  30. package/dist/generated/operations.js +7 -5
  31. package/dist/generated/operations.js.map +1 -1
  32. package/dist/generated/plugin.js +14 -10515
  33. package/dist/generated/plugin.js.map +3 -4
  34. package/dist/plugin.d.ts +10 -0
  35. package/dist/plugin.d.ts.map +1 -0
  36. package/dist/plugin.js +33 -0
  37. package/dist/plugin.js.map +10 -0
  38. package/dist/triggers.d.ts +26 -2
  39. package/dist/triggers.d.ts.map +1 -1
  40. package/dist/triggers.js +8 -6
  41. package/dist/triggers.js.map +1 -1
  42. package/dual-plugin.json +1 -1
  43. package/package.json +1 -1
  44. package/{plugin-t4j28rxn.js → plugin-1b35jx9g.js} +6 -4
  45. package/{plugin-t4j28rxn.js.map → plugin-1b35jx9g.js.map} +2 -2
  46. package/plugin-2qqpmr67.js +108 -0
  47. package/plugin-2qqpmr67.js.map +10 -0
  48. package/{plugin-yzj02c6j.js → plugin-3ryytw13.js} +193 -308
  49. package/{plugin-yzj02c6j.js.map → plugin-3ryytw13.js.map} +5 -6
  50. package/{plugin-3mpmm6hc.js → plugin-5rkcrntd.js} +4 -4
  51. package/plugin-7hfrx1dg.js +167 -0
  52. package/plugin-7hfrx1dg.js.map +10 -0
  53. package/plugin-e0mt19z7.js +377 -0
  54. package/plugin-e0mt19z7.js.map +10 -0
  55. package/{plugin-ahctqzvj.js → plugin-gtd7vh23.js} +4 -4
  56. package/plugin-p1y3h7d7.js +10516 -0
  57. package/plugin-p1y3h7d7.js.map +10 -0
  58. package/plugin-p6f7n836.js +631 -0
  59. package/plugin-p6f7n836.js.map +12 -0
  60. package/plugin-r0m0v72b.js +156 -0
  61. package/plugin-r0m0v72b.js.map +10 -0
  62. package/{plugin-gajxsj3f.js → plugin-w0va8331.js} +2495 -2288
  63. package/{plugin-gajxsj3f.js.map → plugin-w0va8331.js.map} +12 -13
  64. /package/licenses/{@dual-os_sdk@0.8.1 → @dual-os_sdk@0.9.0}/LICENSE +0 -0
  65. /package/{plugin-3mpmm6hc.js.map → plugin-5rkcrntd.js.map} +0 -0
  66. /package/{plugin-ahctqzvj.js.map → plugin-gtd7vh23.js.map} +0 -0
package/Runner.js CHANGED
@@ -1,7 +1,6 @@
1
1
  // @bun
2
2
  import {
3
3
  pipeArguments,
4
- dual,
5
4
  identity,
6
5
  constVoid,
7
6
  pipe,
@@ -11,26 +10,21 @@ import {
11
10
  isNotNull,
12
11
  isNullish,
13
12
  hasProperty,
14
- hash,
15
- equals,
16
13
  byReferenceUnsafe,
17
14
  format,
18
15
  NodeInspectSymbol,
19
16
  toJson,
20
17
  BaseProto,
21
- PipeInspectableProto,
22
18
  Prototype,
23
19
  String2,
24
20
  mapInput,
25
21
  none,
26
22
  some,
27
- isSome,
28
23
  match2,
29
24
  getOrElse,
30
25
  orElse,
31
26
  fromNullishOr,
32
27
  fromUndefinedOr,
33
- getOrUndefined,
34
28
  map,
35
29
  flatMap,
36
30
  Service,
@@ -42,49 +36,44 @@ import {
42
36
  succeed,
43
37
  fail,
44
38
  getOrThrow,
45
- empty,
46
39
  sort,
47
40
  of,
48
- every,
49
41
  fromInputUnsafe,
50
42
  isFinite,
51
43
  toMillis,
52
- toPredicate,
53
- has2,
54
- compose,
55
44
  Error2,
56
45
  TaggedError,
57
- forkUnsafe,
58
- isInterruptReason,
46
+ scopeRemoveFinalizerUnsafe,
47
+ fiberEnterUninterruptibleUnsafe,
59
48
  fail2,
60
- hasInterruptsOnly,
61
49
  squash,
62
50
  hasInterrupts,
63
- filterInterruptors,
64
51
  Done,
65
52
  done,
66
53
  UnknownError,
67
- succeed2,
54
+ succeed3,
68
55
  fail3,
69
- void_,
56
+ void_2,
70
57
  isSuccess2,
71
58
  isFailure,
72
59
  makeUnsafe2,
73
- make,
74
60
  _await,
61
+ done2,
75
62
  fail4,
76
63
  isDone,
77
64
  isDoneUnsafe,
78
65
  doneUnsafe,
79
- into,
80
66
  Scope,
67
+ make,
81
68
  makeUnsafe3,
82
69
  addFinalizerExit,
83
70
  addFinalizer,
84
- fork,
71
+ forkUnsafe2,
85
72
  close,
73
+ makeMemoMapUnsafe,
74
+ buildWithMemoMap,
86
75
  buildWithScope,
87
- succeed3,
76
+ succeed4,
88
77
  effect,
89
78
  mergeAll,
90
79
  provide,
@@ -96,10 +85,10 @@ import {
96
85
  all2,
97
86
  forEach,
98
87
  tryPromise,
99
- succeed4,
88
+ succeed5,
100
89
  suspend,
101
- sync,
102
- void_2,
90
+ sync2,
91
+ void_3,
103
92
  undefined_,
104
93
  callback,
105
94
  never,
@@ -109,8 +98,9 @@ import {
109
98
  failCause,
110
99
  die,
111
100
  try_2,
112
- withFiber,
101
+ withFiber2,
113
102
  flatMap3,
103
+ flatten2,
114
104
  andThen,
115
105
  tap,
116
106
  map4,
@@ -119,21 +109,19 @@ import {
119
109
  catch_,
120
110
  catchTag,
121
111
  catchReason,
122
- catchCause,
123
112
  catchIf,
124
113
  catchCauseIf,
125
114
  mapError2,
126
115
  orDie,
127
- tapCause,
128
116
  ignore,
129
117
  ignoreCause,
130
118
  sleep,
131
119
  raceFirst,
132
120
  matchEffect,
133
121
  context,
134
- provide2,
135
122
  provideContext,
136
123
  serviceOption,
124
+ provideService,
137
125
  scope,
138
126
  scoped,
139
127
  acquireRelease,
@@ -151,14 +139,22 @@ import {
151
139
  forkScoped,
152
140
  runFork,
153
141
  runForkWith,
142
+ runCallbackWith,
143
+ runCallback,
144
+ runPromise,
145
+ runPromiseWith,
146
+ runPromiseExit,
147
+ runPromiseExitWith,
148
+ runSync,
149
+ runSyncWith,
150
+ runSyncExit,
151
+ runSyncExitWith,
154
152
  fnUntraced,
155
153
  clockWith,
156
- logError,
157
154
  effectify,
158
155
  await_,
159
156
  join2,
160
157
  interrupt2,
161
- interruptAll,
162
158
  getCurrent,
163
159
  runIn,
164
160
  make2,
@@ -178,8 +174,8 @@ import {
178
174
  encodeEffect,
179
175
  Unknown,
180
176
  String3,
177
+ Struct,
181
178
  Record,
182
- Tuple,
183
179
  Literals,
184
180
  tag,
185
181
  NonEmptyString,
@@ -196,19 +192,18 @@ import {
196
192
  fromChannel,
197
193
  fromPull,
198
194
  callback2,
199
- empty5,
195
+ empty4,
200
196
  suspend2,
201
197
  fail6,
202
198
  unwrap2,
203
199
  drainFork,
204
- merge,
200
+ merge2,
205
201
  tapError,
206
202
  transduce,
207
203
  decodeText,
208
204
  splitLines,
209
205
  run,
210
206
  runCollect,
211
- runForEach,
212
207
  runDrain,
213
208
  mkString,
214
209
  layer,
@@ -224,16 +219,13 @@ import {
224
219
  oauth2TokenRefresherLayer,
225
220
  make6,
226
221
  isPlugin,
227
- Identity,
228
222
  filesUnavailable,
229
223
  PluginExecutionError,
230
- ipcMessages,
231
- sendIpc,
232
224
  decodeInput,
233
225
  encodeOutput,
234
226
  responseLimit,
235
227
  execute3
236
- } from "./plugin-gajxsj3f.js";
228
+ } from "./plugin-w0va8331.js";
237
229
  var __defProp = Object.defineProperty;
238
230
  var __returnValue = (v) => v;
239
231
  function __exportSetter(name, newValue) {
@@ -249,111 +241,6 @@ var __export = (target, all) => {
249
241
  });
250
242
  };
251
243
 
252
- // ../../../../node_modules/.bun/effect@4.1.2/node_modules/effect/dist/MutableHashMap.js
253
- var TypeId = "~effect/MutableHashMap";
254
- var MutableHashMapProto = {
255
- [TypeId]: TypeId,
256
- [Symbol.iterator]() {
257
- return this.backing[Symbol.iterator]();
258
- },
259
- toString() {
260
- return `MutableHashMap(${format(Array.from(this))})`;
261
- },
262
- toJSON() {
263
- return {
264
- _id: "MutableHashMap",
265
- values: toJson(Array.from(this))
266
- };
267
- },
268
- [NodeInspectSymbol]() {
269
- return this.toJSON();
270
- },
271
- pipe() {
272
- return pipeArguments(this, arguments);
273
- }
274
- };
275
- var empty2 = () => {
276
- const self = Object.create(MutableHashMapProto);
277
- self.backing = new Map;
278
- self.buckets = new Map;
279
- return self;
280
- };
281
- var get2 = /* @__PURE__ */ dual(2, (self, key) => {
282
- if (self.backing.has(key)) {
283
- return some(self.backing.get(key));
284
- } else if (isSimpleKey(key)) {
285
- return none();
286
- }
287
- const hash2 = hash(key);
288
- const bucket = self.buckets.get(hash2);
289
- if (bucket === undefined) {
290
- return none();
291
- }
292
- return getFromBucket(self, bucket, key);
293
- });
294
- var isSimpleKey = (u) => typeof u !== "object" && typeof u !== "function";
295
- var getFromBucket = (self, bucket, key) => {
296
- for (let i = 0, len = bucket.length;i < len; i++) {
297
- if (equals(key, bucket[i])) {
298
- const refKey = bucket[i];
299
- return some(self.backing.get(refKey));
300
- }
301
- }
302
- return none();
303
- };
304
- var has = /* @__PURE__ */ dual(2, (self, key) => isSome(get2(self, key)));
305
- var set = /* @__PURE__ */ dual(3, (self, key, value) => {
306
- if (self.backing.has(key) || isSimpleKey(key)) {
307
- self.backing.set(key, value);
308
- return self;
309
- }
310
- const hash2 = hash(key);
311
- const bucket = self.buckets.get(hash2);
312
- if (bucket === undefined) {
313
- self.buckets.set(hash2, [key]);
314
- self.backing.set(key, value);
315
- return self;
316
- }
317
- let refKey = getRefKey(bucket, key);
318
- if (refKey === undefined) {
319
- bucket.push(key);
320
- refKey = key;
321
- }
322
- self.backing.set(refKey, value);
323
- return self;
324
- });
325
- var getRefKey = (bucket, key) => {
326
- for (let i = 0, len = bucket.length;i < len; i++) {
327
- if (equals(key, bucket[i])) {
328
- return bucket[i];
329
- }
330
- }
331
- };
332
- var remove = /* @__PURE__ */ dual(2, (self, key_) => {
333
- if (isSimpleKey(key_)) {
334
- self.backing.delete(key_);
335
- return self;
336
- }
337
- const hash2 = hash(key_);
338
- const bucket = self.buckets.get(hash2);
339
- if (bucket === undefined) {
340
- return self;
341
- }
342
- for (let i = 0, len = bucket.length;i < len; i++) {
343
- const bkey = bucket[i];
344
- if (bkey === key_ || equals(key_, bkey)) {
345
- self.backing.delete(bkey);
346
- bucket.splice(i, 1);
347
- break;
348
- }
349
- }
350
- if (bucket.length === 0) {
351
- self.buckets.delete(hash2);
352
- }
353
- return self;
354
- });
355
- var size = (self) => self.backing.size;
356
-
357
244
  // ../../../../node_modules/.bun/effect@4.1.2/node_modules/effect/dist/internal/ulid.js
358
245
  var maxTimestamp = 2 ** 48 - 1;
359
246
  var base32Chars = "0123456789ABCDEFGHJKMNPQRSTVWXYZ";
@@ -524,9 +411,9 @@ var make3 = (randomBytes) => {
524
411
  const ulid = makeMonotonic();
525
412
  const ulidRandomBytes = () => randomBytes(10);
526
413
  return {
527
- randomBytes: (size) => sync(() => randomBytesChecked(size)),
528
- intBetween: (min, max, options) => sync(() => intBetweenUnsafe(min, max, options?.halfOpen ?? false, draw)),
529
- shuffle: (elements) => sync(() => {
414
+ randomBytes: (size) => sync2(() => randomBytesChecked(size)),
415
+ intBetween: (min, max, options) => sync2(() => intBetweenUnsafe(min, max, options?.halfOpen ?? false, draw)),
416
+ shuffle: (elements) => sync2(() => {
530
417
  const buffer = Array.from(elements);
531
418
  for (let i = buffer.length - 1;i >= 1; i--) {
532
419
  const index = intBetweenUnsafe(0, i, false, draw);
@@ -536,9 +423,9 @@ var make3 = (randomBytes) => {
536
423
  }
537
424
  return buffer;
538
425
  }),
539
- uuidV4: (options) => sync(() => makeUuid(v4Bytes, randomBytes, options?.format)),
540
- uuidV7: (options) => clockWith((clock) => sync(() => makeUuid((bytes) => uuidV7(clock.currentTimeMillisUnsafe(), bytes), randomBytes, options?.format))),
541
- ulid: clockWith((clock) => sync(() => ulid(clock.currentTimeMillisUnsafe(), ulidRandomBytes)))
426
+ uuidV4: (options) => sync2(() => makeUuid(v4Bytes, randomBytes, options?.format)),
427
+ uuidV7: (options) => clockWith((clock) => sync2(() => makeUuid((bytes) => uuidV7(clock.currentTimeMillisUnsafe(), bytes), randomBytes, options?.format))),
428
+ ulid: clockWith((clock) => sync2(() => ulid(clock.currentTimeMillisUnsafe(), ulidRandomBytes)))
542
429
  };
543
430
  };
544
431
  var fillRandom = (crypto, size) => {
@@ -548,7 +435,7 @@ var fillRandom = (crypto, size) => {
548
435
  }
549
436
  return bytes;
550
437
  };
551
- var layerWebCrypto = /* @__PURE__ */ effect(SecureRandom, /* @__PURE__ */ WebCrypto.use((crypto) => succeed4(make3((size) => fillRandom(crypto, size)))));
438
+ var layerWebCrypto = /* @__PURE__ */ effect(SecureRandom, /* @__PURE__ */ WebCrypto.use((crypto) => succeed5(make3((size) => fillRandom(crypto, size)))));
552
439
 
553
440
  // ../../../../node_modules/.bun/effect@4.1.2/node_modules/effect/dist/BigInt.js
554
441
  var BigInt2 = globalThis.BigInt;
@@ -711,7 +598,7 @@ __export(exports_Aead, {
711
598
  });
712
599
 
713
600
  // ../../../../node_modules/.bun/effect@4.1.2/node_modules/effect/dist/crypto/CryptoError.js
714
- var TypeId2 = "~effect/crypto/CryptoError";
601
+ var TypeId = "~effect/crypto/CryptoError";
715
602
  var ReasonTypeId = "~effect/crypto/CryptoError/Reason";
716
603
 
717
604
  class InvalidArgument extends (/* @__PURE__ */ TaggedError("InvalidArgument")) {
@@ -750,7 +637,7 @@ class NotExtractable extends (/* @__PURE__ */ TaggedError("NotExtractable")) {
750
637
  }
751
638
 
752
639
  class CryptoError extends (/* @__PURE__ */ TaggedError("CryptoError")) {
753
- [TypeId2] = TypeId2;
640
+ [TypeId] = TypeId;
754
641
  cause = "cause" in this.reason ? this.reason.cause : undefined;
755
642
  get message() {
756
643
  return `${this.module}.${this.method}: ${this.reason.message}`;
@@ -1564,7 +1451,7 @@ var fromBytes = (module, method, proto, algorithm, bytes, check) => suspend(() =
1564
1451
  if (!(bytes instanceof Uint8Array))
1565
1452
  return invalidKey(module, method, "Expected the key as a Uint8Array");
1566
1453
  const problem = check(bytes);
1567
- return problem === undefined ? succeed4(makeBytes(proto, algorithm, copyBytes2(bytes))) : invalidKey(module, method, problem);
1454
+ return problem === undefined ? succeed5(makeBytes(proto, algorithm, copyBytes2(bytes))) : invalidKey(module, method, problem);
1568
1455
  });
1569
1456
  var checkAesLength = (name, keyLength) => (algorithm) => {
1570
1457
  const length = algorithm.length;
@@ -1601,7 +1488,7 @@ var importedAlgorithm = (algorithm, cryptoKey) => {
1601
1488
  };
1602
1489
  var fromCryptoKey = (module, method, proto, algorithm, cryptoKey, expected) => suspend(() => {
1603
1490
  const problem = checkCryptoKey(cryptoKey, expected);
1604
- return problem === undefined ? succeed4(make8(proto, importedAlgorithm(algorithm, cryptoKey), {
1491
+ return problem === undefined ? succeed5(make8(proto, importedAlgorithm(algorithm, cryptoKey), {
1605
1492
  _tag: "CryptoKey",
1606
1493
  cryptoKey
1607
1494
  })) : invalidKey(module, method, problem);
@@ -1610,7 +1497,7 @@ var exportRaw = async (subtle, cryptoKey) => new Uint8Array(await subtle.exportK
1610
1497
  var toBytes = (module, key, exportKey) => suspend(() => {
1611
1498
  const stored = material(key);
1612
1499
  if (stored._tag === "Bytes")
1613
- return succeed4(copyBytes2(stored.bytes));
1500
+ return succeed5(copyBytes2(stored.bytes));
1614
1501
  if (!stored.cryptoKey.extractable)
1615
1502
  return notExtractable(module, "toBytes");
1616
1503
  return runWithReference(module, "toBytes", key.algorithm.name, (subtle) => exportKey(subtle, stored.cryptoKey));
@@ -1631,7 +1518,7 @@ var makeCache = (importKey) => {
1631
1518
  };
1632
1519
 
1633
1520
  // ../../../../node_modules/.bun/effect@4.1.2/node_modules/effect/dist/crypto/Aead.js
1634
- var TypeId3 = "~effect/crypto/Aead/Key";
1521
+ var TypeId2 = "~effect/crypto/Aead/Key";
1635
1522
  var aes128Gcm = {
1636
1523
  name: "aes128Gcm",
1637
1524
  keyLength: 16,
@@ -1660,8 +1547,8 @@ var xchacha20Poly13052 = {
1660
1547
  nonceLength: 24,
1661
1548
  implementation: /* @__PURE__ */ chachaImplementation(xchacha20Poly1305)
1662
1549
  };
1663
- var KeyProto = /* @__PURE__ */ redactedProto(TypeId3, "Aead.Key");
1664
- var isKey = (u) => hasProperty(u, TypeId3);
1550
+ var KeyProto = /* @__PURE__ */ redactedProto(TypeId2, "Aead.Key");
1551
+ var isKey = (u) => hasProperty(u, TypeId2);
1665
1552
 
1666
1553
  class Aead extends (/* @__PURE__ */ Service()("effect/crypto/Aead")) {
1667
1554
  }
@@ -1696,11 +1583,11 @@ var runImplementation = (method, implementation, key2, data, options) => {
1696
1583
  }
1697
1584
  const aad = options.aad ?? new Uint8Array(0);
1698
1585
  if (method === "encrypt") {
1699
- return sync(() => implementation.encrypt(stored.bytes, options.nonce, data, aad));
1586
+ return sync2(() => implementation.encrypt(stored.bytes, options.nonce, data, aad));
1700
1587
  }
1701
1588
  return suspend(() => {
1702
1589
  const plaintext = implementation.decrypt(stored.bytes, options.nonce, data, aad);
1703
- return plaintext === undefined ? decryptionFailed() : succeed4(plaintext);
1590
+ return plaintext === undefined ? decryptionFailed() : succeed5(plaintext);
1704
1591
  });
1705
1592
  };
1706
1593
  var layerWebCryptoWith = (options) => effect(Aead, gen(function* () {
@@ -1761,7 +1648,7 @@ __export(exports_Cipher, {
1761
1648
  layerWebCrypto: () => layerWebCrypto3,
1762
1649
  toBytes: () => toBytes3
1763
1650
  });
1764
- var TypeId4 = "~effect/crypto/Cipher/Key";
1651
+ var TypeId3 = "~effect/crypto/Cipher/Key";
1765
1652
  var aes128Ctr = {
1766
1653
  name: "aes128Ctr",
1767
1654
  mode: "AES-CTR",
@@ -1782,8 +1669,8 @@ var aes256Cbc = {
1782
1669
  mode: "AES-CBC",
1783
1670
  keyLength: 32
1784
1671
  };
1785
- var KeyProto2 = /* @__PURE__ */ redactedProto(TypeId4, "Cipher.Key");
1786
- var isKey2 = (u) => hasProperty(u, TypeId4);
1672
+ var KeyProto2 = /* @__PURE__ */ redactedProto(TypeId3, "Cipher.Key");
1673
+ var isKey2 = (u) => hasProperty(u, TypeId3);
1787
1674
 
1788
1675
  class Cipher extends (/* @__PURE__ */ Service()("effect/crypto/Cipher")) {
1789
1676
  }
@@ -2004,7 +1891,7 @@ var layerWebCrypto4 = /* @__PURE__ */ effect(KeyAgreement, /* @__PURE__ */ gen(f
2004
1891
  }), onError).pipe(flatMap3((keys) => run2("KeyAgreement", "deriveSharedSecret", algorithm.name, crypto, async (subtle) => new Uint8Array(await subtle.deriveBits({
2005
1892
  name: specOf(algorithm).name,
2006
1893
  public: keys.publicKey
2007
- }, keys.privateKey, sharedSecretBits(algorithm))), (cause) => isOperationError(cause) ? invalidPeer("Invalid peer public key", cause) : onError(cause))), flatMap3((secret) => algorithm._tag === "X25519" && secret.every((byte) => byte === 0) ? fail5(invalidPeer("X25519 shared secret must not be all zeros")) : succeed4(secret)));
1894
+ }, keys.privateKey, sharedSecretBits(algorithm))), (cause) => isOperationError(cause) ? invalidPeer("Invalid peer public key", cause) : onError(cause))), flatMap3((secret) => algorithm._tag === "X25519" && secret.every((byte) => byte === 0) ? fail5(invalidPeer("X25519 shared secret must not be all zeros")) : succeed5(secret)));
2008
1895
  }),
2009
1896
  publicKeyOf: (privateKey) => publicKeyOf(family, crypto, privateKey)
2010
1897
  });
@@ -2050,7 +1937,7 @@ __export(exports_Mac, {
2050
1937
  timingSafeEqual: () => timingSafeEqual,
2051
1938
  toBytes: () => toBytes5
2052
1939
  });
2053
- var TypeId5 = "~effect/crypto/Mac/Key";
1940
+ var TypeId4 = "~effect/crypto/Mac/Key";
2054
1941
  var hmacSha1 = {
2055
1942
  name: "hmacSha1",
2056
1943
  hash: sha1
@@ -2067,8 +1954,8 @@ var hmacSha512 = {
2067
1954
  name: "hmacSha512",
2068
1955
  hash: sha512
2069
1956
  };
2070
- var KeyProto3 = /* @__PURE__ */ redactedProto(TypeId5, "Mac.Key");
2071
- var isKey3 = (u) => hasProperty(u, TypeId5);
1957
+ var KeyProto3 = /* @__PURE__ */ redactedProto(TypeId4, "Mac.Key");
1958
+ var isKey3 = (u) => hasProperty(u, TypeId4);
2072
1959
  var blockSizes = {
2073
1960
  MD5: 64,
2074
1961
  "SHA-1": 64,
@@ -2098,11 +1985,11 @@ var layerWebCryptoWith2 = (options) => effect(Mac, gen(function* () {
2098
1985
  generateKey: (algorithm) => map4(random.randomBytes(blockSizes[algorithm.hash.name]), (bytes) => makeBytes(KeyProto3, algorithm, bytes)),
2099
1986
  sign: (key, data) => {
2100
1987
  const tagOf = hmacTag(key);
2101
- return tagOf !== undefined ? sync(() => tagOf(data)) : run2("Mac", "sign", key.algorithm.name, crypto, async (subtle) => new Uint8Array(await subtle.sign("HMAC", await cryptoKeyFor(subtle, key), data)));
1988
+ return tagOf !== undefined ? sync2(() => tagOf(data)) : run2("Mac", "sign", key.algorithm.name, crypto, async (subtle) => new Uint8Array(await subtle.sign("HMAC", await cryptoKeyFor(subtle, key), data)));
2102
1989
  },
2103
1990
  verify: (key, tag, data) => {
2104
1991
  const tagOf = hmacTag(key);
2105
- return tagOf !== undefined ? sync(() => timingSafeEqual(tagOf(data), tag)) : run2("Mac", "verify", key.algorithm.name, crypto, async (subtle) => subtle.verify("HMAC", await cryptoKeyFor(subtle, key), tag, data));
1992
+ return tagOf !== undefined ? sync2(() => timingSafeEqual(tagOf(data), tag)) : run2("Mac", "verify", key.algorithm.name, crypto, async (subtle) => subtle.verify("HMAC", await cryptoKeyFor(subtle, key), tag, data));
2106
1993
  }
2107
1994
  });
2108
1995
  }));
@@ -2951,7 +2838,7 @@ var walk = /* @__PURE__ */ fnUntraced(function* (fs, compiled, options) {
2951
2838
  const isUnlisted = (value) => value === "." || value === ".." || isRoot(value);
2952
2839
  const probe = (parent, name, named) => {
2953
2840
  const path = toFsPath(join(parent, name));
2954
- return fs.stat(path).pipe(map4((info) => info.type), catchReason("PlatformError", "NotFound", () => fs.readLink(path).pipe(as("SymbolicLink"), catchIf(isNotLink, () => succeed4(undefined)))), catchIf(named ? isMissing : isIgnorable, () => succeed4(undefined)), map4((type) => type === undefined ? undefined : {
2841
+ return fs.stat(path).pipe(map4((info) => info.type), catchReason("PlatformError", "NotFound", () => fs.readLink(path).pipe(as("SymbolicLink"), catchIf(isNotLink, () => succeed5(undefined)))), catchIf(named ? isMissing : isIgnorable, () => succeed5(undefined)), map4((type) => type === undefined ? undefined : {
2955
2842
  name,
2956
2843
  type
2957
2844
  }));
@@ -2968,7 +2855,7 @@ var walk = /* @__PURE__ */ fnUntraced(function* (fs, compiled, options) {
2968
2855
  }
2969
2856
  }
2970
2857
  const probed = listed ? [...literals].filter(isUnlisted) : [...literals];
2971
- return zipWith(listed ? catchIf(fs.readDirectoryEntries(toFsPath(relative)), named ? isMissing : isIgnorable, () => succeed4([])) : succeed4([]), forEach(probed, (name) => probe(relative, name, named), {
2858
+ return zipWith(listed ? catchIf(fs.readDirectoryEntries(toFsPath(relative)), named ? isMissing : isIgnorable, () => succeed5([])) : succeed5([]), forEach(probed, (name) => probe(relative, name, named), {
2972
2859
  concurrency: 16
2973
2860
  }), (listing, found) => ({
2974
2861
  entries: sort([...listing, ...found.filter(isNotUndefined)], byName),
@@ -3006,22 +2893,22 @@ var walk = /* @__PURE__ */ fnUntraced(function* (fs, compiled, options) {
3006
2893
  return child(type === "Directory", false);
3007
2894
  }
3008
2895
  const path = toFsPath(relative);
3009
- return fs.stat(path).pipe(map4((info) => info.type === "Directory"), catchIf(isIgnorable, () => succeed4(false)), flatMap3((isDirectory) => {
2896
+ return fs.stat(path).pipe(map4((info) => info.type === "Directory"), catchIf(isIgnorable, () => succeed5(false)), flatMap3((isDirectory) => {
3010
2897
  const resolved = child(isDirectory, type === "SymbolicLink");
3011
2898
  if (type === "SymbolicLink" || resolved?.next === undefined || result.globstar.size === 0) {
3012
- return succeed4(resolved);
2899
+ return succeed5(resolved);
3013
2900
  }
3014
- return fs.readLink(path).pipe(as(child(isDirectory, true)), catchIf(isNotLink, () => succeed4(resolved)));
2901
+ return fs.readLink(path).pipe(as(child(isDirectory, true)), catchIf(isNotLink, () => succeed5(resolved)));
3015
2902
  }));
3016
2903
  };
3017
2904
  let slots = DIRECTORY_CONCURRENCY;
3018
2905
  let finishing = false;
3019
2906
  const failed = makeUnsafe2();
3020
- const fork = (walk) => walk.pipe(onError((cause) => sync(() => {
2907
+ const fork = (walk) => walk.pipe(onError((cause) => sync2(() => {
3021
2908
  if (!finishing) {
3022
2909
  doneUnsafe(failed, failCause(cause));
3023
2910
  }
3024
- })), ensuring(sync(() => {
2911
+ })), ensuring(sync2(() => {
3025
2912
  slots++;
3026
2913
  })), forkChild);
3027
2914
  const directory = fnUntraced(function* (relative, states, excluded, named) {
@@ -3053,7 +2940,7 @@ var walk = /* @__PURE__ */ fnUntraced(function* (fs, compiled, options) {
3053
2940
  slots--;
3054
2941
  subtrees.push(join2(yield* fork(walk)));
3055
2942
  } else {
3056
- subtrees.push(succeed4(yield* walk));
2943
+ subtrees.push(succeed5(yield* walk));
3057
2944
  }
3058
2945
  }
3059
2946
  }
@@ -3074,13 +2961,13 @@ var walk = /* @__PURE__ */ fnUntraced(function* (fs, compiled, options) {
3074
2961
  }
3075
2962
  return out;
3076
2963
  });
3077
- return yield* raceFirst(ensuring(directory("", compiled.initial, excludes.initial, true), sync(() => {
2964
+ return yield* raceFirst(ensuring(directory("", compiled.initial, excludes.initial, true), sync2(() => {
3078
2965
  finishing = true;
3079
2966
  })), _await(failed));
3080
2967
  });
3081
2968
 
3082
2969
  // ../../../../node_modules/.bun/effect@4.1.2/node_modules/effect/dist/PlatformError.js
3083
- var TypeId6 = "~effect/PlatformError";
2970
+ var TypeId5 = "~effect/PlatformError";
3084
2971
 
3085
2972
  class BadArgument extends (/* @__PURE__ */ TaggedError("BadArgument")) {
3086
2973
  get message() {
@@ -3107,7 +2994,7 @@ class PlatformError extends (/* @__PURE__ */ TaggedError("PlatformError")) {
3107
2994
  });
3108
2995
  }
3109
2996
  }
3110
- [TypeId6] = TypeId6;
2997
+ [TypeId5] = TypeId5;
3111
2998
  get message() {
3112
2999
  return this.reason.message;
3113
3000
  }
@@ -3116,8 +3003,8 @@ var systemError = (options) => new PlatformError(new SystemError(options));
3116
3003
  var badArgument = (options) => new PlatformError(new BadArgument(options));
3117
3004
 
3118
3005
  // ../../../../node_modules/.bun/effect@4.1.2/node_modules/effect/dist/Sink.js
3119
- var TypeId7 = "~effect/Sink";
3120
- var endVoid = /* @__PURE__ */ succeed4([undefined]);
3006
+ var TypeId6 = "~effect/Sink";
3007
+ var endVoid = /* @__PURE__ */ succeed5([undefined]);
3121
3008
  var sinkVariance = {
3122
3009
  _A: identity,
3123
3010
  _In: identity,
@@ -3126,21 +3013,21 @@ var sinkVariance = {
3126
3013
  _R: identity
3127
3014
  };
3128
3015
  var SinkProto = {
3129
- [TypeId7]: sinkVariance,
3016
+ [TypeId6]: sinkVariance,
3130
3017
  pipe() {
3131
3018
  return pipeArguments(this, arguments);
3132
3019
  }
3133
3020
  };
3134
- var isSink = (u) => hasProperty(u, TypeId7);
3021
+ var isSink = (u) => hasProperty(u, TypeId6);
3135
3022
  var fromChannel2 = (channel) => fromTransform2((upstream, scope) => toTransform(channel)(upstream, scope).pipe(flatMap3(forever({
3136
3023
  disableYield: true
3137
- })), catchDone(succeed4)));
3024
+ })), catchDone(succeed5)));
3138
3025
  var fromTransform2 = (transform) => {
3139
3026
  const self = Object.create(SinkProto);
3140
3027
  self.transform = transform;
3141
3028
  return self;
3142
3029
  };
3143
- var toChannel = (self) => fromTransform((upstream, scope) => succeed4(flatMap3(self.transform(upstream, scope), done)));
3030
+ var toChannel = (self) => fromTransform((upstream, scope) => succeed5(flatMap3(self.transform(upstream, scope), done)));
3144
3031
  var drain = /* @__PURE__ */ fromTransform2((upstream) => catchDone(forever(upstream, {
3145
3032
  disableYield: true
3146
3033
  }), () => endVoid));
@@ -3153,7 +3040,7 @@ var forEachArray = (f) => fromTransform2((upstream) => upstream.pipe(flatMap3(f)
3153
3040
  var unwrap3 = (effect) => fromChannel2(unwrap(map4(effect, toChannel)));
3154
3041
 
3155
3042
  // ../../../../node_modules/.bun/effect@4.1.2/node_modules/effect/dist/internal/rcRef.js
3156
- var TypeId8 = "~effect/RcRef";
3043
+ var TypeId7 = "~effect/RcRef";
3157
3044
  var stateEmpty = {
3158
3045
  _tag: "Empty"
3159
3046
  };
@@ -3166,7 +3053,7 @@ var variance = {
3166
3053
  };
3167
3054
 
3168
3055
  class RcRefImpl {
3169
- [TypeId8] = variance;
3056
+ [TypeId7] = variance;
3170
3057
  pipe() {
3171
3058
  return pipeArguments(this, arguments);
3172
3059
  }
@@ -3182,7 +3069,7 @@ class RcRefImpl {
3182
3069
  this.idleTimeToLive = idleTimeToLive;
3183
3070
  }
3184
3071
  }
3185
- var make10 = (options) => withFiber((fiber) => {
3072
+ var make10 = (options) => withFiber2((fiber) => {
3186
3073
  const context = fiber.context;
3187
3074
  const scope = get(context, Scope);
3188
3075
  const ref = new RcRefImpl(options.acquire, context, scope, options.idleTimeToLive !== undefined ? fromInputUnsafe(options.idleTimeToLive) : undefined);
@@ -3190,10 +3077,10 @@ var make10 = (options) => withFiber((fiber) => {
3190
3077
  const state = ref.state;
3191
3078
  ref.state = stateClosed;
3192
3079
  if (state._tag === "Acquired")
3193
- return close(state.scope, void_);
3080
+ return close(state.scope, void_2);
3194
3081
  if (state._tag === "Acquiring")
3195
3082
  return interrupt2(state.fiber);
3196
- return void_2;
3083
+ return void_3;
3197
3084
  }), ref);
3198
3085
  });
3199
3086
  var getState = (self, restore) => {
@@ -3204,7 +3091,7 @@ var getState = (self, restore) => {
3204
3091
  case "Acquired": {
3205
3092
  const state = self.state;
3206
3093
  state.refCount++;
3207
- return state.fiber ? as(interrupt2(state.fiber), state) : succeed4(state);
3094
+ return state.fiber ? as(interrupt2(state.fiber), state) : succeed5(state);
3208
3095
  }
3209
3096
  case "Acquiring": {
3210
3097
  const state = self.state;
@@ -3234,10 +3121,10 @@ var getState = (self, restore) => {
3234
3121
  };
3235
3122
  self.state = state;
3236
3123
  acquiring.acquired = state;
3237
- return succeed4(state);
3124
+ return succeed5(state);
3238
3125
  }), onExit((exit) => {
3239
3126
  if (isSuccess2(exit))
3240
- return void_2;
3127
+ return void_3;
3241
3128
  if (self.state === acquiring)
3242
3129
  self.state = stateEmpty;
3243
3130
  return close(scope, exit);
@@ -3250,58 +3137,58 @@ var getState = (self, restore) => {
3250
3137
  var awaitAcquiring = (self, acquiring, restore) => onExit(restore(join2(acquiring.fiber)), (exit) => {
3251
3138
  const acquired = acquiring.acquired;
3252
3139
  if (acquired !== undefined) {
3253
- return isFailure(exit) ? release(self, acquired) : void_2;
3140
+ return isFailure(exit) ? release(self, acquired) : void_3;
3254
3141
  }
3255
3142
  if (--acquiring.awaiters > 0 || self.state !== acquiring)
3256
- return void_2;
3143
+ return void_3;
3257
3144
  self.state = stateEmpty;
3258
3145
  return interrupt2(acquiring.fiber);
3259
3146
  });
3260
- var get3 = (self_) => {
3147
+ var get2 = (self_) => {
3261
3148
  const self = self_;
3262
3149
  return uninterruptibleMask((restore) => flatMap3(scope, (scope) => flatMap3(getState(self, restore), (state) => as(addFinalizerExit(scope, () => release(self, state)), state.value))));
3263
3150
  };
3264
3151
  var release = (self, state) => {
3265
3152
  state.refCount--;
3266
3153
  if (state.refCount > 0) {
3267
- return void_2;
3154
+ return void_3;
3268
3155
  }
3269
3156
  const idleTimeToLive = self.idleTimeToLive;
3270
3157
  if (idleTimeToLive === undefined || state.invalidated) {
3271
3158
  if (self.state === state) {
3272
3159
  self.state = stateEmpty;
3273
3160
  }
3274
- return close(state.scope, void_);
3161
+ return close(state.scope, void_2);
3275
3162
  } else if (!isFinite(idleTimeToLive)) {
3276
- return void_2;
3163
+ return void_3;
3277
3164
  }
3278
3165
  state.fiber = uninterruptibleMask((restore) => flatMap3(restore(sleep(idleTimeToLive)), () => {
3279
3166
  if (self.state === state && state.refCount === 0) {
3280
3167
  self.state = stateEmpty;
3281
- return ignoreCause(close(state.scope, void_), {
3168
+ return ignoreCause(close(state.scope, void_2), {
3282
3169
  log: "Unhandled",
3283
3170
  message: "Unhandled error in RcRef finalizer"
3284
3171
  });
3285
3172
  }
3286
- return void_2;
3287
- })).pipe(ensuring(sync(() => {
3173
+ return void_3;
3174
+ })).pipe(ensuring(sync2(() => {
3288
3175
  state.fiber = undefined;
3289
3176
  })), runForkWith(self.context), runIn(self.scope));
3290
- return void_2;
3177
+ return void_3;
3291
3178
  };
3292
3179
 
3293
3180
  // ../../../../node_modules/.bun/effect@4.1.2/node_modules/effect/dist/RcRef.js
3294
3181
  var make11 = make10;
3295
- var get4 = get3;
3182
+ var get3 = get2;
3296
3183
 
3297
3184
  // ../../../../node_modules/.bun/effect@4.1.2/node_modules/effect/dist/FileSystem.js
3298
- var TypeId9 = "~effect/FileSystem";
3185
+ var TypeId8 = "~effect/FileSystem";
3299
3186
  var FileSystem = /* @__PURE__ */ Service("effect/FileSystem");
3300
3187
  var make12 = (impl) => FileSystem.of({
3301
3188
  ...impl,
3302
- [TypeId9]: TypeId9,
3189
+ [TypeId8]: TypeId8,
3303
3190
  glob: make9(impl),
3304
- exists: (path) => pipe(impl.access(path), as(true), catchTag("PlatformError", (e) => e.reason._tag === "NotFound" ? succeed4(false) : fail5(e))),
3191
+ exists: (path) => pipe(impl.access(path), as(true), catchTag("PlatformError", (e) => e.reason._tag === "NotFound" ? succeed5(false) : fail5(e))),
3305
3192
  readFileString: (path, encoding) => flatMap3(impl.readFile(path), (_) => try_2({
3306
3193
  try: () => new TextDecoder(encoding).decode(_),
3307
3194
  catch: (cause) => badArgument({
@@ -3323,7 +3210,7 @@ var make12 = (impl) => FileSystem.of({
3323
3210
  let totalBytesRead = BigInt(0);
3324
3211
  const chunkSize = Number(BigInt(options?.chunkSize ?? 64 * 1024));
3325
3212
  const readChunk = file.readAlloc(chunkSize);
3326
- return fromPull(succeed4(flatMap3(suspend(() => {
3213
+ return fromPull(succeed5(flatMap3(suspend(() => {
3327
3214
  if (bytesToRead !== undefined && bytesToRead <= totalBytesRead) {
3328
3215
  return done();
3329
3216
  }
@@ -3332,7 +3219,7 @@ var make12 = (impl) => FileSystem.of({
3332
3219
  onNone: () => done(),
3333
3220
  onSome: (buf) => {
3334
3221
  totalBytesRead += BigInt(buf.length);
3335
- return succeed4(of(buf));
3222
+ return succeed5(of(buf));
3336
3223
  }
3337
3224
  }))));
3338
3225
  }, unwrap2),
@@ -3355,11 +3242,11 @@ class WatchBackend extends (/* @__PURE__ */ Service()("effect/FileSystem/WatchBa
3355
3242
  }
3356
3243
 
3357
3244
  // ../../../../node_modules/.bun/effect@4.1.2/node_modules/effect/dist/Path.js
3358
- var TypeId10 = "~effect/Path";
3245
+ var TypeId9 = "~effect/Path";
3359
3246
  var Path = /* @__PURE__ */ Service("effect/Path");
3360
3247
  var make13 = (impl) => Path.of({
3361
3248
  ...impl,
3362
- [TypeId10]: TypeId10,
3249
+ [TypeId9]: TypeId9,
3363
3250
  resolveWithin(root, input) {
3364
3251
  if (impl.parse(input).root !== "")
3365
3252
  return none();
@@ -3370,179 +3257,122 @@ var make13 = (impl) => Path.of({
3370
3257
  }
3371
3258
  });
3372
3259
 
3373
- // ../../../../node_modules/.bun/effect@4.1.2/node_modules/effect/dist/FiberMap.js
3374
- var TypeId11 = "~effect/FiberMap";
3375
- var isFiberMap = (u) => hasProperty(u, TypeId11);
3376
- var Proto = {
3377
- [TypeId11]: TypeId11,
3378
- [Symbol.iterator]() {
3379
- if (this.state._tag === "Closed") {
3380
- return empty();
3381
- }
3382
- return this.state.backing[Symbol.iterator]();
3383
- },
3384
- ...PipeInspectableProto,
3385
- toJSON() {
3386
- return {
3387
- _id: "FiberMap",
3388
- state: this.state
3389
- };
3390
- }
3391
- };
3392
- var makeUnsafe5 = (backing, deferred) => {
3393
- const self = Object.create(Proto);
3394
- self.state = {
3395
- _tag: "Open",
3396
- backing,
3397
- fibers: new Set
3398
- };
3399
- self.deferred = deferred;
3400
- return self;
3401
- };
3402
- var make14 = () => acquireRelease(sync(() => makeUnsafe5(empty2(), makeUnsafe2())), (map) => suspend(() => {
3403
- const state = map.state;
3404
- if (state._tag === "Closed")
3405
- return void_2;
3406
- map.state = {
3407
- _tag: "Closed"
3408
- };
3409
- return interruptAll(state.fibers).pipe(into(map.deferred));
3410
- }));
3411
- var internalFiberId = -1;
3412
- var isInternalInterruption = /* @__PURE__ */ toPredicate(/* @__PURE__ */ compose(filterInterruptors, /* @__PURE__ */ has2(internalFiberId)));
3413
- var setUnsafe = /* @__PURE__ */ dual((args) => isFiberMap(args[0]), (self, key, fiber, options) => {
3414
- if (self.state._tag === "Closed") {
3415
- fiber.interruptUnsafe(internalFiberId);
3416
- return;
3417
- }
3418
- const previous = get2(self.state.backing, key);
3419
- if (previous._tag === "Some") {
3420
- if (previous.value === fiber) {
3421
- return;
3422
- } else if (options?.onlyIfMissing === true) {
3423
- fiber.interruptUnsafe(internalFiberId);
3424
- return;
3425
- }
3426
- }
3427
- set(self.state.backing, key, fiber);
3428
- self.state.fibers.add(fiber);
3429
- if (previous._tag === "Some") {
3430
- previous.value.interruptUnsafe(internalFiberId);
3431
- }
3432
- fiber.addObserver((exit) => {
3433
- if (self.state._tag === "Closed") {
3434
- return;
3435
- }
3436
- self.state.fibers.delete(fiber);
3437
- const current = get2(self.state.backing, key);
3438
- if (isSome(current) && fiber === current.value) {
3439
- remove(self.state.backing, key);
3440
- }
3441
- if (isFailure(exit) && (options?.propagateInterruption === true ? !isInternalInterruption(exit.cause) : !hasInterruptsOnly(exit.cause))) {
3442
- doneUnsafe(self.deferred, exit);
3443
- }
3444
- });
3445
- });
3446
- var getUnsafe2 = /* @__PURE__ */ dual(2, (self, key) => {
3447
- return self.state._tag === "Closed" ? none() : get2(self.state.backing, key);
3260
+ // ../../../../node_modules/.bun/effect@4.1.2/node_modules/effect/dist/ManagedRuntime.js
3261
+ var TypeId10 = "~effect/ManagedRuntime";
3262
+ var DisposingRuntimes = /* @__PURE__ */ Reference("effect/ManagedRuntime/DisposingRuntimes", {
3263
+ defaultValue: () => new Set
3448
3264
  });
3449
- var get5 = /* @__PURE__ */ dual(2, (self, key) => suspend(() => succeed4(getUnsafe2(self, key))));
3450
- var hasUnsafe = /* @__PURE__ */ dual(2, (self, key) => self.state._tag === "Closed" ? false : has(self.state.backing, key));
3451
- var has3 = /* @__PURE__ */ dual(2, (self, key) => sync(() => hasUnsafe(self, key)));
3452
- var constInterruptedFiber = /* @__PURE__ */ function() {
3453
- let fiber = undefined;
3454
- return () => {
3455
- if (fiber === undefined) {
3456
- fiber = runFork(interrupt);
3457
- }
3458
- return fiber;
3265
+ var make14 = (layer, options) => {
3266
+ const memoMap = options?.memoMap ?? makeMemoMapUnsafe();
3267
+ const scope = makeUnsafe3("sequential");
3268
+ const layerScope = forkUnsafe2(scope, "sequential");
3269
+ const fiberScope = forkUnsafe2(scope, "parallel");
3270
+ const managedFibers = new WeakSet;
3271
+ const disposingFibers = new WeakSet;
3272
+ const defaultRunOptions = {
3273
+ onFiberStart(fiber) {
3274
+ managedFibers.add(fiber);
3275
+ if (disposingFibers.has(fiber))
3276
+ return;
3277
+ runIn(fiber, fiberScope);
3278
+ }
3459
3279
  };
3460
- }();
3461
- var run3 = function() {
3462
- const self = arguments[0];
3463
- if (isEffect(arguments[2])) {
3464
- return runImpl(self, arguments[1], arguments[2], arguments[3]);
3465
- }
3466
- const key = arguments[1];
3467
- const options = arguments[2];
3468
- return (effect) => runImpl(self, key, effect, options);
3469
- };
3470
- var runImpl = (self, key, effect, options) => withFiber((parent) => {
3471
- if (self.state._tag === "Closed") {
3472
- return interrupt;
3473
- } else if (options?.onlyIfMissing === true && hasUnsafe(self, key)) {
3474
- return sync(constInterruptedFiber);
3475
- }
3476
- const fiber = forkUnsafe(parent, effect, options?.startImmediately ?? true, true);
3477
- setUnsafe(self, key, fiber, options);
3478
- return succeed4(fiber);
3479
- });
3480
- var size2 = (self) => sync(() => self.state._tag === "Closed" ? 0 : size(self.state.backing));
3481
-
3482
- // ../../../../node_modules/.bun/effect@4.1.2/node_modules/effect/dist/Runtime.js
3483
- var defaultTeardown = (exit, onExit) => {
3484
- if (isSuccess2(exit))
3485
- return onExit(0);
3486
- if (hasInterruptsOnly(exit.cause))
3487
- return onExit(130);
3488
- return onExit(getErrorExitCode(squash(exit.cause)));
3489
- };
3490
- var makeRunMain = (f) => dual((args) => isEffect(args[0]), (effect, options) => {
3491
- const main = options?.disableErrorReporting === true ? effect : tapCause(effect, (cause) => {
3492
- if (hasInterruptsOnly(cause))
3493
- return void_2;
3494
- const isReported = getErrorReported(squash(cause));
3495
- return isReported ? logError(cause) : void_2;
3496
- });
3497
- const teardown = options?.teardown ?? defaultTeardown;
3498
- runFork(withFiber((fiber) => {
3499
- try {
3500
- const keepAlive = globalThis.setInterval(constVoid, 2147483647);
3501
- fiber.addObserver(() => {
3502
- clearInterval(keepAlive);
3280
+ const mergeRunOptions = (options) => options ? {
3281
+ ...options,
3282
+ onFiberStart: options.onFiberStart ? (fiber) => {
3283
+ defaultRunOptions.onFiberStart(fiber);
3284
+ options.onFiberStart(fiber);
3285
+ } : defaultRunOptions.onFiberStart
3286
+ } : defaultRunOptions;
3287
+ let buildFiber;
3288
+ let disposed;
3289
+ const contextEffect = withFiber2((fiber) => {
3290
+ if (!buildFiber) {
3291
+ buildFiber = runFork(tap(buildWithMemoMap(layer, memoMap, layerScope), (context) => sync2(() => {
3292
+ self.cachedContext = context;
3293
+ })), {
3294
+ scheduler: fiber.cache.scheduler,
3295
+ onFiberStart(fiber) {
3296
+ managedFibers.add(fiber);
3297
+ runIn(fiber, fiberScope);
3298
+ }
3503
3299
  });
3504
- } catch {}
3505
- f({
3506
- fiber,
3507
- teardown
3508
- });
3509
- return main;
3510
- }));
3511
- });
3512
- var errorExitCode = "~effect/Runtime/errorExitCode";
3513
- var getErrorExitCode = (u) => {
3514
- if (typeof u === "object" && u !== null && errorExitCode in u) {
3515
- const code = u[errorExitCode];
3516
- if (typeof code === "number") {
3517
- return code;
3518
3300
  }
3519
- }
3520
- return 1;
3521
- };
3522
- var errorReported = "~effect/Runtime/errorReported";
3523
- var getErrorReported = (u) => {
3524
- if (typeof u === "object" && u !== null && errorReported in u) {
3525
- const isReported = u[errorReported];
3526
- if (typeof isReported === "boolean") {
3527
- return isReported;
3301
+ return flatten2(await_(buildFiber));
3302
+ });
3303
+ const self = {
3304
+ [TypeId10]: TypeId10,
3305
+ memoMap,
3306
+ scope,
3307
+ contextEffect,
3308
+ cachedContext: undefined,
3309
+ context() {
3310
+ return self.cachedContext === undefined ? runPromise(self.contextEffect) : Promise.resolve(self.cachedContext);
3311
+ },
3312
+ dispose() {
3313
+ return runPromise(self.disposeEffect);
3314
+ },
3315
+ [Symbol.asyncDispose]() {
3316
+ return self.dispose();
3317
+ },
3318
+ disposeEffect: withFiber2((fiber) => {
3319
+ if (disposed !== undefined) {
3320
+ if (fiber.getRef(DisposingRuntimes).has(self))
3321
+ return void_3;
3322
+ for (let current = fiber;current; current = current._parent) {
3323
+ if (managedFibers.has(current))
3324
+ return void_3;
3325
+ }
3326
+ return _await(disposed);
3327
+ }
3328
+ fiberEnterUninterruptibleUnsafe(fiber);
3329
+ const done = disposed = makeUnsafe2();
3330
+ for (let current = fiber;current; current = current._parent) {
3331
+ disposingFibers.add(current);
3332
+ scopeRemoveFinalizerUnsafe(fiberScope, current);
3333
+ }
3334
+ self.contextEffect = die("ManagedRuntime disposed");
3335
+ self.cachedContext = undefined;
3336
+ return close(self.scope, void_2).pipe(provideService(DisposingRuntimes, new Set(fiber.getRef(DisposingRuntimes)).add(self)), ensuring(done2(done, void_2)));
3337
+ }),
3338
+ runFork(effect, options) {
3339
+ return self.cachedContext === undefined ? runFork(provide2(self, effect), mergeRunOptions(options)) : runForkWith(self.cachedContext)(effect, mergeRunOptions(options));
3340
+ },
3341
+ runCallback(effect, options) {
3342
+ return self.cachedContext === undefined ? runCallback(provide2(self, effect), mergeRunOptions(options)) : runCallbackWith(self.cachedContext)(effect, mergeRunOptions(options));
3343
+ },
3344
+ runSyncExit(effect) {
3345
+ return self.cachedContext === undefined ? runSyncExit(provide2(self, effect)) : runSyncExitWith(self.cachedContext)(effect);
3346
+ },
3347
+ runSync(effect) {
3348
+ return self.cachedContext === undefined ? runSync(provide2(self, effect)) : runSyncWith(self.cachedContext)(effect);
3349
+ },
3350
+ runPromiseExit(effect, options) {
3351
+ return self.cachedContext === undefined ? runPromiseExit(provide2(self, effect), mergeRunOptions(options)) : runPromiseExitWith(self.cachedContext)(effect, mergeRunOptions(options));
3352
+ },
3353
+ runPromise(effect, options) {
3354
+ return self.cachedContext === undefined ? runPromise(provide2(self, effect), mergeRunOptions(options)) : runPromiseWith(self.cachedContext)(effect, mergeRunOptions(options));
3528
3355
  }
3529
- }
3530
- return true;
3356
+ };
3357
+ return self;
3531
3358
  };
3359
+ function provide2(managed, effect) {
3360
+ return flatMap3(managed.contextEffect, (context) => provideContext(effect, context));
3361
+ }
3532
3362
 
3533
3363
  // ../../../../node_modules/.bun/effect@4.1.2/node_modules/effect/dist/Stdio.js
3534
- var TypeId12 = "~effect/Stdio";
3535
- var Stdio = /* @__PURE__ */ Service(TypeId12);
3364
+ var TypeId11 = "~effect/Stdio";
3365
+ var Stdio = /* @__PURE__ */ Service(TypeId11);
3536
3366
  var make15 = (options) => ({
3537
- [TypeId12]: TypeId12,
3538
- stdinIsTerminal: succeed4(false),
3539
- stdoutIsTerminal: succeed4(false),
3540
- stderrIsTerminal: succeed4(false),
3367
+ [TypeId11]: TypeId11,
3368
+ stdinIsTerminal: succeed5(false),
3369
+ stdoutIsTerminal: succeed5(false),
3370
+ stderrIsTerminal: succeed5(false),
3541
3371
  ...options
3542
3372
  });
3543
3373
 
3544
3374
  // ../../../../node_modules/.bun/effect@4.1.2/node_modules/effect/dist/Terminal.js
3545
- var TypeId13 = "~effect/Terminal";
3375
+ var TypeId12 = "~effect/Terminal";
3546
3376
  var QuitErrorTypeId = "~effect/Terminal/QuitError";
3547
3377
 
3548
3378
  class QuitError extends (/* @__PURE__ */ Error3("QuitError")({
@@ -3553,7 +3383,7 @@ class QuitError extends (/* @__PURE__ */ Error3("QuitError")({
3553
3383
  var Terminal = /* @__PURE__ */ Service("effect/Terminal");
3554
3384
  var make16 = (impl) => Terminal.of({
3555
3385
  ...impl,
3556
- [TypeId13]: TypeId13
3386
+ [TypeId12]: TypeId12
3557
3387
  });
3558
3388
  // ../../../../node_modules/.bun/effect@4.1.2/node_modules/effect/dist/crypto/Kdf.js
3559
3389
  class Kdf extends (/* @__PURE__ */ Service()("effect/crypto/Kdf")) {
@@ -3589,7 +3419,7 @@ var webCryptoParams = (algorithm, options) => algorithm._tag === "Hkdf" ? {
3589
3419
  salt: options.salt,
3590
3420
  iterations: algorithm.iterations
3591
3421
  };
3592
- var layerWebCrypto8 = /* @__PURE__ */ effect(Kdf, /* @__PURE__ */ WebCrypto.use((crypto) => succeed4(Kdf.of({
3422
+ var layerWebCrypto8 = /* @__PURE__ */ effect(Kdf, /* @__PURE__ */ WebCrypto.use((crypto) => succeed5(Kdf.of({
3593
3423
  derive: (algorithm, secret, options) => suspend(() => {
3594
3424
  const failure = checkArguments2(algorithm, options);
3595
3425
  if (failure !== undefined)
@@ -3618,9 +3448,9 @@ var nodeHashNames = {
3618
3448
  "SHA-512": "sha512"
3619
3449
  };
3620
3450
  var nodeDigest = (algorithm, data) => new Uint8Array(NodeCrypto.createHash(nodeHashNames[algorithm.name]).update(data).digest());
3621
- var layerDigest = /* @__PURE__ */ succeed3(Digest, {
3622
- digest: (algorithm, data) => sync(() => nodeDigest(algorithm, data)),
3623
- digestHex: (algorithm, data) => sync(() => NodeCrypto.createHash(nodeHashNames[algorithm.name]).update(data).digest("hex"))
3451
+ var layerDigest = /* @__PURE__ */ succeed4(Digest, {
3452
+ digest: (algorithm, data) => sync2(() => nodeDigest(algorithm, data)),
3453
+ digestHex: (algorithm, data) => sync2(() => NodeCrypto.createHash(nodeHashNames[algorithm.name]).update(data).digest("hex"))
3624
3454
  });
3625
3455
  var nodeHmac = (hash, key, data) => new Uint8Array(NodeCrypto.createHmac(nodeHashNames[hash], key).update(data).digest());
3626
3456
  var layerMac = /* @__PURE__ */ layerWebCryptoWith2({
@@ -3673,7 +3503,7 @@ var argon2id = (algorithm, secret, options) => callback((resume) => {
3673
3503
  if (cause)
3674
3504
  resume(argon2Failure(cause));
3675
3505
  else
3676
- resume(succeed4(new Uint8Array(key.buffer, key.byteOffset, key.length)));
3506
+ resume(succeed5(new Uint8Array(key.buffer, key.byteOffset, key.length)));
3677
3507
  });
3678
3508
  } catch (cause) {
3679
3509
  resume(argon2Failure(cause));
@@ -3728,31 +3558,6 @@ var layerSignature = /* @__PURE__ */ layerWebCrypto7.pipe(/* @__PURE__ */ provid
3728
3558
  var layerKeyAgreement = /* @__PURE__ */ layerWebCrypto4.pipe(/* @__PURE__ */ provide(layerSecureRandom));
3729
3559
  var layerKeyWrap = /* @__PURE__ */ layerWebCrypto6.pipe(/* @__PURE__ */ provide(layerSecureRandom));
3730
3560
  var layer4 = /* @__PURE__ */ mergeAll(layerSecureRandom, layerDigest, layerMac, layerKdf, layerAead, layerCipher, layerSignature, layerKeyAgreement, layerKeyWrap);
3731
- // ../../../../node_modules/.bun/@effect+platform-node-shared@4.1.2+edf248c88a527e3e/node_modules/@effect/platform-node-shared/dist/NodeRuntime.js
3732
- var runMain = /* @__PURE__ */ makeRunMain(({
3733
- fiber,
3734
- teardown
3735
- }) => {
3736
- let receivedSignal = false;
3737
- fiber.addObserver((exit) => {
3738
- process.removeListener("SIGINT", onSigint);
3739
- process.removeListener("SIGTERM", onSigint);
3740
- teardown(exit, (code) => {
3741
- if (receivedSignal || code !== 0) {
3742
- process.exit(code);
3743
- }
3744
- });
3745
- });
3746
- function onSigint() {
3747
- receivedSignal = true;
3748
- fiber.interruptUnsafe(fiber.id);
3749
- }
3750
- process.on("SIGINT", onSigint);
3751
- process.on("SIGTERM", onSigint);
3752
- });
3753
-
3754
- // ../../../../node_modules/.bun/@effect+platform-node@4.1.2+22a1c27d4b1c9267/node_modules/@effect/platform-node/dist/NodeRuntime.js
3755
- var runMain2 = runMain;
3756
3561
  // ../../../../node_modules/.bun/effect@4.1.2/node_modules/effect/dist/process/ChildProcessSpawner.js
3757
3562
  var ExitCode = /* @__PURE__ */ nominal();
3758
3563
  var ProcessId = /* @__PURE__ */ nominal();
@@ -3981,17 +3786,17 @@ var parseTemplate = (texts, values) => {
3981
3786
  };
3982
3787
 
3983
3788
  // ../../../../node_modules/.bun/effect@4.1.2/node_modules/effect/dist/process/ChildProcess.js
3984
- var TypeId14 = "~effect/process/ChildProcess";
3985
- var Proto2 = {
3789
+ var TypeId13 = "~effect/process/ChildProcess";
3790
+ var Proto = {
3986
3791
  .../* @__PURE__ */ Prototype({
3987
3792
  label: "Command",
3988
3793
  evaluate(fiber) {
3989
3794
  return getUnsafe(fiber.context, ChildProcessSpawner).spawn(this);
3990
3795
  }
3991
3796
  }),
3992
- [TypeId14]: TypeId14
3797
+ [TypeId13]: TypeId13
3993
3798
  };
3994
- var makeStandardCommand = (command, args, options) => Object.assign(Object.create(Proto2), {
3799
+ var makeStandardCommand = (command, args, options) => Object.assign(Object.create(Proto), {
3995
3800
  _tag: "StandardCommand",
3996
3801
  command,
3997
3802
  args,
@@ -4153,10 +3958,10 @@ var fromWritableChannel = (options) => fromTransform((pull) => {
4153
3958
  writable,
4154
3959
  pull
4155
3960
  });
4156
- return succeed4(options.endOnDone === false ? write : onError(write, (cause) => isDoneCause(cause) ? void_2 : releaseWritable(writable)));
3961
+ return succeed5(options.endOnDone === false ? write : onError(write, (cause) => isDoneCause(cause) ? void_3 : releaseWritable(writable)));
4157
3962
  });
4158
3963
  var releaseWritable = (writable) => callback((resume) => {
4159
- const onDestroyed = () => resume(void_2);
3964
+ const onDestroyed = () => resume(void_3);
4160
3965
  if (writable.closed) {
4161
3966
  const cleanup = finished(writable, {
4162
3967
  readable: false
@@ -4168,7 +3973,7 @@ var releaseWritable = (writable) => callback((resume) => {
4168
3973
  destroyStream(writable, constVoid, onDestroyed);
4169
3974
  }
4170
3975
  });
4171
- var pullIntoWritable = (options) => withFiber((fiber) => {
3976
+ var pullIntoWritable = (options) => withFiber2((fiber) => {
4172
3977
  const dispatcher = fiber.currentDispatcher;
4173
3978
  const completion = makeUnsafe2();
4174
3979
  const failure = makeUnsafe2();
@@ -4185,7 +3990,7 @@ var pullIntoWritable = (options) => withFiber((fiber) => {
4185
3990
  if (error) {
4186
3991
  onError(error);
4187
3992
  } else {
4188
- doneUnsafe(completion, void_2);
3993
+ doneUnsafe(completion, void_3);
4189
3994
  }
4190
3995
  });
4191
3996
  return options.pull.pipe(flatMap3((chunk) => {
@@ -4218,11 +4023,11 @@ var pullIntoWritable = (options) => withFiber((fiber) => {
4218
4023
  }
4219
4024
  }
4220
4025
  if (!cancelled) {
4221
- resume(void_2);
4026
+ resume(void_3);
4222
4027
  }
4223
4028
  };
4224
4029
  loop();
4225
- return sync(() => {
4030
+ return sync2(() => {
4226
4031
  cancelled = true;
4227
4032
  options.writable.off("drain", loop);
4228
4033
  options.writable.off("finish", onFinish);
@@ -4233,7 +4038,7 @@ var pullIntoWritable = (options) => withFiber((fiber) => {
4233
4038
  }), options.endOnDone !== false ? catchDone((_) => {
4234
4039
  options.writable.end();
4235
4040
  return andThen(_await(completion), done(_));
4236
- }) : identity, raceFirst(_await(failure)), ensuring(sync(() => {
4041
+ }) : identity, raceFirst(_await(failure)), ensuring(sync2(() => {
4237
4042
  cleanup();
4238
4043
  const removeErrorListener = () => {
4239
4044
  options.writable.off("error", onStreamError);
@@ -4296,9 +4101,9 @@ var readableToPullUnsafe = (options) => {
4296
4101
  break;
4297
4102
  chunk.push(item);
4298
4103
  }
4299
- return succeed4(chunk);
4104
+ return succeed5(chunk);
4300
4105
  });
4301
- return as(addFinalizer(options.scope, sync(() => {
4106
+ return as(addFinalizer(options.scope, sync2(() => {
4302
4107
  readable.off("readable", onReadable);
4303
4108
  if (closeOnDone) {
4304
4109
  destroyStream(readable, cleanup);
@@ -4480,7 +4285,7 @@ var make19 = /* @__PURE__ */ gen(function* () {
4480
4285
  if (additionalFds.length === 0) {
4481
4286
  return {
4482
4287
  getInputFd: () => drain,
4483
- getOutputFd: () => empty5
4288
+ getOutputFd: () => empty4
4484
4289
  };
4485
4290
  }
4486
4291
  const inputSinks = new Map;
@@ -4500,10 +4305,10 @@ var make19 = /* @__PURE__ */ gen(function* () {
4500
4305
  });
4501
4306
  }
4502
4307
  inputSinks.set(fd, sink);
4503
- return void_2;
4308
+ return void_3;
4504
4309
  });
4505
4310
  const setupOutput = (fd, nodeStream, sink) => {
4506
- let stream = empty5;
4311
+ let stream = empty4;
4507
4312
  if (nodeStream && "read" in nodeStream) {
4508
4313
  const passThrough = new PassThrough;
4509
4314
  let error = undefined;
@@ -4549,7 +4354,7 @@ var make19 = /* @__PURE__ */ gen(function* () {
4549
4354
  }
4550
4355
  return {
4551
4356
  getInputFd: (fd) => inputSinks.get(fd) ?? drain,
4552
- getOutputFd: (fd) => outputStreams.get(fd) ?? empty5
4357
+ getOutputFd: (fd) => outputStreams.get(fd) ?? empty4
4553
4358
  };
4554
4359
  });
4555
4360
  const setupChildStdin = (command, childProcess, config, inputFailure) => suspend(() => {
@@ -4566,7 +4371,7 @@ var make19 = /* @__PURE__ */ gen(function* () {
4566
4371
  if (isStream(config.stream)) {
4567
4372
  return as(runInputStream(config.stream, sink, inputFailure), sink);
4568
4373
  }
4569
- return succeed4(sink);
4374
+ return succeed5(sink);
4570
4375
  });
4571
4376
  const setupChildOutputStreams = (command, childProcess, stdoutConfig, stderrConfig) => {
4572
4377
  let stdout = childProcess.stdout ? (() => {
@@ -4577,7 +4382,7 @@ var make19 = /* @__PURE__ */ gen(function* () {
4577
4382
  evaluate: () => passThrough,
4578
4383
  onError: (error) => toPlatformError("fromReadable(stdout)", toError(error), command)
4579
4384
  });
4580
- })() : empty5;
4385
+ })() : empty4;
4581
4386
  let stderr = childProcess.stderr ? (() => {
4582
4387
  const passThrough = new PassThrough;
4583
4388
  childProcess.stderr.on("error", (error) => passThrough.destroy(error));
@@ -4586,14 +4391,14 @@ var make19 = /* @__PURE__ */ gen(function* () {
4586
4391
  evaluate: () => passThrough,
4587
4392
  onError: (error) => toPlatformError("fromReadable(stderr)", toError(error), command)
4588
4393
  });
4589
- })() : empty5;
4394
+ })() : empty4;
4590
4395
  if (isSink(stdoutConfig.stream)) {
4591
4396
  stdout = transduce(stdout, stdoutConfig.stream);
4592
4397
  }
4593
4398
  if (isSink(stderrConfig.stream)) {
4594
4399
  stderr = transduce(stderr, stderrConfig.stream);
4595
4400
  }
4596
- const all = merge(stdout, stderr);
4401
+ const all = merge2(stdout, stderr);
4597
4402
  return {
4598
4403
  stdout,
4599
4404
  stderr,
@@ -4612,12 +4417,12 @@ var make19 = /* @__PURE__ */ gen(function* () {
4612
4417
  resume(fail5(toPlatformError("spawn", error, command)));
4613
4418
  });
4614
4419
  handle.on("exit", (...args) => {
4615
- doneUnsafe(deferred, succeed2(args));
4420
+ doneUnsafe(deferred, succeed3(args));
4616
4421
  });
4617
4422
  handle.on("spawn", () => {
4618
- resume(succeed4([handle, deferred]));
4423
+ resume(succeed5([handle, deferred]));
4619
4424
  });
4620
- return sync(() => {
4425
+ return sync2(() => {
4621
4426
  handle.kill("SIGTERM");
4622
4427
  });
4623
4428
  });
@@ -4628,7 +4433,7 @@ var make19 = /* @__PURE__ */ gen(function* () {
4628
4433
  if (error) {
4629
4434
  resume(fail5(toPlatformError("kill", toError(error), command)));
4630
4435
  } else {
4631
- resume(void_2);
4436
+ resume(void_3);
4632
4437
  }
4633
4438
  });
4634
4439
  });
@@ -4655,7 +4460,7 @@ var make19 = /* @__PURE__ */ gen(function* () {
4655
4460
  const error = new globalThis.Error("Failed to kill child process");
4656
4461
  return fail5(toPlatformError("kill", error, command));
4657
4462
  }
4658
- return void_2;
4463
+ return void_3;
4659
4464
  });
4660
4465
  const awaitProcessExit = (command, childProcess, timeoutMillis) => callback((resume) => {
4661
4466
  const deadline = Date.now() + timeoutMillis;
@@ -4668,17 +4473,17 @@ var make19 = /* @__PURE__ */ gen(function* () {
4668
4473
  clearTimeout(timer);
4669
4474
  if (Date.now() >= deadline || !isProcessAlive(command, childProcess)) {
4670
4475
  stop();
4671
- resume(void_2);
4476
+ resume(void_3);
4672
4477
  return;
4673
4478
  }
4674
4479
  timer = setTimeout(poll, processGroupPollIntervalMillis);
4675
4480
  };
4676
4481
  childProcess.on("exit", poll);
4677
4482
  poll();
4678
- return sync(stop);
4483
+ return sync2(stop);
4679
4484
  });
4680
4485
  const terminateProcessGroup = fnUntraced(function* (command, childProcess, exitSignal, options) {
4681
- const signalGroup = (signal) => ownsProcessGroup(command, childProcess) ? killProcessGroup(command, childProcess, signal).pipe(catch_((error) => hasExited(childProcess) && isUnsignallableProcessGroup(error.cause) ? void_2 : killProcess(command, childProcess, signal))) : killProcess(command, childProcess, signal);
4486
+ const signalGroup = (signal) => ownsProcessGroup(command, childProcess) ? killProcessGroup(command, childProcess, signal).pipe(catch_((error) => hasExited(childProcess) && isUnsignallableProcessGroup(error.cause) ? void_3 : killProcess(command, childProcess, signal))) : killProcess(command, childProcess, signal);
4682
4487
  yield* signalGroup(options?.killSignal ?? "SIGTERM");
4683
4488
  if (isUndefined(options?.forceKillAfter)) {
4684
4489
  yield* _await(exitSignal);
@@ -4764,13 +4569,13 @@ var make19 = /* @__PURE__ */ gen(function* () {
4764
4569
  }
4765
4570
  });
4766
4571
  }
4767
- const reref = sync(() => {
4572
+ const reref = sync2(() => {
4768
4573
  if (!isReferenced) {
4769
4574
  childProcess.ref();
4770
4575
  isReferenced = true;
4771
4576
  }
4772
4577
  });
4773
- const unref = sync(() => {
4578
+ const unref = sync2(() => {
4774
4579
  if (isReferenced) {
4775
4580
  childProcess.unref();
4776
4581
  isReferenced = false;
@@ -4794,7 +4599,7 @@ var make19 = /* @__PURE__ */ gen(function* () {
4794
4599
  return _await(inputFailure);
4795
4600
  }
4796
4601
  if (isNotNull(code)) {
4797
- return succeed4(ExitCode(code));
4602
+ return succeed5(ExitCode(code));
4798
4603
  }
4799
4604
  const error = new globalThis.Error(`Process interrupted due to receipt of signal: '${signal}'`);
4800
4605
  return fail5(toPlatformError("exitCode", error, cmd));
@@ -4825,7 +4630,7 @@ var make19 = /* @__PURE__ */ gen(function* () {
4825
4630
  const command = pipeline[i];
4826
4631
  const options = pipeOptions[i] ?? {};
4827
4632
  const stdinConfig = resolveStdinOption(command.options);
4828
- const sourceStream = unwrap2(succeed4(getSourceStream(handles[handles.length - 1], options.from)));
4633
+ const sourceStream = unwrap2(succeed5(getSourceStream(handles[handles.length - 1], options.from)));
4829
4634
  const toOption = options.to ?? "stdin";
4830
4635
  if (toOption === "stdin") {
4831
4636
  handles.push(yield* spawnCommand(make18(command.command, command.args, {
@@ -5011,7 +4816,7 @@ var removeFactory = (method) => {
5011
4816
  force: options?.force ?? false
5012
4817
  });
5013
4818
  };
5014
- var remove2 = /* @__PURE__ */ removeFactory("remove");
4819
+ var remove = /* @__PURE__ */ removeFactory("remove");
5015
4820
  var makeTempDirectoryScoped = /* @__PURE__ */ (() => {
5016
4821
  const makeDirectory = /* @__PURE__ */ makeTempDirectoryFactory("makeTempDirectoryScoped");
5017
4822
  const removeDirectory = /* @__PURE__ */ removeFactory("makeTempDirectoryScoped");
@@ -5064,7 +4869,7 @@ var noFollowFlags = (method, flag) => suspend(() => {
5064
4869
  description: "noFollow is not supported on this platform"
5065
4870
  }));
5066
4871
  }
5067
- return succeed4(openFlagBits(flag) | O_NOFOLLOW);
4872
+ return succeed5(openFlagBits(flag) | O_NOFOLLOW);
5068
4873
  });
5069
4874
  var openFactory = (method) => {
5070
4875
  const nodeOpen = effectify(NFS.open, handleErrnoException("FileSystem", method), handleBadArgument(method));
@@ -5117,7 +4922,7 @@ var makeFile = /* @__PURE__ */ (() => {
5117
4922
  }));
5118
4923
  }
5119
4924
  this.position = position;
5120
- return succeed4(position);
4925
+ return succeed5(position);
5121
4926
  });
5122
4927
  }
5123
4928
  read(buffer, options) {
@@ -5186,7 +4991,7 @@ var makeFile = /* @__PURE__ */ (() => {
5186
4991
  write(buffer) {
5187
4992
  return suspend(() => {
5188
4993
  const position = this.position;
5189
- return flatMap3(this.append ? succeed4(undefined) : positionToNumber(position, "write"), (nodePosition) => map4(nodeWrite(this.fd, buffer, undefined, undefined, nodePosition), (bytesWritten) => {
4994
+ return flatMap3(this.append ? succeed5(undefined) : positionToNumber(position, "write"), (nodePosition) => map4(nodeWrite(this.fd, buffer, undefined, undefined, nodePosition), (bytesWritten) => {
5190
4995
  if (!this.append) {
5191
4996
  this.position = position + BigInt(bytesWritten);
5192
4997
  }
@@ -5197,7 +5002,7 @@ var makeFile = /* @__PURE__ */ (() => {
5197
5002
  writeAllChunk(buffer) {
5198
5003
  return suspend(() => {
5199
5004
  const position = this.position;
5200
- return flatMap3(this.append ? succeed4(undefined) : positionToNumber(position, "writeAll"), (nodePosition) => flatMap3(nodeWriteAll(this.fd, buffer, undefined, undefined, nodePosition), (bytesWritten) => {
5005
+ return flatMap3(this.append ? succeed5(undefined) : positionToNumber(position, "writeAll"), (nodePosition) => flatMap3(nodeWriteAll(this.fd, buffer, undefined, undefined, nodePosition), (bytesWritten) => {
5201
5006
  if (bytesWritten === 0) {
5202
5007
  return fail5(systemError({
5203
5008
  module: "FileSystem",
@@ -5210,12 +5015,12 @@ var makeFile = /* @__PURE__ */ (() => {
5210
5015
  if (!this.append) {
5211
5016
  this.position = position + BigInt(bytesWritten);
5212
5017
  }
5213
- return bytesWritten < buffer.length ? this.writeAllChunk(buffer.subarray(bytesWritten)) : void_2;
5018
+ return bytesWritten < buffer.length ? this.writeAllChunk(buffer.subarray(bytesWritten)) : void_3;
5214
5019
  }));
5215
5020
  });
5216
5021
  }
5217
5022
  writeAll(buffer) {
5218
- return buffer.length === 0 ? void_2 : this.writeAllChunk(buffer);
5023
+ return buffer.length === 0 ? void_3 : this.writeAllChunk(buffer);
5219
5024
  }
5220
5025
  }
5221
5026
  return (fd, append) => new FileImpl(fd, append);
@@ -5260,7 +5065,7 @@ var readFile2 = (path) => callback((resume, signal) => {
5260
5065
  if (err) {
5261
5066
  resume(fail5(handleErrnoException("FileSystem", "readFile")(err, [path])));
5262
5067
  } else {
5263
- resume(succeed4(data));
5068
+ resume(succeed5(data));
5264
5069
  }
5265
5070
  });
5266
5071
  } catch (err) {
@@ -5319,7 +5124,7 @@ var utimes2 = /* @__PURE__ */ (() => {
5319
5124
  const nodeUtimes = /* @__PURE__ */ effectify(NFS.utimes, /* @__PURE__ */ handleErrnoException("FileSystem", "utime"), /* @__PURE__ */ handleBadArgument("utime"));
5320
5125
  return (path, atime, mtime) => nodeUtimes(path, atime, mtime);
5321
5126
  })();
5322
- var watchNode = (path, info, options) => callback2((queue) => acquireRelease(sync(() => {
5127
+ var watchNode = (path, info, options) => callback2((queue) => acquireRelease(sync2(() => {
5323
5128
  const directory = info.type === "Directory" ? path : Path2.dirname(path);
5324
5129
  const watcher = NFS.watch(path, {
5325
5130
  recursive: options?.recursive ?? false
@@ -5362,7 +5167,7 @@ var watchNode = (path, info, options) => callback2((queue) => acquireRelease(syn
5362
5167
  endUnsafe(queue);
5363
5168
  });
5364
5169
  return watcher;
5365
- }), (watcher) => sync(() => watcher.close())).pipe(tap(() => sync(() => options?.onReady?.()))));
5170
+ }), (watcher) => sync2(() => watcher.close())).pipe(tap(() => sync2(() => options?.onReady?.()))));
5366
5171
  var watch2 = (backend, path, options) => all2([stat2(path), serviceOption(WatchBackend)]).pipe(map4(([stat, callerBackend]) => orElse(callerBackend, () => backend).pipe(flatMap((_) => _.register(path, stat, options)), getOrElse(() => watchNode(path, stat, options)))), unwrap2);
5367
5172
  var writeFile2 = (path, data, options) => callback((resume, signal) => {
5368
5173
  try {
@@ -5374,7 +5179,7 @@ var writeFile2 = (path, data, options) => callback((resume, signal) => {
5374
5179
  if (err) {
5375
5180
  resume(fail5(handleErrnoException("FileSystem", "writeFile")(err, [path])));
5376
5181
  } else {
5377
- resume(void_2);
5182
+ resume(void_3);
5378
5183
  }
5379
5184
  });
5380
5185
  } catch (err) {
@@ -5400,7 +5205,7 @@ var makeFileSystem = /* @__PURE__ */ map4(/* @__PURE__ */ serviceOption(WatchBac
5400
5205
  readFile: readFile2,
5401
5206
  readLink,
5402
5207
  realPath,
5403
- remove: remove2,
5208
+ remove,
5404
5209
  rename: rename2,
5405
5210
  stat: stat2,
5406
5211
  symlink: symlink2,
@@ -5441,15 +5246,15 @@ var fileUrlOps = (windows) => ({
5441
5246
  })
5442
5247
  })
5443
5248
  });
5444
- var layerPosix = /* @__PURE__ */ succeed3(Path)(/* @__PURE__ */ make13({
5249
+ var layerPosix = /* @__PURE__ */ succeed4(Path)(/* @__PURE__ */ make13({
5445
5250
  ...NodePath.posix,
5446
5251
  .../* @__PURE__ */ fileUrlOps(false)
5447
5252
  }));
5448
- var layerWin32 = /* @__PURE__ */ succeed3(Path)(/* @__PURE__ */ make13({
5253
+ var layerWin32 = /* @__PURE__ */ succeed4(Path)(/* @__PURE__ */ make13({
5449
5254
  ...NodePath.win32,
5450
5255
  .../* @__PURE__ */ fileUrlOps(true)
5451
5256
  }));
5452
- var layer8 = /* @__PURE__ */ succeed3(Path)(/* @__PURE__ */ make13({
5257
+ var layer8 = /* @__PURE__ */ succeed4(Path)(/* @__PURE__ */ make13({
5453
5258
  ...NodePath,
5454
5259
  .../* @__PURE__ */ fileUrlOps(undefined)
5455
5260
  }));
@@ -5458,11 +5263,11 @@ var layer8 = /* @__PURE__ */ succeed3(Path)(/* @__PURE__ */ make13({
5458
5263
  var layer9 = layer8;
5459
5264
 
5460
5265
  // ../../../../node_modules/.bun/@effect+platform-node-shared@4.1.2+edf248c88a527e3e/node_modules/@effect/platform-node-shared/dist/NodeStdio.js
5461
- var layer10 = /* @__PURE__ */ succeed3(Stdio, /* @__PURE__ */ make15({
5462
- args: /* @__PURE__ */ sync(() => process.argv.slice(2)),
5463
- stdinIsTerminal: /* @__PURE__ */ sync(() => process.stdin.isTTY === true),
5464
- stdoutIsTerminal: /* @__PURE__ */ sync(() => process.stdout.isTTY === true),
5465
- stderrIsTerminal: /* @__PURE__ */ sync(() => process.stderr.isTTY === true),
5266
+ var layer10 = /* @__PURE__ */ succeed4(Stdio, /* @__PURE__ */ make15({
5267
+ args: /* @__PURE__ */ sync2(() => process.argv.slice(2)),
5268
+ stdinIsTerminal: /* @__PURE__ */ sync2(() => process.stdin.isTTY === true),
5269
+ stdoutIsTerminal: /* @__PURE__ */ sync2(() => process.stdout.isTTY === true),
5270
+ stderrIsTerminal: /* @__PURE__ */ sync2(() => process.stderr.isTTY === true),
5466
5271
  stdout: (options) => fromWritable({
5467
5272
  evaluate: () => process.stdout,
5468
5273
  onError: (cause) => systemError({
@@ -5513,9 +5318,9 @@ var make20 = /* @__PURE__ */ fnUntraced(function* (shouldQuit = defaultShouldQui
5513
5318
  }
5514
5319
  };
5515
5320
  stdin.once("end", onStdinEnd);
5516
- yield* addFinalizer2(() => sync(() => stdin.off("end", onStdinEnd)));
5321
+ yield* addFinalizer2(() => sync2(() => stdin.off("end", onStdinEnd)));
5517
5322
  const rlRef = yield* make11({
5518
- acquire: acquireRelease(sync(() => {
5323
+ acquire: acquireRelease(sync2(() => {
5519
5324
  const rl = readline.createInterface({
5520
5325
  input: stdin,
5521
5326
  escapeCodeTimeout: 50
@@ -5538,7 +5343,7 @@ var make20 = /* @__PURE__ */ fnUntraced(function* (shouldQuit = defaultShouldQui
5538
5343
  rl,
5539
5344
  onClose,
5540
5345
  onLine
5541
- }) => sync(() => {
5346
+ }) => sync2(() => {
5542
5347
  readlineActive = false;
5543
5348
  rl.off("line", onLine);
5544
5349
  rl.off("close", onClose);
@@ -5549,7 +5354,7 @@ var make20 = /* @__PURE__ */ fnUntraced(function* (shouldQuit = defaultShouldQui
5549
5354
  })),
5550
5355
  idleTimeToLive: "10 millis"
5551
5356
  });
5552
- const setRawMode = (enabled) => sync(() => {
5357
+ const setRawMode = (enabled) => sync2(() => {
5553
5358
  if (stdin.isTTY)
5554
5359
  stdin.setRawMode(enabled);
5555
5360
  });
@@ -5557,15 +5362,15 @@ var make20 = /* @__PURE__ */ fnUntraced(function* (shouldQuit = defaultShouldQui
5557
5362
  acquire: acquireRelease(setRawMode(true), () => setRawMode(false)),
5558
5363
  idleTimeToLive: "10 millis"
5559
5364
  });
5560
- const columns = sync(() => stdout.columns ?? 0);
5561
- const rows = sync(() => stdout.rows ?? 0);
5365
+ const columns = sync2(() => stdout.columns ?? 0);
5366
+ const rows = sync2(() => stdout.rows ?? 0);
5562
5367
  const size = gen(function* () {
5563
5368
  const queue = yield* sliding(1);
5564
5369
  const onResize = () => offerUnsafe(queue, {
5565
5370
  columns: stdout.columns ?? 0,
5566
5371
  rows: stdout.rows ?? 0
5567
5372
  });
5568
- yield* addFinalizer2(() => sync(() => {
5373
+ yield* addFinalizer2(() => sync2(() => {
5569
5374
  stdout.off("resize", onResize);
5570
5375
  endUnsafe(queue);
5571
5376
  }));
@@ -5595,7 +5400,7 @@ var make20 = /* @__PURE__ */ fnUntraced(function* (shouldQuit = defaultShouldQui
5595
5400
  clearInterval(keepAlive);
5596
5401
  endUnsafe(queue);
5597
5402
  };
5598
- yield* addFinalizer2(() => sync(() => {
5403
+ yield* addFinalizer2(() => sync2(() => {
5599
5404
  clearInterval(keepAlive);
5600
5405
  stdin.off("keypress", handleKeypress);
5601
5406
  stdin.off("end", handleEnd);
@@ -5604,18 +5409,18 @@ var make20 = /* @__PURE__ */ fnUntraced(function* (shouldQuit = defaultShouldQui
5604
5409
  if (inputEnded) {
5605
5410
  handleEnd();
5606
5411
  } else {
5607
- yield* get4(rlRef);
5608
- yield* get4(rawModeRef);
5412
+ yield* get3(rlRef);
5413
+ yield* get3(rawModeRef);
5609
5414
  stdin.once("end", handleEnd);
5610
5415
  }
5611
5416
  return queue;
5612
5417
  });
5613
5418
  const readLine = suspend(() => poll(lines).pipe(flatMap3(match2({
5614
- onNone: () => scoped(andThen(get4(rlRef), take(lines))),
5615
- onSome: succeed4
5419
+ onNone: () => scoped(andThen(get3(rlRef), take(lines))),
5420
+ onSome: succeed5
5616
5421
  })), mapError2(() => new QuitError({}))));
5617
5422
  const display = (prompt) => uninterruptible(callback((resume) => {
5618
- stdout.write(prompt, (err) => isNullish(err) ? resume(void_2) : resume(fail5(badArgument({
5423
+ stdout.write(prompt, (err) => isNullish(err) ? resume(void_3) : resume(fail5(badArgument({
5619
5424
  module: "Terminal",
5620
5425
  method: "display",
5621
5426
  description: "Failed to write prompt to stdout",
@@ -5642,7 +5447,7 @@ var layer13 = layer12;
5642
5447
 
5643
5448
  // ../../../../node_modules/.bun/@effect+platform-node@4.1.2+22a1c27d4b1c9267/node_modules/@effect/platform-node/dist/NodeServices.js
5644
5449
  var layer14 = /* @__PURE__ */ provideMerge(layer5, /* @__PURE__ */ mergeAll(layer7, layer9, layer11, layer13));
5645
- // ../../../../node_modules/.bun/@dual-os+sdk@0.8.1+a827849ded09603e/node_modules/@dual-os/sdk/dist/Runner.js
5450
+ // ../../../../node_modules/.bun/@dual-os+sdk@0.9.0+a827849ded09603e/node_modules/@dual-os/sdk/dist/Runner.js
5646
5451
  var guestOAuth = pipe(oauth2TokenRefresherLayer, provideMerge(layer3), provide(layer(fromUnknown({}))));
5647
5452
  function initializationError(cause) {
5648
5453
  if (is(PluginExecutionError)(cause))
@@ -5656,116 +5461,77 @@ function initializationError(cause) {
5656
5461
  }))) || "No error details returned by the plugin."
5657
5462
  });
5658
5463
  }
5659
- pipe(gen(function* () {
5660
- const guestServices = yield* context();
5661
- const scope = yield* Scope;
5662
- const runtimeScope = yield* fork(scope, "sequential");
5663
- const failed = yield* make();
5664
- const invocations = yield* make14();
5665
- const stdio = yield* Stdio;
5666
- const args = yield* decodeUnknownEffect(Tuple([
5667
- NonEmptyString,
5668
- NonEmptyString,
5669
- Literals(["inspect", "execute"]),
5670
- NonEmptyString
5671
- ]))(yield* stdio.args);
5672
- const load = yield* cached(forkIn(gen(function* () {
5673
- const plugin = (yield* decodeUnknownEffect(Record(String3, Unknown))(yield* tryPromise({
5674
- try: () => import(args[0]),
5675
- catch: initializationError
5676
- })))[args[1]];
5677
- if (!isPlugin(plugin))
5678
- return yield* PluginExecutionError.make({
5679
- category: "protocol",
5680
- message: "The configured export is not an integration plugin"
5681
- });
5682
- yield* try_2({
5683
- try: () => make6(plugin.identifier),
5684
- catch: initializationError
5685
- });
5686
- return {
5687
- plugin,
5688
- runtime: yield* cached(forkIn(pipe(buildWithScope(pipe(toLayer(fromPlugin(plugin, args[3])), provideMerge(mergeAll(filesUnavailable, layer2, guestOAuth))), runtimeScope), provideContext(makeUnsafe(guestServices.mapUnsafe))), runtimeScope))
5689
- };
5690
- }), runtimeScope));
5691
- const execute$1 = fnUntraced(function* (request) {
5692
- return yield* pipe(gen(function* () {
5693
- const { plugin, runtime } = yield* join2(yield* load);
5694
- if (request.identity.pluginKey !== plugin.identifier && !(args[2] === "inspect" && ("_tag" in request) && request._tag === "extract"))
5695
- return yield* PluginExecutionError.make({
5696
- category: "protocol",
5697
- message: "Plugin identity does not match the request"
5698
- });
5699
- if (request.identity.pluginVersion !== args[3])
5464
+ var Options = Struct({
5465
+ entrypoint: NonEmptyString,
5466
+ exportName: NonEmptyString,
5467
+ mode: Literals(["inspect", "execute"]),
5468
+ version: NonEmptyString
5469
+ });
5470
+ var runtime = make14(mergeAll(layer14, layer4));
5471
+ function load(input) {
5472
+ return runtime.runPromise(gen(function* () {
5473
+ const options = yield* decodeUnknownEffect(Options)(input);
5474
+ const guestServices = yield* context();
5475
+ const scope = yield* make("sequential");
5476
+ const loaded = yield* cached(forkIn(gen(function* () {
5477
+ const plugin = (yield* decodeUnknownEffect(Record(String3, Unknown))(yield* tryPromise({
5478
+ try: () => import(options.entrypoint),
5479
+ catch: initializationError
5480
+ })))[options.exportName];
5481
+ if (!isPlugin(plugin))
5700
5482
  return yield* PluginExecutionError.make({
5701
5483
  category: "protocol",
5702
- message: "Plugin release does not match the request"
5484
+ message: "The configured export is not an integration plugin"
5703
5485
  });
5704
- if ("_tag" in request && request._tag === "extract")
5705
- return {
5706
- _tag: "success",
5707
- identity: request.identity,
5708
- value: yield* decodeEffect(fromJsonString(Json))(yield* encodeEffect(fromJsonString(Unknown))(materializePlugin(plugin, { version: request.identity.pluginVersion })))
5709
- };
5710
- return yield* pipe(execute3(request), provideContext(yield* join2(yield* runtime)));
5711
- }), catchCauseIf((cause) => !hasInterrupts(cause), (cause) => args[2] === "inspect" ? fail5(initializationError(squash(cause))) : succeed4({
5712
- _tag: "failure",
5713
- identity: request.identity,
5714
- error: {
5715
- category: "initialization",
5716
- code: "PluginInitializationFailed",
5717
- message: "Cannot initialize the installed plugin",
5718
- retryable: false
5719
- }
5720
- })), mapError2(initializationError));
5721
- });
5722
- yield* raceFirst(pipe(ipcMessages(process), runForEach(fnUntraced(function* (message) {
5723
- const input = yield* decodeInput(message);
5724
- const key = yield* encodeEffect(fromJsonString(Identity))(input.identity);
5725
- if ("_tag" in input && input._tag === "cancel") {
5726
- const fiber = getOrUndefined(yield* get5(invocations, key));
5727
- if (fiber !== undefined)
5728
- yield* pipe(interrupt2(fiber), forkIn(scope));
5729
- return;
5730
- }
5731
- if ((yield* has3(invocations, key)) || (yield* size2(invocations)) >= 16)
5732
- return yield* PluginExecutionError.make({
5733
- category: "protocol",
5734
- message: "Plugin invocation is duplicate or exceeds concurrency"
5486
+ yield* try_2({
5487
+ try: () => make6(plugin.identifier),
5488
+ catch: initializationError
5735
5489
  });
5736
- const fiber = yield* run3(invocations, key, scoped(execute$1(input)));
5737
- yield* pipe(gen(function* () {
5738
- const exit = yield* await_(fiber);
5739
- const send = fnUntraced(function* (output) {
5740
- const encoded = yield* encodeOutput(output, responseLimit(input));
5741
- if (args[2] !== "inspect")
5742
- return yield* sendIpc(process, encoded);
5743
- yield* callback((resume) => {
5744
- if (process.send === undefined) {
5745
- resume(fail5(initializationError("Plugin IPC channel is closed")));
5746
- return;
5747
- }
5748
- process.send(encoded, (error) => {
5749
- if (error !== null)
5750
- resume(fail5(initializationError(error)));
5751
- else
5752
- resume(void_2);
5490
+ return {
5491
+ plugin,
5492
+ services: yield* cached(forkIn(pipe(buildWithScope(pipe(toLayer(fromPlugin(plugin, options.version)), provideMerge(mergeAll(filesUnavailable, layer2, guestOAuth))), scope), provideContext(makeUnsafe(guestServices.mapUnsafe))), scope))
5493
+ };
5494
+ }), scope));
5495
+ const run = fnUntraced(function* (request) {
5496
+ return yield* pipe(gen(function* () {
5497
+ const { plugin, services } = yield* join2(yield* loaded);
5498
+ if (request.identity.pluginKey !== plugin.identifier && !(options.mode === "inspect" && ("_tag" in request) && request._tag === "extract"))
5499
+ return yield* PluginExecutionError.make({
5500
+ category: "protocol",
5501
+ message: "Plugin identity does not match the request"
5753
5502
  });
5754
- });
5755
- if (process.connected)
5756
- process.disconnect();
5757
- });
5758
- if (isSuccess2(exit))
5759
- return yield* send(exit.value);
5760
- if (every(exit.cause.reasons, isInterruptReason))
5761
- return yield* send({
5762
- _tag: "interrupted",
5763
- identity: input.identity
5764
- });
5765
- return yield* initializationError(squash(exit.cause));
5766
- }), catchCause((cause) => fail4(failed, initializationError(squash(cause)))), forkIn(scope));
5767
- })), mapError2(initializationError)), _await(failed));
5768
- }), scoped, provide2([layer14, layer4]), runMain2({ disableErrorReporting: process.argv[4] !== "inspect" }));
5503
+ if (request.identity.pluginVersion !== options.version)
5504
+ return yield* PluginExecutionError.make({
5505
+ category: "protocol",
5506
+ message: "Plugin release does not match the request"
5507
+ });
5508
+ if ("_tag" in request && request._tag === "extract")
5509
+ return {
5510
+ _tag: "success",
5511
+ identity: request.identity,
5512
+ value: yield* decodeEffect(fromJsonString(Json))(yield* encodeEffect(fromJsonString(Unknown))(materializePlugin(plugin, { version: request.identity.pluginVersion })))
5513
+ };
5514
+ return yield* pipe(execute3(request), provideContext(yield* join2(yield* services)));
5515
+ }), catchCauseIf((cause) => !hasInterrupts(cause), (cause) => options.mode === "inspect" ? fail5(initializationError(squash(cause))) : succeed5({
5516
+ _tag: "failure",
5517
+ identity: request.identity,
5518
+ error: {
5519
+ category: "initialization",
5520
+ code: "PluginInitializationFailed",
5521
+ message: "Cannot initialize the installed plugin",
5522
+ retryable: false
5523
+ }
5524
+ })));
5525
+ });
5526
+ return { execute: (message, signal) => runtime.runPromise(pipe(gen(function* () {
5527
+ const request = yield* decodeInput(message);
5528
+ return yield* encodeOutput(yield* scoped(run(request)), responseLimit(request));
5529
+ }), mapError2(initializationError)), { signal }) };
5530
+ }));
5531
+ }
5532
+ export {
5533
+ load
5534
+ };
5769
5535
 
5770
- //# debugId=E3DAC05DF310E15464756E2164756E21
5536
+ //# debugId=F140CDA449712B2164756E2164756E21
5771
5537
  //# sourceMappingURL=Runner.js.map