@kitman-sh/cli 0.42.2 → 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.
Files changed (28) hide show
  1. package/dist/{chunk-3gax0xq6.js → chunk-134jdvs6.js} +2 -2
  2. package/dist/{chunk-hfy8nmat.js → chunk-1c4wk9dr.js} +3 -3
  3. package/dist/{chunk-q6qn9c47.js → chunk-1k6z8q79.js} +135 -297
  4. package/dist/{chunk-sasjamqz.js → chunk-3mbp8cse.js} +205 -44
  5. package/dist/{chunk-1w517sym.js → chunk-3zy2vbp0.js} +10 -10
  6. package/dist/{chunk-17715h5w.js → chunk-5ccz7ghp.js} +69 -55
  7. package/dist/{chunk-1gr39h4v.js → chunk-7rj9d0rp.js} +21 -2
  8. package/dist/{chunk-wre79w3z.js → chunk-8a7337s1.js} +1 -1
  9. package/dist/{chunk-qndcafax.js → chunk-9h16pekj.js} +1 -1
  10. package/dist/{chunk-gqgbah9q.js → chunk-d0rx9esz.js} +6 -6
  11. package/dist/{chunk-t8y2y7ha.js → chunk-d2tpz1yp.js} +1 -1
  12. package/dist/{chunk-re7cr0kk.js → chunk-dj873p0e.js} +17 -17
  13. package/dist/{chunk-r5b36fgg.js → chunk-dp6v658s.js} +4 -4
  14. package/dist/{chunk-vjkgbsry.js → chunk-dre4f6s4.js} +9 -9
  15. package/dist/{chunk-33zd0yt4.js → chunk-gw0pc35c.js} +17 -17
  16. package/dist/{chunk-sbk4evb4.js → chunk-hmctc4eq.js} +3 -3
  17. package/dist/{chunk-hg9y4ykj.js → chunk-j60f2tr1.js} +4 -4
  18. package/dist/{chunk-tpmyf5mk.js → chunk-k2re3tp5.js} +1 -1
  19. package/dist/{chunk-drw8m50d.js → chunk-ncp13gyf.js} +2 -2
  20. package/dist/{chunk-rc4wvjf2.js → chunk-qkwkxn4d.js} +349 -102
  21. package/dist/{chunk-2bt9e1fj.js → chunk-wh3pjr9r.js} +11 -11
  22. package/dist/{chunk-c3ms91a6.js → chunk-wkg1v0kd.js} +20 -20
  23. package/dist/{chunk-mc0xxx2z.js → chunk-wvnsqt17.js} +6 -6
  24. package/dist/{chunk-b4td2pgc.js → chunk-x0ma41ys.js} +94 -84
  25. package/dist/{chunk-dhe1fwhw.js → chunk-zkvrxna8.js} +2 -2
  26. package/dist/{chunk-y6mjtq6n.js → chunk-zvmdyf3v.js} +53 -33
  27. package/dist/index.js +4 -4
  28. package/package.json +1 -1
@@ -12,7 +12,7 @@ import {
12
12
  succeed,
13
13
  isSuccess,
14
14
  TaggedError,
15
- make15,
15
+ make16,
16
16
  _await,
17
17
  fail5,
18
18
  succeed4,
@@ -109,7 +109,20 @@ import {
109
109
  decodeJsonStringOption,
110
110
  encodeJsonStringSync,
111
111
  encodePrettyJsonString
112
- } from "./chunk-b4td2pgc.js";
112
+ } from "./chunk-x0ma41ys.js";
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-3mbp8cse.js";
113
126
  import {
114
127
  SecureRandom,
115
128
  layerWebCrypto,
@@ -149,9 +162,8 @@ import {
149
162
  runOutlineText,
150
163
  RunDisplayStates,
151
164
  RunnerExecutionBackend,
152
- MaxRunnerConcurrency,
153
- verificationCap,
154
165
  PinnedImage,
166
+ RunnerSettings,
155
167
  RunnerSettingNames,
156
168
  RunnerSettingsUpdate,
157
169
  defaultRunnerSettings,
@@ -240,28 +252,15 @@ import {
240
252
  harnessNames,
241
253
  herdrRunnerCapabilities2,
242
254
  declaredChecks
243
- } from "./chunk-q6qn9c47.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-sasjamqz.js";
255
+ } from "./chunk-1k6z8q79.js";
257
256
  import {
258
257
  ChildProcessSpawner,
259
258
  make3
260
- } from "./chunk-3gax0xq6.js";
259
+ } from "./chunk-134jdvs6.js";
261
260
  import {
262
261
  Id,
263
262
  Timestamp
264
- } from "./chunk-qndcafax.js";
263
+ } from "./chunk-9h16pekj.js";
265
264
 
266
265
  // apps/cli/src/cli-error.ts
