@kitman-sh/cli 0.42.2 → 0.43.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 (28) hide show
  1. package/dist/{chunk-q6qn9c47.js → chunk-0qfaf9h3.js} +111 -266
  2. package/dist/{chunk-gqgbah9q.js → chunk-27e7m975.js} +6 -6
  3. package/dist/{chunk-3gax0xq6.js → chunk-6x08g7m6.js} +2 -2
  4. package/dist/{chunk-sbk4evb4.js → chunk-7ygg19wj.js} +3 -3
  5. package/dist/{chunk-wre79w3z.js → chunk-8b02x7vv.js} +1 -1
  6. package/dist/{chunk-re7cr0kk.js → chunk-91tvnb8f.js} +8 -8
  7. package/dist/{chunk-tpmyf5mk.js → chunk-98azvx6g.js} +1 -1
  8. package/dist/{chunk-17715h5w.js → chunk-b2btevxm.js} +34 -34
  9. package/dist/{chunk-y6mjtq6n.js → chunk-bbq7q5r6.js} +8 -8
  10. package/dist/{chunk-b4td2pgc.js → chunk-bqbfyqx6.js} +61 -61
  11. package/dist/{chunk-33zd0yt4.js → chunk-bqebfc06.js} +17 -17
  12. package/dist/{chunk-2bt9e1fj.js → chunk-cnryphhh.js} +5 -5
  13. package/dist/{chunk-hfy8nmat.js → chunk-d4vhrja4.js} +3 -3
  14. package/dist/{chunk-qndcafax.js → chunk-ea29sbaq.js} +1 -1
  15. package/dist/{chunk-sasjamqz.js → chunk-etrfc5cn.js} +178 -29
  16. package/dist/{chunk-vjkgbsry.js → chunk-fbddgx6q.js} +4 -4
  17. package/dist/{chunk-t8y2y7ha.js → chunk-fekh3jwz.js} +1 -1
  18. package/dist/{chunk-r5b36fgg.js → chunk-hgvft7vy.js} +4 -4
  19. package/dist/{chunk-rc4wvjf2.js → chunk-jq5h43a4.js} +43 -24
  20. package/dist/{chunk-1w517sym.js → chunk-jvwjreb0.js} +7 -7
  21. package/dist/{chunk-drw8m50d.js → chunk-ns26fbmk.js} +2 -2
  22. package/dist/{chunk-hg9y4ykj.js → chunk-qqc567gx.js} +4 -4
  23. package/dist/{chunk-c3ms91a6.js → chunk-qxpwkb5f.js} +18 -18
  24. package/dist/{chunk-1gr39h4v.js → chunk-rbt72xjw.js} +2 -2
  25. package/dist/{chunk-mc0xxx2z.js → chunk-wv8kt4rb.js} +6 -6
  26. package/dist/{chunk-dhe1fwhw.js → chunk-wy6gmtd9.js} +2 -2
  27. package/dist/index.js +4 -4
  28. package/package.json +1 -1
