@kitman-sh/cli 0.14.8 → 0.15.0

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 (30) hide show
  1. package/dist/{chunk-y0y2gg8d.js → chunk-0ws25xvg.js} +2 -2
  2. package/dist/{chunk-b009hdm0.js → chunk-39ykbhq8.js} +5 -5
  3. package/dist/{chunk-eytzmdna.js → chunk-3n99j4z0.js} +471 -234
  4. package/dist/{chunk-bbf0jzsc.js → chunk-3ns4sbfb.js} +1 -1
  5. package/dist/{chunk-q0x3c0dh.js → chunk-4x7a1qkj.js} +7 -7
  6. package/dist/{chunk-ya4z1n5p.js → chunk-4zc1g45m.js} +7 -7
  7. package/dist/{chunk-6dj39qtt.js → chunk-58hehm8d.js} +1133 -115
  8. package/dist/{chunk-9avbsbvk.js → chunk-5hkdgzh4.js} +1 -1
  9. package/dist/{chunk-xfs1nf75.js → chunk-8393zths.js} +1626 -388
  10. package/dist/{chunk-bpx2zjh7.js → chunk-8wpg3rph.js} +2 -2
  11. package/dist/{chunk-6x43ntsx.js → chunk-b16qxawc.js} +1 -1
  12. package/dist/chunk-cf1hxp43.js +3080 -0
  13. package/dist/chunk-csxxwscf.js +39 -0
  14. package/dist/{chunk-dq21ab8w.js → chunk-djp6t2g6.js} +21 -21
  15. package/dist/{chunk-zpp4jg4a.js → chunk-dx792s4w.js} +1455 -100
  16. package/dist/{chunk-5wrhj4cj.js → chunk-fv2zpgh0.js} +7 -7
  17. package/dist/{chunk-ctpgfdzf.js → chunk-fzaecdgv.js} +3 -3
  18. package/dist/{chunk-79g5zh2p.js → chunk-k2wd9r6t.js} +4 -4
  19. package/dist/chunk-mrkrt2hg.js +4345 -0
  20. package/dist/{chunk-721qyd1a.js → chunk-qkt77rtj.js} +6 -6
  21. package/dist/{chunk-drp4zdwq.js → chunk-rt0qfdtg.js} +15 -7
  22. package/dist/{chunk-cf723a2y.js → chunk-snwjv2sd.js} +678 -40
  23. package/dist/{chunk-bdd62njv.js → chunk-vg78dz3w.js} +259 -57
  24. package/dist/{chunk-wszvkzg8.js → chunk-vq7caqt2.js} +1828 -130
  25. package/dist/{chunk-63m3r0k4.js → chunk-wfz64h9p.js} +4 -4
  26. package/dist/{chunk-hz4t408c.js → chunk-xx711t5r.js} +4 -4
  27. package/dist/index.js +4 -4
  28. package/package.json +2 -1
  29. package/dist/chunk-1rwaetnm.js +0 -526
  30. package/dist/chunk-hrtr5wfq.js +0 -1166