267
266
  function cliErrorCode(error, status) {
@@ -707,7 +706,7 @@ var Usage = [
707
706
  " kitman pair [<pairing code>] [--api-url <url>] (what the command the web shows runs; no code finishes or re-keys with your session)",
708
707
  " kitman pair <runner pairing code> --credential-file <path> (writes a shared Runner's credential for a container or its replicas to mount)",
709
708
  " kitman runner start --credential-file <path> (or KITMAN_RUNNER_CREDENTIAL_FILE; starts the Runner the file holds)",
710
- " kitman runner settings <runner> [--concurrency <1-32>] [--verification-concurrency <1-32>] [--sandbox srt|docker|host]",
709
+ " kitman runner settings <runner> [--concurrency <n>] [--verification-concurrency auto|<n>] [--sandbox srt|docker|host]",
711
710
  " [--docker-image <image@sha256:\u2026>|none]",
712
711
  " [--check-hosts <host,\u2026>|none] [--check-docker-image <image@sha256:\u2026>|none] [--check-registry-image <image@sha256:\u2026>|none]",
713
712
  " kitman runner settings history <runner> (each change: who, when, old and new value)",
@@ -1329,10 +1328,10 @@ var sandboxMissing = (sandbox, missing) => ({
1329
1328
  var personalCheckBackend = (agentSandbox, dockerAvailable) => agentSandbox === "srt" || agentSandbox === "docker" && dockerAvailable ? agentSandbox : undefined;
1330
1329
  var herdrCoreSession = (runnerId, personal) => personal ? undefined : `kitman-${sha2562(runnerId).slice(0, 16)}`;
1331
1330
  var OpenHerdrCore = Reference("kitman/cli/OpenHerdrCore", {
1332
- defaultValue: () => (options) => flatMap3(promise(() => import("./chunk-hg9y4ykj.js")), ({ HerdrCore, herdrCoreLayer }) => provide3(service(HerdrCore), herdrCoreLayer(options)))
1331
+ defaultValue: () => (options) => flatMap3(promise(() => import("./chunk-j60f2tr1.js")), ({ HerdrCore, herdrCoreLayer }) => provide3(service(HerdrCore), herdrCoreLayer(options)))
1333
1332
  });
1334
1333
  var UpdateHerdrCore = Reference("kitman/cli/UpdateHerdrCore", {
1335
- defaultValue: () => (options) => flatMap3(promise(() => import("./chunk-hg9y4ykj.js")), (module) => module.updateHerdrCore(options))
1334
+ defaultValue: () => (options) => flatMap3(promise(() => import("./chunk-j60f2tr1.js")), (module) => module.updateHerdrCore(options))
1336
1335
  });
1337
1336
  var herdrCoreMissing = (error) => {
1338
1337
  if (isTagged(error, "HerdrCoreMissing"))
@@ -1400,10 +1399,12 @@ var AllowFullAccessVariable = "KITMAN_RUNNER_ALLOW_FULL_ACCESS";
1400
1399
  var isPinnedImage = is(PinnedImage);
1401
1400
  var isNetworkHost = is(NetworkHost);
1402
1401
  var isBackend = is(RunnerExecutionBackend);
1402
+ var isConcurrency = is(RunnerSettings.fields.concurrency);
1403
1403
  var settingFromVariable = {
1404
1404
  concurrency: (value) => {
1405
- const concurrency = Math.trunc(Number(value));
1406
- return Number.isFinite(concurrency) ? { concurrency: Math.min(MaxRunnerConcurrency, Math.max(1, concurrency)) } : {};
1405
+ const whole = Math.trunc(Number(value));
1406
+ const concurrency = Math.max(1, whole);
1407
+ return Number.isFinite(whole) && isConcurrency(concurrency) ? { concurrency } : {};
1407
1408
  },
1408
1409
  sandbox: (value) => isBackend(value) ? { sandbox: value } : {},
1409
1410
  dockerImage: (value) => isPinnedImage(value) ? { dockerImage: value } : {},
@@ -1473,18 +1474,19 @@ var settingFlags = {
1473
1474
  };
1474
1475
  var isRunnerSettingFlag = (flag) => (flag in settingFlags);
1475
1476
  var isSettingsUpdate = is(RunnerSettingsUpdate);
1477
+ var wholeNumber = (text) => /^\d+$/u.test(text.trim()) ? Number(text.trim()) : Number.NaN;
1476
1478
  var settingFromFlag = (flag, value) => {
1477
1479
  const setting = settingFlags[flag];
1478
1480
  const cleared = value.trim() === "none";
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();
1481
+ const parsed = setting === "verificationConcurrency" && value.trim() === "auto" ? "auto" : setting === "concurrency" || setting === "verificationConcurrency" ? wholeNumber(value) : setting === "checkHosts" ? cleared ? [] : value.split(",").map((host) => host.trim()).filter((host) => host !== "") : setting === "sandbox" ? value.trim() : cleared ? null : value.trim();
1480
1482
  const update = { [setting]: parsed };
1481
1483
  if (!isSettingsUpdate(update))
1482
1484
  throw new Error(settingFlagRefused[setting]);
1483
1485
  return update;
1484
1486
  };
1485
1487
  var settingFlagRefused = {
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`,
1488
+ concurrency: "--concurrency takes a whole number from 1 up",
1489
+ verificationConcurrency: "--verification-concurrency takes auto or a whole number from 1 up",
1488
1490
  sandbox: "--sandbox takes srt, docker or host",
1489
1491
  dockerImage: "--docker-image takes an image pinned by digest (name@sha256:...), or none",
1490
1492
  checkHosts: "--check-hosts takes comma-separated hosts, such as registry.npmjs.org,*.example.com, or none",
@@ -1643,7 +1645,7 @@ var runnerUpdater = (input) => {
1643
1645
  const drain = (version) => gen(function* () {
1644
1646
  claiming = false;
1645
1647
  const since = yield* currentTimeMillis;
1646
- const switchNow = yield* make15();
1648
+ const switchNow = yield* make16();
1647
1649
  if (version !== undefined)
1648
1650
  draining = {
1649
1651
  report: {
@@ -1796,7 +1798,7 @@ var syncTargets = (harness) => gen(function* () {
1796
1798
  });
1797
1799
  var syncKits = (input) => gen(function* () {
1798
1800
  const fs = yield* FileSystem;
1799
- const { syncKitSetup } = yield* promise(() => import("./chunk-1w517sym.js"));
1801
+ const { syncKitSetup } = yield* promise(() => import("./chunk-3zy2vbp0.js"));
1800
1802
  const harnesses = yield* syncTargets(input.harness);
1801
1803
  const chain = yield* input.client.getKitChain(input.workspaceId);
1802
1804
  for (const { name, problem } of chain.skipped)
@@ -3291,7 +3293,7 @@ var shipped_steps_generated_default = {
3291
3293
  };
3292
3294
 
3293
3295
  // apps/cli/src/scaffold-files.ts
3294
- var cliVersion = "0.42.2";
3296
+ var cliVersion = "0.44.0";
3295
3297
  var shippedLoopSteps = new Map(Object.entries(shipped_steps_generated_default));
3296
3298
  var loopSteps = (loop) => shippedLoopSteps.get(loop) ?? [];
3297
3299
  var replacedStep = (loop) => loopSteps(loop).find((step) => step.from === defaultKitName && step.exported?.startsWith("steps.") === true);
@@ -3556,7 +3558,7 @@ var scaffoldKit = (directory, scaffold = {}) => gen(function* () {
3556
3558
 
3557
3559
  // apps/cli/src/commands.ts
3558
3560
  var ClientId = "kitman-cli";
3559
- var agentRuntime = promise(() => import("./chunk-rc4wvjf2.js"));
3561
+ var agentRuntime = promise(() => import("./chunk-qkwkxn4d.js"));
3560
3562
  var TuiLauncher = Reference("kitman/cli/TuiLauncher", {
3561
3563
  defaultValue: () => gen(function* () {
3562
3564
  const tui = yield* tryPromise({
@@ -5095,7 +5097,7 @@ var SandboxHostProbe = Reference("kitman/cli/SandboxHostProbe", {
5095
5097
  });
5096
5098
  var OpenRunnerRpc = Reference("kitman/cli/OpenRunnerRpc", {
5097
5099
  defaultValue: () => (options) => gen(function* () {
5098
- const { makeRunnerRpcClient, runnerRpcUrl, runnerWebSocketProtocol } = yield* promise(() => import("./chunk-mc0xxx2z.js"));
5100
+ const { makeRunnerRpcClient, runnerRpcUrl, runnerWebSocketProtocol } = yield* promise(() => import("./chunk-wvnsqt17.js"));
5099
5101
  return yield* makeRunnerRpcClient({
5100
5102
  runnerId: options.runnerId,
5101
5103
  bearer: options.bearer,
@@ -5206,6 +5208,7 @@ function startCanonicalHerdrRunnerCommand(input) {
5206
5208
  harnessesInSrt,
5207
5209
  homeDirectories,
5208
5210
  checkThreadBudget,
5211
+ runnerVerificationCap,
5209
5212
  kitmanBundles,
5210
5213
  kitmanMcpPreflight,
5211
5214
  lacksLoginSecret,
@@ -5238,7 +5241,11 @@ function startCanonicalHerdrRunnerCommand(input) {
5238
5241
  const fs = yield* FileSystem;
5239
5242
  const container = yield* runsInContainer(input.credential !== undefined);
5240
5243
  const version = yield* RunningKitmanVersion;
5241
- const reported = { ...version === undefined ? undefined : { version }, container };
5244
+ const reported = {
5245
+ ...version === undefined ? undefined : { version },
5246
+ container,
5247
+ readsAutoSettings: true
5248
+ };
5242
5249
  const credential = input.credential ?? (yield* startupStep("load the Runner credential", "10 seconds", storedHerdrRunnerCredential(input.apiUrl, input.runnerId)));
5243
5250
  if (credential === undefined)
5244
5251
  return yield* new RunnerStopped({ problem: credentialMissing(input.runnerId) });
@@ -5358,6 +5365,11 @@ function startCanonicalHerdrRunnerCommand(input) {
5358
5365
  capacity: { maxConcurrentRuns: live.settings.concurrency },
5359
5366
  telemetry: { activeWorkUnits: 0 }
5360
5367
  })));
5368
+ let replicaCapacity = live.settings.concurrency;
5369
+ const appliedRunnerSettings = () => ({
5370
+ ...live.settings,
5371
+ concurrency: Math.min(live.settings.concurrency, replicaCapacity)
5372
+ });
5361
5373
  const uid = process.getuid?.();
5362
5374
  const gid = process.getgid?.();
5363
5375
  const docker = host.backends.includes("docker") && settings.dockerImage !== null ? {
@@ -5366,8 +5378,8 @@ function startCanonicalHerdrRunnerCommand(input) {
5366
5378
  ...uid === undefined || gid === undefined ? undefined : { user: `${uid}:${gid}` }
5367
5379
  } : undefined;
5368
5380
  const appliedSettings = () => ({
5369
- concurrency: live.settings.concurrency,
5370
- verificationConcurrency: verificationCap(live.settings),
5381
+ concurrency: appliedRunnerSettings().concurrency,
5382
+ verificationConcurrency: runnerVerificationCap(appliedRunnerSettings()),
5371
5383
  sandbox: live.sandbox,
5372
5384
  dockerImage: settings.dockerImage,
5373
5385
  checkHosts: live.settings.checkHosts,
@@ -5379,7 +5391,7 @@ function startCanonicalHerdrRunnerCommand(input) {
5379
5391
  const root = herdrCoreAgentBackendLayer({
5380
5392
  sandboxBackends: host.backends,
5381
5393
  srtBinaries,
5382
- threadBudget: sync2(() => checkThreadBudget(live.settings)),
5394
+ threadBudget: sync2(() => checkThreadBudget(appliedRunnerSettings())),
5383
5395
  ...docker === undefined ? undefined : { docker: { ...docker, runnerId: input.runnerId } }
5384
5396
  }).pipe(provide2(succeed5(HerdrCore, core)), provide2(succeed5(StepProcesses, stepProcesses)), provide2(layer3));
5385
5397
  const activeSlots = new Set;
@@ -5413,7 +5425,7 @@ function startCanonicalHerdrRunnerCommand(input) {
5413
5425
  drainState: "accepting",
5414
5426
  capacity: { maxConcurrentRuns: live.settings.concurrency },
5415
5427
  telemetry: { activeWorkUnits: 0 }
5416
- })))));
5428
+ })), tap2(() => sync2(() => replicaCapacity = live.settings.concurrency)))));
5417
5429
  return yield* scoped(gen(function* () {
5418
5430
  const rpc = yield* startupStep("open the Runner RPC", "30 seconds", stopOnRefusal(openRunnerRpc({
5419
5431
  apiUrl: input.apiUrl,
@@ -5421,7 +5433,7 @@ function startCanonicalHerdrRunnerCommand(input) {
5421
5433
  bearer: controlPlane.rpcBearer
5422
5434
  }).pipe(tap2((opened) => opened.settledRuns([])))));
5423
5435
  const signals = yield* makeReplicaSignals;
5424
- const verifications = verificationPermits(sync2(() => verificationCap(live.settings)));
5436
+ const verifications = verificationPermits(sync2(() => runnerVerificationCap(appliedRunnerSettings())));
5425
5437
  const heartbeat = (beat) => flatMap3(verifications.full, (full) => rpc.heartbeat(full ? { ...beat, takesVerifications: false } : beat));
5426
5438
  const bundles = yield* kitmanBundles({
5427
5439
  fetch: (digest) => rpc.bundle(digest).pipe(map9((found) => found.bundle)),
@@ -5431,7 +5443,7 @@ function startCanonicalHerdrRunnerCommand(input) {
5431
5443
  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);
5432
5444
  yield* suspend3(() => sleep(ownerLogin.expired() ? ownerLoginRetryInterval : ownerLoginInterval)).pipe(andThen2(checkOwnerLogin), forever, forkScoped);
5433
5445
  const platform = yield* context();
5434
- const updated = yield* make15();
5446
+ const updated = yield* make16();
5435
5447
  const scope = yield* scope2;
5436
5448
  const startUpdate = (update) => update.pipe(catch_((error) => andThen2(restartOntoUpdate(input.runnerId), fail5(updated, error))), provideContext2(platform), forkIn(scope), asVoid);
5437
5449
  const refusedForProtocol = container ? updater.stopWhenDrained(new RunnerStopped({ problem: updateRequired })).pipe(catch_((stopped) => fail5(updated, stopped)), forkIn(scope), asVoid) : startUpdate(updater.updateRequired);
@@ -5530,7 +5542,7 @@ function startCanonicalHerdrRunnerCommand(input) {
5530
5542
  runnerScope: scope,
5531
5543
  runAfterMerge: (work, worktree, command, args) => {
5532
5544
  const sandbox = checkSandbox();
5533
- return afterMergeRunner(sandbox === undefined ? undefined : { ...sandbox, apiUrl: input.apiUrl, hosts: live.settings.checkHosts }, checkThreadBudget(live.settings))(work, worktree, command, args);
5545
+ return afterMergeRunner(sandbox === undefined ? undefined : { ...sandbox, apiUrl: input.apiUrl, hosts: live.settings.checkHosts }, checkThreadBudget(appliedRunnerSettings()))(work, worktree, command, args);
5534
5546
  },
5535
5547
  runAgent: (work, worktree, session, steered, refused, launched) => flatMap3(currentTimeMillis, (now) => agentBackend.execute({
5536
5548
  runnerId: input.runnerId,
@@ -5586,7 +5598,7 @@ function startCanonicalHerdrRunnerCommand(input) {
5586
5598
  postgres: dockerCheckPostgres(input.runnerId, replica.id),
5587
5599
  ...checkDocker === undefined ? undefined : { docker: checkDocker },
5588
5600
  runsDeployScripts: personal,
5589
- threadBudget: checkThreadBudget(live.settings),
5601
+ threadBudget: checkThreadBudget(appliedRunnerSettings()),
5590
5602
  revokedSecrets: (unit, secrets) => rpc.heartbeat({ workUnitId: unit.id, lease: leaseOf(unit), secrets: [...secrets] }).pipe(map9((state) => state.revokedSecrets ?? [])),
5591
5603
  ...sandbox === undefined ? undefined : { sandbox: { ...sandbox, apiUrl: input.apiUrl, hosts: live.settings.checkHosts } }
5592
5604
  })(work);
@@ -5616,12 +5628,15 @@ function startCanonicalHerdrRunnerCommand(input) {
5616
5628
  labels: runner.labels,
5617
5629
  ...appliedSettingsReport(),
5618
5630
  ...updateDrainReport(updater.updateDrain())
5619
- })).pipe(tap2(followReleaseChannel), flatMap3((heartbeat) => applySettings(heartbeat.settings)), flatMap3(() => controlPlane.client.heartbeatRunnerReplica(input.runnerId, replica.id, {
5620
- healthStatus: "healthy",
5621
- drainState: updater.claiming() ? "accepting" : "draining",
5622
- capacity: { maxConcurrentRuns: live.settings.concurrency },
5623
- telemetry: { activeWorkUnits: activeSlots.size }
5624
- }).pipe(asVoid)), tapError2(onProtocolRefusal)),
5631
+ })).pipe(tap2(followReleaseChannel), flatMap3((heartbeat) => applySettings(heartbeat.settings)), flatMap3(() => {
5632
+ const capacity = live.settings.concurrency;
5633
+ return controlPlane.client.heartbeatRunnerReplica(input.runnerId, replica.id, {
5634
+ healthStatus: "healthy",
5635
+ drainState: updater.claiming() ? "accepting" : "draining",
5636
+ capacity: { maxConcurrentRuns: capacity },
5637
+ telemetry: { activeWorkUnits: activeSlots.size }
5638
+ }).pipe(andThen2(sync2(() => replicaCapacity = capacity)));
5639
+ }), tapError2(onProtocolRefusal)),
5625
5640
  heartbeatWork: (workUnitId, lease) => heartbeat({ workUnitId, lease }),
5626
5641
  complete: (completion) => rpc.complete(completion),
5627
5642
  release: (workUnitId, lease, crashed, tokens, ranModel) => rpc.release({
@@ -5634,8 +5649,7 @@ function startCanonicalHerdrRunnerCommand(input) {
5634
5649
  };
5635
5650
  };
5636
5651
  const supervised = superviseReplica({
5637
- slots: Array.from({ length: MaxRunnerConcurrency }, (_, index) => `slot-${index + 1}`),
5638
- concurrency: sync2(() => live.settings.concurrency),
5652
+ concurrency: sync2(() => appliedRunnerSettings().concurrency),
5639
5653
  verifications,
5640
5654
  control,
5641
5655
  executor: {
@@ -5695,7 +5709,7 @@ function mcpCommand(args) {
5695
5709
  if (command.action === "run") {
5696
5710
  if (command.args.length > 0)
5697
5711
  return yield* new CliError({ message: `Unknown command: ${args.join(" ")}` });
5698
- const { runMcpServerCommand } = yield* promise(() => import("./chunk-y6mjtq6n.js"));
5712
+ const { runMcpServerCommand } = yield* promise(() => import("./chunk-zvmdyf3v.js"));
5699
5713
  return yield* runMcpServerCommand({ flags: command.flags });
5700
5714
  }
5701
5715
  if (command.action !== "setup")
@@ -6195,7 +6209,7 @@ function programLoopCommand(command) {
6195
6209
  return yield* new CliError({ message: `Unknown loop command: ${command.action}` });
6196
6210
  });
6197
6211
  }
6198
- var docsModule = promise(() => import("./chunk-t8y2y7ha.js"));
6212
+ var docsModule = promise(() => import("./chunk-d2tpz1yp.js"));
6199
6213
  function docsCommand(args) {
6200
6214
  return gen(function* () {
6201
6215
  const command = parseCommand(args);
@@ -7199,7 +7213,7 @@ function changeRequestCommand(args) {
7199
7213
  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}`);
7200
7214
  });
7201
7215
  }
7202
- var readOutlines = (directory) => flatMap3(promise(() => import("./chunk-33zd0yt4.js")), (build) => build.readOutlines(directory)).pipe(mapError2((error) => new CliError({ message: error.message })));
7216
+ var readOutlines = (directory) => flatMap3(promise(() => import("./chunk-gw0pc35c.js")), (build) => build.readOutlines(directory)).pipe(mapError2((error) => new CliError({ message: error.message })));
7203
7217
  var loopOutline = (command) => gen(function* () {
7204
7218
  const path = yield* Path;
7205
7219
  const loop = requiredArg(command, "a Loop id");
@@ -7219,9 +7233,9 @@ var loopOutline = (command) => gen(function* () {
7219
7233
  `).pipe(mapError2((error) => new CliError({ message: error.message })));
7220
7234
  yield* log(`Wrote the outline of ${loop} to ${out}`);
7221
7235
  });
7222
- var KitWriter = map9(promise(() => import("./chunk-33zd0yt4.js")), (build) => build.writeKit);
7236
+ var KitWriter = map9(promise(() => import("./chunk-gw0pc35c.js")), (build) => build.writeKit);
7223
7237
  var KitBuilder = Reference("kitman/cli/KitBuilder", {
7224
- defaultValue: () => (directory) => flatMap3(promise(() => import("./chunk-33zd0yt4.js")), (build) => build.buildKit(directory))
7238
+ defaultValue: () => (directory) => flatMap3(promise(() => import("./chunk-gw0pc35c.js")), (build) => build.buildKit(directory))
7225
7239
  });
7226
7240
  var uploadKit = (client, workspaceId, built) => gen(function* () {
7227
7241
  yield* client.uploadKitBundle(workspaceId, built.digest, { bundle: encode2(built.bundle) });
@@ -1320,7 +1320,26 @@ Runners execute StepAttempts in user-controlled environments. A runner advertise
1320
1320
  path: "runner-operations#runner-settings",
1321
1321
  level: 3,
1322
1322
  link: "https://kitman.sh/knowledge/docs/runner-operations#runner-settings",
1323
- text: "### Runner settings\n\nKitman keeps how your Runner behaves, so you change it on the Runner's page in the **Runners** tab, or with `kitman runner settings <runner>`, without touching its service. Its owner, or a Workspace admin, may change it; each change is in its History with who made it, when, and the old and new value (`kitman runner settings history <runner>`).\n\n- **Concurrency**: how many Work Units it runs at once, 1 to 32. It applies a change within about 10 seconds, and work in flight finishes first.\n- **Verification concurrency**: how many of those may be Verifications, the checks that test a Step's work. By default there is no cap: any slot can run one. Set it lower to keep a busy machine responsive; then each check is also told to use the cores divided by this number (through `GOMAXPROCS`, `RAYON_NUM_THREADS`, `UV_THREADPOOL_SIZE` and `VITEST_MAX_WORKERS`). It never runs more of them than its concurrency, even when this setting is higher. Its other slots keep taking agent Steps. It caps each Runner process, so a Runner with several replicas runs that many on each.\n- **Sandbox**: `srt` (the default), `docker` or `host`. New Steps and checks use a change; a running Step keeps its own.\n- **Docker image**: the image `docker` runs agents in, pinned by digest. It applies when the Runner restarts.\n- **Check hosts**: hosts every check this Runner runs, for any Team, may also reach.\n- **Checks' Docker image** and **checks' registry image**: for a pipeline check's own Docker daemon (below), each pinned by digest. They apply when the Runner restarts.\n\n```sh\nkitman runner settings <runner> --concurrency 2 --check-hosts github.com\n```\n\nThe Runner's page shows where what the Runner applies differs from its settings, and why.\n\nA few things stay on your machine, because they start the Runner or protect it: the Runner's id, the API URL and its credential, `KITMAN_RUNNER_FULL_ACCESS`, and your consent to run agents with no sandbox, `KITMAN_RUNNER_ALLOW_FULL_ACCESS=1`. Kitman cannot give that consent, so nobody who can change the Runner's settings, nor a compromised control plane, can turn off your machine's sandbox: a Runner set to `host` on a machine without it runs its agents in `srt` and shows the `full_access_refused` Runner Problem. A Runner set to `host` on a machine with it runs agents that use your own `kitman` login. When Kitman refuses that login, the Runner shows the `cli_session_expired` Runner Problem: run `kitman login` on the machine.\n\nBefore Kitman kept these, they were the environment variables `KITMAN_RUNNER_CONCURRENCY`, `KITMAN_RUNNER_SANDBOX`, `KITMAN_RUNNER_DOCKER_IMAGE`, `KITMAN_RUNNER_CHECK_HOSTS`, `KITMAN_RUNNER_CHECK_DOCKER_IMAGE` and `KITMAN_RUNNER_CHECK_REGISTRY_IMAGE`. The first time a Runner starts on a version with settings, Kitman adopts the values they give, once, for each setting nobody has set yet (a shared Runner's sandbox excepted); after that the Runner ignores them and warns at each start that each one still set is deprecated. Remove them from its service when its settings look right. While `KITMAN_RUNNER_SANDBOX=host` stays set, it counts as your consent to run agents on the host."
1323
+ text: `### Runner settings
1324
+
1325
+ Kitman keeps how your Runner behaves, so you change it on the Runner's page in the **Runners** tab, or with \`kitman runner settings <runner>\`, without touching its service. Its owner, or a Workspace admin, may change it; each change is in its History with who made it, when, and the old and new value (\`kitman runner settings history <runner>\`).
1326
+
1327
+ - **Concurrency**: how many Work Units it runs at once, any whole number from 1. It applies a change within about 10 seconds, without a restart, and work in flight finishes first.
1328
+ - **Verification concurrency**: how many of those may be Verifications, the checks that test a Step's work. By default, \`auto\`, it runs one Verification per 3 of its machine's cores, rounded up: 8 on 24 cores, 3 on 8. The cores are those the Runner may use, so a container or pod with a CPU limit of 4 counts 4. The Runner's page shows the number it applies, such as "auto (8 on this machine)". Set a whole number from 1 to choose it yourself; 32 means exactly 32. When Verifications are capped below the concurrency, each check is also told to use the cores divided by the cap (through \`GOMAXPROCS\`, \`RAYON_NUM_THREADS\`, \`UV_THREADPOOL_SIZE\` and \`VITEST_MAX_WORKERS\`); tools that read none of these size their own pools. It never runs more of them than its concurrency, even when this setting is higher. Its other slots keep taking agent Steps. It caps each Runner process, so a Runner with several replicas runs that many on each.
1329
+ - **Sandbox**: \`srt\` (the default), \`docker\` or \`host\`. New Steps and checks use a change; a running Step keeps its own.
1330
+ - **Docker image**: the image \`docker\` runs agents in, pinned by digest. It applies when the Runner restarts.
1331
+ - **Check hosts**: hosts every check this Runner runs, for any Team, may also reach.
1332
+ - **Checks' Docker image** and **checks' registry image**: for a pipeline check's own Docker daemon (below), each pinned by digest. They apply when the Runner restarts.
1333
+
1334
+ \`\`\`sh
1335
+ kitman runner settings <runner> --concurrency 2 --check-hosts github.com
1336
+ \`\`\`
1337
+
1338
+ The Runner's page shows where what the Runner applies differs from its settings, and why.
1339
+
1340
+ A few things stay on your machine, because they start the Runner or protect it: the Runner's id, the API URL and its credential, \`KITMAN_RUNNER_FULL_ACCESS\`, and your consent to run agents with no sandbox, \`KITMAN_RUNNER_ALLOW_FULL_ACCESS=1\`. Kitman cannot give that consent, so nobody who can change the Runner's settings, nor a compromised control plane, can turn off your machine's sandbox: a Runner set to \`host\` on a machine without it runs its agents in \`srt\` and shows the \`full_access_refused\` Runner Problem. A Runner set to \`host\` on a machine with it runs agents that use your own \`kitman\` login. When Kitman refuses that login, the Runner shows the \`cli_session_expired\` Runner Problem: run \`kitman login\` on the machine.
1341
+
1342
+ Before Kitman kept these, they were the environment variables \`KITMAN_RUNNER_CONCURRENCY\`, \`KITMAN_RUNNER_SANDBOX\`, \`KITMAN_RUNNER_DOCKER_IMAGE\`, \`KITMAN_RUNNER_CHECK_HOSTS\`, \`KITMAN_RUNNER_CHECK_DOCKER_IMAGE\` and \`KITMAN_RUNNER_CHECK_REGISTRY_IMAGE\`. The first time a Runner starts on a version with settings, Kitman adopts the values they give, once, for each setting nobody has set yet (a shared Runner's sandbox excepted); after that the Runner ignores them and warns at each start that each one still set is deprecated. Remove them from its service when its settings look right. While \`KITMAN_RUNNER_SANDBOX=host\` stays set, it counts as your consent to run agents on the host.`
1324
1343
  },
1325
1344
  {
1326
1345
  title: "Runner Operations Guide \u203A The sandbox",
@@ -2211,7 +2230,7 @@ var pathOfLink = (link) => {
2211
2230
  return page === null ? link : page[1] || "index";
2212
2231
  };
2213
2232
  var UnpinnedSdkLink = "https://cdn.jsdelivr.net/npm/@kitman-sh/sdk/";
2214
- var pinnedLink2 = (link, version = "0.42.2") => version === undefined || !link.startsWith(UnpinnedSdkLink) ? link : link.replace(UnpinnedSdkLink, `https://cdn.jsdelivr.net/npm/@kitman-sh/sdk@${version}/`);
2233
+ var pinnedLink2 = (link, version = "0.44.0") => version === undefined || !link.startsWith(UnpinnedSdkLink) ? link : link.replace(UnpinnedSdkLink, `https://cdn.jsdelivr.net/npm/@kitman-sh/sdk@${version}/`);
2215
2234
  var pageOf = (path) => path.split("#")[0];
2216
2235
  var exportName = (section) => section.path.startsWith("sdk/") ? section.path.split("#")[1] ?? "" : "";
2217
2236
  function excerpt(text, queryTerms) {
@@ -3,7 +3,7 @@ import {
3
3
  Random,
4
4
  succeed6,
5
5
  withFiber2
6
- } from "./chunk-b4td2pgc.js";
6
+ } from "./chunk-x0ma41ys.js";
7
7
 
8
8
  // node_modules/.bun/effect@4.1.2/node_modules/effect/dist/Random.js
9
9
  var Random2 = Random;
@@ -18,7 +18,7 @@ import {
18
18
  isMinLength,
19
19
  isMaxLength,
20
20
  FiniteFromString
21
- } from "./chunk-b4td2pgc.js";
21
+ } from "./chunk-x0ma41ys.js";
22
22
 
23
23
  // packages/core/src/schema.ts
24
24
  var Days = [0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
@@ -6,7 +6,10 @@ import {
6
6
  gen,
7
7
  flatMap3,
8
8
  provideContext2
9
- } from "./chunk-b4td2pgc.js";
9
+ } from "./chunk-x0ma41ys.js";
10
+ import {
11
+ runForEach
12
+ } from "./chunk-3mbp8cse.js";
10
13
  import {
11
14
  WebSocketConstructor,
12
15
  layerWebSocketConstructorGlobal,
@@ -16,16 +19,13 @@ import {
16
19
  RunnerReplicaRpcs,
17
20
  RunnerRunFileRpcs,
18
21
  ProgramRpcs
19
- } from "./chunk-q6qn9c47.js";
20
- import {
21
- runForEach
22
- } from "./chunk-sasjamqz.js";
22
+ } from "./chunk-1k6z8q79.js";
23
23
  import {
24
24
  layerJson,
25
25
  make4,
26
26
  withHeaders,
27
27
  layerProtocolSocket
28
- } from "./chunk-c3ms91a6.js";
28
+ } from "./chunk-wkg1v0kd.js";
29
29
 
30
30
  // packages/live/src/rpc/runner-client.ts
31
31
  var proxiedWebSocket = (proxy) => succeed5(WebSocketConstructor)((target) => {
@@ -4,7 +4,7 @@ import {
4
4
  searchDocs2,
5
5
  readDoc2,
6
6
  pinnedLink2
7
- } from "./chunk-1gr39h4v.js";
7
+ } from "./chunk-7rj9d0rp.js";
8
8
  export {
9
9
  DefaultDocsSearchLimit2 as DefaultDocsSearchLimit,
10
10
  pinnedLink2 as pinnedLink,
@@ -9,10 +9,10 @@ import {
9
9
  isNone,
10
10
  getOrElse,
11
11
  Service2,
12
- empty3,
12
+ empty4,
13
13
  add,
14
14
  getOrUndefined2,
15
- get3,
15
+ get4,
16
16
  merge3,
17
17
  Reference,
18
18
  fromInputUnsafe,
@@ -138,7 +138,13 @@ import {
138
138
  toJsonSchemaDocument,
139
139
  toCodecJson,
140
140
  Json
141
- } from "./chunk-b4td2pgc.js";
141
+ } from "./chunk-x0ma41ys.js";
142
+ import {
143
+ currentTimeMillis,
144
+ getCurrent,
145
+ runForEach,
146
+ FileSystem
147
+ } from "./chunk-3mbp8cse.js";
142
148
  import {
143
149
  WebCrypto,
144
150
  makeUnsafe,
@@ -175,24 +181,18 @@ import {
175
181
  StepManifest,
176
182
  KitSetup,
177
183
  RunnerRpcError
178
- } from "./chunk-q6qn9c47.js";
179
- import {
180
- currentTimeMillis,
181
- getCurrent,
182
- runForEach,
183
- FileSystem
184
- } from "./chunk-sasjamqz.js";
184
+ } from "./chunk-1k6z8q79.js";
185
185
  import {
186
186
  splitQuestionOptions,
187
187
  recommendationProblem,
188
188
  questionAdvice
189
- } from "./chunk-tpmyf5mk.js";
189
+ } from "./chunk-k2re3tp5.js";
190
190
  import {
191
191
  guard,
192
192
  Id,
193
193
  Timestamp,
194
194
  ActorType
195
- } from "./chunk-qndcafax.js";
195
+ } from "./chunk-9h16pekj.js";
196
196
  var __defProp = Object.defineProperty;
197
197
  var __returnValue = (v) => v;
198
198
  function __exportSetter(name, newValue) {
@@ -755,7 +755,7 @@ var make = (tag, options) => makeProto({
755
755
  payloadSchema: isSchema(options.payload) ? options.payload : Struct(options.payload),
756
756
  successSchema: options.success ?? Void,
757
757
  errorSchema: options.error ?? Never,
758
- annotations: options.annotations ?? empty3(),
758
+ annotations: options.annotations ?? empty4(),
759
759
  idempotencyKey: options.idempotencyKey,
760
760
  suspendedRetrySchedule: options.suspendedRetrySchedule
761
761
  });
@@ -769,7 +769,7 @@ class Suspended extends (/* @__PURE__ */ Class2("effect/workflow/Workflow/Suspen
769
769
  [ResultTypeId] = ResultTypeId;
770
770
  }
771
771
  var wrapActivityResult = (effect, isSuspend) => contextWith((context) => {
772
- const instance = get3(context, InstanceTag);
772
+ const instance = get4(context, InstanceTag);
773
773
  return acquireUseRelease(sync2(() => adoptActivityUnsafe(context, instance) ?? registerActivityUnsafe(instance)), () => effect, (registration, exit) => {
774
774
  releaseActivityUnsafe(registration);
775
775
  const isSuspended = isSuccess2(exit) && isSuspend(exit.value);
@@ -935,7 +935,7 @@ var make3 = (options) => {
935
935
  errorSchema,
936
936
  exitSchema: Exit(successSchemaJson, errorSchemaJson, Defect()),
937
937
  exitSchemaPartial: Exit(successSchemaJson, errorSchemaJson, Unknown),
938
- annotations: options.annotations ?? empty3(),
938
+ annotations: options.annotations ?? empty4(),
939
939
  annotate(tag, value) {
940
940
  return make3({
941
941
  ...options,
@@ -1380,7 +1380,7 @@ var StepError = Union([
1380
1380
  ChangeRequestClosed,
1381
1381
  ChildFailed
1382
1382
  ]);
1383
- var serviceFree = (effect) => provide3(effect, empty3());
1383
+ var serviceFree = (effect) => provide3(effect, empty4());
1384
1384
  var declared = [];
1385
1385
  var stackSite = /\(?((?:[a-z]+:\/\/)?[^\s()]+):(\d+):(\d+)\)?$/u;
1386
1386
  var callSite = (above) => {
@@ -1420,7 +1420,7 @@ var scopingActivities = (engine) => ({
1420
1420
  }),
1421
1421
  activityExecute: (activity, attempt) => gen(function* () {
1422
1422
  const scope = yield* StepScope;
1423
- if (scope === "" || get3(activity.annotations, ActivityNamed))
1423
+ if (scope === "" || get4(activity.annotations, ActivityNamed))
1424
1424
  return yield* engine.activityExecute(activity, attempt);
1425
1425
  return yield* engine.activityExecute(renamed(activity, scopedName(scope, activity.name)), attempt);
1426
1426
  })
@@ -9,10 +9,10 @@ import {
9
9
  readOpencode2,
10
10
  databaseStamp2,
11
11
  runOpencodeReader2
12
- } from "./chunk-2bt9e1fj.js";
13
- import"./chunk-3gax0xq6.js";
14
- import"./chunk-sasjamqz.js";
15
- import"./chunk-b4td2pgc.js";
12
+ } from "./chunk-wh3pjr9r.js";
13
+ import"./chunk-134jdvs6.js";
14
+ import"./chunk-3mbp8cse.js";
15
+ import"./chunk-x0ma41ys.js";
16
16
  export {
17
17
  databaseStamp2 as databaseStamp,
18
18
  decoded2 as decoded,
@@ -1,4 +1,10 @@
1
1
  // @bun
2
+ import {
3
+ FileSystem,
4
+ Path,
5
+ optionalEnv,
6
+ tempDirectoryScoped
7
+ } from "./chunk-3mbp8cse.js";
2
8
  import {
3
9
  Reference,
4
10
  TaggedError,
@@ -25,21 +31,15 @@ import {
25
31
  isString2,
26
32
  encodePrettyJsonString,
27
33
  decodeJsonStringSync
28
- } from "./chunk-b4td2pgc.js";
29
- import {
30
- FileSystem,
31
- Path,
32
- optionalEnv,
33
- tempDirectoryScoped
34
- } from "./chunk-sasjamqz.js";
34
+ } from "./chunk-x0ma41ys.js";
35
35
  import {
36
36
  AgentHarnessIds,
37
37
  sha2562,
38
38
  runCommand2
39
- } from "./chunk-q6qn9c47.js";
39
+ } from "./chunk-1k6z8q79.js";
40
40
  import {
41
41
  NpmRegistry
42
- } from "./chunk-sbk4evb4.js";
42
+ } from "./chunk-hmctc4eq.js";
43
43
 
44
44
  // packages/agent-runtime/src/config-convergence.ts
45
45
  var writeAgentEnvironmentConfigFile2 = fnUntraced(function* (file, content, keep = {}) {