@kitman-sh/cli 0.43.0 → 0.44.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.
- package/dist/{chunk-6x08g7m6.js → chunk-134jdvs6.js} +2 -2
- package/dist/{chunk-d4vhrja4.js → chunk-1c4wk9dr.js} +3 -3
- package/dist/{chunk-0qfaf9h3.js → chunk-1k6z8q79.js} +31 -38
- package/dist/{chunk-etrfc5cn.js → chunk-3mbp8cse.js} +29 -17
- package/dist/{chunk-jvwjreb0.js → chunk-3zy2vbp0.js} +10 -10
- package/dist/{chunk-b2btevxm.js → chunk-5ccz7ghp.js} +53 -39
- package/dist/{chunk-rbt72xjw.js → chunk-7rj9d0rp.js} +21 -2
- package/dist/{chunk-8b02x7vv.js → chunk-8a7337s1.js} +1 -1
- package/dist/{chunk-ea29sbaq.js → chunk-9h16pekj.js} +1 -1
- package/dist/{chunk-27e7m975.js → chunk-d0rx9esz.js} +4 -4
- package/dist/{chunk-fekh3jwz.js → chunk-d2tpz1yp.js} +1 -1
- package/dist/{chunk-91tvnb8f.js → chunk-dj873p0e.js} +14 -14
- package/dist/{chunk-hgvft7vy.js → chunk-dp6v658s.js} +4 -4
- package/dist/{chunk-fbddgx6q.js → chunk-dre4f6s4.js} +9 -9
- package/dist/{chunk-bqebfc06.js → chunk-gw0pc35c.js} +17 -17
- package/dist/{chunk-7ygg19wj.js → chunk-hmctc4eq.js} +3 -3
- package/dist/{chunk-qqc567gx.js → chunk-j60f2tr1.js} +4 -4
- package/dist/{chunk-98azvx6g.js → chunk-k2re3tp5.js} +1 -1
- package/dist/{chunk-ns26fbmk.js → chunk-ncp13gyf.js} +2 -2
- package/dist/{chunk-jq5h43a4.js → chunk-qkwkxn4d.js} +326 -98
- package/dist/{chunk-cnryphhh.js → chunk-wh3pjr9r.js} +10 -10
- package/dist/{chunk-qxpwkb5f.js → chunk-wkg1v0kd.js} +5 -5
- package/dist/{chunk-wv8kt4rb.js → chunk-wvnsqt17.js} +6 -6
- package/dist/{chunk-bqbfyqx6.js → chunk-x0ma41ys.js} +34 -24
- package/dist/{chunk-wy6gmtd9.js → chunk-zkvrxna8.js} +2 -2
- package/dist/{chunk-bbq7q5r6.js → chunk-zvmdyf3v.js} +53 -33
- package/dist/index.js +4 -4
- package/package.json +1 -1
|
@@ -38,7 +38,11 @@ import {
|
|
|
38
38
|
isSuccess,
|
|
39
39
|
getSuccess,
|
|
40
40
|
chunksOf,
|
|
41
|
+
toPredicate,
|
|
42
|
+
has,
|
|
43
|
+
compose,
|
|
41
44
|
TaggedError,
|
|
45
|
+
forkUnsafe,
|
|
42
46
|
succeed3,
|
|
43
47
|
void_2,
|
|
44
48
|
isSuccess2,
|
|
@@ -51,18 +55,22 @@ import {
|
|
|
51
55
|
isDoneUnsafe,
|
|
52
56
|
succeed4,
|
|
53
57
|
doneUnsafe,
|
|
58
|
+
into,
|
|
54
59
|
makeUnsafe6,
|
|
55
60
|
provide,
|
|
56
61
|
succeed5,
|
|
57
62
|
effect,
|
|
58
63
|
mergeAll,
|
|
59
64
|
die2,
|
|
65
|
+
hasInterruptsOnly,
|
|
60
66
|
findErrorOption,
|
|
67
|
+
filterInterruptors,
|
|
61
68
|
pretty,
|
|
62
69
|
exponential,
|
|
63
70
|
jittered,
|
|
64
71
|
spaced,
|
|
65
72
|
upTo,
|
|
73
|
+
isEffect,
|
|
66
74
|
all3,
|
|
67
75
|
validate,
|
|
68
76
|
findFirst,
|
|
@@ -82,6 +90,7 @@ import {
|
|
|
82
90
|
die3,
|
|
83
91
|
try_2,
|
|
84
92
|
yieldNow,
|
|
93
|
+
withFiber2,
|
|
85
94
|
flatMap3,
|
|
86
95
|
andThen2,
|
|
87
96
|
tap2,
|
|
@@ -122,12 +131,14 @@ import {
|
|
|
122
131
|
addFinalizer2,
|
|
123
132
|
ensuring2,
|
|
124
133
|
onExit,
|
|
134
|
+
interrupt3,
|
|
125
135
|
uninterruptible,
|
|
126
136
|
forever,
|
|
127
137
|
repeat,
|
|
128
138
|
forkIn,
|
|
129
139
|
forkScoped,
|
|
130
140
|
forkDetach,
|
|
141
|
+
runFork,
|
|
131
142
|
fnUntraced,
|
|
132
143
|
logWarning,
|
|
133
144
|
logError,
|
|
@@ -175,7 +186,58 @@ import {
|
|
|
175
186
|
decodeJsonStringSync,
|
|
176
187
|
encodeUnknownJsonStringSync,
|
|
177
188
|
storable
|
|
178
|
-
} from "./chunk-
|
|
189
|
+
} from "./chunk-x0ma41ys.js";
|
|
190
|
+
import {
|
|
191
|
+
empty2,
|
|
192
|
+
currentTimeMillis,
|
|
193
|
+
join,
|
|
194
|
+
interrupt,
|
|
195
|
+
interruptAll,
|
|
196
|
+
unbounded,
|
|
197
|
+
publishUnsafe,
|
|
198
|
+
unbounded2,
|
|
199
|
+
offer,
|
|
200
|
+
makeUnsafe3,
|
|
201
|
+
make11,
|
|
202
|
+
fromQueue,
|
|
203
|
+
fromPubSub,
|
|
204
|
+
map2,
|
|
205
|
+
filter,
|
|
206
|
+
take2,
|
|
207
|
+
mapAccum,
|
|
208
|
+
decodeText,
|
|
209
|
+
encodeText,
|
|
210
|
+
splitLines,
|
|
211
|
+
run,
|
|
212
|
+
runCollect,
|
|
213
|
+
runFold,
|
|
214
|
+
runHead,
|
|
215
|
+
runForEach,
|
|
216
|
+
FileSystem,
|
|
217
|
+
Path,
|
|
218
|
+
embeddedFile,
|
|
219
|
+
extractEmbeddedFile,
|
|
220
|
+
withDefault,
|
|
221
|
+
String2,
|
|
222
|
+
optionalEnv,
|
|
223
|
+
operatorConfigHome,
|
|
224
|
+
tempDirectoryScoped,
|
|
225
|
+
harnessesUnsupportedInSrt2,
|
|
226
|
+
harnessesUnsupportedInDocker2,
|
|
227
|
+
compiled2,
|
|
228
|
+
pinnedSrtCommand2,
|
|
229
|
+
pinnedSrtStepCommand2,
|
|
230
|
+
runSrtCli2,
|
|
231
|
+
kitmanCacheDirectory2,
|
|
232
|
+
srtSettings2,
|
|
233
|
+
srtCacheEnvironment2,
|
|
234
|
+
srtInheritedEnv2,
|
|
235
|
+
inheritedEnvironment2,
|
|
236
|
+
withOnlyEnvironment2,
|
|
237
|
+
writeSrtSettings2,
|
|
238
|
+
srtStepArgv2,
|
|
239
|
+
srtArgv2
|
|
240
|
+
} from "./chunk-3mbp8cse.js";
|
|
179
241
|
import {
|
|
180
242
|
SecureRandom,
|
|
181
243
|
layerWebCrypto,
|
|
@@ -231,6 +293,7 @@ import {
|
|
|
231
293
|
layer4,
|
|
232
294
|
SetupArchive,
|
|
233
295
|
kitMcpSecretNames,
|
|
296
|
+
WorkAvailable,
|
|
234
297
|
RunSettled,
|
|
235
298
|
UpdateAvailable,
|
|
236
299
|
HERDR_CORE_GENERATION2,
|
|
@@ -264,56 +327,7 @@ import {
|
|
|
264
327
|
checkServicesFile,
|
|
265
328
|
checkServices,
|
|
266
329
|
serviceChecks
|
|
267
|
-
} from "./chunk-
|
|
268
|
-
import {
|
|
269
|
-
currentTimeMillis,
|
|
270
|
-
join,
|
|
271
|
-
interrupt,
|
|
272
|
-
unbounded,
|
|
273
|
-
publishUnsafe,
|
|
274
|
-
unbounded2,
|
|
275
|
-
offer,
|
|
276
|
-
makeUnsafe3,
|
|
277
|
-
make11,
|
|
278
|
-
fromQueue,
|
|
279
|
-
fromPubSub,
|
|
280
|
-
map2,
|
|
281
|
-
filter,
|
|
282
|
-
take2,
|
|
283
|
-
mapAccum,
|
|
284
|
-
decodeText,
|
|
285
|
-
encodeText,
|
|
286
|
-
splitLines,
|
|
287
|
-
run,
|
|
288
|
-
runCollect,
|
|
289
|
-
runFold,
|
|
290
|
-
runHead,
|
|
291
|
-
runForEach,
|
|
292
|
-
FileSystem,
|
|
293
|
-
Path,
|
|
294
|
-
embeddedFile,
|
|
295
|
-
extractEmbeddedFile,
|
|
296
|
-
withDefault,
|
|
297
|
-
String2,
|
|
298
|
-
optionalEnv,
|
|
299
|
-
operatorConfigHome,
|
|
300
|
-
tempDirectoryScoped,
|
|
301
|
-
harnessesUnsupportedInSrt2,
|
|
302
|
-
harnessesUnsupportedInDocker2,
|
|
303
|
-
compiled2,
|
|
304
|
-
pinnedSrtCommand2,
|
|
305
|
-
pinnedSrtStepCommand2,
|
|
306
|
-
runSrtCli2,
|
|
307
|
-
kitmanCacheDirectory2,
|
|
308
|
-
srtSettings2,
|
|
309
|
-
srtCacheEnvironment2,
|
|
310
|
-
srtInheritedEnv2,
|
|
311
|
-
inheritedEnvironment2,
|
|
312
|
-
withOnlyEnvironment2,
|
|
313
|
-
writeSrtSettings2,
|
|
314
|
-
srtStepArgv2,
|
|
315
|
-
srtArgv2
|
|
316
|
-
} from "./chunk-etrfc5cn.js";
|
|
330
|
+
} from "./chunk-1k6z8q79.js";
|
|
317
331
|
import {
|
|
318
332
|
writeAgentEnvironmentConfigFile2,
|
|
319
333
|
readManifestSkillPaths2,
|
|
@@ -329,8 +343,8 @@ import {
|
|
|
329
343
|
applyAgentEnvironmentMaterialization2,
|
|
330
344
|
isPathWithin2,
|
|
331
345
|
skillIdentity2
|
|
332
|
-
} from "./chunk-
|
|
333
|
-
import"./chunk-
|
|
346
|
+
} from "./chunk-dre4f6s4.js";
|
|
347
|
+
import"./chunk-hmctc4eq.js";
|
|
334
348
|
import {
|
|
335
349
|
egressAllowed,
|
|
336
350
|
writeSecretRegistry,
|
|
@@ -340,7 +354,7 @@ import {
|
|
|
340
354
|
secretFilter2,
|
|
341
355
|
opaqueTunnelRefusal2,
|
|
342
356
|
isOpaqueConnectReason2
|
|
343
|
-
} from "./chunk-
|
|
357
|
+
} from "./chunk-zkvrxna8.js";
|
|
344
358
|
import {
|
|
345
359
|
sliceBytes2,
|
|
346
360
|
maxLineBytes2,
|
|
@@ -350,29 +364,29 @@ import {
|
|
|
350
364
|
lookAtOpencode2,
|
|
351
365
|
readOpencode2,
|
|
352
366
|
databaseStamp2
|
|
353
|
-
} from "./chunk-
|
|
367
|
+
} from "./chunk-wh3pjr9r.js";
|
|
354
368
|
import {
|
|
355
369
|
uploadRunFile,
|
|
356
370
|
programLease,
|
|
357
371
|
rpcRunFiles,
|
|
358
372
|
programHostsEnv,
|
|
359
373
|
undeclaredHostsEnv
|
|
360
|
-
} from "./chunk-
|
|
361
|
-
import"./chunk-
|
|
374
|
+
} from "./chunk-dj873p0e.js";
|
|
375
|
+
import"./chunk-d0rx9esz.js";
|
|
362
376
|
import {
|
|
363
377
|
nextInt
|
|
364
|
-
} from "./chunk-
|
|
365
|
-
import"./chunk-
|
|
378
|
+
} from "./chunk-8a7337s1.js";
|
|
379
|
+
import"./chunk-k2re3tp5.js";
|
|
366
380
|
import {
|
|
367
381
|
ChildProcessSpawner,
|
|
368
382
|
make3
|
|
369
|
-
} from "./chunk-
|
|
370
|
-
import"./chunk-
|
|
383
|
+
} from "./chunk-134jdvs6.js";
|
|
384
|
+
import"./chunk-wkg1v0kd.js";
|
|
371
385
|
import {
|
|
372
386
|
Id,
|
|
373
387
|
secretReference,
|
|
374
388
|
secretPlaceholder
|
|
375
|
-
} from "./chunk-
|
|
389
|
+
} from "./chunk-9h16pekj.js";
|
|
376
390
|
|
|
377
391
|
// packages/core/src/sync-kit.ts
|
|
378
392
|
import { createHash } from "crypto";
|
|
@@ -644,6 +658,91 @@ var outputTailWithParallelFailures = (failures, output) => {
|
|
|
644
658
|
`);
|
|
645
659
|
};
|
|
646
660
|
|
|
661
|
+
// node_modules/.bun/effect@4.1.2/node_modules/effect/dist/FiberSet.js
|
|
662
|
+
var TypeId = "~effect/FiberSet";
|
|
663
|
+
var isFiberSet = (u) => hasProperty(u, TypeId);
|
|
664
|
+
var Proto = {
|
|
665
|
+
[TypeId]: TypeId,
|
|
666
|
+
[Symbol.iterator]() {
|
|
667
|
+
if (this.state._tag === "Closed") {
|
|
668
|
+
return empty2();
|
|
669
|
+
}
|
|
670
|
+
return this.state.backing[Symbol.iterator]();
|
|
671
|
+
},
|
|
672
|
+
...PipeInspectableProto,
|
|
673
|
+
toJSON() {
|
|
674
|
+
return {
|
|
675
|
+
_id: "FiberSet",
|
|
676
|
+
state: this.state
|
|
677
|
+
};
|
|
678
|
+
}
|
|
679
|
+
};
|
|
680
|
+
var makeUnsafe = (backing, deferred) => {
|
|
681
|
+
const self = Object.create(Proto);
|
|
682
|
+
self.state = {
|
|
683
|
+
_tag: "Open",
|
|
684
|
+
backing
|
|
685
|
+
};
|
|
686
|
+
self.deferred = deferred;
|
|
687
|
+
return self;
|
|
688
|
+
};
|
|
689
|
+
var make = () => acquireRelease(sync2(() => makeUnsafe(new Set, makeUnsafe5())), (set) => suspend3(() => {
|
|
690
|
+
const state = set.state;
|
|
691
|
+
if (state._tag === "Closed")
|
|
692
|
+
return void_3;
|
|
693
|
+
set.state = {
|
|
694
|
+
_tag: "Closed"
|
|
695
|
+
};
|
|
696
|
+
const fibers = state.backing;
|
|
697
|
+
return interruptAll(fibers).pipe(into(set.deferred));
|
|
698
|
+
}));
|
|
699
|
+
var internalFiberId = -1;
|
|
700
|
+
var isInternalInterruption = /* @__PURE__ */ toPredicate(/* @__PURE__ */ compose(filterInterruptors, /* @__PURE__ */ has(internalFiberId)));
|
|
701
|
+
var addUnsafe = /* @__PURE__ */ dual((args) => isFiberSet(args[0]), (self, fiber, options) => {
|
|
702
|
+
if (self.state._tag === "Closed") {
|
|
703
|
+
fiber.interruptUnsafe(internalFiberId);
|
|
704
|
+
return;
|
|
705
|
+
} else if (self.state.backing.has(fiber)) {
|
|
706
|
+
return;
|
|
707
|
+
}
|
|
708
|
+
self.state.backing.add(fiber);
|
|
709
|
+
fiber.addObserver((exit) => {
|
|
710
|
+
if (self.state._tag === "Closed") {
|
|
711
|
+
return;
|
|
712
|
+
}
|
|
713
|
+
self.state.backing.delete(fiber);
|
|
714
|
+
if (isFailure2(exit) && (options?.propagateInterruption === true ? !isInternalInterruption(exit.cause) : !hasInterruptsOnly(exit.cause))) {
|
|
715
|
+
doneUnsafe(self.deferred, exit);
|
|
716
|
+
}
|
|
717
|
+
});
|
|
718
|
+
});
|
|
719
|
+
var constInterruptedFiber = /* @__PURE__ */ function() {
|
|
720
|
+
let fiber = undefined;
|
|
721
|
+
return () => {
|
|
722
|
+
if (fiber === undefined) {
|
|
723
|
+
fiber = runFork(interrupt3);
|
|
724
|
+
}
|
|
725
|
+
return fiber;
|
|
726
|
+
};
|
|
727
|
+
}();
|
|
728
|
+
var run2 = function() {
|
|
729
|
+
const self = arguments[0];
|
|
730
|
+
if (!isEffect(arguments[1])) {
|
|
731
|
+
const options = arguments[1];
|
|
732
|
+
return (effect) => runImpl(self, effect, options);
|
|
733
|
+
}
|
|
734
|
+
return runImpl(self, arguments[1], arguments[2]);
|
|
735
|
+
};
|
|
736
|
+
var runImpl = (self, effect, options) => withFiber2((parent) => {
|
|
737
|
+
if (self.state._tag === "Closed") {
|
|
738
|
+
return sync2(constInterruptedFiber);
|
|
739
|
+
}
|
|
740
|
+
const fiber = forkUnsafe(parent, effect, options?.startImmediately ?? true, true);
|
|
741
|
+
addUnsafe(self, fiber, options);
|
|
742
|
+
return succeed6(fiber);
|
|
743
|
+
});
|
|
744
|
+
var join2 = (self) => _await(self.deferred);
|
|
745
|
+
|
|
647
746
|
// packages/agent-runtime/src/agent-environment.ts
|
|
648
747
|
class AgentEnvironmentResolutionError extends TaggedError("AgentEnvironmentResolutionError") {
|
|
649
748
|
get message() {
|
|
@@ -3220,10 +3319,10 @@ var stepKitSetup = (agent, harness) => gen(function* () {
|
|
|
3220
3319
|
import { homedir as homedir2 } from "os";
|
|
3221
3320
|
|
|
3222
3321
|
// node_modules/.bun/effect@4.1.2/node_modules/effect/dist/SubscriptionRef.js
|
|
3223
|
-
var
|
|
3224
|
-
var
|
|
3322
|
+
var TypeId2 = "~effect/SubscriptionRef";
|
|
3323
|
+
var Proto2 = {
|
|
3225
3324
|
...PipeInspectableProto,
|
|
3226
|
-
[
|
|
3325
|
+
[TypeId2]: {
|
|
3227
3326
|
_A: identity
|
|
3228
3327
|
},
|
|
3229
3328
|
toJSON() {
|
|
@@ -3233,10 +3332,10 @@ var Proto = {
|
|
|
3233
3332
|
};
|
|
3234
3333
|
}
|
|
3235
3334
|
};
|
|
3236
|
-
var
|
|
3335
|
+
var make2 = (value) => map9(unbounded({
|
|
3237
3336
|
replay: 1
|
|
3238
3337
|
}), (pubsub) => {
|
|
3239
|
-
const self = Object.create(
|
|
3338
|
+
const self = Object.create(Proto2);
|
|
3240
3339
|
self.semaphore = makeUnsafe3(1);
|
|
3241
3340
|
self.value = value;
|
|
3242
3341
|
self.pubsub = pubsub;
|
|
@@ -4512,17 +4611,46 @@ var cpuQuota = (cpuMax) => {
|
|
|
4512
4611
|
const quota = Number(max) / Number(period);
|
|
4513
4612
|
return Number.isFinite(quota) && quota > 0 ? quota : undefined;
|
|
4514
4613
|
};
|
|
4515
|
-
var
|
|
4614
|
+
var readText = (file) => {
|
|
4615
|
+
try {
|
|
4616
|
+
return readFileSync(file, "utf8");
|
|
4617
|
+
} catch {
|
|
4618
|
+
return;
|
|
4619
|
+
}
|
|
4620
|
+
};
|
|
4621
|
+
var readBytes = (file) => {
|
|
4516
4622
|
try {
|
|
4517
|
-
return readFileSync(
|
|
4623
|
+
return readFileSync(file, "latin1");
|
|
4518
4624
|
} catch {
|
|
4519
4625
|
return;
|
|
4520
4626
|
}
|
|
4521
4627
|
};
|
|
4522
|
-
var
|
|
4523
|
-
|
|
4524
|
-
|
|
4628
|
+
var readAtBytePath = (file) => {
|
|
4629
|
+
try {
|
|
4630
|
+
return readFileSync(Buffer.from(file, "latin1"), "utf8");
|
|
4631
|
+
} catch {
|
|
4632
|
+
return;
|
|
4633
|
+
}
|
|
4525
4634
|
};
|
|
4635
|
+
var lineAfter = (text, prefix) => text.split(`
|
|
4636
|
+
`).find((line) => line.startsWith(prefix))?.slice(prefix.length);
|
|
4637
|
+
var cpuListSize = (list) => list.trim().split(",").filter((range) => range !== "").reduce((size, range) => {
|
|
4638
|
+
const [first, last = first] = range.split("-").map(Number);
|
|
4639
|
+
return size + (last ?? 0) - (first ?? 0) + 1;
|
|
4640
|
+
}, 0);
|
|
4641
|
+
var affinityCores = (status = readText("/proc/self/status")) => {
|
|
4642
|
+
const list = status === undefined ? undefined : lineAfter(status, "Cpus_allowed_list:")?.trim();
|
|
4643
|
+
const size = list === undefined ? Number.NaN : cpuListSize(list);
|
|
4644
|
+
return Number.isInteger(size) && size > 0 ? size : availableParallelism();
|
|
4645
|
+
};
|
|
4646
|
+
var cgroupCpuQuota = (procCgroup, read) => {
|
|
4647
|
+
const path = procCgroup === undefined ? undefined : lineAfter(procCgroup, "0::/");
|
|
4648
|
+
const named = path === undefined ? [] : path.split("/").filter((part) => part !== "" && part !== ".");
|
|
4649
|
+
const parts = named.includes("..") ? [] : named;
|
|
4650
|
+
const quotas = parts.map((_, depth) => parts.slice(0, parts.length - depth).join("/")).concat("").map((dir) => cpuQuota(read(`/sys/fs/cgroup${dir === "" ? "" : `/${dir}`}/cpu.max`))).filter((quota) => quota !== undefined);
|
|
4651
|
+
return quotas.length === 0 ? undefined : Math.min(...quotas);
|
|
4652
|
+
};
|
|
4653
|
+
var effectiveCores = (affinity = affinityCores(), quota = cgroupCpuQuota(readBytes("/proc/self/cgroup"), readAtBytePath)) => quota === undefined ? affinity : Math.min(affinity, quota);
|
|
4526
4654
|
var threadBudget = (cores, concurrency) => Math.max(2, Math.floor(cores / concurrency));
|
|
4527
4655
|
var runnerVerificationCap = (settings, cores = effectiveCores()) => verificationCap(settings, cores);
|
|
4528
4656
|
var checkThreadBudget = (settings, cores = effectiveCores()) => {
|
|
@@ -5037,7 +5165,7 @@ var runAttempt = (request, options) => gen(function* () {
|
|
|
5037
5165
|
return isTagged(terminal.failure, "HerdrCoreRpcError") ? failed("harness_launch_failed", `herdr-core refused to start the Harness: ${terminal.failure.message}`) : { status: "unreported", reason: "herdr_unavailable" };
|
|
5038
5166
|
}
|
|
5039
5167
|
const { address } = terminal.success;
|
|
5040
|
-
const seen = yield*
|
|
5168
|
+
const seen = yield* make2({ status: null, turn: 0, end: undefined });
|
|
5041
5169
|
yield* forkScoped(follow(options.core, attempt.id, address, seen));
|
|
5042
5170
|
const stop = gen(function* () {
|
|
5043
5171
|
if ((yield* get2(seen)).end === "unreachable")
|
|
@@ -5865,9 +5993,9 @@ var needsNothing = (git, input) => gen(function* () {
|
|
|
5865
5993
|
});
|
|
5866
5994
|
|
|
5867
5995
|
// node_modules/.bun/effect@4.1.2/node_modules/effect/dist/internal/matcher.js
|
|
5868
|
-
var
|
|
5996
|
+
var TypeId3 = "~effect/Match/Matcher";
|
|
5869
5997
|
var TypeMatcherProto = {
|
|
5870
|
-
[
|
|
5998
|
+
[TypeId3]: {
|
|
5871
5999
|
_input: identity,
|
|
5872
6000
|
_filters: identity,
|
|
5873
6001
|
_remaining: identity,
|
|
@@ -5890,7 +6018,7 @@ function makeTypeMatcher(select, cases) {
|
|
|
5890
6018
|
return matcher;
|
|
5891
6019
|
}
|
|
5892
6020
|
var ValueMatcherProto = {
|
|
5893
|
-
[
|
|
6021
|
+
[TypeId3]: {
|
|
5894
6022
|
_input: identity,
|
|
5895
6023
|
_filters: identity,
|
|
5896
6024
|
_result: identity,
|
|
@@ -6224,31 +6352,36 @@ function superviseReplica(input) {
|
|
|
6224
6352
|
});
|
|
6225
6353
|
const claimTurn = makeUnsafe3(1);
|
|
6226
6354
|
let emptyAt = -1;
|
|
6227
|
-
const wokenControl = (control, gate, signals) =>
|
|
6228
|
-
|
|
6229
|
-
|
|
6230
|
-
|
|
6231
|
-
|
|
6232
|
-
|
|
6233
|
-
|
|
6234
|
-
|
|
6235
|
-
|
|
6236
|
-
|
|
6237
|
-
|
|
6238
|
-
|
|
6239
|
-
|
|
6355
|
+
const wokenControl = (control, gate, signals, demand) => {
|
|
6356
|
+
let lastAsked;
|
|
6357
|
+
return {
|
|
6358
|
+
...control,
|
|
6359
|
+
claim: (idempotencyKey, options) => claimTurn.withPermit(gen(function* () {
|
|
6360
|
+
const generation = yield* signals.generation;
|
|
6361
|
+
const retry = lastAsked === idempotencyKey;
|
|
6362
|
+
lastAsked = idempotencyKey;
|
|
6363
|
+
if (!retry && generation <= emptyAt)
|
|
6364
|
+
return {};
|
|
6365
|
+
const { claimed, asked } = yield* claimThrough(control, gate, idempotencyKey, options);
|
|
6366
|
+
if (claimed.workUnit === undefined && asked?.takesVerifications !== false && (demand === undefined || (yield* demand.offeredNew)))
|
|
6367
|
+
emptyAt = Math.max(emptyAt, generation);
|
|
6368
|
+
return claimed;
|
|
6369
|
+
}))
|
|
6370
|
+
};
|
|
6371
|
+
};
|
|
6372
|
+
const runSlot = (capacitySlot, demand) => gen(function* () {
|
|
6240
6373
|
let idleIterations = 0;
|
|
6241
|
-
let woken =
|
|
6374
|
+
let woken = demand === undefined;
|
|
6242
6375
|
while (true) {
|
|
6243
|
-
if (
|
|
6244
|
-
|
|
6245
|
-
continue;
|
|
6246
|
-
}
|
|
6376
|
+
if (demand !== undefined && (yield* demand.past))
|
|
6377
|
+
return;
|
|
6247
6378
|
const seen = signals === undefined ? 0 : yield* signals.generation;
|
|
6248
|
-
const control = input.control(capacitySlot);
|
|
6379
|
+
const control = demand === undefined ? input.control(capacitySlot) : demand.claiming(input.control(capacitySlot));
|
|
6249
6380
|
const gate = input.verifications === undefined ? undefined : verificationGate(input.verifications);
|
|
6250
|
-
const claiming = signals !== undefined && woken ? wokenControl(control, gate, signals) : gatedControl(control, gate);
|
|
6381
|
+
const claiming = signals !== undefined && woken ? wokenControl(control, gate, signals, demand) : gatedControl(control, gate);
|
|
6251
6382
|
const exit2 = yield* exit(runReplica(claiming, input.executor, signals).pipe(ensuring2(gate?.free ?? void_3)));
|
|
6383
|
+
if (demand !== undefined)
|
|
6384
|
+
yield* demand.free;
|
|
6252
6385
|
if (isSuccess2(exit2) && exit2.value.status === "completed") {
|
|
6253
6386
|
idleIterations = 0;
|
|
6254
6387
|
woken = false;
|
|
@@ -6259,6 +6392,8 @@ function superviseReplica(input) {
|
|
|
6259
6392
|
woken = true;
|
|
6260
6393
|
continue;
|
|
6261
6394
|
}
|
|
6395
|
+
if (isSuccess2(exit2) && demand !== undefined && (yield* demand.spare))
|
|
6396
|
+
return;
|
|
6262
6397
|
if (isSuccess2(exit2) && signals !== undefined) {
|
|
6263
6398
|
woken = isSome(yield* signals.workSignalledAfter(seen).pipe(timeoutOption(IdleRecheck)));
|
|
6264
6399
|
continue;
|
|
@@ -6272,10 +6407,17 @@ function superviseReplica(input) {
|
|
|
6272
6407
|
yield* sleep(idleBackoff(idleIterations++));
|
|
6273
6408
|
}
|
|
6274
6409
|
});
|
|
6275
|
-
const
|
|
6410
|
+
const slotName = (index) => input.slots?.[index] ?? `slot-${index + 1}`;
|
|
6411
|
+
const heartbeat = input.control(slotName(0)).heartbeatReplica;
|
|
6412
|
+
let wakeAfterHeartbeat = false;
|
|
6413
|
+
const wake = signals === undefined ? void_3 : signals.push(WorkAvailable.make({}));
|
|
6276
6414
|
const replicaHeartbeat = gen(function* () {
|
|
6277
6415
|
while (true) {
|
|
6278
6416
|
const exit2 = yield* exit(retryTransient(heartbeatCall(heartbeat)));
|
|
6417
|
+
if (isSuccess2(exit2) && wakeAfterHeartbeat) {
|
|
6418
|
+
wakeAfterHeartbeat = false;
|
|
6419
|
+
yield* wake;
|
|
6420
|
+
}
|
|
6279
6421
|
if (isFailure2(exit2)) {
|
|
6280
6422
|
const error = findErrorOption(exit2.cause);
|
|
6281
6423
|
if (isSome(error) && error.value.kind === "unauthorized")
|
|
@@ -6285,7 +6427,88 @@ function superviseReplica(input) {
|
|
|
6285
6427
|
yield* sleep(ReplicaHeartbeatInterval);
|
|
6286
6428
|
}
|
|
6287
6429
|
});
|
|
6288
|
-
|
|
6430
|
+
const slots = input.concurrency === undefined ? forEach(input.slots, (slot) => runSlot(slot), { concurrency: "unbounded", discard: true }) : slotsOnDemand(input.concurrency);
|
|
6431
|
+
function slotsOnDemand(concurrency) {
|
|
6432
|
+
return scoped(gen(function* () {
|
|
6433
|
+
const fibers = yield* make();
|
|
6434
|
+
const started = new Set;
|
|
6435
|
+
let idle = 0;
|
|
6436
|
+
let busySlots = 0;
|
|
6437
|
+
let claimsInFlight = 0;
|
|
6438
|
+
let lastConcurrency = 0;
|
|
6439
|
+
const startSpare = gen(function* () {
|
|
6440
|
+
if (idle > 0 || started.size >= (yield* concurrency))
|
|
6441
|
+
return;
|
|
6442
|
+
let index = 0;
|
|
6443
|
+
while (started.has(index))
|
|
6444
|
+
index += 1;
|
|
6445
|
+
started.add(index);
|
|
6446
|
+
idle += 1;
|
|
6447
|
+
yield* run2(fibers, runSlot(slotName(index), slotDemand(index)).pipe(ensuring2(sync2(() => started.delete(index)))));
|
|
6448
|
+
});
|
|
6449
|
+
const slotDemand = (index) => {
|
|
6450
|
+
let busy = false;
|
|
6451
|
+
const claimed = suspend3(() => {
|
|
6452
|
+
if (busy)
|
|
6453
|
+
return void_3;
|
|
6454
|
+
busy = true;
|
|
6455
|
+
busySlots += 1;
|
|
6456
|
+
idle -= 1;
|
|
6457
|
+
return startSpare;
|
|
6458
|
+
});
|
|
6459
|
+
const stop = () => {
|
|
6460
|
+
idle -= 1;
|
|
6461
|
+
return true;
|
|
6462
|
+
};
|
|
6463
|
+
let lastAsked;
|
|
6464
|
+
let offeredNew = false;
|
|
6465
|
+
const claimWithin = (control, idempotencyKey, options) => gen(function* () {
|
|
6466
|
+
const full = busySlots + claimsInFlight >= (yield* concurrency);
|
|
6467
|
+
const retry = lastAsked === idempotencyKey;
|
|
6468
|
+
lastAsked = idempotencyKey;
|
|
6469
|
+
offeredNew = !full;
|
|
6470
|
+
if (full && !retry)
|
|
6471
|
+
return {};
|
|
6472
|
+
let reserved = !full;
|
|
6473
|
+
if (reserved)
|
|
6474
|
+
claimsInFlight += 1;
|
|
6475
|
+
const unreserve = sync2(() => {
|
|
6476
|
+
if (reserved)
|
|
6477
|
+
claimsInFlight -= 1;
|
|
6478
|
+
reserved = false;
|
|
6479
|
+
});
|
|
6480
|
+
return yield* control.claim(idempotencyKey, full ? { ...options, heldOnly: true } : options).pipe(tap2((result) => result.workUnit === undefined ? void_3 : andThen2(unreserve, claimed)), ensuring2(unreserve));
|
|
6481
|
+
});
|
|
6482
|
+
return {
|
|
6483
|
+
claiming: (control) => ({
|
|
6484
|
+
...control,
|
|
6485
|
+
claim: (idempotencyKey, options) => claimWithin(control, idempotencyKey, options)
|
|
6486
|
+
}),
|
|
6487
|
+
free: sync2(() => {
|
|
6488
|
+
if (!busy)
|
|
6489
|
+
return;
|
|
6490
|
+
busy = false;
|
|
6491
|
+
busySlots -= 1;
|
|
6492
|
+
idle += 1;
|
|
6493
|
+
}),
|
|
6494
|
+
past: map9(concurrency, (limit) => (index >= limit || busySlots >= limit) && stop()),
|
|
6495
|
+
spare: sync2(() => idle > 1 && stop()),
|
|
6496
|
+
offeredNew: sync2(() => offeredNew)
|
|
6497
|
+
};
|
|
6498
|
+
};
|
|
6499
|
+
const wakeOnRise = flatMap3(concurrency, (now) => {
|
|
6500
|
+
const rose = lastConcurrency > 0 && now > lastConcurrency;
|
|
6501
|
+
lastConcurrency = now;
|
|
6502
|
+
if (!rose)
|
|
6503
|
+
return void_3;
|
|
6504
|
+
wakeAfterHeartbeat = true;
|
|
6505
|
+
return wake;
|
|
6506
|
+
});
|
|
6507
|
+
const keepSpare = forever(andThen2(wakeOnRise, andThen2(startSpare, sleep(ConcurrencyRecheck))));
|
|
6508
|
+
return yield* raceFirst(keepSpare, join2(fibers));
|
|
6509
|
+
}));
|
|
6510
|
+
}
|
|
6511
|
+
return all3([replicaHeartbeat, slots], {
|
|
6289
6512
|
concurrency: "unbounded",
|
|
6290
6513
|
discard: true
|
|
6291
6514
|
}).pipe(andThen2(never));
|
|
@@ -10417,6 +10640,7 @@ export {
|
|
|
10417
10640
|
SkillMaterializationRefused2 as SkillMaterializationRefused,
|
|
10418
10641
|
StepAttemptLabel,
|
|
10419
10642
|
StepProcesses,
|
|
10643
|
+
affinityCores,
|
|
10420
10644
|
afterFreshService,
|
|
10421
10645
|
afterMergeRunner,
|
|
10422
10646
|
agentStepExecutionLimit,
|
|
@@ -10429,6 +10653,7 @@ export {
|
|
|
10429
10653
|
attemptTempDirectory,
|
|
10430
10654
|
carriedLoginHosts,
|
|
10431
10655
|
carriedProviderHosts,
|
|
10656
|
+
cgroupCpuQuota,
|
|
10432
10657
|
checkDockerAlias,
|
|
10433
10658
|
checkDockerClientConfig,
|
|
10434
10659
|
checkDockerDaemonArgs,
|
|
@@ -10449,6 +10674,7 @@ export {
|
|
|
10449
10674
|
compiled2 as compiled,
|
|
10450
10675
|
composeAgentEnvironmentSyncPlan,
|
|
10451
10676
|
controlFailureKind,
|
|
10677
|
+
cpuListSize,
|
|
10452
10678
|
cpuQuota,
|
|
10453
10679
|
defaultAgentRuntimeUserConfigPath,
|
|
10454
10680
|
detectHarnesses2 as detectHarnesses,
|
|
@@ -10521,6 +10747,8 @@ export {
|
|
|
10521
10747
|
psProcessTable,
|
|
10522
10748
|
publishedPort,
|
|
10523
10749
|
pushWork,
|
|
10750
|
+
readAtBytePath,
|
|
10751
|
+
readBytes,
|
|
10524
10752
|
readManifestSkillPaths2 as readManifestSkillPaths,
|
|
10525
10753
|
redactedWith,
|
|
10526
10754
|
redactingSecrets,
|
|
@@ -1,4 +1,12 @@
|
|
|
1
1
|
// @bun
|
|
2
|
+
import {
|
|
3
|
+
currentTimeMillis,
|
|
4
|
+
make11,
|
|
5
|
+
runForEach,
|
|
6
|
+
toPull,
|
|
7
|
+
FileSystem,
|
|
8
|
+
compiled2
|
|
9
|
+
} from "./chunk-3mbp8cse.js";
|
|
2
10
|
import {
|
|
3
11
|
isSome,
|
|
4
12
|
getOrElse,
|
|
@@ -35,19 +43,11 @@ import {
|
|
|
35
43
|
isJsonObject,
|
|
36
44
|
isString2,
|
|
37
45
|
encodeUnknownJsonStringSync
|
|
38
|
-
} from "./chunk-
|
|
39
|
-
import {
|
|
40
|
-
currentTimeMillis,
|
|
41
|
-
make11,
|
|
42
|
-
runForEach,
|
|
43
|
-
toPull,
|
|
44
|
-
FileSystem,
|
|
45
|
-
compiled2
|
|
46
|
-
} from "./chunk-etrfc5cn.js";
|
|
46
|
+
} from "./chunk-x0ma41ys.js";
|
|
47
47
|
import {
|
|
48
48
|
ChildProcessSpawner,
|
|
49
49
|
make3
|
|
50
|
-
} from "./chunk-
|
|
50
|
+
} from "./chunk-134jdvs6.js";
|
|
51
51
|
|
|
52
52
|
// packages/agent-runtime/src/opencode-store.ts
|
|
53
53
|
import { lstatSync, readFileSync, realpathSync, writeSync } from "fs";
|