@kitman-sh/cli 0.14.3 → 0.14.4

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 (27) hide show
  1. package/dist/{chunk-bbf0jzsc.js → chunk-0kreahhj.js} +1 -1
  2. package/dist/{chunk-91j33xf2.js → chunk-4yvafzhp.js} +6 -6
  3. package/dist/{chunk-ctpgfdzf.js → chunk-5c4tn29r.js} +3 -3
  4. package/dist/{chunk-3f6mzrm7.js → chunk-6zwwrpve.js} +1 -1
  5. package/dist/{chunk-my9vcmfw.js → chunk-af3m4nhz.js} +44 -30
  6. package/dist/{chunk-a4mkjaxa.js → chunk-c6fanp7r.js} +6 -6
  7. package/dist/{chunk-7q3t3x0x.js → chunk-dz7qcbpp.js} +6 -6
  8. package/dist/{chunk-zpp4jg4a.js → chunk-ec01eq70.js} +215 -71
  9. package/dist/{chunk-rvnem2bt.js → chunk-kg32dz1w.js} +4 -4
  10. package/dist/{chunk-zxmx605h.js → chunk-me1zn085.js} +2 -2
  11. package/dist/{chunk-7v1n7a6k.js → chunk-nmw831xh.js} +4 -4
  12. package/dist/{chunk-y0y2gg8d.js → chunk-p9wzycsm.js} +2 -2
  13. package/dist/{chunk-9anvghq2.js → chunk-pcyscxe1.js} +2 -2
  14. package/dist/{chunk-hasfatd4.js → chunk-pvv8y59t.js} +5 -5
  15. package/dist/{chunk-65dpe0ev.js → chunk-q1y9qjjp.js} +5 -3
  16. package/dist/{chunk-34748vfg.js → chunk-qd9bkybz.js} +123 -288
  17. package/dist/{chunk-f96vy2h9.js → chunk-qnb3a82t.js} +4 -4
  18. package/dist/{chunk-44kx62t6.js → chunk-ra22g5nv.js} +7 -7
  19. package/dist/{chunk-tebzffha.js → chunk-rx2cg7rn.js} +17 -17
  20. package/dist/{chunk-2w9a76nr.js → chunk-tnrmd4hz.js} +178 -163
  21. package/dist/{chunk-er9n65mh.js → chunk-v26jmjr0.js} +9 -9
  22. package/dist/{chunk-daem5h1c.js → chunk-wvhm5fgh.js} +14 -14
  23. package/dist/{chunk-dhtx14r5.js → chunk-x2jjnfff.js} +3 -3
  24. package/dist/{chunk-9avbsbvk.js → chunk-yv2mq2e9.js} +6 -1
  25. package/dist/{chunk-rgrpvnwg.js → chunk-zv1sshtj.js} +22 -22
  26. package/dist/index.js +4 -4
  27. package/package.json +1 -1
@@ -25,21 +25,21 @@ import {
25
25
  isString2,
26
26
  encodePrettyJsonString,
27
27
  decodeJsonStringSync
28
- } from "./chunk-zpp4jg4a.js";
28
+ } from "./chunk-ec01eq70.js";
29
29
  import {
30
30
  FileSystem,
31
31
  Path,
32
32
  optionalEnv,
33
33
  tempDirectoryScoped
34
- } from "./chunk-2w9a76nr.js";
34
+ } from "./chunk-tnrmd4hz.js";
35
35
  import {
36
36
  AgentHarnessIds,
37
37
  sha2562,
38
38
  runCommand2
39
- } from "./chunk-34748vfg.js";
39
+ } from "./chunk-qd9bkybz.js";
40
40
  import {
41
41
  NpmRegistry
42
- } from "./chunk-dhtx14r5.js";
42
+ } from "./chunk-x2jjnfff.js";
43
43
 
44
44
  // packages/agent-runtime/src/config-convergence.ts
45
45
  var writeAgentEnvironmentConfigFile2 = fnUntraced(function* (file, content, keep = {}) {
@@ -13,27 +13,27 @@ import {
13
13
  isJsonObject,
14
14
  decodeJsonString,
15
15
  encodePrettyJsonString
16
- } from "./chunk-zpp4jg4a.js";
16
+ } from "./chunk-ec01eq70.js";
17
+ import"./chunk-yv2mq2e9.js";
17
18
  import {
18
19
  FileSystem,
19
20
  Path
20
- } from "./chunk-2w9a76nr.js";
21
+ } from "./chunk-tnrmd4hz.js";
21
22
  import {
22
23
  tomlTableHeader2,
23
24
  tomlKeyPath2,
24
25
  kitmanSkillEntry,
25
26
  isPathWithin2
26
- } from "./chunk-f96vy2h9.js";
27
+ } from "./chunk-qnb3a82t.js";
27
28
  import {
28
29
  instructionsStart,
29
30
  instructionsEnd,
30
31
  renderMcpServer,
31
32
  materializeKitSetup,
32
33
  tomlInline
33
- } from "./chunk-34748vfg.js";
34
- import"./chunk-dhtx14r5.js";
35
- import"./chunk-zxmx605h.js";
36
- import"./chunk-9avbsbvk.js";
34
+ } from "./chunk-qd9bkybz.js";
35
+ import"./chunk-x2jjnfff.js";
36
+ import"./chunk-me1zn085.js";
37
37
 
