@outerlayer/cli 0.41.1 → 0.42.0-next.20261119011332

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 (44) hide show
  1. package/README.md +1 -1
  2. package/dist/{agent-setup-BJRTAU3H.js → agent-setup-RWS247BZ.js} +1 -1
  3. package/dist/build-info.json +1 -1
  4. package/dist/{caller-ZUQVRQMY.js → caller-WLYRCJKR.js} +1 -1
  5. package/dist/{check-YN3NMNHB.js → check-HABHY27Y.js} +7 -7
  6. package/dist/{chunk-7TDLQUJ5.js → chunk-BWDUZJ4K.js} +1 -1
  7. package/dist/chunk-CBSURJ2P.js +88 -0
  8. package/dist/{chunk-B2TOGQHU.js → chunk-CUPEP5D2.js} +3 -2
  9. package/dist/{chunk-F2FZG6FG.js → chunk-H7L6XTQQ.js} +1 -1
  10. package/dist/{chunk-ND6R4UHO.js → chunk-HNWNJ6QK.js} +1 -1
  11. package/dist/{chunk-QLHEU44A.js → chunk-HT6HMUC3.js} +1 -1
  12. package/dist/chunk-IMGBXZUX.js +41 -0
  13. package/dist/{chunk-UE6OJBU6.js → chunk-IOWXXJUM.js} +1 -1
  14. package/dist/{chunk-6XSVJ7O7.js → chunk-K476DEC7.js} +2 -2
  15. package/dist/{chunk-MI3YC7JL.js → chunk-M4V46N7A.js} +66 -9
  16. package/dist/{chunk-7CMRGY4Z.js → chunk-QHZZUINX.js} +1 -1
  17. package/dist/{chunk-SVALMZJU.js → chunk-UE6ZEQAL.js} +14 -10
  18. package/dist/{chunk-S3VUP7LF.js → chunk-V3T36H4O.js} +2 -2
  19. package/dist/{chunk-U74IJMMN.js → chunk-WXGEDDUO.js} +114 -30
  20. package/dist/{chunk-4JVYALPL.js → chunk-YPS6YOYK.js} +12 -8
  21. package/dist/{chunk-4GXROH35.js → chunk-ZN3RUNOZ.js} +5 -87
  22. package/dist/{cli-B7VPNSJB.js → cli-KDLYNUNH.js} +55 -38
  23. package/dist/{command-23WALNEO.js → command-GZJHU5QD.js} +4 -4
  24. package/dist/{container-start-ZWE4BSMK.js → container-start-R2C2UNL6.js} +5 -5
  25. package/dist/{doctor-N4USOXZL.js → doctor-D7B4Z7Y7.js} +5 -5
  26. package/dist/{fleet-readiness-6WFZ6DSU.js → fleet-readiness-452TASWD.js} +2 -1
  27. package/dist/{host-checks-QYSWXJHF.js → host-checks-SMVSA55L.js} +3 -3
  28. package/dist/index.js +1 -1
  29. package/dist/{init-OFLW5CQN.js → init-RWDQWHCW.js} +3 -3
  30. package/dist/{init-5XO6SUSS.js → init-ZCNI5SFB.js} +3 -3
  31. package/dist/{init-agent-K7GN7NAJ.js → init-agent-YGLQSRVI.js} +3 -3
  32. package/dist/{init-cmd-OEPA6SZX.js → init-cmd-N35UZUCM.js} +4 -3
  33. package/dist/{init-update-ZBCOQJEX.js → init-update-TKH2L4VO.js} +3 -2
  34. package/dist/{loop-6CVDHR4M.js → loop-YMGQKGIS.js} +7 -7
  35. package/dist/{machine-7SELY76I.js → machine-AFXMDA56.js} +3 -3
  36. package/dist/{runner-key-ZT6HBAUY.js → runner-key-H3CKD4UB.js} +3 -3
  37. package/dist/{setup-cmd-VFKTGD52.js → setup-cmd-IBGMGFMJ.js} +97 -13
  38. package/dist/{setup-wiring-MF3FYG4U.js → setup-wiring-O5SJZBTP.js} +19 -12
  39. package/dist/{status-XSXYRYU6.js → status-GC2RXFMJ.js} +3 -3
  40. package/dist/{update-steps-U6LUOXPF.js → update-steps-U7JDUYLU.js} +4 -4
  41. package/dist/{work-claim-cmd-BZ5RFKVN.js → work-claim-cmd-2WWN4XB7.js} +1 -1
  42. package/dist/{work-proofs-cmd-UXBOOBIG.js → work-proofs-cmd-EJPH5GY3.js} +1 -1
  43. package/dist/{work-proofs-record-BQOPO3NI.js → work-proofs-record-B25ZFR2P.js} +1 -1
  44. package/package.json +1 -1
package/README.md CHANGED
@@ -696,7 +696,7 @@ moves, that pass stops counting and a fresh review is needed. The evidence
696
696
  status check's title says where the review stands. The status check on GitHub
697
697
  never waits for the review: it completes once OuterLayer's judges finish. With
698
698
  the factory's "Block the merge when a check fails" switch on (Settings, then
699
- Build settings), a person's request for changes fails it.
699
+ Repositories), a person's request for changes fails it.
700
700
 
701
701
  A criterion thread is scoped to one acceptance criterion rather than the