@@ -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,
@@ -85,6 +88,7 @@ import {
85
88
  fail4,
86
89
  interrupt2,
87
90
  void_2,
91
+ isSuccess2,
88
92
  isFailure2,
89
93
  asVoidAll,
90
94
  makeUnsafe5,
@@ -156,12 +160,14 @@ import {
156
160
  tapError2,
157
161
  ignoreCause,
158
162
  orElseSucceed,
163
+ sleep,
159
164
  raceFirst,
160
165
  when,
161
166
  matchCauseEffect,
162
167
  context,
163
168
  contextWith,
164
169
  provideContext2,
170
+ scope2,
165
171
  scoped,
166
172
  scopedWith,
167
173
  acquireRelease,
@@ -172,6 +178,7 @@ import {
172
178
  interrupt3,
173
179
  onInterrupt,
174
180
  uninterruptible,
181
+ uninterruptibleMask2,
175
182
  forever,
176
183
  forkChild,
177
184
  forkIn,
@@ -194,11 +201,11 @@ import {
194
201
  toEncoded,
195
202
  decodeUnknownEffect,
196
203
  SchemaError,
197
- make16,
204
+ make17,
198
205
  String4,
199
206
  toCodecStringTree,
200
207
  encodeUnknownJsonStringSync
201
- } from "./chunk-b4td2pgc.js";
208
+ } from "./chunk-bqbfyqx6.js";
202
209
 
203
210
  // node_modules/.bun/effect@4.1.2/node_modules/effect/dist/Iterable.js
204
211
  var headUnsafe = (self) => {
@@ -371,7 +378,7 @@ var fromStringUnsafe = (input) => {
371
378
  return invalid(`${JSON.stringify(input)} does not represent an integral number of bytes`);
372
379
  return make(value);
373
380
  };
374
- var fromInputUnsafe = (input) => {
381
+ var fromInputUnsafe2 = (input) => {
375
382
  switch (typeof input) {
376
383
  case "bigint":
377
384
  if (input < bigint0)
@@ -384,7 +391,7 @@ var fromInputUnsafe = (input) => {
384
391
  }
385
392
  return invalid(`unsupported input ${input}`);
386
393
  };
387
- var bytes = (value) => typeof value === "bigint" ? fromInputUnsafe(value) : fromNumber(value);
394
+ var bytes = (value) => typeof value === "bigint" ? fromInputUnsafe2(value) : fromNumber(value);
388
395
 
389
396
  // node_modules/.bun/effect@4.1.2/node_modules/effect/dist/Fiber.js
390
397
  var join = fiberJoin;
@@ -1310,7 +1317,7 @@ var publishUnsafe = /* @__PURE__ */ dual(2, (self, value) => {
1310
1317
  return false;
1311
1318
  });
1312
1319
  var subscribe = (self) => uninterruptible(contextWith((services) => {
1313
- const localScope = get3(services, Scope);
1320
+ const localScope = get4(services, Scope);
1314
1321
  const scope = forkUnsafe(self.scope);
1315
1322
  const subscription = makeSubscriptionUnsafe(self.pubsub, self.subscribers, self.strategy, self.ended);
1316
1323
  return addFinalizer(scope, unsubscribe(subscription)).pipe(andThen2(addFinalizerExit(localScope, (exit) => close(scope, exit))), as(subscription));
@@ -2753,7 +2760,7 @@ var runFold2 = /* @__PURE__ */ dual(3, (self, initial, f) => suspend3(() => {
2753
2760
  var toPull2 = /* @__PURE__ */ fnUntraced(function* (self) {
2754
2761
  const semaphore = makeUnsafe3(1);
2755
2762
  const context2 = yield* context();
2756
- const scope = get3(context2, Scope);
2763
+ const scope = get4(context2, Scope);
2757
2764
  const pull = yield* toTransform(self)(done(), scope);
2758
2765
  return pull.pipe(provideContext2(context2), semaphore.withPermits(1));
2759
2766
  }, /* @__PURE__ */ catchCause2((cause) => succeed6(failCause3(cause))));
@@ -2814,16 +2821,158 @@ var forEachArray = (f) => fromTransform2((upstream) => upstream.pipe(flatMap3(f)
2814
2821
  }), catchDone(() => endVoid)));
2815
2822
  var unwrap3 = (effect) => fromChannel(unwrap2(map9(effect, toChannel)));
2816
2823
 
2824
+ // node_modules/.bun/effect@4.1.2/node_modules/effect/dist/internal/rcRef.js
2825
+ var TypeId8 = "~effect/RcRef";
2826
+ var stateEmpty = {
2827
+ _tag: "Empty"
2828
+ };
2829
+ var stateClosed = {
2830
+ _tag: "Closed"
2831
+ };
2832
+ var variance2 = {
2833
+ _A: identity,
2834
+ _E: identity
2835
+ };
2836
+
2837
+ class RcRefImpl {
2838
+ [TypeId8] = variance2;
2839
+ pipe() {
2840
+ return pipeArguments(this, arguments);
2841
+ }
2842
+ state = stateEmpty;
2843
+ acquire;
2844
+ context;
2845
+ scope;
2846
+ idleTimeToLive;
2847
+ constructor(acquire, context, scope, idleTimeToLive) {
2848
+ this.acquire = acquire;
2849
+ this.context = context;
2850
+ this.scope = scope;
2851
+ this.idleTimeToLive = idleTimeToLive;
2852
+ }
2853
+ }
2854
+ var make6 = (options) => withFiber2((fiber) => {
2855
+ const context = fiber.context;
2856
+ const scope = get4(context, Scope);
2857
+ const ref = new RcRefImpl(options.acquire, context, scope, options.idleTimeToLive !== undefined ? fromInputUnsafe(options.idleTimeToLive) : undefined);
2858
+ return as(addFinalizerExit(scope, () => {
2859
+ const state = ref.state;
2860
+ ref.state = stateClosed;
2861
+ if (state._tag === "Acquired")
2862
+ return close(state.scope, void_2);
2863
+ if (state._tag === "Acquiring")
2864
+ return interrupt(state.fiber);
2865
+ return void_3;
2866
+ }), ref);
2867
+ });
2868
+ var getState = (self, restore) => {
2869
+ switch (self.state._tag) {
2870
+ case "Closed": {
2871
+ return interrupt3;
2872
+ }
2873
+ case "Acquired": {
2874
+ const state = self.state;
2875
+ state.refCount++;
2876
+ return state.fiber ? as(interrupt(state.fiber), state) : succeed6(state);
2877
+ }
2878
+ case "Acquiring": {
2879
+ const state = self.state;
2880
+ state.awaiters++;
2881
+ return awaitAcquiring(self, state, restore);
2882
+ }
2883
+ case "Empty": {
2884
+ const acquiring = {
2885
+ _tag: "Acquiring",
2886
+ fiber: undefined,
2887
+ awaiters: 1,
2888
+ acquired: undefined
2889
+ };
2890
+ self.state = acquiring;
2891
+ const scope = makeUnsafe6();
2892
+ const acquire = provideContext2(self.acquire, add(self.context, Scope, scope)).pipe(flatMap3((value) => {
2893
+ if (self.state !== acquiring) {
2894
+ return interrupt3;
2895
+ }
2896
+ const state = {
2897
+ _tag: "Acquired",
2898
+ value,
2899
+ scope,
2900
+ fiber: undefined,
2901
+ refCount: acquiring.awaiters,
2902
+ invalidated: false
2903
+ };
2904
+ self.state = state;
2905
+ acquiring.acquired = state;
2906
+ return succeed6(state);
2907
+ }), onExit((exit) => {
2908
+ if (isSuccess2(exit))
2909
+ return void_3;
2910
+ if (self.state === acquiring)
2911
+ self.state = stateEmpty;
2912
+ return close(scope, exit);
2913
+ }));
2914
+ acquiring.fiber = runForkWith(getCurrent().context)(acquire);
2915
+ return awaitAcquiring(self, acquiring, restore);
2916
+ }
2917
+ }
2918
+ };
2919
+ var awaitAcquiring = (self, acquiring, restore) => onExit(restore(join(acquiring.fiber)), (exit) => {
2920
+ const acquired = acquiring.acquired;
2921
+ if (acquired !== undefined) {
2922
+ return isFailure2(exit) ? release(self, acquired) : void_3;
2923
+ }
2924
+ if (--acquiring.awaiters > 0 || self.state !== acquiring)
2925
+ return void_3;
2926
+ self.state = stateEmpty;
2927
+ return interrupt(acquiring.fiber);
2928
+ });
2929
+ var get2 = (self_) => {
2930
+ const self = self_;
2931
+ return uninterruptibleMask2((restore) => flatMap3(scope2, (scope) => flatMap3(getState(self, restore), (state) => as(addFinalizerExit(scope, () => release(self, state)), state.value))));
2932
+ };
2933
+ var release = (self, state) => {
2934
+ state.refCount--;
2935
+ if (state.refCount > 0) {
2936
+ return void_3;
2937
+ }
2938
+ const idleTimeToLive = self.idleTimeToLive;
2939
+ if (idleTimeToLive === undefined || state.invalidated) {
2940
+ if (self.state === state) {
2941
+ self.state = stateEmpty;
2942
+ }
2943
+ return close(state.scope, void_2);
2944
+ } else if (!isFinite(idleTimeToLive)) {
2945
+ return void_3;
2946
+ }
2947
+ state.fiber = uninterruptibleMask2((restore) => flatMap3(restore(sleep(idleTimeToLive)), () => {
2948
+ if (self.state === state && state.refCount === 0) {
2949
+ self.state = stateEmpty;
2950
+ return ignoreCause(close(state.scope, void_2), {
2951
+ log: "Unhandled",
2952
+ message: "Unhandled error in RcRef finalizer"
2953
+ });
2954
+ }
2955
+ return void_3;
2956
+ })).pipe(ensuring2(sync2(() => {
2957
+ state.fiber = undefined;
2958
+ })), runForkWith(self.context), runIn(self.scope));
2959
+ return void_3;
2960
+ };
2961
+
2962
+ // node_modules/.bun/effect@4.1.2/node_modules/effect/dist/RcRef.js
2963
+ var make10 = make6;
2964
+ var get3 = get2;
2965
+
2817
2966
  // node_modules/.bun/effect@4.1.2/node_modules/effect/dist/Stream.js
2818
- var TypeId8 = "~effect/Stream";
2819
- var isStream = (u) => hasProperty(u, TypeId8);
2967
+ var TypeId9 = "~effect/Stream";
2968
+ var isStream = (u) => hasProperty(u, TypeId9);
2820
2969
  var fromChannel2 = fromChannel3;
2821
2970
  var fromPull2 = (pull) => fromChannel2(fromPull(pull));
2822
2971
  var transformPull2 = (self, f) => fromChannel2(fromTransform((_, scope) => flatMap3(toPullScoped(self.channel, scope), (pull) => f(pull, scope))));
2823
2972
  var toChannel2 = (stream) => stream.channel;
2824
2973
  var callback = (f, options) => fromChannel2(callbackArray(f, options));
2825
2974
  var empty2 = /* @__PURE__ */ fromChannel2(empty);
2826
- var make10 = (...values) => fromArray2(values);
2975
+ var make11 = (...values) => fromArray2(values);
2827
2976
  var suspend = (stream) => {
2828
2977
  const suspended = fromChannel2(suspend4(() => stream().channel));
2829
2978
  suspendedStreams.set(suspended, stream);
@@ -3022,11 +3171,11 @@ var toReadableStreamWith = /* @__PURE__ */ dual((args) => isStream(args[0]), (se
3022
3171
  var toReadableStreamEffect = /* @__PURE__ */ dual((args) => isStream(args[0]), (self, options) => map9(context(), (context) => toReadableStreamWith(self, context, options)));
3023
3172
 
3024
3173
  // node_modules/.bun/effect@4.1.2/node_modules/effect/dist/FileSystem.js
3025
- var TypeId9 = "~effect/FileSystem";
3174
+ var TypeId10 = "~effect/FileSystem";
3026
3175
  var FileSystem = /* @__PURE__ */ Service2("effect/FileSystem");
3027
- var make11 = (impl) => FileSystem.of({
3176
+ var make12 = (impl) => FileSystem.of({
3028
3177
  ...impl,
3029
- [TypeId9]: TypeId9,
3178
+ [TypeId10]: TypeId10,
3030
3179
  glob: make2(impl),
3031
3180
  exists: (path) => pipe(impl.access(path), as(true), catchTag("PlatformError", (e) => e.reason._tag === "NotFound" ? succeed6(false) : fail7(e))),
3032
3181
  readFileString: (path, encoding) => flatMap3(impl.readFile(path), (_) => try_2({
@@ -3042,11 +3191,11 @@ var make11 = (impl) => FileSystem.of({
3042
3191
  const file = yield* impl.open(path, {
3043
3192
  flag: "r"
3044
3193
  });
3045
- const offset = options?.offset === undefined ? undefined : fromInputUnsafe(options.offset);
3194
+ const offset = options?.offset === undefined ? undefined : fromInputUnsafe2(options.offset);
3046
3195
  if (offset) {
3047
3196
  yield* file.seek(offset, "start");
3048
3197
  }
3049
- const bytesToRead = options?.bytesToRead === undefined ? undefined : fromInputUnsafe(options.bytesToRead);
3198
+ const bytesToRead = options?.bytesToRead === undefined ? undefined : fromInputUnsafe2(options.bytesToRead);
3050
3199
  let totalBytesRead = BigInt(0);
3051
3200
  const chunkSize = Number(BigInt(options?.chunkSize ?? 64 * 1024));
3052
3201
  const readChunk = file.readAlloc(chunkSize);
@@ -3082,11 +3231,11 @@ class WatchBackend extends (/* @__PURE__ */ Service2()("effect/FileSystem/WatchB
3082
3231
  }
3083
3232
 
3084
3233
  // node_modules/.bun/effect@4.1.2/node_modules/effect/dist/Path.js
3085
- var TypeId10 = "~effect/Path";
3234
+ var TypeId11 = "~effect/Path";
3086
3235
  var Path = /* @__PURE__ */ Service2("effect/Path");
3087
- var make12 = (impl) => Path.of({
3236
+ var make13 = (impl) => Path.of({
3088
3237
  ...impl,
3089
- [TypeId10]: TypeId10,
3238
+ [TypeId11]: TypeId11,
3090
3239
  resolveWithin(root, input) {
3091
3240
  if (impl.parse(input).root !== "")
3092
3241
  return none();
@@ -3159,7 +3308,7 @@ function makeProvider(load, mapInput) {
3159
3308
  function makeSource(get, transform) {
3160
3309
  return makeProvider((path) => get(transform(path)), (f) => makeSource(get, (path) => f(transform(path))));
3161
3310
  }
3162
- function make6(get) {
3311
+ function make7(get) {
3163
3312
  return makeSource(get, identityPath);
3164
3313
  }
3165
3314
  function emptyStringAsMissing(value, preserveEmptyStrings) {
@@ -3168,7 +3317,7 @@ function emptyStringAsMissing(value, preserveEmptyStrings) {
3168
3317
  function fromEnvRecord(env, options) {
3169
3318
  const preserveEmptyStrings = options?.preserveEmptyStrings === true;
3170
3319
  const trie = buildEnvTrie(env);
3171
- return make6((path) => succeed6(nodeAtEnv(trie, env, path, preserveEmptyStrings)));
3320
+ return make7((path) => succeed6(nodeAtEnv(trie, env, path, preserveEmptyStrings)));
3172
3321
  }
3173
3322
  function fromEnv(options) {
3174
3323
  const env = options?.env ?? {
@@ -3221,7 +3370,7 @@ function trieNodeAt(root, path) {
3221
3370
  }
3222
3371
 
3223
3372
  // node_modules/.bun/effect@4.1.2/node_modules/effect/dist/Config.js
3224
- var TypeId11 = "~effect/Config";
3373
+ var TypeId12 = "~effect/Config";
3225
3374
  class ConfigError {
3226
3375
  _tag = "ConfigError";
3227
3376
  name = "ConfigError";
@@ -3243,14 +3392,14 @@ var Proto2 = {
3243
3392
  return this.parse(fiber.getRef(ConfigProvider));
3244
3393
  }
3245
3394
  }),
3246
- [TypeId11]: TypeId11,
3395
+ [TypeId12]: TypeId12,
3247
3396
  toJSON() {
3248
3397
  return {
3249
3398
  _id: "Config"
3250
3399
  };
3251
3400
  }
3252
3401
  };
3253
- function make7(evaluator) {
3402
+ function make14(evaluator) {
3254
3403
  const self = Object.create(Proto2);
3255
3404
  self.evaluator = evaluator;
3256
3405
  self.parse = (provider) => flatMapEager(evaluator(provider, []), fromResult);
@@ -3258,14 +3407,14 @@ function make7(evaluator) {
3258
3407
  }
3259
3408
  var evaluateAt = (self, provider, pathPrefix) => self.evaluator(provider, pathPrefix);
3260
3409
  var map3 = /* @__PURE__ */ dual(2, (self, f) => {
3261
- return make7((provider, pathPrefix) => map9(evaluateAt(self, provider, pathPrefix), map5(f)));
3410
+ return make14((provider, pathPrefix) => map9(evaluateAt(self, provider, pathPrefix), map5(f)));
3262
3411
  });
3263
3412
  function all(arg) {
3264
3413
  const configs = globalThis.Array.isArray(arg) ? arg : (Symbol.iterator in arg) ? [...arg] : arg;
3265
- 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));
3414
+ 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));
3266
3415
  }
3267
3416
  var withDefault = /* @__PURE__ */ dual(2, (self, defaultValue) => {
3268
- return make7((provider, pathPrefix) => mapEager(evaluateAt(self, provider, pathPrefix), (resolution) => isFailure(resolution) ? succeed(defaultValue) : resolution));
3417
+ return make14((provider, pathPrefix) => mapEager(evaluateAt(self, provider, pathPrefix), (resolution) => isFailure(resolution) ? succeed(defaultValue) : resolution));
3269
3418
  });
3270
3419
  var option = (self) => self.pipe(map3(some), withDefault(none()));
3271
3420
  var isSourceError = (u) => isTagged(u, "SourceError");
@@ -3382,9 +3531,9 @@ var toConfigCursorAST = /* @__PURE__ */ memoize((root) => {
3382
3531
  function schema(codec, path) {
3383
3532
  const codecStringTree = toCodecStringTree(codec);
3384
3533
  const encodedAst = toEncoded(codecStringTree.ast);
3385
- const decodeCursor = decodeUnknownEffect(make16(toConfigCursorAST(codecStringTree.ast)));
3534
+ const decodeCursor = decodeUnknownEffect(make17(toConfigCursorAST(codecStringTree.ast)));
3386
3535
  const localPath = typeof path === "string" ? [path] : path ?? [];
3387
- return make7((provider, pathPrefix) => {
3536
+ return make14((provider, pathPrefix) => {
3388
3537
  const fullPath = [...pathPrefix, ...localPath];
3389
3538
  return loadCursor(provider, fullPath).pipe(flatMapEager((cursor) => decodeCursor(cursor).pipe(mapEager(succeed), catchEager((issue) => {
3390
3539
  const error = new ConfigError(new SchemaError(fullPath.length > 0 ? new Pointer(fullPath, issue) : issue));
@@ -3514,4 +3663,4 @@ var srtArgv2 = (srtCommand, settingsFile, argv) => [
3514
3663
  ...argv
3515
3664
  ];
3516
3665
 
3517
- 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, mapAccum, transduce, decodeText, encodeText, splitLines, interruptWhen, ensuring, provideContext, run, runCollect, runFold, runHead, runForEach, runDrain, toPull, 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 };
3666
+ export { map, makeEquivalence, Clock, currentTimeMillis, 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, toPull, 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 };
@@ -25,21 +25,21 @@ import {
25
25
  isString2,
26
26
  encodePrettyJsonString,
27
27
  decodeJsonStringSync
28
- } from "./chunk-b4td2pgc.js";
28
+ } from "./chunk-bqbfyqx6.js";
29
29
  import {
30
30
  FileSystem,
31
31
  Path,
32
32
  optionalEnv,
33
33
  tempDirectoryScoped
34
- } from "./chunk-sasjamqz.js";
34
+ } from "./chunk-etrfc5cn.js";
35
35
  import {
36
36
  AgentHarnessIds,
37
37
  sha2562,
38
38
  runCommand2
39
- } from "./chunk-q6qn9c47.js";
39
+ } from "./chunk-0qfaf9h3.js";
40
40
  import {
41
41
  NpmRegistry
42
- } from "./chunk-sbk4evb4.js";
42
+ } from "./chunk-7ygg19wj.js";
43
43
 
44
44
  // packages/agent-runtime/src/config-convergence.ts
45
45
  var writeAgentEnvironmentConfigFile2 = fnUntraced(function* (file, content, keep = {}) {
@@ -4,7 +4,7 @@ import {
4
4
  searchDocs2,
5
5
  readDoc2,
6
6
  pinnedLink2
7
- } from "./chunk-1gr39h4v.js";
7
+ } from "./chunk-rbt72xjw.js";
8
8
  export {
9
9
  DefaultDocsSearchLimit2 as DefaultDocsSearchLimit,
10
10
  pinnedLink2 as pinnedLink,
@@ -9,10 +9,10 @@ import {
9
9
  readOpencode2,
10
10
  databaseStamp2,
11
11
  runOpencodeReader2
12
- } from "./chunk-2bt9e1fj.js";
13
- import"./chunk-3gax0xq6.js";
14
- import"./chunk-sasjamqz.js";
15
- import"./chunk-b4td2pgc.js";
12
+ } from "./chunk-cnryphhh.js";
13
+ import"./chunk-6x08g7m6.js";
14
+ import"./chunk-etrfc5cn.js";
15
+ import"./chunk-bqbfyqx6.js";
16
16
  export {
17
17
  databaseStamp2 as databaseStamp,
18
18
  decoded2 as decoded,
@@ -45,7 +45,7 @@ import {
45
45
  isFailure2,
46
46
  hasInterrupts,
47
47
  makeUnsafe5,
48
- make15,
48
+ make16,
49
49
  _await,
50
50
  fail5,
51
51
  isDoneUnsafe,
@@ -175,7 +175,7 @@ import {
175
175
  decodeJsonStringSync,
176
176
  encodeUnknownJsonStringSync,
177
177
  storable
178
- } from "./chunk-b4td2pgc.js";
178
+ } from "./chunk-bqbfyqx6.js";
179
179
  import {
180
180
  SecureRandom,
181
181
  layerWebCrypto,
@@ -264,7 +264,7 @@ import {
264
264
  checkServicesFile,
265
265
  checkServices,
266
266
  serviceChecks
267
- } from "./chunk-q6qn9c47.js";
267
+ } from "./chunk-0qfaf9h3.js";
268
268
  import {
269
269
  currentTimeMillis,
270
270
  join,
@@ -274,7 +274,7 @@ import {
274
274
  unbounded2,
275
275
  offer,
276
276
  makeUnsafe3,
277
- make10,
277
+ make11,
278
278
  fromQueue,
279
279
  fromPubSub,
280
280
  map2,
@@ -313,7 +313,7 @@ import {
313
313
  writeSrtSettings2,
314
314
  srtStepArgv2,
315
315
  srtArgv2
316
- } from "./chunk-sasjamqz.js";
316
+ } from "./chunk-etrfc5cn.js";
317
317
  import {
318
318
  writeAgentEnvironmentConfigFile2,
319
319
  readManifestSkillPaths2,
@@ -329,8 +329,8 @@ import {
329
329
  applyAgentEnvironmentMaterialization2,
330
330
  isPathWithin2,
331
331
  skillIdentity2
332
- } from "./chunk-vjkgbsry.js";
333
- import"./chunk-sbk4evb4.js";
332
+ } from "./chunk-fbddgx6q.js";
333
+ import"./chunk-7ygg19wj.js";
334
334
  import {
335
335
  egressAllowed,
336
336
  writeSecretRegistry,
@@ -340,7 +340,7 @@ import {
340
340
  secretFilter2,
341
341
  opaqueTunnelRefusal2,
342
342
  isOpaqueConnectReason2
343
- } from "./chunk-dhe1fwhw.js";
343
+ } from "./chunk-wy6gmtd9.js";
344
344
  import {
345
345
  sliceBytes2,
346
346
  maxLineBytes2,
@@ -350,29 +350,29 @@ import {
350
350
  lookAtOpencode2,
351
351
  readOpencode2,
352
352
  databaseStamp2
353
- } from "./chunk-2bt9e1fj.js";
353
+ } from "./chunk-cnryphhh.js";
354
354
  import {
355
355
  uploadRunFile,
356
356
  programLease,
357
357
  rpcRunFiles,
358
358
  programHostsEnv,
359
359
  undeclaredHostsEnv
360
- } from "./chunk-re7cr0kk.js";
361
- import"./chunk-gqgbah9q.js";
360
+ } from "./chunk-91tvnb8f.js";
361
+ import"./chunk-27e7m975.js";
362
362
  import {
363
363
  nextInt
364
- } from "./chunk-wre79w3z.js";
365
- import"./chunk-tpmyf5mk.js";
364
+ } from "./chunk-8b02x7vv.js";
365
+ import"./chunk-98azvx6g.js";
366
366
  import {
367
367
  ChildProcessSpawner,
368
368
  make3
369
- } from "./chunk-3gax0xq6.js";
370
- import"./chunk-c3ms91a6.js";
369
+ } from "./chunk-6x08g7m6.js";
370
+ import"./chunk-qxpwkb5f.js";
371
371
  import {
372
372
  Id,
373
373
  secretReference,
374
374
  secretPlaceholder
375
- } from "./chunk-qndcafax.js";
375
+ } from "./chunk-ea29sbaq.js";
376
376
 
377
377
  // packages/core/src/sync-kit.ts
378
378
  import { createHash } from "crypto";
@@ -4505,12 +4505,29 @@ var systemStepProcessesLayer = effect(StepProcesses, gen(function* () {
4505
4505
  }));
4506
4506
 
4507
4507
  // packages/agent-runtime/src/thread-budget.ts
4508
+ import { readFileSync } from "fs";
4508
4509
  import { availableParallelism } from "os";
4510
+ var cpuQuota = (cpuMax) => {
4511
+ const [max, period] = (cpuMax ?? "max").trim().split(/\s+/);
4512
+ const quota = Number(max) / Number(period);
4513
+ return Number.isFinite(quota) && quota > 0 ? quota : undefined;
4514
+ };
4515
+ var readCpuMax = () => {
4516
+ try {
4517
+ return readFileSync("/sys/fs/cgroup/cpu.max", "utf8");
4518
+ } catch {
4519
+ return;
4520
+ }
4521
+ };
4522
+ var effectiveCores = (cores = availableParallelism(), cpuMax = readCpuMax()) => {
4523
+ const quota = cpuQuota(cpuMax);
4524
+ return quota === undefined ? cores : Math.max(1, Math.min(cores, Math.ceil(quota)));
4525
+ };
4509
4526
  var threadBudget = (cores, concurrency) => Math.max(2, Math.floor(cores / concurrency));
4510
- var hostThreadBudget = (concurrency) => threadBudget(availableParallelism(), concurrency);
4511
- var checkThreadBudget = (settings) => {
4512
- const cap = verificationCap(settings);
4513
- return cap < settings.concurrency ? hostThreadBudget(cap) : undefined;
4527
+ var runnerVerificationCap = (settings, cores = effectiveCores()) => verificationCap(settings, cores);
4528
+ var checkThreadBudget = (settings, cores = effectiveCores()) => {
4529
+ const cap = runnerVerificationCap(settings, cores);
4530
+ return cap < settings.concurrency ? threadBudget(cores, cap) : undefined;
4514
4531
  };
4515
4532
  var threadBudgetVariables = [
4516
4533
  "GOMAXPROCS",
@@ -8689,7 +8706,7 @@ var codexAppServer = (binary = "codex") => (env) => gen(function* () {
8689
8706
  return {
8690
8707
  request: (method, params) => gen(function* () {
8691
8708
  const id = ++lastId;
8692
- const deferred = yield* make15();
8709
+ const deferred = yield* make16();
8693
8710
  pending.set(id, deferred);
8694
8711
  yield* send({ id, method, params });
8695
8712
  return yield* _await(deferred).pipe(mapError2((error) => new CodexAppServerFailed({ reason: `${method}: ${error.message}` })));
@@ -8832,7 +8849,7 @@ var kitmanMcpPreflight = (mcp) => gen(function* () {
8832
8849
  const server = yield* spawner.spawn(make3(mcp.command, [...mcp.args], {
8833
8850
  extendEnv: true,
8834
8851
  env: mcp.env,
8835
- stdin: { stream: make10(new TextEncoder().encode(handshake)), endOnDone: false },
8852
+ stdin: { stream: make11(new TextEncoder().encode(handshake)), endOnDone: false },
8836
8853
  stderr: "ignore"
8837
8854
  }));
8838
8855
  const reply = yield* server.stdout.pipe(decodeText, splitLines, map2((line) => getOrUndefined(decodeJsonStringOption(line))), filter((message) => isJsonObject(message) && message.id === 2), runHead);
@@ -8906,7 +8923,7 @@ var programProcessExecutor = (input) => (work) => gen(function* () {
8906
8923
  const exitCode = sandbox === undefined ? yield* gen(function* () {
8907
8924
  const spawner = yield* ChildProcessSpawner;
8908
8925
  const handle = yield* spawner.spawn(make3(input.bun ?? process.execPath, [file], {
8909
- stdin: make10(new TextEncoder().encode(stdin)),
8926
+ stdin: make11(new TextEncoder().encode(stdin)),
8910
8927
  stdout: "inherit",
8911
8928
  stderr: "inherit",
8912
8929
  extendEnv: false,
@@ -10432,6 +10449,7 @@ export {
10432
10449
  compiled2 as compiled,
10433
10450
  composeAgentEnvironmentSyncPlan,
10434
10451
  controlFailureKind,
10452
+ cpuQuota,
10435
10453
  defaultAgentRuntimeUserConfigPath,
10436
10454
  detectHarnesses2 as detectHarnesses,
10437
10455
  diskSpaceFromDf,
@@ -10445,6 +10463,7 @@ export {
10445
10463
  dockerMissing,
10446
10464
  dockerRootDirectory,
10447
10465
  dockerStepContainers,
10466
+ effectiveCores,
10448
10467
  failed,
10449
10468
  failedWhenUnrun,
10450
10469
  firstMessage,
@@ -10468,7 +10487,6 @@ export {
10468
10487
  herdrRunnerCapabilitiesForRepoBinding2 as herdrRunnerCapabilitiesForRepoBinding,
10469
10488
  herdrSandboxBackends,
10470
10489
  homeDirectories,
10471
- hostThreadBudget,
10472
10490
  inheritedEnvironment2 as inheritedEnvironment,
10473
10491
  isPathWithin2 as isPathWithin,
10474
10492
  kitMcpHosts,
@@ -10529,6 +10547,7 @@ export {
10529
10547
  runSrtCli2 as runSrtCli,
10530
10548
  runnerStateSandboxPolicy,
10531
10549
  runnerStepAttemptFromAgentStep,
10550
+ runnerVerificationCap,
10532
10551
  runsOnHost,
10533
10552
  sampleMetrics,
10534
10553
  sandboxedLaunch,
@@ -13,17 +13,17 @@ import {
13
13
  isJsonObject,
14
14
  decodeJsonString,
15
15
  encodePrettyJsonString
16
- } from "./chunk-b4td2pgc.js";
16
+ } from "./chunk-bqbfyqx6.js";
17
17
  import {
18
18
  FileSystem,
19
19
  Path
20
- } from "./chunk-sasjamqz.js";
20
+ } from "./chunk-etrfc5cn.js";
21
21
  import {
22
22
  tomlTableHeader2,
23
23
  tomlKeyPath2,
24
24
  kitmanSkillEntry,
25
25
  isPathWithin2
26
- } from "./chunk-vjkgbsry.js";
26
+ } from "./chunk-fbddgx6q.js";
27
27
  import {
28
28
  instructionsStart,
29
29
  instructionsEnd,
@@ -31,10 +31,10 @@ import {
31
31
  antigravityPlugins,
32
32
  materializeKitSetup,
33
33
  tomlInline
34
- } from "./chunk-q6qn9c47.js";
35
- import"./chunk-sbk4evb4.js";
36
- import"./chunk-3gax0xq6.js";
37
- import"./chunk-qndcafax.js";
34
+ } from "./chunk-0qfaf9h3.js";
35
+ import"./chunk-7ygg19wj.js";
36
+ import"./chunk-6x08g7m6.js";
37
+ import"./chunk-ea29sbaq.js";
38
38
 
39
39
  // packages/agent-runtime/src/kit-setup-sync.ts
40
40
  class KitSyncError extends TaggedError("KitSyncError") {
@@ -15,8 +15,8 @@ import {
15
15
  writeSrtSettings2,
16
16
  srtStepArgv2,
17
17
  srtArgv2
18
- } from "./chunk-sasjamqz.js";
19
- import"./chunk-b4td2pgc.js";
18
+ } from "./chunk-etrfc5cn.js";
19
+ import"./chunk-bqbfyqx6.js";
20
20
  export {
21
21
  compiled2 as compiled,
22
22
  harnessesUnsupportedInDocker2 as harnessesUnsupportedInDocker,