@kitman-sh/cli 0.14.9 → 0.15.1

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-cwdrhsvk.js → chunk-0ws25xvg.js} +2 -2
  2. package/dist/{chunk-czmbgsqr.js → chunk-2vxb3q01.js} +656 -39
  3. package/dist/{chunk-mgjer6c7.js → chunk-39ykbhq8.js} +3 -3
  4. package/dist/{chunk-vt8aqeby.js → chunk-3ns4sbfb.js} +1 -1
  5. package/dist/{chunk-c80dvhxf.js → chunk-5hkdgzh4.js} +1 -6
  6. package/dist/{chunk-0x5r7h2g.js → chunk-60fhzjx3.js} +1127 -109
  7. package/dist/{chunk-enmtmq63.js → chunk-69xka6ew.js} +1 -1
  8. package/dist/{chunk-vjt0d9zj.js → chunk-6h70kent.js} +7 -7
  9. package/dist/{chunk-qb9jft1r.js → chunk-8wpg3rph.js} +2 -2
  10. package/dist/{chunk-ftre6ndb.js → chunk-91tmbf95.js} +6 -6
  11. package/dist/chunk-csxxwscf.js +39 -0
  12. package/dist/chunk-d40233pm.js +3080 -0
  13. package/dist/{chunk-jsb61dsk.js → chunk-dv4v0tbn.js} +1815 -117
  14. package/dist/{chunk-wttgq85b.js → chunk-dx792s4w.js} +1396 -41
  15. package/dist/{chunk-dd7wknyk.js → chunk-f36s9s1g.js} +1512 -125
  16. package/dist/{chunk-y9x0yv20.js → chunk-fggwdr03.js} +461 -224
  17. package/dist/{chunk-93xj74qp.js → chunk-fzaecdgv.js} +3 -3
  18. package/dist/{chunk-2r4jy82z.js → chunk-k2wd9r6t.js} +4 -4
  19. package/dist/{chunk-h7qv6nzc.js → chunk-kskb0hkb.js} +7 -7
  20. package/dist/{chunk-6qygqj10.js → chunk-tgt9a3yz.js} +6 -6
  21. package/dist/{chunk-bmwf2ea5.js → chunk-vg78dz3w.js} +85 -26
  22. package/dist/{chunk-axr8avvs.js → chunk-wh4bpc4w.js} +4 -4
  23. package/dist/chunk-xrjt25ns.js +4345 -0
  24. package/dist/{chunk-e3c15bgw.js → chunk-xx711t5r.js} +4 -4
  25. package/dist/{chunk-b2yy07ag.js → chunk-ygx2pda7.js} +7 -7
  26. package/dist/{chunk-cpss81fx.js → chunk-zy4sv70r.js} +13 -5
  27. package/dist/index.js +4 -4
  28. package/package.json +2 -1
  29. package/dist/chunk-3hdjd2c3.js +0 -1192
  30. package/dist/chunk-qvyqfm54.js +0 -526
@@ -4,9 +4,9 @@ import {
4
4
  opaqueTunnelRefusal2,
5
5
  isOpaqueConnectReason2,
6
6
  runSrtStep2
7
- } from "./chunk-cwdrhsvk.js";
8
- import"./chunk-c80dvhxf.js";
9
- import"./chunk-wttgq85b.js";
7
+ } from "./chunk-0ws25xvg.js";
8
+ import"./chunk-5hkdgzh4.js";
9
+ import"./chunk-dx792s4w.js";
10
10
  export {
11
11
  isOpaqueConnectReason2 as isOpaqueConnectReason,
12
12
  opaqueTunnelRefusal2 as opaqueTunnelRefusal,
@@ -19,10 +19,10 @@ import {
19
19
  never,
20
20
  flatMap3,
21
21
  andThen2,
22
- map8,
22
+ map9,
23
23
  raceFirst,
24
24
  scoped
25
- } from "./chunk-wttgq85b.js";
25
+ } from "./chunk-dx792s4w.js";
26
26
  import {
27
27
  unwrap,
28
28
  drainFork,
@@ -31,7 +31,7 @@ import {
31
31
  runCollect,
32
32
  runDrain,
33
33
  mkString
34
- } from "./chunk-bmwf2ea5.js";
34
+ } from "./chunk-vg78dz3w.js";
35
35
 