702
702
  whole item: an agent attaches proof with `outerlayer work comment
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
- export { keepHandWritten, runAgentSetup } from './chunk-4JVYALPL.js';
3
+ export { keepHandWritten, runAgentSetup } from './chunk-YPS6YOYK.js';
4
4
  import './chunk-ZMXG7DQ5.js';
5
5
  import './chunk-DPS4OOL5.js';
6
6
  import './chunk-WHXF2MLU.js';
@@ -1 +1 @@
1
- {"id":"2026-11-18T21:46:09.303Z","root":"/home/runner/work/outerlayer/outerlayer","pkg":"outerlayer"}
1
+ {"id":"2026-11-19T01:25:51.403Z","root":"/home/runner/work/outerlayer/outerlayer","pkg":"outerlayer"}
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
- export { claimCalls, claimItem, configForJob, itemCalls, leftByRunnerKey, runnerCalls, spoolHomeFor } from './chunk-S3VUP7LF.js';
3
+ export { claimCalls, claimItem, configForJob, itemCalls, leftByRunnerKey, runnerCalls, spoolHomeFor } from './chunk-V3T36H4O.js';
4
4
  import './chunk-TRZOAT7E.js';
5
5
  import './chunk-MYDYQUJD.js';
6
6
  import './chunk-EYN62KZW.js';
@@ -1,17 +1,17 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
- import { probeCredentials } from './chunk-U74IJMMN.js';
3
+ import { probeCredentials } from './chunk-WXGEDDUO.js';
4
4
  import './chunk-6YBI24YT.js';
5
5
  import './chunk-E7R2GIAW.js';
6
- import './chunk-ND6R4UHO.js';
7
- import './chunk-UE6OJBU6.js';
6
+ import './chunk-HNWNJ6QK.js';
7
+ import './chunk-IOWXXJUM.js';
8
8
  import './chunk-TXKHD4Q6.js';
9
9
  import './chunk-GFXXAXPF.js';
10
10
  import './chunk-AVYR5USX.js';
11
- import { fleetConfigProblem, managedProblems, managedFactsOf, askFleetMachine, fleetQueuesWithoutAgent, fleetQueuesWithoutAgentNote } from './chunk-7CMRGY4Z.js';
11
+ import { fleetConfigProblem, managedProblems, managedFactsOf, askFleetMachine, fleetQueuesWithoutAgent, fleetQueuesWithoutAgentNote } from './chunk-QHZZUINX.js';
12
12
  import './chunk-CYQSTT5N.js';
13
- import { createGatewaySandboxClient, gatewayRefusalReason, placeholderQueues, placeholderProblem, permissionModeProblems, permissionModeProblem, needsAgentCredential, agentCredentialCheck, credentialVerdict, claimPermissionProblem, formerSkillQueues, modellessQueues, formerSkillProblem, modellessProblem } from './chunk-SVALMZJU.js';
14
- import './chunk-7TDLQUJ5.js';
13
+ import { createGatewaySandboxClient, gatewayRefusalReason, placeholderQueues, placeholderProblem, permissionModeProblems, permissionModeProblem, needsAgentCredential, agentCredentialCheck, credentialVerdict, claimPermissionProblem, formerSkillQueues, modellessQueues, formerSkillProblem, modellessProblem } from './chunk-UE6ZEQAL.js';
14
+ import './chunk-BWDUZJ4K.js';
15
15
  import './chunk-2QK7L3WV.js';
16
16
  import './chunk-2PGI6RDE.js';
17
17
  import './chunk-57MLWALQ.js';
@@ -25,7 +25,7 @@ import './chunk-C2PZOLN7.js';
25
25
  import './chunk-B4XB5QFD.js';
26
26
  import './chunk-NXYTICCS.js';
27
27
  import './chunk-TQMI335S.js';
28
- import './chunk-S3VUP7LF.js';
28
+ import './chunk-V3T36H4O.js';
29
29
  import './chunk-NN33FYXG.js';
30
30
  import './chunk-XETFYRKD.js';
31
31
  import './chunk-CQKCNDPP.js';
@@ -4,6 +4,6 @@ import { createRequire } from 'node:module';
4
4
  createRequire(import.meta.url);
5
5
 
6
6
  // src/runner/protocol.ts
7
- var RUNNER_PROTOCOL = 72;
7
+ var RUNNER_PROTOCOL = 73;
8
8
 
9
9
  export { RUNNER_PROTOCOL };
@@ -0,0 +1,88 @@
1
+ #!/usr/bin/env node
2
+ import { createRequire } from 'node:module';
3
+ import { checkCommittedMaintainedSkills } from './chunk-ZN3RUNOZ.js';
4
+ import { sanitizeTerminal } from './chunk-V3NMSDOC.js';
5
+ import { resolveGatewayCredentials, defaultFetch } from './chunk-E7HPIXAM.js';
6
+ import { versionAtLeast } from './chunk-LIPSGE6C.js';
7
+ import { findGitDirs } from './chunk-BJ3KTMDH.js';
8
+ import { cliInvocation } from './chunk-FZKNTIOJ.js';
9
+
10
+ createRequire(import.meta.url);
11
+
12
+ // src/fleet-readiness.ts
13
+ var FIRST_VERSION_WITH_MACHINE_SKILLS = "0.27.0";
14
+ var HOSTS_TIMEOUT_MS = 1e4;
15
+ function shortVersion(host) {
16
+ return host.cliVersion === null ? "no version" : /\d+\.\d+\.\d+\S*/.exec(host.cliVersion)?.[0] ?? host.cliVersion;
17
+ }
18
+ function judgeFleet(hosts) {
19
+ const old = (h) => !versionAtLeast(h.cliVersion ?? "", FIRST_VERSION_WITH_MACHINE_SKILLS);
20
+ const staleBehind = hosts.filter((h) => h.stale && old(h));
21
+ const behind = hosts.filter((h) => !h.stale && old(h));
22
+ if (behind.length > 0) return { state: "behind", behind, staleBehind };
23
+ return { state: "ready", current: hosts.filter((h) => !old(h)), staleBehind };
24
+ }
25
+ function parseHosts(body) {
26
+ const data = body?.data;
27
+ if (!Array.isArray(data)) return void 0;
28
+ const hosts = [];
29
+ for (const row of data) {
30
+ if (typeof row?.host !== "string") return void 0;
31
+ hosts.push({
32
+ host: row.host,
33
+ cliVersion: typeof row.cliVersion === "string" ? row.cliVersion : null,
34
+ lastHeartbeatAt: typeof row.lastHeartbeatAt === "string" ? row.lastHeartbeatAt : null,
35
+ stale: row.status === "stale"
36
+ });
37
+ }
38
+ return hosts;
39
+ }
40
+ async function fleetReadiness(opts = {}) {
41
+ const resolved = resolveGatewayCredentials(opts);
42
+ if (!resolved.ok) return { state: "unknown", reason: sanitizeTerminal(resolved.message) };
43
+ const fetchImpl = opts.fetchImpl ?? defaultFetch;
44
+ let status;
45
+ let body;
46
+ try {
47
+ const res = await fetchImpl(`${resolved.url.replace(/\/+$/, "")}/v1/hosts`, {
48
+ method: "GET",
49
+ headers: { authorization: `Bearer ${resolved.credential}`, "x-outerlayer-app-id": resolved.appId },
50
+ signal: AbortSignal.timeout(HOSTS_TIMEOUT_MS)
51
+ });
52
+ status = res.status;
53
+ body = await res.json().catch(() => void 0);
54
+ } catch (err) {
55
+ return { state: "unknown", reason: `the gateway did not answer: ${sanitizeTerminal(err instanceof Error ? err.message : String(err))}` };
56
+ }
57
+ if (status === 401) return { state: "unknown", reason: `the gateway refused the credential (HTTP 401); run \`${cliInvocation()} login\`` };
58
+ if (status === 403) return { state: "unknown", reason: "the credential cannot list the factory's runner hosts (HTTP 403); it needs the hosts.read permission" };
59
+ if (status >= 300) return { state: "unknown", reason: `the gateway did not list the runner hosts (HTTP ${status})` };
60
+ const hosts = parseHosts(body);
61
+ if (hosts === void 0) return { state: "unknown", reason: "the gateway's list of runner hosts was not in the expected shape" };
62
+ return judgeFleet(hosts);
63
+ }
64
+ var named = (hosts) => hosts.map((h) => `${sanitizeTerminal(h.host)} (${sanitizeTerminal(shortVersion(h))})`).join(", ");
65
+ var lastSeen = (hosts) => hosts.map((h) => `${sanitizeTerminal(h.host)} (${sanitizeTerminal(shortVersion(h))}, last heartbeat ${h.lastHeartbeatAt?.slice(0, 10) ?? "never"})`).join(", ");
66
+ function describeFleet(fleet) {
67
+ const minimum = FIRST_VERSION_WITH_MACHINE_SKILLS;
68
+ if (fleet.state === "unknown") return [`The runner hosts were not checked: ${fleet.reason}.`];
69
+ const lines = fleet.state === "behind" ? [`These runner hosts run a CLI older than ${minimum}: ${named(fleet.behind)}. Do not commit the removal until each one updates.`] : fleet.current.length === 0 ? ["No runner host has reported to this factory."] : [`Every runner host that is sending heartbeats runs ${minimum} or later: ${named(fleet.current)}.`];
70
+ if (fleet.staleBehind.length > 0) {
71
+ lines.push(`These runner hosts stopped sending heartbeats on an older CLI: ${lastSeen(fleet.staleBehind)}. Update each one before it builds again.`);
72
+ }
73
+ return lines;
74
+ }
75
+ var CHECK_NAME = "Runner hosts for the maintained skills";
76
+ async function fleetCheck(opts = {}) {
77
+ const dirs = findGitDirs(opts.cwd ?? process.cwd());
78
+ if (dirs === void 0 || checkCommittedMaintainedSkills(dirs.repoRoot).length === 0) return [];
79
+ const fleet = await fleetReadiness(opts);
80
+ const detail = describeFleet(fleet).join(" ");
81
+ if (fleet.state === "unknown") return [{ name: CHECK_NAME, status: "skipped", detail }];
82
+ if (fleet.state === "behind") {
83
+ return [{ name: CHECK_NAME, status: "warn", detail, fix: `Wait for each host to update, or run \`${cliInvocation()} runner status\` on it to see why it has not.` }];
84
+ }
85
+ return [{ name: CHECK_NAME, status: "pass", detail }];
86
+ }
87
+
88
+ export { describeFleet, fleetCheck, fleetReadiness };
@@ -2,7 +2,8 @@
2
2
  import { createRequire } from 'node:module';
