@outerlayer/cli 0.36.0-next.20261101174803 → 0.36.0-next.20261102135508
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-Q3HDN23U.js +39 -0
- package/dist/agent-subcommand-Z6SOLWZW.js +25 -0
- package/dist/bridge-4KPODDN7.js +15 -0
- package/dist/build-KYXFZQ33.js +23 -0
- package/dist/build-disk-W6AL5WHI.js +20 -0
- package/dist/build-info.json +1 -1
- package/dist/builder-IMNOEYV7.js +19 -0
- package/dist/caller-NLRE272L.js +22 -0
- package/dist/{check-K4RVAP4L.js → check-WWX32IGY.js} +78 -74
- package/dist/{chunk-MKSZHT6S.js → chunk-2YC3TXWX.js} +1 -1
- package/dist/{chunk-QIOTIQWD.js → chunk-3UFX6KH2.js} +12 -11
- package/dist/{chunk-F2LPX2HS.js → chunk-3YEPLVNW.js} +8 -8
- package/dist/chunk-4DLJ343I.js +38 -0
- package/dist/{chunk-5WYT3PPE.js → chunk-4OD45RBP.js} +4 -1
- package/dist/{chunk-H7SKHAUE.js → chunk-4XXBV37R.js} +6 -6
- package/dist/{chunk-XNBUZGRO.js → chunk-6B3V6EGQ.js} +11 -9
- package/dist/{chunk-O36YAH2G.js → chunk-6HDXRDC5.js} +4 -4
- package/dist/chunk-6JLYU322.js +68 -0
- package/dist/{chunk-5GHJFETA.js → chunk-6KH3NMIT.js} +3010 -1196
- package/dist/{chunk-SPXVFFQV.js → chunk-AQE6E54X.js} +10 -9
- package/dist/{chunk-LGV5N5DG.js → chunk-ATKCHMFD.js} +1 -1
- package/dist/{chunk-7J7HRYZ3.js → chunk-B2P72DAE.js} +1 -1
- package/dist/{chunk-LEHBDEUG.js → chunk-B36NSEUM.js} +4 -5
- package/dist/{chunk-B62TYDP2.js → chunk-B5SWBFVE.js} +5 -4
- package/dist/chunk-BSPJI5T7.js +28 -0
- package/dist/{chunk-VJYSPH2J.js → chunk-BUYXEU7J.js} +26 -21
- package/dist/{chunk-CIUD3436.js → chunk-BZSJ77MO.js} +1 -1
- package/dist/{chunk-OEBFKPHK.js → chunk-CDG475ZP.js} +11 -11
- package/dist/{chunk-AGKQEOFS.js → chunk-CSBW4LGL.js} +54 -31
- package/dist/{chunk-D2OTBS47.js → chunk-CSVJGW3I.js} +2 -2
- package/dist/{chunk-GANAOCHR.js → chunk-CXJC3JLN.js} +25 -374
- package/dist/{chunk-WAZJPDR2.js → chunk-D4VGJQY7.js} +1 -1
- package/dist/{chunk-BRUDBWLO.js → chunk-D5I5SSPU.js} +7 -7
- package/dist/{chunk-KFUDKFEH.js → chunk-D6EXW4EB.js} +45 -19
- package/dist/{chunk-AF6DQJ5W.js → chunk-DG3M5DZU.js} +1 -1
- package/dist/{chunk-WT7J2627.js → chunk-DTCTXDJP.js} +1 -1
- package/dist/chunk-DTQPDMHG.js +654 -0
- package/dist/{chunk-EZRAR5YG.js → chunk-E3TP4QTM.js} +1 -1
- package/dist/{chunk-NFZJ5XHP.js → chunk-ENBOAE2W.js} +33 -32
- package/dist/{chunk-R3252UTU.js → chunk-ENMX3VQ7.js} +7 -7
- package/dist/{chunk-AH6634HC.js → chunk-FOSYM7TQ.js} +1 -2
- package/dist/{chunk-HL7UNTXO.js → chunk-FRMAQ3C4.js} +17 -10
- package/dist/{chunk-HAWPG7QW.js → chunk-FTP7SE6Y.js} +3 -3
- package/dist/{chunk-IP7BIBXJ.js → chunk-FWSVWPMS.js} +16 -7
- package/dist/{chunk-GLUQVET2.js → chunk-GFZ7PELR.js} +6 -6
- package/dist/{chunk-UZGQT6OF.js → chunk-H2NJG3TE.js} +6 -3
- package/dist/{chunk-46OBCATR.js → chunk-HRHWA6TZ.js} +1 -1
- package/dist/chunk-HTRDL42C.js +45 -0
- package/dist/{chunk-YBAVN6WS.js → chunk-I4DM7SNX.js} +7 -7
- package/dist/{chunk-24FEVLX7.js → chunk-I6U6QPN6.js} +1311 -73
- package/dist/{chunk-4DJZSNVT.js → chunk-IKFAJTLZ.js} +1 -1
- package/dist/{chunk-55PYF6S2.js → chunk-J2OMKFYB.js} +3 -3
- package/dist/{chunk-7Y5VW4JG.js → chunk-K2G3VB7W.js} +1 -1
- package/dist/chunk-K7N6LAPC.js +78 -0
- package/dist/{chunk-ULBVE7MP.js → chunk-KRCU66AM.js} +9 -9
- package/dist/{chunk-JU3VU42K.js → chunk-LHHDX7FB.js} +5 -5
- package/dist/{chunk-FUJUFLDC.js → chunk-LO4CK734.js} +8 -14
- package/dist/chunk-LSLK4RS4.js +82 -0
- package/dist/{chunk-ABAVN4RT.js → chunk-LSZUTI6O.js} +29 -26
- package/dist/chunk-MVPOYQQY.js +136 -0
- package/dist/{chunk-YQHEJ5SV.js → chunk-NXQK2I3G.js} +3 -3
- package/dist/{chunk-DJMR4YPG.js → chunk-O3MJAHLI.js} +82 -96
- package/dist/{chunk-B7PYT2BY.js → chunk-PBGNX3PS.js} +6 -3
- package/dist/{chunk-CJJDJ7AT.js → chunk-PIZA7OG2.js} +5 -3
- package/dist/{chunk-RIHB3HA2.js → chunk-PMA67TIN.js} +3 -3
- package/dist/{chunk-DJDTL6AY.js → chunk-QKOJ22OV.js} +148 -293
- package/dist/{chunk-RDWKRG4K.js → chunk-RF4JHGGB.js} +7 -7
- package/dist/{chunk-MOOZJRKM.js → chunk-SJJXDU2J.js} +27 -30
- package/dist/chunk-T5QBWM6M.js +113 -0
- package/dist/{chunk-W7I65BKE.js → chunk-TJIFYV2Z.js} +12 -12
- package/dist/{chunk-EBOQU6QC.js → chunk-TKY3SDXH.js} +6 -6
- package/dist/{chunk-ALEUIS35.js → chunk-ULBYRPAP.js} +1 -1
- package/dist/{chunk-ZP7F3OHV.js → chunk-URHS76GV.js} +48 -38
- package/dist/{chunk-X2XTCGUS.js → chunk-VAYVTUU4.js} +11 -12
- package/dist/{chunk-TSYHUUAT.js → chunk-VUH7KKVD.js} +3 -3
- package/dist/{chunk-RIIPBJK6.js → chunk-WACPWYMH.js} +4 -4
- package/dist/{chunk-AAGU5FJF.js → chunk-WGC7UFRM.js} +1 -1
- package/dist/{chunk-2SRQSGPR.js → chunk-WVAXJOWG.js} +30 -24
- package/dist/{chunk-KLXECBIE.js → chunk-XEWG4AB2.js} +151 -108
- package/dist/{chunk-KDK6AF7B.js → chunk-XIDDJSQU.js} +7 -6
- package/dist/{chunk-MXIFRYLA.js → chunk-Y4E7IS7H.js} +2 -2
- package/dist/{chunk-DHFNBNC3.js → chunk-YJQ7YA7J.js} +5 -5
- package/dist/{chunk-6A2GEFN3.js → chunk-YMVRCSKD.js} +4 -4
- package/dist/{chunk-JW5BENE6.js → chunk-YYQ5NOT5.js} +3 -3
- package/dist/chunk-ZHQC43NH.js +130 -0
- package/dist/{chunk-KB5B6ZT5.js → chunk-ZSRMJOAK.js} +20 -20
- package/dist/{claude-launcher-L77BKZOC.js → claude-launcher-LGKJZH33.js} +99 -120
- package/dist/{cli-QQY5UECM.js → cli-Q5L64EEG.js} +327 -298
- package/dist/{cli-update-notice-T3CXRWNB.js → cli-update-notice-AWYJ4A7R.js} +2 -2
- package/dist/{command-QLHQZ32L.js → command-CGEFJZNC.js} +65 -64
- package/dist/{config-5GY7FL35.js → config-T22KVOOT.js} +14 -10
- package/dist/connect-cmd-RUBP466E.js +28 -0
- package/dist/{container-start-OCJODSMB.js → container-start-JRF3SBUA.js} +65 -62
- package/dist/{context-cleanup-A7KBEBIO.js → context-cleanup-3K2AOECJ.js} +6 -2
- package/dist/{context-show-cmd-MZ74ZIVO.js → context-show-cmd-4UXO5WQJ.js} +18 -16
- package/dist/{control-plane-launch-3TZFOSCX.js → control-plane-launch-AAH4YH56.js} +31 -27
- package/dist/{demo-record-cmd-Y57UWBCX.js → demo-record-cmd-2OKCGST7.js} +10 -5
- package/dist/{demo-voice-cmd-4INIOVTC.js → demo-voice-cmd-GEPX7GIG.js} +27 -27
- package/dist/{dist-6KGTCWKR.js → dist-VVZIGSAF.js} +1 -1
- package/dist/docker-5VWK335X.js +19 -0
- package/dist/{doctor-DB2AJUAO.js → doctor-EQM3JRZI.js} +81 -76
- package/dist/emit-artifact-cmd-TA3MPHLU.js +43 -0
- package/dist/{emit-cmd-IOWTTZSA.js → emit-cmd-RO4L4PFZ.js} +9 -8
- package/dist/emit-criteria-cmd-NMTUV2KM.js +34 -0
- package/dist/emit-demo-cmd-Y2Y6LEL7.js +46 -0
- package/dist/{emit-finding-cmd-KQIGM5IF.js → emit-finding-cmd-VECM64UR.js} +20 -19
- package/dist/{emit-result-cmd-6Q7OU2NY.js → emit-result-cmd-2ERWFDUN.js} +25 -24
- package/dist/{emit-step-cmd-GZU5O2FR.js → emit-step-cmd-V2ET66N4.js} +20 -19
- package/dist/exec-client-54XKNPTI.js +16 -0
- package/dist/find-unit-CNAPU7XQ.js +23 -0
- package/dist/{findings-cmd-T7PQAVJG.js → findings-cmd-QJPPF6BY.js} +20 -19
- package/dist/{fleet-readiness-PTMOEX6L.js → fleet-readiness-DKAPHAZN.js} +16 -15
- package/dist/governing-source-7PZ6DAJU.js +40 -0
- package/dist/guest-init-5QZRGP62.js +18 -0
- package/dist/{hook-fast-RW7RU3O6.js → hook-fast-VXROB4KF.js} +7 -5
- package/dist/hook-install-GDNRMML4.js +14 -0
- package/dist/{hook-wrap-fast-545QJSBJ.js → hook-wrap-fast-LWWKKPGK.js} +4 -2
- package/dist/host-checks-WAPO5X7X.js +78 -0
- package/dist/host-key-HLLV37NV.js +16 -0
- package/dist/image-tag-PBWQBATH.js +17 -0
- package/dist/index.js +8 -9
- package/dist/init-EK3PUU6W.js +78 -0
- package/dist/{init-HUQLVUPO.js → init-Y2URPVVY.js} +62 -59
- package/dist/{init-cmd-6NQGBVAJ.js → init-cmd-XNANUDIW.js} +38 -33
- package/dist/{init-update-MA6QKX46.js → init-update-EFCTKF6D.js} +55 -46
- package/dist/install-cmd-RHFUZFV4.js +19 -0
- package/dist/layout-7XMC7S6K.js +13 -0
- package/dist/{logs-FEITSC2V.js → logs-E7MGQINH.js} +10 -3
- package/dist/loop-L6TX6OR4.js +89 -0
- package/dist/machine-VJKAY2GX.js +78 -0
- package/dist/{machine-skills-237PQFRC.js → machine-skills-HR4RNRNR.js} +5 -4
- package/dist/{mcp-install-cmd-23ZY4IBK.js → mcp-install-cmd-SMPLT43Q.js} +7 -1
- package/dist/{mcp-serve-cmd-ZINYSLY6.js → mcp-serve-cmd-XXERT673.js} +11 -7
- package/dist/{paths-XEYE7OZ2.js → paths-F2ZR2EKC.js} +10 -3
- package/dist/pending-VOFQRXP4.js +16 -0
- package/dist/pidfile-7M7O2M7T.js +17 -0
- package/dist/record-YCJ6DZOY.js +16 -0
- package/dist/{relay-IEYNSKAZ.js → relay-I2T43PPB.js} +8 -1
- package/dist/relay-protocol-GI2GC2AM.js +13 -0
- package/dist/runner-env-YW55JVU7.js +23 -0
- package/dist/runner-identity-Y5ZFCC7V.js +19 -0
- package/dist/{runner-key-CFZ47PR3.js → runner-key-R47C6374.js} +54 -54
- package/dist/session-sender-UPACLRGG.js +43 -0
- package/dist/{shell-function-NRD4KVUK.js → shell-function-GYD2ZQQG.js} +2 -1
- package/dist/{spec-cmd-CNASSB6L.js → spec-cmd-7QRE2SZK.js} +21 -20
- package/dist/{starter-pack-CCVIEY72.js → starter-pack-IMKIUA56.js} +7 -6
- package/dist/state-VAHBIMS5.js +16 -0
- package/dist/{status-VNHIHQ57.js → status-BQEYEG2V.js} +54 -54
- package/dist/{statusline-fast-E7RWVREA.js → statusline-fast-NUVHCNRX.js} +4 -2
- package/dist/{sync-cmd-5JLJBODH.js → sync-cmd-NBLYEPQG.js} +25 -24
- package/dist/update-steps-VGKNGWTZ.js +79 -0
- package/dist/{watch-AEWWTUEK.js → watch-IHV4V3HZ.js} +25 -24
- package/dist/{work-claim-cmd-GUYOJYH7.js → work-claim-cmd-WGTSU5IT.js} +24 -24
- package/dist/{work-cmd-YRPYMGII.js → work-cmd-HKOJU5FJ.js} +18 -17
- package/dist/{work-comment-cmd-U5Z6FKEU.js → work-comment-cmd-H3JCWQ2J.js} +21 -20
- package/dist/{work-demo-cmd-OLCWTVWM.js → work-demo-cmd-J4AZAIVP.js} +18 -17
- package/dist/{work-launch-TTGSHLY4.js → work-launch-LWDQXLGI.js} +1 -1
- package/dist/{work-logs-cmd-2OA7ENDU.js → work-logs-cmd-UOO4JVLG.js} +18 -17
- package/dist/{work-open-pr-cmd-6GUCDYVM.js → work-open-pr-cmd-QFRDDBAM.js} +20 -19
- package/dist/{work-pr-cmd-KK3VQUQI.js → work-pr-cmd-3Q2D5RQT.js} +19 -18
- package/dist/{work-proofs-cmd-BUOS5OJC.js → work-proofs-cmd-7Y3HGT7C.js} +21 -20
- package/dist/{work-proofs-record-6WLMOK53.js → work-proofs-record-QPUM6DY4.js} +31 -31
- package/dist/{work-stop-cmd-VZJX5X4L.js → work-stop-cmd-SD2ZRMSY.js} +18 -17
- 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-KYDEBGJG.js +0 -402
- 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/emit-artifact-cmd-H27MFSKH.js +0 -42
- package/dist/emit-criteria-cmd-IOUVMB2Q.js +0 -33
- package/dist/emit-demo-cmd-WJSS7KU2.js +0 -46
- package/dist/exec-client-FGGPQSYQ.js +0 -9
- package/dist/find-unit-PRZIFBIK.js +0 -19
- package/dist/governing-source-CND5ZZC3.js +0 -39
- 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/image-tag-WBD57QBN.js +0 -10
- package/dist/init-ILTX4V56.js +0 -78
- package/dist/install-cmd-JKPXIOEY.js +0 -12
- package/dist/layout-2ZMCT2D3.js +0 -11
- 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/relay-protocol-5LSWUJCW.js +0 -6
- package/dist/runner-env-W2UMHY7P.js +0 -19
- package/dist/runner-identity-IIY5UJL3.js +0 -14
- package/dist/session-sender-NO4F2IQ5.js +0 -42
- package/dist/settings-XB2HYBKO.js +0 -7
- 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,23 +1,30 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
3
|
+
import { withInjectedPrograms } from './chunk-4DLJ343I.js';
|
|
4
|
+
import { sharedSkillNames } from './chunk-6JLYU322.js';
|
|
5
|
+
import { GOVERNANCE_VARIABLE, versionAtLeast, CONTROL_PLANE_DIR_VARIABLE } from './chunk-BSPJI5T7.js';
|
|
6
6
|
import { findGitDirs } from './chunk-BJ3KTMDH.js';
|
|
7
|
-
import { setupMachineSkills } from './chunk-
|
|
8
|
-
import './chunk-
|
|
7
|
+
import { setupMachineSkills } from './chunk-LSZUTI6O.js';
|
|
8
|
+
import { defaultAgents, agentById, legacyAgent } from './chunk-I6U6QPN6.js';
|
|
9
|
+
import './chunk-WUKLQWGY.js';
|
|
10
|
+
import './chunk-T5QBWM6M.js';
|
|
11
|
+
import { LEGACY_AGENT } from './chunk-LSLK4RS4.js';
|
|
9
12
|
import './chunk-CDDED64E.js';
|
|
10
13
|
import './chunk-RA3O54FC.js';
|
|
11
|
-
import './chunk-24FEVLX7.js';
|
|
12
|
-
import './chunk-WUKLQWGY.js';
|
|
13
14
|
import { homeFromEnv } from './chunk-352DHUTP.js';
|
|
14
15
|
import './chunk-Z5GEFMRW.js';
|
|
15
|
-
import { spawn, execFileSync
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
16
|
+
import { spawn, execFileSync } from 'child_process';
|
|
17
|
+
import { existsSync, readdirSync, lstatSync, readFileSync, writeFileSync, rmSync, mkdirSync, realpathSync, symlinkSync, renameSync, readlinkSync, statSync } from 'fs';
|
|
18
|
+
import { delimiter, join, isAbsolute, resolve, dirname, basename } from 'path';
|
|
18
19
|
import { createHash, randomBytes } from 'crypto';
|
|
19
20
|
|
|
20
21
|
createRequire(import.meta.url);
|
|
22
|
+
function under(base, folder) {
|
|
23
|
+
return join(base, ...folder.split("/"));
|
|
24
|
+
}
|
|
25
|
+
function skillFolderOf(agents) {
|
|
26
|
+
return legacyAgent(agents).descriptor.context.repoSkillFolders[0];
|
|
27
|
+
}
|
|
21
28
|
function ownSkillsRoot(home) {
|
|
22
29
|
return join(home, ".outerlayer", "context", "own");
|
|
23
30
|
}
|
|
@@ -34,8 +41,8 @@ function folderNames(dir) {
|
|
|
34
41
|
return [];
|
|
35
42
|
}
|
|
36
43
|
}
|
|
37
|
-
function wantedLinks(repoRoot, shared) {
|
|
38
|
-
const provided = new Set(folderNames(
|
|
44
|
+
function wantedLinks(repoRoot, shared, agents) {
|
|
45
|
+
const provided = new Set(folderNames(under(repoRoot, skillFolderOf(agents))));
|
|
39
46
|
const wanted = /* @__PURE__ */ new Map();
|
|
40
47
|
for (const name of folderNames(join(repoRoot, ".agents", "skills")).sort()) {
|
|
41
48
|
if (provided.has(name) || shared.has(name)) continue;
|
|
@@ -43,8 +50,8 @@ function wantedLinks(repoRoot, shared) {
|
|
|
43
50
|
}
|
|
44
51
|
return wanted;
|
|
45
52
|
}
|
|
46
|
-
function holdsLinks(dir, wanted) {
|
|
47
|
-
const skills =
|
|
53
|
+
function holdsLinks(dir, wanted, agents) {
|
|
54
|
+
const skills = under(dir, skillFolderOf(agents));
|
|
48
55
|
let names;
|
|
49
56
|
try {
|
|
50
57
|
names = readdirSync(skills);
|
|
@@ -74,8 +81,8 @@ function removeMovedAside(path) {
|
|
|
74
81
|
}
|
|
75
82
|
}
|
|
76
83
|
}
|
|
77
|
-
function ensureOwnSkillsDir(input) {
|
|
78
|
-
const wanted = wantedLinks(input.repoRoot, new Set(input.shared));
|
|
84
|
+
function ensureOwnSkillsDir(input, agents = defaultAgents()) {
|
|
85
|
+
const wanted = wantedLinks(input.repoRoot, new Set(input.shared), agents);
|
|
79
86
|
if (wanted.size === 0) return void 0;
|
|
80
87
|
const root = ownSkillsRoot(input.home);
|
|
81
88
|
mkdirSync(root, { recursive: true });
|
|
@@ -89,13 +96,13 @@ function ensureOwnSkillsDir(input) {
|
|
|
89
96
|
`);
|
|
90
97
|
renameSync(temporary2, record);
|
|
91
98
|
};
|
|
92
|
-
if (holdsLinks(final, wanted)) {
|
|
99
|
+
if (holdsLinks(final, wanted, agents)) {
|
|
93
100
|
if (!existsSync(record)) writeRecord();
|
|
94
101
|
return final;
|
|
95
102
|
}
|
|
96
103
|
const temporary = join(root, `.tmp-${randomBytes(6).toString("hex")}`);
|
|
97
|
-
mkdirSync(
|
|
98
|
-
for (const [name, target] of wanted) symlinkSync(target, join(temporary,
|
|
104
|
+
mkdirSync(under(temporary, skillFolderOf(agents)), { recursive: true });
|
|
105
|
+
for (const [name, target] of wanted) symlinkSync(target, join(under(temporary, skillFolderOf(agents)), name));
|
|
99
106
|
try {
|
|
100
107
|
for (let attempt = 0; attempt < REPLACE_ATTEMPTS; attempt += 1) {
|
|
101
108
|
try {
|
|
@@ -103,7 +110,7 @@ function ensureOwnSkillsDir(input) {
|
|
|
103
110
|
writeRecord();
|
|
104
111
|
return final;
|
|
105
112
|
} catch {
|
|
106
|
-
if (holdsLinks(final, wanted)) {
|
|
113
|
+
if (holdsLinks(final, wanted, agents)) {
|
|
107
114
|
writeRecord();
|
|
108
115
|
return final;
|
|
109
116
|
}
|
|
@@ -153,6 +160,11 @@ function removeStaleOwnSkillsDirs(home, now = Date.now()) {
|
|
|
153
160
|
}
|
|
154
161
|
}
|
|
155
162
|
|
|
163
|
+
// src/legacy-launcher.ts
|
|
164
|
+
function runClaudeLauncher(args, deps = {}) {
|
|
165
|
+
return runAgentLauncher(LEGACY_AGENT, args, deps);
|
|
166
|
+
}
|
|
167
|
+
|
|
156
168
|
// src/claude-launcher.ts
|
|
157
169
|
function readDeliveryRecord(cwd) {
|
|
158
170
|
let common;
|
|
@@ -172,24 +184,10 @@ function readDeliveryRecord(cwd) {
|
|
|
172
184
|
}
|
|
173
185
|
return { kind: "invalid", path };
|
|
174
186
|
}
|
|
175
|
-
function findClaude(path) {
|
|
176
|
-
for (const entry of (path ?? "").split(delimiter)) {
|
|
177
|
-
if (entry === "") continue;
|
|
178
|
-
const candidate = join(entry, "claude");
|
|
179
|
-
try {
|
|
180
|
-
accessSync(candidate, constants.X_OK);
|
|
181
|
-
if (statSync(candidate).size === Buffer.byteLength(SHIM_SCRIPT) && readFileSync(candidate, "utf8") === SHIM_SCRIPT) continue;
|
|
182
|
-
} catch {
|
|
183
|
-
continue;
|
|
184
|
-
}
|
|
185
|
-
return candidate;
|
|
186
|
-
}
|
|
187
|
-
return void 0;
|
|
188
|
-
}
|
|
189
187
|
var SIGNALS = ["SIGINT", "SIGTERM", "SIGHUP"];
|
|
190
188
|
var SIGNAL_NUMBERS = { SIGHUP: 1, SIGINT: 2, SIGTERM: 15 };
|
|
191
|
-
function
|
|
192
|
-
return new Promise((done) => {
|
|
189
|
+
function runWith(prefix) {
|
|
190
|
+
return (program, argv, env, cwd, stderr) => new Promise((done) => {
|
|
193
191
|
const child = spawn(program, argv, { cwd, env, stdio: "inherit" });
|
|
194
192
|
const forward = (signal) => () => {
|
|
195
193
|
child.kill(signal);
|
|
@@ -201,121 +199,109 @@ function run(program, argv, env, cwd, stderr) {
|
|
|
201
199
|
done(code);
|
|
202
200
|
};
|
|
203
201
|
child.on("error", (err) => {
|
|
204
|
-
stderr(
|
|
202
|
+
stderr(`${prefix} could not start ${program}: ${err.message}
|
|
205
203
|
`);
|
|
206
204
|
finish(127);
|
|
207
205
|
});
|
|
208
206
|
child.on("exit", (code, signal) => finish(code ?? 128 + (signal === null ? 0 : SIGNAL_NUMBERS[signal] ?? 0)));
|
|
209
207
|
});
|
|
210
208
|
}
|
|
211
|
-
function ownSkillsDirFor(cwd, home, shared, stderr) {
|
|
209
|
+
function ownSkillsDirFor(prefix, cwd, home, shared, stderr) {
|
|
212
210
|
const root = findGitDirs(cwd)?.repoRoot;
|
|
213
211
|
if (root === void 0) return void 0;
|
|
214
212
|
try {
|
|
215
213
|
return ensureOwnSkillsDir({ home, repoRoot: root, shared });
|
|
216
214
|
} catch (err) {
|
|
217
|
-
stderr(
|
|
215
|
+
stderr(`${prefix} the checkout's .agents/skills/ skills are not attached: ${err instanceof Error ? err.message : String(err)}
|
|
218
216
|
`);
|
|
219
217
|
return void 0;
|
|
220
218
|
}
|
|
221
219
|
}
|
|
222
220
|
var SESSION_ID_VARIABLE = "OUTERLAYER_SESSION_ID";
|
|
223
221
|
var RESUME_SESSION_VARIABLE = "OUTERLAYER_RESUME_SESSION";
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
const named = sessionId !== void 0 && sessionId !== "";
|
|
228
|
-
const resumes = resume !== void 0 && resume !== "";
|
|
229
|
-
if (callerArgs.some((arg) => OWN_SESSION_FLAGS.has(arg)) || !named && !resumes) return { args: [], env: rest };
|
|
230
|
-
return { args: [...resumes ? ["--resume", resume, "--fork-session"] : [], ...named ? ["--session-id", sessionId] : []], env: rest };
|
|
222
|
+
function withoutSessionVariables(env) {
|
|
223
|
+
const { [SESSION_ID_VARIABLE]: _id, [RESUME_SESSION_VARIABLE]: _resume, ...rest } = env;
|
|
224
|
+
return rest;
|
|
231
225
|
}
|
|
232
226
|
var SIGNAL_EXIT = 128;
|
|
233
227
|
async function runWithResumeFallback(input) {
|
|
234
228
|
const code = await input.run(input.resumeArgs);
|
|
235
|
-
if (!input.
|
|
229
|
+
if (!input.resumes || code === 0 || code >= SIGNAL_EXIT || input.hasReply()) return code;
|
|
236
230
|
input.removeTranscript();
|
|
237
231
|
input.writeMarker();
|
|
238
232
|
return input.run(input.freshArgs);
|
|
239
233
|
}
|
|
240
|
-
function
|
|
241
|
-
const
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
const
|
|
250
|
-
|
|
251
|
-
}
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
const entry = JSON.parse(line);
|
|
260
|
-
if (entry.type === "assistant" && typeof entry.timestamp === "string" && Date.parse(entry.timestamp) >= sinceMs) return true;
|
|
261
|
-
}
|
|
262
|
-
} catch {
|
|
263
|
-
}
|
|
264
|
-
return false;
|
|
265
|
-
}
|
|
266
|
-
async function launch(runProgram, claude, front, args, env, cwd, stderr) {
|
|
267
|
-
const session = sessionArgs(env, args);
|
|
268
|
-
const idAt = session.args.indexOf("--session-id");
|
|
269
|
-
const sessionId = idAt === -1 ? void 0 : session.args[idAt + 1];
|
|
270
|
-
const configDir = session.env.CLAUDE_CONFIG_DIR ?? join(homeFromEnv(session.env), ".claude");
|
|
271
|
-
if (sessionId !== void 0 && findTranscript(configDir, sessionId) !== void 0) return runProgram(claude, [...front, ...args], session.env, cwd, stderr);
|
|
272
|
-
const resumeAt = session.args.indexOf("--resume");
|
|
273
|
-
if (resumeAt === -1) return runProgram(claude, [...front, ...session.args, ...args], session.env, cwd, stderr);
|
|
274
|
-
const resumePath = session.args[resumeAt + 1];
|
|
234
|
+
async function start(context, args, env) {
|
|
235
|
+
const { launch, prefix, stderr } = context;
|
|
236
|
+
const session = launch.session;
|
|
237
|
+
const named = session?.args(env, args) ?? { args: [], env: withoutSessionVariables(env) };
|
|
238
|
+
const sessionEnv = named.env;
|
|
239
|
+
const flagged = named.args.length > 0;
|
|
240
|
+
const sessionId = flagged && env[SESSION_ID_VARIABLE] ? env[SESSION_ID_VARIABLE] : void 0;
|
|
241
|
+
const resumePath = flagged && env[RESUME_SESSION_VARIABLE] ? env[RESUME_SESSION_VARIABLE] : void 0;
|
|
242
|
+
const specFor = (flags) => {
|
|
243
|
+
const spec = launch.interactive({ cwd: context.cwd, program: context.program, callerArgs: [...flags, ...args], env: sessionEnv, controlPlane: context.controlPlane, ownSkills: context.ownSkills });
|
|
244
|
+
return context.controlPlane === void 0 ? spec : { ...spec, env: { ...spec.env, [CONTROL_PLANE_DIR_VARIABLE]: context.controlPlane } };
|
|
245
|
+
};
|
|
246
|
+
const run = (flags) => {
|
|
247
|
+
const spec = specFor(flags);
|
|
248
|
+
return context.runProgram(spec.program, [...spec.args], spec.env, context.cwd, stderr);
|
|
249
|
+
};
|
|
250
|
+
if (session === void 0) return run(named.args);
|
|
251
|
+
if (sessionId !== void 0 && session.exists(sessionId, sessionEnv)) return run([]);
|
|
252
|
+
if (resumePath === void 0) return run(named.args);
|
|
275
253
|
const resumeDir = dirname(resumePath);
|
|
276
254
|
const launchedAt = Date.now();
|
|
277
255
|
try {
|
|
278
256
|
writeFileSync(join(resumeDir, "launch.json"), JSON.stringify({ sessionId, resumedFrom: basename(resumePath, ".jsonl"), launchedAt: new Date(launchedAt).toISOString() }));
|
|
279
257
|
} catch (err) {
|
|
280
|
-
stderr(
|
|
258
|
+
stderr(`${prefix} could not record the resume: ${err instanceof Error ? err.message : String(err)}
|
|
281
259
|
`);
|
|
282
260
|
}
|
|
283
|
-
const transcript = () => sessionId === void 0 ? void 0 : findTranscript(configDir, sessionId);
|
|
284
261
|
return runWithResumeFallback({
|
|
285
|
-
run
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
262
|
+
run,
|
|
263
|
+
resumes: true,
|
|
264
|
+
resumeArgs: named.args,
|
|
265
|
+
freshArgs: session.args({ ...env, [RESUME_SESSION_VARIABLE]: void 0 }, args).args,
|
|
266
|
+
hasReply: () => sessionId !== void 0 && session.hasReplySince(sessionId, sessionEnv, launchedAt),
|
|
289
267
|
removeTranscript: () => {
|
|
290
|
-
|
|
291
|
-
if (path !== void 0) rmSync(path, { force: true });
|
|
268
|
+
if (sessionId !== void 0) session.discard(sessionId, sessionEnv);
|
|
292
269
|
},
|
|
293
270
|
writeMarker: () => {
|
|
294
|
-
stderr(
|
|
271
|
+
stderr(`${prefix} the resume failed, so this run starts a fresh session
|
|
272
|
+
`);
|
|
295
273
|
try {
|
|
296
274
|
writeFileSync(join(resumeDir, "failed"), "");
|
|
297
275
|
} catch (err) {
|
|
298
|
-
stderr(
|
|
276
|
+
stderr(`${prefix} could not record the fresh start: ${err instanceof Error ? err.message : String(err)}
|
|
299
277
|
`);
|
|
300
278
|
}
|
|
301
279
|
}
|
|
302
280
|
});
|
|
303
281
|
}
|
|
304
|
-
function
|
|
305
|
-
return spawnSync(claude, ["--version"], { env, encoding: "utf8", timeout: 15e3, stdio: ["ignore", "pipe", "ignore"] }).stdout ?? "";
|
|
306
|
-
}
|
|
307
|
-
async function runClaudeLauncher(args, deps = {}) {
|
|
282
|
+
async function runAgentLauncher(agentId, args, deps = {}) {
|
|
308
283
|
const cwd = deps.cwd ?? process.cwd();
|
|
309
284
|
const env = deps.env ?? process.env;
|
|
310
285
|
const stderr = deps.stderr ?? ((text) => void process.stderr.write(text));
|
|
311
|
-
const
|
|
286
|
+
const agents = withInjectedPrograms(deps.agents ?? defaultAgents(), { version: deps.claudeVersion });
|
|
287
|
+
const agent = agentById(agentId, agents);
|
|
288
|
+
const launch = agent?.adapter.launch;
|
|
289
|
+
if (agent === void 0 || launch === void 0) {
|
|
290
|
+
stderr(`outerlayer: ${agentId} is not an agent that can be started
|
|
291
|
+
`);
|
|
292
|
+
return 1;
|
|
293
|
+
}
|
|
294
|
+
const { descriptor } = agent;
|
|
295
|
+
const prefix = `outerlayer ${descriptor.legacy?.subcommand ?? descriptor.id}:`;
|
|
296
|
+
const runProgram = deps.runProgram ?? runWith(prefix);
|
|
312
297
|
const home = homeFromEnv(env);
|
|
313
298
|
const installed = setupMachineSkills(home);
|
|
314
|
-
for (const failure of installed.failures) stderr(
|
|
299
|
+
for (const failure of installed.failures) stderr(`${prefix} could not write a maintained skill: ${failure}
|
|
300
|
+
`);
|
|
301
|
+
const program = launch.findProgram(env.PATH, delimiter);
|
|
302
|
+
if (program === void 0) {
|
|
303
|
+
stderr(`${prefix} no ${descriptor.program} program found on PATH
|
|
315
304
|
`);
|
|
316
|
-
const claude = findClaude(env.PATH);
|
|
317
|
-
if (claude === void 0) {
|
|
318
|
-
stderr("outerlayer claude: no claude program found on PATH\n");
|
|
319
305
|
return 127;
|
|
320
306
|
}
|
|
321
307
|
try {
|
|
@@ -325,7 +311,7 @@ async function runClaudeLauncher(args, deps = {}) {
|
|
|
325
311
|
const found = readDeliveryRecord(cwd);
|
|
326
312
|
const build = found.kind === "found" && found.record.launcher !== true ? found.record : void 0;
|
|
327
313
|
if (found.kind === "invalid" && env.OUTERLAYER_JOB_DIR !== void 0) {
|
|
328
|
-
stderr(
|
|
314
|
+
stderr(`${prefix} ${found.path} is not a readable delivery record, so the control plane cannot be attached
|
|
329
315
|
`);
|
|
330
316
|
return 1;
|
|
331
317
|
}
|
|
@@ -333,16 +319,16 @@ async function runClaudeLauncher(args, deps = {}) {
|
|
|
333
319
|
if (build !== void 0) {
|
|
334
320
|
dir = build.dir;
|
|
335
321
|
if (!existsSync(dir)) {
|
|
336
|
-
stderr(
|
|
322
|
+
stderr(`${prefix} the control plane of ${build.repository} is not at ${dir}, so it cannot be attached
|
|
337
323
|
`);
|
|
338
324
|
return 1;
|
|
339
325
|
}
|
|
340
326
|
} else {
|
|
341
|
-
const { resolveLaunchPlane } = await import('./control-plane-launch-
|
|
327
|
+
const { resolveLaunchPlane } = await import('./control-plane-launch-AAH4YH56.js');
|
|
342
328
|
const plane = env[GOVERNANCE_VARIABLE] === "self" ? { kind: "none" } : await resolveLaunchPlane({ cwd, env, home, fetchImpl: deps.fetchImpl, stderr });
|
|
343
329
|
if (plane.kind === "none") {
|
|
344
|
-
const own2 = ownSkillsDirFor(cwd, home,
|
|
345
|
-
return
|
|
330
|
+
const own2 = ownSkillsDirFor(prefix, cwd, home, /* @__PURE__ */ new Set(), stderr);
|
|
331
|
+
return start({ prefix, launch, program, ownSkills: own2, runProgram, cwd, stderr }, args, env);
|
|
346
332
|
}
|
|
347
333
|
if (plane.kind === "refused") {
|
|
348
334
|
stderr(plane.message);
|
|
@@ -350,22 +336,15 @@ async function runClaudeLauncher(args, deps = {}) {
|
|
|
350
336
|
}
|
|
351
337
|
dir = plane.dir;
|
|
352
338
|
}
|
|
353
|
-
const
|
|
354
|
-
|
|
355
|
-
|
|
339
|
+
const minimum = descriptor.versions.minimum;
|
|
340
|
+
const reported = launch.version(program, env);
|
|
341
|
+
if (/\d+\.\d+\.\d+/.test(reported) && !versionAtLeast(reported, minimum)) {
|
|
342
|
+
stderr(`${prefix} ${descriptor.label} ${reported.trim().split(/\s+/)[0]} is older than ${minimum}, the oldest version known to load a control plane's instructions for subagents; the minimum version is ${minimum}
|
|
356
343
|
`);
|
|
357
344
|
return 1;
|
|
358
345
|
}
|
|
359
|
-
const own = ownSkillsDirFor(cwd, home, sharedSkillNames(dir), stderr);
|
|
360
|
-
return launch
|
|
361
|
-
runProgram,
|
|
362
|
-
claude,
|
|
363
|
-
["--add-dir", dir, ...own === void 0 ? [] : ["--add-dir", own], "--settings", join(dir, "settings.json")],
|
|
364
|
-
args,
|
|
365
|
-
{ ...env, CLAUDE_CODE_ADDITIONAL_DIRECTORIES_CLAUDE_MD: "1", [CONTROL_PLANE_DIR_VARIABLE]: dir },
|
|
366
|
-
cwd,
|
|
367
|
-
stderr
|
|
368
|
-
);
|
|
346
|
+
const own = ownSkillsDirFor(prefix, cwd, home, sharedSkillNames(dir), stderr);
|
|
347
|
+
return start({ prefix, launch, program, controlPlane: dir, ownSkills: own, runProgram, cwd, stderr }, args, env);
|
|
369
348
|
}
|
|
370
349
|
|
|
371
|
-
export {
|
|
350
|
+
export { runAgentLauncher, runClaudeLauncher, runWith, runWithResumeFallback };
|