36
36
  // node_modules/.bun/effect@4.1.2/node_modules/effect/dist/internal/redacted.js
37
37
  var redactedRegistry = /* @__PURE__ */ new WeakMap;
@@ -102,7 +102,7 @@ var makeHandle = (params) => Object.setPrototypeOf({
102
102
  ...params
103
103
  }, HandleProto);
104
104
  var make2 = (spawn) => {
105
- const streamString = (command, options) => spawn(command).pipe(map8((handle) => decodeText(options?.includeStderr === true ? handle.all : drainFork(handle.stdout, handle.stderr))), unwrap);
105
+ const streamString = (command, options) => spawn(command).pipe(map9((handle) => decodeText(options?.includeStderr === true ? handle.all : drainFork(handle.stdout, handle.stderr))), unwrap);
106
106
  const streamLines = (command, options) => splitLines(streamString(command, options));
107
107
  return ChildProcessSpawner.of({
108
108
  spawn,
@@ -12,7 +12,7 @@ import {
12
12
  gen,
13
13
  fail7,
14
14
  flatMap3,
15
- map8,
15
+ map9,
16
16
  mapError2,
17
17
  orDie,
18
18
  provide3,
@@ -24,11 +24,11 @@ import {
24
24
  Record,
25
25
  Int,
26
26
  fromJsonString
27
- } from "./chunk-wttgq85b.js";
27
+ } from "./chunk-dx792s4w.js";
28
28
  import {
29
29
  withDefault,
30
30
  String2
31
- } from "./chunk-bmwf2ea5.js";
31
+ } from "./chunk-vg78dz3w.js";
32
32
  import {
33
33
  newerKitmanVersion,
34
34
  digestSha256,
@@ -39,7 +39,7 @@ import {
39
39
  get2,
40
40
  layer4,
41
41
  KitDigest
42
- } from "./chunk-dd7wknyk.js";
42
+ } from "./chunk-f36s9s1g.js";
43
43
 
44
44
  // packages/core/src/npm-registry.ts
45
45
  var KitManifest = Struct({
@@ -73,7 +73,7 @@ var PackageJson = Struct({ kitman: optionalKey(Unknown) });
73
73
  var decodePackageJson = decodeUnknownOption(fromJsonString(PackageJson));
74
74
  var decodeManifest = decodeUnknownOption(KitManifest);
75
75
  var decodeJson = decodeUnknownOption(fromJsonString(Unknown));
76
- var gunzip = (bytes) => tryPromise(() => new Response(new Blob([new Uint8Array(bytes)]).stream().pipeThrough(new DecompressionStream("gzip"))).arrayBuffer()).pipe(map8((buffer) => new Uint8Array(buffer)));
76
+ var gunzip = (bytes) => tryPromise(() => new Response(new Blob([new Uint8Array(bytes)]).stream().pipeThrough(new DecompressionStream("gzip"))).arrayBuffer()).pipe(map9((buffer) => new Uint8Array(buffer)));
77
77
  var text = (bytes) => new TextDecoder().decode(bytes).replace(/\0.*$/su, "");
78
78
  var untar = (tar) => {
79
79
  const files = new Map;
@@ -103,7 +103,7 @@ var untar = (tar) => {
103
103
  var registryUrl = String2("NPM_CONFIG_REGISTRY").pipe(withDefault("https://registry.npmjs.org"));
104
104
  var newerOf = (latest, next) => latest === undefined || next !== undefined && newerKitmanVersion(next, latest) ? next : latest;
105
105
  var npmRegistryAt = (url = registryUrl) => {
106
- const base = (isString(url) ? succeed6(url) : orDie(url)).pipe(map8((value) => value.replace(/\/+$/u, "")));
106
+ const base = (isString(url) ? succeed6(url) : orDie(url)).pipe(map9((value) => value.replace(/\/+$/u, "")));
107
107
  const unreachable = (name, version) => (error) => new NpmRegistryError({
108
108
  kind: "unreachable",
109
109
  message: `npm did not answer for ${name}@${version}: ${error.message}; try again`
@@ -131,7 +131,7 @@ var npmRegistryAt = (url = registryUrl) => {
131
131
  const dist = found.versions[version]?.dist;
132
132
  if (dist === undefined)
133
133
  return yield* new NpmRegistryError({ kind: "not_found", message: `npm has no ${name}@${wanted}` });
134
- const tarball = yield* get2(dist.tarball).pipe(flatMap3(filterStatusOk), flatMap3((response) => response.arrayBuffer), map8((buffer) => new Uint8Array(buffer)), mapError2(unreachable(name, version)), provide3(layer4));
134
+ const tarball = yield* get2(dist.tarball).pipe(flatMap3(filterStatusOk), flatMap3((response) => response.arrayBuffer), map9((buffer) => new Uint8Array(buffer)), mapError2(unreachable(name, version)), provide3(layer4));
135
135
  if (!tarballMatches(tarball, dist))
136
136
  return yield* new NpmRegistryError({
137
137
  kind: "integrity",
@@ -4,12 +4,12 @@ import {
4
4
  runnerRpcUrl2,
5
5
  makeRunnerRpcClient2,
6
6
  makeProgramRpcClient2
7
- } from "./chunk-cpss81fx.js";
8
- import"./chunk-ftre6ndb.js";
9
- import"./chunk-dd7wknyk.js";
10
- import"./chunk-c80dvhxf.js";
11
- import"./chunk-bmwf2ea5.js";
12
- import"./chunk-wttgq85b.js";
7
+ } from "./chunk-zy4sv70r.js";
8
+ import"./chunk-91tmbf95.js";
9
+ import"./chunk-f36s9s1g.js";
10
+ import"./chunk-5hkdgzh4.js";
11
+ import"./chunk-vg78dz3w.js";
12
+ import"./chunk-dx792s4w.js";
13
13
  export {
14
14
  makeProgramRpcClient2 as makeProgramRpcClient,
15
15
  makeRunnerRpcClient2 as makeRunnerRpcClient,
@@ -47,11 +47,13 @@ import {
47
47
  map5,
48
48
  all2,
49
49
  fromIterable,
50
+ isArray,
50
51
  isArrayNonEmpty,
51
52
  isReadonlyArrayNonEmpty,
52
53
  isCanonicalArrayIndex,
53
54
  getUnsafe2,
54
55
  sort,
56
+ empty4,
55
57
  of,
56
58
  map6,
57
59
  Error2,
@@ -141,7 +143,7 @@ import {
141
143
  tap2,
142
144
  option2,
143
145
  exit,
144
- map8,
146
+ map9,
145
147
  as,
146
148
  asSome2,
147
149
  asVoid,
@@ -201,7 +203,7 @@ import {
201
203
  String4,
202
204
  toCodecStringTree,
203
205
  encodeUnknownJsonStringSync
204
- } from "./chunk-wttgq85b.js";
206
+ } from "./chunk-dx792s4w.js";
205
207
 
206
208
  // node_modules/.bun/effect@4.1.2/node_modules/effect/dist/Iterable.js
207
209
  var headUnsafe = (self) => {
@@ -949,7 +951,7 @@ var walk = /* @__PURE__ */ fnUntraced(function* (fs, compiled, options) {
949
951
  const isUnlisted = (value) => value === "." || value === ".." || isRoot(value);
950
952
  const probe = (parent, name, named) => {
951
953
  const path = toFsPath(join2(parent, name));
952
- 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 : {
953
955
  name,
954
956
  type
955
957
  }));
@@ -1004,7 +1006,7 @@ var walk = /* @__PURE__ */ fnUntraced(function* (fs, compiled, options) {
1004
1006
  return child(type === "Directory", false);
1005
1007
  }
1006
1008
  const path = toFsPath(relative);
1007
- 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) => {
1008
1010
  const resolved = child(isDirectory, type === "SymbolicLink");
1009
1011
  if (type === "SymbolicLink" || resolved?.next === undefined || result.globstar.size === 0) {
1010
1012
  return succeed6(resolved);
@@ -1030,7 +1032,7 @@ var walk = /* @__PURE__ */ fnUntraced(function* (fs, compiled, options) {
1030
1032
  const child = visit(entry, relative, states, excluded);
1031
1033
  if (isEffect(child)) {
1032
1034
  const index = children.push(undefined) - 1;
1033
- pending.push(map8(child, (child) => {
1035
+ pending.push(map9(child, (child) => {
1034
1036
  children[index] = child;
1035
1037
  }));
1036
1038
  } else {
@@ -2256,7 +2258,7 @@ var asyncQueue = (scope, f, options) => make9({
2256
2258
  }).pipe(tap2((queue) => addFinalizer(scope, shutdown(queue))), tap2((queue) => provide(f(queue), scope).pipe(catchCause2((cause) => failCause(queue, cause)), forkIn(scope, {
2257
2259
  startImmediately: true
2258
2260
  }))));
2259
- 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));
2260
2262
  var suspend4 = (evaluate) => fromTransform((upstream, scope) => suspend3(() => toTransform(evaluate())(upstream, scope)));
2261
2263
  var fromIterator = (iterator) => fromPull(sync2(() => {
2262
2264
  const iter = iterator();
@@ -2282,7 +2284,7 @@ var fromEffect = (effect) => fromPull(sync2(() => {
2282
2284
  var fromEffectDrain = (effect) => fromPull(flatMap3(effect, () => done()));
2283
2285
  var fromQueueArray = (queue) => fromPull(succeed6(takeAll3(queue)));
2284
2286
  var fromSubscriptionArray = (subscription) => fromPull(succeed6(onInterrupt(takeAll2(subscription), () => done())));
2285
- var fromPubSubArray = (pubsub) => unwrap2(map8(subscribe(pubsub), fromSubscriptionArray));
2287
+ var fromPubSubArray = (pubsub) => unwrap2(map9(subscribe(pubsub), fromSubscriptionArray));
2286
2288
  var fromReadableStream2 = (options) => fromTransform((_, scope) => readableStreamToPullUnsafe({
2287
2289
  scope,
2288
2290
  readable: options.evaluate(),
@@ -2314,7 +2316,7 @@ var readableStreamToPullUnsafe = (options) => {
2314
2316
  };
2315
2317
  var map7 = /* @__PURE__ */ dual(2, (self, f) => transformPull(self, (pull) => sync2(() => {
2316
2318
  let i = 0;
2317
- return map8(pull, (o) => f(o, i++));
2319
+ return map9(pull, (o) => f(o, i++));
2318
2320
  })));
2319
2321
  var mapDone = /* @__PURE__ */ dual(2, (self, f) => mapDoneEffect(self, (o) => succeed6(f(o))));
2320
2322
  var mapDoneEffect = /* @__PURE__ */ dual(2, (self, f) => transformPull(self, (pull) => succeed6(catchDone(pull, (done2) => flatMap3(f(done2), done)))));
@@ -2322,7 +2324,7 @@ var concurrencyIsSequential = (concurrency) => concurrency === undefined || conc
2322
2324
  var mapEffect = /* @__PURE__ */ dual((args) => isChannel(args[0]), (self, f, options) => concurrencyIsSequential(options?.concurrency) ? mapEffectSequential(self, f) : mapEffectConcurrent(self, f, options));
2323
2325
  var mapEffectSequential = (self, f) => fromTransform((upstream, scope) => {
2324
2326
  let i = 0;
2325
- return map8(toTransform(self)(upstream, scope), flatMap3((o) => f(o, i++)));
2327
+ return map9(toTransform(self)(upstream, scope), flatMap3((o) => f(o, i++)));
2326
2328
  });
2327
2329
  var mapEffectConcurrent = (self, f, options) => fromTransformBracket(fnUntraced(function* (upstream, scope, forkedScope) {
2328
2330
  let i = 0;
@@ -2374,7 +2376,7 @@ var mapEffectConcurrent = (self, f, options) => fromTransformBracket(fnUntraced(
2374
2376
  return take(queue);
2375
2377
  }));
2376
2378
  var flatMap = /* @__PURE__ */ dual((args) => isChannel(args[0]), (self, f, options) => concurrencyIsSequential(options?.concurrency) ? flatMapSequential(self, f) : flatMapConcurrent(self, f, options));
2377
- 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) => {
2378
2380
  let childPull;
2379
2381
  let childScope;
2380
2382
  const makePull = flatMap3(pull, (value) => {
@@ -2433,9 +2435,49 @@ var filterArray = /* @__PURE__ */ dual(2, (self, predicate) => transformPull(sel
2433
2435
  }
2434
2436
  return isReadonlyArrayNonEmpty(passes) ? succeed6(passes) : flatMap3(pull, loop);
2435
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
+ })));
2436
2478
  var catchCause3 = /* @__PURE__ */ dual(2, (self, f) => fromTransform((upstream, scope) => {
2437
2479
  let forkedScope = forkUnsafe(scope);
2438
- return map8(toTransform(self)(upstream, forkedScope), (pull) => {
2480
+ return map9(toTransform(self)(upstream, forkedScope), (pull) => {
2439
2481
  let currentPull = pull.pipe(catchCause2((cause) => {
2440
2482
  if (isDoneCause(cause)) {
2441
2483
  return failCause3(cause);
@@ -2632,7 +2674,7 @@ var decodeText2 = (encoding, options) => fromTransform((upstream, _scope) => syn
2632
2674
  const streamOptions = {
2633
2675
  stream: true
2634
2676
  };
2635
- 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) => {
2636
2678
  pull = done(leftover);
2637
2679
  const last = decoder.decode();
2638
2680
  return last.length > 0 ? succeed6(of(last)) : pull;
@@ -2663,14 +2705,14 @@ var runWith = (self, f, onHalt) => suspend3(() => {
2663
2705
  const makePull = toTransform(self)(done(), scope);
2664
2706
  return catchDone(flatMap3(makePull, f), onHalt ? onHalt : succeed6).pipe(onExit((exit) => close(scope, exit)));
2665
2707
  });
2666
- 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))));
2667
2709
  var runDrain2 = (self) => runWith(self, (pull) => forever(pull, {
2668
2710
  disableYield: true
2669
2711
  }));
2670
2712
  var runForEach2 = /* @__PURE__ */ dual(2, (self, f) => runWith(self, (pull) => forever(flatMap3(pull, f), {
2671
2713
  disableYield: true
2672
2714
  })));
2673
- var mkUint8Array = (self) => map8(runFold2(self, () => ({
2715
+ var mkUint8Array = (self) => map9(runFold2(self, () => ({
2674
2716
  bytes: 0,
2675
2717
  arrays: []
2676
2718
  }), (acc, chunk) => {
@@ -2764,7 +2806,7 @@ var forEach2 = (f) => forEachArray(forEach((_) => f(_), {
2764
2806
  var forEachArray = (f) => fromTransform2((upstream) => upstream.pipe(flatMap3(f), forever({
2765
2807
  disableYield: true
2766
2808
  }), catchDone(() => endVoid)));
2767
- var unwrap3 = (effect) => fromChannel(unwrap2(map8(effect, toChannel)));
2809
+ var unwrap3 = (effect) => fromChannel(unwrap2(map9(effect, toChannel)));
2768
2810
 
2769
2811
  // node_modules/.bun/effect@4.1.2/node_modules/effect/dist/internal/rcRef.js
2770
2812
  var TypeId8 = "~effect/RcRef";
@@ -2930,7 +2972,7 @@ var fromArray2 = (array) => isReadonlyArrayNonEmpty(array) ? fromChannel2(succee
2930
2972
  var fromQueue = (queue) => fromChannel2(fromQueueArray(queue));
2931
2973
  var fromPubSub = (pubsub) => fromChannel2(fromPubSubArray(pubsub));
2932
2974
  var fromReadableStream = (options) => fromChannel2(fromReadableStream2(options));
2933
- var unwrap = (effect) => fromChannel2(unwrap2(map8(effect, toChannel2)));
2975
+ var unwrap = (effect) => fromChannel2(unwrap2(map9(effect, toChannel2)));
2934
2976
  var map2 = /* @__PURE__ */ dual(2, (self, f) => suspend(() => {
2935
2977
  let i = 0;
2936
2978
  return fromChannel2(map7(self.channel, map6((o) => f(o, i++))));
@@ -2990,6 +3032,23 @@ var takeUntil = /* @__PURE__ */ dual((args) => isStream(args[0]), (self, predica
2990
3032
  });
2991
3033
  return pump;
2992
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();
2993
3052
  var transduce = /* @__PURE__ */ dual(2, (self, sink) => transformPull2(self, (upstream, scope) => sync2(() => {
2994
3053
  let done2;
2995
3054
  let leftover;
@@ -3004,7 +3063,7 @@ var transduce = /* @__PURE__ */ dual(2, (self, sink) => transformPull2(self, (up
3004
3063
  done2 = fail4(error);
3005
3064
  return done();
3006
3065
  }));
3007
- const pull = map8(suspend3(() => sink.transform(upstreamWithLeftover, scope)), ([value, leftover_]) => {
3066
+ const pull = map9(suspend3(() => sink.transform(upstreamWithLeftover, scope)), ([value, leftover_]) => {
3008
3067
  leftover = leftover_;
3009
3068
  return of(value);
3010
3069
  });
@@ -3019,7 +3078,7 @@ var splitLines = (self) => self.channel.pipe(pipeTo(splitLines2()), fromChannel2
3019
3078
  var interruptWhen = /* @__PURE__ */ dual(2, (self, effect) => fromChannel2(interruptWhen2(self.channel, effect)));
3020
3079
  var ensuring = /* @__PURE__ */ dual(2, (self, finalizer) => fromChannel2(ensuring3(self.channel, finalizer)));
3021
3080
  var provideContext = /* @__PURE__ */ dual(2, (self, context) => fromChannel2(provideContext3(self.channel, context)));
3022
- 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))));
3023
3082
  var runSink = (sink, upstream, scope) => restoreUpstreamFailure(sink.transform(upstreamFailureToDefect(upstream), scope));
3024
3083
  var runCollect = (self) => runFold2(self.channel, () => [], (acc, chunk) => {
3025
3084
  for (let i = 0;i < chunk.length; i++) {
@@ -3033,7 +3092,7 @@ var runFold = /* @__PURE__ */ dual(3, (self, initial, f) => runFold2(self.channe
3033
3092
  }
3034
3093
  return acc;
3035
3094
  }));
3036
- var runHead = (self) => map8(runHead2(self.channel), map4(getUnsafe2(0)));
3095
+ var runHead = (self) => map9(runHead2(self.channel), map4(getUnsafe2(0)));
3037
3096
  var runForEach = /* @__PURE__ */ dual(2, (self, f) => runForEach2(self.channel, (arr) => {
3038
3097
  let i = 0;
3039
3098
  return whileLoop({
@@ -3044,7 +3103,7 @@ var runForEach = /* @__PURE__ */ dual(2, (self, f) => runForEach2(self.channel,
3044
3103
  }));
3045
3104
  var runDrain = (self) => runDrain2(self.channel);
3046
3105
  var mkString = (self) => runFold2(self.channel, () => "", (acc, chunk) => acc + chunk.join(""));
3047
- var mkArrayBuffer = (self) => map8(mkUint8Array(self.channel), (bytes) => bytes.buffer);
3106
+ var mkArrayBuffer = (self) => map9(mkUint8Array(self.channel), (bytes) => bytes.buffer);
3048
3107
  var toReadableStreamWith = /* @__PURE__ */ dual((args) => isStream(args[0]), (self, context, options) => {
3049
3108
  let currentResolve = undefined;
3050
3109
  let fiber = undefined;
@@ -3095,7 +3154,7 @@ var toReadableStreamWith = /* @__PURE__ */ dual((args) => isStream(args[0]), (se
3095
3154
  }
3096
3155
  }, options?.strategy);
3097
3156
  });
3098
- 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)));
3099
3158
 
3100
3159
  // node_modules/.bun/effect@4.1.2/node_modules/effect/dist/FileSystem.js
3101
3160
  var TypeId10 = "~effect/FileSystem";
@@ -3142,7 +3201,7 @@ var make12 = (impl) => FileSystem.of({
3142
3201
  sink: (path, options) => pipe(impl.open(path, {
3143
3202
  ...options,
3144
3203
  flag: options?.flag ?? "w"
3145
- }), map8((file) => forEach2((_) => file.writeAll(_))), unwrap3),
3204
+ }), map9((file) => forEach2((_) => file.writeAll(_))), unwrap3),
3146
3205
  writeFileString: (path, data, options) => flatMap3(try_2({
3147
3206
  try: () => new TextEncoder().encode(data),
3148
3207
  catch: (cause) => badArgument({
@@ -3334,7 +3393,7 @@ function make14(evaluator) {
3334
3393
  }
3335
3394
  var evaluateAt = (self, provider, pathPrefix) => self.evaluator(provider, pathPrefix);
3336
3395
  var map3 = /* @__PURE__ */ dual(2, (self, f) => {
3337
- return make14((provider, pathPrefix) => map8(evaluateAt(self, provider, pathPrefix), map5(f)));
3396
+ return make14((provider, pathPrefix) => map9(evaluateAt(self, provider, pathPrefix), map5(f)));
3338
3397
  });
3339
3398
  function all(arg) {
3340
3399
  const configs = globalThis.Array.isArray(arg) ? arg : (Symbol.iterator in arg) ? [...arg] : arg;
@@ -3483,7 +3542,7 @@ var optionalEnv = (name) => gen(function* () {
3483
3542
  }).pipe(orElseSucceed(() => {
3484
3543
  return;
3485
3544
  }));
3486
- 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`));
3487
3546
 
3488
3547
  // packages/agent-runtime/src/temp-directory.ts
3489
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 }))));
@@ -3540,7 +3599,7 @@ var srtInheritedEnv2 = [
3540
3599
  "LC_CTYPE",
3541
3600
  "TZ"
3542
3601
  ];
3543
- 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()));
3544
3603
  var shellName = /^[A-Za-z_][A-Za-z0-9_]*$/;
3545
3604
  var withOnlyEnvironment2 = (names, argv) => [
3546
3605
  "sh",
@@ -3576,4 +3635,4 @@ var srtArgv2 = (srtCommand, settingsFile, argv) => [
3576
3635
  ...argv
3577
3636
  ];
3578
3637
 
3579
- 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, 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 };
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 };
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import"./chunk-2r4jy82z.js";
2
+ import"./chunk-k2wd9r6t.js";
3
3
  import {
4
4
  HERDR_CORE_GENERATION2,
5
5
  HERDR_CORE_INSTALL_COMMAND2,
@@ -12,9 +12,9 @@ import {
12
12
  herdrCoreLayer2,
13
13
  herdrCoreTransportLayer2,
14
14
  updateHerdrCore2
15
- } from "./chunk-dd7wknyk.js";
16
- import"./chunk-bmwf2ea5.js";
17
- import"./chunk-wttgq85b.js";
15
+ } from "./chunk-f36s9s1g.js";
16
+ import"./chunk-vg78dz3w.js";
17
+ import"./chunk-dx792s4w.js";
18
18
  export {
19
19
  HERDR_CORE_GENERATION2 as HERDR_CORE_GENERATION,
20
20
  HERDR_CORE_INSTALL_COMMAND2 as HERDR_CORE_INSTALL_COMMAND,