3
3
  import { checkStarterFiles, contextIsGoverned } from './chunk-CNEOUUPF.js';
4
4
  import { resolveCredentials, getJson, WorkCommandError } from './chunk-ASAIS67T.js';
5
- import { fleetCheck, checkBuildSkill, checkSpecSkill, checkMachineSkills, checkCommittedMaintainedSkills, checkMaintainedReferences, checkIgnoredSkillFolders } from './chunk-4GXROH35.js';
5
+ import { fleetCheck } from './chunk-CBSURJ2P.js';
6
+ import { checkBuildSkill, checkSpecSkill, checkMachineSkills, checkCommittedMaintainedSkills, checkMaintainedReferences, checkIgnoredSkillFolders } from './chunk-ZN3RUNOZ.js';
6
7
  import { withInjectedPrograms } from './chunk-ZQHGY6K2.js';
7
8
  import { isLinkedRepository } from './chunk-7O37CF6M.js';
8
9
  import { sanitizeTerminal } from './chunk-V3NMSDOC.js';
@@ -1083,7 +1084,7 @@ async function gatherDoctorChecks(options = {}) {
1083
1084
  const { runnerVmCheck } = await import('./doctor-53F2PYY7.js');
1084
1085
  checks.push(runnerVmCheck(configPath, { lima: realLima(), home: homeFromEnv(), instance: runnerVm.instance }));
1085
1086
  } else if (hasRunnerBlock(configPath)) {
1086
- const { runnerHostChecks } = await import('./doctor-N4USOXZL.js');
1087
+ const { runnerHostChecks } = await import('./doctor-D7B4Z7Y7.js');
1087
1088
  const gateway = (() => {
1088
1089
  try {
1089
1090
  const loaded = loadRunnerConfig(configPath);
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
- import { summarizeChecks, summaryText, renderDoctorText } from './chunk-B2TOGQHU.js';
3
+ import { summarizeChecks, summaryText, renderDoctorText } from './chunk-CUPEP5D2.js';
4
4
  import { shellFunctionInstalled, removeShellFunction, installShellFunction, SHELL_FUNCTION_LINE } from './chunk-UWRXRSCE.js';
5
5
  import { runConnect, hasUncommittedSetup, commitCommandsFor } from './chunk-7O37CF6M.js';
6
6
  import { C } from './chunk-2AM6Z5BP.js';
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
- import { scrubReason, stripTerminalControls } from './chunk-SVALMZJU.js';
3
+ import { scrubReason, stripTerminalControls } from './chunk-UE6ZEQAL.js';
4
4
  import { checkFit, RUNNER_RESERVE_BYTES } from './chunk-ETBEMXPC.js';
5
5
  import { RunnerAlreadyRunningError, readPidFile } from './chunk-NRR4YLHI.js';
6
6
  import { isSameProcess } from './chunk-JBJTC3UU.js';
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
- import { helperSocketPath } from './chunk-SVALMZJU.js';
3
+ import { helperSocketPath } from './chunk-UE6ZEQAL.js';
4
4
  import { UNIT_MARKER } from './chunk-ETBEMXPC.js';
5
5
  import { runnerDir } from './chunk-5PRVTL54.js';
6
6
  import { createHash } from 'crypto';
@@ -0,0 +1,41 @@
1
+ #!/usr/bin/env node
2
+ import { createRequire } from 'node:module';
3
+ import { LEGACY_AGENT, NATIVE_AGENTS } from './chunk-7FAKHR6W.js';
4
+
5
+ createRequire(import.meta.url);
6
+
7
+ // src/setup-agent.ts
8
+ var SETUP_AGENTS = [LEGACY_AGENT, "codex"];
9
+ function isSetupAgent(value) {
10
+ return SETUP_AGENTS.includes(value);
11
+ }
12
+ function chooseSetupAgent(input) {
13
+ if (input.flag !== void 0) return { id: input.flag, chosenBy: "flag" };
14
+ if (isSetupAgent(input.configAgent)) return { id: input.configAgent, chosenBy: "config" };
15
+ const inSession = input.sessionAgents.filter(isSetupAgent);
16
+ if (inSession.length === 1) return { id: inSession[0], chosenBy: "session" };
17
+ return { id: LEGACY_AGENT, chosenBy: "default" };
18
+ }
19
+ function sessionAgentsIn(env, agents) {
20
+ return agents.filter((agent) => agent.adapter.lifecycle?.detectInSession(env) === true).map((agent) => agent.descriptor.id);
21
+ }
22
+ function setupAgentLabel(agent) {
23
+ return NATIVE_AGENTS[agent].label;
24
+ }
25
+ function setupAgentProviders(agent) {
26
+ return NATIVE_AGENTS[agent].providers;
27
+ }
28
+ function setupAgentLine(choice, command) {
29
+ const label = setupAgentLabel(choice.id);
30
+ const why = {
31
+ flag: `${label}, because --agent chose it.`,
32
+ config: `${label}, because .outerlayer/config.json names it.`,
33
+ session: `${label}, because ${label} runs this setup.`,
34
+ default: `${label}, because no --agent flag, config or agent session chose another.`
35
+ }[choice.chosenBy];
36
+ if (choice.chosenBy === "config") return `Agent: ${why} To change it, edit the agent key in .outerlayer/config.json.`;
37
+ const other = SETUP_AGENTS.find((id) => id !== choice.id);
38
+ return `Agent: ${why} To set up for ${setupAgentLabel(other)} instead, run \`${command(other)}\`.`;
39
+ }
40
+
41
+ export { SETUP_AGENTS, chooseSetupAgent, sessionAgentsIn, setupAgentLabel, setupAgentLine, setupAgentProviders };
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
- import { stripTerminalControls } from './chunk-SVALMZJU.js';
3
+ import { stripTerminalControls } from './chunk-UE6ZEQAL.js';
4
4
  import { tagToPull, imageTag, pullInstruction, readUpdateStatus, runnerImageVersion } from './chunk-NXYTICCS.js';
5
5
  import { readFileSync } from 'fs';
6
6
 
@@ -130,7 +130,7 @@ async function judgeCheckName(cwd) {
130
130
  const dir = governingDir(cwd);
131
131
  if (dir === void 0) return {};
132
132
  if (!existsSync(dir)) return { note: `the governed context at ${dir} is not readable` };
133
- const { checksIn } = await import('./host-checks-QYSWXJHF.js');
133
+ const { checksIn } = await import('./host-checks-SMVSA55L.js');
134
134
  const quiet = { line: () => void 0, error: () => void 0 };
135
135
  const check = checksIn(dir, quiet, "").checks.find((c) => c.judge.subjects === "criteria");
136
136
  return check === void 0 ? {} : { name: check.name };
@@ -366,7 +366,7 @@ async function runWorkProofs(opts) {
366
366
  async function runWorkProofsCommand(opts) {
367
367
  try {
368
368
  if (opts.record || opts.check) {
369
- const { runWorkProofsRecord } = await import('./work-proofs-record-BQOPO3NI.js');
369
+ const { runWorkProofsRecord } = await import('./work-proofs-record-B25ZFR2P.js');
370
370
  const result2 = await runWorkProofsRecord(opts);
371
371
  process.exitCode = result2.exitCode;
372
372
  return;
@@ -1,11 +1,17 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
+ import { buildSkillPaths } from './chunk-UE6ZEQAL.js';
4
+ import { ignoreRuleFor } from './chunk-ZN3RUNOZ.js';
3
5
  import { linkedBranches, setupCommitPaths, commitCommandsFor, ownerAndName } from './chunk-7O37CF6M.js';
6
+ import { sanitizeTerminal } from './chunk-V3NMSDOC.js';
7
+ import { skillsBaseFor } from './chunk-IEVG36GC.js';
4
8
  import { resolveGatewayCredentials } from './chunk-E7HPIXAM.js';
5
9
  import { findGitDirs } from './chunk-BJ3KTMDH.js';
10
+ import { cliInvocation } from './chunk-FZKNTIOJ.js';
11
+ import { skillDir, AGENTS_SKILLS_BASE, loadMaintainedFiles, loadTemplateFiles } from './chunk-V3ZIIURQ.js';
6
12
  import { execFileSync } from 'child_process';
7
13
  import { existsSync, mkdirSync, writeFileSync } from 'fs';
8
- import { join, dirname } from 'path';
14
+ import { relative, join, dirname } from 'path';
9
15
 
10
16
  createRequire(import.meta.url);
11
17
  var SETUP_BRANCH = "outerlayer-setup";
@@ -19,7 +25,7 @@ function run(command, args, cwd) {
19
25
  return { ok: true, stdout: stdout.trim(), stderr: "" };
20
26
  } catch (err) {
21
27
  const e = err;
22
- return { ok: false, stdout: String(e.stdout ?? "").trim(), stderr: String(e.stderr ?? e.message ?? "").trim() };
28
+ return { ok: false, stdout: String(e.stdout ?? "").trim(), stderr: String(e.stderr ?? e.message ?? "").trim(), ...e.code === "ENOENT" ? { notFound: true } : {} };
23
29
  }
24
30
  }
25
31
  var git = (cwd, args) => run("git", args, cwd);
@@ -39,7 +45,39 @@ function currentBranch(cwd) {
39
45
  }
40
46
  function setupMerged(cwd, base) {
41
47
  if (!git(cwd, ["fetch", "--quiet", "origin", `refs/heads/${base}:refs/remotes/origin/${base}`]).ok) return null;
42
- return git(cwd, ["cat-file", "-e", `refs/remotes/origin/${base}:${SETUP_MARKER}`]).ok;
48
+ const onBase = (path) => git(cwd, ["cat-file", "-e", `refs/remotes/origin/${base}:${path}`]).ok;
49
+ if (!onBase(SETUP_MARKER)) return false;
50
+ const root = findGitDirs(cwd)?.repoRoot ?? cwd;
51
+ const own = `${skillDir("build", skillsBaseFor(root))}/SKILL.md`;
52
+ if ([own, ...buildSkillPaths()].some(onBase)) return true;
53
+ return missingBuildSkill(cwd, root, own, base);
54
+ }
55
+ function missingBuildSkill(cwd, root, path, base) {
56
+ const shown = relative(cwd, join(root, path));
57
+ const here = existsSync(join(root, path));
58
+ const rule = ignoreRuleFor(root, path);
59
+ const reason = !here ? `it is not in this checkout either, so \`${cliInvocation()} init\` must write it again` : rule !== void 0 ? `git ignores it, by the rule ${ruleText(rule)}, so the setup commit left it out` : `it is in this checkout, and no commit on ${base} holds it`;
60
+ return {
61
+ path: shown,
62
+ reason,
63
+ commands: [...here ? [] : [`${cliInvocation()} init`], `git add ${rule === void 0 ? "" : "-f "}${shown}`, 'git commit -m "Add the OuterLayer build skill"', "git push"]
64
+ };
65
+ }
66
+ function ruleText(rule) {
67
+ return `${rule.source}:${rule.line}:${rule.pattern}`;
68
+ }
69
+ function filesSetupWrites(root) {
70
+ const base = skillsBaseFor(root);
71
+ const maintained = base === AGENTS_SKILLS_BASE ? [] : loadMaintainedFiles(void 0, void 0, base);
72
+ return /* @__PURE__ */ new Set([SETUP_MARKER, ...[...loadTemplateFiles(void 0, void 0, base), ...maintained].map((file) => file.path)]);
73
+ }
74
+ function ignoredSetupFiles(root, paths) {
75
+ const listed = git(root, ["ls-files", "--others", "--ignored", "--exclude-standard", "-z", "--", ...paths]);
76
+ const written = filesSetupWrites(root);
77
+ return listed.stdout.split("\0").filter((path) => written.has(path)).flatMap((path) => {
78
+ const rule = ignoreRuleFor(root, path);
79
+ return rule === void 0 ? [] : [{ path, rule: ruleText(rule) }];
80
+ });
43
81
  }
44
82
  function setupBranchPushed(cwd) {
45
83
  const heads = git(cwd, ["ls-remote", "--heads", "origin", SETUP_BRANCH]);
@@ -49,11 +87,20 @@ function compareUrl(repository, base) {
49
87
  if (repository === void 0 || !repository.toLowerCase().startsWith("github.com/")) return void 0;
50
88
  return `https://github.com/${ownerAndName(repository)}/compare/${encodeURIComponent(base)}...${SETUP_BRANCH}?expand=1`;
51
89
  }
90
+ function ghSays(result) {
91
+ const lines = `${result.stderr}
92
+ ${result.stdout}`.split("\n").map((line) => line.trim().replace(/^[X✓-]\s+/, "")).filter((line) => line !== "" && line !== "github.com");
93
+ return sanitizeTerminal(lines.join(" ")) || "nothing";
94
+ }
52
95
  function ghReady(gh, cwd) {
53
- return gh(["auth", "status"], cwd).ok;
96
+ let status = gh(["auth", "status", "--hostname", "github.com", "--active"], cwd);
97
+ if (!status.ok && /unknown flag: --active/.test(status.stderr)) status = gh(["auth", "status", "--hostname", "github.com"], cwd);
98
+ if (status.ok) return { ready: true };
99
+ if (status.notFound === true) return { ready: false, reason: "gh is not installed." };
100
+ return { ready: false, reason: `gh is not signed in to github.com. gh says: ${ghSays(status)}` };
54
101
  }
55
102
  function setupPullRequestUrl(cwd, base, repository, gh = realGh) {
56
- if (compareUrl(repository, base) !== void 0 && ghReady(gh, cwd)) {
103
+ if (compareUrl(repository, base) !== void 0 && ghReady(gh, cwd).ready) {
57
104
  const open = gh(["pr", "view", SETUP_BRANCH, "--json", "url", "--jq", ".url"], cwd);
58
105
  if (open.ok && open.stdout.startsWith("https://")) return open.stdout;
59
106
  }
@@ -64,7 +111,7 @@ function openSetupPullRequest(cwd, base, repository, gh = realGh) {
64
111
  if (dirs === void 0) return { ok: false, message: "this directory is not in a git repository." };
65
112
  const paths = setupCommitPaths(dirs.repoRoot);
66
113
  if (paths.length === 0) return { ok: false, message: "there are no setup files to commit. Run `outerlayer setup` without --open-pr first." };
67
- return pushSetupBranch({ root: dirs.repoRoot, paths, base, repository, commitCommands: commitCommandsFor(cwd) }, git, gh);
114
+ return pushSetupBranch({ root: dirs.repoRoot, paths, base, repository, commitCommands: commitCommandsFor(cwd), forced: ignoredSetupFiles(dirs.repoRoot, paths) }, git, gh);
68
115
  }
69
116
  function pushSetupBranch(plan, runGit, gh) {
70
117
  const { root, paths, base, repository } = plan;
@@ -89,6 +136,11 @@ ${plan.commitCommands}`
89
136
  }
90
137
  const added = runGit(root, ["add", "--", ...paths]);
91
138
  if (!added.ok) return { ok: false, message: `git add failed: ${added.stderr}` };
139
+ const forced = plan.forced ?? [];
140
+ if (forced.length > 0) {
141
+ const forceAdded = runGit(root, ["add", "-f", "--", ...forced.map((file) => file.path)]);
142
+ if (!forceAdded.ok) return { ok: false, message: `git add -f failed: ${forceAdded.stderr}` };
143
+ }
92
144
  const staged = runGit(root, ["diff", "--cached", "--quiet", "--", ...paths]);
93
145
  if (!staged.ok) {
94
146
  const committed = runGit(root, ["commit", "--quiet", "-m", PR_TITLE, "--", ...paths]);
@@ -96,13 +148,18 @@ ${plan.commitCommands}`
96
148
  }
97
149
  const pushed = runGit(root, ["push", "--quiet", "-u", "origin", SETUP_BRANCH]);
98
150
  if (!pushed.ok) return { ok: false, message: `git push failed: ${pushed.stderr}` };
151
+ const extra = forced.length > 0 ? { forced } : {};
99
152
  const page = compareUrl(repository, base);
100
- if (page === void 0 || !ghReady(gh, root)) return { ok: true, url: page, opened: false };
153
+ if (page === void 0) return { ok: true, url: page, opened: false, ...extra };
154
+ const ready = ghReady(gh, root);
155
+ if (!ready.ready) return { ok: true, url: page, opened: false, reason: ready.reason, ...extra };
101
156
  const existing = gh(["pr", "view", SETUP_BRANCH, "--json", "url", "--jq", ".url"], root);
102
- if (existing.ok && existing.stdout.startsWith("https://")) return { ok: true, url: existing.stdout, opened: true };
157
+ if (existing.ok && existing.stdout.startsWith("https://")) return { ok: true, url: existing.stdout, opened: true, ...extra };
103
158
  const created = gh(["pr", "create", "--base", base, "--head", SETUP_BRANCH, "--title", PR_TITLE, "--body", PR_BODY], root);
104
159
  const url = created.stdout.split("\n").reverse().find((line) => line.startsWith("https://"));
105
- return created.ok && url !== void 0 ? { ok: true, url, opened: true } : { ok: true, url: page, opened: false };
160
+ if (created.ok && url !== void 0) return { ok: true, url, opened: true, ...extra };
161
+ const said = sanitizeTerminal((created.stderr || created.stdout).split("\n")[0]) || "nothing";
162
+ return { ok: true, url: page, opened: false, reason: `gh could not create the pull request. gh says: ${said}`, ...extra };
106
163
  }
107
164
  function installedPath(cwd) {
108
165
  const dirs = findGitDirs(cwd);
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
- import { placeholderQueues, placeholderProblem } from './chunk-SVALMZJU.js';
3
+ import { placeholderQueues, placeholderProblem } from './chunk-UE6ZEQAL.js';
4
4
  import { checkFit } from './chunk-ETBEMXPC.js';
5
5
  import { getJson, WorkCommandError } from './chunk-ASAIS67T.js';
6
6
  import { isBuiltinSandbox, builtinKind, EGRESS_SWITCHABLE_KEYS, keepsHostBuilder } from './chunk-TRZOAT7E.js';
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
- import { RUNNER_PROTOCOL } from './chunk-7TDLQUJ5.js';
3
+ import { RUNNER_PROTOCOL } from './chunk-BWDUZJ4K.js';
4
4
  import { MAX_TEST_FILE_BYTES, criteriaOf, hostItemsOf, loadCitationFinder, testFileMatcher, planCriteria, wholeItems, judgeGroups, failedItems, inCriteriaOrder, itemsSentence, testsByCriterion, oneLineReason, criterionInputs, parseJudgeAnswer, judgedItems, hostCheckOf } from './chunk-2QK7L3WV.js';
5
5
  import { sha256OfFile, downloadPinned, VoiceDownloadError } from './chunk-2PGI6RDE.js';
6
6
  import { hasStoredCredential, storedCredentialVariables, storeAgentCredential, replaceFile, isAgentName, credentialFromStdin } from './chunk-57MLWALQ.js';
@@ -10,7 +10,7 @@ import { senderPidfile } from './chunk-QZFQ6EWP.js';
10
10
  import { installScrubContext } from './chunk-AFU6UF34.js';
11
11
  import { readsJobState, READ_JOB_STATE_FORMATS, jobStateFormatOf } from './chunk-B4XB5QFD.js';
12
12
  import { runnerImageVersion } from './chunk-NXYTICCS.js';
13
- import { claimCalls, spoolHomeFor, itemCalls, claimItem, leftByRunnerKey, configForJob } from './chunk-S3VUP7LF.js';
13
+ import { claimCalls, spoolHomeFor, itemCalls, claimItem, leftByRunnerKey, configForJob } from './chunk-V3T36H4O.js';
14
14
  import { receiveFiles } from './chunk-NN33FYXG.js';
15
15
  import { readDefaultBranchFiles, readDefaultBranchHead, buildRepositoryImage, readRepositoryRecipe, fetchCommit, prepareImageBuild, readBranchHead, diffBetween, KEY_PREFIX, TAG_HOST, SHARED_OWNER, SHARED_NAME, universalBase, metadataFromLabels, writeRecord, changedPathsBetween } from './chunk-XETFYRKD.js';
16
16
  import { FETCHED_DIR, toolsDockerfile, FETCHED_FFMPEG, FETCHED_GH, FETCHED_TINI, FETCHED_HEADLESS_SHELL, FETCHED_PLAYWRIGHT_FFMPEG, FETCHED_VOICE_DIR } from './chunk-CQKCNDPP.js';
@@ -258,9 +258,8 @@ function claimRepos(repos) {
258
258
  const bare = (pattern) => pattern.replace(/^github\.com\//i, "");
259
259
  return { include: (repos.include ?? []).map(bare), exclude: (repos.exclude ?? []).map(bare) };
260
260
  }
261
- function parseClaim(data) {
262
- const run = data.run;
263
- const runKey = data.runKey;
261
+ function parseRunClaim(runValue, runKey) {
262
+ const run = runValue;
264
263
  if (run === null || run === void 0 || typeof run !== "object") return { kind: "none" };
265
264
  if (typeof run.id !== "string" || typeof run.repository !== "string" || typeof run.instructions !== "string" || typeof run.issuesLeft !== "number" || typeof run.timeLimitSeconds !== "number" || typeof runKey !== "string" || runKey === "") {
266
265
  return { kind: "malformed", reason: "the gateway's answer to the run claim is missing a field the runner needs; upgrade the runner or the gateway" };
@@ -271,6 +270,9 @@ function parseClaim(data) {
271
270
  runKey
272
271
  };
273
272
  }
273
+ function parseClaim(data) {
274
+ return parseRunClaim(data.run, data.runKey);
275
+ }
274
276
  async function claimRun(input) {
275
277
  const { config } = input;
276
278
  const repos = claimRepos(config.repos);
@@ -718,7 +720,7 @@ function failedStepLineOf(path) {
718
720
  // src/runner/managed-model-key.ts
719
721
  var FETCH_RETRY_WINDOW_MS = 3e4;
720
722
  var ADOPTED_FETCH_RETRY_WINDOW_MS = 3e5;
721
- var OWN_404_CODES = /* @__PURE__ */ new Set(["work_item_not_found", "model_provider_unknown"]);
723
+ var OWN_404_CODES = /* @__PURE__ */ new Set(["work_item_not_found", "run_not_found", "model_provider_unknown"]);
722
724
  async function fetchAnthropicKeyOfOlderGateway(config, item, fetchImpl, deps) {
723
725
  const outcome = await retrySend(
724
726
  async () => postJson(config.url, `/v1/work-items/${item}/claim/anthropic-key`, config.apiKey, config.appId, {}, fetchImpl, void 0, await signerFor(config.configPath)),
@@ -734,12 +736,13 @@ async function fetchAnthropicKeyOfOlderGateway(config, item, fetchImpl, deps) {
734
736
  async function fetchManagedModelKey(config, item, deps = {}) {
735
737
  const fetchImpl = deps.fetchImpl ?? fetch;
736
738
  const body = deps.provider === void 0 ? {} : { provider: deps.provider };
739
+ const path = deps.run === true ? `/v1/schedule-runs/${item}/model-key` : `/v1/work-items/${item}/claim/model-key`;
737
740
  const outcome = await retrySend(
738
- async () => postJson(config.url, `/v1/work-items/${item}/claim/model-key`, config.apiKey, config.appId, body, fetchImpl, void 0, await signerFor(config.configPath)),
741
+ async () => postJson(config.url, path, config.apiKey, config.appId, body, fetchImpl, void 0, await signerFor(config.configPath)),
739
742
  { now: deps.now, sleep: deps.sleep, windowMs: deps.windowMs ?? FETCH_RETRY_WINDOW_MS }
740
743
  );
741
744
  if (!outcome.ok) {
742
- if (outcome.status === 404 && !OWN_404_CODES.has(outcome.code ?? "") && (deps.provider === void 0 || deps.provider === "anthropic")) {
745
+ if (deps.run !== true && outcome.status === 404 && !OWN_404_CODES.has(outcome.code ?? "") && (deps.provider === void 0 || deps.provider === "anthropic")) {
743
746
  return fetchAnthropicKeyOfOlderGateway(config, item, fetchImpl, deps);
744
747
  }
745
748
  return { ok: false, code: outcome.code, reason: outcome.message ?? outcome.reason, retryable: outcome.retryable };
@@ -843,8 +846,9 @@ function parseSettings(data) {
843
846
  }
844
847
  async function fetchManagedBuildSettings(config, item, deps = {}) {
845
848
  const fetchImpl = deps.fetchImpl ?? fetch;
849
+ const path = deps.run === true ? `/v1/schedule-runs/${item}/build-settings` : `/v1/work-items/${item}/claim/build-settings`;
846
850
  const outcome = await retrySend(
847
- async () => postJson(config.url, `/v1/work-items/${item}/claim/build-settings`, config.apiKey, config.appId, {}, fetchImpl, void 0, await signerFor(config.configPath)),
851
+ async () => postJson(config.url, path, config.apiKey, config.appId, {}, fetchImpl, void 0, await signerFor(config.configPath)),
848
852
  { now: deps.now, sleep: deps.sleep, windowMs: deps.windowMs ?? FETCH_RETRY_WINDOW_MS2 }
849
853
  );
850
854
  if (!outcome.ok) return { ok: false, code: outcome.code, reason: outcome.message ?? outcome.reason, retryable: outcome.retryable };
@@ -14403,4 +14407,4 @@ function makeRecorder(input) {
14403
14407
  };
14404
14408
  }
14405
14409
 
14406
- export { ADOPTED_FETCH_RETRY_WINDOW_MS, ALREADY_RELEASED, AttemptLogBook, EXIT_CODE_FILE, GUEST_USAGE_INTERVAL_MS, HELPER_ENV, KIND_LABEL, LEASE_SECONDS, MICROVM_COMMAND_DIR, MIN_ENGINE_MAJOR, NO_LOG, PLACEHOLDER_MARKER, RENEW_INTERVAL_SECONDS, RunnerInitError, SandboxContainerStoppedError, SandboxGoneError, addRunnerAgent, agentCredentialCheck, agentCredentialFromFiles, appendCommandLog, attemptNote, builtOf, carriedProblems, checksIn, claimPermissionProblem, claimRun, commandEndReasonOf, commandLogOffset, containerCommandExec, createContainerRuntime, createGatewaySandboxClient, createHousekeepingDocker, createLeaseChannel, credentialVerdict, currentSkillCommand, decideHostBuildSkill, deliverCommitHooks, deliverContainerHooks, deliverExecMaven, deliverJobFiles, deliverSandboxHooks, describeHookEnd, describeMachineDocker, detectMachine, dropNonProblems, ensureFirecrackerAndJailer, ensureNetworkReady, ensureTunnel, environmentFor, execArgv, execCommandLine, fetchManagedBuildSettings, fetchManagedModelKey, filesAreCopied, finishJob, foldSample, formerSkillProblem, formerSkillQueues, freeItemDisksUntil, gatewayRefusalReason, gitRemoteFor, hasRunnerBlock, heldSandboxClaimsOf, helperFirecrackerNote, helperSocketPath, holdManagedBuildSettings, holdManagedKey, holdsHostDisk, hookLimitsFor, hostCommandEnvironment, hostEnvironment, housekeepingDockerIfReachable, inSandbox, inTeardown, installTrust, isContainerTracked, isGroupAlive, isIdle, isIsolatedJob, isMicroVmTracked, isPlaceholderCommand, isReadable, isSandboxTracked, isTimedOut, isTracked, isUnfinished, issueText, itemScope, itemTag, jobEnv, jobRecordsClaim, jobTimeLimitMinutes, judgeCredential, judgeProbe, keepGhConfigCurrent, keptCommitsLine, keptSandboxIds, keptSessionDir, leaseExpiresAtMs, leaseTimeLeftMs, lifecycleFailureReason, lifecycleSteps, listAdoptableJobs, listItemDisks, listTrackedJobs, listUnreadableJobs, listenOnBroker, makeRecorder, managedBuildSettingsFor, markdownSection, measureDisk, mergeAnswers, microVmArchSupported, microVmAssetsPinned, microVmCommandLine, microVmOomKills, missingJudgeCredential, missingPermissionFix, missingPermissionOf, modellessProblem, modellessQueues, nativeWindowsSandboxRefusal, needsAgentCredential, needsBuildSkill, needsRenew, noteMissingCredential, outcomeFromExitCode, parseCpuList, permissionModeProblem, permissionModeProblems, placeholderProblem, placeholderQueues, prepareBranch, prepareResume, prepareRunnerInit, probeCommand, probeHelper, probeMicroVmCommand, probeSandboxCommand, provisionContainer, provisionEnvironment, provisionMicroVm, provisionSandbox, reachDockerStep, readConfigObject, readCpuUsec, readDefinitions, readProvisionOut, readRecords, readWorkItem, recordsProofsOnly, recoverLostJobs, rejoinSandboxBuild, releaseLease, removeOldestUntil, removeRunnerBlock, renewLease, renewRun, resolveHostBuild, restartSender, restoreSessionIntoContainer, restoreSessionIntoMicroVm, restoreSessionIntoSandbox, restoreWork, retryFailedReleases, reviewFiles, runCommand, runCommandFor, runCommandOf, runDecision, runHook, runHousekeeping, runRunnerInit, runWithSpawn, sampleGuest, savedStatesDir, scrubReason, serveLease, sessionGuestOfContainer, sessionGuestOfMicroVm, sessionGuestOfSandbox, setStage, setUpRunnerCgroup, shellQuote, startHostServices, startMicroVmCommand, startSandboxCommand, startSender, startServicesFor, stopOrphanedMicroVms, stoppedHelperReason, storedProblemsText, stripTerminalControls, superviseRuns, supportsContainerBuilds, supportsMicroVmBuilds, sweepImageBuilders, sweepSandboxes, territories, territoryBrief, timeoutAfter, treeFileText, unfinishedJobs, unreviewedFiles, unreviewedItem, vmAlive, withJobTimeLimit, withTunnelLog, workRestoredEnv, workdirProblem, writeGuestGhConfig, writeRunnerInit };
14410
+ export { ADOPTED_FETCH_RETRY_WINDOW_MS, ALREADY_RELEASED, AttemptLogBook, EXIT_CODE_FILE, GUEST_USAGE_INTERVAL_MS, HELPER_ENV, KIND_LABEL, LEASE_SECONDS, MICROVM_COMMAND_DIR, MIN_ENGINE_MAJOR, NO_LOG, PLACEHOLDER_MARKER, RENEW_INTERVAL_SECONDS, RunnerInitError, SandboxContainerStoppedError, SandboxGoneError, addRunnerAgent, agentCredentialCheck, agentCredentialFromFiles, appendCommandLog, attemptNote, buildSkillPaths, builtOf, carriedProblems, checksIn, claimPermissionProblem, claimRun, commandEndReasonOf, commandLogOffset, containerCommandExec, createContainerRuntime, createGatewaySandboxClient, createHousekeepingDocker, createLeaseChannel, credentialVerdict, currentSkillCommand, decideHostBuildSkill, deliverCommitHooks, deliverContainerHooks, deliverExecMaven, deliverJobFiles, deliverSandboxHooks, describeHookEnd, describeMachineDocker, detectMachine, dropNonProblems, ensureFirecrackerAndJailer, ensureNetworkReady, ensureTunnel, environmentFor, execArgv, execCommandLine, fetchManagedBuildSettings, fetchManagedModelKey, filesAreCopied, finishJob, foldSample, formerSkillProblem, formerSkillQueues, freeItemDisksUntil, gatewayRefusalReason, gitRemoteFor, hasRunnerBlock, heldSandboxClaimsOf, helperFirecrackerNote, helperSocketPath, holdManagedBuildSettings, holdManagedKey, holdsHostDisk, hookLimitsFor, hostCommandEnvironment, hostEnvironment, housekeepingDockerIfReachable, inSandbox, inTeardown, installTrust, isContainerTracked, isGroupAlive, isIdle, isIsolatedJob, isMicroVmTracked, isPlaceholderCommand, isReadable, isSandboxTracked, isTimedOut, isTracked, isUnfinished, issueText, itemScope, itemTag, jobEnv, jobRecordsClaim, jobTimeLimitMinutes, judgeCredential, judgeProbe, keepGhConfigCurrent, keptCommitsLine, keptSandboxIds, keptSessionDir, leaseExpiresAtMs, leaseTimeLeftMs, lifecycleFailureReason, lifecycleSteps, listAdoptableJobs, listItemDisks, listTrackedJobs, listUnreadableJobs, listenOnBroker, makeRecorder, managedBuildSettingsFor, markdownSection, measureDisk, mergeAnswers, microVmArchSupported, microVmAssetsPinned, microVmCommandLine, microVmOomKills, missingJudgeCredential, missingPermissionFix, missingPermissionOf, modellessProblem, modellessQueues, nativeWindowsSandboxRefusal, needsAgentCredential, needsBuildSkill, needsRenew, noteMissingCredential, outcomeFromExitCode, parseCpuList, parseRunClaim, permissionModeProblem, permissionModeProblems, placeholderProblem, placeholderQueues, prepareBranch, prepareResume, prepareRunnerInit, probeCommand, probeHelper, probeMicroVmCommand, probeSandboxCommand, provisionContainer, provisionEnvironment, provisionMicroVm, provisionSandbox, reachDockerStep, readConfigObject, readCpuUsec, readDefinitions, readProvisionOut, readRecords, readWorkItem, recordsProofsOnly, recoverLostJobs, rejoinSandboxBuild, releaseLease, releaseRun, removeOldestUntil, removeRunnerBlock, renewLease, renewRun, resolveHostBuild, restartSender, restoreSessionIntoContainer, restoreSessionIntoMicroVm, restoreSessionIntoSandbox, restoreWork, retryFailedReleases, reviewFiles, runCommand, runCommandFor, runCommandOf, runDecision, runHook, runHousekeeping, runRunnerInit, runWithSpawn, sampleGuest, savedStatesDir, scrubReason, serveLease, sessionGuestOfContainer, sessionGuestOfMicroVm, sessionGuestOfSandbox, setStage, setUpRunnerCgroup, shellQuote, startHostServices, startMicroVmCommand, startSandboxCommand, startSender, startServicesFor, stopOrphanedMicroVms, stoppedHelperReason, storedProblemsText, stripTerminalControls, superviseRuns, supportsContainerBuilds, supportsMicroVmBuilds, sweepImageBuilders, sweepSandboxes, territories, territoryBrief, timeoutAfter, treeFileText, unfinishedJobs, unreviewedFiles, unreviewedItem, vmAlive, withJobTimeLimit, withTunnelLog, workRestoredEnv, workdirProblem, writeGuestGhConfig, writeRunnerInit };
@@ -18,7 +18,7 @@ function runnerCalls(config) {
18
18
  return config;
19
19
  }
20
20
  function claimCalls(config, job) {
21
- if (job.queue === "run") return withoutBuildAccess(runnerCalls(config));
21
+ if (job.queue === "run") return withoutBuildAccess(config.fleet === true ? { ...config, appId: factoryOf(job) } : runnerCalls(config));
22
22
  if (config.fleet !== true) return runnerCalls(config);
23
23
  return { ...config, appId: factoryOf(job) };
24
24
  }
@@ -36,7 +36,7 @@ function itemCalls(config, job) {
36
36
  return { ...config, apiKey: job.itemKey, appId: factoryOf(job) };
37
37
  }
38
38
  function claimItem(config, job) {
39
- if (config.fleet !== true) return job.item;
39
+ if (config.fleet !== true || job.queue === "run") return job.item;
40
40
  if (job.workItemId === void 0 || job.workItemId === "") throw new RunnerConfigError("a fleet build's job file names no work item id; the claim carries it");
41
41
  return job.workItemId;
42
42
  }