@outerlayer/cli 0.34.0 → 0.34.1-next.20261029194222
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/README.md +1 -1
- package/dist/{agent-setup-UPIHHKI2.js → agent-setup-G445QZEM.js} +10 -10
- package/dist/{artifact-link-cmd-6LFCTDBD.js → artifact-link-cmd-H3KVDGP3.js} +2 -2
- package/dist/{build-WC5EBFL3.js → build-26BBPGWD.js} +4 -4
- package/dist/{build-disk-RARJJXLL.js → build-disk-UGIMTVLM.js} +4 -4
- package/dist/build-info.json +1 -1
- package/dist/{builder-IIFXZVGN.js → builder-LYFK7SKW.js} +3 -3
- package/dist/{caller-VWXDLYPU.js → caller-YGK3NKQQ.js} +6 -6
- package/dist/{check-FYYNT3UP.js → check-A6QEWYRN.js} +35 -35
- package/dist/{chunk-5DVJQC76.js → chunk-23DAYPF5.js} +4 -4
- package/dist/{chunk-5FWBAM6O.js → chunk-2PMJ7TQR.js} +1 -1
- package/dist/{chunk-2MTBQRCI.js → chunk-2WXFXI36.js} +6 -6
- package/dist/{chunk-IP3HLHWO.js → chunk-5ESKQSQP.js} +1 -1
- package/dist/{chunk-FYVIHKCH.js → chunk-6IIP4KMY.js} +3 -3
- package/dist/{chunk-ZI2E4YMY.js → chunk-6YK3SXCW.js} +1 -1
- package/dist/{chunk-AYMOVIT2.js → chunk-A6QFXRUU.js} +14 -14
- package/dist/{chunk-QM3HMXMU.js → chunk-AW4MYEIW.js} +1 -1
- package/dist/{chunk-PQ5YDDDE.js → chunk-AWNONB6E.js} +2 -2
- package/dist/{chunk-AZLWIUIF.js → chunk-BITJMQJ2.js} +3 -3
- package/dist/{chunk-JBUFM5JN.js → chunk-BMMSKKVA.js} +2 -2
- package/dist/{chunk-CZA37XBG.js → chunk-CANPD2V3.js} +5 -5
- package/dist/{chunk-3NPVOVWY.js → chunk-CPWSPEP5.js} +2 -2
- package/dist/{chunk-DVXUUCOF.js → chunk-CQQWIWYG.js} +1 -1
- package/dist/{chunk-32IASBQV.js → chunk-E3R62JBJ.js} +4 -4
- package/dist/{chunk-25SWTFPA.js → chunk-EBFU4YCI.js} +4 -4
- package/dist/{chunk-2OE4BZRF.js → chunk-EK7MQ56V.js} +3 -3
- package/dist/chunk-EMBL45WE.js +287 -0
- package/dist/{chunk-UX7BQX4C.js → chunk-F7CYWR7J.js} +17 -17
- package/dist/{chunk-JXXMOAJG.js → chunk-GWXHRG2N.js} +1 -1
- package/dist/{chunk-DY2HAYJL.js → chunk-HJS267VR.js} +19 -5
- package/dist/{chunk-SVDO6ZQA.js → chunk-HJSNFVKX.js} +8 -8
- package/dist/{chunk-M4MSA6I4.js → chunk-HTJR62XR.js} +1 -1
- package/dist/{chunk-4CGEAKOR.js → chunk-HXCUMPPY.js} +3 -3
- package/dist/{chunk-NB44HOTO.js → chunk-I4TEZU2E.js} +2 -2
- package/dist/{chunk-QZQ2UTPE.js → chunk-L5GF2A43.js} +2 -2
- package/dist/{chunk-UPRZREBO.js → chunk-MGF4254K.js} +1 -1
- package/dist/{chunk-NZDM6KJ2.js → chunk-MTUV27NY.js} +5 -5
- package/dist/{chunk-YTTESG7K.js → chunk-N2XW4NYY.js} +5 -1
- package/dist/{chunk-7NARODRP.js → chunk-NFBWTJ3A.js} +1 -1
- package/dist/{chunk-H25XK3DY.js → chunk-PBAGWT2M.js} +1 -1
- package/dist/{chunk-CDVG2LXT.js → chunk-PILW3YP4.js} +7 -7
- package/dist/{chunk-WG3VIMD2.js → chunk-POZ65DAI.js} +6 -6
- package/dist/{chunk-HS5QEIJT.js → chunk-PPZ47OB6.js} +2 -2
- package/dist/{chunk-WJTIU2A5.js → chunk-Q7ZHL6FY.js} +4 -4
- package/dist/{chunk-HNA33MLR.js → chunk-QJCXP4TA.js} +2 -2
- package/dist/{chunk-H467HI5U.js → chunk-QRDF5A3U.js} +2 -2
- package/dist/{chunk-TJ755TTP.js → chunk-RO2XIOEN.js} +5 -5
- package/dist/{chunk-PUSCE544.js → chunk-SUVS7A7X.js} +4 -4
- package/dist/{chunk-62TMOXQN.js → chunk-TMFKZBOW.js} +2 -2
- package/dist/{chunk-RWQLBHU3.js → chunk-TYRKGKMX.js} +4 -4
- package/dist/{chunk-PHETCXGP.js → chunk-UJTYMT7G.js} +1 -1
- package/dist/{chunk-7SFE6CFO.js → chunk-UPGN7KCY.js} +12 -12
- package/dist/{chunk-XGSJNXH2.js → chunk-VQCAJUDV.js} +2 -2
- package/dist/{chunk-SIF536BT.js → chunk-WJPBZFSF.js} +1 -1
- package/dist/{chunk-PDK35AR4.js → chunk-XSX42Q2H.js} +1 -1
- package/dist/{chunk-7K6MTRN2.js → chunk-Y5CPIOBF.js} +12 -12
- package/dist/{chunk-2B6EKUBD.js → chunk-YC5KTX7D.js} +4 -4
- package/dist/{claude-launcher-MMCKOBND.js → claude-launcher-VA3OAA5V.js} +5 -5
- package/dist/{cli-VLQZS3BV.js → cli-EFJXK3VB.js} +123 -114
- package/dist/{command-Y2HFOL33.js → command-UGIOJSET.js} +22 -295
- package/dist/{config-YI5R4K77.js → config-FVSPGZIO.js} +5 -5
- package/dist/{connect-cmd-NHRK6Y4L.js → connect-cmd-NDWWTEHW.js} +8 -8
- package/dist/{container-start-W3BDQAQE.js → container-start-MMTUO3JR.js} +32 -32
- package/dist/{context-cleanup-PASDUBGW.js → context-cleanup-KIWINRKM.js} +3 -3
- package/dist/{context-show-cmd-OLJEKW2G.js → context-show-cmd-HLEHQJTV.js} +9 -9
- package/dist/{control-plane-launch-FV5Q6GVJ.js → control-plane-launch-X2QXGPFW.js} +6 -6
- package/dist/{demo-voice-cmd-W47GNKN6.js → demo-voice-cmd-NSKOX6T7.js} +14 -14
- package/dist/{dist-ZDKMTBJU.js → dist-RR6YVPSF.js} +2 -2
- package/dist/{docker-36W7PA5I.js → docker-LKM7PPDE.js} +3 -3
- package/dist/{doctor-YAPSQYAC.js → doctor-QDTZWUOX.js} +45 -25
- package/dist/{emit-artifact-cmd-72TRW3OL.js → emit-artifact-cmd-72V5FRE3.js} +13 -13
- package/dist/{emit-cmd-UOPHEUW5.js → emit-cmd-ZHYBT2F6.js} +6 -6
- package/dist/{emit-criteria-cmd-TLO4L3FN.js → emit-criteria-cmd-HIE6JLCO.js} +10 -10
- package/dist/{emit-demo-cmd-PISZZ6TE.js → emit-demo-cmd-TR2IS5NY.js} +14 -14
- package/dist/{emit-finding-cmd-MRXMDOQY.js → emit-finding-cmd-3HZBWWP7.js} +10 -10
- package/dist/{emit-result-cmd-UHX7OTY2.js → emit-result-cmd-YIPXXWII.js} +12 -12
- package/dist/{emit-step-cmd-TL73HPJY.js → emit-step-cmd-QQYPX7EF.js} +10 -10
- package/dist/{find-unit-LIJR6HXI.js → find-unit-QS446AID.js} +7 -7
- package/dist/{findings-cmd-WPHPYWZJ.js → findings-cmd-CPNMM5CJ.js} +10 -10
- package/dist/{fleet-readiness-4RNICYSP.js → fleet-readiness-ZQOFJZ5B.js} +8 -8
- package/dist/{governing-source-HAJVYDYG.js → governing-source-YXZXD6LI.js} +13 -13
- package/dist/{hook-fast-5PNO5HRO.js → hook-fast-OPHM3MRK.js} +1 -1
- package/dist/{host-checks-IAF6DYWU.js → host-checks-5YDTGG6B.js} +30 -30
- package/dist/index.js +4 -4
- package/dist/{init-4MUFI7Q7.js → init-7ZFHIK5W.js} +21 -21
- package/dist/{init-HTX7R3O6.js → init-M6GSCMJM.js} +21 -21
- package/dist/{init-cmd-Q337RMX5.js → init-cmd-IFUQBRNA.js} +18 -18
- package/dist/{init-update-7F5WWVWX.js → init-update-GFXITSTA.js} +17 -17
- package/dist/{layout-ZE6F2Z7W.js → layout-2YSKJHPC.js} +4 -4
- package/dist/{login-browser-YB7AMKHR.js → login-browser-S6PLZCKK.js} +2 -2
- package/dist/{loop-XZH3TA5Z.js → loop-72U5FJPH.js} +34 -34
- package/dist/{machine-L4U73LZN.js → machine-FQNIDAC5.js} +21 -21
- package/dist/{machine-skills-DMHU7OLO.js → machine-skills-YXN3TMJ5.js} +4 -4
- package/dist/{runner-env-P7BHDTKU.js → runner-env-HUZ2TMAK.js} +7 -7
- package/dist/{runner-identity-BQEM2OHY.js → runner-identity-XKJFHYS7.js} +3 -3
- package/dist/{runner-key-MNVNR6UM.js → runner-key-HU542TOA.js} +21 -21
- package/dist/{session-sender-HPJWCUVZ.js → session-sender-5DTNDRJY.js} +13 -13
- package/dist/{spec-cmd-NPZ2H3ZN.js → spec-cmd-HMPVRZP2.js} +11 -11
- package/dist/{starter-pack-WUNNS6G7.js → starter-pack-3ERHTBBJ.js} +5 -5
- package/dist/{status-G4EL4ZCI.js → status-YOGCWUOD.js} +30 -30
- package/dist/{sync-cmd-AFB3TGYH.js → sync-cmd-45QEXKDM.js} +12 -12
- package/dist/{update-steps-N6U2OWK6.js → update-steps-VI2KVXG6.js} +31 -31
- package/dist/{watch-O6ZO5HBT.js → watch-L5MUTCM2.js} +12 -12
- package/dist/{work-claim-cmd-CN5FR3G4.js → work-claim-cmd-GF6O4PE4.js} +15 -15
- package/dist/{work-cmd-EHDLH3CJ.js → work-cmd-PKQ3UANC.js} +10 -10
- package/dist/{work-comment-cmd-YPNDPDHP.js → work-comment-cmd-X26ER5HH.js} +11 -11
- package/dist/{work-demo-cmd-TM47UETD.js → work-demo-cmd-WBOSB5QG.js} +10 -10
- package/dist/{work-logs-cmd-4PCBHRM2.js → work-logs-cmd-VRPW3AAL.js} +10 -10
- package/dist/{work-open-pr-cmd-ESLHVNO5.js → work-open-pr-cmd-BYQSZHFN.js} +11 -11
- package/dist/{work-pr-cmd-N63H6OJM.js → work-pr-cmd-BQBQORGW.js} +10 -10
- package/dist/{work-proofs-cmd-U6XFQ34N.js → work-proofs-cmd-BSNVSO7A.js} +12 -12
- package/dist/{work-proofs-record-YYRYIYMQ.js → work-proofs-record-LV5UTB3H.js} +18 -18
- package/dist/{work-stop-cmd-RB64IM3K.js → work-stop-cmd-5J5MUNDK.js} +10 -10
- package/package.json +1 -1
- package/skill-pack/maintained/outerlayer-amend/SKILL.md +20 -20
- package/skill-pack/maintained/outerlayer-amend/references/new-proof.md +13 -0
- package/skill-pack/maintained/outerlayer-amend/references/threads.md +56 -0
|
@@ -0,0 +1,287 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { createRequire } from 'node:module';
|
|
3
|
+
import { helperSocketPath } from './chunk-Y5CPIOBF.js';
|
|
4
|
+
import { UNIT_MARKER } from './chunk-BMMSKKVA.js';
|
|
5
|
+
import { runnerDir } from './chunk-YQHUCOUL.js';
|
|
6
|
+
import { createHash } from 'crypto';
|
|
7
|
+
import { join } from 'path';
|
|
8
|
+
|
|
9
|
+
createRequire(import.meta.url);
|
|
10
|
+
var LIBEXEC = "/usr/local/libexec/outerlayer";
|
|
11
|
+
var ETC = "/etc/outerlayer";
|
|
12
|
+
var UID_BASE = 2e9;
|
|
13
|
+
var UID_COUNT = 256;
|
|
14
|
+
var UID_ATTEMPTS = 8;
|
|
15
|
+
var UID_STEP = 65536;
|
|
16
|
+
function helperUnitFor(unitName) {
|
|
17
|
+
return `${unitName}-helper`;
|
|
18
|
+
}
|
|
19
|
+
function helperDirFor(unitName) {
|
|
20
|
+
return `${LIBEXEC}/${helperUnitFor(unitName)}`;
|
|
21
|
+
}
|
|
22
|
+
function helperBinaryFor(unitName) {
|
|
23
|
+
return `${helperDirFor(unitName)}/outerlayer-host-helper`;
|
|
24
|
+
}
|
|
25
|
+
function helperSocketFor(unitName) {
|
|
26
|
+
return helperSocketPath(unitName);
|
|
27
|
+
}
|
|
28
|
+
function helperConfigPathFor(unitName) {
|
|
29
|
+
return `${ETC}/${helperUnitFor(unitName)}.json`;
|
|
30
|
+
}
|
|
31
|
+
function helperUnitPathFor(unitName) {
|
|
32
|
+
return `/etc/systemd/system/${helperUnitFor(unitName)}.service`;
|
|
33
|
+
}
|
|
34
|
+
function sliceFor(unitName) {
|
|
35
|
+
return `${unitName}-builds.slice`;
|
|
36
|
+
}
|
|
37
|
+
function slicePathFor(unitName) {
|
|
38
|
+
return `/etc/systemd/system/${sliceFor(unitName)}`;
|
|
39
|
+
}
|
|
40
|
+
function sliceUnitText(unitName, limits) {
|
|
41
|
+
return `${UNIT_MARKER}
|
|
42
|
+
[Unit]
|
|
43
|
+
Description=OuterLayer builds of ${unitName}
|
|
44
|
+
|
|
45
|
+
[Slice]
|
|
46
|
+
${limits.memoryMaxBytes === void 0 ? "" : `MemoryMax=${limits.memoryMaxBytes}
|
|
47
|
+
MemorySwapMax=0
|
|
48
|
+
`}${limits.cpus === void 0 ? "" : `CPUQuota=${Math.round(limits.cpus * 100)}%
|
|
49
|
+
`}`;
|
|
50
|
+
}
|
|
51
|
+
function sha256Of(bytes) {
|
|
52
|
+
return createHash("sha256").update(bytes).digest("hex");
|
|
53
|
+
}
|
|
54
|
+
function helperUnitText(unitName) {
|
|
55
|
+
const unit = helperUnitFor(unitName);
|
|
56
|
+
return `${UNIT_MARKER}
|
|
57
|
+
[Unit]
|
|
58
|
+
Description=OuterLayer root helper: starts microVM builds under Firecracker's jailer
|
|
59
|
+
After=local-fs.target
|
|
60
|
+
|
|
61
|
+
[Service]
|
|
62
|
+
ExecStart=${helperBinaryFor(unitName)} --config ${helperConfigPathFor(unitName)}
|
|
63
|
+
RuntimeDirectory=${unit}
|
|
64
|
+
RuntimeDirectoryMode=0755
|
|
65
|
+
RuntimeDirectoryPreserve=yes
|
|
66
|
+
Restart=on-failure
|
|
67
|
+
RestartSec=5
|
|
68
|
+
KillMode=process
|
|
69
|
+
|
|
70
|
+
[Install]
|
|
71
|
+
WantedBy=multi-user.target
|
|
72
|
+
`;
|
|
73
|
+
}
|
|
74
|
+
function helperConfigText(input) {
|
|
75
|
+
const dir = helperDirFor(input.unitName);
|
|
76
|
+
return `${JSON.stringify(
|
|
77
|
+
{
|
|
78
|
+
runnerUid: input.uid,
|
|
79
|
+
runnerGid: input.gid,
|
|
80
|
+
buildsRoot: input.buildsRoot,
|
|
81
|
+
jailBase: input.jailBase,
|
|
82
|
+
stateDir: `/run/${helperUnitFor(input.unitName)}/state`,
|
|
83
|
+
socket: helperSocketFor(input.unitName),
|
|
84
|
+
uidBase: input.uidBase,
|
|
85
|
+
uidCount: UID_COUNT,
|
|
86
|
+
...input.slice ? { slice: sliceFor(input.unitName) } : {},
|
|
87
|
+
jailer: { path: `${dir}/jailer`, sha256: input.pins.jailer },
|
|
88
|
+
firecracker: { path: `${dir}/firecracker`, sha256: input.pins.firecracker },
|
|
89
|
+
firecrackerVersion: input.pins.firecrackerVersion
|
|
90
|
+
},
|
|
91
|
+
null,
|
|
92
|
+
2
|
|
93
|
+
)}
|
|
94
|
+
`;
|
|
95
|
+
}
|
|
96
|
+
function notInstalled(ok, lines) {
|
|
97
|
+
return { ok, installed: false, lines };
|
|
98
|
+
}
|
|
99
|
+
async function installHelper(request, deps) {
|
|
100
|
+
const { helper } = deps;
|
|
101
|
+
const lines = [];
|
|
102
|
+
const say = deps.say ?? ((line) => void lines.push(line));
|
|
103
|
+
const unit = helperUnitFor(request.unitName);
|
|
104
|
+
const dir = helperDirFor(request.unitName);
|
|
105
|
+
const configFile = helperConfigPathFor(request.unitName);
|
|
106
|
+
const without = "microVM builds run Firecracker as the runner's account, as they did before";
|
|
107
|
+
if (!deps.systemd.running()) return notInstalled(true, [`systemd is not running, so the root helper is not installed: ${without}`]);
|
|
108
|
+
if (helper.pins.helper === void 0) {
|
|
109
|
+
return notInstalled(true, [`this release of the CLI pins no root helper, so none is installed: ${without}`]);
|
|
110
|
+
}
|
|
111
|
+
const identity = helper.identity(request.user);
|
|
112
|
+
if (identity === void 0) return notInstalled(false, [`the account ${request.user} was not found, so the root helper was not installed`]);
|
|
113
|
+
const runner = runnerDir(request.configPath);
|
|
114
|
+
const buildsRoot = join(runner, "builds");
|
|
115
|
+
const jailBase = helper.jailBase(buildsRoot, request.unitName);
|
|
116
|
+
if (jailBase === void 0) {
|
|
117
|
+
return notInstalled(true, [
|
|
118
|
+
`no directory that only root can write, below only such directories, is on the same file system as ${buildsRoot}, so the root helper was not installed: it links each build's files into its jail, and a link cannot cross file systems. ${without}`
|
|
119
|
+
]);
|
|
120
|
+
}
|
|
121
|
+
const others = helper.helperRanges().filter((range) => range.helper !== unit);
|
|
122
|
+
const own = helper.helperRanges().find((range) => range.helper === unit);
|
|
123
|
+
const takerOf = (base) => {
|
|
124
|
+
const account = helper.uidRangeTaker(base, UID_COUNT);
|
|
125
|
+
if (account !== void 0) return account;
|
|
126
|
+
const rival = others.find((range) => base < range.uidBase + range.uidCount && range.uidBase < base + UID_COUNT);
|
|
127
|
+
return rival === void 0 ? void 0 : `the root helper ${rival.helper}`;
|
|
128
|
+
};
|
|
129
|
+
const tried = [];
|
|
130
|
+
let uidBase;
|
|
131
|
+
const candidates = own === void 0 ? Array.from({ length: UID_ATTEMPTS + 1 }, (_, i) => UID_BASE + i * UID_STEP) : [own.uidBase, ...Array.from({ length: UID_ATTEMPTS + 1 }, (_, i) => UID_BASE + i * UID_STEP)];
|
|
132
|
+
for (const base of candidates) {
|
|
133
|
+
const taker = takerOf(base);
|
|
134
|
+
if (taker === void 0) {
|
|
135
|
+
uidBase = base;
|
|
136
|
+
break;
|
|
137
|
+
}
|
|
138
|
+
tried.push(`${base} to ${base + UID_COUNT - 1} is used by ${taker}`);
|
|
139
|
+
}
|
|
140
|
+
if (uidBase === void 0) {
|
|
141
|
+
return notInstalled(false, [`every range of ${UID_COUNT} user ids that was tried is taken (${tried.join("; ")}), so the root helper was not installed`]);
|
|
142
|
+
}
|
|
143
|
+
let assets;
|
|
144
|
+
let helperBytes;
|
|
145
|
+
try {
|
|
146
|
+
assets = await helper.assets(runner);
|
|
147
|
+
helperBytes = await helper.fetchHelper();
|
|
148
|
+
} catch (err) {
|
|
149
|
+
return notInstalled(false, [`the files for the root helper could not be had: ${err instanceof Error ? err.message : String(err)}`]);
|
|
150
|
+
}
|
|
151
|
+
if (sha256Of(helperBytes) !== helper.pins.helper) {
|
|
152
|
+
return notInstalled(false, [`the root helper that was downloaded has sha256 ${sha256Of(helperBytes)}, not the ${helper.pins.helper} this release pins, so it was not installed`]);
|
|
153
|
+
}
|
|
154
|
+
const config = helperConfigText({ unitName: request.unitName, uid: identity.uid, gid: identity.gid, buildsRoot, jailBase, uidBase, slice: request.slice !== void 0, pins: helper.pins });
|
|
155
|
+
const unitPath = helperUnitPathFor(request.unitName);
|
|
156
|
+
const existed = deps.systemd.read(unitPath) !== void 0;
|
|
157
|
+
const staged = helper.stage({ "outerlayer-host-helper": helperBytes, "helper.json": config });
|
|
158
|
+
const root = (argv) => {
|
|
159
|
+
say(`sudo ${argv.join(" ")}`);
|
|
160
|
+
const result = helper.root(argv);
|
|
161
|
+
if (result.status !== 0) lines.push(`sudo ${argv.join(" ")} failed with exit status ${result.status}`);
|
|
162
|
+
return result.status === 0;
|
|
163
|
+
};
|
|
164
|
+
const systemctl = (args) => {
|
|
165
|
+
say(`sudo systemctl ${args.join(" ")}`);
|
|
166
|
+
return deps.systemd.systemctl(args, { sudo: true }).status === 0;
|
|
167
|
+
};
|
|
168
|
+
const removeFiles = () => {
|
|
169
|
+
helper.root(["rm", "-rf", dir]);
|
|
170
|
+
helper.root(["rm", "-f", configFile]);
|
|
171
|
+
};
|
|
172
|
+
const discard = () => {
|
|
173
|
+
if (existed) systemctl(["disable", "--now", unit]);
|
|
174
|
+
if (deps.systemd.read(unitPath) !== void 0) {
|
|
175
|
+
deps.systemd.remove(unitPath);
|
|
176
|
+
systemctl(["daemon-reload"]);
|
|
177
|
+
}
|
|
178
|
+
removeFiles();
|
|
179
|
+
};
|
|
180
|
+
const removeNewSlice = () => {
|
|
181
|
+
if (deps.systemd.read(slicePathFor(request.unitName)) !== void 0) deps.systemd.remove(slicePathFor(request.unitName));
|
|
182
|
+
};
|
|
183
|
+
try {
|
|
184
|
+
const copies = [
|
|
185
|
+
{ from: join(staged.dir, "outerlayer-host-helper"), to: helperBinaryFor(request.unitName), pin: helper.pins.helper, what: "helper" },
|
|
186
|
+
{ from: assets.jailer, to: `${dir}/jailer`, pin: helper.pins.jailer, what: "jailer" },
|
|
187
|
+
{ from: assets.firecracker, to: `${dir}/firecracker`, pin: helper.pins.firecracker, what: "Firecracker" }
|
|
188
|
+
];
|
|
189
|
+
const ok = root(["install", "-d", "-o", "root", "-g", "root", "-m", "0755", dir]) && root(["install", "-d", "-o", "root", "-g", "root", "-m", "0755", ETC]) && root(["install", "-d", "-o", "root", "-g", "root", "-m", "0755", jailBase]) && copies.every((copy) => root(["install", "-o", "root", "-g", "root", "-m", "0755", copy.from, copy.to])) && root(["install", "-o", "root", "-g", "root", "-m", "0644", join(staged.dir, "helper.json"), configFile]);
|
|
190
|
+
if (!ok) {
|
|
191
|
+
if (existed) lines.push(`the root helper ${unit} is installed, so its files were left in place`);
|
|
192
|
+
else removeFiles();
|
|
193
|
+
return notInstalled(false, lines);
|
|
194
|
+
}
|
|
195
|
+
for (const copy of copies) {
|
|
196
|
+
const bytes = helper.readFile(copy.to);
|
|
197
|
+
if (bytes === void 0 || sha256Of(bytes) !== copy.pin) {
|
|
198
|
+
discard();
|
|
199
|
+
return notInstalled(false, [...lines, `the ${copy.what} copied to ${copy.to} is not the file this release pins, so the root helper was not installed`]);
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
if (helper.readFile(configFile)?.toString("utf8") !== config) {
|
|
203
|
+
discard();
|
|
204
|
+
return notInstalled(false, [...lines, `the config copied to ${configFile} is not the one the installer wrote, so the root helper was not installed`]);
|
|
205
|
+
}
|
|
206
|
+
const writable = deps.accountCan === void 0 ? void 0 : [dir, ...copies.map((copy) => copy.to), configFile, ETC].find((path) => deps.accountCan(request.user, "-w", path));
|
|
207
|
+
if (writable !== void 0) {
|
|
208
|
+
discard();
|
|
209
|
+
return notInstalled(false, [...lines, `the account ${request.user} can write ${writable}, which root runs or reads, so the root helper was not installed`]);
|
|
210
|
+
}
|
|
211
|
+
} finally {
|
|
212
|
+
staged.remove();
|
|
213
|
+
}
|
|
214
|
+
const slicePath = slicePathFor(request.unitName);
|
|
215
|
+
try {
|
|
216
|
+
if (request.slice !== void 0) {
|
|
217
|
+
say(`sudo tee ${slicePath}`);
|
|
218
|
+
deps.systemd.write(slicePath, sliceUnitText(request.unitName, request.slice));
|
|
219
|
+
} else if (deps.systemd.read(slicePath)?.startsWith(UNIT_MARKER) === true) {
|
|
220
|
+
say(`sudo rm ${slicePath}`);
|
|
221
|
+
deps.systemd.remove(slicePath);
|
|
222
|
+
}
|
|
223
|
+
say(`sudo tee ${unitPath}`);
|
|
224
|
+
deps.systemd.write(unitPath, helperUnitText(request.unitName));
|
|
225
|
+
} catch (err) {
|
|
226
|
+
if (!existed) {
|
|
227
|
+
removeFiles();
|
|
228
|
+
removeNewSlice();
|
|
229
|
+
}
|
|
230
|
+
return notInstalled(false, [...lines, err instanceof Error ? err.message : String(err)]);
|
|
231
|
+
}
|
|
232
|
+
if (!systemctl(["daemon-reload"]) || !systemctl(["enable", "--now", unit]) || existed && !systemctl(["restart", unit])) {
|
|
233
|
+
if (!existed) {
|
|
234
|
+
discard();
|
|
235
|
+
removeNewSlice();
|
|
236
|
+
}
|
|
237
|
+
lines.push(`the unit ${unit} did not start, so the root helper is not running: ${without}`);
|
|
238
|
+
return notInstalled(false, lines);
|
|
239
|
+
}
|
|
240
|
+
lines.push(`installed and started the root helper ${unit}: it runs as root, starts each microVM build under Firecracker's jailer and does nothing else`);
|
|
241
|
+
return { ok: true, installed: true, lines };
|
|
242
|
+
}
|
|
243
|
+
function uninstallHelper(request, deps) {
|
|
244
|
+
const lines = [];
|
|
245
|
+
const say = deps.say ?? ((line) => void lines.push(line));
|
|
246
|
+
const unit = helperUnitFor(request.unitName);
|
|
247
|
+
const unitPath = helperUnitPathFor(request.unitName);
|
|
248
|
+
const configFile = helperConfigPathFor(request.unitName);
|
|
249
|
+
const dir = helperDirFor(request.unitName);
|
|
250
|
+
const config = deps.helper.readFile(configFile);
|
|
251
|
+
let jailBase;
|
|
252
|
+
if (config !== void 0) {
|
|
253
|
+
try {
|
|
254
|
+
jailBase = JSON.parse(config.toString("utf8")).jailBase;
|
|
255
|
+
} catch {
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
const systemctl = (args) => {
|
|
259
|
+
say(`sudo systemctl ${args.join(" ")}`);
|
|
260
|
+
deps.systemd.systemctl(args, { sudo: true });
|
|
261
|
+
};
|
|
262
|
+
const root = (argv) => {
|
|
263
|
+
say(`sudo ${argv.join(" ")}`);
|
|
264
|
+
deps.helper.root(argv);
|
|
265
|
+
};
|
|
266
|
+
const installed = deps.systemd.read(unitPath) !== void 0 || config !== void 0;
|
|
267
|
+
if (!installed) return { ok: true, installed: false, lines };
|
|
268
|
+
systemctl(["disable", "--now", unit]);
|
|
269
|
+
if (deps.systemd.read(unitPath) !== void 0) {
|
|
270
|
+
say(`sudo rm ${unitPath}`);
|
|
271
|
+
deps.systemd.remove(unitPath);
|
|
272
|
+
systemctl(["daemon-reload"]);
|
|
273
|
+
}
|
|
274
|
+
root(["rm", "-rf", dir]);
|
|
275
|
+
root(["rm", "-f", configFile]);
|
|
276
|
+
const slicePath = slicePathFor(request.unitName);
|
|
277
|
+
if (deps.systemd.read(slicePath)?.startsWith(UNIT_MARKER) === true) {
|
|
278
|
+
say(`sudo rm ${slicePath}`);
|
|
279
|
+
deps.systemd.remove(slicePath);
|
|
280
|
+
systemctl(["daemon-reload"]);
|
|
281
|
+
}
|
|
282
|
+
if (jailBase !== void 0) root(["rmdir", `${jailBase}/firecracker`, jailBase]);
|
|
283
|
+
lines.push(`removed the root helper ${unit}`);
|
|
284
|
+
return { ok: true, installed: false, lines };
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
export { helperBinaryFor, helperSocketFor, helperUnitFor, installHelper, uninstallHelper };
|
|
@@ -1,34 +1,34 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
|
-
import { itemsSentence, criteriaOf, hostItemsOf, loadCitationFinder, testFileMatcher, MAX_TEST_FILE_BYTES, MAX_TEST_FILES, criterionInputs, uncitedIds, planCriteria, parseJudgeAnswer, inCriteriaOrder, oneLineReason, judgedItems, IdScan, firstInPathOrder, isSearchCandidate } from './chunk-
|
|
3
|
+
import { itemsSentence, criteriaOf, hostItemsOf, loadCitationFinder, testFileMatcher, MAX_TEST_FILE_BYTES, MAX_TEST_FILES, criterionInputs, uncitedIds, planCriteria, parseJudgeAnswer, inCriteriaOrder, oneLineReason, judgedItems, IdScan, firstInPathOrder, isSearchCandidate } from './chunk-YC5KTX7D.js';
|
|
4
4
|
import { readsJobState, READ_JOB_STATE_FORMATS, jobStateFormatOf } from './chunk-ZVB57WI6.js';
|
|
5
5
|
import { HELPER_PATH, DOCKERD_LOG, HELPER_RECORD } from './chunk-H2GESWLW.js';
|
|
6
6
|
import { writeDockerClientConfig } from './chunk-MKSZHT6S.js';
|
|
7
7
|
import { zodProblem } from './chunk-I3LTIAOR.js';
|
|
8
|
-
import { senderPidfile } from './chunk-
|
|
9
|
-
import { installScrubContext } from './chunk-
|
|
10
|
-
import { upgradedStarterText } from './chunk-
|
|
11
|
-
import { ADDED_USER, shellQuote, GH_CONFIG_YML, ghHostsYml, firstLine, provisionWithFreshFallback, itemTag, hasClaudeCredential, AssetError, obtainImage, taggedLog, planSavedState, clockOf, savedStateBase, savedStatesDir, ensureRootfs, makeBuildsDirPrivate, gitRemoteFor, startServicesFor, createLeaseChannel, createBuildDisk, machineConfig, startJailedInto, resolveAgentUser, AgentUserError, agentUidOf, userIdChangedReason, runBuildSteps, setupInputFor, runtimeStepInput, settleFailedSteps, keepRuntimeStep, keepMissingSetupScripts, createContainerRuntime, containerSenderCommand, hostCommandEnvironment, execArgv, signalInContainer, startHostServices, LEASE_SECONDS, itemScope, managedBuildSettingsFor, stopContainer, cleanupContainer, recordProofsInContainer, PROOFS_LOG, outOfMemoryReason, closeHostBuild, dropManagedClaudeKey, dropManagedBuildSettings, startCheckContainer, ranRuntimeStep, provisionRuntimes, lifecycleSteps, lifecycleFailureReason, runSetupScripts, writeEvalInput, DeliveryFailure, EVAL_INPUT_NAME, syncInContainer, copyTranscriptsFromContainer, senderAliveScript, discardUnusableState, MANAGED_UNJAILED_REASON, uidFromProbe, saveAndPrune, managedMachineLimits, withFactoryHosts, helperFirecrackerNote, said, managedClaudeKeyValuesFor, managedBuildSettingValuesFor, managedClaudeKeyValues, managedBuildSettingValues, stopJailed, deleteBuildDisk, RECORD_PROOFS_ARGV, managedClaudeKeyFor, ROOT_DISK_ID_PREFIX, copyTranscripts, writeRecord, containerJudgeEnvironment, deleteRecord, senderSignalScript, copyJudgeTree } from './chunk-
|
|
12
|
-
import { fetchCommit, readBranchHead, diffBetween } from './chunk-
|
|
8
|
+
import { senderPidfile } from './chunk-HXCUMPPY.js';
|
|
9
|
+
import { installScrubContext } from './chunk-RO2XIOEN.js';
|
|
10
|
+
import { upgradedStarterText } from './chunk-Q7ZHL6FY.js';
|
|
11
|
+
import { ADDED_USER, shellQuote, GH_CONFIG_YML, ghHostsYml, firstLine, provisionWithFreshFallback, itemTag, hasClaudeCredential, AssetError, obtainImage, taggedLog, planSavedState, clockOf, savedStateBase, savedStatesDir, ensureRootfs, makeBuildsDirPrivate, gitRemoteFor, startServicesFor, createLeaseChannel, createBuildDisk, machineConfig, startJailedInto, resolveAgentUser, AgentUserError, agentUidOf, userIdChangedReason, runBuildSteps, setupInputFor, runtimeStepInput, settleFailedSteps, keepRuntimeStep, keepMissingSetupScripts, createContainerRuntime, containerSenderCommand, hostCommandEnvironment, execArgv, signalInContainer, startHostServices, LEASE_SECONDS, itemScope, managedBuildSettingsFor, stopContainer, cleanupContainer, recordProofsInContainer, PROOFS_LOG, outOfMemoryReason, closeHostBuild, dropManagedClaudeKey, dropManagedBuildSettings, startCheckContainer, ranRuntimeStep, provisionRuntimes, lifecycleSteps, lifecycleFailureReason, runSetupScripts, writeEvalInput, DeliveryFailure, EVAL_INPUT_NAME, syncInContainer, copyTranscriptsFromContainer, senderAliveScript, discardUnusableState, MANAGED_UNJAILED_REASON, uidFromProbe, saveAndPrune, managedMachineLimits, withFactoryHosts, helperFirecrackerNote, said, managedClaudeKeyValuesFor, managedBuildSettingValuesFor, managedClaudeKeyValues, managedBuildSettingValues, stopJailed, deleteBuildDisk, RECORD_PROOFS_ARGV, managedClaudeKeyFor, ROOT_DISK_ID_PREFIX, copyTranscripts, writeRecord, containerJudgeEnvironment, deleteRecord, senderSignalScript, copyJudgeTree } from './chunk-Y5CPIOBF.js';
|
|
12
|
+
import { fetchCommit, readBranchHead, diffBetween } from './chunk-5ESKQSQP.js';
|
|
13
13
|
import { isSameProcess, startTimeOf } from './chunk-JBJTC3UU.js';
|
|
14
14
|
import { waitForAgent, vmExecArgs } from './chunk-4PH4DVV4.js';
|
|
15
15
|
import { socketPathProblem, vsockLinks, LEASE_LINK, linkVsockSockets } from './chunk-UZGQT6OF.js';
|
|
16
|
-
import { describeCallFailure, resolveGoverningSource, prefetchGovernedContext, refusalCode, removeStagedContext, stageGovernedContext, pinnedSourceOf, commandWithShim, logStamp, createRunnerLog, formatDuration, removeKeptContext, retrySend, formatClock, keptContextTree, WORKFLOW_PERMISSION_REASON } from './chunk-
|
|
17
|
-
import { claimCalls, spoolHomeFor, itemCalls, claimItem, leftByRunnerKey } from './chunk-
|
|
18
|
-
import { imageBuildOf, isBuiltinContainer, isBuiltinProcess, isBuiltinVm, egressSummary, DEFAULT_CHECK_TIME_LIMIT_MINUTES, DEFAULT_SETUP_MINUTES, optionalEgress } from './chunk-
|
|
19
|
-
import { formatBytes, DEFAULT_CACHE_DISK, allocatedBytes } from './chunk-
|
|
20
|
-
import { HASH_ARGV, parseProgramHash, JUDGE_PROGRAM, writeJobFile, readJobFile, parseSize, identityScript, identityArgs, parseIdentity, mountableHome, homeCopyScript, homeCopyArgs, childEnvironment, withAnswerProtocol, judgeCommand, MAX_REPORT_BYTES, JUDGE_MAX_TURNS, JUDGE_DIR, COMMAND_DIR, MAX_ITEMS_BYTES } from './chunk-
|
|
16
|
+
import { describeCallFailure, resolveGoverningSource, prefetchGovernedContext, refusalCode, removeStagedContext, stageGovernedContext, pinnedSourceOf, commandWithShim, logStamp, createRunnerLog, formatDuration, removeKeptContext, retrySend, formatClock, keptContextTree, WORKFLOW_PERMISSION_REASON } from './chunk-QRDF5A3U.js';
|
|
17
|
+
import { claimCalls, spoolHomeFor, itemCalls, claimItem, leftByRunnerKey } from './chunk-NFBWTJ3A.js';
|
|
18
|
+
import { imageBuildOf, isBuiltinContainer, isBuiltinProcess, isBuiltinVm, egressSummary, DEFAULT_CHECK_TIME_LIMIT_MINUTES, DEFAULT_SETUP_MINUTES, optionalEgress } from './chunk-QJCXP4TA.js';
|
|
19
|
+
import { formatBytes, DEFAULT_CACHE_DISK, allocatedBytes } from './chunk-UJTYMT7G.js';
|
|
20
|
+
import { HASH_ARGV, parseProgramHash, JUDGE_PROGRAM, writeJobFile, readJobFile, parseSize, identityScript, identityArgs, parseIdentity, mountableHome, homeCopyScript, homeCopyArgs, childEnvironment, withAnswerProtocol, judgeCommand, MAX_REPORT_BYTES, JUDGE_MAX_TURNS, JUDGE_DIR, COMMAND_DIR, MAX_ITEMS_BYTES } from './chunk-CQQWIWYG.js';
|
|
21
21
|
import { CLAUDE_CODE_VERSION, FIRECRACKER_VERSION } from './chunk-PZN4L2DN.js';
|
|
22
|
-
import { WorkCommandError, postJson, isSignatureRefusal, getJson } from './chunk-
|
|
23
|
-
import { planArtifactUpload } from './chunk-
|
|
22
|
+
import { WorkCommandError, postJson, isSignatureRefusal, getJson } from './chunk-MTUV27NY.js';
|
|
23
|
+
import { planArtifactUpload } from './chunk-XSX42Q2H.js';
|
|
24
24
|
import { readCloudConfig } from './chunk-HWVMRETT.js';
|
|
25
25
|
import { signerFor } from './chunk-XU5BNWX7.js';
|
|
26
|
-
import { AGENTS_SKILLS_BASE, OUTERLAYER_SKILLS_BASE, resolvePackRoot } from './chunk-
|
|
27
|
-
import { scrubText } from './chunk-
|
|
26
|
+
import { AGENTS_SKILLS_BASE, OUTERLAYER_SKILLS_BASE, resolvePackRoot } from './chunk-MGF4254K.js';
|
|
27
|
+
import { scrubText } from './chunk-PBAGWT2M.js';
|
|
28
28
|
import { MAINTAINED_SKILLS } from './chunk-CDDED64E.js';
|
|
29
29
|
import { resolveVersion } from './chunk-RA3O54FC.js';
|
|
30
|
-
import { parsePolicy } from './chunk-
|
|
31
|
-
import { CheckItemsSchema } from './chunk-
|
|
30
|
+
import { parsePolicy } from './chunk-2PMJ7TQR.js';
|
|
31
|
+
import { CheckItemsSchema } from './chunk-N2XW4NYY.js';
|
|
32
32
|
import { homeFromEnv } from './chunk-352DHUTP.js';
|
|
33
33
|
import { RUNNER_FILE_MODE, runnerDir, buildDir, orgStoreIn, vsockPath, jobConsolePath, orgHomeDir } from './chunk-YQHUCOUL.js';
|
|
34
34
|
import { JOB_MOUNT, repositoriesOf, primaryOf, buildEnvironment, CHECKOUT_DIR, claudeCredential, AGENT_CREDENTIAL_MISSING, sharedUserEnvironment, headerVariables, authorEnvironment, withTunnelRecord, commitIdentityRecord, RELAY_PORT, repositoryPath, lifecycleWorkdir, CHECK_ITEMS_FILE, fdName, BUILD_HOME, CLAUDE_CREDENTIAL_VARIABLES, currentClaudeCredential, removedClaudeCredentialValues, managedClaudeCredential, checkEnvironment, EVAL_INPUT_DIR, withMiseVariables } from './chunk-GANAOCHR.js';
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
3
|
import { readContextManifest, removeContextManifest } from './chunk-YQR6E6OV.js';
|
|
4
4
|
import { removePreCommitGuardHook } from './chunk-CJPTUU2E.js';
|
|
5
|
-
import { CONTEXT_PIN_FILENAME } from './chunk-
|
|
5
|
+
import { CONTEXT_PIN_FILENAME } from './chunk-2PMJ7TQR.js';
|
|
6
6
|
import { execFileSync } from 'child_process';
|
|
7
7
|
import { lstatSync, existsSync, unlinkSync, readdirSync, rmdirSync, readFileSync, mkdirSync, writeFileSync } from 'fs';
|
|
8
8
|
import { join, dirname, isAbsolute } from 'path';
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
|
-
import { resolveCredentials, postJson, getJson } from './chunk-
|
|
3
|
+
import { resolveCredentials, postJson, getJson } from './chunk-MTUV27NY.js';
|
|
4
4
|
import { detectActiveSession } from './chunk-IP7BIBXJ.js';
|
|
5
5
|
import { C } from './chunk-2AM6Z5BP.js';
|
|
6
|
-
import { sanitizeTerminal } from './chunk-
|
|
6
|
+
import { sanitizeTerminal } from './chunk-XSX42Q2H.js';
|
|
7
7
|
import { defaultFetch } from './chunk-GBMTKV5B.js';
|
|
8
|
-
import { resolveRepoIdentity } from './chunk-
|
|
8
|
+
import { resolveRepoIdentity } from './chunk-PBAGWT2M.js';
|
|
9
9
|
import { parseTrackerNumber, trackerNumberError } from './chunk-WZBHBH3J.js';
|
|
10
10
|
import { homeFromEnv } from './chunk-352DHUTP.js';
|
|
11
11
|
import { randomUUID } from 'crypto';
|
|
@@ -30,6 +30,9 @@ async function runWorkComment(opts) {
|
|
|
30
30
|
throw new WorkCommentCommandError(trackerNumberError("--item", opts.item ?? ""));
|
|
31
31
|
}
|
|
32
32
|
const action = resolveAction(opts);
|
|
33
|
+
if (opts.thread !== void 0 && (opts.criterion !== void 0 || action !== void 0)) {
|
|
34
|
+
throw new WorkCommentCommandError("--thread answers one thread and takes no --criterion and no action flag");
|
|
35
|
+
}
|
|
33
36
|
if (action === "attach" && !opts.artifact) {
|
|
34
37
|
throw new WorkCommentCommandError("--attach needs --artifact <id>, naming the artifact that becomes the criterion's proof");
|
|
35
38
|
}
|
|
@@ -48,6 +51,7 @@ async function runWorkComment(opts) {
|
|
|
48
51
|
clientCommentId: opts.clientCommentId ?? randomUUID(),
|
|
49
52
|
body: opts.body ?? "",
|
|
50
53
|
...opts.criterion !== void 0 ? { criterion: opts.criterion } : {},
|
|
54
|
+
thread: opts.thread,
|
|
51
55
|
...action !== void 0 ? { action } : {},
|
|
52
56
|
...opts.artifact !== void 0 ? { artifact: opts.artifact } : {},
|
|
53
57
|
...sessionId !== void 0 ? { sessionId } : {}
|
|
@@ -63,7 +67,7 @@ async function runWorkComment(opts) {
|
|
|
63
67
|
);
|
|
64
68
|
const thread = data.thread;
|
|
65
69
|
const waitingOn = thread?.waitingOn ?? null;
|
|
66
|
-
const criterionLabel = opts.criterion ? `criterion ${opts.criterion}` : "the general thread";
|
|
70
|
+
const criterionLabel = opts.thread ? `thread ${opts.thread}` : opts.criterion ? `criterion ${opts.criterion}` : "the general thread";
|
|
67
71
|
const output = opts.json ? JSON.stringify(data) : `${C.green}\u2713${C.reset} commented on ${criterionLabel} of item #${itemNumber} ${C.dim}\xB7${C.reset} waiting on ${waitingOn ?? "no one"}`;
|
|
68
72
|
if (!opts.quiet) process.stdout.write(output + "\n");
|
|
69
73
|
return { data, output };
|
|
@@ -82,11 +86,21 @@ async function runWorkThreads(opts) {
|
|
|
82
86
|
return { data, output: output2 };
|
|
83
87
|
}
|
|
84
88
|
const page = data;
|
|
85
|
-
const lines = [
|
|
89
|
+
const lines = [
|
|
90
|
+
renderThread("general", page.general),
|
|
91
|
+
...page.criteria.map((t) => renderThread(t.criterion ?? "", t)),
|
|
92
|
+
...(page.threads ?? []).map(renderSourceThread)
|
|
93
|
+
];
|
|
86
94
|
const output = lines.join("\n");
|
|
87
95
|
if (!opts.quiet) process.stdout.write(output + "\n");
|
|
88
96
|
return { data, output };
|
|
89
97
|
}
|
|
98
|
+
function renderSourceThread(thread) {
|
|
99
|
+
const place = thread.anchor ? ` \xB7 ${sanitizeTerminal(thread.anchor.path)}:${thread.anchor.line}` : "";
|
|
100
|
+
const header = `${C.dim}thread ${sanitizeTerminal(thread.id)} \xB7 ${sanitizeTerminal(thread.source)}${place} \xB7 waiting on ${thread.waitingOn ?? "no one"}${C.reset}`;
|
|
101
|
+
const comments = thread.comments.map((c) => ` ${c.authorKind === "person" ? "person" : "agent"} ${sanitizeTerminal(c.authorName)}: ${sanitizeTerminal(c.body)}`);
|
|
102
|
+
return [header, ...comments].join("\n");
|
|
103
|
+
}
|
|
90
104
|
function renderThread(label, thread) {
|
|
91
105
|
const header = `${C.dim}${label === "general" ? "general" : `criterion ${label}`} \xB7 waiting on ${thread.waitingOn ?? "no one"}${C.reset}`;
|
|
92
106
|
const comments = thread.comments.map(
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
|
-
import { criteriaOf, loadCitationFinder, hostItemsOf, criterionInputs, NO_CITING_TEST_REASON, NO_TEST_FILES_REASON, NO_VERDICT_REASON, isFoundInReason, uncitedIds, planCriteria, pickSearchable, IdScan, testFileMatcher, foundInReason, MAX_TEST_FILE_BYTES, MAX_TEST_FILES, groupBySize } from './chunk-
|
|
4
|
-
import { WorkCommandError, resolveCredentials, getJson } from './chunk-
|
|
3
|
+
import { criteriaOf, loadCitationFinder, hostItemsOf, criterionInputs, NO_CITING_TEST_REASON, NO_TEST_FILES_REASON, NO_VERDICT_REASON, isFoundInReason, uncitedIds, planCriteria, pickSearchable, IdScan, testFileMatcher, foundInReason, MAX_TEST_FILE_BYTES, MAX_TEST_FILES, groupBySize } from './chunk-YC5KTX7D.js';
|
|
4
|
+
import { WorkCommandError, resolveCredentials, getJson } from './chunk-MTUV27NY.js';
|
|
5
5
|
import { C } from './chunk-2AM6Z5BP.js';
|
|
6
|
-
import { sanitizeTerminal } from './chunk-
|
|
6
|
+
import { sanitizeTerminal } from './chunk-XSX42Q2H.js';
|
|
7
7
|
import { defaultFetch } from './chunk-GBMTKV5B.js';
|
|
8
|
-
import { resolveRepoIdentity } from './chunk-
|
|
8
|
+
import { resolveRepoIdentity } from './chunk-PBAGWT2M.js';
|
|
9
9
|
import { parseWorkItemEnv } from './chunk-5WYT3PPE.js';
|
|
10
10
|
import { parseTrackerNumber, trackerNumberError } from './chunk-WZBHBH3J.js';
|
|
11
11
|
import { readDeliveryRecord } from './chunk-YQR6E6OV.js';
|
|
12
|
-
import { inferArtifactKind, mediaTypeForArtifactPath, WORK_ITEM_COMMENT_MAX_BODY_LENGTH } from './chunk-
|
|
12
|
+
import { inferArtifactKind, mediaTypeForArtifactPath, WORK_ITEM_COMMENT_MAX_BODY_LENGTH } from './chunk-N2XW4NYY.js';
|
|
13
13
|
import { createHash } from 'crypto';
|
|
14
14
|
import { spawnSync } from 'child_process';
|
|
15
15
|
import { existsSync, statSync, readFileSync } from 'fs';
|
|
@@ -217,14 +217,14 @@ function governingDir(cwd) {
|
|
|
217
217
|
async function testProofMode(cwd) {
|
|
218
218
|
const dir = governingDir(cwd);
|
|
219
219
|
if (dir === void 0) return "any";
|
|
220
|
-
const { testProofIn } = await import('./host-checks-
|
|
220
|
+
const { testProofIn } = await import('./host-checks-5YDTGG6B.js');
|
|
221
221
|
return testProofIn(dir);
|
|
222
222
|
}
|
|
223
223
|
async function judgeCheckName(cwd) {
|
|
224
224
|
const dir = governingDir(cwd);
|
|
225
225
|
if (dir === void 0) return {};
|
|
226
226
|
if (!existsSync(dir)) return { note: `the governed context at ${dir} is not readable` };
|
|
227
|
-
const { checksIn, isJudgeCheck } = await import('./host-checks-
|
|
227
|
+
const { checksIn, isJudgeCheck } = await import('./host-checks-5YDTGG6B.js');
|
|
228
228
|
const quiet = { line: () => void 0, error: () => void 0 };
|
|
229
229
|
const check = checksIn(dir, quiet, "").checks.find((c) => isJudgeCheck(c) && c.judge.subjects === "criteria");
|
|
230
230
|
return check === void 0 ? {} : { name: check.name };
|
|
@@ -369,7 +369,7 @@ async function runWorkProofs(opts) {
|
|
|
369
369
|
async function runWorkProofsCommand(opts) {
|
|
370
370
|
try {
|
|
371
371
|
if (opts.record) {
|
|
372
|
-
const { runWorkProofsRecord } = await import('./work-proofs-record-
|
|
372
|
+
const { runWorkProofsRecord } = await import('./work-proofs-record-LV5UTB3H.js');
|
|
373
373
|
const result2 = await runWorkProofsRecord(opts);
|
|
374
374
|
process.exitCode = result2.exitCode;
|
|
375
375
|
return;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
|
-
import { escapeUnitPath, UNIT_MARKER, DEFAULT_UNIT_NAME } from './chunk-
|
|
3
|
+
import { escapeUnitPath, UNIT_MARKER, DEFAULT_UNIT_NAME } from './chunk-BMMSKKVA.js';
|
|
4
4
|
import { inspectService, realInspectProbes } from './chunk-GANAOCHR.js';
|
|
5
5
|
import { realpathSync, readFileSync, readdirSync } from 'fs';
|
|
6
6
|
import { resolve, dirname, join } from 'path';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
|
-
import { LiveUploader } from './chunk-
|
|
4
|
-
import { spoolDir } from './chunk-
|
|
5
|
-
import { CaptureDaemon } from './chunk-
|
|
3
|
+
import { LiveUploader } from './chunk-RO2XIOEN.js';
|
|
4
|
+
import { spoolDir } from './chunk-PPZ47OB6.js';
|
|
5
|
+
import { CaptureDaemon } from './chunk-PBAGWT2M.js';
|
|
6
6
|
import { parseWorkItemEnv } from './chunk-5WYT3PPE.js';
|
|
7
7
|
import { homeFromEnv } from './chunk-352DHUTP.js';
|
|
8
8
|
import { mkdirSync, writeFileSync, rmSync } from 'fs';
|
|
@@ -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-F7CYWR7J.js';
|
|
4
4
|
import { tagToPull, imageTag, pullInstruction, readUpdateStatus, runnerImageVersion } from './chunk-SQGD4LYW.js';
|
|
5
5
|
import { readFileSync } from 'fs';
|
|
6
6
|
|
|
@@ -55,7 +55,7 @@ function envNamesOf(row, imageEnv) {
|
|
|
55
55
|
return [...new Set(names)].sort();
|
|
56
56
|
}
|
|
57
57
|
async function readOwnContainer(deps = {}) {
|
|
58
|
-
const run = deps.run ?? (await import('./docker-
|
|
58
|
+
const run = deps.run ?? (await import('./docker-LKM7PPDE.js')).spawnRun;
|
|
59
59
|
const ids = candidateIds(deps.env ?? process.env, deps.readFile ?? ((path) => readFileSync(path, "utf8")));
|
|
60
60
|
if (ids.length === 0) return { ok: false, reason: "the runner cannot tell which container it runs in: HOSTNAME is empty and /proc/self/mountinfo names none" };
|
|
61
61
|
let problem = "";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
|
-
import { fetchFactories, selectFactory, saveFactoryConnection, autoConnectedLine } from './chunk-
|
|
3
|
+
import { fetchFactories, selectFactory, saveFactoryConnection, autoConnectedLine } from './chunk-TYRKGKMX.js';
|
|
4
4
|
import { resolveGatewayCredentials } from './chunk-GBMTKV5B.js';
|
|
5
5
|
import { readCloudConfig } from './chunk-HWVMRETT.js';
|
|
6
6
|
import { findGitDirs, readRepoConnection } from './chunk-BJ3KTMDH.js';
|
|
7
|
-
import { resolveRepoIdentity } from './chunk-
|
|
7
|
+
import { resolveRepoIdentity } from './chunk-PBAGWT2M.js';
|
|
8
8
|
import { cliInvocation } from './chunk-FZKNTIOJ.js';
|
|
9
9
|
import { homeFromEnv } from './chunk-352DHUTP.js';
|
|
10
10
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
3
|
import { MAINTAINED_SKILLS } from './chunk-CDDED64E.js';
|
|
4
4
|
import { resolvePackageVersion } from './chunk-RA3O54FC.js';
|
|
5
|
-
import { splitRawFile } from './chunk-
|
|
5
|
+
import { splitRawFile } from './chunk-2PMJ7TQR.js';
|
|
6
6
|
import { existsSync, readFileSync, mkdirSync, writeFileSync, readdirSync } from 'fs';
|
|
7
7
|
import { join, dirname } from 'path';
|
|
8
8
|
import { fileURLToPath } from 'url';
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
3
|
import { detectActiveSession } from './chunk-IP7BIBXJ.js';
|
|
4
|
-
import { autoConnect } from './chunk-
|
|
5
|
-
import { workPageUrl } from './chunk-
|
|
4
|
+
import { autoConnect } from './chunk-L5GF2A43.js';
|
|
5
|
+
import { workPageUrl } from './chunk-TYRKGKMX.js';
|
|
6
6
|
import { C } from './chunk-2AM6Z5BP.js';
|
|
7
|
-
import { sanitizeTerminal } from './chunk-
|
|
7
|
+
import { sanitizeTerminal } from './chunk-XSX42Q2H.js';
|
|
8
8
|
import { resolveGatewayCredentials, unauthorizedMessage, defaultFetch } from './chunk-GBMTKV5B.js';
|
|
9
9
|
import { signRunnerRequest } from './chunk-XU5BNWX7.js';
|
|
10
10
|
import { readRepoConnection } from './chunk-BJ3KTMDH.js';
|
|
11
|
-
import { resolveRepoIdentity } from './chunk-
|
|
11
|
+
import { resolveRepoIdentity } from './chunk-PBAGWT2M.js';
|
|
12
12
|
import { parseTrackerNumber, trackerNumberError } from './chunk-WZBHBH3J.js';
|
|
13
13
|
import { homeFromEnv } from './chunk-352DHUTP.js';
|
|
14
14
|
|
|
@@ -471,7 +471,7 @@ async function runWorkLinkSession(opts) {
|
|
|
471
471
|
return await linkSession(opts);
|
|
472
472
|
} catch (err) {
|
|
473
473
|
if (opts.logFailures) {
|
|
474
|
-
const { logHookError } = await import('./hook-fast-
|
|
474
|
+
const { logHookError } = await import('./hook-fast-OPHM3MRK.js');
|
|
475
475
|
const reason = err instanceof Error ? err.message : String(err);
|
|
476
476
|
logHookError(opts.home ?? homeFromEnv(opts.env ?? process.env), new Error(`work link-session #${opts.number} failed: ${reason}`));
|
|
477
477
|
}
|
|
@@ -22636,7 +22636,11 @@ external_exports.object({
|
|
|
22636
22636
|
action: external_exports.enum(WORK_ITEM_COMMENT_ACTIONS).optional(),
|
|
22637
22637
|
artifact: external_exports.string().min(1).max(128).optional(),
|
|
22638
22638
|
sessionId: external_exports.string().min(1).optional(),
|
|
22639
|
-
reviewSendId: external_exports.string().regex(REVIEW_SEND_ID_PATTERN).optional()
|
|
22639
|
+
reviewSendId: external_exports.string().regex(REVIEW_SEND_ID_PATTERN).optional(),
|
|
22640
|
+
/** The id of the thread the comment answers (`threads[].id` from the
|
|
22641
|
+
* threads read). Refused with `criterion` or an `action`. The answer is
|
|
22642
|
+
* posted back to the source of the thread. */
|
|
22643
|
+
thread: external_exports.string().min(1).max(128).optional()
|
|
22640
22644
|
});
|
|
22641
22645
|
var WORK_ITEM_REVIEW_NOTES_MAX = 50;
|
|
22642
22646
|
var WorkItemReviewNoteSchema = external_exports.object({
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
|
-
import { keyRunnerFactory, RunnerConfigError } from './chunk-
|
|
3
|
+
import { keyRunnerFactory, RunnerConfigError } from './chunk-QJCXP4TA.js';
|
|
4
4
|
import { orgHomeDir } from './chunk-YQHUCOUL.js';
|
|
5
5
|
|
|
6
6
|
createRequire(import.meta.url);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
|
-
import { EVENT_TYPES, isHumanUserTurn, INPUT_BAND_BOUNDARIES, parseAgentSession, SCHEMA_VERSION, SPEED_MAX_LENGTH, inputBandOf, BUCKET_MODEL_MAX_LENGTH } from './chunk-
|
|
3
|
+
import { EVENT_TYPES, isHumanUserTurn, INPUT_BAND_BOUNDARIES, parseAgentSession, SCHEMA_VERSION, SPEED_MAX_LENGTH, inputBandOf, BUCKET_MODEL_MAX_LENGTH } from './chunk-N2XW4NYY.js';
|
|
4
4
|
import { createHash } from 'crypto';
|
|
5
5
|
import { readFileSync, readdirSync, statSync, mkdirSync, copyFileSync, renameSync, unlinkSync, writeFileSync, stat as stat$1, unwatchFile, watchFile, watch as watch$1 } from 'fs';
|
|
6
6
|
import { type, homedir } from 'os';
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
|
-
import { runEmit } from './chunk-
|
|
3
|
+
import { runEmit } from './chunk-SUVS7A7X.js';
|
|
4
4
|
import { addStdioMcpEntryIfAbsent, addDocsMcpEntryIfAbsent, DOCS_MCP_SERVER_NAME } from './chunk-OHQMGLJP.js';
|
|
5
|
-
import { installStarterPack } from './chunk-
|
|
5
|
+
import { installStarterPack } from './chunk-VQCAJUDV.js';
|
|
6
6
|
import { C } from './chunk-2AM6Z5BP.js';
|
|
7
|
-
import { AGENTS_MD_LAYOUT, declareAgentsMdLayout, linkClaudeSkills, SKILLS_LINK_PATH, describeSkillsLink, isAgentsMdLayout, holdsTodaysLayoutSources, discoverOuterlayerPaths } from './chunk-
|
|
8
|
-
import { resolveGitCommonDir, defaultGitRunner } from './chunk-
|
|
9
|
-
import { loadTemplateFiles, loadMaintainedFiles, skillDir, AGENTS_SKILLS_BASE } from './chunk-
|
|
7
|
+
import { AGENTS_MD_LAYOUT, declareAgentsMdLayout, linkClaudeSkills, SKILLS_LINK_PATH, describeSkillsLink, isAgentsMdLayout, holdsTodaysLayoutSources, discoverOuterlayerPaths } from './chunk-TMFKZBOW.js';
|
|
8
|
+
import { resolveGitCommonDir, defaultGitRunner } from './chunk-EK7MQ56V.js';
|
|
9
|
+
import { loadTemplateFiles, loadMaintainedFiles, skillDir, AGENTS_SKILLS_BASE } from './chunk-MGF4254K.js';
|
|
10
10
|
import { cliInvocation } from './chunk-FZKNTIOJ.js';
|
|
11
|
-
import { linkedAgentsPath } from './chunk-
|
|
11
|
+
import { linkedAgentsPath } from './chunk-GWXHRG2N.js';
|
|
12
12
|
import { cloneIsGoverned } from './chunk-YQR6E6OV.js';
|
|
13
|
-
import { generatedHeaderSource } from './chunk-
|
|
13
|
+
import { generatedHeaderSource } from './chunk-2PMJ7TQR.js';
|
|
14
14
|
import { execFileSync } from 'child_process';
|
|
15
15
|
import { existsSync, mkdirSync, writeFileSync } from 'fs';
|
|
16
16
|
import { join, dirname } from 'path';
|