@outerlayer/cli 0.36.0-next.20261102124202 → 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-DFG2GTXQ.js → bridge-4KPODDN7.js} +6 -4
- package/dist/{build-THAD3B4Q.js → build-KYXFZQ33.js} +13 -11
- package/dist/{build-disk-HO2VPIBJ.js → build-disk-W6AL5WHI.js} +11 -9
- package/dist/build-info.json +1 -1
- package/dist/{builder-AXJNIF4S.js → builder-IMNOEYV7.js} +10 -8
- package/dist/caller-NLRE272L.js +22 -0
- package/dist/{check-SF2OVZXB.js → check-WWX32IGY.js} +60 -58
- package/dist/{chunk-KN4VIK53.js → chunk-2YC3TXWX.js} +1 -1
- package/dist/{chunk-4TNUQLXH.js → chunk-3UFX6KH2.js} +12 -11
- package/dist/{chunk-5FIOUQGC.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-OYKAOHX5.js → chunk-4XXBV37R.js} +6 -6
- package/dist/{chunk-RSRZDF3K.js → chunk-6B3V6EGQ.js} +11 -9
- package/dist/{chunk-XABJMU5A.js → chunk-6HDXRDC5.js} +2 -2
- package/dist/{chunk-TWYHSMHM.js → chunk-6JLYU322.js} +3 -2
- package/dist/{chunk-5GHJFETA.js → chunk-6KH3NMIT.js} +3010 -1196
- package/dist/{chunk-QJDX6VJS.js → chunk-AQE6E54X.js} +10 -9
- package/dist/{chunk-564Q2STF.js → chunk-ATKCHMFD.js} +1 -1
- package/dist/{chunk-PQDFW422.js → chunk-B2P72DAE.js} +1 -1
- package/dist/{chunk-GZ75FRLB.js → chunk-B36NSEUM.js} +1 -1
- package/dist/{chunk-XHFSBSIA.js → chunk-B5SWBFVE.js} +3 -2
- package/dist/{chunk-NC3QAHOS.js → chunk-BSPJI5T7.js} +4 -2
- package/dist/{chunk-I6FRCBMU.js → chunk-BUYXEU7J.js} +8 -8
- package/dist/{chunk-A5Y2HBVU.js → chunk-BZSJ77MO.js} +1 -1
- package/dist/{chunk-C3JWWPLC.js → chunk-CDG475ZP.js} +8 -7
- package/dist/{chunk-TYCZVJTB.js → chunk-CSBW4LGL.js} +5 -5
- package/dist/{chunk-EUDG754F.js → chunk-CSVJGW3I.js} +2 -2
- package/dist/{chunk-M2NIHHQI.js → chunk-CXJC3JLN.js} +3 -2
- package/dist/{chunk-XE3DIJJT.js → chunk-D4VGJQY7.js} +1 -1
- package/dist/{chunk-PKO5IDW4.js → chunk-D5I5SSPU.js} +7 -7
- package/dist/{chunk-WDQPBAFV.js → chunk-D6EXW4EB.js} +2 -1
- package/dist/{chunk-GSXGA6KF.js → chunk-DG3M5DZU.js} +1 -1
- package/dist/{chunk-GD6KIHOS.js → chunk-DTCTXDJP.js} +1 -1
- package/dist/{chunk-J7Y3PCO2.js → chunk-DTQPDMHG.js} +2 -1
- package/dist/{chunk-PT34C6SU.js → chunk-E3TP4QTM.js} +1 -1
- package/dist/{chunk-NWBB2SQ4.js → chunk-ENBOAE2W.js} +24 -24
- package/dist/{chunk-LSXHTBAM.js → chunk-ENMX3VQ7.js} +7 -7
- package/dist/{chunk-XLOM2BNL.js → chunk-FOSYM7TQ.js} +1 -1
- package/dist/{chunk-4CTVN3C5.js → chunk-FRMAQ3C4.js} +5 -5
- package/dist/{chunk-PTPF36Q7.js → chunk-FTP7SE6Y.js} +3 -3
- package/dist/{chunk-IP7BIBXJ.js → chunk-FWSVWPMS.js} +16 -7
- package/dist/{chunk-K3X3L5YW.js → chunk-GFZ7PELR.js} +6 -6
- package/dist/{chunk-WLMAGMTU.js → chunk-H2NJG3TE.js} +4 -3
- package/dist/{chunk-T5Z22NA6.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-CKPQOQFC.js → chunk-I6U6QPN6.js} +769 -101
- package/dist/{chunk-6JJITHBI.js → chunk-IKFAJTLZ.js} +1 -1
- package/dist/{chunk-FIO6PIZ6.js → chunk-J2OMKFYB.js} +3 -3
- package/dist/{chunk-Q42K6XZ6.js → chunk-K2G3VB7W.js} +1 -1
- package/dist/{chunk-L3JXQDVH.js → chunk-K7N6LAPC.js} +4 -4
- package/dist/{chunk-RK4JQRVT.js → chunk-KRCU66AM.js} +9 -9
- package/dist/{chunk-RPZIHELI.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-I626B72C.js → chunk-LSZUTI6O.js} +1 -1
- package/dist/{chunk-H2FFONRY.js → chunk-MVPOYQQY.js} +1 -1
- package/dist/{chunk-JVCQZDQ6.js → chunk-NXQK2I3G.js} +1 -1
- package/dist/{chunk-EBIYRRJW.js → chunk-O3MJAHLI.js} +80 -94
- package/dist/{chunk-VRQM4A64.js → chunk-PBGNX3PS.js} +1 -1
- package/dist/{chunk-CJJDJ7AT.js → chunk-PIZA7OG2.js} +5 -3
- package/dist/{chunk-772ILTCK.js → chunk-PMA67TIN.js} +3 -3
- package/dist/{chunk-GDZTL6BI.js → chunk-QKOJ22OV.js} +123 -277
- package/dist/{chunk-WNYH42PF.js → chunk-RF4JHGGB.js} +7 -7
- package/dist/{chunk-WQB3XOEP.js → chunk-SJJXDU2J.js} +6 -6
- package/dist/chunk-T5QBWM6M.js +113 -0
- package/dist/{chunk-LYFLUNWK.js → chunk-TJIFYV2Z.js} +7 -7
- package/dist/{chunk-OZOATEK3.js → chunk-TKY3SDXH.js} +6 -6
- package/dist/{chunk-CVGQ3BNF.js → chunk-ULBYRPAP.js} +1 -1
- package/dist/{chunk-LVXR37OG.js → chunk-URHS76GV.js} +9 -8
- package/dist/{chunk-J7TCTARR.js → chunk-VAYVTUU4.js} +5 -5
- package/dist/{chunk-5FND4PIU.js → chunk-VUH7KKVD.js} +3 -3
- package/dist/{chunk-NTMRMBLM.js → chunk-WACPWYMH.js} +4 -4
- package/dist/{chunk-AAGU5FJF.js → chunk-WGC7UFRM.js} +1 -1
- package/dist/{chunk-XAOIHYPS.js → chunk-WVAXJOWG.js} +5 -4
- package/dist/{chunk-6LO62EQ5.js → chunk-XEWG4AB2.js} +28 -28
- package/dist/{chunk-AYLYAOHH.js → chunk-XIDDJSQU.js} +3 -2
- package/dist/{chunk-ESSJPSJ2.js → chunk-Y4E7IS7H.js} +2 -2
- package/dist/{chunk-HIN4BMRW.js → chunk-YJQ7YA7J.js} +5 -5
- package/dist/{chunk-LCOQN6NR.js → chunk-YMVRCSKD.js} +4 -4
- package/dist/{chunk-JXXHLQQR.js → chunk-YYQ5NOT5.js} +3 -3
- package/dist/chunk-ZHQC43NH.js +130 -0
- package/dist/{chunk-3FSKTGM6.js → chunk-ZSRMJOAK.js} +3 -3
- package/dist/{claude-launcher-LXZPTDNC.js → claude-launcher-LGKJZH33.js} +82 -108
- package/dist/{cli-QFUT3UQS.js → cli-Q5L64EEG.js} +323 -293
- package/dist/{command-45RZT4CK.js → command-CGEFJZNC.js} +55 -53
- package/dist/{config-WYQPXLOP.js → config-T22KVOOT.js} +12 -10
- package/dist/{connect-cmd-LUCQ7FSV.js → connect-cmd-RUBP466E.js} +12 -10
- package/dist/{container-start-T776VI3M.js → container-start-JRF3SBUA.js} +53 -51
- package/dist/{context-cleanup-QE2MIO2Q.js → context-cleanup-3K2AOECJ.js} +4 -2
- package/dist/{context-show-cmd-7QEHUOEL.js → context-show-cmd-4UXO5WQJ.js} +13 -11
- package/dist/{control-plane-launch-THUH6YU5.js → control-plane-launch-AAH4YH56.js} +25 -21
- package/dist/{demo-record-cmd-SBERRQNW.js → demo-record-cmd-2OKCGST7.js} +7 -5
- package/dist/{demo-voice-cmd-VM3FITZU.js → demo-voice-cmd-GEPX7GIG.js} +24 -22
- package/dist/{dist-6KGTCWKR.js → dist-VVZIGSAF.js} +1 -1
- package/dist/{docker-MQNLK4OO.js → docker-5VWK335X.js} +10 -8
- package/dist/{doctor-NQOSPJGS.js → doctor-EQM3JRZI.js} +55 -53
- package/dist/emit-artifact-cmd-TA3MPHLU.js +43 -0
- package/dist/{emit-cmd-ZPFCPVSR.js → emit-cmd-RO4L4PFZ.js} +7 -5
- package/dist/emit-criteria-cmd-NMTUV2KM.js +34 -0
- package/dist/{emit-demo-cmd-PMQGNNVX.js → emit-demo-cmd-Y2Y6LEL7.js} +24 -22
- package/dist/{emit-finding-cmd-MYWQN5WW.js → emit-finding-cmd-VECM64UR.js} +17 -15
- package/dist/{emit-result-cmd-GXK3KMAP.js → emit-result-cmd-2ERWFDUN.js} +22 -20
- package/dist/{emit-step-cmd-ZV2XTUVT.js → emit-step-cmd-V2ET66N4.js} +17 -15
- package/dist/{exec-client-P7RFRUCK.js → exec-client-54XKNPTI.js} +7 -5
- package/dist/find-unit-CNAPU7XQ.js +23 -0
- package/dist/{findings-cmd-OGMBVVSM.js → findings-cmd-QJPPF6BY.js} +17 -15
- package/dist/{fleet-readiness-4RBKLXBQ.js → fleet-readiness-DKAPHAZN.js} +13 -11
- package/dist/{governing-source-XJMXFSAR.js → governing-source-7PZ6DAJU.js} +21 -19
- package/dist/{guest-init-XZHRPIMG.js → guest-init-5QZRGP62.js} +8 -6
- package/dist/{hook-fast-ZOWGWCPO.js → hook-fast-VXROB4KF.js} +4 -2
- package/dist/{pending-YU2GE2UV.js → hook-install-GDNRMML4.js} +5 -5
- 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-E4JK2APF.js → image-tag-PBWQBATH.js} +7 -5
- package/dist/index.js +8 -9
- package/dist/init-EK3PUU6W.js +78 -0
- package/dist/{init-LO6U7YTW.js → init-Y2URPVVY.js} +51 -49
- package/dist/{init-cmd-2JANO5EN.js → init-cmd-XNANUDIW.js} +35 -29
- package/dist/{init-update-D6PRTGNE.js → init-update-EFCTKF6D.js} +24 -22
- package/dist/{install-cmd-SJMBNQEH.js → install-cmd-RHFUZFV4.js} +9 -7
- package/dist/{layout-AQHIMJMO.js → layout-7XMC7S6K.js} +4 -2
- package/dist/{logs-NE55HOET.js → logs-E7MGQINH.js} +6 -4
- package/dist/loop-L6TX6OR4.js +89 -0
- package/dist/machine-VJKAY2GX.js +78 -0
- package/dist/{machine-skills-KK2HXYMR.js → machine-skills-HR4RNRNR.js} +4 -2
- package/dist/{mcp-install-cmd-2QAS3AQZ.js → mcp-install-cmd-SMPLT43Q.js} +4 -2
- package/dist/{mcp-serve-cmd-U6USKHYR.js → mcp-serve-cmd-XXERT673.js} +8 -6
- package/dist/{paths-O7LCWY33.js → paths-F2ZR2EKC.js} +6 -4
- package/dist/pending-VOFQRXP4.js +16 -0
- package/dist/{pidfile-5GDCQ5HA.js → pidfile-7M7O2M7T.js} +7 -5
- package/dist/{record-NETSDAO6.js → record-YCJ6DZOY.js} +7 -5
- package/dist/{relay-VZ733BVJ.js → relay-I2T43PPB.js} +4 -2
- package/dist/{relay-protocol-24GEUGCO.js → relay-protocol-GI2GC2AM.js} +4 -2
- package/dist/runner-env-YW55JVU7.js +23 -0
- package/dist/{runner-identity-PSCZBILD.js → runner-identity-Y5ZFCC7V.js} +10 -8
- package/dist/{runner-key-VM2LYVRK.js → runner-key-R47C6374.js} +51 -49
- package/dist/{session-sender-P2RHDM6U.js → session-sender-UPACLRGG.js} +23 -21
- package/dist/{shell-function-NRD4KVUK.js → shell-function-GYD2ZQQG.js} +2 -1
- package/dist/{spec-cmd-LGKP6MT7.js → spec-cmd-7QRE2SZK.js} +18 -16
- package/dist/{starter-pack-SMK6UPRL.js → starter-pack-IMKIUA56.js} +5 -3
- package/dist/state-VAHBIMS5.js +16 -0
- package/dist/{status-HEHCNIDS.js → status-BQEYEG2V.js} +51 -49
- package/dist/{statusline-fast-E7RWVREA.js → statusline-fast-NUVHCNRX.js} +4 -2
- package/dist/{sync-cmd-HKN45HXL.js → sync-cmd-NBLYEPQG.js} +22 -20
- package/dist/update-steps-VGKNGWTZ.js +79 -0
- package/dist/{watch-RGZCUCR3.js → watch-IHV4V3HZ.js} +22 -20
- package/dist/{work-claim-cmd-6DSPGCZE.js → work-claim-cmd-WGTSU5IT.js} +21 -19
- package/dist/{work-cmd-GPLYLWY7.js → work-cmd-HKOJU5FJ.js} +15 -13
- package/dist/{work-comment-cmd-V5WM7LAW.js → work-comment-cmd-H3JCWQ2J.js} +18 -16
- package/dist/{work-demo-cmd-SWWI6AGD.js → work-demo-cmd-J4AZAIVP.js} +15 -13
- package/dist/{work-launch-TTGSHLY4.js → work-launch-LWDQXLGI.js} +1 -1
- package/dist/{work-logs-cmd-CTFBOPCI.js → work-logs-cmd-UOO4JVLG.js} +15 -13
- package/dist/{work-open-pr-cmd-HX2U3YBR.js → work-open-pr-cmd-QFRDDBAM.js} +17 -15
- package/dist/{work-pr-cmd-EI2R4FQG.js → work-pr-cmd-3Q2D5RQT.js} +16 -14
- package/dist/{work-proofs-cmd-QXNPHLYC.js → work-proofs-cmd-7Y3HGT7C.js} +18 -16
- package/dist/{work-proofs-record-72OKWEES.js → work-proofs-record-QPUM6DY4.js} +28 -26
- package/dist/{work-stop-cmd-7M7ZYUN2.js → work-stop-cmd-SD2ZRMSY.js} +15 -13
- package/package.json +1 -1
- package/dist/agent-setup-AOB76EDJ.js +0 -37
- package/dist/caller-GOY2X6QT.js +0 -20
- package/dist/chunk-KYDEBGJG.js +0 -402
- package/dist/emit-artifact-cmd-6E365VBQ.js +0 -41
- package/dist/emit-criteria-cmd-HWQOYZZ4.js +0 -32
- package/dist/find-unit-63SXQ7IM.js +0 -21
- package/dist/host-checks-WHW24PJR.js +0 -76
- package/dist/host-key-MWLXB5U5.js +0 -14
- package/dist/init-EZIAHBMH.js +0 -76
- package/dist/loop-2E34CGCX.js +0 -87
- package/dist/machine-6ALGG4IO.js +0 -76
- package/dist/runner-env-KHCONH2R.js +0 -21
- package/dist/settings-XB2HYBKO.js +0 -7
- package/dist/state-RJR4PMMX.js +0 -14
- package/dist/update-steps-7E4RD47J.js +0 -77
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
|
-
import { PROXY_WARNING_FLAG } from './chunk-
|
|
4
|
-
import { buildAgent, GH_VERSION, VOICE_PACK_FILES, VOICE_PACK_VERSION, FFMPEG_STATIC, FFMPEG_BUILD_TAG, GH_SHA256, TINI_SHA256, TINI_VERSION, RELAY_ID, RELAY_USER, HEADLESS_SHELL_REVISION, HEADLESS_SHELL_BASE_URL, PLAYWRIGHT_FFMPEG_BASE_URL, PLAYWRIGHT_FFMPEG_REVISION, HEADLESS_SHELL, PLAYWRIGHT_FFMPEG, PLAYWRIGHT_VERSION } from './chunk-
|
|
5
|
-
import { defaultAgents } from './chunk-
|
|
3
|
+
import { PROXY_WARNING_FLAG } from './chunk-CXJC3JLN.js';
|
|
4
|
+
import { buildAgent, GH_VERSION, VOICE_PACK_FILES, VOICE_PACK_VERSION, FFMPEG_STATIC, FFMPEG_BUILD_TAG, GH_SHA256, TINI_SHA256, TINI_VERSION, RELAY_ID, RELAY_USER, HEADLESS_SHELL_REVISION, HEADLESS_SHELL_BASE_URL, PLAYWRIGHT_FFMPEG_BASE_URL, PLAYWRIGHT_FFMPEG_REVISION, HEADLESS_SHELL, PLAYWRIGHT_FFMPEG, PLAYWRIGHT_VERSION } from './chunk-DTQPDMHG.js';
|
|
5
|
+
import { defaultAgents } from './chunk-I6U6QPN6.js';
|
|
6
6
|
|
|
7
7
|
createRequire(import.meta.url);
|
|
8
8
|
|
|
@@ -1,19 +1,21 @@
|
|
|
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 { defaultAgents, legacyAgent } from './chunk-
|
|
7
|
+
import { setupMachineSkills } from './chunk-LSZUTI6O.js';
|
|
8
|
+
import { defaultAgents, agentById, legacyAgent } from './chunk-I6U6QPN6.js';
|
|
9
9
|
import './chunk-WUKLQWGY.js';
|
|
10
|
+
import './chunk-T5QBWM6M.js';
|
|
11
|
+
import { LEGACY_AGENT } from './chunk-LSLK4RS4.js';
|
|
10
12
|
import './chunk-CDDED64E.js';
|
|
11
13
|
import './chunk-RA3O54FC.js';
|
|
12
14
|
import { homeFromEnv } from './chunk-352DHUTP.js';
|
|
13
15
|
import './chunk-Z5GEFMRW.js';
|
|
14
|
-
import { spawn, execFileSync
|
|
15
|
-
import {
|
|
16
|
-
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';
|
|
17
19
|
import { createHash, randomBytes } from 'crypto';
|
|
18
20
|
|
|
19
21
|
createRequire(import.meta.url);
|
|
@@ -158,6 +160,11 @@ function removeStaleOwnSkillsDirs(home, now = Date.now()) {
|
|
|
158
160
|
}
|
|
159
161
|
}
|
|
160
162
|
|
|
163
|
+
// src/legacy-launcher.ts
|
|
164
|
+
function runClaudeLauncher(args, deps = {}) {
|
|
165
|
+
return runAgentLauncher(LEGACY_AGENT, args, deps);
|
|
166
|
+
}
|
|
167
|
+
|
|
161
168
|
// src/claude-launcher.ts
|
|
162
169
|
function readDeliveryRecord(cwd) {
|
|
163
170
|
let common;
|
|
@@ -177,24 +184,10 @@ function readDeliveryRecord(cwd) {
|
|
|
177
184
|
}
|
|
178
185
|
return { kind: "invalid", path };
|
|
179
186
|
}
|
|
180
|
-
function findClaude(path) {
|
|
181
|
-
for (const entry of (path ?? "").split(delimiter)) {
|
|
182
|
-
if (entry === "") continue;
|
|
183
|
-
const candidate = join(entry, "claude");
|
|
184
|
-
try {
|
|
185
|
-
accessSync(candidate, constants.X_OK);
|
|
186
|
-
if (statSync(candidate).size === Buffer.byteLength(SHIM_SCRIPT) && readFileSync(candidate, "utf8") === SHIM_SCRIPT) continue;
|
|
187
|
-
} catch {
|
|
188
|
-
continue;
|
|
189
|
-
}
|
|
190
|
-
return candidate;
|
|
191
|
-
}
|
|
192
|
-
return void 0;
|
|
193
|
-
}
|
|
194
187
|
var SIGNALS = ["SIGINT", "SIGTERM", "SIGHUP"];
|
|
195
188
|
var SIGNAL_NUMBERS = { SIGHUP: 1, SIGINT: 2, SIGTERM: 15 };
|
|
196
|
-
function
|
|
197
|
-
return new Promise((done) => {
|
|
189
|
+
function runWith(prefix) {
|
|
190
|
+
return (program, argv, env, cwd, stderr) => new Promise((done) => {
|
|
198
191
|
const child = spawn(program, argv, { cwd, env, stdio: "inherit" });
|
|
199
192
|
const forward = (signal) => () => {
|
|
200
193
|
child.kill(signal);
|
|
@@ -206,121 +199,109 @@ function run(program, argv, env, cwd, stderr) {
|
|
|
206
199
|
done(code);
|
|
207
200
|
};
|
|
208
201
|
child.on("error", (err) => {
|
|
209
|
-
stderr(
|
|
202
|
+
stderr(`${prefix} could not start ${program}: ${err.message}
|
|
210
203
|
`);
|
|
211
204
|
finish(127);
|
|
212
205
|
});
|
|
213
206
|
child.on("exit", (code, signal) => finish(code ?? 128 + (signal === null ? 0 : SIGNAL_NUMBERS[signal] ?? 0)));
|
|
214
207
|
});
|
|
215
208
|
}
|
|
216
|
-
function ownSkillsDirFor(cwd, home, shared, stderr) {
|
|
209
|
+
function ownSkillsDirFor(prefix, cwd, home, shared, stderr) {
|
|
217
210
|
const root = findGitDirs(cwd)?.repoRoot;
|
|
218
211
|
if (root === void 0) return void 0;
|
|
219
212
|
try {
|
|
220
213
|
return ensureOwnSkillsDir({ home, repoRoot: root, shared });
|
|
221
214
|
} catch (err) {
|
|
222
|
-
stderr(
|
|
215
|
+
stderr(`${prefix} the checkout's .agents/skills/ skills are not attached: ${err instanceof Error ? err.message : String(err)}
|
|
223
216
|
`);
|
|
224
217
|
return void 0;
|
|
225
218
|
}
|
|
226
219
|
}
|
|
227
220
|
var SESSION_ID_VARIABLE = "OUTERLAYER_SESSION_ID";
|
|
228
221
|
var RESUME_SESSION_VARIABLE = "OUTERLAYER_RESUME_SESSION";
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
const named = sessionId !== void 0 && sessionId !== "";
|
|
233
|
-
const resumes = resume !== void 0 && resume !== "";
|
|
234
|
-
if (callerArgs.some((arg) => OWN_SESSION_FLAGS.has(arg)) || !named && !resumes) return { args: [], env: rest };
|
|
235
|
-
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;
|
|
236
225
|
}
|
|
237
226
|
var SIGNAL_EXIT = 128;
|
|
238
227
|
async function runWithResumeFallback(input) {
|
|
239
228
|
const code = await input.run(input.resumeArgs);
|
|
240
|
-
if (!input.
|
|
229
|
+
if (!input.resumes || code === 0 || code >= SIGNAL_EXIT || input.hasReply()) return code;
|
|
241
230
|
input.removeTranscript();
|
|
242
231
|
input.writeMarker();
|
|
243
232
|
return input.run(input.freshArgs);
|
|
244
233
|
}
|
|
245
|
-
function
|
|
246
|
-
const
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
const
|
|
255
|
-
|
|
256
|
-
}
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
const entry = JSON.parse(line);
|
|
265
|
-
if (entry.type === "assistant" && typeof entry.timestamp === "string" && Date.parse(entry.timestamp) >= sinceMs) return true;
|
|
266
|
-
}
|
|
267
|
-
} catch {
|
|
268
|
-
}
|
|
269
|
-
return false;
|
|
270
|
-
}
|
|
271
|
-
async function launch(runProgram, claude, front, args, env, cwd, stderr) {
|
|
272
|
-
const session = sessionArgs(env, args);
|
|
273
|
-
const idAt = session.args.indexOf("--session-id");
|
|
274
|
-
const sessionId = idAt === -1 ? void 0 : session.args[idAt + 1];
|
|
275
|
-
const configDir = session.env.CLAUDE_CONFIG_DIR ?? join(homeFromEnv(session.env), ".claude");
|
|
276
|
-
if (sessionId !== void 0 && findTranscript(configDir, sessionId) !== void 0) return runProgram(claude, [...front, ...args], session.env, cwd, stderr);
|
|
277
|
-
const resumeAt = session.args.indexOf("--resume");
|
|
278
|
-
if (resumeAt === -1) return runProgram(claude, [...front, ...session.args, ...args], session.env, cwd, stderr);
|
|
279
|
-
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);
|
|
280
253
|
const resumeDir = dirname(resumePath);
|
|
281
254
|
const launchedAt = Date.now();
|
|
282
255
|
try {
|
|
283
256
|
writeFileSync(join(resumeDir, "launch.json"), JSON.stringify({ sessionId, resumedFrom: basename(resumePath, ".jsonl"), launchedAt: new Date(launchedAt).toISOString() }));
|
|
284
257
|
} catch (err) {
|
|
285
|
-
stderr(
|
|
258
|
+
stderr(`${prefix} could not record the resume: ${err instanceof Error ? err.message : String(err)}
|
|
286
259
|
`);
|
|
287
260
|
}
|
|
288
|
-
const transcript = () => sessionId === void 0 ? void 0 : findTranscript(configDir, sessionId);
|
|
289
261
|
return runWithResumeFallback({
|
|
290
|
-
run
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
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),
|
|
294
267
|
removeTranscript: () => {
|
|
295
|
-
|
|
296
|
-
if (path !== void 0) rmSync(path, { force: true });
|
|
268
|
+
if (sessionId !== void 0) session.discard(sessionId, sessionEnv);
|
|
297
269
|
},
|
|
298
270
|
writeMarker: () => {
|
|
299
|
-
stderr(
|
|
271
|
+
stderr(`${prefix} the resume failed, so this run starts a fresh session
|
|
272
|
+
`);
|
|
300
273
|
try {
|
|
301
274
|
writeFileSync(join(resumeDir, "failed"), "");
|
|
302
275
|
} catch (err) {
|
|
303
|
-
stderr(
|
|
276
|
+
stderr(`${prefix} could not record the fresh start: ${err instanceof Error ? err.message : String(err)}
|
|
304
277
|
`);
|
|
305
278
|
}
|
|
306
279
|
}
|
|
307
280
|
});
|
|
308
281
|
}
|
|
309
|
-
function
|
|
310
|
-
return spawnSync(claude, ["--version"], { env, encoding: "utf8", timeout: 15e3, stdio: ["ignore", "pipe", "ignore"] }).stdout ?? "";
|
|
311
|
-
}
|
|
312
|
-
async function runClaudeLauncher(args, deps = {}) {
|
|
282
|
+
async function runAgentLauncher(agentId, args, deps = {}) {
|
|
313
283
|
const cwd = deps.cwd ?? process.cwd();
|
|
314
284
|
const env = deps.env ?? process.env;
|
|
315
285
|
const stderr = deps.stderr ?? ((text) => void process.stderr.write(text));
|
|
316
|
-
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);
|
|
317
297
|
const home = homeFromEnv(env);
|
|
318
298
|
const installed = setupMachineSkills(home);
|
|
319
|
-
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
|
|
320
304
|
`);
|
|
321
|
-
const claude = findClaude(env.PATH);
|
|
322
|
-
if (claude === void 0) {
|
|
323
|
-
stderr("outerlayer claude: no claude program found on PATH\n");
|
|
324
305
|
return 127;
|
|
325
306
|
}
|
|
326
307
|
try {
|
|
@@ -330,7 +311,7 @@ async function runClaudeLauncher(args, deps = {}) {
|
|
|
330
311
|
const found = readDeliveryRecord(cwd);
|
|
331
312
|
const build = found.kind === "found" && found.record.launcher !== true ? found.record : void 0;
|
|
332
313
|
if (found.kind === "invalid" && env.OUTERLAYER_JOB_DIR !== void 0) {
|
|
333
|
-
stderr(
|
|
314
|
+
stderr(`${prefix} ${found.path} is not a readable delivery record, so the control plane cannot be attached
|
|
334
315
|
`);
|
|
335
316
|
return 1;
|
|
336
317
|
}
|
|
@@ -338,16 +319,16 @@ async function runClaudeLauncher(args, deps = {}) {
|
|
|
338
319
|
if (build !== void 0) {
|
|
339
320
|
dir = build.dir;
|
|
340
321
|
if (!existsSync(dir)) {
|
|
341
|
-
stderr(
|
|
322
|
+
stderr(`${prefix} the control plane of ${build.repository} is not at ${dir}, so it cannot be attached
|
|
342
323
|
`);
|
|
343
324
|
return 1;
|
|
344
325
|
}
|
|
345
326
|
} else {
|
|
346
|
-
const { resolveLaunchPlane } = await import('./control-plane-launch-
|
|
327
|
+
const { resolveLaunchPlane } = await import('./control-plane-launch-AAH4YH56.js');
|
|
347
328
|
const plane = env[GOVERNANCE_VARIABLE] === "self" ? { kind: "none" } : await resolveLaunchPlane({ cwd, env, home, fetchImpl: deps.fetchImpl, stderr });
|
|
348
329
|
if (plane.kind === "none") {
|
|
349
|
-
const own2 = ownSkillsDirFor(cwd, home,
|
|
350
|
-
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);
|
|
351
332
|
}
|
|
352
333
|
if (plane.kind === "refused") {
|
|
353
334
|
stderr(plane.message);
|
|
@@ -355,22 +336,15 @@ async function runClaudeLauncher(args, deps = {}) {
|
|
|
355
336
|
}
|
|
356
337
|
dir = plane.dir;
|
|
357
338
|
}
|
|
358
|
-
const
|
|
359
|
-
|
|
360
|
-
|
|
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}
|
|
361
343
|
`);
|
|
362
344
|
return 1;
|
|
363
345
|
}
|
|
364
|
-
const own = ownSkillsDirFor(cwd, home, sharedSkillNames(dir), stderr);
|
|
365
|
-
return launch
|
|
366
|
-
runProgram,
|
|
367
|
-
claude,
|
|
368
|
-
["--add-dir", dir, ...own === void 0 ? [] : ["--add-dir", own], "--settings", join(dir, "settings.json")],
|
|
369
|
-
args,
|
|
370
|
-
{ ...env, CLAUDE_CODE_ADDITIONAL_DIRECTORIES_CLAUDE_MD: "1", [CONTROL_PLANE_DIR_VARIABLE]: dir },
|
|
371
|
-
cwd,
|
|
372
|
-
stderr
|
|
373
|
-
);
|
|
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);
|
|
374
348
|
}
|
|
375
349
|
|
|
376
|
-
export {
|
|
350
|
+
export { runAgentLauncher, runClaudeLauncher, runWith, runWithResumeFallback };
|