@@ -34,8 +34,11 @@ import {
34
34
  getOrUndefined,
35
35
  map4,
36
36
  Service2,
37
- get3,
37
+ add,
38
+ get4,
38
39
  Reference,
40
+ fromInputUnsafe,
41
+ isFinite,
39
42
  normalize,
40
43
  succeed,
41
44
  fail3,
@@ -44,11 +47,13 @@ import {
44
47
  map5,
45
48
  all2,
46
49
  fromIterable,
50
+ isArray,
47
51
  isArrayNonEmpty,
48
52
  isReadonlyArrayNonEmpty,
49
53
  isCanonicalArrayIndex,
50
54
  getUnsafe2,
51
55
  sort,
56
+ empty4,
52
57
  of,
53
58
  map6,
54
59
  Error2,
@@ -76,13 +81,12 @@ import {
76
81
  fiberRunIn,
77
82
  makeLatchUnsafe,
78
83
  makeLatch,
79
- ClockRef,
80
- currentTimeMillis2,
81
84
  succeed3,
82
85
  failCause2,
83
86
  fail4,
84
87
  interrupt2,
85
88
  void_2,
89
+ isSuccess2,
86
90
  isFailure2,
87
91
  asVoidAll,
88
92
  makeUnsafe5,
@@ -139,7 +143,7 @@ import {
139
143
  tap2,
140
144
  option2,
141
145
  exit,
142
- map8,
146
+ map9,
143
147
  as,
144
148
  asSome2,
145
149
  asVoid,
@@ -154,12 +158,14 @@ import {
154
158
  tapError2,
155
159
  ignoreCause,
156
160
  orElseSucceed,
161
+ sleep,
157
162
  raceFirst,
158
163
  when,
159
164
  matchCauseEffect,
160
165
  context,
161
166
  contextWith,
162
167
  provideContext2,
168
+ scope2,
163
169
  scoped,
164
170
  scopedWith,
165
171
  acquireRelease,
@@ -170,6 +176,7 @@ import {
170
176
  interrupt3,
171
177
  onInterrupt,
172
178
  uninterruptible,
179
+ uninterruptibleMask2,
173
180
  forever,
174
181
  forkChild,
175
182
  forkIn,
@@ -192,11 +199,11 @@ import {
192
199
  toEncoded,
193
200
  decodeUnknownEffect,
194
201
  SchemaError,
195
- make16,
202
+ make17,
196
203
  String4,
197
204
  toCodecStringTree,
198
205
  encodeUnknownJsonStringSync
199
- } from "./chunk-zpp4jg4a.js";
206
+ } from "./chunk-dx792s4w.js";
200
207
 
201
208
  // node_modules/.bun/effect@4.1.2/node_modules/effect/dist/Iterable.js
202
209
  var headUnsafe = (self) => {
@@ -245,10 +252,6 @@ var makeEquivalence = (equivalence) => {
245
252
  return (self, that) => is(self, that) && is(that, self);
246
253
  };
247
254
 
248
- // node_modules/.bun/effect@4.1.2/node_modules/effect/dist/Clock.js
249
- var Clock = ClockRef;
250
- var currentTimeMillis = currentTimeMillis2;
251
-
252
255
  // node_modules/.bun/effect@4.1.2/node_modules/effect/dist/ByteSize.js
253
256
  var bigint0 = /* @__PURE__ */ BigInt(0);
254
257
  var bigint1 = /* @__PURE__ */ BigInt(1);
@@ -369,7 +372,7 @@ var fromStringUnsafe = (input) => {
369
372
  return invalid(`${JSON.stringify(input)} does not represent an integral number of bytes`);
370
373
  return make(value);
371
374
  };
372
- var fromInputUnsafe = (input) => {
375
+ var fromInputUnsafe2 = (input) => {
373
376
  switch (typeof input) {
374
377
  case "bigint":
375
378
  if (input < bigint0)
@@ -382,7 +385,7 @@ var fromInputUnsafe = (input) => {
382
385
  }
383
386
  return invalid(`unsupported input ${input}`);
384
387
  };
385
- var bytes = (value) => typeof value === "bigint" ? fromInputUnsafe(value) : fromNumber(value);
388
+ var bytes = (value) => typeof value === "bigint" ? fromInputUnsafe2(value) : fromNumber(value);
386
389
 
387
390
  // node_modules/.bun/effect@4.1.2/node_modules/effect/dist/Fiber.js
388
391
  var join = fiberJoin;
@@ -948,7 +951,7 @@ var walk = /* @__PURE__ */ fnUntraced(function* (fs, compiled, options) {
948
951
  const isUnlisted = (value) => value === "." || value === ".." || isRoot(value);
949
952
  const probe = (parent, name, named) => {
950
953
  const path = toFsPath(join2(parent, name));
951
- return fs.stat(path).pipe(map8((info) => info.type), catchReason("PlatformError", "NotFound", () => fs.readLink(path).pipe(as("SymbolicLink"), catchIf(isNotLink, () => succeed6(undefined)))), catchIf(named ? isMissing : isIgnorable, () => succeed6(undefined)), map8((type) => type === undefined ? undefined : {
954
+ return fs.stat(path).pipe(map9((info) => info.type), catchReason("PlatformError", "NotFound", () => fs.readLink(path).pipe(as("SymbolicLink"), catchIf(isNotLink, () => succeed6(undefined)))), catchIf(named ? isMissing : isIgnorable, () => succeed6(undefined)), map9((type) => type === undefined ? undefined : {
952
955
  name,
953
956
  type
954
957
  }));
@@ -1003,7 +1006,7 @@ var walk = /* @__PURE__ */ fnUntraced(function* (fs, compiled, options) {
1003
1006
  return child(type === "Directory", false);
1004
1007
  }
1005
1008
  const path = toFsPath(relative);
1006
- return fs.stat(path).pipe(map8((info) => info.type === "Directory"), catchIf(isIgnorable, () => succeed6(false)), flatMap3((isDirectory) => {
1009
+ return fs.stat(path).pipe(map9((info) => info.type === "Directory"), catchIf(isIgnorable, () => succeed6(false)), flatMap3((isDirectory) => {
1007
1010
  const resolved = child(isDirectory, type === "SymbolicLink");
1008
1011
  if (type === "SymbolicLink" || resolved?.next === undefined || result.globstar.size === 0) {
1009
1012
  return succeed6(resolved);
@@ -1029,7 +1032,7 @@ var walk = /* @__PURE__ */ fnUntraced(function* (fs, compiled, options) {
1029
1032
  const child = visit(entry, relative, states, excluded);
1030
1033
  if (isEffect(child)) {
1031
1034
  const index = children.push(undefined) - 1;
1032
- pending.push(map8(child, (child) => {
1035
+ pending.push(map9(child, (child) => {
1033
1036
  children[index] = child;
1034
1037
  }));
1035
1038
  } else {
@@ -1308,7 +1311,7 @@ var publishUnsafe = /* @__PURE__ */ dual(2, (self, value) => {
1308
1311
  return false;
1309
1312
  });
1310
1313
  var subscribe = (self) => uninterruptible(contextWith((services) => {
1311
- const localScope = get3(services, Scope);
1314
+ const localScope = get4(services, Scope);
1312
1315
  const scope = forkUnsafe(self.scope);
1313
1316
  const subscription = makeSubscriptionUnsafe(self.pubsub, self.subscribers, self.strategy, self.ended);
1314
1317
  return addFinalizer(scope, unsubscribe(subscription)).pipe(andThen2(addFinalizerExit(localScope, (exit) => close(scope, exit))), as(subscription));
@@ -2255,7 +2258,7 @@ var asyncQueue = (scope, f, options) => make9({
2255
2258
  }).pipe(tap2((queue) => addFinalizer(scope, shutdown(queue))), tap2((queue) => provide(f(queue), scope).pipe(catchCause2((cause) => failCause(queue, cause)), forkIn(scope, {
2256
2259
  startImmediately: true
2257
2260
  }))));
2258
- var callbackArray = (f, options) => fromTransform((_, scope) => map8(asyncQueue(scope, f, options), takeAll3));
2261
+ var callbackArray = (f, options) => fromTransform((_, scope) => map9(asyncQueue(scope, f, options), takeAll3));
2259
2262
  var suspend4 = (evaluate) => fromTransform((upstream, scope) => suspend3(() => toTransform(evaluate())(upstream, scope)));
2260
2263
  var fromIterator = (iterator) => fromPull(sync2(() => {
2261
2264
  const iter = iterator();
@@ -2281,7 +2284,7 @@ var fromEffect = (effect) => fromPull(sync2(() => {
2281
2284
  var fromEffectDrain = (effect) => fromPull(flatMap3(effect, () => done()));
2282
2285
  var fromQueueArray = (queue) => fromPull(succeed6(takeAll3(queue)));
2283
2286
  var fromSubscriptionArray = (subscription) => fromPull(succeed6(onInterrupt(takeAll2(subscription), () => done())));
2284
- var fromPubSubArray = (pubsub) => unwrap2(map8(subscribe(pubsub), fromSubscriptionArray));
2287
+ var fromPubSubArray = (pubsub) => unwrap2(map9(subscribe(pubsub), fromSubscriptionArray));
2285
2288
  var fromReadableStream2 = (options) => fromTransform((_, scope) => readableStreamToPullUnsafe({
2286
2289
  scope,
2287
2290
  readable: options.evaluate(),
@@ -2313,7 +2316,7 @@ var readableStreamToPullUnsafe = (options) => {
2313
2316
  };
2314
2317
  var map7 = /* @__PURE__ */ dual(2, (self, f) => transformPull(self, (pull) => sync2(() => {
2315
2318
  let i = 0;
2316
- return map8(pull, (o) => f(o, i++));
2319
+ return map9(pull, (o) => f(o, i++));
2317
2320
  })));
2318
2321
  var mapDone = /* @__PURE__ */ dual(2, (self, f) => mapDoneEffect(self, (o) => succeed6(f(o))));
2319
2322
  var mapDoneEffect = /* @__PURE__ */ dual(2, (self, f) => transformPull(self, (pull) => succeed6(catchDone(pull, (done2) => flatMap3(f(done2), done)))));
@@ -2321,7 +2324,7 @@ var concurrencyIsSequential = (concurrency) => concurrency === undefined || conc
2321
2324
  var mapEffect = /* @__PURE__ */ dual((args) => isChannel(args[0]), (self, f, options) => concurrencyIsSequential(options?.concurrency) ? mapEffectSequential(self, f) : mapEffectConcurrent(self, f, options));
2322
2325
  var mapEffectSequential = (self, f) => fromTransform((upstream, scope) => {
2323
2326
  let i = 0;
2324
- return map8(toTransform(self)(upstream, scope), flatMap3((o) => f(o, i++)));
2327
+ return map9(toTransform(self)(upstream, scope), flatMap3((o) => f(o, i++)));
2325
2328
  });
2326
2329
  var mapEffectConcurrent = (self, f, options) => fromTransformBracket(fnUntraced(function* (upstream, scope, forkedScope) {
2327
2330
  let i = 0;
@@ -2373,7 +2376,7 @@ var mapEffectConcurrent = (self, f, options) => fromTransformBracket(fnUntraced(
2373
2376
  return take(queue);
2374
2377
  }));
2375
2378
  var flatMap = /* @__PURE__ */ dual((args) => isChannel(args[0]), (self, f, options) => concurrencyIsSequential(options?.concurrency) ? flatMapSequential(self, f) : flatMapConcurrent(self, f, options));
2376
- var flatMapSequential = (self, f) => fromTransform((upstream, scope) => map8(toTransform(self)(upstream, scope), (pull) => {
2379
+ var flatMapSequential = (self, f) => fromTransform((upstream, scope) => map9(toTransform(self)(upstream, scope), (pull) => {
2377
2380
  let childPull;
2378
2381
  let childScope;
2379
2382
  const makePull = flatMap3(pull, (value) => {
@@ -2432,9 +2435,49 @@ var filterArray = /* @__PURE__ */ dual(2, (self, predicate) => transformPull(sel
2432
2435
  }
2433
2436
  return isReadonlyArrayNonEmpty(passes) ? succeed6(passes) : flatMap3(pull, loop);
2434
2437
  }))));
2438
+ var mapAccum2 = /* @__PURE__ */ dual((args) => isChannel(args[0]), (self, initial, f, options) => fromTransform((upstream, scope) => map9(toTransform(self)(upstream, scope), (pull) => {
2439
+ let state = initial();
2440
+ let current;
2441
+ let index = 0;
2442
+ let cause;
2443
+ const pullNext = matchCauseEffect(pull, {
2444
+ onFailure(cause_) {
2445
+ cause = cause_;
2446
+ const b = options?.onHalt && options.onHalt(state);
2447
+ return b && b.length > 0 ? succeed6([state, b]) : failCause3(cause_);
2448
+ },
2449
+ onSuccess(a) {
2450
+ const b = f(state, a);
2451
+ return isArray(b) ? succeed6(b) : b;
2452
+ }
2453
+ });
2454
+ const pump = suspend3(function loop() {
2455
+ if (current === undefined) {
2456
+ if (cause)
2457
+ return failCause3(cause);
2458
+ return flatMap3(pullNext, ([newState, values]) => {
2459
+ state = newState;
2460
+ if (values.length === 0) {
2461
+ return loop();
2462
+ } else if (values.length === 1) {
2463
+ return succeed6(values[0]);
2464
+ }
2465
+ current = values;
2466
+ return loop();
2467
+ });
2468
+ }
2469
+ const next = current[index++];
2470
+ if (index >= current.length) {
2471
+ current = undefined;
2472
+ index = 0;
2473
+ }
2474
+ return succeed6(next);
2475
+ });
2476
+ return pump;
2477
+ })));
2435
2478
  var catchCause3 = /* @__PURE__ */ dual(2, (self, f) => fromTransform((upstream, scope) => {
2436
2479
  let forkedScope = forkUnsafe(scope);
2437
- return map8(toTransform(self)(upstream, forkedScope), (pull) => {
2480
+ return map9(toTransform(self)(upstream, forkedScope), (pull) => {
2438
2481
  let currentPull = pull.pipe(catchCause2((cause) => {
2439
2482
  if (isDoneCause(cause)) {
2440
2483
  return failCause3(cause);
@@ -2631,7 +2674,7 @@ var decodeText2 = (encoding, options) => fromTransform((upstream, _scope) => syn
2631
2674
  const streamOptions = {
2632
2675
  stream: true
2633
2676
  };
2634
- let pull = upstream.pipe(map8(map6((bytes) => decoder.decode(bytes, streamOptions))), catchDone((leftover) => {
2677
+ let pull = upstream.pipe(map9(map6((bytes) => decoder.decode(bytes, streamOptions))), catchDone((leftover) => {
2635
2678
  pull = done(leftover);
2636
2679
  const last = decoder.decode();
2637
2680
  return last.length > 0 ? succeed6(of(last)) : pull;
@@ -2662,14 +2705,14 @@ var runWith = (self, f, onHalt) => suspend3(() => {
2662
2705
  const makePull = toTransform(self)(done(), scope);
2663
2706
  return catchDone(flatMap3(makePull, f), onHalt ? onHalt : succeed6).pipe(onExit((exit) => close(scope, exit)));
2664
2707
  });
2665
- var provideContext3 = /* @__PURE__ */ dual(2, (self, context) => fromTransform((upstream, scope) => map8(provideContext2(toTransform(self)(upstream, scope), context), provideContext2(context))));
2708
+ var provideContext3 = /* @__PURE__ */ dual(2, (self, context) => fromTransform((upstream, scope) => map9(provideContext2(toTransform(self)(upstream, scope), context), provideContext2(context))));
2666
2709
  var runDrain2 = (self) => runWith(self, (pull) => forever(pull, {
2667
2710
  disableYield: true
2668
2711
  }));
2669
2712
  var runForEach2 = /* @__PURE__ */ dual(2, (self, f) => runWith(self, (pull) => forever(flatMap3(pull, f), {
2670
2713
  disableYield: true
2671
2714
  })));
2672
- var mkUint8Array = (self) => map8(runFold2(self, () => ({
2715
+ var mkUint8Array = (self) => map9(runFold2(self, () => ({
2673
2716
  bytes: 0,
2674
2717
  arrays: []
2675
2718
  }), (acc, chunk) => {
@@ -2763,18 +2806,160 @@ var forEach2 = (f) => forEachArray(forEach((_) => f(_), {
2763
2806
  var forEachArray = (f) => fromTransform2((upstream) => upstream.pipe(flatMap3(f), forever({
2764
2807
  disableYield: true
2765
2808
  }), catchDone(() => endVoid)));
2766
- var unwrap3 = (effect) => fromChannel(unwrap2(map8(effect, toChannel)));
2809
+ var unwrap3 = (effect) => fromChannel(unwrap2(map9(effect, toChannel)));
2810
+
2811
+ // node_modules/.bun/effect@4.1.2/node_modules/effect/dist/internal/rcRef.js
2812
+ var TypeId8 = "~effect/RcRef";
2813
+ var stateEmpty = {
2814
+ _tag: "Empty"
2815
+ };
2816
+ var stateClosed = {
2817
+ _tag: "Closed"
2818
+ };
2819
+ var variance2 = {
2820
+ _A: identity,
2821
+ _E: identity
2822
+ };
2823
+
2824
+ class RcRefImpl {
2825
+ [TypeId8] = variance2;
2826
+ pipe() {
2827
+ return pipeArguments(this, arguments);
2828
+ }
2829
+ state = stateEmpty;
2830
+ acquire;
2831
+ context;
2832
+ scope;
2833
+ idleTimeToLive;
2834
+ constructor(acquire, context, scope, idleTimeToLive) {
2835
+ this.acquire = acquire;
2836
+ this.context = context;
2837
+ this.scope = scope;
2838
+ this.idleTimeToLive = idleTimeToLive;
2839
+ }
2840
+ }
2841
+ var make6 = (options) => withFiber2((fiber) => {
2842
+ const context = fiber.context;
2843
+ const scope = get4(context, Scope);
2844
+ const ref = new RcRefImpl(options.acquire, context, scope, options.idleTimeToLive !== undefined ? fromInputUnsafe(options.idleTimeToLive) : undefined);
2845
+ return as(addFinalizerExit(scope, () => {
2846
+ const state = ref.state;
2847
+ ref.state = stateClosed;
2848
+ if (state._tag === "Acquired")
2849
+ return close(state.scope, void_2);
2850
+ if (state._tag === "Acquiring")
2851
+ return interrupt(state.fiber);
2852
+ return void_3;
2853
+ }), ref);
2854
+ });
2855
+ var getState = (self, restore) => {
2856
+ switch (self.state._tag) {
2857
+ case "Closed": {
2858
+ return interrupt3;
2859
+ }
2860
+ case "Acquired": {
2861
+ const state = self.state;
2862
+ state.refCount++;
2863
+ return state.fiber ? as(interrupt(state.fiber), state) : succeed6(state);
2864
+ }
2865
+ case "Acquiring": {
2866
+ const state = self.state;
2867
+ state.awaiters++;
2868
+ return awaitAcquiring(self, state, restore);
2869
+ }
2870
+ case "Empty": {
2871
+ const acquiring = {
2872
+ _tag: "Acquiring",
2873
+ fiber: undefined,
2874
+ awaiters: 1,
2875
+ acquired: undefined
2876
+ };
2877
+ self.state = acquiring;
2878
+ const scope = makeUnsafe6();
2879
+ const acquire = provideContext2(self.acquire, add(self.context, Scope, scope)).pipe(flatMap3((value) => {
2880
+ if (self.state !== acquiring) {
2881
+ return interrupt3;
2882
+ }
2883
+ const state = {
2884
+ _tag: "Acquired",
2885
+ value,
2886
+ scope,
2887
+ fiber: undefined,
2888
+ refCount: acquiring.awaiters,
2889
+ invalidated: false
2890
+ };
2891
+ self.state = state;
2892
+ acquiring.acquired = state;
2893
+ return succeed6(state);
2894
+ }), onExit((exit) => {
2895
+ if (isSuccess2(exit))
2896
+ return void_3;
2897
+ if (self.state === acquiring)
2898
+ self.state = stateEmpty;
2899
+ return close(scope, exit);
2900
+ }));
2901
+ acquiring.fiber = runForkWith(getCurrent().context)(acquire);
2902
+ return awaitAcquiring(self, acquiring, restore);
2903
+ }
2904
+ }
2905
+ };
2906
+ var awaitAcquiring = (self, acquiring, restore) => onExit(restore(join(acquiring.fiber)), (exit) => {
2907
+ const acquired = acquiring.acquired;
2908
+ if (acquired !== undefined) {
2909
+ return isFailure2(exit) ? release(self, acquired) : void_3;
2910
+ }
2911
+ if (--acquiring.awaiters > 0 || self.state !== acquiring)
2912
+ return void_3;
2913
+ self.state = stateEmpty;
2914
+ return interrupt(acquiring.fiber);
2915
+ });
2916
+ var get2 = (self_) => {
2917
+ const self = self_;
2918
+ return uninterruptibleMask2((restore) => flatMap3(scope2, (scope) => flatMap3(getState(self, restore), (state) => as(addFinalizerExit(scope, () => release(self, state)), state.value))));
2919
+ };
2920
+ var release = (self, state) => {
2921
+ state.refCount--;
2922
+ if (state.refCount > 0) {
2923
+ return void_3;
2924
+ }
2925
+ const idleTimeToLive = self.idleTimeToLive;
2926
+ if (idleTimeToLive === undefined || state.invalidated) {
2927
+ if (self.state === state) {
2928
+ self.state = stateEmpty;
2929
+ }
2930
+ return close(state.scope, void_2);
2931
+ } else if (!isFinite(idleTimeToLive)) {
2932
+ return void_3;
2933
+ }
2934
+ state.fiber = uninterruptibleMask2((restore) => flatMap3(restore(sleep(idleTimeToLive)), () => {
2935
+ if (self.state === state && state.refCount === 0) {
2936
+ self.state = stateEmpty;
2937
+ return ignoreCause(close(state.scope, void_2), {
2938
+ log: "Unhandled",
2939
+ message: "Unhandled error in RcRef finalizer"
2940
+ });
2941
+ }
2942
+ return void_3;
2943
+ })).pipe(ensuring2(sync2(() => {
2944
+ state.fiber = undefined;
2945
+ })), runForkWith(self.context), runIn(self.scope));
2946
+ return void_3;
2947
+ };
2948
+
2949
+ // node_modules/.bun/effect@4.1.2/node_modules/effect/dist/RcRef.js
2950
+ var make10 = make6;
2951
+ var get3 = get2;
2767
2952
 
2768
2953
  // node_modules/.bun/effect@4.1.2/node_modules/effect/dist/Stream.js
2769
- var TypeId8 = "~effect/Stream";
2770
- var isStream = (u) => hasProperty(u, TypeId8);
2954
+ var TypeId9 = "~effect/Stream";
2955
+ var isStream = (u) => hasProperty(u, TypeId9);
2771
2956
  var fromChannel2 = fromChannel3;
2772
2957
  var fromPull2 = (pull) => fromChannel2(fromPull(pull));
2773
2958
  var transformPull2 = (self, f) => fromChannel2(fromTransform((_, scope) => flatMap3(toPullScoped(self.channel, scope), (pull) => f(pull, scope))));
2774
2959
  var toChannel2 = (stream) => stream.channel;
2775
2960
  var callback = (f, options) => fromChannel2(callbackArray(f, options));
2776
2961
  var empty2 = /* @__PURE__ */ fromChannel2(empty);
2777
- var make10 = (...values) => fromArray2(values);
2962
+ var make11 = (...values) => fromArray2(values);
2778
2963
  var suspend = (stream) => {
2779
2964
  const suspended = fromChannel2(suspend4(() => stream().channel));
2780
2965
  suspendedStreams.set(suspended, stream);
@@ -2787,7 +2972,7 @@ var fromArray2 = (array) => isReadonlyArrayNonEmpty(array) ? fromChannel2(succee
2787
2972
  var fromQueue = (queue) => fromChannel2(fromQueueArray(queue));
2788
2973
  var fromPubSub = (pubsub) => fromChannel2(fromPubSubArray(pubsub));
2789
2974
  var fromReadableStream = (options) => fromChannel2(fromReadableStream2(options));
2790
- var unwrap = (effect) => fromChannel2(unwrap2(map8(effect, toChannel2)));
2975
+ var unwrap = (effect) => fromChannel2(unwrap2(map9(effect, toChannel2)));
2791
2976
  var map2 = /* @__PURE__ */ dual(2, (self, f) => suspend(() => {
2792
2977
  let i = 0;
2793
2978
  return fromChannel2(map7(self.channel, map6((o) => f(o, i++))));
@@ -2847,6 +3032,23 @@ var takeUntil = /* @__PURE__ */ dual((args) => isStream(args[0]), (self, predica
2847
3032
  });
2848
3033
  return pump;
2849
3034
  })));
3035
+ var mapAccum = /* @__PURE__ */ dual((args) => isStream(args[0]), (self, initial, f, options) => fromChannel2(mapAccum2(self.channel, initial, (state, arr) => {
3036
+ const acc = empty4();
3037
+ for (let index = 0;index < arr.length; index++) {
3038
+ const [newState, values] = f(state, arr[index]);
3039
+ state = newState;
3040
+ for (let i = 0;i < values.length; i++) {
3041
+ acc.push(values[i]);
3042
+ }
3043
+ }
3044
+ return [state, isArrayNonEmpty(acc) ? of(acc) : emptyArr];
3045
+ }, options?.onHalt ? {
3046
+ onHalt(state) {
3047
+ const arr = options.onHalt(state);
3048
+ return isReadonlyArrayNonEmpty(arr) ? of(arr) : emptyArr;
3049
+ }
3050
+ } : undefined)));
3051
+ var emptyArr = /* @__PURE__ */ empty4();
2850
3052
  var transduce = /* @__PURE__ */ dual(2, (self, sink) => transformPull2(self, (upstream, scope) => sync2(() => {
2851
3053
  let done2;
2852
3054
  let leftover;
@@ -2861,7 +3063,7 @@ var transduce = /* @__PURE__ */ dual(2, (self, sink) => transformPull2(self, (up
2861
3063
  done2 = fail4(error);
2862
3064
  return done();
2863
3065
  }));
2864
- const pull = map8(suspend3(() => sink.transform(upstreamWithLeftover, scope)), ([value, leftover_]) => {
3066
+ const pull = map9(suspend3(() => sink.transform(upstreamWithLeftover, scope)), ([value, leftover_]) => {
2865
3067
  leftover = leftover_;
2866
3068
  return of(value);
2867
3069
  });
@@ -2876,7 +3078,7 @@ var splitLines = (self) => self.channel.pipe(pipeTo(splitLines2()), fromChannel2
2876
3078
  var interruptWhen = /* @__PURE__ */ dual(2, (self, effect) => fromChannel2(interruptWhen2(self.channel, effect)));
2877
3079
  var ensuring = /* @__PURE__ */ dual(2, (self, finalizer) => fromChannel2(ensuring3(self.channel, finalizer)));
2878
3080
  var provideContext = /* @__PURE__ */ dual(2, (self, context) => fromChannel2(provideContext3(self.channel, context)));
2879
- var run = /* @__PURE__ */ dual(2, (self, sink) => scopedWith((scope) => toPullScoped(self.channel, scope).pipe(flatMap3((upstream) => runSink(sink, upstream, scope)), map8(([a]) => a))));
3081
+ var run = /* @__PURE__ */ dual(2, (self, sink) => scopedWith((scope) => toPullScoped(self.channel, scope).pipe(flatMap3((upstream) => runSink(sink, upstream, scope)), map9(([a]) => a))));
2880
3082
  var runSink = (sink, upstream, scope) => restoreUpstreamFailure(sink.transform(upstreamFailureToDefect(upstream), scope));
2881
3083
  var runCollect = (self) => runFold2(self.channel, () => [], (acc, chunk) => {
2882
3084
  for (let i = 0;i < chunk.length; i++) {
@@ -2890,7 +3092,7 @@ var runFold = /* @__PURE__ */ dual(3, (self, initial, f) => runFold2(self.channe
2890
3092
  }
2891
3093
  return acc;
2892
3094
  }));
2893
- var runHead = (self) => map8(runHead2(self.channel), map4(getUnsafe2(0)));
3095
+ var runHead = (self) => map9(runHead2(self.channel), map4(getUnsafe2(0)));
2894
3096
  var runForEach = /* @__PURE__ */ dual(2, (self, f) => runForEach2(self.channel, (arr) => {
2895
3097
  let i = 0;
2896
3098
  return whileLoop({
@@ -2901,7 +3103,7 @@ var runForEach = /* @__PURE__ */ dual(2, (self, f) => runForEach2(self.channel,
2901
3103
  }));
2902
3104
  var runDrain = (self) => runDrain2(self.channel);
2903
3105
  var mkString = (self) => runFold2(self.channel, () => "", (acc, chunk) => acc + chunk.join(""));
2904
- var mkArrayBuffer = (self) => map8(mkUint8Array(self.channel), (bytes) => bytes.buffer);
3106
+ var mkArrayBuffer = (self) => map9(mkUint8Array(self.channel), (bytes) => bytes.buffer);
2905
3107
  var toReadableStreamWith = /* @__PURE__ */ dual((args) => isStream(args[0]), (self, context, options) => {
2906
3108
  let currentResolve = undefined;
2907
3109
  let fiber = undefined;
@@ -2952,14 +3154,14 @@ var toReadableStreamWith = /* @__PURE__ */ dual((args) => isStream(args[0]), (se
2952
3154
  }
2953
3155
  }, options?.strategy);
2954
3156
  });
2955
- var toReadableStreamEffect = /* @__PURE__ */ dual((args) => isStream(args[0]), (self, options) => map8(context(), (context) => toReadableStreamWith(self, context, options)));
3157
+ var toReadableStreamEffect = /* @__PURE__ */ dual((args) => isStream(args[0]), (self, options) => map9(context(), (context) => toReadableStreamWith(self, context, options)));
2956
3158
 
2957
3159
  // node_modules/.bun/effect@4.1.2/node_modules/effect/dist/FileSystem.js
2958
- var TypeId9 = "~effect/FileSystem";
3160
+ var TypeId10 = "~effect/FileSystem";
2959
3161
  var FileSystem = /* @__PURE__ */ Service2("effect/FileSystem");
2960
- var make11 = (impl) => FileSystem.of({
3162
+ var make12 = (impl) => FileSystem.of({
2961
3163
  ...impl,
2962
- [TypeId9]: TypeId9,
3164
+ [TypeId10]: TypeId10,
2963
3165
  glob: make2(impl),
2964
3166
  exists: (path) => pipe(impl.access(path), as(true), catchTag("PlatformError", (e) => e.reason._tag === "NotFound" ? succeed6(false) : fail7(e))),
2965
3167
  readFileString: (path, encoding) => flatMap3(impl.readFile(path), (_) => try_2({
@@ -2975,11 +3177,11 @@ var make11 = (impl) => FileSystem.of({
2975
3177
  const file = yield* impl.open(path, {
2976
3178
  flag: "r"
2977
3179
  });
2978
- const offset = options?.offset === undefined ? undefined : fromInputUnsafe(options.offset);
3180
+ const offset = options?.offset === undefined ? undefined : fromInputUnsafe2(options.offset);
2979
3181
  if (offset) {
2980
3182
  yield* file.seek(offset, "start");
2981
3183
  }
2982
- const bytesToRead = options?.bytesToRead === undefined ? undefined : fromInputUnsafe(options.bytesToRead);
3184
+ const bytesToRead = options?.bytesToRead === undefined ? undefined : fromInputUnsafe2(options.bytesToRead);
2983
3185
  let totalBytesRead = BigInt(0);
2984
3186
  const chunkSize = Number(BigInt(options?.chunkSize ?? 64 * 1024));
2985
3187
  const readChunk = file.readAlloc(chunkSize);
@@ -2999,7 +3201,7 @@ var make11 = (impl) => FileSystem.of({
2999
3201
  sink: (path, options) => pipe(impl.open(path, {
3000
3202
  ...options,
3001
3203
  flag: options?.flag ?? "w"
3002
- }), map8((file) => forEach2((_) => file.writeAll(_))), unwrap3),
3204
+ }), map9((file) => forEach2((_) => file.writeAll(_))), unwrap3),
3003
3205
  writeFileString: (path, data, options) => flatMap3(try_2({
3004
3206
  try: () => new TextEncoder().encode(data),
3005
3207
  catch: (cause) => badArgument({
@@ -3015,11 +3217,11 @@ class WatchBackend extends (/* @__PURE__ */ Service2()("effect/FileSystem/WatchB
3015
3217
  }
3016
3218
 
3017
3219
  // node_modules/.bun/effect@4.1.2/node_modules/effect/dist/Path.js
3018
- var TypeId10 = "~effect/Path";
3220
+ var TypeId11 = "~effect/Path";
3019
3221
  var Path = /* @__PURE__ */ Service2("effect/Path");
3020
- var make12 = (impl) => Path.of({
3222
+ var make13 = (impl) => Path.of({
3021
3223
  ...impl,
3022
- [TypeId10]: TypeId10,
3224
+ [TypeId11]: TypeId11,
3023
3225
  resolveWithin(root, input) {
3024
3226
  if (impl.parse(input).root !== "")
3025
3227
  return none();
@@ -3092,7 +3294,7 @@ function makeProvider(load, mapInput) {
3092
3294
  function makeSource(get, transform) {
3093
3295
  return makeProvider((path) => get(transform(path)), (f) => makeSource(get, (path) => f(transform(path))));
3094
3296
  }
3095
- function make6(get) {
3297
+ function make7(get) {
3096
3298
  return makeSource(get, identityPath);
3097
3299
  }
3098
3300
  function emptyStringAsMissing(value, preserveEmptyStrings) {
@@ -3101,7 +3303,7 @@ function emptyStringAsMissing(value, preserveEmptyStrings) {
3101
3303
  function fromEnvRecord(env, options) {
3102
3304
  const preserveEmptyStrings = options?.preserveEmptyStrings === true;
3103
3305
  const trie = buildEnvTrie(env);
3104
- return make6((path) => succeed6(nodeAtEnv(trie, env, path, preserveEmptyStrings)));
3306
+ return make7((path) => succeed6(nodeAtEnv(trie, env, path, preserveEmptyStrings)));
3105
3307
  }
3106
3308
  function fromEnv(options) {
3107
3309
  const env = options?.env ?? {
@@ -3154,7 +3356,7 @@ function trieNodeAt(root, path) {
3154
3356
  }
3155
3357
 
3156
3358
  // node_modules/.bun/effect@4.1.2/node_modules/effect/dist/Config.js
3157
- var TypeId11 = "~effect/Config";
3359
+ var TypeId12 = "~effect/Config";
3158
3360
  class ConfigError {
3159
3361
  _tag = "ConfigError";
3160
3362
  name = "ConfigError";
@@ -3176,14 +3378,14 @@ var Proto2 = {
3176
3378
  return this.parse(fiber.getRef(ConfigProvider));
3177
3379
  }
3178
3380
  }),
3179
- [TypeId11]: TypeId11,
3381
+ [TypeId12]: TypeId12,
3180
3382
  toJSON() {
3181
3383
  return {
3182
3384
  _id: "Config"
3183
3385
  };
3184
3386
  }
3185
3387
  };
3186
- function make7(evaluator) {
3388
+ function make14(evaluator) {
3187
3389
  const self = Object.create(Proto2);
3188
3390
  self.evaluator = evaluator;
3189
3391
  self.parse = (provider) => flatMapEager(evaluator(provider, []), fromResult);
@@ -3191,14 +3393,14 @@ function make7(evaluator) {
3191
3393
  }
3192
3394
  var evaluateAt = (self, provider, pathPrefix) => self.evaluator(provider, pathPrefix);
3193
3395
  var map3 = /* @__PURE__ */ dual(2, (self, f) => {
3194
- return make7((provider, pathPrefix) => map8(evaluateAt(self, provider, pathPrefix), map5(f)));
3396
+ return make14((provider, pathPrefix) => map9(evaluateAt(self, provider, pathPrefix), map5(f)));
3195
3397
  });
3196
3398
  function all(arg) {
3197
3399
  const configs = globalThis.Array.isArray(arg) ? arg : (Symbol.iterator in arg) ? [...arg] : arg;
3198
- return make7((provider, pathPrefix) => globalThis.Array.isArray(configs) ? mapEager(all3(configs.map((config) => evaluateAt(config, provider, pathPrefix))), all2) : mapEager(all3(map(configs, (config) => evaluateAt(config, provider, pathPrefix))), all2));
3400
+ return make14((provider, pathPrefix) => globalThis.Array.isArray(configs) ? mapEager(all3(configs.map((config) => evaluateAt(config, provider, pathPrefix))), all2) : mapEager(all3(map(configs, (config) => evaluateAt(config, provider, pathPrefix))), all2));
3199
3401
  }
3200
3402
  var withDefault = /* @__PURE__ */ dual(2, (self, defaultValue) => {
3201
- return make7((provider, pathPrefix) => mapEager(evaluateAt(self, provider, pathPrefix), (resolution) => isFailure(resolution) ? succeed(defaultValue) : resolution));
3403
+ return make14((provider, pathPrefix) => mapEager(evaluateAt(self, provider, pathPrefix), (resolution) => isFailure(resolution) ? succeed(defaultValue) : resolution));
3202
3404
  });
3203
3405
  var option = (self) => self.pipe(map3(some), withDefault(none()));
3204
3406
  var isSourceError = (u) => isTagged(u, "SourceError");
@@ -3315,9 +3517,9 @@ var toConfigCursorAST = /* @__PURE__ */ memoize((root) => {
3315
3517
  function schema(codec, path) {
3316
3518
  const codecStringTree = toCodecStringTree(codec);
3317
3519
  const encodedAst = toEncoded(codecStringTree.ast);
3318
- const decodeCursor = decodeUnknownEffect(make16(toConfigCursorAST(codecStringTree.ast)));
3520
+ const decodeCursor = decodeUnknownEffect(make17(toConfigCursorAST(codecStringTree.ast)));
3319
3521
  const localPath = typeof path === "string" ? [path] : path ?? [];
3320
- return make7((provider, pathPrefix) => {
3522
+ return make14((provider, pathPrefix) => {
3321
3523
  const fullPath = [...pathPrefix, ...localPath];
3322
3524
  return loadCursor(provider, fullPath).pipe(flatMapEager((cursor) => decodeCursor(cursor).pipe(mapEager(succeed), catchEager((issue) => {
3323
3525
  const error = new ConfigError(new SchemaError(fullPath.length > 0 ? new Pointer(fullPath, issue) : issue));
@@ -3340,7 +3542,7 @@ var optionalEnv = (name) => gen(function* () {
3340
3542
  }).pipe(orElseSucceed(() => {
3341
3543
  return;
3342
3544
  }));
3343
- var operatorConfigHome = (home) => optionalEnv("XDG_CONFIG_HOME").pipe(map8((configHome) => configHome ?? `${home}/.config`));
3545
+ var operatorConfigHome = (home) => optionalEnv("XDG_CONFIG_HOME").pipe(map9((configHome) => configHome ?? `${home}/.config`));
3344
3546
 
3345
3547
  // packages/agent-runtime/src/temp-directory.ts
3346
3548
  var tempDirectoryScoped = (fs, options) => acquireRelease(fs.makeTempDirectory(options), (directory) => fs.remove(directory, { recursive: true, force: true }).pipe(catch_((error) => logWarning("temp_directory_not_removed", { directory, error: error.message }))));
@@ -3397,7 +3599,7 @@ var srtInheritedEnv2 = [
3397
3599
  "LC_CTYPE",
3398
3600
  "TZ"
3399
3601
  ];
3400
- var inheritedEnvironment2 = (names) => map8(forEach(names, (name) => map8(optionalEnv(name), (value) => value === undefined ? [] : [[name, value]])), (entries) => Object.fromEntries(entries.flat()));
3602
+ var inheritedEnvironment2 = (names) => map9(forEach(names, (name) => map9(optionalEnv(name), (value) => value === undefined ? [] : [[name, value]])), (entries) => Object.fromEntries(entries.flat()));
3401
3603
  var shellName = /^[A-Za-z_][A-Za-z0-9_]*$/;
3402
3604
  var withOnlyEnvironment2 = (names, argv) => [
3403
3605
  "sh",
@@ -3433,4 +3635,4 @@ var srtArgv2 = (srtCommand, settingsFile, argv) => [
3433
3635
  ...argv
3434
3636
  ];
3435
3637
 
3436
- export { map, makeEquivalence, Clock, currentTimeMillis, bytes, join, interrupt, getCurrent, runIn, BadArgument, systemError, badArgument, makeUnsafe2, make8, unbounded, publishUnsafe, make9, bounded, sliding, unbounded2, offer, offerUnsafe, offerAll, fail, failCause, failCauseUnsafe, end, endUnsafe, shutdownUnsafe, take, poll, makeUnsafe3, fromTransform, mapDone, isSink, fromChannel, drain, isStream, fromChannel2, callback, empty2, make10, suspend, fail2, fromQueue, fromPubSub, fromReadableStream, unwrap, map2, tap, drainFork, concat, merge2, filter, catchCause, tapError, mapError, take2, transduce, decodeText, encodeText, splitLines, interruptWhen, ensuring, provideContext, run, runCollect, runFold, runHead, runForEach, runDrain, mkString, mkArrayBuffer, toReadableStreamEffect, FileSystem, make11, FileTypeId, WatchBackend, Path, make12, embeddedFile, extractEmbeddedFile, map3, all, withDefault, option, String2, optionalEnv, operatorConfigHome, tempDirectoryScoped, harnessesUnsupportedInSrt2, harnessesUnsupportedInDocker2, compiled2, pinnedSrtCommand2, pinnedSrtStepCommand2, runSrtCli2, kitmanCacheDirectory2, srtSettings2, srtCacheEnvironment2, srtInheritedEnv2, inheritedEnvironment2, withOnlyEnvironment2, writeSrtSettings2, srtStepArgv2, srtArgv2 };
3638
+ export { map, makeEquivalence, bytes, join, interrupt, getCurrent, BadArgument, systemError, badArgument, makeUnsafe2, make8, unbounded, publishUnsafe, make9, bounded, sliding, unbounded2, offer, offerUnsafe, offerAll, fail, failCause, failCauseUnsafe, end, endUnsafe, shutdownUnsafe, take, poll, makeUnsafe3, fromTransform, mapDone, isSink, fromChannel, drain, make10, get3, isStream, fromChannel2, callback, empty2, make11, suspend, fail2, fromQueue, fromPubSub, fromReadableStream, unwrap, map2, tap, drainFork, concat, merge2, filter, catchCause, tapError, mapError, take2, mapAccum, transduce, decodeText, encodeText, splitLines, interruptWhen, ensuring, provideContext, run, runCollect, runFold, runHead, runForEach, runDrain, mkString, mkArrayBuffer, toReadableStreamEffect, FileSystem, make12, FileTypeId, WatchBackend, Path, make13, embeddedFile, extractEmbeddedFile, map3, all, withDefault, option, String2, optionalEnv, operatorConfigHome, tempDirectoryScoped, harnessesUnsupportedInSrt2, harnessesUnsupportedInDocker2, compiled2, pinnedSrtCommand2, pinnedSrtStepCommand2, runSrtCli2, kitmanCacheDirectory2, srtSettings2, srtCacheEnvironment2, srtInheritedEnv2, inheritedEnvironment2, withOnlyEnvironment2, writeSrtSettings2, srtStepArgv2, srtArgv2 };