38
38
  // packages/agent-runtime/src/kit-setup-sync.ts
39
39
  class KitSyncError extends TaggedError("KitSyncError") {
@@ -12,7 +12,7 @@ import {
12
12
  add,
13
13
  getOrUndefinedUnsafe,
14
14
  getUnsafe,
15
- get3,
15
+ get4,
16
16
  Reference,
17
17
  toMillis,
18
18
  isSuccess,
@@ -96,7 +96,19 @@ import {
96
96
  Defect,
97
97
  Exit,
98
98
  toCodecJson
99
- } from "./chunk-zpp4jg4a.js";
99
+ } from "./chunk-ec01eq70.js";
100
+ import {
101
+ interrupt,
102
+ getCurrent,
103
+ makeUnsafe2,
104
+ bounded,
105
+ offerAll,
106
+ failCause,
107
+ end,
108
+ shutdownUnsafe,
109
+ fromQueue,
110
+ unwrap
111
+ } from "./chunk-tnrmd4hz.js";
100
112
  import {
101
113
  Clock,
102
114
  empty,
@@ -111,19 +123,7 @@ import {
111
123
  ParseOptions,
112
124
  RpcClientDefect,
113
125
  RpcClientError
114
- } from "./chunk-34748vfg.js";
115
- import {
116
- interrupt,
117
- getCurrent,
118
- makeUnsafe2,
119
- bounded,
120
- offerAll,
121
- failCause,
122
- end,
123
- shutdownUnsafe,
124
- fromQueue,
125
- unwrap
126
- } from "./chunk-2w9a76nr.js";
126
+ } from "./chunk-qd9bkybz.js";
127
127
 
128
128
  // node_modules/.bun/effect@4.1.2/node_modules/effect/dist/workers/Transferable.js
129
129
  class Collector extends (/* @__PURE__ */ Service2()("effect/workers/Transferable/Collector")) {
@@ -237,7 +237,7 @@ var makeNoSerialization = /* @__PURE__ */ fnUntraced(function* (group, options)
237
237
  const disableTracing = options?.disableTracing ?? false;
238
238
  const generateRequestId = options?.generateRequestId ?? (() => requestIdCounter++);
239
239
  const services = yield* context();
240
- const scope = get3(services, Scope);
240
+ const scope = get4(services, Scope);
241
241
  const entries = new Map;
242
242
  let isShutdown = false;
243
243
  yield* addFinalizer(scope, withFiber2((parent) => {
@@ -643,7 +643,7 @@ var makeRpcSchemas = (codecFor) => {
643
643
  return entry;
644
644
  }
645
645
  const streamSchemas = getStreamSchemas(rpc.successSchema);
646
- const parseOptions = get3(rpc.annotations, ParseOptions);
646
+ const parseOptions = get4(rpc.annotations, ParseOptions);
647
647
  const exitSchema2 = exitSchema(rpc);
648
648
  let decodeDiscardExit;
649
649
  entry = {
@@ -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,
@@ -81,6 +84,7 @@ import {
81
84
  fail4,
82
85
  interrupt2,
83
86
  void_2,
87
+ isSuccess2,
84
88
  isFailure2,
85
89
  asVoidAll,
86
90
  makeUnsafe5,
@@ -152,12 +156,14 @@ import {
152
156
  tapError2,
153
157
  ignoreCause,
154
158
  orElseSucceed,
159
+ sleep,
155
160
  raceFirst,
156
161
  when,
157
162
  matchCauseEffect,
158
163
  context,
159
164
  contextWith,
160
165
  provideContext2,
166
+ scope2,
161
167
  scoped,
162
168
  scopedWith,
163
169
  acquireRelease,
@@ -168,6 +174,7 @@ import {
168
174
  interrupt3,
169
175
  onInterrupt,
170
176
  uninterruptible,
177
+ uninterruptibleMask2,
171
178
  forever,
172
179
  forkChild,
173
180
  forkIn,
@@ -179,6 +186,7 @@ import {
179
186
  mapEager,
180
187
  flatMapEager,
181
188
  catchEager,
189
+ fromInputUnsafe2,
182
190
  Pointer,
183
191
  passthrough,
184
192
  transformEffect,
@@ -190,11 +198,11 @@ import {
190
198
  toEncoded,
191
199
  decodeUnknownEffect,
192
200
  SchemaError,
193
- make16,
201
+ make17,
194
202
  String4,
195
203
  toCodecStringTree,
196
204
  encodeUnknownJsonStringSync
197
- } from "./chunk-zpp4jg4a.js";
205
+ } from "./chunk-ec01eq70.js";
198
206
 
199
207
  // node_modules/.bun/effect@4.1.2/node_modules/effect/dist/Iterable.js
200
208
  var headUnsafe = (self) => {
@@ -243,141 +251,6 @@ var makeEquivalence = (equivalence) => {
243
251
  return (self, that) => is(self, that) && is(that, self);
244
252
  };
245
253
 
246
- // node_modules/.bun/effect@4.1.2/node_modules/effect/dist/ByteSize.js
247
- var bigint0 = /* @__PURE__ */ BigInt(0);
248
- var bigint1 = /* @__PURE__ */ BigInt(1);
249
- var decimalBase = /* @__PURE__ */ BigInt(1000);
250
- var binaryBase = /* @__PURE__ */ BigInt(1024);
251
- var decimalUnits = [{
252
- symbol: "B",
253
- factor: bigint1,
254
- names: ["B", "byte", "bytes"]
255
- }, {
256
- symbol: "kB",
257
- factor: decimalBase,
258
- names: ["kB", "kilobyte", "kilobytes"]
259
- }, {
260
- symbol: "MB",
261
- factor: decimalBase ** /* @__PURE__ */ BigInt(2),
262
- names: ["MB", "megabyte", "megabytes"]
263
- }, {
264
- symbol: "GB",
265
- factor: decimalBase ** /* @__PURE__ */ BigInt(3),
266
- names: ["GB", "gigabyte", "gigabytes"]
267
- }, {
268
- symbol: "TB",
269
- factor: decimalBase ** /* @__PURE__ */ BigInt(4),
270
- names: ["TB", "terabyte", "terabytes"]
271
- }, {
272
- symbol: "PB",
273
- factor: decimalBase ** /* @__PURE__ */ BigInt(5),
274
- names: ["PB", "petabyte", "petabytes"]
275
- }, {
276
- symbol: "EB",
277
- factor: decimalBase ** /* @__PURE__ */ BigInt(6),
278
- names: ["EB", "exabyte", "exabytes"]
279
- }, {
280
- symbol: "ZB",
281
- factor: decimalBase ** /* @__PURE__ */ BigInt(7),
282
- names: ["ZB", "zettabyte", "zettabytes"]
283
- }, {
284
- symbol: "YB",
285
- factor: decimalBase ** /* @__PURE__ */ BigInt(8),
286
- names: ["YB", "yottabyte", "yottabytes"]
287
- }, {
288
- symbol: "RB",
289
- factor: decimalBase ** /* @__PURE__ */ BigInt(9),
290
- names: ["RB", "ronnabyte", "ronnabytes"]
291
- }, {
292
- symbol: "QB",
293
- factor: decimalBase ** /* @__PURE__ */ BigInt(10),
294
- names: ["QB", "quettabyte", "quettabytes"]
295
- }];
296
- var binaryUnits = [decimalUnits[0], {
297
- symbol: "KiB",
298
- factor: binaryBase,
299
- names: ["KiB", "kibibyte", "kibibytes"]
300
- }, {
301
- symbol: "MiB",
302
- factor: binaryBase ** /* @__PURE__ */ BigInt(2),
303
- names: ["MiB", "mebibyte", "mebibytes"]
304
- }, {
305
- symbol: "GiB",
306
- factor: binaryBase ** /* @__PURE__ */ BigInt(3),
307
- names: ["GiB", "gibibyte", "gibibytes"]
308
- }, {
309
- symbol: "TiB",
310
- factor: binaryBase ** /* @__PURE__ */ BigInt(4),
311
- names: ["TiB", "tebibyte", "tebibytes"]
312
- }, {
313
- symbol: "PiB",
314
- factor: binaryBase ** /* @__PURE__ */ BigInt(5),
315
- names: ["PiB", "pebibyte", "pebibytes"]
316
- }, {
317
- symbol: "EiB",
318
- factor: binaryBase ** /* @__PURE__ */ BigInt(6),
319
- names: ["EiB", "exbibyte", "exbibytes"]
320
- }, {
321
- symbol: "ZiB",
322
- factor: binaryBase ** /* @__PURE__ */ BigInt(7),
323
- names: ["ZiB", "zebibyte", "zebibytes"]
324
- }, {
325
- symbol: "YiB",
326
- factor: binaryBase ** /* @__PURE__ */ BigInt(8),
327
- names: ["YiB", "yobibyte", "yobibytes"]
328
- }];
329
- var allUnits = [...decimalUnits, .../* @__PURE__ */ binaryUnits.slice(1)];
330
- var unitsByName = /* @__PURE__ */ new Map(/* @__PURE__ */ allUnits.flatMap((unit) => unit.names.map((name) => [name, unit])));
331
- var make = (value) => value;
332
- var invalid = (message) => {
333
- throw new Error(`Invalid ByteSize: ${message}`);
334
- };
335
- var fromNumber = (input) => {
336
- if (!Number.isSafeInteger(input) || input < 0) {
337
- return invalid(`expected a non-negative safe integer, received ${input}`);
338
- }
339
- return make(BigInt(input));
340
- };
341
- var maxSafeInteger = /* @__PURE__ */ BigInt(Number.MAX_SAFE_INTEGER);
342
- var scaleDecimal = (quantity, factor) => {
343
- const match = /^(\d+)(?:\.(\d+))?(?:e([+-]\d+))?$/.exec(quantity);
344
- if (match === null)
345
- return;
346
- const fraction = match[2] ?? "";
347
- const numerator = BigInt(match[1] + fraction) * factor;
348
- const shift = Number(match[3] ?? 0) - fraction.length;
349
- if (shift >= 0)
350
- return numerator * BigInt(10) ** BigInt(shift);
351
- const scale = BigInt(10) ** BigInt(-shift);
352
- return numerator % scale === bigint0 ? numerator / scale : undefined;
353
- };
354
- var fromStringUnsafe = (input) => {
355
- const match = /^\s*(\d+(?:\.\d+)?)\s*([A-Za-z]+)\s*$/.exec(input);
356
- if (match === null)
357
- return invalid(`unsupported syntax ${JSON.stringify(input)}`);
358
- const unit = unitsByName.get(match[2]);
359
- if (unit === undefined)
360
- return invalid(`unsupported unit ${JSON.stringify(match[2])}`);
361
- const value = scaleDecimal(match[1], unit.factor);
362
- if (value === undefined)
363
- return invalid(`${JSON.stringify(input)} does not represent an integral number of bytes`);
364
- return make(value);
365
- };
366
- var fromInputUnsafe = (input) => {
367
- switch (typeof input) {
368
- case "bigint":
369
- if (input < bigint0)
370
- return invalid(`expected a non-negative bigint, received ${input}`);
371
- return make(input);
372
- case "number":
373
- return fromNumber(input);
374
- case "string":
375
- return fromStringUnsafe(input);
376
- }
377
- return invalid(`unsupported input ${input}`);
378
- };
379
- var bytes = (value) => typeof value === "bigint" ? fromInputUnsafe(value) : fromNumber(value);
380
-
381
254
  // node_modules/.bun/effect@4.1.2/node_modules/effect/dist/Fiber.js
382
255
  var join = fiberJoin;
383
256
  var interrupt = fiberInterrupt;
@@ -930,7 +803,7 @@ var isIgnorable = (error) => isMissing(error) || error.reason._tag === "Permissi
930
803
  var isNotLink = (error) => isIgnorable(error) || error.reason._tag === "Unknown";
931
804
  var DIRECTORY_CONCURRENCY = 16;
932
805
  var byName = /* @__PURE__ */ mapInput(String3, (entry) => entry.name);
933
- var make2 = (fs) => (pattern, options) => walk(fs, compile([pattern], options?.dot ?? false), options);
806
+ var make = (fs) => (pattern, options) => walk(fs, compile([pattern], options?.dot ?? false), options);
934
807
  var walk = /* @__PURE__ */ fnUntraced(function* (fs, compiled, options) {
935
808
  if (compiled.initial.size === 0) {
936
809
  return [];
@@ -1108,7 +981,7 @@ var badArgument = (options) => new PlatformError(new BadArgument(options));
1108
981
 
1109
982
  // node_modules/.bun/effect@4.1.2/node_modules/effect/dist/Latch.js
1110
983
  var makeUnsafe2 = makeLatchUnsafe;
1111
- var make3 = makeLatch;
984
+ var make2 = makeLatch;
1112
985
 
1113
986
  // node_modules/.bun/effect@4.1.2/node_modules/effect/dist/MutableRef.js
1114
987
  var TypeId2 = "~effect/MutableRef";
@@ -1134,7 +1007,7 @@ var set = /* @__PURE__ */ dual(2, (self, value) => {
1134
1007
 
1135
1008
  // node_modules/.bun/effect@4.1.2/node_modules/effect/dist/MutableList.js
1136
1009
  var Empty = /* @__PURE__ */ Symbol.for("effect/MutableList/Empty");
1137
- var make4 = () => ({
1010
+ var make3 = () => ({
1138
1011
  head: undefined,
1139
1012
  tail: undefined,
1140
1013
  length: 0
@@ -1283,8 +1156,8 @@ var remove = (self, value) => filter2(self, (v) => v !== value);
1283
1156
  // node_modules/.bun/effect@4.1.2/node_modules/effect/dist/PubSub.js
1284
1157
  var TypeId3 = "~effect/PubSub";
1285
1158
  var SubscriptionTypeId = "~effect/PubSub/Subscription";
1286
- var make5 = (options) => sync2(() => makePubSubUnsafe(options.atomicPubSub(), new Map, makeUnsafe6(), makeUnsafe2(false), make8(false), options.strategy(), make8(none())));
1287
- var unbounded = (options) => make5({
1159
+ var make4 = (options) => sync2(() => makePubSubUnsafe(options.atomicPubSub(), new Map, makeUnsafe6(), makeUnsafe2(false), make8(false), options.strategy(), make8(none())));
1160
+ var unbounded = (options) => make4({
1288
1161
  atomicPubSub: () => makeAtomicUnbounded(options),
1289
1162
  strategy: () => new DroppingStrategy
1290
1163
  });
@@ -1302,7 +1175,7 @@ var publishUnsafe = /* @__PURE__ */ dual(2, (self, value) => {
1302
1175
  return false;
1303
1176
  });
1304
1177
  var subscribe = (self) => uninterruptible(contextWith((services) => {
1305
- const localScope = get3(services, Scope);
1178
+ const localScope = get4(services, Scope);
1306
1179
  const scope = forkUnsafe(self.scope);
1307
1180
  const subscription = makeSubscriptionUnsafe(self.pubsub, self.subscribers, self.strategy, self.ended);
1308
1181
  return addFinalizer(scope, unsubscribe(subscription)).pipe(andThen2(addFinalizerExit(localScope, (exit) => close(scope, exit))), as(subscription));
@@ -1378,7 +1251,7 @@ var removeSubscribers = (subscribers, subscription, pollers) => {
1378
1251
  subscribers.delete(subscription);
1379
1252
  }
1380
1253
  };
1381
- var makeSubscriptionUnsafe = (pubsub, subscribers, strategy, ended) => new SubscriptionImpl(pubsub, subscribers, pubsub.subscribe(), make4(), makeUnsafe2(false), make8(false), strategy, pubsub.replayWindow(), ended);
1254
+ var makeSubscriptionUnsafe = (pubsub, subscribers, strategy, ended) => new SubscriptionImpl(pubsub, subscribers, pubsub.subscribe(), make3(), makeUnsafe2(false), make8(false), strategy, pubsub.replayWindow(), ended);
1382
1255
  class UnboundedPubSub {
1383
1256
  publisherHead = {
1384
1257
  value: AbsentValue,
@@ -1800,7 +1673,7 @@ var make9 = (options) => withFiber((fiber) => {
1800
1673
  self.dispatcher = fiber.currentDispatcher;
1801
1674
  self.capacity = options?.capacity ?? Number.POSITIVE_INFINITY;
1802
1675
  self.strategy = options?.strategy ?? "suspend";
1803
- self.messages = make4();
1676
+ self.messages = make3();
1804
1677
  self.scheduleRunning = false;
1805
1678
  self.state = {
1806
1679
  _tag: "Open",
@@ -2452,7 +2325,7 @@ var mergeAll = /* @__PURE__ */ dual(2, (channels, {
2452
2325
  }) => fromTransformBracket(fnUntraced(function* (upstream, scope, forkedScope) {
2453
2326
  const concurrencyN = concurrency === "unbounded" ? Number.MAX_SAFE_INTEGER : Math.max(1, concurrency);
2454
2327
  const semaphore = switch_ ? undefined : makeUnsafe3(concurrencyN);
2455
- const doneLatch = yield* make3(true);
2328
+ const doneLatch = yield* make2(true);
2456
2329
  const fibers = new Map;
2457
2330
  const queue = yield* bounded(bufferSize);
2458
2331
  yield* addFinalizer(forkedScope, shutdown(queue));
@@ -2759,16 +2632,158 @@ var forEachArray = (f) => fromTransform2((upstream) => upstream.pipe(flatMap3(f)
2759
2632
  }), catchDone(() => endVoid)));
2760
2633
  var unwrap3 = (effect) => fromChannel(unwrap2(map8(effect, toChannel)));
2761
2634
 
2635
+ // node_modules/.bun/effect@4.1.2/node_modules/effect/dist/internal/rcRef.js
2636
+ var TypeId8 = "~effect/RcRef";
2637
+ var stateEmpty = {
2638
+ _tag: "Empty"
2639
+ };
2640
+ var stateClosed = {
2641
+ _tag: "Closed"
2642
+ };
2643
+ var variance2 = {
2644
+ _A: identity,
2645
+ _E: identity
2646
+ };
2647
+
2648
+ class RcRefImpl {
2649
+ [TypeId8] = variance2;
2650
+ pipe() {
2651
+ return pipeArguments(this, arguments);
2652
+ }
2653
+ state = stateEmpty;
2654
+ acquire;
2655
+ context;
2656
+ scope;
2657
+ idleTimeToLive;
2658
+ constructor(acquire, context, scope, idleTimeToLive) {
2659
+ this.acquire = acquire;
2660
+ this.context = context;
2661
+ this.scope = scope;
2662
+ this.idleTimeToLive = idleTimeToLive;
2663
+ }
2664
+ }
2665
+ var make5 = (options) => withFiber2((fiber) => {
2666
+ const context = fiber.context;
2667
+ const scope = get4(context, Scope);
2668
+ const ref = new RcRefImpl(options.acquire, context, scope, options.idleTimeToLive !== undefined ? fromInputUnsafe(options.idleTimeToLive) : undefined);
2669
+ return as(addFinalizerExit(scope, () => {
2670
+ const state = ref.state;
2671
+ ref.state = stateClosed;
2672
+ if (state._tag === "Acquired")
2673
+ return close(state.scope, void_2);
2674
+ if (state._tag === "Acquiring")
2675
+ return interrupt(state.fiber);
2676
+ return void_3;
2677
+ }), ref);
2678
+ });
2679
+ var getState = (self, restore) => {
2680
+ switch (self.state._tag) {
2681
+ case "Closed": {
2682
+ return interrupt3;
2683
+ }
2684
+ case "Acquired": {
2685
+ const state = self.state;
2686
+ state.refCount++;
2687
+ return state.fiber ? as(interrupt(state.fiber), state) : succeed6(state);
2688
+ }
2689
+ case "Acquiring": {
2690
+ const state = self.state;
2691
+ state.awaiters++;
2692
+ return awaitAcquiring(self, state, restore);
2693
+ }
2694
+ case "Empty": {
2695
+ const acquiring = {
2696
+ _tag: "Acquiring",
2697
+ fiber: undefined,
2698
+ awaiters: 1,
2699
+ acquired: undefined
2700
+ };
2701
+ self.state = acquiring;
2702
+ const scope = makeUnsafe6();
2703
+ const acquire = provideContext2(self.acquire, add(self.context, Scope, scope)).pipe(flatMap3((value) => {
2704
+ if (self.state !== acquiring) {
2705
+ return interrupt3;
2706
+ }
2707
+ const state = {
2708
+ _tag: "Acquired",
2709
+ value,
2710
+ scope,
2711
+ fiber: undefined,
2712
+ refCount: acquiring.awaiters,
2713
+ invalidated: false
2714
+ };
2715
+ self.state = state;
2716
+ acquiring.acquired = state;
2717
+ return succeed6(state);
2718
+ }), onExit((exit) => {
2719
+ if (isSuccess2(exit))
2720
+ return void_3;
2721
+ if (self.state === acquiring)
2722
+ self.state = stateEmpty;
2723
+ return close(scope, exit);
2724
+ }));
2725
+ acquiring.fiber = runForkWith(getCurrent().context)(acquire);
2726
+ return awaitAcquiring(self, acquiring, restore);
2727
+ }
2728
+ }
2729
+ };
2730
+ var awaitAcquiring = (self, acquiring, restore) => onExit(restore(join(acquiring.fiber)), (exit) => {
2731
+ const acquired = acquiring.acquired;
2732
+ if (acquired !== undefined) {
2733
+ return isFailure2(exit) ? release(self, acquired) : void_3;
2734
+ }
2735
+ if (--acquiring.awaiters > 0 || self.state !== acquiring)
2736
+ return void_3;
2737
+ self.state = stateEmpty;
2738
+ return interrupt(acquiring.fiber);
2739
+ });
2740
+ var get2 = (self_) => {
2741
+ const self = self_;
2742
+ return uninterruptibleMask2((restore) => flatMap3(scope2, (scope) => flatMap3(getState(self, restore), (state) => as(addFinalizerExit(scope, () => release(self, state)), state.value))));
2743
+ };
2744
+ var release = (self, state) => {
2745
+ state.refCount--;
2746
+ if (state.refCount > 0) {
2747
+ return void_3;
2748
+ }
2749
+ const idleTimeToLive = self.idleTimeToLive;
2750
+ if (idleTimeToLive === undefined || state.invalidated) {
2751
+ if (self.state === state) {
2752
+ self.state = stateEmpty;
2753
+ }
2754
+ return close(state.scope, void_2);
2755
+ } else if (!isFinite(idleTimeToLive)) {
2756
+ return void_3;
2757
+ }
2758
+ state.fiber = uninterruptibleMask2((restore) => flatMap3(restore(sleep(idleTimeToLive)), () => {
2759
+ if (self.state === state && state.refCount === 0) {
2760
+ self.state = stateEmpty;
2761
+ return ignoreCause(close(state.scope, void_2), {
2762
+ log: "Unhandled",
2763
+ message: "Unhandled error in RcRef finalizer"
2764
+ });
2765
+ }
2766
+ return void_3;
2767
+ })).pipe(ensuring2(sync2(() => {
2768
+ state.fiber = undefined;
2769
+ })), runForkWith(self.context), runIn(self.scope));
2770
+ return void_3;
2771
+ };
2772
+
2773
+ // node_modules/.bun/effect@4.1.2/node_modules/effect/dist/RcRef.js
2774
+ var make10 = make5;
2775
+ var get3 = get2;
2776
+
2762
2777
  // node_modules/.bun/effect@4.1.2/node_modules/effect/dist/Stream.js
2763
- var TypeId8 = "~effect/Stream";
2764
- var isStream = (u) => hasProperty(u, TypeId8);
2778
+ var TypeId9 = "~effect/Stream";
2779
+ var isStream = (u) => hasProperty(u, TypeId9);
2765
2780
  var fromChannel2 = fromChannel3;
2766
2781
  var fromPull2 = (pull) => fromChannel2(fromPull(pull));
2767
2782
  var transformPull2 = (self, f) => fromChannel2(fromTransform((_, scope) => flatMap3(toPullScoped(self.channel, scope), (pull) => f(pull, scope))));
2768
2783
  var toChannel2 = (stream) => stream.channel;
2769
2784
  var callback = (f, options) => fromChannel2(callbackArray(f, options));
2770
2785
  var empty2 = /* @__PURE__ */ fromChannel2(empty);
2771
- var make10 = (...values) => fromArray2(values);
2786
+ var make11 = (...values) => fromArray2(values);
2772
2787
  var suspend = (stream) => {
2773
2788
  const suspended = fromChannel2(suspend4(() => stream().channel));
2774
2789
  suspendedStreams.set(suspended, stream);
@@ -2949,12 +2964,12 @@ var toReadableStreamWith = /* @__PURE__ */ dual((args) => isStream(args[0]), (se
2949
2964
  var toReadableStreamEffect = /* @__PURE__ */ dual((args) => isStream(args[0]), (self, options) => map8(context(), (context) => toReadableStreamWith(self, context, options)));
2950
2965
 
2951
2966
  // node_modules/.bun/effect@4.1.2/node_modules/effect/dist/FileSystem.js
2952
- var TypeId9 = "~effect/FileSystem";
2967
+ var TypeId10 = "~effect/FileSystem";
2953
2968
  var FileSystem = /* @__PURE__ */ Service2("effect/FileSystem");
2954
- var make11 = (impl) => FileSystem.of({
2969
+ var make12 = (impl) => FileSystem.of({
2955
2970
  ...impl,
2956
- [TypeId9]: TypeId9,
2957
- glob: make2(impl),
2971
+ [TypeId10]: TypeId10,
2972
+ glob: make(impl),
2958
2973
  exists: (path) => pipe(impl.access(path), as(true), catchTag("PlatformError", (e) => e.reason._tag === "NotFound" ? succeed6(false) : fail7(e))),
2959
2974
  readFileString: (path, encoding) => flatMap3(impl.readFile(path), (_) => try_2({
2960
2975
  try: () => new TextDecoder(encoding).decode(_),
@@ -2969,11 +2984,11 @@ var make11 = (impl) => FileSystem.of({
2969
2984
  const file = yield* impl.open(path, {
2970
2985
  flag: "r"
2971
2986
  });
2972
- const offset = options?.offset === undefined ? undefined : fromInputUnsafe(options.offset);
2987
+ const offset = options?.offset === undefined ? undefined : fromInputUnsafe2(options.offset);
2973
2988
  if (offset) {
2974
2989
  yield* file.seek(offset, "start");
2975
2990
  }
2976
- const bytesToRead = options?.bytesToRead === undefined ? undefined : fromInputUnsafe(options.bytesToRead);
2991
+ const bytesToRead = options?.bytesToRead === undefined ? undefined : fromInputUnsafe2(options.bytesToRead);
2977
2992
  let totalBytesRead = BigInt(0);
2978
2993
  const chunkSize = Number(BigInt(options?.chunkSize ?? 64 * 1024));
2979
2994
  const readChunk = file.readAlloc(chunkSize);
@@ -3009,11 +3024,11 @@ class WatchBackend extends (/* @__PURE__ */ Service2()("effect/FileSystem/WatchB
3009
3024
  }
3010
3025
 
3011
3026
  // node_modules/.bun/effect@4.1.2/node_modules/effect/dist/Path.js
3012
- var TypeId10 = "~effect/Path";
3027
+ var TypeId11 = "~effect/Path";
3013
3028
  var Path = /* @__PURE__ */ Service2("effect/Path");
3014
- var make12 = (impl) => Path.of({
3029
+ var make13 = (impl) => Path.of({
3015
3030
  ...impl,
3016
- [TypeId10]: TypeId10,
3031
+ [TypeId11]: TypeId11,
3017
3032
  resolveWithin(root, input) {
3018
3033
  if (impl.parse(input).root !== "")
3019
3034
  return none();
@@ -3148,7 +3163,7 @@ function trieNodeAt(root, path) {
3148
3163
  }
3149
3164
 
3150
3165
  // node_modules/.bun/effect@4.1.2/node_modules/effect/dist/Config.js
3151
- var TypeId11 = "~effect/Config";
3166
+ var TypeId12 = "~effect/Config";
3152
3167
  class ConfigError {
3153
3168
  _tag = "ConfigError";
3154
3169
  name = "ConfigError";
@@ -3170,7 +3185,7 @@ var Proto2 = {
3170
3185
  return this.parse(fiber.getRef(ConfigProvider));
3171
3186
  }
3172
3187
  }),
3173
- [TypeId11]: TypeId11,
3188
+ [TypeId12]: TypeId12,
3174
3189
  toJSON() {
3175
3190
  return {
3176
3191
  _id: "Config"
@@ -3309,7 +3324,7 @@ var toConfigCursorAST = /* @__PURE__ */ memoize((root) => {
3309
3324
  function schema(codec, path) {
3310
3325
  const codecStringTree = toCodecStringTree(codec);
3311
3326
  const encodedAst = toEncoded(codecStringTree.ast);
3312
- const decodeCursor = decodeUnknownEffect(make16(toConfigCursorAST(codecStringTree.ast)));
3327
+ const decodeCursor = decodeUnknownEffect(make17(toConfigCursorAST(codecStringTree.ast)));
3313
3328
  const localPath = typeof path === "string" ? [path] : path ?? [];
3314
3329
  return make7((provider, pathPrefix) => {
3315
3330
  const fullPath = [...pathPrefix, ...localPath];
@@ -3426,4 +3441,4 @@ var srtArgv2 = (srtCommand, settingsFile, argv) => [
3426
3441
  ...argv
3427
3442
  ];
3428
3443
 
3429
- export { map, makeEquivalence, bytes, join, interrupt, getCurrent, runIn, BadArgument, systemError, badArgument, makeUnsafe2, make8, unbounded, publishUnsafe, make9, bounded, sliding, unbounded2, offer, offerUnsafe, offerAll, fail, failCause, failCauseUnsafe, end, endUnsafe, shutdownUnsafe, take, poll, makeUnsafe3, fromTransform, mapDone, isSink, fromChannel, drain, isStream, fromChannel2, callback, empty2, make10, suspend, fail2, fromQueue, fromPubSub, fromReadableStream, unwrap, map2, tap, drainFork, concat, merge2, filter, catchCause, tapError, mapError, take2, transduce, decodeText, encodeText, splitLines, interruptWhen, ensuring, provideContext, run, runCollect, runFold, runHead, runForEach, runDrain, mkString, mkArrayBuffer, toReadableStreamEffect, FileSystem, make11, FileTypeId, WatchBackend, Path, make12, embeddedFile, extractEmbeddedFile, map3, all, withDefault, option, String2, optionalEnv, operatorConfigHome, tempDirectoryScoped, harnessesUnsupportedInSrt2, compiled2, pinnedSrtCommand2, pinnedSrtStepCommand2, runSrtCli2, kitmanCacheDirectory2, srtSettings2, srtCacheEnvironment2, srtInheritedEnv2, inheritedEnvironment2, withOnlyEnvironment2, writeSrtSettings2, srtStepArgv2, srtArgv2 };
3444
+ export { map, makeEquivalence, 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, compiled2, pinnedSrtCommand2, pinnedSrtStepCommand2, runSrtCli2, kitmanCacheDirectory2, srtSettings2, srtCacheEnvironment2, srtInheritedEnv2, inheritedEnvironment2, withOnlyEnvironment2, writeSrtSettings2, srtStepArgv2, srtArgv2 };