@kitman-sh/cli 0.35.0 → 0.36.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-t9dmwy8x.js → chunk-3t6aayxz.js} +12 -12
- package/dist/{chunk-xc7kg57m.js → chunk-49hz9619.js} +45 -45
- package/dist/{chunk-rbpn35g5.js → chunk-4qjfn1sa.js} +1 -1
- package/dist/{chunk-znhjs0t6.js → chunk-5kqt4bqp.js} +1 -1
- package/dist/{chunk-5e1ndtnp.js → chunk-6bwf81dt.js} +2 -2
- package/dist/{chunk-z0gqrc8c.js → chunk-8fyfsajs.js} +17 -17
- package/dist/{chunk-ee7ss0df.js → chunk-96bzt4ck.js} +3 -3
- package/dist/{chunk-er0e8d8v.js → chunk-9nbqzdqp.js} +60 -14
- package/dist/{chunk-n0bp958m.js → chunk-c2ngtf1e.js} +4 -4
- package/dist/{chunk-r9x4ehsy.js → chunk-crw9pdwb.js} +6 -6
- package/dist/{chunk-64arqv10.js → chunk-dw0v4ke8.js} +9 -9
- package/dist/{chunk-t205gnzc.js → chunk-ewf73f4k.js} +17 -17
- package/dist/{chunk-c8eg05nh.js → chunk-gnq1ryhx.js} +4 -4
- package/dist/{chunk-61dmxexa.js → chunk-h2f26xbd.js} +28 -70
- package/dist/{chunk-n01c55f9.js → chunk-pn7egyb2.js} +5 -5
- package/dist/{chunk-tsefrrxz.js → chunk-rbj2eant.js} +1 -1
- package/dist/{chunk-56gs4z53.js → chunk-s34am3kw.js} +7 -7
- package/dist/{chunk-4qrb09w4.js → chunk-samxkpbz.js} +3 -3
- package/dist/{chunk-yhat3rhw.js → chunk-t89zj8wf.js} +125 -116
- package/dist/{chunk-ke4rajdh.js → chunk-th0znqwv.js} +72 -28
- package/dist/{chunk-1hgsf81a.js → chunk-tsx0347c.js} +1 -1
- package/dist/{chunk-wkkjyzpx.js → chunk-vwaf8peb.js} +4 -4
- package/dist/{chunk-q8e58p57.js → chunk-vz38kngm.js} +2 -2
- package/dist/{chunk-nna9pwp0.js → chunk-wab1jevd.js} +60 -48
- package/dist/{chunk-y3c9pxez.js → chunk-wckr96wg.js} +7 -7
- package/dist/{chunk-qqb6djs7.js → chunk-x29m7k25.js} +2 -2
- package/dist/index.js +4 -4
- package/package.json +1 -1
|
@@ -44,7 +44,7 @@ import {
|
|
|
44
44
|
isFailure2,
|
|
45
45
|
hasInterrupts,
|
|
46
46
|
makeUnsafe5,
|
|
47
|
-
|
|
47
|
+
make16,
|
|
48
48
|
_await,
|
|
49
49
|
fail5,
|
|
50
50
|
isDoneUnsafe,
|
|
@@ -174,7 +174,7 @@ import {
|
|
|
174
174
|
decodeJsonStringSync,
|
|
175
175
|
encodeUnknownJsonStringSync,
|
|
176
176
|
storable
|
|
177
|
-
} from "./chunk-
|
|
177
|
+
} from "./chunk-h2f26xbd.js";
|
|
178
178
|
import {
|
|
179
179
|
SecureRandom,
|
|
180
180
|
layerWebCrypto,
|
|
@@ -262,7 +262,7 @@ import {
|
|
|
262
262
|
checkServicesFile,
|
|
263
263
|
checkServices,
|
|
264
264
|
serviceChecks
|
|
265
|
-
} from "./chunk-
|
|
265
|
+
} from "./chunk-t89zj8wf.js";
|
|
266
266
|
import {
|
|
267
267
|
currentTimeMillis,
|
|
268
268
|
join,
|
|
@@ -272,7 +272,7 @@ import {
|
|
|
272
272
|
unbounded2,
|
|
273
273
|
offer,
|
|
274
274
|
makeUnsafe3,
|
|
275
|
-
|
|
275
|
+
make11,
|
|
276
276
|
fromQueue,
|
|
277
277
|
fromPubSub,
|
|
278
278
|
map2,
|
|
@@ -311,7 +311,7 @@ import {
|
|
|
311
311
|
writeSrtSettings2,
|
|
312
312
|
srtStepArgv2,
|
|
313
313
|
srtArgv2
|
|
314
|
-
} from "./chunk-
|
|
314
|
+
} from "./chunk-8fyfsajs.js";
|
|
315
315
|
import {
|
|
316
316
|
writeAgentEnvironmentConfigFile2,
|
|
317
317
|
readManifestSkillPaths2,
|
|
@@ -327,8 +327,8 @@ import {
|
|
|
327
327
|
applyAgentEnvironmentMaterialization2,
|
|
328
328
|
isPathWithin2,
|
|
329
329
|
skillIdentity2
|
|
330
|
-
} from "./chunk-
|
|
331
|
-
import"./chunk-
|
|
330
|
+
} from "./chunk-c2ngtf1e.js";
|
|
331
|
+
import"./chunk-96bzt4ck.js";
|
|
332
332
|
import {
|
|
333
333
|
egressAllowed,
|
|
334
334
|
writeSecretRegistry,
|
|
@@ -338,7 +338,7 @@ import {
|
|
|
338
338
|
secretFilter2,
|
|
339
339
|
opaqueTunnelRefusal2,
|
|
340
340
|
isOpaqueConnectReason2
|
|
341
|
-
} from "./chunk-
|
|
341
|
+
} from "./chunk-vz38kngm.js";
|
|
342
342
|
import {
|
|
343
343
|
sliceBytes2,
|
|
344
344
|
maxLineBytes2,
|
|
@@ -348,29 +348,29 @@ import {
|
|
|
348
348
|
lookAtOpencode2,
|
|
349
349
|
readOpencode2,
|
|
350
350
|
databaseStamp2
|
|
351
|
-
} from "./chunk-
|
|
351
|
+
} from "./chunk-s34am3kw.js";
|
|
352
352
|
import {
|
|
353
353
|
uploadRunFile,
|
|
354
354
|
programLease,
|
|
355
355
|
rpcRunFiles,
|
|
356
356
|
programHostsEnv,
|
|
357
357
|
undeclaredHostsEnv
|
|
358
|
-
} from "./chunk-
|
|
359
|
-
import"./chunk-
|
|
358
|
+
} from "./chunk-pn7egyb2.js";
|
|
359
|
+
import"./chunk-dw0v4ke8.js";
|
|
360
360
|
import {
|
|
361
361
|
nextInt
|
|
362
|
-
} from "./chunk-
|
|
363
|
-
import"./chunk-
|
|
362
|
+
} from "./chunk-5kqt4bqp.js";
|
|
363
|
+
import"./chunk-tsx0347c.js";
|
|
364
364
|
import {
|
|
365
365
|
ChildProcessSpawner,
|
|
366
|
-
|
|
367
|
-
} from "./chunk-
|
|
368
|
-
import"./chunk-
|
|
366
|
+
make3
|
|
367
|
+
} from "./chunk-9nbqzdqp.js";
|
|
368
|
+
import"./chunk-ewf73f4k.js";
|
|
369
369
|
import {
|
|
370
370
|
Id,
|
|
371
371
|
secretReference,
|
|
372
372
|
secretPlaceholder
|
|
373
|
-
} from "./chunk-
|
|
373
|
+
} from "./chunk-4qjfn1sa.js";
|
|
374
374
|
|
|
375
375
|
// packages/core/src/sync-kit.ts
|
|
376
376
|
import { createHash } from "crypto";
|
|
@@ -6033,18 +6033,59 @@ function runReplica(control, executor, signals) {
|
|
|
6033
6033
|
var ConcurrencyRecheck = seconds(1);
|
|
6034
6034
|
var IdleRecheck = seconds(60);
|
|
6035
6035
|
var idleBackoff = (idleIterations) => millis(Math.min(1000 * 2 ** idleIterations, 30000));
|
|
6036
|
+
var verificationPermits = (cap) => {
|
|
6037
|
+
let held = 0;
|
|
6038
|
+
return {
|
|
6039
|
+
full: map9(cap, (limit) => held >= limit),
|
|
6040
|
+
take: map9(cap, (limit) => {
|
|
6041
|
+
if (held >= limit)
|
|
6042
|
+
return false;
|
|
6043
|
+
held += 1;
|
|
6044
|
+
return true;
|
|
6045
|
+
}),
|
|
6046
|
+
give: sync2(() => {
|
|
6047
|
+
held -= 1;
|
|
6048
|
+
})
|
|
6049
|
+
};
|
|
6050
|
+
};
|
|
6036
6051
|
function superviseReplica(input) {
|
|
6037
6052
|
const { signals } = input;
|
|
6053
|
+
const verificationGate = (permits) => {
|
|
6054
|
+
let held = false;
|
|
6055
|
+
const free = suspend3(() => {
|
|
6056
|
+
if (!held)
|
|
6057
|
+
return void_3;
|
|
6058
|
+
held = false;
|
|
6059
|
+
return permits.give;
|
|
6060
|
+
});
|
|
6061
|
+
const ask = (options) => map9(held ? succeed6(true) : permits.take, (taken) => {
|
|
6062
|
+
held = taken;
|
|
6063
|
+
return taken ? options : { ...options, takesVerifications: false };
|
|
6064
|
+
});
|
|
6065
|
+
const settle = (claimed) => claimed.workUnit?.kind === "verification" ? void_3 : free;
|
|
6066
|
+
return { ask, settle, free };
|
|
6067
|
+
};
|
|
6068
|
+
const claimThrough = (control, gate, idempotencyKey, options) => gen(function* () {
|
|
6069
|
+
const asked = gate === undefined ? options : yield* gate.ask(options);
|
|
6070
|
+
const claimed = yield* control.claim(idempotencyKey, asked);
|
|
6071
|
+
if (gate !== undefined)
|
|
6072
|
+
yield* gate.settle(claimed);
|
|
6073
|
+
return { claimed, asked };
|
|
6074
|
+
});
|
|
6075
|
+
const gatedControl = (control, gate) => ({
|
|
6076
|
+
...control,
|
|
6077
|
+
claim: (idempotencyKey, options) => map9(claimThrough(control, gate, idempotencyKey, options), ({ claimed }) => claimed)
|
|
6078
|
+
});
|
|
6038
6079
|
const claimTurn = makeUnsafe3(1);
|
|
6039
6080
|
let emptyAt = -1;
|
|
6040
|
-
const wokenControl = (control, signals) => ({
|
|
6081
|
+
const wokenControl = (control, gate, signals) => ({
|
|
6041
6082
|
...control,
|
|
6042
|
-
claim: (idempotencyKey) => claimTurn.withPermit(gen(function* () {
|
|
6083
|
+
claim: (idempotencyKey, options) => claimTurn.withPermit(gen(function* () {
|
|
6043
6084
|
const generation = yield* signals.generation;
|
|
6044
6085
|
if (generation <= emptyAt)
|
|
6045
6086
|
return {};
|
|
6046
|
-
const claimed = yield* control
|
|
6047
|
-
if (claimed.workUnit === undefined)
|
|
6087
|
+
const { claimed, asked } = yield* claimThrough(control, gate, idempotencyKey, options);
|
|
6088
|
+
if (claimed.workUnit === undefined && asked?.takesVerifications !== false)
|
|
6048
6089
|
emptyAt = Math.max(emptyAt, generation);
|
|
6049
6090
|
return claimed;
|
|
6050
6091
|
}))
|
|
@@ -6059,7 +6100,9 @@ function superviseReplica(input) {
|
|
|
6059
6100
|
}
|
|
6060
6101
|
const seen = signals === undefined ? 0 : yield* signals.generation;
|
|
6061
6102
|
const control = input.control(capacitySlot);
|
|
6062
|
-
const
|
|
6103
|
+
const gate = input.verifications === undefined ? undefined : verificationGate(input.verifications);
|
|
6104
|
+
const claiming = signals !== undefined && woken ? wokenControl(control, gate, signals) : gatedControl(control, gate);
|
|
6105
|
+
const exit2 = yield* exit(runReplica(claiming, input.executor, signals).pipe(ensuring2(gate?.free ?? void_3)));
|
|
6063
6106
|
if (isSuccess2(exit2) && exit2.value.status === "completed") {
|
|
6064
6107
|
idleIterations = 0;
|
|
6065
6108
|
woken = false;
|
|
@@ -8493,7 +8536,7 @@ var codexAppServer = (binary = "codex") => (env) => gen(function* () {
|
|
|
8493
8536
|
const input = yield* unbounded2();
|
|
8494
8537
|
const pending = new Map;
|
|
8495
8538
|
let lastId = 0;
|
|
8496
|
-
const handle = yield* spawner.spawn(
|
|
8539
|
+
const handle = yield* spawner.spawn(make3(binary, ["app-server"], {
|
|
8497
8540
|
cwd: env.home,
|
|
8498
8541
|
extendEnv: true,
|
|
8499
8542
|
env: { HOME: env.home, CODEX_HOME: env.codexHome },
|
|
@@ -8516,7 +8559,7 @@ var codexAppServer = (binary = "codex") => (env) => gen(function* () {
|
|
|
8516
8559
|
return {
|
|
8517
8560
|
request: (method, params) => gen(function* () {
|
|
8518
8561
|
const id = ++lastId;
|
|
8519
|
-
const deferred = yield*
|
|
8562
|
+
const deferred = yield* make16();
|
|
8520
8563
|
pending.set(id, deferred);
|
|
8521
8564
|
yield* send({ id, method, params });
|
|
8522
8565
|
return yield* _await(deferred).pipe(mapError2((error) => new CodexAppServerFailed({ reason: `${method}: ${error.message}` })));
|
|
@@ -8656,10 +8699,10 @@ var handshake = [
|
|
|
8656
8699
|
`).join("");
|
|
8657
8700
|
var kitmanMcpPreflight = (mcp) => gen(function* () {
|
|
8658
8701
|
const spawner = yield* ChildProcessSpawner;
|
|
8659
|
-
const server = yield* spawner.spawn(
|
|
8702
|
+
const server = yield* spawner.spawn(make3(mcp.command, [...mcp.args], {
|
|
8660
8703
|
extendEnv: true,
|
|
8661
8704
|
env: mcp.env,
|
|
8662
|
-
stdin: { stream:
|
|
8705
|
+
stdin: { stream: make11(new TextEncoder().encode(handshake)), endOnDone: false },
|
|
8663
8706
|
stderr: "ignore"
|
|
8664
8707
|
}));
|
|
8665
8708
|
const reply = yield* server.stdout.pipe(decodeText, splitLines, map2((line) => getOrUndefined(decodeJsonStringOption(line))), filter((message) => isJsonObject(message) && message.id === 2), runHead);
|
|
@@ -8732,8 +8775,8 @@ var programProcessExecutor = (input) => (work) => gen(function* () {
|
|
|
8732
8775
|
};
|
|
8733
8776
|
const exitCode = sandbox === undefined ? yield* gen(function* () {
|
|
8734
8777
|
const spawner = yield* ChildProcessSpawner;
|
|
8735
|
-
const handle = yield* spawner.spawn(
|
|
8736
|
-
stdin:
|
|
8778
|
+
const handle = yield* spawner.spawn(make3(input.bun ?? process.execPath, [file], {
|
|
8779
|
+
stdin: make11(new TextEncoder().encode(stdin)),
|
|
8737
8780
|
stdout: "inherit",
|
|
8738
8781
|
stderr: "inherit",
|
|
8739
8782
|
extendEnv: false,
|
|
@@ -10379,6 +10422,7 @@ export {
|
|
|
10379
10422
|
tomlTableHeader2 as tomlTableHeader,
|
|
10380
10423
|
updateHerdrCore2 as updateHerdrCore,
|
|
10381
10424
|
verificationExecutor,
|
|
10425
|
+
verificationPermits,
|
|
10382
10426
|
withCopyableLogin,
|
|
10383
10427
|
withOnlyEnvironment2 as withOnlyEnvironment,
|
|
10384
10428
|
withSourceResolutionCache2 as withSourceResolutionCache,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import"./chunk-
|
|
2
|
+
import"./chunk-9nbqzdqp.js";
|
|
3
3
|
import {
|
|
4
4
|
HERDR_CORE_GENERATION2,
|
|
5
5
|
HERDR_CORE_INSTALL_COMMAND2,
|
|
@@ -12,9 +12,9 @@ import {
|
|
|
12
12
|
herdrCoreLayer2,
|
|
13
13
|
herdrCoreTransportLayer2,
|
|
14
14
|
updateHerdrCore2
|
|
15
|
-
} from "./chunk-
|
|
16
|
-
import"./chunk-
|
|
17
|
-
import"./chunk-
|
|
15
|
+
} from "./chunk-t89zj8wf.js";
|
|
16
|
+
import"./chunk-8fyfsajs.js";
|
|
17
|
+
import"./chunk-h2f26xbd.js";
|
|
18
18
|
export {
|
|
19
19
|
HERDR_CORE_GENERATION2 as HERDR_CORE_GENERATION,
|
|
20
20
|
HERDR_CORE_INSTALL_COMMAND2 as HERDR_CORE_INSTALL_COMMAND,
|
|
@@ -13,11 +13,11 @@ import {
|
|
|
13
13
|
ArraySchema,
|
|
14
14
|
decodeJsonStringOption,
|
|
15
15
|
encodeUnknownJsonStringSync
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-h2f26xbd.js";
|
|
17
17
|
import {
|
|
18
18
|
replaceSecretReferences,
|
|
19
19
|
secretReferencesIn
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-4qjfn1sa.js";
|
|
21
21
|
|
|
22
22
|
// packages/agent-runtime/src/srt-step.ts
|
|
23
23
|
import { SandboxRuntimeConfigSchema } from "@anthropic-ai/sandbox-runtime";
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
succeed,
|
|
13
13
|
isSuccess,
|
|
14
14
|
TaggedError,
|
|
15
|
-
|
|
15
|
+
make16,
|
|
16
16
|
_await,
|
|
17
17
|
fail5,
|
|
18
18
|
succeed4,
|
|
@@ -109,20 +109,7 @@ import {
|
|
|
109
109
|
decodeJsonStringOption,
|
|
110
110
|
encodeJsonStringSync,
|
|
111
111
|
encodePrettyJsonString
|
|
112
|
-
} from "./chunk-
|
|
113
|
-
import {
|
|
114
|
-
currentTimeMillis,
|
|
115
|
-
tap,
|
|
116
|
-
mapError,
|
|
117
|
-
decodeText,
|
|
118
|
-
run,
|
|
119
|
-
mkString,
|
|
120
|
-
FileSystem,
|
|
121
|
-
Path,
|
|
122
|
-
withDefault,
|
|
123
|
-
option,
|
|
124
|
-
String2
|
|
125
|
-
} from "./chunk-z0gqrc8c.js";
|
|
112
|
+
} from "./chunk-h2f26xbd.js";
|
|
126
113
|
import {
|
|
127
114
|
SecureRandom,
|
|
128
115
|
layerWebCrypto,
|
|
@@ -163,6 +150,7 @@ import {
|
|
|
163
150
|
RunDisplayStates,
|
|
164
151
|
RunnerExecutionBackend,
|
|
165
152
|
MaxRunnerConcurrency,
|
|
153
|
+
verificationCap,
|
|
166
154
|
PinnedImage,
|
|
167
155
|
RunnerSettingNames,
|
|
168
156
|
RunnerSettingsUpdate,
|
|
@@ -186,7 +174,7 @@ import {
|
|
|
186
174
|
digestSha256,
|
|
187
175
|
sha256Hasher,
|
|
188
176
|
raw,
|
|
189
|
-
|
|
177
|
+
make5,
|
|
190
178
|
get,
|
|
191
179
|
put,
|
|
192
180
|
HttpClient,
|
|
@@ -252,15 +240,28 @@ import {
|
|
|
252
240
|
harnessNames,
|
|
253
241
|
herdrRunnerCapabilities2,
|
|
254
242
|
declaredChecks
|
|
255
|
-
} from "./chunk-
|
|
243
|
+
} from "./chunk-t89zj8wf.js";
|
|
244
|
+
import {
|
|
245
|
+
currentTimeMillis,
|
|
246
|
+
tap,
|
|
247
|
+
mapError,
|
|
248
|
+
decodeText,
|
|
249
|
+
run,
|
|
250
|
+
mkString,
|
|
251
|
+
FileSystem,
|
|
252
|
+
Path,
|
|
253
|
+
withDefault,
|
|
254
|
+
option,
|
|
255
|
+
String2
|
|
256
|
+
} from "./chunk-8fyfsajs.js";
|
|
256
257
|
import {
|
|
257
258
|
ChildProcessSpawner,
|
|
258
|
-
|
|
259
|
-
} from "./chunk-
|
|
259
|
+
make3
|
|
260
|
+
} from "./chunk-9nbqzdqp.js";
|
|
260
261
|
import {
|
|
261
262
|
Id,
|
|
262
263
|
Timestamp
|
|
263
|
-
} from "./chunk-
|
|
264
|
+
} from "./chunk-4qjfn1sa.js";
|
|
264
265
|
|
|
265
266
|
// apps/cli/src/cli-error.ts
|
|
266
267
|
function cliErrorCode(error, status) {
|
|
@@ -706,7 +707,8 @@ var Usage = [
|
|
|
706
707
|
" kitman pair [<pairing code>] [--api-url <url>] (what the command the web shows runs; no code finishes or re-keys with your session)",
|
|
707
708
|
" kitman pair <runner pairing code> --credential-file <path> (writes a shared Runner's credential for a container or its replicas to mount)",
|
|
708
709
|
" kitman runner start --credential-file <path> (or KITMAN_RUNNER_CREDENTIAL_FILE; starts the Runner the file holds)",
|
|
709
|
-
" kitman runner settings <runner> [--concurrency <1-32>] [--sandbox srt|docker|host]
|
|
710
|
+
" kitman runner settings <runner> [--concurrency <1-32>] [--verification-concurrency <1-32>] [--sandbox srt|docker|host]",
|
|
711
|
+
" [--docker-image <image@sha256:\u2026>|none]",
|
|
710
712
|
" [--check-hosts <host,\u2026>|none] [--check-docker-image <image@sha256:\u2026>|none] [--check-registry-image <image@sha256:\u2026>|none]",
|
|
711
713
|
" kitman runner settings history <runner> (each change: who, when, old and new value)",
|
|
712
714
|
"",
|
|
@@ -1327,10 +1329,10 @@ var sandboxMissing = (sandbox, missing) => ({
|
|
|
1327
1329
|
var personalCheckBackend = (agentSandbox, dockerAvailable) => agentSandbox === "srt" || agentSandbox === "docker" && dockerAvailable ? agentSandbox : undefined;
|
|
1328
1330
|
var herdrCoreSession = (runnerId, personal) => personal ? undefined : `kitman-${sha2562(runnerId).slice(0, 16)}`;
|
|
1329
1331
|
var OpenHerdrCore = Reference("kitman/cli/OpenHerdrCore", {
|
|
1330
|
-
defaultValue: () => (options) => flatMap3(promise(() => import("./chunk-
|
|
1332
|
+
defaultValue: () => (options) => flatMap3(promise(() => import("./chunk-vwaf8peb.js")), ({ HerdrCore, herdrCoreLayer }) => provide3(service(HerdrCore), herdrCoreLayer(options)))
|
|
1331
1333
|
});
|
|
1332
1334
|
var UpdateHerdrCore = Reference("kitman/cli/UpdateHerdrCore", {
|
|
1333
|
-
defaultValue: () => (options) => flatMap3(promise(() => import("./chunk-
|
|
1335
|
+
defaultValue: () => (options) => flatMap3(promise(() => import("./chunk-vwaf8peb.js")), (module) => module.updateHerdrCore(options))
|
|
1334
1336
|
});
|
|
1335
1337
|
var herdrCoreMissing = (error) => {
|
|
1336
1338
|
if (isTagged(error, "HerdrCoreMissing"))
|
|
@@ -1393,6 +1395,7 @@ var settingVariables = {
|
|
|
1393
1395
|
checkDockerImage: "KITMAN_RUNNER_CHECK_DOCKER_IMAGE",
|
|
1394
1396
|
checkRegistryImage: "KITMAN_RUNNER_CHECK_REGISTRY_IMAGE"
|
|
1395
1397
|
};
|
|
1398
|
+
var environmentSettingNames = RunnerSettingNames.filter((setting) => (setting in settingVariables));
|
|
1396
1399
|
var AllowFullAccessVariable = "KITMAN_RUNNER_ALLOW_FULL_ACCESS";
|
|
1397
1400
|
var isPinnedImage = is(PinnedImage);
|
|
1398
1401
|
var isNetworkHost = is(NetworkHost);
|
|
@@ -1417,7 +1420,7 @@ var variableValue = (environment, name) => {
|
|
|
1417
1420
|
var environmentSettings = (environment) => {
|
|
1418
1421
|
const settings = {};
|
|
1419
1422
|
const variables = [];
|
|
1420
|
-
for (const setting of
|
|
1423
|
+
for (const setting of environmentSettingNames) {
|
|
1421
1424
|
const value = variableValue(environment, settingVariables[setting]);
|
|
1422
1425
|
if (value === undefined)
|
|
1423
1426
|
continue;
|
|
@@ -1450,7 +1453,7 @@ var appliedSandbox = (input) => {
|
|
|
1450
1453
|
return { sandbox: fallback, ...problem === undefined ? undefined : { problem } };
|
|
1451
1454
|
};
|
|
1452
1455
|
var missingFor = (input, sandbox) => input.unavailable?.find((entry) => entry.backend === sandbox)?.missing ?? ["unsupported"];
|
|
1453
|
-
var deprecationWarnings = (variables, settings) =>
|
|
1456
|
+
var deprecationWarnings = (variables, settings) => environmentSettingNames.flatMap((setting) => {
|
|
1454
1457
|
const variable = settingVariables[setting];
|
|
1455
1458
|
if (!variables.includes(variable))
|
|
1456
1459
|
return [];
|
|
@@ -1461,6 +1464,7 @@ var deprecationWarnings = (variables, settings) => RunnerSettingNames.flatMap((s
|
|
|
1461
1464
|
});
|
|
1462
1465
|
var settingFlags = {
|
|
1463
1466
|
"--concurrency": "concurrency",
|
|
1467
|
+
"--verification-concurrency": "verificationConcurrency",
|
|
1464
1468
|
"--sandbox": "sandbox",
|
|
1465
1469
|
"--docker-image": "dockerImage",
|
|
1466
1470
|
"--check-hosts": "checkHosts",
|
|
@@ -1472,7 +1476,7 @@ var isSettingsUpdate = is(RunnerSettingsUpdate);
|
|
|
1472
1476
|
var settingFromFlag = (flag, value) => {
|
|
1473
1477
|
const setting = settingFlags[flag];
|
|
1474
1478
|
const cleared = value.trim() === "none";
|
|
1475
|
-
const parsed = setting === "concurrency" ? Number(value) : setting === "checkHosts" ? cleared ? [] : value.split(",").map((host) => host.trim()).filter((host) => host !== "") : setting === "sandbox" ? value.trim() : cleared ? null : value.trim();
|
|
1479
|
+
const parsed = setting === "concurrency" || setting === "verificationConcurrency" ? Number(value) : setting === "checkHosts" ? cleared ? [] : value.split(",").map((host) => host.trim()).filter((host) => host !== "") : setting === "sandbox" ? value.trim() : cleared ? null : value.trim();
|
|
1476
1480
|
const update = { [setting]: parsed };
|
|
1477
1481
|
if (!isSettingsUpdate(update))
|
|
1478
1482
|
throw new Error(settingFlagRefused[setting]);
|
|
@@ -1480,6 +1484,7 @@ var settingFromFlag = (flag, value) => {
|
|
|
1480
1484
|
};
|
|
1481
1485
|
var settingFlagRefused = {
|
|
1482
1486
|
concurrency: `--concurrency takes a whole number from 1 to ${MaxRunnerConcurrency}`,
|
|
1487
|
+
verificationConcurrency: `--verification-concurrency takes a whole number from 1 to the Runner's concurrency`,
|
|
1483
1488
|
sandbox: "--sandbox takes srt, docker or host",
|
|
1484
1489
|
dockerImage: "--docker-image takes an image pinned by digest (name@sha256:...), or none",
|
|
1485
1490
|
checkHosts: "--check-hosts takes comma-separated hosts, such as registry.npmjs.org,*.example.com, or none",
|
|
@@ -1488,7 +1493,8 @@ var settingFlagRefused = {
|
|
|
1488
1493
|
};
|
|
1489
1494
|
var settingRows = (settings, applied) => RunnerSettingNames.map((setting) => {
|
|
1490
1495
|
const value = shownRunnerSetting(settings[setting]);
|
|
1491
|
-
const
|
|
1496
|
+
const appliedValue = applied?.[setting];
|
|
1497
|
+
const inEffect = appliedValue === undefined ? undefined : shownRunnerSetting(appliedValue);
|
|
1492
1498
|
return {
|
|
1493
1499
|
setting,
|
|
1494
1500
|
value,
|
|
@@ -1637,7 +1643,7 @@ var runnerUpdater = (input) => {
|
|
|
1637
1643
|
const drain = (version) => gen(function* () {
|
|
1638
1644
|
claiming = false;
|
|
1639
1645
|
const since = yield* currentTimeMillis;
|
|
1640
|
-
const switchNow = yield*
|
|
1646
|
+
const switchNow = yield* make16();
|
|
1641
1647
|
if (version !== undefined)
|
|
1642
1648
|
draining = {
|
|
1643
1649
|
report: {
|
|
@@ -1790,7 +1796,7 @@ var syncTargets = (harness) => gen(function* () {
|
|
|
1790
1796
|
});
|
|
1791
1797
|
var syncKits = (input) => gen(function* () {
|
|
1792
1798
|
const fs = yield* FileSystem;
|
|
1793
|
-
const { syncKitSetup } = yield* promise(() => import("./chunk-
|
|
1799
|
+
const { syncKitSetup } = yield* promise(() => import("./chunk-wckr96wg.js"));
|
|
1794
1800
|
const harnesses = yield* syncTargets(input.harness);
|
|
1795
1801
|
const chain = yield* input.client.getKitChain(input.workspaceId);
|
|
1796
1802
|
for (const { name, problem } of chain.skipped)
|
|
@@ -2307,7 +2313,7 @@ var ServiceManager = Reference("kitman/cli/ServiceManager", {
|
|
|
2307
2313
|
run: (command, args) => runCommand2(command, args),
|
|
2308
2314
|
attach: (command, args) => gen(function* () {
|
|
2309
2315
|
const spawner = yield* ChildProcessSpawner;
|
|
2310
|
-
const handle = yield* spawner.spawn(
|
|
2316
|
+
const handle = yield* spawner.spawn(make3(command, args, { stdin: "inherit", stdout: "inherit", stderr: "inherit" }));
|
|
2311
2317
|
const exitCode = yield* handle.exitCode;
|
|
2312
2318
|
if (exitCode !== 0)
|
|
2313
2319
|
return yield* new CommandFailed2({ command, reason: `exit code ${exitCode}` });
|
|
@@ -3285,7 +3291,7 @@ var shipped_steps_generated_default = {
|
|
|
3285
3291
|
};
|
|
3286
3292
|
|
|
3287
3293
|
// apps/cli/src/scaffold-files.ts
|
|
3288
|
-
var cliVersion = "0.
|
|
3294
|
+
var cliVersion = "0.36.0";
|
|
3289
3295
|
var shippedLoopSteps = new Map(Object.entries(shipped_steps_generated_default));
|
|
3290
3296
|
var loopSteps = (loop) => shippedLoopSteps.get(loop) ?? [];
|
|
3291
3297
|
var replacedStep = (loop) => loopSteps(loop).find((step) => step.from === defaultKitName && step.exported?.startsWith("steps.") === true);
|
|
@@ -3550,7 +3556,7 @@ var scaffoldKit = (directory, scaffold = {}) => gen(function* () {
|
|
|
3550
3556
|
|
|
3551
3557
|
// apps/cli/src/commands.ts
|
|
3552
3558
|
var ClientId = "kitman-cli";
|
|
3553
|
-
var agentRuntime = promise(() => import("./chunk-
|
|
3559
|
+
var agentRuntime = promise(() => import("./chunk-th0znqwv.js"));
|
|
3554
3560
|
var TuiLauncher = Reference("kitman/cli/TuiLauncher", {
|
|
3555
3561
|
defaultValue: () => gen(function* () {
|
|
3556
3562
|
const tui = yield* tryPromise({
|
|
@@ -5089,7 +5095,7 @@ var SandboxHostProbe = Reference("kitman/cli/SandboxHostProbe", {
|
|
|
5089
5095
|
});
|
|
5090
5096
|
var OpenRunnerRpc = Reference("kitman/cli/OpenRunnerRpc", {
|
|
5091
5097
|
defaultValue: () => (options) => gen(function* () {
|
|
5092
|
-
const { makeRunnerRpcClient, runnerRpcUrl, runnerWebSocketProtocol } = yield* promise(() => import("./chunk-
|
|
5098
|
+
const { makeRunnerRpcClient, runnerRpcUrl, runnerWebSocketProtocol } = yield* promise(() => import("./chunk-crw9pdwb.js"));
|
|
5093
5099
|
return yield* makeRunnerRpcClient({
|
|
5094
5100
|
runnerId: options.runnerId,
|
|
5095
5101
|
bearer: options.bearer,
|
|
@@ -5220,7 +5226,8 @@ function startCanonicalHerdrRunnerCommand(input) {
|
|
|
5220
5226
|
runCheckouts,
|
|
5221
5227
|
runnerStepAttemptFromAgentStep,
|
|
5222
5228
|
superviseReplica,
|
|
5223
|
-
verificationExecutor
|
|
5229
|
+
verificationExecutor,
|
|
5230
|
+
verificationPermits
|
|
5224
5231
|
} = yield* agentRuntime;
|
|
5225
5232
|
const openRunnerRpc = yield* OpenRunnerRpc;
|
|
5226
5233
|
const hostSettings = yield* runnerHostSettings;
|
|
@@ -5241,9 +5248,9 @@ function startCanonicalHerdrRunnerCommand(input) {
|
|
|
5241
5248
|
}))) : firstHeartbeat;
|
|
5242
5249
|
yield* rememberReleaseChannel(input.runnerId, runner.releaseChannel);
|
|
5243
5250
|
const personal = runner.ownership.kind === "personal";
|
|
5244
|
-
const settings =
|
|
5251
|
+
const settings = {
|
|
5245
5252
|
...defaultRunnerSettings(personal),
|
|
5246
|
-
...hostSettings.environment.settings
|
|
5253
|
+
...runner.settings ?? hostSettings.environment.settings
|
|
5247
5254
|
};
|
|
5248
5255
|
if (runner.settings !== undefined)
|
|
5249
5256
|
for (const warning of deprecationWarnings(hostSettings.environment.variables, runner.settings))
|
|
@@ -5357,6 +5364,7 @@ function startCanonicalHerdrRunnerCommand(input) {
|
|
|
5357
5364
|
} : undefined;
|
|
5358
5365
|
const appliedSettings = () => ({
|
|
5359
5366
|
concurrency: live.settings.concurrency,
|
|
5367
|
+
verificationConcurrency: verificationCap(live.settings),
|
|
5360
5368
|
sandbox: live.sandbox,
|
|
5361
5369
|
dockerImage: settings.dockerImage,
|
|
5362
5370
|
checkHosts: live.settings.checkHosts,
|
|
@@ -5410,6 +5418,8 @@ function startCanonicalHerdrRunnerCommand(input) {
|
|
|
5410
5418
|
bearer: controlPlane.rpcBearer
|
|
5411
5419
|
}).pipe(tap2((opened) => opened.settledRuns([])))));
|
|
5412
5420
|
const signals = yield* makeReplicaSignals;
|
|
5421
|
+
const verifications = verificationPermits(sync2(() => verificationCap(live.settings)));
|
|
5422
|
+
const heartbeat = (beat) => flatMap3(verifications.full, (full) => rpc.heartbeat(full ? { ...beat, takesVerifications: false } : beat));
|
|
5413
5423
|
const bundles = yield* kitmanBundles({
|
|
5414
5424
|
fetch: (digest) => rpc.bundle(digest).pipe(map9((found) => found.bundle)),
|
|
5415
5425
|
cacheDir: bundleCache
|
|
@@ -5418,7 +5428,7 @@ function startCanonicalHerdrRunnerCommand(input) {
|
|
|
5418
5428
|
yield* controlPlane.client.listRepoBindings(runner.workspaceId).pipe(flatMap3(({ items }) => forEach(items.filter((binding) => binding.status === "active" && (teamId === undefined || binding.teamId === teamId)), (repoBinding) => map9(checkouts.reaches(repoBinding), (reachable) => ({ repoBinding, reachable })), { concurrency: 4 })), tap2((probed) => sync2(() => reached = probed)), catch_((error) => logWarning("runner_repository_probe_failed", error.message)), flatMap3(() => sleep(reached.some((probe) => !probe.reachable) ? repositoryRetryInterval : repositoryProbeInterval)), forever, forkScoped);
|
|
5419
5429
|
yield* suspend3(() => sleep(ownerLogin.expired() ? ownerLoginRetryInterval : ownerLoginInterval)).pipe(andThen2(checkOwnerLogin), forever, forkScoped);
|
|
5420
5430
|
const platform = yield* context();
|
|
5421
|
-
const updated = yield*
|
|
5431
|
+
const updated = yield* make16();
|
|
5422
5432
|
const scope = yield* scope2;
|
|
5423
5433
|
const startUpdate = (update) => update.pipe(catch_((error) => andThen2(restartOntoUpdate(input.runnerId), fail5(updated, error))), provideContext2(platform), forkIn(scope), asVoid);
|
|
5424
5434
|
const refusedForProtocol = container ? updater.stopWhenDrained(new RunnerStopped({ problem: updateRequired })).pipe(catch_((stopped) => fail5(updated, stopped)), forkIn(scope), asVoid) : startUpdate(updater.updateRequired);
|
|
@@ -5447,7 +5457,7 @@ function startCanonicalHerdrRunnerCommand(input) {
|
|
|
5447
5457
|
const applySettings = (next) => gen(function* () {
|
|
5448
5458
|
if (next === undefined)
|
|
5449
5459
|
return;
|
|
5450
|
-
live.settings = next;
|
|
5460
|
+
live.settings = { ...defaultRunnerSettings(personal), ...next };
|
|
5451
5461
|
const wanted = appliedSandbox({
|
|
5452
5462
|
wanted: next.sandbox,
|
|
5453
5463
|
personal,
|
|
@@ -5497,7 +5507,7 @@ function startCanonicalHerdrRunnerCommand(input) {
|
|
|
5497
5507
|
const version = work.secretDestinations?.[name]?.version;
|
|
5498
5508
|
return version === undefined ? [] : [{ name, version }];
|
|
5499
5509
|
});
|
|
5500
|
-
return
|
|
5510
|
+
return heartbeat({
|
|
5501
5511
|
workUnitId: work.id,
|
|
5502
5512
|
lease: leaseOf(work),
|
|
5503
5513
|
...secrets.length === 0 ? undefined : { secrets }
|
|
@@ -5510,7 +5520,7 @@ function startCanonicalHerdrRunnerCommand(input) {
|
|
|
5510
5520
|
spending,
|
|
5511
5521
|
sandbox: sandboxOf,
|
|
5512
5522
|
heartbeat: heartbeatOf,
|
|
5513
|
-
harnessStarted: (work) => asVoid(
|
|
5523
|
+
harnessStarted: (work) => asVoid(heartbeat({ workUnitId: work.id, lease: leaseOf(work), harnessStarted: true })),
|
|
5514
5524
|
gitCredentials: rpc.gitCredential,
|
|
5515
5525
|
checkpoints: rpcStepCheckpoints(rpc, signals, storage),
|
|
5516
5526
|
transcripts: (work, entries) => rpc.appendTranscript({ workUnitId: work.id, entries }),
|
|
@@ -5580,11 +5590,12 @@ function startCanonicalHerdrRunnerCommand(input) {
|
|
|
5580
5590
|
};
|
|
5581
5591
|
const control = (capacitySlot) => {
|
|
5582
5592
|
return {
|
|
5583
|
-
claim: (idempotencyKey) => suspend3(() => {
|
|
5593
|
+
claim: (idempotencyKey, options) => suspend3(() => {
|
|
5584
5594
|
if (!updater.claiming())
|
|
5585
5595
|
return succeed6({});
|
|
5586
5596
|
claimsInFlight += 1;
|
|
5587
5597
|
return rpc.claim({
|
|
5598
|
+
...options,
|
|
5588
5599
|
...input.teamId === undefined ? undefined : { teamId: input.teamId },
|
|
5589
5600
|
runnerReplicaId: replica.id,
|
|
5590
5601
|
capacitySlot,
|
|
@@ -5608,7 +5619,7 @@ function startCanonicalHerdrRunnerCommand(input) {
|
|
|
5608
5619
|
capacity: { maxConcurrentRuns: live.settings.concurrency },
|
|
5609
5620
|
telemetry: { activeWorkUnits: activeSlots.size }
|
|
5610
5621
|
}).pipe(asVoid)), tapError2(onProtocolRefusal)),
|
|
5611
|
-
heartbeatWork: (workUnitId, lease) =>
|
|
5622
|
+
heartbeatWork: (workUnitId, lease) => heartbeat({ workUnitId, lease }),
|
|
5612
5623
|
complete: (completion) => rpc.complete(completion),
|
|
5613
5624
|
release: (workUnitId, lease, crashed, tokens, ranModel) => rpc.release({
|
|
5614
5625
|
workUnitId,
|
|
@@ -5622,6 +5633,7 @@ function startCanonicalHerdrRunnerCommand(input) {
|
|
|
5622
5633
|
const supervised = superviseReplica({
|
|
5623
5634
|
slots: Array.from({ length: MaxRunnerConcurrency }, (_, index) => `slot-${index + 1}`),
|
|
5624
5635
|
concurrency: sync2(() => live.settings.concurrency),
|
|
5636
|
+
verifications,
|
|
5625
5637
|
control,
|
|
5626
5638
|
executor: {
|
|
5627
5639
|
execute: (work) => {
|
|
@@ -5680,7 +5692,7 @@ function mcpCommand(args) {
|
|
|
5680
5692
|
if (command.action === "run") {
|
|
5681
5693
|
if (command.args.length > 0)
|
|
5682
5694
|
return yield* new CliError({ message: `Unknown command: ${args.join(" ")}` });
|
|
5683
|
-
const { runMcpServerCommand } = yield* promise(() => import("./chunk-
|
|
5695
|
+
const { runMcpServerCommand } = yield* promise(() => import("./chunk-49hz9619.js"));
|
|
5684
5696
|
return yield* runMcpServerCommand({ flags: command.flags });
|
|
5685
5697
|
}
|
|
5686
5698
|
if (command.action !== "setup")
|
|
@@ -6180,7 +6192,7 @@ function programLoopCommand(command) {
|
|
|
6180
6192
|
return yield* new CliError({ message: `Unknown loop command: ${command.action}` });
|
|
6181
6193
|
});
|
|
6182
6194
|
}
|
|
6183
|
-
var docsModule = promise(() => import("./chunk-
|
|
6195
|
+
var docsModule = promise(() => import("./chunk-rbj2eant.js"));
|
|
6184
6196
|
function docsCommand(args) {
|
|
6185
6197
|
return gen(function* () {
|
|
6186
6198
|
const command = parseCommand(args);
|
|
@@ -7184,7 +7196,7 @@ function changeRequestCommand(args) {
|
|
|
7184
7196
|
yield* log(command.action === "approve" ? `Approved ${short} of ${changeRequest.title}. A Run waiting on approval of ${short} resumes; one waiting on another head does not.` : `Requested changes to ${short} of ${changeRequest.title}`);
|
|
7185
7197
|
});
|
|
7186
7198
|
}
|
|
7187
|
-
var readOutlines = (directory) => flatMap3(promise(() => import("./chunk-
|
|
7199
|
+
var readOutlines = (directory) => flatMap3(promise(() => import("./chunk-3t6aayxz.js")), (build) => build.readOutlines(directory)).pipe(mapError2((error) => new CliError({ message: error.message })));
|
|
7188
7200
|
var loopOutline = (command) => gen(function* () {
|
|
7189
7201
|
const path = yield* Path;
|
|
7190
7202
|
const loop = requiredArg(command, "a Loop id");
|
|
@@ -7204,9 +7216,9 @@ var loopOutline = (command) => gen(function* () {
|
|
|
7204
7216
|
`).pipe(mapError2((error) => new CliError({ message: error.message })));
|
|
7205
7217
|
yield* log(`Wrote the outline of ${loop} to ${out}`);
|
|
7206
7218
|
});
|
|
7207
|
-
var KitWriter = map9(promise(() => import("./chunk-
|
|
7219
|
+
var KitWriter = map9(promise(() => import("./chunk-3t6aayxz.js")), (build) => build.writeKit);
|
|
7208
7220
|
var KitBuilder = Reference("kitman/cli/KitBuilder", {
|
|
7209
|
-
defaultValue: () => (directory) => flatMap3(promise(() => import("./chunk-
|
|
7221
|
+
defaultValue: () => (directory) => flatMap3(promise(() => import("./chunk-3t6aayxz.js")), (build) => build.buildKit(directory))
|
|
7210
7222
|
});
|
|
7211
7223
|
var uploadKit = (client, workspaceId, built) => gen(function* () {
|
|
7212
7224
|
yield* client.uploadKitBundle(workspaceId, built.digest, { bundle: encode2(built.bundle) });
|
|
@@ -7985,7 +7997,7 @@ function downloadPresignedAsset(download, outputPath) {
|
|
|
7985
7997
|
return gen(function* () {
|
|
7986
7998
|
const fs = yield* FileSystem;
|
|
7987
7999
|
const failed = (cause) => new CliError({ message: `Asset download failed: ${String(cause)}` });
|
|
7988
|
-
const response = yield* send(
|
|
8000
|
+
const response = yield* send(make5(download.method)(download.url), failed);
|
|
7989
8001
|
if (response.status < 200 || response.status >= 300)
|
|
7990
8002
|
return yield* new CliError({ message: `Asset download failed with ${response.status}` });
|
|
7991
8003
|
const body = yield* response.arrayBuffer.pipe(mapError2((error) => failed(error.message)));
|
|
@@ -13,17 +13,17 @@ import {
|
|
|
13
13
|
isJsonObject,
|
|
14
14
|
decodeJsonString,
|
|
15
15
|
encodePrettyJsonString
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-h2f26xbd.js";
|
|
17
17
|
import {
|
|
18
18
|
FileSystem,
|
|
19
19
|
Path
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-8fyfsajs.js";
|
|
21
21
|
import {
|
|
22
22
|
tomlTableHeader2,
|
|
23
23
|
tomlKeyPath2,
|
|
24
24
|
kitmanSkillEntry,
|
|
25
25
|
isPathWithin2
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-c2ngtf1e.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-
|
|
35
|
-
import"./chunk-
|
|
36
|
-
import"./chunk-
|
|
37
|
-
import"./chunk-
|
|
34
|
+
} from "./chunk-t89zj8wf.js";
|
|
35
|
+
import"./chunk-96bzt4ck.js";
|
|
36
|
+
import"./chunk-9nbqzdqp.js";
|
|
37
|
+
import"./chunk-4qjfn1sa.js";
|
|
38
38
|
|
|
39
39
|
// packages/agent-runtime/src/kit-setup-sync.ts
|
|
40
40
|
class KitSyncError extends TaggedError("KitSyncError") {
|