@kitman-sh/cli 0.10.84 → 0.10.86

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 (26) hide show
  1. package/dist/{chunk-tzz4fv17.js → chunk-292vjjdz.js} +1 -1
  2. package/dist/{chunk-397fax43.js → chunk-2fqry6rd.js} +33 -185
  3. package/dist/{chunk-ynn6jk0w.js → chunk-38end526.js} +78 -64
  4. package/dist/{chunk-kgdppbdr.js → chunk-3wvp5n5a.js} +1 -1
  5. package/dist/{chunk-9gztfcvf.js → chunk-4sz3sg95.js} +7 -7
  6. package/dist/{chunk-2tpysgqk.js → chunk-6tq2m8xc.js} +3 -3
  7. package/dist/{chunk-76ctrqm6.js → chunk-93vddjpx.js} +1 -1
  8. package/dist/{chunk-0mgbryyd.js → chunk-999xbcaa.js} +9 -9
  9. package/dist/{chunk-hgx1dq68.js → chunk-b0qaan2c.js} +4 -4
  10. package/dist/{chunk-cakmwaed.js → chunk-bjexx93x.js} +2 -2
  11. package/dist/{chunk-ze0f51ds.js → chunk-ehwvgxq8.js} +11 -11
  12. package/dist/{chunk-92mjxge4.js → chunk-ekkjbmr9.js} +8 -8
  13. package/dist/{chunk-2k1qfyvx.js → chunk-gmt7awee.js} +6 -6
  14. package/dist/{chunk-d53rckf0.js → chunk-h8fq958v.js} +305 -144
  15. package/dist/{chunk-7qbchfkf.js → chunk-jfgmhb6k.js} +9 -9
  16. package/dist/{chunk-98r2t1s6.js → chunk-mak28dxp.js} +18 -18
  17. package/dist/{chunk-kxtmk59a.js → chunk-mr30hj39.js} +5 -5
  18. package/dist/{chunk-kp01bv8f.js → chunk-q1qrwcnw.js} +23 -23
  19. package/dist/{chunk-ebd5zjnx.js → chunk-qnnsy306.js} +2 -2
  20. package/dist/{chunk-93b1hdfa.js → chunk-wbdgjd1n.js} +29 -29
  21. package/dist/{chunk-ky974pcr.js → chunk-wtx1vq9t.js} +4 -4
  22. package/dist/{chunk-jbwk6k6m.js → chunk-xq4k0mgr.js} +60 -60
  23. package/dist/{chunk-krh0gek1.js → chunk-y1x0mb3b.js} +17 -17
  24. package/dist/{chunk-62565d52.js → chunk-zms40x1v.js} +2 -2
  25. package/dist/index.js +4 -4
  26. package/package.json +1 -1
@@ -8,7 +8,7 @@ import {
8
8
  isFunction2,
9
9
  isUndefined2,
10
10
  isObjectOrArray
11
- } from "./chunk-jbwk6k6m.js";
11
+ } from "./chunk-xq4k0mgr.js";
12
12
 
13
13
  // packages/core/src/runtime-type.ts
14
14
  var UnsafeJsonObjectKeys = new Set(["__proto__", "constructor", "prototype"]);
