@outerlayer/cli 0.41.1 → 0.41.2-next.20261119010339
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/{agent-setup-BJRTAU3H.js → agent-setup-RWS247BZ.js} +1 -1
- package/dist/build-info.json +1 -1
- package/dist/{check-YN3NMNHB.js → check-BXJBIMLW.js} +5 -5
- package/dist/{chunk-UE6OJBU6.js → chunk-3ZZSQG2A.js} +1 -1
- package/dist/{chunk-6XSVJ7O7.js → chunk-72NCZTEG.js} +2 -2
- package/dist/{chunk-QLHEU44A.js → chunk-7HH6C45Q.js} +1 -1
- package/dist/{chunk-MI3YC7JL.js → chunk-AAL7FZPH.js} +66 -9
- package/dist/chunk-CBSURJ2P.js +88 -0
- package/dist/{chunk-U74IJMMN.js → chunk-DQ3IKV5Q.js} +5 -5
- package/dist/chunk-IMGBXZUX.js +41 -0
- package/dist/{chunk-7CMRGY4Z.js → chunk-OLXB2YMX.js} +1 -1
- package/dist/{chunk-SVALMZJU.js → chunk-RCE5YQFT.js} +1 -1
- package/dist/{chunk-ND6R4UHO.js → chunk-U5MLUAY3.js} +1 -1
- package/dist/{chunk-B2TOGQHU.js → chunk-X6WL4AQY.js} +3 -2
- package/dist/{chunk-4JVYALPL.js → chunk-YPS6YOYK.js} +12 -8
- package/dist/{chunk-F2FZG6FG.js → chunk-Z27PY2OJ.js} +1 -1
- package/dist/{chunk-4GXROH35.js → chunk-ZN3RUNOZ.js} +5 -87
- package/dist/{cli-B7VPNSJB.js → cli-7QRILUMX.js} +51 -34
- package/dist/{command-23WALNEO.js → command-TOAYBFFZ.js} +2 -2
- package/dist/{container-start-ZWE4BSMK.js → container-start-6FSO54P4.js} +3 -3
- package/dist/{doctor-N4USOXZL.js → doctor-XDN7XS64.js} +3 -3
- package/dist/{fleet-readiness-6WFZ6DSU.js → fleet-readiness-452TASWD.js} +2 -1
- package/dist/{host-checks-QYSWXJHF.js → host-checks-XGFTDLLF.js} +1 -1
- package/dist/index.js +1 -1
- package/dist/{init-OFLW5CQN.js → init-JU5GZJWH.js} +1 -1
- package/dist/{init-5XO6SUSS.js → init-VOKKIEKX.js} +1 -1
- package/dist/{init-agent-K7GN7NAJ.js → init-agent-XMC3ZJWR.js} +1 -1
- package/dist/{init-cmd-OEPA6SZX.js → init-cmd-CKMBOAZ5.js} +4 -3
- package/dist/{init-update-ZBCOQJEX.js → init-update-TKH2L4VO.js} +3 -2
- package/dist/{loop-6CVDHR4M.js → loop-WPT6ILVY.js} +5 -5
- package/dist/{machine-7SELY76I.js → machine-BZBJNTTU.js} +1 -1
- package/dist/{runner-key-ZT6HBAUY.js → runner-key-LTA6PHOI.js} +1 -1
- package/dist/{setup-cmd-VFKTGD52.js → setup-cmd-ANDLH2E7.js} +97 -13
- package/dist/{setup-wiring-MF3FYG4U.js → setup-wiring-4YSYU7OV.js} +17 -10
- package/dist/{status-XSXYRYU6.js → status-4MTM45CS.js} +1 -1
- package/dist/{update-steps-U6LUOXPF.js → update-steps-GJ6WGON2.js} +2 -2
- package/dist/{work-proofs-cmd-UXBOOBIG.js → work-proofs-cmd-FIEPKCPW.js} +1 -1
- package/dist/{work-proofs-record-BQOPO3NI.js → work-proofs-record-BQ7EAT5R.js} +1 -1
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
|
-
export { keepHandWritten, runAgentSetup } from './chunk-
|
|
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';
|
package/dist/build-info.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"id":"2026-11-
|
|
1
|
+
{"id":"2026-11-19T01:10:25.003Z","root":"/home/runner/work/outerlayer/outerlayer","pkg":"outerlayer"}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
|
-
import { probeCredentials } from './chunk-
|
|
3
|
+
import { probeCredentials } from './chunk-DQ3IKV5Q.js';
|
|
4
4
|
import './chunk-6YBI24YT.js';
|
|
5
5
|
import './chunk-E7R2GIAW.js';
|
|
6
|
-
import './chunk-
|
|
7
|
-
import './chunk-
|
|
6
|
+
import './chunk-U5MLUAY3.js';
|
|
7
|
+
import './chunk-3ZZSQG2A.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-
|
|
11
|
+
import { fleetConfigProblem, managedProblems, managedFactsOf, askFleetMachine, fleetQueuesWithoutAgent, fleetQueuesWithoutAgentNote } from './chunk-OLXB2YMX.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-
|
|
13
|
+
import { createGatewaySandboxClient, gatewayRefusalReason, placeholderQueues, placeholderProblem, permissionModeProblems, permissionModeProblem, needsAgentCredential, agentCredentialCheck, credentialVerdict, claimPermissionProblem, formerSkillQueues, modellessQueues, formerSkillProblem, modellessProblem } from './chunk-RCE5YQFT.js';
|
|
14
14
|
import './chunk-7TDLQUJ5.js';
|
|
15
15
|
import './chunk-2QK7L3WV.js';
|
|
16
16
|
import './chunk-2PGI6RDE.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
|
-
import { stripTerminalControls } from './chunk-
|
|
3
|
+
import { stripTerminalControls } from './chunk-RCE5YQFT.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-
|
|
133
|
+
const { checksIn } = await import('./host-checks-XGFTDLLF.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-
|
|
369
|
+
const { runWorkProofsRecord } = await import('./work-proofs-record-BQ7EAT5R.js');
|
|
370
370
|
const result2 = await runWorkProofsRecord(opts);
|
|
371
371
|
process.exitCode = result2.exitCode;
|
|
372
372
|
return;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
|
-
import { helperSocketPath } from './chunk-
|
|
3
|
+
import { helperSocketPath } from './chunk-RCE5YQFT.js';
|
|
4
4
|
import { UNIT_MARKER } from './chunk-ETBEMXPC.js';
|
|
5
5
|
import { runnerDir } from './chunk-5PRVTL54.js';
|
|
6
6
|
import { createHash } from 'crypto';
|
|
@@ -1,11 +1,17 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
|
+
import { buildSkillPaths } from './chunk-RCE5YQFT.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
|
-
|
|
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
|
-
|
|
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
|
|
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
|
-
|
|
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);
|
|
@@ -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,14 +2,14 @@
|
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
3
|
import { readHousekeepingRecord, writeHousekeepingRecord } from './chunk-6YBI24YT.js';
|
|
4
4
|
import { fetchVersionMeta, npmVersion, npmSupportsProvenance, fetchTarballDigest, fetchProvenance, installVersion, auditSignatures } from './chunk-E7R2GIAW.js';
|
|
5
|
-
import { reportFailedStart, fitImageBuildMemory } from './chunk-
|
|
6
|
-
import { renderUpdateSteps } from './chunk-
|
|
5
|
+
import { reportFailedStart, fitImageBuildMemory } from './chunk-U5MLUAY3.js';
|
|
6
|
+
import { renderUpdateSteps } from './chunk-3ZZSQG2A.js';
|
|
7
7
|
import { decideInstalledSwitch } from './chunk-TXKHD4Q6.js';
|
|
8
8
|
import { writeFleetState } from './chunk-GFXXAXPF.js';
|
|
9
9
|
import { writePendingUpdate } from './chunk-AVYR5USX.js';
|
|
10
|
-
import { fleetConfigProblem, realBlockedProbes, checkBlockedWithSlots, askFleetMachine } from './chunk-
|
|
10
|
+
import { fleetConfigProblem, realBlockedProbes, checkBlockedWithSlots, askFleetMachine } from './chunk-OLXB2YMX.js';
|
|
11
11
|
import { writeMarker, readMarker, currentVersion, removeMarker, isInLayout, startedThroughCurrent, entryIn, versionDir, switchCurrent, cleanVersions, stagingDir } from './chunk-CYQSTT5N.js';
|
|
12
|
-
import { leaseTimeLeftMs, createContainerRuntime, heldSandboxClaimsOf, unfinishedJobs, withTunnelLog, itemTag, releaseLease, runDecision, claimRun, LEASE_SECONDS, isUnfinished, prepareResume, restoreSessionIntoMicroVm, restoreSessionIntoContainer, restoreSessionIntoSandbox, restoreWork, keptSessionDir, workRestoredEnv, sessionGuestOfMicroVm, sessionGuestOfContainer, sessionGuestOfSandbox, recordsProofsOnly, itemScope, attemptNote, noteMissingCredential, fetchManagedBuildSettings, holdManagedBuildSettings, setStage, jobEnv, runHook, describeHookEnd, needsBuildSkill, provisionContainer, leaseExpiresAtMs, withJobTimeLimit, deliverContainerHooks, provisionSandbox, deliverSandboxHooks, provisionMicroVm, deliverCommitHooks, provisionEnvironment, readProvisionOut, resolveHostBuild, workdirProblem, listenOnBroker, hostEnvironment, deliverExecMaven, runWithSpawn, hostCommandEnvironment, lifecycleSteps, execArgv, lifecycleFailureReason, decideHostBuildSkill, prepareBranch, keptCommitsLine, runCommandFor, currentSkillCommand, formerSkillProblem, commandLogOffset, startSandboxCommand, MICROVM_COMMAND_DIR, startMicroVmCommand, microVmCommandLine, runCommand, containerCommandExec, execCommandLine, startSender, commandEndReasonOf, holdManagedKey, startHostServices, finishJob, sampleGuest, foldSample, isSandboxTracked, isContainerTracked, isMicroVmTracked, probeSandboxCommand, probeMicroVmCommand, probeCommand, appendCommandLog, judgeProbe, SandboxGoneError, SandboxContainerStoppedError, EXIT_CODE_FILE, isTracked, isGroupAlive, outcomeFromExitCode, isIsolatedJob, jobTimeLimitMinutes, isTimedOut, readCpuUsec, isIdle, HELPER_ENV, setUpRunnerCgroup, stopOrphanedMicroVms, sweepImageBuilders, listUnreadableJobs, listAdoptableJobs, retryFailedReleases, recoverLostJobs, GUEST_USAGE_INTERVAL_MS, vmAlive, filesAreCopied, inSandbox, listItemDisks, hookLimitsFor, runCommandOf, AttemptLogBook, fetchManagedModelKey, environmentFor, builtOf, judgeCredential, missingJudgeCredential, reviewFiles, readWorkItem, issueText, storedProblemsText, territories, territoryBrief, dropNonProblems, mergeAnswers, carriedProblems, unreviewedItem, makeRecorder, microVmOomKills, needsRenew, renewRun, renewLease, RENEW_INTERVAL_SECONDS, stoppedHelperReason, measureDisk, listTrackedJobs, sweepSandboxes, keptSandboxIds, parseCpuList, ensureTunnel, keepGhConfigCurrent, restartSender, rejoinSandboxBuild, createHousekeepingDocker, housekeepingDockerIfReachable, runHousekeeping, shellQuote, jobRecordsClaim, freeItemDisksUntil, savedStatesDir, readRecords, holdsHostDisk, removeOldestUntil, treeFileText, scrubReason, superviseRuns, NO_LOG, timeoutAfter, unreviewedFiles, markdownSection, ensureNetworkReady, ADOPTED_FETCH_RETRY_WINDOW_MS, managedBuildSettingsFor, gitRemoteFor, startServicesFor, installTrust, createLeaseChannel, serveLease, writeGuestGhConfig, deliverJobFiles, inTeardown } from './chunk-
|
|
12
|
+
import { leaseTimeLeftMs, createContainerRuntime, heldSandboxClaimsOf, unfinishedJobs, withTunnelLog, itemTag, releaseLease, runDecision, claimRun, LEASE_SECONDS, isUnfinished, prepareResume, restoreSessionIntoMicroVm, restoreSessionIntoContainer, restoreSessionIntoSandbox, restoreWork, keptSessionDir, workRestoredEnv, sessionGuestOfMicroVm, sessionGuestOfContainer, sessionGuestOfSandbox, recordsProofsOnly, itemScope, attemptNote, noteMissingCredential, fetchManagedBuildSettings, holdManagedBuildSettings, setStage, jobEnv, runHook, describeHookEnd, needsBuildSkill, provisionContainer, leaseExpiresAtMs, withJobTimeLimit, deliverContainerHooks, provisionSandbox, deliverSandboxHooks, provisionMicroVm, deliverCommitHooks, provisionEnvironment, readProvisionOut, resolveHostBuild, workdirProblem, listenOnBroker, hostEnvironment, deliverExecMaven, runWithSpawn, hostCommandEnvironment, lifecycleSteps, execArgv, lifecycleFailureReason, decideHostBuildSkill, prepareBranch, keptCommitsLine, runCommandFor, currentSkillCommand, formerSkillProblem, commandLogOffset, startSandboxCommand, MICROVM_COMMAND_DIR, startMicroVmCommand, microVmCommandLine, runCommand, containerCommandExec, execCommandLine, startSender, commandEndReasonOf, holdManagedKey, startHostServices, finishJob, sampleGuest, foldSample, isSandboxTracked, isContainerTracked, isMicroVmTracked, probeSandboxCommand, probeMicroVmCommand, probeCommand, appendCommandLog, judgeProbe, SandboxGoneError, SandboxContainerStoppedError, EXIT_CODE_FILE, isTracked, isGroupAlive, outcomeFromExitCode, isIsolatedJob, jobTimeLimitMinutes, isTimedOut, readCpuUsec, isIdle, HELPER_ENV, setUpRunnerCgroup, stopOrphanedMicroVms, sweepImageBuilders, listUnreadableJobs, listAdoptableJobs, retryFailedReleases, recoverLostJobs, GUEST_USAGE_INTERVAL_MS, vmAlive, filesAreCopied, inSandbox, listItemDisks, hookLimitsFor, runCommandOf, AttemptLogBook, fetchManagedModelKey, environmentFor, builtOf, judgeCredential, missingJudgeCredential, reviewFiles, readWorkItem, issueText, storedProblemsText, territories, territoryBrief, dropNonProblems, mergeAnswers, carriedProblems, unreviewedItem, makeRecorder, microVmOomKills, needsRenew, renewRun, renewLease, RENEW_INTERVAL_SECONDS, stoppedHelperReason, measureDisk, listTrackedJobs, sweepSandboxes, keptSandboxIds, parseCpuList, ensureTunnel, keepGhConfigCurrent, restartSender, rejoinSandboxBuild, createHousekeepingDocker, housekeepingDockerIfReachable, runHousekeeping, shellQuote, jobRecordsClaim, freeItemDisksUntil, savedStatesDir, readRecords, holdsHostDisk, removeOldestUntil, treeFileText, scrubReason, superviseRuns, NO_LOG, timeoutAfter, unreviewedFiles, markdownSection, ensureNetworkReady, ADOPTED_FETCH_RETRY_WINDOW_MS, managedBuildSettingsFor, gitRemoteFor, startServicesFor, installTrust, createLeaseChannel, serveLease, writeGuestGhConfig, deliverJobFiles, inTeardown } from './chunk-RCE5YQFT.js';
|
|
13
13
|
import { RUNNER_PROTOCOL } from './chunk-7TDLQUJ5.js';
|
|
14
14
|
import { criteriaOf, diffLines, loadCitationFinder, wholeItems, itemsSentence, oneLineReason, treePath, parseJudgeAnswer, wholeEntries, lineInDiff } from './chunk-2QK7L3WV.js';
|
|
15
15
|
import { RepoFilter } from './chunk-AFU6UF34.js';
|
|
@@ -5091,7 +5091,7 @@ async function startRunner(configPath, deps, startup) {
|
|
|
5091
5091
|
check: update.check ? () => update.check(configPath) : async () => {
|
|
5092
5092
|
const held = runnerAgents(deps.agents).flatMap((agent) => heldAgentCredential(agent.descriptor.id) ?? []);
|
|
5093
5093
|
const env = { ...process.env, ...Object.fromEntries(held.map((credential) => [credential.variable, credential.value])) };
|
|
5094
|
-
return (await import('./check-
|
|
5094
|
+
return (await import('./check-BXJBIMLW.js')).runRunnerCheck(configPath, { fetchImpl: deps.fetchImpl, env });
|
|
5095
5095
|
},
|
|
5096
5096
|
now: () => (deps.now ?? (() => /* @__PURE__ */ new Date()))().getTime(),
|
|
5097
5097
|
log
|
|
@@ -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 { placeholderQueues, placeholderProblem } from './chunk-
|
|
3
|
+
import { placeholderQueues, placeholderProblem } from './chunk-RCE5YQFT.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';
|
|
@@ -14403,4 +14403,4 @@ function makeRecorder(input) {
|
|
|
14403
14403
|
};
|
|
14404
14404
|
}
|
|
14405
14405
|
|
|
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 };
|
|
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, 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, 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 };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
|
-
import { scrubReason, stripTerminalControls } from './chunk-
|
|
3
|
+
import { scrubReason, stripTerminalControls } from './chunk-RCE5YQFT.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';
|
|
@@ -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
|
|
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-
|
|
1087
|
+
const { runnerHostChecks } = await import('./doctor-XDN7XS64.js');
|
|
1087
1088
|
const gateway = (() => {
|
|
1088
1089
|
try {
|
|
1089
1090
|
const loaded = loadRunnerConfig(configPath);
|
|
@@ -4,7 +4,7 @@ import { installStarterPack } from './chunk-ZMXG7DQ5.js';
|
|
|
4
4
|
import { runEmit } from './chunk-DPS4OOL5.js';
|
|
5
5
|
import { addStdioMcpEntryIfAbsent, addDocsMcpEntryIfAbsent, DOCS_MCP_SERVER_NAME } from './chunk-WHXF2MLU.js';
|
|
6
6
|
import { listWithAnd } from './chunk-7O37CF6M.js';
|
|
7
|
-
import {
|
|
7
|
+
import { mcpFiles, AGENTS_MD_LAYOUT, declareAgentsMdLayout, linkAgentSkills, describeSkillsLink, isAgentsMdLayout, holdsTodaysLayoutSources, discoverOuterlayerPaths } from './chunk-IEVG36GC.js';
|
|
8
8
|
import { C } from './chunk-2AM6Z5BP.js';
|
|
9
9
|
import { resolveGitCommonDir, defaultGitRunner } from './chunk-25SFFAJ5.js';
|
|
10
10
|
import { cliInvocation } from './chunk-FZKNTIOJ.js';
|
|
@@ -18,10 +18,13 @@ import { join, dirname } from 'path';
|
|
|
18
18
|
|
|
19
19
|
createRequire(import.meta.url);
|
|
20
20
|
var CONFIG_PATH = ".outerlayer/config.json";
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
21
|
+
function newConfig(agent, layout) {
|
|
22
|
+
const doc = { targets: [agent] };
|
|
23
|
+
if (layout !== void 0) doc.layout = layout;
|
|
24
|
+
if (agent !== LEGACY_AGENT) doc.agent = agent;
|
|
25
|
+
return `${JSON.stringify(doc, null, 2)}
|
|
24
26
|
`;
|
|
27
|
+
}
|
|
25
28
|
var starterAgentsMd = (agents) => `# Agent instructions
|
|
26
29
|
|
|
27
30
|
Write here what an agent needs to work in this repository: how to build and test it, the rules it follows, and what to check before it opens a pull request.
|
|
@@ -80,6 +83,7 @@ function keepHandWritten(createdSources) {
|
|
|
80
83
|
}
|
|
81
84
|
function runAgentSetup(opts) {
|
|
82
85
|
const agents = opts.agents ?? defaultAgents();
|
|
86
|
+
const configAgent = opts.configAgent ?? LEGACY_AGENT;
|
|
83
87
|
let repoRoot;
|
|
84
88
|
try {
|
|
85
89
|
repoRoot = gitTopLevel(opts.cwd);
|
|
@@ -90,7 +94,7 @@ function runAgentSetup(opts) {
|
|
|
90
94
|
} catch (err) {
|
|
91
95
|
return failed(errorMessage(err), /* @__PURE__ */ new Set(), []);
|
|
92
96
|
}
|
|
93
|
-
if (!inTodaysLayout(repoRoot)) return runAgentsMdSetup(repoRoot, opts.skillsLink !== false, agents);
|
|
97
|
+
if (!inTodaysLayout(repoRoot)) return runAgentsMdSetup(repoRoot, opts.skillsLink !== false, agents, configAgent);
|
|
94
98
|
const written = /* @__PURE__ */ new Set();
|
|
95
99
|
const kept = [];
|
|
96
100
|
const problems = [];
|
|
@@ -108,7 +112,7 @@ function runAgentSetup(opts) {
|
|
|
108
112
|
kept.push(CONFIG_PATH);
|
|
109
113
|
} else {
|
|
110
114
|
mkdirSync(dirname(join(repoRoot, CONFIG_PATH)), { recursive: true });
|
|
111
|
-
writeFileSync(join(repoRoot, CONFIG_PATH),
|
|
115
|
+
writeFileSync(join(repoRoot, CONFIG_PATH), newConfig(configAgent, void 0));
|
|
112
116
|
written.add(CONFIG_PATH);
|
|
113
117
|
}
|
|
114
118
|
} catch (err) {
|
|
@@ -156,7 +160,7 @@ function runAgentSetup(opts) {
|
|
|
156
160
|
kept: keptPaths
|
|
157
161
|
};
|
|
158
162
|
}
|
|
159
|
-
function runAgentsMdSetup(repoRoot, skillsLink, agents) {
|
|
163
|
+
function runAgentsMdSetup(repoRoot, skillsLink, agents, configAgent) {
|
|
160
164
|
const written = /* @__PURE__ */ new Set();
|
|
161
165
|
const kept = [];
|
|
162
166
|
const problems = [];
|
|
@@ -177,7 +181,7 @@ function runAgentsMdSetup(repoRoot, skillsLink, agents) {
|
|
|
177
181
|
kept.push(CONFIG_PATH);
|
|
178
182
|
} else {
|
|
179
183
|
mkdirSync(dirname(join(repoRoot, CONFIG_PATH)), { recursive: true });
|
|
180
|
-
writeFileSync(join(repoRoot, CONFIG_PATH),
|
|
184
|
+
writeFileSync(join(repoRoot, CONFIG_PATH), newConfig(configAgent, AGENTS_MD_LAYOUT));
|
|
181
185
|
written.add(CONFIG_PATH);
|
|
182
186
|
}
|
|
183
187
|
declareAgentsMdLayout(repoRoot);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
|
-
import { summarizeChecks, summaryText, renderDoctorText } from './chunk-
|
|
3
|
+
import { summarizeChecks, summaryText, renderDoctorText } from './chunk-X6WL4AQY.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';
|