@outerlayer/cli 0.36.0-next.20261101174803 → 0.36.0-next.20261102124202
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-AOB76EDJ.js +37 -0
- package/dist/bridge-DFG2GTXQ.js +13 -0
- package/dist/build-THAD3B4Q.js +21 -0
- package/dist/build-disk-HO2VPIBJ.js +18 -0
- package/dist/build-info.json +1 -1
- package/dist/builder-AXJNIF4S.js +17 -0
- package/dist/caller-GOY2X6QT.js +20 -0
- package/dist/{check-K4RVAP4L.js → check-SF2OVZXB.js} +68 -66
- package/dist/{chunk-KB5B6ZT5.js → chunk-3FSKTGM6.js} +20 -20
- package/dist/{chunk-HL7UNTXO.js → chunk-4CTVN3C5.js} +15 -8
- package/dist/{chunk-QIOTIQWD.js → chunk-4TNUQLXH.js} +5 -5
- package/dist/{chunk-LGV5N5DG.js → chunk-564Q2STF.js} +1 -1
- package/dist/{chunk-F2LPX2HS.js → chunk-5FIOUQGC.js} +8 -8
- package/dist/{chunk-TSYHUUAT.js → chunk-5FND4PIU.js} +2 -2
- package/dist/{chunk-4DJZSNVT.js → chunk-6JJITHBI.js} +1 -1
- package/dist/{chunk-KLXECBIE.js → chunk-6LO62EQ5.js} +149 -106
- package/dist/{chunk-RIHB3HA2.js → chunk-772ILTCK.js} +3 -3
- package/dist/{chunk-CIUD3436.js → chunk-A5Y2HBVU.js} +1 -1
- package/dist/{chunk-KDK6AF7B.js → chunk-AYLYAOHH.js} +5 -5
- package/dist/{chunk-OEBFKPHK.js → chunk-C3JWWPLC.js} +9 -10
- package/dist/{chunk-24FEVLX7.js → chunk-CKPQOQFC.js} +643 -73
- package/dist/{chunk-ALEUIS35.js → chunk-CVGQ3BNF.js} +1 -1
- package/dist/{chunk-DJMR4YPG.js → chunk-EBIYRRJW.js} +5 -5
- package/dist/{chunk-MXIFRYLA.js → chunk-ESSJPSJ2.js} +2 -2
- package/dist/{chunk-D2OTBS47.js → chunk-EUDG754F.js} +2 -2
- package/dist/{chunk-55PYF6S2.js → chunk-FIO6PIZ6.js} +3 -3
- package/dist/{chunk-WT7J2627.js → chunk-GD6KIHOS.js} +1 -1
- package/dist/{chunk-DJDTL6AY.js → chunk-GDZTL6BI.js} +40 -31
- package/dist/{chunk-AF6DQJ5W.js → chunk-GSXGA6KF.js} +1 -1
- package/dist/{chunk-LEHBDEUG.js → chunk-GZ75FRLB.js} +4 -5
- package/dist/chunk-H2FFONRY.js +136 -0
- package/dist/{chunk-DHFNBNC3.js → chunk-HIN4BMRW.js} +2 -2
- package/dist/{chunk-ABAVN4RT.js → chunk-I626B72C.js} +29 -26
- package/dist/{chunk-VJYSPH2J.js → chunk-I6FRCBMU.js} +26 -21
- package/dist/{chunk-X2XTCGUS.js → chunk-J7TCTARR.js} +11 -12
- package/dist/chunk-J7Y3PCO2.js +653 -0
- package/dist/{chunk-YQHEJ5SV.js → chunk-JVCQZDQ6.js} +3 -3
- package/dist/{chunk-JW5BENE6.js → chunk-JXXHLQQR.js} +3 -3
- package/dist/{chunk-GLUQVET2.js → chunk-K3X3L5YW.js} +2 -2
- package/dist/{chunk-MKSZHT6S.js → chunk-KN4VIK53.js} +1 -1
- package/dist/chunk-L3JXQDVH.js +78 -0
- package/dist/{chunk-6A2GEFN3.js → chunk-LCOQN6NR.js} +2 -2
- package/dist/{chunk-R3252UTU.js → chunk-LSXHTBAM.js} +2 -2
- package/dist/{chunk-ZP7F3OHV.js → chunk-LVXR37OG.js} +47 -38
- package/dist/{chunk-W7I65BKE.js → chunk-LYFLUNWK.js} +12 -12
- package/dist/{chunk-GANAOCHR.js → chunk-M2NIHHQI.js} +24 -374
- package/dist/chunk-NC3QAHOS.js +26 -0
- package/dist/{chunk-RIIPBJK6.js → chunk-NTMRMBLM.js} +4 -4
- package/dist/{chunk-NFZJ5XHP.js → chunk-NWBB2SQ4.js} +33 -32
- package/dist/{chunk-H7SKHAUE.js → chunk-OYKAOHX5.js} +3 -3
- package/dist/{chunk-EBOQU6QC.js → chunk-OZOATEK3.js} +2 -2
- package/dist/{chunk-BRUDBWLO.js → chunk-PKO5IDW4.js} +7 -7
- package/dist/{chunk-7J7HRYZ3.js → chunk-PQDFW422.js} +1 -1
- package/dist/{chunk-EZRAR5YG.js → chunk-PT34C6SU.js} +1 -1
- package/dist/{chunk-HAWPG7QW.js → chunk-PTPF36Q7.js} +3 -3
- package/dist/{chunk-7Y5VW4JG.js → chunk-Q42K6XZ6.js} +1 -1
- package/dist/{chunk-SPXVFFQV.js → chunk-QJDX6VJS.js} +5 -5
- package/dist/{chunk-ULBVE7MP.js → chunk-RK4JQRVT.js} +6 -6
- package/dist/{chunk-JU3VU42K.js → chunk-RPZIHELI.js} +5 -5
- package/dist/{chunk-XNBUZGRO.js → chunk-RSRZDF3K.js} +3 -3
- package/dist/{chunk-46OBCATR.js → chunk-T5Z22NA6.js} +1 -1
- package/dist/chunk-TWYHSMHM.js +67 -0
- package/dist/{chunk-AGKQEOFS.js → chunk-TYCZVJTB.js} +54 -31
- package/dist/{chunk-B7PYT2BY.js → chunk-VRQM4A64.js} +6 -3
- package/dist/{chunk-KFUDKFEH.js → chunk-WDQPBAFV.js} +44 -19
- package/dist/{chunk-UZGQT6OF.js → chunk-WLMAGMTU.js} +5 -3
- package/dist/{chunk-RDWKRG4K.js → chunk-WNYH42PF.js} +4 -4
- package/dist/{chunk-MOOZJRKM.js → chunk-WQB3XOEP.js} +27 -30
- package/dist/{chunk-O36YAH2G.js → chunk-XABJMU5A.js} +4 -4
- package/dist/{chunk-2SRQSGPR.js → chunk-XAOIHYPS.js} +29 -24
- package/dist/{chunk-WAZJPDR2.js → chunk-XE3DIJJT.js} +1 -1
- package/dist/{chunk-B62TYDP2.js → chunk-XHFSBSIA.js} +4 -4
- package/dist/{chunk-AH6634HC.js → chunk-XLOM2BNL.js} +1 -2
- package/dist/{claude-launcher-L77BKZOC.js → claude-launcher-LXZPTDNC.js} +23 -18
- package/dist/{cli-QQY5UECM.js → cli-QFUT3UQS.js} +137 -138
- package/dist/{cli-update-notice-T3CXRWNB.js → cli-update-notice-AWYJ4A7R.js} +2 -2
- package/dist/{command-QLHQZ32L.js → command-45RZT4CK.js} +55 -56
- package/dist/{config-5GY7FL35.js → config-WYQPXLOP.js} +11 -9
- package/dist/connect-cmd-LUCQ7FSV.js +26 -0
- package/dist/{container-start-OCJODSMB.js → container-start-T776VI3M.js} +55 -54
- package/dist/{context-cleanup-A7KBEBIO.js → context-cleanup-QE2MIO2Q.js} +4 -2
- package/dist/{context-show-cmd-MZ74ZIVO.js → context-show-cmd-7QEHUOEL.js} +14 -14
- package/dist/{control-plane-launch-3TZFOSCX.js → control-plane-launch-THUH6YU5.js} +18 -18
- package/dist/{demo-record-cmd-Y57UWBCX.js → demo-record-cmd-SBERRQNW.js} +8 -5
- package/dist/{demo-voice-cmd-4INIOVTC.js → demo-voice-cmd-VM3FITZU.js} +18 -20
- package/dist/docker-MQNLK4OO.js +17 -0
- package/dist/{doctor-DB2AJUAO.js → doctor-NQOSPJGS.js} +71 -68
- package/dist/{emit-artifact-cmd-H27MFSKH.js → emit-artifact-cmd-6E365VBQ.js} +17 -18
- package/dist/{emit-cmd-IOWTTZSA.js → emit-cmd-ZPFCPVSR.js} +7 -8
- package/dist/{emit-criteria-cmd-IOUVMB2Q.js → emit-criteria-cmd-HWQOYZZ4.js} +13 -14
- package/dist/{emit-demo-cmd-WJSS7KU2.js → emit-demo-cmd-PMQGNNVX.js} +18 -20
- package/dist/{emit-finding-cmd-KQIGM5IF.js → emit-finding-cmd-MYWQN5WW.js} +13 -14
- package/dist/{emit-result-cmd-6Q7OU2NY.js → emit-result-cmd-GXK3KMAP.js} +16 -17
- package/dist/{emit-step-cmd-GZU5O2FR.js → emit-step-cmd-ZV2XTUVT.js} +13 -14
- package/dist/exec-client-P7RFRUCK.js +14 -0
- package/dist/find-unit-63SXQ7IM.js +21 -0
- package/dist/{findings-cmd-T7PQAVJG.js → findings-cmd-OGMBVVSM.js} +13 -14
- package/dist/{fleet-readiness-PTMOEX6L.js → fleet-readiness-4RBKLXBQ.js} +14 -15
- package/dist/{governing-source-CND5ZZC3.js → governing-source-XJMXFSAR.js} +19 -20
- package/dist/guest-init-XZHRPIMG.js +16 -0
- package/dist/{hook-fast-RW7RU3O6.js → hook-fast-ZOWGWCPO.js} +5 -5
- package/dist/host-checks-WHW24PJR.js +76 -0
- package/dist/host-key-MWLXB5U5.js +14 -0
- package/dist/{image-tag-WBD57QBN.js → image-tag-E4JK2APF.js} +9 -4
- package/dist/index.js +4 -4
- package/dist/init-EZIAHBMH.js +76 -0
- package/dist/{init-HUQLVUPO.js → init-LO6U7YTW.js} +52 -51
- package/dist/{init-cmd-6NQGBVAJ.js → init-cmd-2JANO5EN.js} +23 -24
- package/dist/{init-update-MA6QKX46.js → init-update-D6PRTGNE.js} +51 -44
- package/dist/install-cmd-SJMBNQEH.js +17 -0
- package/dist/{layout-2ZMCT2D3.js → layout-AQHIMJMO.js} +4 -4
- package/dist/{logs-FEITSC2V.js → logs-NE55HOET.js} +8 -3
- package/dist/loop-2E34CGCX.js +87 -0
- package/dist/machine-6ALGG4IO.js +76 -0
- package/dist/{machine-skills-237PQFRC.js → machine-skills-KK2HXYMR.js} +3 -4
- package/dist/{mcp-install-cmd-23ZY4IBK.js → mcp-install-cmd-2QAS3AQZ.js} +5 -1
- package/dist/{mcp-serve-cmd-ZINYSLY6.js → mcp-serve-cmd-U6USKHYR.js} +9 -7
- package/dist/{paths-XEYE7OZ2.js → paths-O7LCWY33.js} +8 -3
- package/dist/pending-YU2GE2UV.js +14 -0
- package/dist/pidfile-5GDCQ5HA.js +15 -0
- package/dist/record-NETSDAO6.js +14 -0
- package/dist/{relay-IEYNSKAZ.js → relay-VZ733BVJ.js} +6 -1
- package/dist/{relay-protocol-5LSWUJCW.js → relay-protocol-24GEUGCO.js} +6 -1
- package/dist/runner-env-KHCONH2R.js +21 -0
- package/dist/{runner-identity-IIY5UJL3.js → runner-identity-PSCZBILD.js} +10 -7
- package/dist/{runner-key-CFZ47PR3.js → runner-key-VM2LYVRK.js} +44 -46
- package/dist/{session-sender-NO4F2IQ5.js → session-sender-P2RHDM6U.js} +17 -18
- package/dist/{spec-cmd-CNASSB6L.js → spec-cmd-LGKP6MT7.js} +14 -15
- package/dist/{starter-pack-CCVIEY72.js → starter-pack-SMK6UPRL.js} +5 -6
- package/dist/state-RJR4PMMX.js +14 -0
- package/dist/{status-VNHIHQ57.js → status-HEHCNIDS.js} +44 -46
- package/dist/{sync-cmd-5JLJBODH.js → sync-cmd-HKN45HXL.js} +16 -17
- package/dist/update-steps-7E4RD47J.js +77 -0
- package/dist/{watch-AEWWTUEK.js → watch-RGZCUCR3.js} +16 -17
- package/dist/{work-claim-cmd-GUYOJYH7.js → work-claim-cmd-6DSPGCZE.js} +19 -21
- package/dist/{work-cmd-YRPYMGII.js → work-cmd-GPLYLWY7.js} +13 -14
- package/dist/{work-comment-cmd-U5Z6FKEU.js → work-comment-cmd-V5WM7LAW.js} +16 -17
- package/dist/{work-demo-cmd-OLCWTVWM.js → work-demo-cmd-SWWI6AGD.js} +13 -14
- package/dist/{work-logs-cmd-2OA7ENDU.js → work-logs-cmd-CTFBOPCI.js} +13 -14
- package/dist/{work-open-pr-cmd-6GUCDYVM.js → work-open-pr-cmd-HX2U3YBR.js} +14 -15
- package/dist/{work-pr-cmd-KK3VQUQI.js → work-pr-cmd-EI2R4FQG.js} +13 -14
- package/dist/{work-proofs-cmd-BUOS5OJC.js → work-proofs-cmd-QXNPHLYC.js} +15 -16
- package/dist/{work-proofs-record-6WLMOK53.js → work-proofs-record-72OKWEES.js} +22 -24
- package/dist/{work-stop-cmd-VZJX5X4L.js → work-stop-cmd-7M7ZYUN2.js} +13 -14
- package/package.json +1 -1
- package/dist/agent-setup-DJRQFPDU.js +0 -33
- package/dist/bridge-XM4QLKIX.js +0 -8
- package/dist/build-ZE5IG3V6.js +0 -18
- package/dist/build-disk-GMXDIZU4.js +0 -15
- package/dist/builder-LJ3FSB36.js +0 -14
- package/dist/caller-YLNJJPFU.js +0 -18
- package/dist/chunk-CXFJOX2C.js +0 -144
- package/dist/chunk-FGF52V4V.js +0 -137
- package/dist/chunk-HCVLP7XA.js +0 -53
- package/dist/chunk-MESOOLF4.js +0 -45
- package/dist/chunk-OHQMGLJP.js +0 -113
- package/dist/chunk-OUPQTA7N.js +0 -145
- package/dist/chunk-VRMXYQWR.js +0 -74
- package/dist/connect-cmd-THV7XBVP.js +0 -27
- package/dist/docker-5YVUZ3J2.js +0 -14
- package/dist/exec-client-FGGPQSYQ.js +0 -9
- package/dist/find-unit-PRZIFBIK.js +0 -19
- package/dist/guest-init-WPUS45IN.js +0 -11
- package/dist/host-checks-S3B7Z4SY.js +0 -78
- package/dist/host-key-O4DFMOSV.js +0 -9
- package/dist/init-ILTX4V56.js +0 -78
- package/dist/install-cmd-JKPXIOEY.js +0 -12
- package/dist/loop-KDWDOSMQ.js +0 -89
- package/dist/machine-Z6K5XXI6.js +0 -78
- package/dist/pending-D2NNV54J.js +0 -9
- package/dist/pidfile-FLFVRKVW.js +0 -10
- package/dist/record-JMZOXD4R.js +0 -9
- package/dist/runner-env-W2UMHY7P.js +0 -19
- package/dist/state-UWIM42JH.js +0 -9
- package/dist/update-steps-XGOXDCOS.js +0 -79
- package/dist/{chunk-OLM2TIOW.js → chunk-NFZMENCY.js} +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
|
-
import { stripTerminalControls } from './chunk-
|
|
4
|
-
import { tagToPull, imageTag, pullInstruction, readUpdateStatus, runnerImageVersion } from './chunk-
|
|
3
|
+
import { stripTerminalControls } from './chunk-6LO62EQ5.js';
|
|
4
|
+
import { tagToPull, imageTag, pullInstruction, readUpdateStatus, runnerImageVersion } from './chunk-CVGQ3BNF.js';
|
|
5
5
|
import { readFileSync } from 'fs';
|
|
6
6
|
|
|
7
7
|
createRequire(import.meta.url);
|
|
@@ -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-MQNLK4OO.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 = "";
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
3
|
import { launchRefusalForSession } from './chunk-AAGU5FJF.js';
|
|
4
4
|
import { detectActiveSession } from './chunk-IP7BIBXJ.js';
|
|
5
|
-
import { autoConnect } from './chunk-
|
|
5
|
+
import { autoConnect } from './chunk-5FND4PIU.js';
|
|
6
6
|
import { C } from './chunk-2AM6Z5BP.js';
|
|
7
|
-
import { resolveGatewayCredentials, defaultFetch, unauthorizedMessage } from './chunk-
|
|
7
|
+
import { resolveGatewayCredentials, defaultFetch, unauthorizedMessage } from './chunk-JVCQZDQ6.js';
|
|
8
8
|
import { resolveRepoIdentity } from './chunk-5GHJFETA.js';
|
|
9
9
|
import { launchedItemForSession } from './chunk-5WYT3PPE.js';
|
|
10
10
|
import { parseTrackerNumber, trackerNumberError } from './chunk-WZBHBH3J.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
|
-
import { RELAY_PORT, BUILD_HOME } from './chunk-
|
|
3
|
+
import { RELAY_PORT, BUILD_HOME } from './chunk-M2NIHHQI.js';
|
|
4
4
|
import { createServer, connect } from 'net';
|
|
5
5
|
|
|
6
6
|
createRequire(import.meta.url);
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { createRequire } from 'node:module';
|
|
3
|
+
import { DEFAULT_UNIT_NAME } from './chunk-TYCZVJTB.js';
|
|
4
|
+
import { RUNNER_FILE_MODE } from './chunk-GD6KIHOS.js';
|
|
5
|
+
import { runnerAgents, credentialAgent, credentialForms, orList, credentialShapes, credentialEnvPath, withoutCredentialLines, parseRunnerEnv, forwardedVariables } from './chunk-J7Y3PCO2.js';
|
|
6
|
+
import { defaultAgents } from './chunk-CKPQOQFC.js';
|
|
7
|
+
import { existsSync, readFileSync, writeFileSync, renameSync, rmSync } from 'fs';
|
|
8
|
+
import { join, dirname } from 'path';
|
|
9
|
+
|
|
10
|
+
createRequire(import.meta.url);
|
|
11
|
+
var AGENT_COMMANDS = {
|
|
12
|
+
claude: {
|
|
13
|
+
implement: 'claude -p "/build" --permission-mode bypassPermissions',
|
|
14
|
+
amend: 'claude -p "/outerlayer-amend" --permission-mode bypassPermissions'
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
function isAgentName(name) {
|
|
18
|
+
return Object.hasOwn(AGENT_COMMANDS, name);
|
|
19
|
+
}
|
|
20
|
+
var RunnerEnvError = class extends Error {
|
|
21
|
+
};
|
|
22
|
+
function runnerEnvPath(configPath) {
|
|
23
|
+
return join(dirname(configPath), "runner.env");
|
|
24
|
+
}
|
|
25
|
+
function credentialFromStdin(text, agents = defaultAgents()) {
|
|
26
|
+
const value = (text ?? "").trim();
|
|
27
|
+
if (value === "") return void 0;
|
|
28
|
+
for (const agent2 of runnerAgents(agents)) {
|
|
29
|
+
const variable = agent2.credentials.identify(value);
|
|
30
|
+
if (variable !== void 0) return { variable, value };
|
|
31
|
+
}
|
|
32
|
+
const agent = credentialAgent(agents);
|
|
33
|
+
if (agent === void 0) throw new RunnerEnvError("no agent takes a credential on stdin, so nothing was written.");
|
|
34
|
+
throw new RunnerEnvError(`the value on stdin is not a ${credentialForms(agent.descriptor).label} credential, so nothing was written. Pipe one value: ${orList(credentialShapes(agent.descriptor).map((shape) => `${shape.phrase}, which starts ${shape.starts}`))}.`);
|
|
35
|
+
}
|
|
36
|
+
function setsCredential(path, agents) {
|
|
37
|
+
if (!existsSync(path)) return false;
|
|
38
|
+
const env = parseRunnerEnv(readFileSync(path, "utf8"));
|
|
39
|
+
return forwardedVariables(agents).some((name) => env[name]);
|
|
40
|
+
}
|
|
41
|
+
function hasStoredCredential(configPath, agents = defaultAgents()) {
|
|
42
|
+
const own = credentialEnvPath(configPath, agents);
|
|
43
|
+
return own !== void 0 && setsCredential(own, agents) || setsCredential(runnerEnvPath(configPath), agents);
|
|
44
|
+
}
|
|
45
|
+
function replaceFile(path, text) {
|
|
46
|
+
const temporary = `${path}.${process.pid}.tmp`;
|
|
47
|
+
try {
|
|
48
|
+
writeFileSync(temporary, text, { mode: RUNNER_FILE_MODE, flag: "wx" });
|
|
49
|
+
renameSync(temporary, path);
|
|
50
|
+
} catch (err) {
|
|
51
|
+
rmSync(temporary, { force: true });
|
|
52
|
+
throw err;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
function storeAgentCredential(configPath, credential, agents = defaultAgents()) {
|
|
56
|
+
const owner = runnerAgents(agents).find((agent) => agent.descriptor.credentials.forwarded.includes(credential.variable)) ?? credentialAgent(agents);
|
|
57
|
+
if (owner === void 0) throw new RunnerEnvError("no agent takes a credential, so nothing was written.");
|
|
58
|
+
const path = join(dirname(configPath), credentialForms(owner.descriptor).envFile);
|
|
59
|
+
replaceFile(path, `${credential.variable}=${credential.value}
|
|
60
|
+
`);
|
|
61
|
+
const runnerPath = runnerEnvPath(configPath);
|
|
62
|
+
if (existsSync(runnerPath)) {
|
|
63
|
+
const dropped = withoutCredentialLines(readFileSync(runnerPath, "utf8"), agents);
|
|
64
|
+
if (dropped !== void 0) replaceFile(runnerPath, dropped);
|
|
65
|
+
}
|
|
66
|
+
return path;
|
|
67
|
+
}
|
|
68
|
+
function restartForCredential(state, unitName = DEFAULT_UNIT_NAME, agents = defaultAgents()) {
|
|
69
|
+
const agent = credentialAgent(agents);
|
|
70
|
+
const file = agent === void 0 ? "the credential file" : credentialForms(agent.descriptor).envFile;
|
|
71
|
+
if (state === "differs") {
|
|
72
|
+
return `The service ${unitName} was not written by runner init, so it may not load ${file}, the one file that now holds the credential. Add EnvironmentFile=-<config directory>/${file} to it, or run runner install --service --replace. Then restart it: sudo systemctl restart ${unitName}`;
|
|
73
|
+
}
|
|
74
|
+
if (state !== "pending-restart") return void 0;
|
|
75
|
+
return `The service ${unitName} loads ${file} only when it starts. Restart it so it uses the stored credential: sudo systemctl restart ${unitName}`;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export { AGENT_COMMANDS, RunnerEnvError, credentialFromStdin, hasStoredCredential, isAgentName, restartForCredential, storeAgentCredential };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
|
-
import { LiveUploader } from './chunk-
|
|
4
|
-
import { spoolDir } from './chunk-
|
|
3
|
+
import { LiveUploader } from './chunk-4TNUQLXH.js';
|
|
4
|
+
import { spoolDir } from './chunk-EBIYRRJW.js';
|
|
5
5
|
import { CaptureDaemon } from './chunk-5GHJFETA.js';
|
|
6
6
|
import { parseWorkItemEnv } from './chunk-5WYT3PPE.js';
|
|
7
7
|
import { homeFromEnv } from './chunk-352DHUTP.js';
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
3
|
import { launchRefusalForSession } from './chunk-AAGU5FJF.js';
|
|
4
4
|
import { detectActiveSession } from './chunk-IP7BIBXJ.js';
|
|
5
|
-
import { autoConnect } from './chunk-
|
|
5
|
+
import { autoConnect } from './chunk-5FND4PIU.js';
|
|
6
6
|
import { C } from './chunk-2AM6Z5BP.js';
|
|
7
7
|
import { acquireSpoolLockAt } from './chunk-P6PHY33P.js';
|
|
8
|
-
import { resolveGatewayCredentials, defaultFetch, unauthorizedMessage } from './chunk-
|
|
8
|
+
import { resolveGatewayCredentials, defaultFetch, unauthorizedMessage } from './chunk-JVCQZDQ6.js';
|
|
9
9
|
import { resolveRepoIdentity } from './chunk-5GHJFETA.js';
|
|
10
10
|
import { launchedItemForSession } from './chunk-5WYT3PPE.js';
|
|
11
11
|
import { parseTrackerNumber, trackerNumberError } from './chunk-WZBHBH3J.js';
|
|
@@ -1,34 +1,34 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
|
-
import { runEmit } from './chunk-
|
|
4
|
-
import { addStdioMcpEntryIfAbsent, addDocsMcpEntryIfAbsent, DOCS_MCP_SERVER_NAME } from './chunk-
|
|
5
|
-
import { installStarterPack } from './chunk-
|
|
3
|
+
import { runEmit } from './chunk-XAOIHYPS.js';
|
|
4
|
+
import { addStdioMcpEntryIfAbsent, addDocsMcpEntryIfAbsent, DOCS_MCP_SERVER_NAME } from './chunk-H2FFONRY.js';
|
|
5
|
+
import { installStarterPack } from './chunk-XHFSBSIA.js';
|
|
6
|
+
import { listWithAnd } from './chunk-4CTVN3C5.js';
|
|
6
7
|
import { C } from './chunk-2AM6Z5BP.js';
|
|
7
|
-
import { AGENTS_MD_LAYOUT,
|
|
8
|
-
import { resolveGitCommonDir, defaultGitRunner } from './chunk-
|
|
9
|
-
import { loadTemplateFiles, loadMaintainedFiles, skillDir, AGENTS_SKILLS_BASE } from './chunk-CXFJOX2C.js';
|
|
8
|
+
import { AGENTS_MD_LAYOUT, mcpFiles, declareAgentsMdLayout, linkAgentSkills, describeSkillsLink, isAgentsMdLayout, holdsTodaysLayoutSources, discoverOuterlayerPaths } from './chunk-WDQPBAFV.js';
|
|
9
|
+
import { resolveGitCommonDir, defaultGitRunner } from './chunk-J7TCTARR.js';
|
|
10
10
|
import { cliInvocation } from './chunk-FZKNTIOJ.js';
|
|
11
|
-
import { linkedAgentsPath } from './chunk-
|
|
11
|
+
import { linkedAgentsPath } from './chunk-VRQM4A64.js';
|
|
12
12
|
import { cloneIsGoverned } from './chunk-YQR6E6OV.js';
|
|
13
|
-
import { generatedHeaderSource } from './chunk-
|
|
13
|
+
import { LEGACY_AGENT, generatedHeaderSource, defaultAgents, loadTemplateFiles, loadMaintainedFiles, skillDir, AGENTS_SKILLS_BASE, legacyAgent, contextAgents } from './chunk-CKPQOQFC.js';
|
|
14
14
|
import { execFileSync } from 'child_process';
|
|
15
15
|
import { existsSync, mkdirSync, writeFileSync } from 'fs';
|
|
16
16
|
import { join, dirname } from 'path';
|
|
17
17
|
|
|
18
18
|
createRequire(import.meta.url);
|
|
19
19
|
var CONFIG_PATH = ".outerlayer/config.json";
|
|
20
|
-
var MCP_OUTPUT_PATH = ".mcp.json";
|
|
21
20
|
var POLICY_PATH = ".outerlayer/policy.yaml";
|
|
22
|
-
var DEFAULT_CONFIG = `${JSON.stringify({ targets: [
|
|
21
|
+
var DEFAULT_CONFIG = `${JSON.stringify({ targets: [LEGACY_AGENT] }, null, 2)}
|
|
23
22
|
`;
|
|
24
|
-
var AGENTS_MD_CONFIG = `${JSON.stringify({ targets: [
|
|
23
|
+
var AGENTS_MD_CONFIG = `${JSON.stringify({ targets: [LEGACY_AGENT], layout: AGENTS_MD_LAYOUT }, null, 2)}
|
|
25
24
|
`;
|
|
26
|
-
var
|
|
25
|
+
var starterAgentsMd = (agents) => `# Agent instructions
|
|
27
26
|
|
|
28
27
|
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.
|
|
29
28
|
|
|
30
|
-
|
|
29
|
+
${legacyAgent(agents).descriptor.label} and Codex read this file as it is. Skills are in \`.agents/skills/\`.
|
|
31
30
|
`;
|
|
31
|
+
var agentLabels = (agents) => contextAgents(agents).map((agent) => agent.descriptor.label).join(" and ");
|
|
32
32
|
function inTodaysLayout(repoRoot) {
|
|
33
33
|
if (isAgentsMdLayout(repoRoot)) return false;
|
|
34
34
|
return existsSync(join(repoRoot, CONFIG_PATH)) || holdsTodaysLayoutSources(discoverOuterlayerPaths(repoRoot));
|
|
@@ -79,6 +79,7 @@ function keepHandWritten(createdSources) {
|
|
|
79
79
|
};
|
|
80
80
|
}
|
|
81
81
|
function runAgentSetup(opts) {
|
|
82
|
+
const agents = opts.agents ?? defaultAgents();
|
|
82
83
|
let repoRoot;
|
|
83
84
|
try {
|
|
84
85
|
repoRoot = gitTopLevel(opts.cwd);
|
|
@@ -89,7 +90,7 @@ function runAgentSetup(opts) {
|
|
|
89
90
|
} catch (err) {
|
|
90
91
|
return failed(errorMessage(err), /* @__PURE__ */ new Set(), []);
|
|
91
92
|
}
|
|
92
|
-
if (!inTodaysLayout(repoRoot)) return runAgentsMdSetup(repoRoot, opts.skillsLink !== false);
|
|
93
|
+
if (!inTodaysLayout(repoRoot)) return runAgentsMdSetup(repoRoot, opts.skillsLink !== false, agents);
|
|
93
94
|
const written = /* @__PURE__ */ new Set();
|
|
94
95
|
const kept = [];
|
|
95
96
|
const problems = [];
|
|
@@ -118,20 +119,22 @@ function runAgentSetup(opts) {
|
|
|
118
119
|
return failed(`could not install the skills: ${errorMessage(err)}`, written, kept);
|
|
119
120
|
}
|
|
120
121
|
try {
|
|
121
|
-
const mcp
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
122
|
+
for (const mcp of withOthers(addStdioMcpEntryIfAbsent(repoRoot, "outerlayer", agents))) {
|
|
123
|
+
if (mcp.added) written.add(mcp.path);
|
|
124
|
+
else kept.push(`${mcp.path} (already has an outerlayer server)`);
|
|
125
|
+
}
|
|
126
|
+
for (const docs of withOthers(addDocsMcpEntryIfAbsent(repoRoot, agents))) {
|
|
127
|
+
if (docs.added) written.add(docs.path);
|
|
128
|
+
else kept.push(`${docs.path} (already has an ${DOCS_MCP_SERVER_NAME} server)`);
|
|
129
|
+
}
|
|
127
130
|
} catch (err) {
|
|
128
131
|
problems.push(errorMessage(err));
|
|
129
132
|
}
|
|
130
133
|
let pending;
|
|
131
134
|
try {
|
|
132
|
-
const check = runEmit({ cwd: repoRoot, check: true, quiet: true, keep });
|
|
135
|
+
const check = runEmit({ cwd: repoRoot, check: true, quiet: true, keep }, agents);
|
|
133
136
|
pending = check.drift ?? [];
|
|
134
|
-
const emitted = runEmit({ cwd: repoRoot, quiet: true, keep });
|
|
137
|
+
const emitted = runEmit({ cwd: repoRoot, quiet: true, keep }, agents);
|
|
135
138
|
for (const path of emitted.kept) keptOutputs.add(path);
|
|
136
139
|
if (emitted.exitCode !== 0) {
|
|
137
140
|
const detail = emitted.errors.map((e) => `${e.path}: ${e.message}`).join("; ");
|
|
@@ -152,12 +155,12 @@ function runAgentSetup(opts) {
|
|
|
152
155
|
return {
|
|
153
156
|
outcome: "done",
|
|
154
157
|
reason: paths.length === 0 ? "already set up" : `${paths.length} files written`,
|
|
155
|
-
text: renderDone(paths, kept, keptOutputs.has(
|
|
158
|
+
text: renderDone(paths, kept, mcpFiles(agents).some((file) => keptOutputs.has(file)), agents),
|
|
156
159
|
paths,
|
|
157
160
|
kept: keptPaths
|
|
158
161
|
};
|
|
159
162
|
}
|
|
160
|
-
function runAgentsMdSetup(repoRoot, skillsLink) {
|
|
163
|
+
function runAgentsMdSetup(repoRoot, skillsLink, agents) {
|
|
161
164
|
const written = /* @__PURE__ */ new Set();
|
|
162
165
|
const kept = [];
|
|
163
166
|
const problems = [];
|
|
@@ -175,7 +178,7 @@ function runAgentsMdSetup(repoRoot, skillsLink) {
|
|
|
175
178
|
if (existsSync(join(repoRoot, "AGENTS.md")) || existsSync(join(repoRoot, "CLAUDE.md"))) {
|
|
176
179
|
kept.push(existsSync(join(repoRoot, "AGENTS.md")) ? "AGENTS.md" : "CLAUDE.md");
|
|
177
180
|
} else {
|
|
178
|
-
writeFileSync(join(repoRoot, "AGENTS.md"),
|
|
181
|
+
writeFileSync(join(repoRoot, "AGENTS.md"), starterAgentsMd(agents));
|
|
179
182
|
written.add("AGENTS.md");
|
|
180
183
|
}
|
|
181
184
|
if (existsSync(join(repoRoot, CONFIG_PATH))) {
|
|
@@ -190,20 +193,22 @@ function runAgentsMdSetup(repoRoot, skillsLink) {
|
|
|
190
193
|
return failed(`could not install the skills: ${errorMessage(err)}`, written, kept);
|
|
191
194
|
}
|
|
192
195
|
try {
|
|
193
|
-
const mcp
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
196
|
+
for (const mcp of withOthers(addStdioMcpEntryIfAbsent(repoRoot, "outerlayer", agents))) {
|
|
197
|
+
if (mcp.added) written.add(mcp.path);
|
|
198
|
+
else kept.push(`${mcp.path} (already has an outerlayer server)`);
|
|
199
|
+
}
|
|
200
|
+
for (const docs of withOthers(addDocsMcpEntryIfAbsent(repoRoot, agents))) {
|
|
201
|
+
if (docs.added) written.add(docs.path);
|
|
202
|
+
else kept.push(`${docs.path} (already has an ${DOCS_MCP_SERVER_NAME} server)`);
|
|
203
|
+
}
|
|
199
204
|
} catch (err) {
|
|
200
205
|
problems.push(errorMessage(err));
|
|
201
206
|
}
|
|
202
207
|
let linkNote = "";
|
|
203
208
|
if (skillsLink) {
|
|
204
|
-
const link =
|
|
205
|
-
if (link.status === "linked") written.add(
|
|
206
|
-
linkNote = describeSkillsLink(link);
|
|
209
|
+
const link = linkAgentSkills(repoRoot, agents);
|
|
210
|
+
if (link.status === "linked") for (const folder of link.folders ?? [link.folder ?? legacyAgent(agents).descriptor.context.repoSkillFolders[0]]) written.add(folder);
|
|
211
|
+
linkNote = describeSkillsLink(link, agents);
|
|
207
212
|
}
|
|
208
213
|
if (problems.length > 0) return failed(problems.join("; "), written, kept);
|
|
209
214
|
const paths = [...written].sort();
|
|
@@ -212,7 +217,7 @@ function runAgentsMdSetup(repoRoot, skillsLink) {
|
|
|
212
217
|
renderPaths(paths, kept).trimEnd()
|
|
213
218
|
];
|
|
214
219
|
if (linkNote !== "") lines.push(` ${linkNote}`);
|
|
215
|
-
if (paths.length > 0) lines.push(` ${C.dim}Commit AGENTS.md, .agents/
|
|
220
|
+
if (paths.length > 0) lines.push(` ${C.dim}Commit ${listWithAnd(["AGENTS.md", ".agents/", ...mcpFiles(agents)])} with .outerlayer/. Nothing is generated, so there is no emit step.${C.reset}`);
|
|
216
221
|
return {
|
|
217
222
|
outcome: "done",
|
|
218
223
|
reason: paths.length === 0 ? "already set up" : `${paths.length} files written`,
|
|
@@ -231,6 +236,9 @@ function writtenBeforeFailure(repoRoot, pending, keep) {
|
|
|
231
236
|
return [];
|
|
232
237
|
}
|
|
233
238
|
}
|
|
239
|
+
function withOthers(result) {
|
|
240
|
+
return [result, ...result.others ?? []];
|
|
241
|
+
}
|
|
234
242
|
function failed(reason, written, kept, keptPaths = []) {
|
|
235
243
|
const paths = [...written].sort();
|
|
236
244
|
return {
|
|
@@ -255,15 +263,16 @@ function renderPaths(paths, kept) {
|
|
|
255
263
|
return `${lines.join("\n")}
|
|
256
264
|
`;
|
|
257
265
|
}
|
|
258
|
-
function renderDone(paths, kept, mcpKept) {
|
|
259
|
-
const
|
|
266
|
+
function renderDone(paths, kept, mcpKept, agents) {
|
|
267
|
+
const files = mcpFiles(agents).join(", ");
|
|
268
|
+
const mcpNote = mcpKept ? ` ${C.yellow}!${C.reset} The outerlayer and ${DOCS_MCP_SERVER_NAME} entries were not added to ${files}, so their MCP servers are not set up. Add them to ${files} by hand, or move the servers you wrote into .outerlayer/mcp.json and run \`${cliInvocation()} context emit\`.
|
|
260
269
|
` : "";
|
|
261
270
|
const what = mcpKept ? "the OuterLayer skills" : "the OuterLayer skills and MCP servers";
|
|
262
271
|
if (paths.length === 0) {
|
|
263
272
|
return `${C.green}\u2713${C.reset} Agent setup: already in place, nothing changed
|
|
264
273
|
${renderPaths(paths, kept)}${mcpNote}`;
|
|
265
274
|
}
|
|
266
|
-
return `${C.green}\u2713${C.reset} Agent setup:
|
|
275
|
+
return `${C.green}\u2713${C.reset} Agent setup: ${agentLabels(agents)} has ${what}
|
|
267
276
|
` + renderPaths(paths, kept) + mcpNote + ` ${C.dim}\`context emit\` compiled every source under .outerlayer/ for the targets in ${CONFIG_PATH}, not only the skills.${C.reset}
|
|
268
277
|
`;
|
|
269
278
|
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
|
-
import { toolsDockerfile } from './chunk-
|
|
4
|
-
import { claimPidFile, RunnerAlreadyRunningError, releasePidFile } from './chunk-
|
|
3
|
+
import { toolsDockerfile } from './chunk-3FSKTGM6.js';
|
|
4
|
+
import { claimPidFile, RunnerAlreadyRunningError, releasePidFile } from './chunk-XE3DIJJT.js';
|
|
5
5
|
import { startTimeOf } from './chunk-JBJTC3UU.js';
|
|
6
|
-
import { runnerLabelValue } from './chunk-
|
|
7
|
-
import { RecipeError, locateRecipe, readRecipe, assertBuildable, writeSanitizedRecipe, classifyProperties, SANITIZED_NAME } from './chunk-
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
6
|
+
import { runnerLabelValue } from './chunk-C3JWWPLC.js';
|
|
7
|
+
import { RecipeError, locateRecipe, readRecipe, assertBuildable, writeSanitizedRecipe, classifyProperties, SANITIZED_NAME } from './chunk-A5Y2HBVU.js';
|
|
8
|
+
import { RUNNER_DIR_MODE, RUNNER_FILE_MODE, repoCacheDir, imagesDir, imageBuildLogsDir, attemptStamp, orgStore, rootfsPathFor } from './chunk-GD6KIHOS.js';
|
|
9
|
+
import { withGitConfig, tokenHeader } from './chunk-M2NIHHQI.js';
|
|
10
|
+
import { UNIVERSAL_IMAGE_DIGEST, UNIVERSAL_IMAGE_REPOSITORY, UNIVERSAL_IMAGE_SOURCE, buildAgentPin, NODE_IMAGE, UNIVERSAL_IMAGE, MEDIA_PINS, TINI_VERSION, GH_VERSION } from './chunk-J7Y3PCO2.js';
|
|
11
11
|
import { mkdirSync, rmSync, writeFileSync, existsSync, mkdtempSync, cpSync, readFileSync, readdirSync, lstatSync, readlinkSync } from 'fs';
|
|
12
12
|
import { tmpdir } from 'os';
|
|
13
13
|
import { dirname, join } from 'path';
|
|
@@ -308,7 +308,7 @@ async function prepareImageBuild(opts) {
|
|
|
308
308
|
throw new Error(`${opts.cli.distDir} holds no index.js: the tools layer copies the built CLI, so run this from a build (yarn workspace @outerlayer/cli build)`);
|
|
309
309
|
}
|
|
310
310
|
const now = opts.now ?? (() => /* @__PURE__ */ new Date());
|
|
311
|
-
const
|
|
311
|
+
const agentVersion = opts.claudeCodeVersion ?? buildAgentPin();
|
|
312
312
|
const nodeImage = opts.nodeImage ?? NODE_IMAGE;
|
|
313
313
|
const organizationId = opts.organizationId;
|
|
314
314
|
const cacheDir = repoCacheDir(opts.configPath, owner, name, organizationId);
|
|
@@ -354,7 +354,7 @@ async function prepareImageBuild(opts) {
|
|
|
354
354
|
releaseShared = () => releasePidFile(sharedLock, self);
|
|
355
355
|
}
|
|
356
356
|
const rKey = recipeKey(checkout.dir, location, UNIVERSAL_IMAGE);
|
|
357
|
-
const tKey = toolsKey({ buildId: opts.cli.buildId, claudeCodeVersion, nodeImage, ghVersion: GH_VERSION, tiniVersion: TINI_VERSION, guestHelperSha256: opts.guestHelper?.sha256, mediaPins: MEDIA_PINS });
|
|
357
|
+
const tKey = toolsKey({ buildId: opts.cli.buildId, claudeCodeVersion: agentVersion, nodeImage, ghVersion: GH_VERSION, tiniVersion: TINI_VERSION, guestHelperSha256: opts.guestHelper?.sha256, mediaPins: MEDIA_PINS });
|
|
358
358
|
const recordDir = join(records, `${rKey.slice(0, KEY_PREFIX)}-${tKey.slice(0, KEY_PREFIX)}`);
|
|
359
359
|
return {
|
|
360
360
|
repository,
|
|
@@ -369,7 +369,7 @@ async function prepareImageBuild(opts) {
|
|
|
369
369
|
recipe,
|
|
370
370
|
recipeKey: rKey,
|
|
371
371
|
toolsKey: tKey,
|
|
372
|
-
|
|
372
|
+
agentVersion,
|
|
373
373
|
nodeImage,
|
|
374
374
|
logPath,
|
|
375
375
|
release
|
|
@@ -384,7 +384,7 @@ async function buildRepositoryImage(opts, ports) {
|
|
|
384
384
|
const now = opts.now ?? (() => /* @__PURE__ */ new Date());
|
|
385
385
|
const scratchRoot = opts.tmpDir ?? tmpdir();
|
|
386
386
|
const prepared = await prepareImageBuild(opts);
|
|
387
|
-
const { repository, repoRecords, imageRepository, tagName, checkout, location, recipe, recipeKey: rKey, toolsKey: tKey,
|
|
387
|
+
const { repository, repoRecords, imageRepository, tagName, checkout, location, recipe, recipeKey: rKey, toolsKey: tKey, agentVersion, nodeImage, recordDir, logPath } = prepared;
|
|
388
388
|
const universal = location.kind === "default";
|
|
389
389
|
const runnerLabel = runnerLabelValue(opts.configPath);
|
|
390
390
|
const buildTag = `${TAG_HOST}/build/${tagName}:${rKey.slice(0, KEY_PREFIX)}-${tKey.slice(0, KEY_PREFIX)}`;
|
|
@@ -459,7 +459,7 @@ async function buildRepositoryImage(opts, ports) {
|
|
|
459
459
|
const dockerfile = toolsDockerfile({
|
|
460
460
|
recipeImage: universal ? UNIVERSAL_IMAGE : recipeTag,
|
|
461
461
|
nodeImage,
|
|
462
|
-
claudeCodeVersion,
|
|
462
|
+
claudeCodeVersion: agentVersion,
|
|
463
463
|
buildId: opts.cli.buildId,
|
|
464
464
|
guestHelper: opts.guestHelper !== void 0
|
|
465
465
|
});
|