@@ -34,11 +34,8 @@ import {
34
34
  getOrUndefined,
35
35
  map4,
36
36
  Service2,
37
- add,
38
- get4,
37
+ get3,
39
38
  Reference,
40
- fromInputUnsafe,
41
- isFinite,
42
39
  normalize,
43
40
  succeed,
44
41
  fail3,
@@ -79,12 +76,13 @@ import {
79
76
  fiberRunIn,
80
77
  makeLatchUnsafe,
81
78
  makeLatch,
79
+ ClockRef,
80
+ currentTimeMillis2,
82
81
  succeed3,
83
82
  failCause2,
84
83
  fail4,
85
84
  interrupt2,
86
85
  void_2,
87
- isSuccess2,
88
86
  isFailure2,
89
87
  asVoidAll,
90
88
  makeUnsafe5,
@@ -156,14 +154,12 @@ import {
156
154
  tapError2,
157
155
  ignoreCause,
158
156
  orElseSucceed,
159
- sleep,
160
157
  raceFirst,
161
158
  when,
162
159
  matchCauseEffect,
163
160
  context,
164
161
  contextWith,
165
162
  provideContext2,
166
- scope2,
167
163
  scoped,
168
164
  scopedWith,
169
165
  ensuring2,
@@ -173,7 +169,6 @@ import {
173
169
  interrupt3,
174
170
  onInterrupt,
175
171
  uninterruptible,
176
- uninterruptibleMask2,
177
172
  forever,
178
173
  forkChild,
179
174
  forkIn,
@@ -195,11 +190,11 @@ import {
195
190
  toEncoded,
196
191
  decodeUnknownEffect,
197
192
  SchemaError,
198
- make17,
193
+ make16,
199
194
  String4,
200
195
  toCodecStringTree,
201
196
  encodeUnknownJsonStringSync
202
- } from "./chunk-jbwk6k6m.js";
197
+ } from "./chunk-xq4k0mgr.js";
203
198
 
204
199
  // node_modules/.bun/effect@4.1.2/node_modules/effect/dist/Iterable.js
205
200
  var headUnsafe = (self) => {
@@ -248,14 +243,9 @@ var makeEquivalence = (equivalence) => {
248
243
  return (self, that) => is(self, that) && is(that, self);
249
244
  };
250
245
 
251
- // node_modules/.bun/effect@4.1.2/node_modules/effect/dist/BigInt.js
252
- var BigInt2 = globalThis.BigInt;
253
- var toNumber = (b) => {
254
- if (b > BigInt2(Number.MAX_SAFE_INTEGER) || b < BigInt2(Number.MIN_SAFE_INTEGER)) {
255
- return none();
256
- }
257
- return some(Number(b));
258
- };
246
+ // node_modules/.bun/effect@4.1.2/node_modules/effect/dist/Clock.js
247
+ var Clock = ClockRef;
248
+ var currentTimeMillis = currentTimeMillis2;
259
249
 
260
250
  // node_modules/.bun/effect@4.1.2/node_modules/effect/dist/ByteSize.js
261
251
  var bigint0 = /* @__PURE__ */ BigInt(0);
@@ -377,7 +367,7 @@ var fromStringUnsafe = (input) => {
377
367
  return invalid(`${JSON.stringify(input)} does not represent an integral number of bytes`);
378
368
  return make(value);
379
369
  };
380
- var fromInputUnsafe2 = (input) => {
370
+ var fromInputUnsafe = (input) => {
381
371
  switch (typeof input) {
382
372
  case "bigint":
383
373
  if (input < bigint0)
@@ -390,7 +380,7 @@ var fromInputUnsafe2 = (input) => {
390
380
  }
391
381
  return invalid(`unsupported input ${input}`);
392
382
  };
393
- var bytes = (value) => typeof value === "bigint" ? fromInputUnsafe2(value) : fromNumber(value);
383
+ var bytes = (value) => typeof value === "bigint" ? fromInputUnsafe(value) : fromNumber(value);
394
384
 
395
385
  // node_modules/.bun/effect@4.1.2/node_modules/effect/dist/Fiber.js
396
386
  var join = fiberJoin;
@@ -1316,7 +1306,7 @@ var publishUnsafe = /* @__PURE__ */ dual(2, (self, value) => {
1316
1306
  return false;
1317
1307
  });
1318
1308
  var subscribe = (self) => uninterruptible(contextWith((services) => {
1319
- const localScope = get4(services, Scope);
1309
+ const localScope = get3(services, Scope);
1320
1310
  const scope = forkUnsafe(self.scope);
1321
1311
  const subscription = makeSubscriptionUnsafe(self.pubsub, self.subscribers, self.strategy, self.ended);
1322
1312
  return addFinalizer(scope, unsubscribe(subscription)).pipe(andThen2(addFinalizerExit(localScope, (exit) => close(scope, exit))), as(subscription));
@@ -2773,158 +2763,16 @@ var forEachArray = (f) => fromTransform2((upstream) => upstream.pipe(flatMap3(f)
2773
2763
  }), catchDone(() => endVoid)));
2774
2764
  var unwrap3 = (effect) => fromChannel(unwrap2(map8(effect, toChannel)));
2775
2765
 
2776
- // node_modules/.bun/effect@4.1.2/node_modules/effect/dist/internal/rcRef.js
2777
- var TypeId8 = "~effect/RcRef";
2778
- var stateEmpty = {
2779
- _tag: "Empty"
2780
- };
2781
- var stateClosed = {
2782
- _tag: "Closed"
2783
- };
2784
- var variance2 = {
2785
- _A: identity,
2786
- _E: identity
2787
- };
2788
-
2789
- class RcRefImpl {
2790
- [TypeId8] = variance2;
2791
- pipe() {
2792
- return pipeArguments(this, arguments);
2793
- }
2794
- state = stateEmpty;
2795
- acquire;
2796
- context;
2797
- scope;
2798
- idleTimeToLive;
2799
- constructor(acquire, context, scope, idleTimeToLive) {
2800
- this.acquire = acquire;
2801
- this.context = context;
2802
- this.scope = scope;
2803
- this.idleTimeToLive = idleTimeToLive;
2804
- }
2805
- }
2806
- var make6 = (options) => withFiber2((fiber) => {
2807
- const context = fiber.context;
2808
- const scope = get4(context, Scope);
2809
- const ref = new RcRefImpl(options.acquire, context, scope, options.idleTimeToLive !== undefined ? fromInputUnsafe(options.idleTimeToLive) : undefined);
2810
- return as(addFinalizerExit(scope, () => {
2811
- const state = ref.state;
2812
- ref.state = stateClosed;
2813
- if (state._tag === "Acquired")
2814
- return close(state.scope, void_2);
2815
- if (state._tag === "Acquiring")
2816
- return interrupt(state.fiber);
2817
- return void_3;
2818
- }), ref);
2819
- });
2820
- var getState = (self, restore) => {
2821
- switch (self.state._tag) {
2822
- case "Closed": {
2823
- return interrupt3;
2824
- }
2825
- case "Acquired": {
2826
- const state = self.state;
2827
- state.refCount++;
2828
- return state.fiber ? as(interrupt(state.fiber), state) : succeed6(state);
2829
- }
2830
- case "Acquiring": {
2831
- const state = self.state;
2832
- state.awaiters++;
2833
- return awaitAcquiring(self, state, restore);
2834
- }
2835
- case "Empty": {
2836
- const acquiring = {
2837
- _tag: "Acquiring",
2838
- fiber: undefined,
2839
- awaiters: 1,
2840
- acquired: undefined
2841
- };
2842
- self.state = acquiring;
2843
- const scope = makeUnsafe6();
2844
- const acquire = provideContext2(self.acquire, add(self.context, Scope, scope)).pipe(flatMap3((value) => {
2845
- if (self.state !== acquiring) {
2846
- return interrupt3;
2847
- }
2848
- const state = {
2849
- _tag: "Acquired",
2850
- value,
2851
- scope,
2852
- fiber: undefined,
2853
- refCount: acquiring.awaiters,
2854
- invalidated: false
2855
- };
2856
- self.state = state;
2857
- acquiring.acquired = state;
2858
- return succeed6(state);
2859
- }), onExit((exit) => {
2860
- if (isSuccess2(exit))
2861
- return void_3;
2862
- if (self.state === acquiring)
2863
- self.state = stateEmpty;
2864
- return close(scope, exit);
2865
- }));
2866
- acquiring.fiber = runForkWith(getCurrent().context)(acquire);
2867
- return awaitAcquiring(self, acquiring, restore);
2868
- }
2869
- }
2870
- };
2871
- var awaitAcquiring = (self, acquiring, restore) => onExit(restore(join(acquiring.fiber)), (exit) => {
2872
- const acquired = acquiring.acquired;
2873
- if (acquired !== undefined) {
2874
- return isFailure2(exit) ? release(self, acquired) : void_3;
2875
- }
2876
- if (--acquiring.awaiters > 0 || self.state !== acquiring)
2877
- return void_3;
2878
- self.state = stateEmpty;
2879
- return interrupt(acquiring.fiber);
2880
- });
2881
- var get2 = (self_) => {
2882
- const self = self_;
2883
- return uninterruptibleMask2((restore) => flatMap3(scope2, (scope) => flatMap3(getState(self, restore), (state) => as(addFinalizerExit(scope, () => release(self, state)), state.value))));
2884
- };
2885
- var release = (self, state) => {
2886
- state.refCount--;
2887
- if (state.refCount > 0) {
2888
- return void_3;
2889
- }
2890
- const idleTimeToLive = self.idleTimeToLive;
2891
- if (idleTimeToLive === undefined || state.invalidated) {
2892
- if (self.state === state) {
2893
- self.state = stateEmpty;
2894
- }
2895
- return close(state.scope, void_2);
2896
- } else if (!isFinite(idleTimeToLive)) {
2897
- return void_3;
2898
- }
2899
- state.fiber = uninterruptibleMask2((restore) => flatMap3(restore(sleep(idleTimeToLive)), () => {
2900
- if (self.state === state && state.refCount === 0) {
2901
- self.state = stateEmpty;
2902
- return ignoreCause(close(state.scope, void_2), {
2903
- log: "Unhandled",
2904
- message: "Unhandled error in RcRef finalizer"
2905
- });
2906
- }
2907
- return void_3;
2908
- })).pipe(ensuring2(sync2(() => {
2909
- state.fiber = undefined;
2910
- })), runForkWith(self.context), runIn(self.scope));
2911
- return void_3;
2912
- };
2913
-
2914
- // node_modules/.bun/effect@4.1.2/node_modules/effect/dist/RcRef.js
2915
- var make10 = make6;
2916
- var get3 = get2;
2917
-
2918
2766
  // node_modules/.bun/effect@4.1.2/node_modules/effect/dist/Stream.js
2919
- var TypeId9 = "~effect/Stream";
2920
- var isStream = (u) => hasProperty(u, TypeId9);
2767
+ var TypeId8 = "~effect/Stream";
2768
+ var isStream = (u) => hasProperty(u, TypeId8);
2921
2769
  var fromChannel2 = fromChannel3;
2922
2770
  var fromPull2 = (pull) => fromChannel2(fromPull(pull));
2923
2771
  var transformPull2 = (self, f) => fromChannel2(fromTransform((_, scope) => flatMap3(toPullScoped(self.channel, scope), (pull) => f(pull, scope))));
2924
2772
  var toChannel2 = (stream) => stream.channel;
2925
2773
  var callback = (f, options) => fromChannel2(callbackArray(f, options));
2926
2774
  var empty2 = /* @__PURE__ */ fromChannel2(empty);
2927
- var make11 = (...values) => fromArray2(values);
2775
+ var make10 = (...values) => fromArray2(values);
2928
2776
  var suspend = (stream) => {
2929
2777
  const suspended = fromChannel2(suspend4(() => stream().channel));
2930
2778
  suspendedStreams.set(suspended, stream);
@@ -3087,11 +2935,11 @@ var toReadableStreamWith = /* @__PURE__ */ dual((args) => isStream(args[0]), (se
3087
2935
  var toReadableStreamEffect = /* @__PURE__ */ dual((args) => isStream(args[0]), (self, options) => map8(context(), (context) => toReadableStreamWith(self, context, options)));
3088
2936
 
3089
2937
  // node_modules/.bun/effect@4.1.2/node_modules/effect/dist/FileSystem.js
3090
- var TypeId10 = "~effect/FileSystem";
2938
+ var TypeId9 = "~effect/FileSystem";
3091
2939
  var FileSystem = /* @__PURE__ */ Service2("effect/FileSystem");
3092
- var make12 = (impl) => FileSystem.of({
2940
+ var make11 = (impl) => FileSystem.of({
3093
2941
  ...impl,
3094
- [TypeId10]: TypeId10,
2942
+ [TypeId9]: TypeId9,
3095
2943
  glob: make2(impl),
3096
2944
  exists: (path) => pipe(impl.access(path), as(true), catchTag("PlatformError", (e) => e.reason._tag === "NotFound" ? succeed6(false) : fail7(e))),
3097
2945
  readFileString: (path, encoding) => flatMap3(impl.readFile(path), (_) => try_2({
@@ -3107,11 +2955,11 @@ var make12 = (impl) => FileSystem.of({
3107
2955
  const file = yield* impl.open(path, {
3108
2956
  flag: "r"
3109
2957
  });
3110
- const offset = options?.offset === undefined ? undefined : fromInputUnsafe2(options.offset);
2958
+ const offset = options?.offset === undefined ? undefined : fromInputUnsafe(options.offset);
3111
2959
  if (offset) {
3112
2960
  yield* file.seek(offset, "start");
3113
2961
  }
3114
- const bytesToRead = options?.bytesToRead === undefined ? undefined : fromInputUnsafe2(options.bytesToRead);
2962
+ const bytesToRead = options?.bytesToRead === undefined ? undefined : fromInputUnsafe(options.bytesToRead);
3115
2963
  let totalBytesRead = BigInt(0);
3116
2964
  const chunkSize = Number(BigInt(options?.chunkSize ?? 64 * 1024));
3117
2965
  const readChunk = file.readAlloc(chunkSize);
@@ -3147,11 +2995,11 @@ class WatchBackend extends (/* @__PURE__ */ Service2()("effect/FileSystem/WatchB
3147
2995
  }
3148
2996
 
3149
2997
  // node_modules/.bun/effect@4.1.2/node_modules/effect/dist/Path.js
3150
- var TypeId11 = "~effect/Path";
2998
+ var TypeId10 = "~effect/Path";
3151
2999
  var Path = /* @__PURE__ */ Service2("effect/Path");
3152
- var make13 = (impl) => Path.of({
3000
+ var make12 = (impl) => Path.of({
3153
3001
  ...impl,
3154
- [TypeId11]: TypeId11,
3002
+ [TypeId10]: TypeId10,
3155
3003
  resolveWithin(root, input) {
3156
3004
  if (impl.parse(input).root !== "")
3157
3005
  return none();
@@ -3224,7 +3072,7 @@ function makeProvider(load, mapInput) {
3224
3072
  function makeSource(get, transform) {
3225
3073
  return makeProvider((path) => get(transform(path)), (f) => makeSource(get, (path) => f(transform(path))));
3226
3074
  }
3227
- function make7(get) {
3075
+ function make6(get) {
3228
3076
  return makeSource(get, identityPath);
3229
3077
  }
3230
3078
  function emptyStringAsMissing(value, preserveEmptyStrings) {
@@ -3233,7 +3081,7 @@ function emptyStringAsMissing(value, preserveEmptyStrings) {
3233
3081
  function fromEnvRecord(env, options) {
3234
3082
  const preserveEmptyStrings = options?.preserveEmptyStrings === true;
3235
3083
  const trie = buildEnvTrie(env);
3236
- return make7((path) => succeed6(nodeAtEnv(trie, env, path, preserveEmptyStrings)));
3084
+ return make6((path) => succeed6(nodeAtEnv(trie, env, path, preserveEmptyStrings)));
3237
3085
  }
3238
3086
  function fromEnv(options) {
3239
3087
  const env = options?.env ?? {
@@ -3286,7 +3134,7 @@ function trieNodeAt(root, path) {
3286
3134
  }
3287
3135
 
3288
3136
  // node_modules/.bun/effect@4.1.2/node_modules/effect/dist/Config.js
3289
- var TypeId12 = "~effect/Config";
3137
+ var TypeId11 = "~effect/Config";
3290
3138
  class ConfigError {
3291
3139
  _tag = "ConfigError";
3292
3140
  name = "ConfigError";
@@ -3308,14 +3156,14 @@ var Proto2 = {
3308
3156
  return this.parse(fiber.getRef(ConfigProvider));
3309
3157
  }
3310
3158
  }),
3311
- [TypeId12]: TypeId12,
3159
+ [TypeId11]: TypeId11,
3312
3160
  toJSON() {
3313
3161
  return {
3314
3162
  _id: "Config"
3315
3163
  };
3316
3164
  }
3317
3165
  };
3318
- function make14(evaluator) {
3166
+ function make7(evaluator) {
3319
3167
  const self = Object.create(Proto2);
3320
3168
  self.evaluator = evaluator;
3321
3169
  self.parse = (provider) => flatMapEager(evaluator(provider, []), fromResult);
@@ -3323,14 +3171,14 @@ function make14(evaluator) {
3323
3171
  }
3324
3172
  var evaluateAt = (self, provider, pathPrefix) => self.evaluator(provider, pathPrefix);
3325
3173
  var map3 = /* @__PURE__ */ dual(2, (self, f) => {
3326
- return make14((provider, pathPrefix) => map8(evaluateAt(self, provider, pathPrefix), map5(f)));
3174
+ return make7((provider, pathPrefix) => map8(evaluateAt(self, provider, pathPrefix), map5(f)));
3327
3175
  });
3328
3176
  function all(arg) {
3329
3177
  const configs = globalThis.Array.isArray(arg) ? arg : (Symbol.iterator in arg) ? [...arg] : arg;
3330
- 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));
3178
+ 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));
3331
3179
  }
3332
3180
  var withDefault = /* @__PURE__ */ dual(2, (self, defaultValue) => {
3333
- return make14((provider, pathPrefix) => mapEager(evaluateAt(self, provider, pathPrefix), (resolution) => isFailure(resolution) ? succeed(defaultValue) : resolution));
3181
+ return make7((provider, pathPrefix) => mapEager(evaluateAt(self, provider, pathPrefix), (resolution) => isFailure(resolution) ? succeed(defaultValue) : resolution));
3334
3182
  });
3335
3183
  var option = (self) => self.pipe(map3(some), withDefault(none()));
3336
3184
  var isSourceError = (u) => isTagged(u, "SourceError");
@@ -3447,9 +3295,9 @@ var toConfigCursorAST = /* @__PURE__ */ memoize((root) => {
3447
3295
  function schema(codec, path) {
3448
3296
  const codecStringTree = toCodecStringTree(codec);
3449
3297
  const encodedAst = toEncoded(codecStringTree.ast);
3450
- const decodeCursor = decodeUnknownEffect(make17(toConfigCursorAST(codecStringTree.ast)));
3298
+ const decodeCursor = decodeUnknownEffect(make16(toConfigCursorAST(codecStringTree.ast)));
3451
3299
  const localPath = typeof path === "string" ? [path] : path ?? [];
3452
- return make14((provider, pathPrefix) => {
3300
+ return make7((provider, pathPrefix) => {
3453
3301
  const fullPath = [...pathPrefix, ...localPath];
3454
3302
  return loadCursor(provider, fullPath).pipe(flatMapEager((cursor) => decodeCursor(cursor).pipe(mapEager(succeed), catchEager((issue) => {
3455
3303
  const error = new ConfigError(new SchemaError(fullPath.length > 0 ? new Pointer(fullPath, issue) : issue));
@@ -3561,4 +3409,4 @@ var srtArgv2 = (srtCommand, settingsFile, argv) => [
3561
3409
  ...argv
3562
3410
  ];
3563
3411
 
3564
- export { map, makeEquivalence, toNumber, 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, 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, harnessesUnsupportedInSrt2, compiled2, pinnedSrtCommand2, pinnedSrtStepCommand2, runSrtCli2, kitmanCacheDirectory2, srtSettings2, srtCacheEnvironment2, srtInheritedEnv2, inheritedEnvironment2, withOnlyEnvironment2, writeSrtSettings2, srtStepArgv2, srtArgv2 };
3412
+ 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, 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, harnessesUnsupportedInSrt2, compiled2, pinnedSrtCommand2, pinnedSrtStepCommand2, runSrtCli2, kitmanCacheDirectory2, srtSettings2, srtCacheEnvironment2, srtInheritedEnv2, inheritedEnvironment2, withOnlyEnvironment2, writeSrtSettings2, srtStepArgv2, srtArgv2 };
@@ -6,47 +6,7 @@ import {
6
6
  isObject,
7
7
  isJsonObject,
8
8
  isString
9
- } from "./chunk-tzz4fv17.js";
10
- import {
11
- join,
12
- interrupt,
13
- unbounded,
14
- publishUnsafe,
15
- unbounded2,
16
- offer,
17
- makeUnsafe3,
18
- make11,
19
- fromQueue,
20
- fromPubSub,
21
- map2,
22
- filter,
23
- decodeText,
24
- encodeText,
25
- splitLines,
26
- run,
27
- runHead,
28
- runForEach,
29
- FileSystem,
30
- Path,
31
- embeddedFile,
32
- extractEmbeddedFile,
33
- optionalEnv,
34
- operatorConfigHome,
35
- harnessesUnsupportedInSrt2,
36
- compiled2,
37
- pinnedSrtCommand2,
38
- pinnedSrtStepCommand2,
39
- runSrtCli2,
40
- kitmanCacheDirectory2,
41
- srtSettings2,
42
- srtCacheEnvironment2,
43
- srtInheritedEnv2,
44
- inheritedEnvironment2,
45
- withOnlyEnvironment2,
46
- writeSrtSettings2,
47
- srtStepArgv2,
48
- srtArgv2
49
- } from "./chunk-397fax43.js";
9
+ } from "./chunk-292vjjdz.js";
50
10
  import {
51
11
  pipeArguments,
52
12
  dual,
@@ -86,7 +46,7 @@ import {
86
46
  isFailure2,
87
47
  hasInterrupts,
88
48
  makeUnsafe5,
89
- make16,
49
+ make15,
90
50
  _await,
91
51
  fail5,
92
52
  isDoneUnsafe,
@@ -205,14 +165,13 @@ import {
205
165
  encodePrettyJsonString,
206
166
  decodeJsonStringSync,
207
167
  encodeUnknownJsonStringSync
208
- } from "./chunk-jbwk6k6m.js";
168
+ } from "./chunk-xq4k0mgr.js";
209
169
  import {
210
170
  Id,
211
171
  secretReference,
212
172
  secretPlaceholder
213
- } from "./chunk-kgdppbdr.js";
173
+ } from "./chunk-3wvp5n5a.js";
214
174
  import {
215
- currentTimeMillis,
216
175
  SecureRandom,
217
176
  layerWebCrypto,
218
177
  layer,
@@ -283,7 +242,48 @@ import {
283
242
  installCommand,
284
243
  checkServicesFile,
285
244
  checkServices
286
- } from "./chunk-d53rckf0.js";
245
+ } from "./chunk-h8fq958v.js";
246
+ import {
247
+ currentTimeMillis,
248
+ join,
249
+ interrupt,
250
+ unbounded,
251
+ publishUnsafe,
252
+ unbounded2,
253
+ offer,
254
+ makeUnsafe3,
255
+ make10,
256
+ fromQueue,
257
+ fromPubSub,
258
+ map2,
259
+ filter,
260
+ decodeText,
261
+ encodeText,
262
+ splitLines,
263
+ run,
264
+ runHead,
265
+ runForEach,
266
+ FileSystem,
267
+ Path,
268
+ embeddedFile,
269
+ extractEmbeddedFile,
270
+ optionalEnv,
271
+ operatorConfigHome,
272
+ harnessesUnsupportedInSrt2,
273
+ compiled2,
274
+ pinnedSrtCommand2,
275
+ pinnedSrtStepCommand2,
276
+ runSrtCli2,
277
+ kitmanCacheDirectory2,
278
+ srtSettings2,
279
+ srtCacheEnvironment2,
280
+ srtInheritedEnv2,
281
+ inheritedEnvironment2,
282
+ withOnlyEnvironment2,
283
+ writeSrtSettings2,
284
+ srtStepArgv2,
285
+ srtArgv2
286
+ } from "./chunk-2fqry6rd.js";
287
287
  import {
288
288
  writeAgentEnvironmentConfigFile2,
289
289
  readManifestSkillPaths2,
@@ -299,8 +299,8 @@ import {
299
299
  applyAgentEnvironmentMaterialization2,
300
300
  isPathWithin2,
301
301
  skillIdentity2
302
- } from "./chunk-7qbchfkf.js";
303
- import"./chunk-2tpysgqk.js";
302
+ } from "./chunk-jfgmhb6k.js";
303
+ import"./chunk-6tq2m8xc.js";
304
304
  import {
305
305
  egressAllowed,
306
306
  writeSecretRegistry,
@@ -310,7 +310,7 @@ import {
310
310
  secretFilter2,
311
311
  opaqueTunnelRefusal2,
312
312
  isOpaqueConnectReason2
313
- } from "./chunk-62565d52.js";
313
+ } from "./chunk-zms40x1v.js";
314
314
  import {
315
315
  sliceBytes2,
316
316
  maxLineBytes2,
@@ -318,23 +318,23 @@ import {
318
318
  decodedOption2,
319
319
  decoded2,
320
320
  readOpencode2
321
- } from "./chunk-0mgbryyd.js";
321
+ } from "./chunk-999xbcaa.js";
322
322
  import {
323
323
  uploadRunFile,
324
324
  programLease,
325
325
  rpcRunFiles,
326
326
  programHostsEnv,
327
327
  undeclaredHostsEnv
328
- } from "./chunk-92mjxge4.js";
329
- import"./chunk-2k1qfyvx.js";
328
+ } from "./chunk-ekkjbmr9.js";
329
+ import"./chunk-gmt7awee.js";
330
330
  import {
331
331
  nextInt
332
- } from "./chunk-76ctrqm6.js";
332
+ } from "./chunk-93vddjpx.js";
333
333
  import {
334
334
  ChildProcessSpawner,
335
335
  make3
336
- } from "./chunk-cakmwaed.js";
337
- import"./chunk-98r2t1s6.js";
336
+ } from "./chunk-bjexx93x.js";
337
+ import"./chunk-mak28dxp.js";
338
338
 
339
339
  // packages/core/src/sync-kit.ts
340
340
  import { createHash } from "crypto";
@@ -4866,9 +4866,7 @@ var claudeProviderRefusal = (line) => {
4866
4866
  if (!isJsonObject(line) || line.type !== "assistant" || line.isApiErrorMessage !== true)
4867
4867
  return;
4868
4868
  const said = bounded(isJsonObject(line.message) ? textOf(line.message.content) : "");
4869
- if (line.error === "rate_limit")
4870
- return { summary: said || "Rate limit reached", kind: "rate_limited" };
4871
- return line.error === "billing_error" ? { summary: said || "Billing error", kind: "out_of_quota" } : undefined;
4869
+ return line.error === "rate_limit" || line.error === "billing_error" ? { summary: said || "Usage limit reached", kind: "out_of_quota" } : undefined;
4872
4870
  };
4873
4871
  var codexQuotaErrors = new Set([
4874
4872
  "usage_limit_exceeded",
@@ -4891,6 +4889,15 @@ var codexProviderRefusal = (line) => {
4891
4889
  return { summary, kind: "login_refused" };
4892
4890
  return tag === "rate_limit_exceeded" || status === 429 ? { summary, kind: "rate_limited" } : undefined;
4893
4891
  };
4892
+ var codexRateLimits = (line) => {
4893
+ const event = isJsonObject(line) && line.type === "event_msg" ? line.payload : undefined;
4894
+ const limits = isJsonObject(event) && event.type === "token_count" ? event.rate_limits : undefined;
4895
+ return isJsonObject(limits) && (isJsonObject(limits.primary) || isJsonObject(limits.secondary)) ? limits : undefined;
4896
+ };
4897
+ var codexReset = (limits) => {
4898
+ const resets = [limits?.primary, limits?.secondary].flatMap((window) => isJsonObject(window) && isNumber(window.used_percent) && window.used_percent >= 100 && isNumber(window.resets_at) ? [window.resets_at] : []);
4899
+ return resetTime(resets.length === 0 ? undefined : Math.max(...resets));
4900
+ };
4894
4901
  var opencodeQuotaErrors = /^provider\.(quota|free-limit|go-limit|budget-limit|model-budget-limit|chatgpt-limit)$/;
4895
4902
  var opencodeProviderRefusal = (error) => {
4896
4903
  if (!isJsonObject(error))
@@ -5120,6 +5127,7 @@ var transcriptRelay = (input) => {
5120
5127
  const asking = new Set;
5121
5128
  let loginLost;
5122
5129
  let refusal;
5130
+ let codexLimits;
5123
5131
  let errorReadAt;
5124
5132
  const heard = (said) => {
5125
5133
  if (refusal === undefined || refusal.retried === true)
@@ -5209,10 +5217,16 @@ var transcriptRelay = (input) => {
5209
5217
  const value = decoded2(line);
5210
5218
  if (input.harness === "claude")
5211
5219
  loginLost = claudeLoginLost(value) ?? loginLost;
5212
- const refused = sessionRefusals.get(input.harness)?.(value);
5213
- if (refused !== undefined || input.harness === "pi" && piReplied(value))
5220
+ if (input.harness === "codex")
5221
+ codexLimits = codexRateLimits(value) ?? codexLimits;
5222
+ const said = sessionRefusals.get(input.harness)?.(value);
5223
+ const refused = said?.kind === "out_of_quota" && said.until === undefined && input.harness === "codex" ? { ...said, ...codexReset(codexLimits) } : said;
5224
+ const events = normalize(value);
5225
+ if (refused !== undefined)
5214
5226
  heard(refused);
5215
- return normalize(value).slice(0, maxEventsPerLine);
5227
+ else if (events.length > 0 || input.harness === "pi" && piReplied(value))
5228
+ refusal = undefined;
5229
+ return events.slice(0, maxEventsPerLine);
5216
5230
  }))).pipe(uninterruptible);
5217
5231
  yield* yieldNow;
5218
5232
  }
@@ -6559,7 +6573,7 @@ var codexAppServer = (binary = "codex") => (env) => gen(function* () {
6559
6573
  return {
6560
6574
  request: (method, params) => gen(function* () {
6561
6575
  const id = ++lastId;
6562
- const deferred = yield* make16();
6576
+ const deferred = yield* make15();
6563
6577
  pending.set(id, deferred);
6564
6578
  yield* send({ id, method, params });
6565
6579
  return yield* _await(deferred).pipe(mapError2((error) => new CodexAppServerFailed({ reason: `${method}: ${error.message}` })));
@@ -6702,7 +6716,7 @@ var kitmanMcpPreflight = (mcp) => gen(function* () {
6702
6716
  const server = yield* spawner.spawn(make3(mcp.command, [...mcp.args], {
6703
6717
  extendEnv: true,
6704
6718
  env: mcp.env,
6705
- stdin: { stream: make11(new TextEncoder().encode(handshake)), endOnDone: false },
6719
+ stdin: { stream: make10(new TextEncoder().encode(handshake)), endOnDone: false },
6706
6720
  stderr: "ignore"
6707
6721
  }));
6708
6722
  const reply = yield* server.stdout.pipe(decodeText, splitLines, map2((line) => getOrUndefined(decodeJsonStringOption(line))), filter((message) => isJsonObject(message) && message.id === 2), runHead);
@@ -6776,7 +6790,7 @@ var programProcessExecutor = (input) => (work) => gen(function* () {
6776
6790
  const exitCode = sandbox === undefined ? yield* gen(function* () {
6777
6791
  const spawner = yield* ChildProcessSpawner;
6778
6792
  const handle = yield* spawner.spawn(make3(input.bun ?? process.execPath, [file], {
6779
- stdin: make11(new TextEncoder().encode(stdin)),
6793
+ stdin: make10(new TextEncoder().encode(stdin)),
6780
6794
  stdout: "inherit",
6781
6795
  stderr: "inherit",
6782
6796
  extendEnv: false,
@@ -18,7 +18,7 @@ import {
18
18
  isMinLength,
19
19
  isMaxLength,
20
20
  FiniteFromString
21
- } from "./chunk-jbwk6k6m.js";
21
+ } from "./chunk-xq4k0mgr.js";
22
22
 
23
23
  // node_modules/.bun/effect@4.1.2/node_modules/effect/dist/JsonSchema.js
24
24
  var PRE_2020_TO_2020_COLLISIONS = ["$anchor", "$defs", "$dynamicAnchor", "$dynamicRef", "$vocabulary", "contentSchema", "dependentRequired", "dependentSchemas", "maxContains", "minContains", "prefixItems", "unevaluatedItems", "unevaluatedProperties"];
@@ -4,13 +4,13 @@ import {
4
4
  runnerRpcUrl2,
5
5
  makeRunnerRpcClient2,
6
6
  makeProgramRpcClient2
7
- } from "./chunk-2k1qfyvx.js";
8
- import"./chunk-98r2t1s6.js";
9
- import"./chunk-d53rckf0.js";
10
- import"./chunk-kgdppbdr.js";
11
- import"./chunk-tzz4fv17.js";
12
- import"./chunk-397fax43.js";
13
- import"./chunk-jbwk6k6m.js";
7
+ } from "./chunk-gmt7awee.js";
8
+ import"./chunk-mak28dxp.js";
9
+ import"./chunk-h8fq958v.js";
10
+ import"./chunk-3wvp5n5a.js";
11
+ import"./chunk-292vjjdz.js";
12
+ import"./chunk-2fqry6rd.js";
13
+ import"./chunk-xq4k0mgr.js";
14
14
  export {
15
15
  makeProgramRpcClient2 as makeProgramRpcClient,
16
16
  makeRunnerRpcClient2 as makeRunnerRpcClient,