@outerlayer/cli 0.36.0-next.20261101131017 → 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/{artifact-link-cmd-W7LRR76D.js → artifact-link-cmd-ZCMQIT5Y.js} +2 -2
- 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-G4TVQKN3.js → check-SF2OVZXB.js} +73 -71
- package/dist/{chunk-KB5B6ZT5.js → chunk-3FSKTGM6.js} +20 -20
- package/dist/{chunk-CONA2WNE.js → chunk-4CTVN3C5.js} +18 -11
- package/dist/{chunk-2QW2PLWT.js → chunk-4TNUQLXH.js} +8 -8
- package/dist/{chunk-LGV5N5DG.js → chunk-564Q2STF.js} +1 -1
- package/dist/{chunk-2ANBJ7DB.js → chunk-5FIOUQGC.js} +8 -8
- package/dist/{chunk-4W7CPTKY.js → chunk-5FND4PIU.js} +3 -3
- package/dist/{chunk-SQ6HDN7A.js → chunk-5GHJFETA.js} +1 -1
- package/dist/{chunk-4DJZSNVT.js → chunk-6JJITHBI.js} +1 -1
- package/dist/{chunk-6CYNPWZT.js → chunk-6LO62EQ5.js} +151 -108
- package/dist/{chunk-RIHB3HA2.js → chunk-772ILTCK.js} +3 -3
- package/dist/{chunk-CIUD3436.js → chunk-A5Y2HBVU.js} +1 -1
- package/dist/{chunk-F3ZMVUAS.js → chunk-AYLYAOHH.js} +5 -5
- package/dist/{chunk-DZDTSDHQ.js → chunk-C3JWWPLC.js} +10 -11
- package/dist/{chunk-JFMSFHER.js → chunk-CKPQOQFC.js} +644 -74
- package/dist/{chunk-ALEUIS35.js → chunk-CVGQ3BNF.js} +1 -1
- package/dist/{chunk-GDMAN42R.js → chunk-EBIYRRJW.js} +5 -5
- package/dist/{chunk-UIKUH2UQ.js → chunk-ESSJPSJ2.js} +2 -2
- package/dist/{chunk-A67A5SWG.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-SRENPED2.js → chunk-GDZTL6BI.js} +42 -33
- package/dist/{chunk-AF6DQJ5W.js → chunk-GSXGA6KF.js} +1 -1
- package/dist/{chunk-T3AJOPUR.js → chunk-GZ75FRLB.js} +4 -5
- package/dist/chunk-H2FFONRY.js +136 -0
- package/dist/{chunk-IM2DECLP.js → chunk-HIN4BMRW.js} +3 -3
- package/dist/{chunk-OLENS2DD.js → chunk-I626B72C.js} +29 -26
- package/dist/{chunk-YCUUZGFF.js → chunk-I6FRCBMU.js} +26 -21
- package/dist/{chunk-PN6TNCQI.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-5DYL6FJA.js → chunk-JXXHLQQR.js} +3 -3
- package/dist/{chunk-VI6Z4EJZ.js → chunk-K3X3L5YW.js} +4 -4
- package/dist/{chunk-MKSZHT6S.js → chunk-KN4VIK53.js} +1 -1
- package/dist/{chunk-3LCXSD26.js → chunk-L2BA2HXM.js} +1 -1
- package/dist/chunk-L3JXQDVH.js +78 -0
- package/dist/{chunk-3ONYQMGD.js → chunk-LCOQN6NR.js} +3 -3
- package/dist/{chunk-6KHQGLNT.js → chunk-LSXHTBAM.js} +5 -5
- package/dist/{chunk-RGH5GYU2.js → chunk-LVXR37OG.js} +47 -38
- package/dist/{chunk-HGGR7Y3V.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-UFRRRF64.js → chunk-NTMRMBLM.js} +10 -5
- package/dist/{chunk-RGU6LHPI.js → chunk-NWBB2SQ4.js} +38 -35
- package/dist/{chunk-A7D5BMII.js → chunk-OYKAOHX5.js} +5 -5
- package/dist/{chunk-46YRS7QS.js → chunk-OZOATEK3.js} +4 -4
- package/dist/{chunk-3PQTOKML.js → chunk-P6PHY33P.js} +1 -1
- package/dist/{chunk-GQ7VVBUA.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-K66FIV2S.js → chunk-PTPF36Q7.js} +3 -3
- package/dist/{chunk-7Y5VW4JG.js → chunk-Q42K6XZ6.js} +1 -1
- package/dist/{chunk-VIJWXQMT.js → chunk-QJDX6VJS.js} +7 -7
- package/dist/{chunk-W46566FP.js → chunk-RK4JQRVT.js} +9 -9
- package/dist/{chunk-U553JKMO.js → chunk-RPZIHELI.js} +5 -5
- package/dist/{chunk-CIEX2ZKQ.js → chunk-RSRZDF3K.js} +6 -6
- package/dist/{chunk-46OBCATR.js → chunk-T5Z22NA6.js} +1 -1
- package/dist/{chunk-5H57X7YC.js → chunk-TPMLB3VZ.js} +1 -1
- package/dist/chunk-TWYHSMHM.js +67 -0
- package/dist/{chunk-6GA5BJTH.js → chunk-TYCZVJTB.js} +54 -31
- package/dist/{chunk-4SFHEARD.js → chunk-VRQM4A64.js} +6 -3
- package/dist/{chunk-LRCGXRQI.js → chunk-WDQPBAFV.js} +44 -19
- package/dist/{chunk-UZGQT6OF.js → chunk-WLMAGMTU.js} +5 -3
- package/dist/{chunk-KCUX5I5W.js → chunk-WNYH42PF.js} +6 -6
- package/dist/{chunk-C4YULCXX.js → chunk-WQB3XOEP.js} +28 -31
- package/dist/{chunk-VUG4IZ7H.js → chunk-WUKLQWGY.js} +1 -1
- package/dist/{chunk-MDFOS4OM.js → chunk-XABJMU5A.js} +4 -4
- package/dist/{chunk-MMXPNEEQ.js → chunk-XAOIHYPS.js} +29 -24
- package/dist/{chunk-WAZJPDR2.js → chunk-XE3DIJJT.js} +1 -1
- package/dist/{chunk-3SQZ5LIK.js → chunk-XHFSBSIA.js} +4 -4
- package/dist/{chunk-GDIVOYDA.js → chunk-XLOM2BNL.js} +3 -4
- package/dist/{claude-launcher-YV3TDXBU.js → claude-launcher-LXZPTDNC.js} +23 -18
- package/dist/{cli-EMQEIYSR.js → cli-QFUT3UQS.js} +145 -146
- package/dist/{cli-update-notice-T3CXRWNB.js → cli-update-notice-AWYJ4A7R.js} +2 -2
- package/dist/{command-GKVKI74I.js → command-45RZT4CK.js} +59 -60
- package/dist/{config-4HXUXX3M.js → config-WYQPXLOP.js} +13 -11
- package/dist/connect-cmd-LUCQ7FSV.js +26 -0
- package/dist/{container-start-OMF3ZUIB.js → container-start-T776VI3M.js} +59 -58
- package/dist/{context-cleanup-TPHCVVFV.js → context-cleanup-QE2MIO2Q.js} +5 -3
- package/dist/{context-show-cmd-MKQAAR7R.js → context-show-cmd-7QEHUOEL.js} +17 -17
- package/dist/{control-plane-launch-UWFQWMWB.js → control-plane-launch-THUH6YU5.js} +19 -19
- package/dist/{demo-record-cmd-Y57UWBCX.js → demo-record-cmd-SBERRQNW.js} +8 -5
- package/dist/{demo-voice-cmd-H4PCO2PT.js → demo-voice-cmd-VM3FITZU.js} +22 -24
- package/dist/{dist-Y3WSK7OZ.js → dist-6KGTCWKR.js} +2 -2
- package/dist/docker-MQNLK4OO.js +17 -0
- package/dist/{doctor-FEBZ3DZB.js → doctor-NQOSPJGS.js} +75 -72
- package/dist/emit-artifact-cmd-6E365VBQ.js +41 -0
- package/dist/emit-cmd-ZPFCPVSR.js +16 -0
- package/dist/emit-criteria-cmd-HWQOYZZ4.js +32 -0
- package/dist/{emit-demo-cmd-VKGN74NW.js → emit-demo-cmd-PMQGNNVX.js} +22 -24
- package/dist/{emit-finding-cmd-DNFJEYQS.js → emit-finding-cmd-MYWQN5WW.js} +17 -18
- package/dist/{emit-result-cmd-OR5WTW4P.js → emit-result-cmd-GXK3KMAP.js} +20 -21
- package/dist/{emit-step-cmd-AAEBYW3L.js → emit-step-cmd-ZV2XTUVT.js} +17 -18
- package/dist/exec-client-P7RFRUCK.js +14 -0
- package/dist/find-unit-63SXQ7IM.js +21 -0
- package/dist/{findings-cmd-LTM62M3K.js → findings-cmd-OGMBVVSM.js} +17 -18
- package/dist/fleet-readiness-4RBKLXBQ.js +27 -0
- package/dist/governing-source-XJMXFSAR.js +38 -0
- package/dist/guest-init-XZHRPIMG.js +16 -0
- package/dist/{hook-fast-3HPWMSFB.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-O5H4TWA7.js → init-LO6U7YTW.js} +56 -55
- package/dist/{init-cmd-HWAXEEOD.js → init-cmd-2JANO5EN.js} +27 -28
- package/dist/{init-update-3W2TOJQV.js → init-update-D6PRTGNE.js} +55 -48
- package/dist/install-cmd-SJMBNQEH.js +17 -0
- package/dist/layout-AQHIMJMO.js +11 -0
- package/dist/{login-browser-ODTJEGDN.js → login-browser-QH4KYG3F.js} +2 -2
- 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-VRUJVBQV.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-PSCZBILD.js +17 -0
- package/dist/{runner-key-HUOW7X7B.js → runner-key-VM2LYVRK.js} +48 -50
- package/dist/{session-sender-32UAV25N.js → session-sender-P2RHDM6U.js} +21 -22
- package/dist/{spec-cmd-TPRHZ3EV.js → spec-cmd-LGKP6MT7.js} +18 -19
- package/dist/{starter-pack-7QNUT74O.js → starter-pack-SMK6UPRL.js} +6 -7
- package/dist/state-RJR4PMMX.js +14 -0
- package/dist/{status-HDJ2V5UD.js → status-HEHCNIDS.js} +48 -50
- package/dist/{sync-cmd-AHXCXMVP.js → sync-cmd-HKN45HXL.js} +20 -21
- package/dist/update-steps-7E4RD47J.js +77 -0
- package/dist/{watch-4EDI4CTS.js → watch-RGZCUCR3.js} +20 -21
- package/dist/{work-claim-cmd-GFRZBX2V.js → work-claim-cmd-6DSPGCZE.js} +24 -26
- package/dist/{work-cmd-FLKJQWGQ.js → work-cmd-GPLYLWY7.js} +17 -18
- package/dist/work-comment-cmd-V5WM7LAW.js +35 -0
- package/dist/{work-demo-cmd-FDPDTXG6.js → work-demo-cmd-SWWI6AGD.js} +17 -18
- package/dist/{work-logs-cmd-PSB44DT5.js → work-logs-cmd-CTFBOPCI.js} +17 -18
- package/dist/{work-open-pr-cmd-QJW5PNT2.js → work-open-pr-cmd-HX2U3YBR.js} +18 -19
- package/dist/{work-pr-cmd-HMGBUHGL.js → work-pr-cmd-EI2R4FQG.js} +17 -18
- package/dist/{work-proofs-cmd-3GPGH4RL.js → work-proofs-cmd-QXNPHLYC.js} +19 -20
- package/dist/{work-proofs-record-AC4GYMQA.js → work-proofs-record-72OKWEES.js} +26 -28
- package/dist/{work-stop-cmd-YO7SBPNF.js → work-stop-cmd-7M7ZYUN2.js} +17 -18
- package/package.json +2 -1
- package/dist/agent-setup-UYTS2PHZ.js +0 -33
- package/dist/bridge-XM4QLKIX.js +0 -8
- package/dist/build-IENNKWWC.js +0 -18
- package/dist/build-disk-M33Q6L22.js +0 -15
- package/dist/builder-YNMSYR75.js +0 -14
- package/dist/caller-2GU5V52U.js +0 -18
- package/dist/chunk-3DMCCCVM.js +0 -74
- package/dist/chunk-7O7LJWQO.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/connect-cmd-GLB2X7YA.js +0 -27
- package/dist/docker-AFJABU7U.js +0 -14
- package/dist/emit-artifact-cmd-DGFH4MUK.js +0 -42
- package/dist/emit-cmd-HNXRGC5Z.js +0 -17
- package/dist/emit-criteria-cmd-B23VYUF6.js +0 -33
- package/dist/exec-client-FGGPQSYQ.js +0 -9
- package/dist/find-unit-4XKMNIE7.js +0 -19
- package/dist/fleet-readiness-FAKMWCJV.js +0 -28
- package/dist/governing-source-75MBT2IE.js +0 -39
- package/dist/guest-init-WPUS45IN.js +0 -11
- package/dist/host-checks-PUI32LIA.js +0 -78
- package/dist/host-key-O4DFMOSV.js +0 -9
- package/dist/init-Y672J4BW.js +0 -78
- package/dist/install-cmd-JKPXIOEY.js +0 -12
- package/dist/layout-TLUOMM6F.js +0 -11
- package/dist/loop-QJGPNIT4.js +0 -89
- package/dist/machine-YKQSW22W.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-FK3SUT3Q.js +0 -19
- package/dist/runner-identity-WYAGV6UQ.js +0 -14
- package/dist/state-UWIM42JH.js +0 -9
- package/dist/update-steps-F37GQWLJ.js +0 -79
- package/dist/work-comment-cmd-3HUIIEQD.js +0 -36
- 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
3
|
import { isVersion, compareVersions } from './chunk-TQMI335S.js';
|
|
4
|
-
import { RUNNER_DIR_MODE, RUNNER_FILE_MODE } from './chunk-
|
|
4
|
+
import { RUNNER_DIR_MODE, RUNNER_FILE_MODE } from './chunk-GD6KIHOS.js';
|
|
5
5
|
import { readFileSync, mkdirSync, writeFileSync, renameSync } from 'fs';
|
|
6
6
|
import { join } from 'path';
|
|
7
7
|
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
3
|
import { appendContextProvenance } from './chunk-545P7JY7.js';
|
|
4
|
-
import { CONTROL_PLANE_DIR_VARIABLE } from './chunk-
|
|
4
|
+
import { CONTROL_PLANE_DIR_VARIABLE } from './chunk-NC3QAHOS.js';
|
|
5
5
|
import { readRepoConnection, findGitDirs } from './chunk-BJ3KTMDH.js';
|
|
6
|
-
import { updateNoticeContext, staleMachineCopiesContext } from './chunk-
|
|
7
|
-
import { resolvePackageVersion } from './chunk-RA3O54FC.js';
|
|
6
|
+
import { updateNoticeContext, staleMachineCopiesContext } from './chunk-NFZMENCY.js';
|
|
8
7
|
import { cliInvocation } from './chunk-FZKNTIOJ.js';
|
|
9
8
|
import { deadHooksState, huskyPrepareScript, preparePackageManagerCommand } from './chunk-CJPTUU2E.js';
|
|
9
|
+
import { resolvePackageVersion } from './chunk-RA3O54FC.js';
|
|
10
10
|
import { homeFromEnv } from './chunk-352DHUTP.js';
|
|
11
11
|
import { readFileSync, mkdirSync, writeFileSync, renameSync, existsSync, readdirSync, unlinkSync, statSync, appendFileSync, opendirSync } from 'fs';
|
|
12
12
|
import { spawn, execFileSync } from 'child_process';
|
|
@@ -808,11 +808,11 @@ async function missingControlPlane(cwd, sessionId, home, env) {
|
|
|
808
808
|
const dirs = findGitDirs(cwd);
|
|
809
809
|
if (dirs === void 0) return void 0;
|
|
810
810
|
if (existsSync(join(dirs.gitCommonDir, "outerlayer", "materialized.json")) || hasExcludeBlock(dirs.gitCommonDir)) {
|
|
811
|
-
const { cleanupEarlierCopies } = await import('./context-cleanup-
|
|
811
|
+
const { cleanupEarlierCopies } = await import('./context-cleanup-QE2MIO2Q.js');
|
|
812
812
|
cleanupEarlierCopies(dirs);
|
|
813
813
|
}
|
|
814
814
|
if (!contextPossiblyGoverned(cwd, home)) return void 0;
|
|
815
|
-
const { governanceOf } = await import('./control-plane-launch-
|
|
815
|
+
const { governanceOf } = await import('./control-plane-launch-THUH6YU5.js');
|
|
816
816
|
if (await governanceOf({ cwd, env, home }) !== "governed") return void 0;
|
|
817
817
|
recordMissingContext(dirs, sessionId, home);
|
|
818
818
|
const launcher = `${cliInvocation()} claude`;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
|
-
import { parseSize, BUILD_LABEL, RUNNER_LABEL, runnerLabelValue } from './chunk-
|
|
4
|
-
import { buildsDir, storeScopes, rootfsDir, orgStoreIn, runnerDir, imagesDir, builderCacheDiskPath } from './chunk-
|
|
3
|
+
import { parseSize, BUILD_LABEL, RUNNER_LABEL, runnerLabelValue } from './chunk-C3JWWPLC.js';
|
|
4
|
+
import { buildsDir, storeScopes, rootfsDir, orgStoreIn, runnerDir, imagesDir, builderCacheDiskPath } from './chunk-GD6KIHOS.js';
|
|
5
5
|
import { spawnSync } from 'child_process';
|
|
6
6
|
import { statfsSync, statSync, existsSync, readdirSync } from 'fs';
|
|
7
7
|
import { dirname, join } from 'path';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
|
-
import { keyRunnerFactory, RunnerConfigError } from './chunk-
|
|
4
|
-
import { orgHomeDir } from './chunk-
|
|
3
|
+
import { keyRunnerFactory, RunnerConfigError } from './chunk-NTMRMBLM.js';
|
|
4
|
+
import { orgHomeDir } from './chunk-GD6KIHOS.js';
|
|
5
5
|
|
|
6
6
|
createRequire(import.meta.url);
|
|
7
7
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
3
|
import { startTimeOf } from './chunk-JBJTC3UU.js';
|
|
4
|
-
import { EXEC_PORT } from './chunk-
|
|
5
|
-
import { TUNNEL_PORT, BRIDGE_ADDRESS, BRIDGE_CIDR } from './chunk-
|
|
6
|
-
import { RELAY_PORT } from './chunk-
|
|
4
|
+
import { EXEC_PORT } from './chunk-WLMAGMTU.js';
|
|
5
|
+
import { TUNNEL_PORT, BRIDGE_ADDRESS, BRIDGE_CIDR } from './chunk-KN4VIK53.js';
|
|
6
|
+
import { RELAY_PORT } from './chunk-M2NIHHQI.js';
|
|
7
7
|
import { spawn, spawnSync } from 'child_process';
|
|
8
8
|
import { symlinkSync, lstatSync, writeFileSync, chmodSync, mkdirSync, existsSync } from 'fs';
|
|
9
9
|
|
|
@@ -1,22 +1,23 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
|
-
import { checkStarterFiles, contextIsGoverned } from './chunk-
|
|
4
|
-
import { resolveCredentials, getJson, WorkCommandError } from './chunk-
|
|
5
|
-
import { isLinkedRepository } from './chunk-
|
|
3
|
+
import { checkStarterFiles, contextIsGoverned } from './chunk-RPZIHELI.js';
|
|
4
|
+
import { resolveCredentials, getJson, WorkCommandError } from './chunk-QJDX6VJS.js';
|
|
5
|
+
import { isLinkedRepository } from './chunk-4CTVN3C5.js';
|
|
6
6
|
import { C } from './chunk-2AM6Z5BP.js';
|
|
7
|
-
import { fleetCheck, checkBuildSkill, checkMachineSkills, checkCommittedMaintainedSkills, checkMaintainedReferences, checkIgnoredSkillFolders } from './chunk-
|
|
8
|
-
import { sanitizeTerminal } from './chunk-
|
|
9
|
-
import { checkFormerSkillNames } from './chunk-
|
|
10
|
-
import { resolveGatewayCredentials, defaultFetch } from './chunk-
|
|
11
|
-
import { sanitizeForContext, spoolDir, assessSyncHealth, readSyncStatus, SYNC_STALE_AFTER_MS, formatAgo, checkInstalledCliStaleness, workspaceRootOf, hookFiredMarkerPath, refreshCommand } from './chunk-
|
|
7
|
+
import { fleetCheck, checkBuildSkill, checkMachineSkills, checkCommittedMaintainedSkills, checkMaintainedReferences, checkIgnoredSkillFolders } from './chunk-WQB3XOEP.js';
|
|
8
|
+
import { sanitizeTerminal } from './chunk-P6PHY33P.js';
|
|
9
|
+
import { checkFormerSkillNames } from './chunk-GZ75FRLB.js';
|
|
10
|
+
import { resolveGatewayCredentials, defaultFetch } from './chunk-JVCQZDQ6.js';
|
|
11
|
+
import { sanitizeForContext, spoolDir, assessSyncHealth, readSyncStatus, SYNC_STALE_AFTER_MS, formatAgo, checkInstalledCliStaleness, workspaceRootOf, hookFiredMarkerPath, refreshCommand } from './chunk-EBIYRRJW.js';
|
|
12
12
|
import { readStatuslineState, STATE_FRESH_MS } from './chunk-YBAVN6WS.js';
|
|
13
|
-
import {
|
|
13
|
+
import { CONTROL_PLANE_DIR_VARIABLE } from './chunk-NC3QAHOS.js';
|
|
14
14
|
import { findGitDirs } from './chunk-BJ3KTMDH.js';
|
|
15
|
-
import { resolveRepoIdentity, compareVersions, SUPPORTED_VERSIONS } from './chunk-
|
|
15
|
+
import { resolveRepoIdentity, compareVersions, SUPPORTED_VERSIONS } from './chunk-5GHJFETA.js';
|
|
16
16
|
import { cliInvocation } from './chunk-FZKNTIOJ.js';
|
|
17
17
|
import { readSettings, settingsPath, isOurStatuslineSlot, statuslineWrappedOriginal, REGISTERED_EVENTS, isOurHookCommand, ourCommandBins, cliBinResolvable, ourDirectScriptBins, wrappedOriginalCommand } from './chunk-KYDEBGJG.js';
|
|
18
18
|
import { readDeliveryRecord, readDegraded, readSourceCache } from './chunk-YQR6E6OV.js';
|
|
19
19
|
import { deadHooksState, preparePackageManagerCommand } from './chunk-CJPTUU2E.js';
|
|
20
|
+
import { contextAgents, defaultAgents, legacyAgent } from './chunk-CKPQOQFC.js';
|
|
20
21
|
import { homeFromEnv } from './chunk-352DHUTP.js';
|
|
21
22
|
import { readFileSync, mkdirSync, writeFileSync, renameSync, existsSync, accessSync, constants, statSync, readdirSync, realpathSync } from 'fs';
|
|
22
23
|
import { join, dirname, resolve, delimiter } from 'path';
|
|
@@ -118,7 +119,7 @@ function recordStatusline(home, settingsPath2, outcome, original, now = Date.now
|
|
|
118
119
|
}
|
|
119
120
|
var NAME = "MCP server";
|
|
120
121
|
var SERVER = "outerlayer";
|
|
121
|
-
var
|
|
122
|
+
var npxFix = (file) => `Change the "outerlayer" entry in ${file} to run \`npx -y @outerlayer/cli mcp serve\`, or install the CLI with \`npm install -g @outerlayer/cli\`.`;
|
|
122
123
|
function expand(value, env) {
|
|
123
124
|
return value.replace(/\$\{([A-Za-z_][A-Za-z0-9_]*)\}/g, (_m, name) => env[name] ?? "");
|
|
124
125
|
}
|
|
@@ -145,25 +146,32 @@ function resolveCommand(command, root, env, platform) {
|
|
|
145
146
|
}
|
|
146
147
|
return void 0;
|
|
147
148
|
}
|
|
148
|
-
function checkMcpCommand(cwd, env = process.env, platform = process.platform) {
|
|
149
|
+
function checkMcpCommand(cwd, env = process.env, platform = process.platform, agents = defaultAgents()) {
|
|
149
150
|
const root = findGitDirs(cwd ?? process.cwd())?.repoRoot;
|
|
150
151
|
if (root === void 0) return [];
|
|
151
|
-
const
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
152
|
+
const files = [...new Set(contextAgents(agents).map((agent) => agent.context.mcp))];
|
|
153
|
+
return files.flatMap((mcp) => {
|
|
154
|
+
const path = join(root, mcp.file);
|
|
155
|
+
if (!existsSync(path)) return [];
|
|
156
|
+
let text;
|
|
157
|
+
try {
|
|
158
|
+
text = readFileSync(path, "utf8");
|
|
159
|
+
} catch {
|
|
160
|
+
text = void 0;
|
|
161
|
+
}
|
|
162
|
+
const servers = text === void 0 ? void 0 : mcp.servers(text);
|
|
163
|
+
if (servers === void 0) {
|
|
164
|
+
return [{ name: NAME, status: "warn", detail: `${mcp.file} is not valid JSON, so the agent starts none of its servers`, fix: `Fix the JSON syntax in ${mcp.file}.` }];
|
|
165
|
+
}
|
|
166
|
+
const command = servers[SERVER]?.command;
|
|
167
|
+
if (typeof command !== "string") return [];
|
|
168
|
+
const shown = sanitizeTerminal(command);
|
|
169
|
+
const resolved = resolveCommand(expand(command, env), root, env, platform);
|
|
170
|
+
if (resolved === void 0) {
|
|
171
|
+
return [{ name: NAME, status: "warn", detail: `the "outerlayer" server runs \`${shown}\`, which is not on PATH here, so the agent has no OuterLayer tools`, fix: npxFix(mcp.file) }];
|
|
172
|
+
}
|
|
173
|
+
return [{ name: NAME, status: "pass", detail: `the "outerlayer" server runs ${sanitizeTerminal(resolved)}` }];
|
|
174
|
+
});
|
|
167
175
|
}
|
|
168
176
|
|
|
169
177
|
// src/doctor.ts
|
|
@@ -761,7 +769,8 @@ function checkControlPlaneHooks(cwd) {
|
|
|
761
769
|
} catch {
|
|
762
770
|
return [];
|
|
763
771
|
}
|
|
764
|
-
const
|
|
772
|
+
const escapesDelivery = legacyAgent().adapter.context?.escapesDelivery;
|
|
773
|
+
const escaping = escapesDelivery === void 0 ? [] : hookCommandsOf(settings).filter((command) => escapesDelivery(command, CONTROL_PLANE_DIR_VARIABLE));
|
|
765
774
|
if (escaping.length === 0) return [];
|
|
766
775
|
return [
|
|
767
776
|
{
|
|
@@ -1195,8 +1204,8 @@ function doctorExitCode(checks) {
|
|
|
1195
1204
|
|
|
1196
1205
|
// src/doctor-report.ts
|
|
1197
1206
|
async function gatherDoctorChecks() {
|
|
1198
|
-
const { DEFAULT_BUILD_DISK, DEFAULT_CACHE_DISK } = await import('./build-disk-
|
|
1199
|
-
const { defaultRunnerConfigPath, hasRunnerBlock, keyRunnerFactory, loadRunnerConfig, runnerVmOf } = await import('./config-
|
|
1207
|
+
const { DEFAULT_BUILD_DISK, DEFAULT_CACHE_DISK } = await import('./build-disk-HO2VPIBJ.js');
|
|
1208
|
+
const { defaultRunnerConfigPath, hasRunnerBlock, keyRunnerFactory, loadRunnerConfig, runnerVmOf } = await import('./config-WYQPXLOP.js');
|
|
1200
1209
|
const configPath = defaultRunnerConfigPath();
|
|
1201
1210
|
const runnerHost = hasRunnerBlock(configPath);
|
|
1202
1211
|
const hooks = (() => {
|
|
@@ -1224,7 +1233,7 @@ async function gatherDoctorChecks() {
|
|
|
1224
1233
|
const { runnerVmCheck } = await import('./doctor-53F2PYY7.js');
|
|
1225
1234
|
checks.push(runnerVmCheck(configPath, { lima: realLima(), home: homeFromEnv(), instance: runnerVm.instance }));
|
|
1226
1235
|
} else if (hasRunnerBlock(configPath)) {
|
|
1227
|
-
const { runnerHostChecks } = await import('./doctor-
|
|
1236
|
+
const { runnerHostChecks } = await import('./doctor-NQOSPJGS.js');
|
|
1228
1237
|
const gateway = (() => {
|
|
1229
1238
|
try {
|
|
1230
1239
|
const loaded = loadRunnerConfig(configPath);
|
|
@@ -1252,7 +1261,7 @@ async function gatherDoctorChecks() {
|
|
|
1252
1261
|
const service = await (async () => {
|
|
1253
1262
|
const { existsSync: existsSync3 } = await import('fs');
|
|
1254
1263
|
if (process.platform !== "linux" || !existsSync3("/run/systemd/system")) return void 0;
|
|
1255
|
-
const { inspectRunnerService } = await import('./find-unit-
|
|
1264
|
+
const { inspectRunnerService } = await import('./find-unit-63SXQ7IM.js');
|
|
1256
1265
|
return inspectRunnerService(configPath);
|
|
1257
1266
|
})();
|
|
1258
1267
|
checks.push(...await runnerHostChecks({ configPath, hooks, gateway, repos, runner, service }));
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
|
-
import { runnerDir, RUNNER_DIR_MODE, RUNNER_FILE_MODE } from './chunk-
|
|
3
|
+
import { runnerDir, RUNNER_DIR_MODE, RUNNER_FILE_MODE } from './chunk-GD6KIHOS.js';
|
|
4
4
|
import { readlinkSync, realpathSync, mkdirSync, unlinkSync, symlinkSync, renameSync, readFileSync, writeFileSync, rmSync, existsSync, readdirSync } from 'fs';
|
|
5
5
|
import { join, basename, sep, resolve } from 'path';
|
|
6
6
|
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
|
-
import { skillDir, FORMER_MAINTAINED_NAMES, isMaintainedCopy } from './chunk-7O7LJWQO.js';
|
|
4
3
|
import { cliInvocation } from './chunk-FZKNTIOJ.js';
|
|
5
|
-
import { emitTree,
|
|
4
|
+
import { skillDir, emitTree, targetIds, classifyTree, emitBuilders, defaultAgents, FORMER_MAINTAINED_NAMES, isMaintainedCopy } from './chunk-CKPQOQFC.js';
|
|
6
5
|
import { readFileSync, existsSync, unlinkSync, rmdirSync, readdirSync } from 'fs';
|
|
7
6
|
import { join, dirname, relative, sep } from 'path';
|
|
8
7
|
|
|
@@ -17,7 +16,7 @@ function filesUnder(repoRoot, rel) {
|
|
|
17
16
|
function retiredSkillsPresent(repoRoot) {
|
|
18
17
|
return Object.keys(FORMER_MAINTAINED_NAMES).filter((former) => isMaintainedCopy(repoRoot, former));
|
|
19
18
|
}
|
|
20
|
-
function retiredSkillPaths(repoRoot, retired = retiredSkillsPresent(repoRoot)) {
|
|
19
|
+
function retiredSkillPaths(repoRoot, retired = retiredSkillsPresent(repoRoot), agents = defaultAgents()) {
|
|
21
20
|
const paths = /* @__PURE__ */ new Set();
|
|
22
21
|
for (const former of retired) {
|
|
23
22
|
const sources = filesUnder(repoRoot, skillDir(former));
|
|
@@ -26,8 +25,8 @@ function retiredSkillPaths(repoRoot, retired = retiredSkillsPresent(repoRoot)) {
|
|
|
26
25
|
contents: new Map(sources.map((path) => [path, readFileSync(join(repoRoot, path), "utf8")])),
|
|
27
26
|
// A superset is safe: targets ignore a path that is not a skill asset.
|
|
28
27
|
assetPaths: sources,
|
|
29
|
-
targets:
|
|
30
|
-
});
|
|
28
|
+
targets: targetIds(agents)
|
|
29
|
+
}, emitBuilders(agents));
|
|
31
30
|
for (const path of [...sources, ...compiled.files.map((f) => f.path), ...compiled.copies.map((c) => c.toPath)]) paths.add(path);
|
|
32
31
|
}
|
|
33
32
|
return [...paths].filter((path) => existsSync(join(repoRoot, path))).sort();
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { createRequire } from 'node:module';
|
|
3
|
+
import { C } from './chunk-2AM6Z5BP.js';
|
|
4
|
+
import { readCloudConfig } from './chunk-HWVMRETT.js';
|
|
5
|
+
import { cliInvocation } from './chunk-FZKNTIOJ.js';
|
|
6
|
+
import { defaultAgents, legacyAgent, contextAgents, McpFileError } from './chunk-CKPQOQFC.js';
|
|
7
|
+
import { mkdirSync, writeFileSync, existsSync, readFileSync } from 'fs';
|
|
8
|
+
import { join, dirname } from 'path';
|
|
9
|
+
|
|
10
|
+
createRequire(import.meta.url);
|
|
11
|
+
var McpInstallError = class extends Error {
|
|
12
|
+
};
|
|
13
|
+
function defaultMcpUrl(home) {
|
|
14
|
+
const origin = readCloudConfig(home).url;
|
|
15
|
+
if (!origin) {
|
|
16
|
+
throw new McpInstallError(
|
|
17
|
+
`no gateway URL: pass --url <your gateway>, or run \`${cliInvocation()} login\` first.`
|
|
18
|
+
);
|
|
19
|
+
}
|
|
20
|
+
return `${origin.replace(/\/+$/, "")}/v1/mcp`;
|
|
21
|
+
}
|
|
22
|
+
var API_KEY_ENV_PLACEHOLDER = "${OUTERLAYER_API_KEY}";
|
|
23
|
+
var DEFAULT_MCP_TRANSPORT = "stdio";
|
|
24
|
+
var DEFAULT_MCP_COMMAND = "outerlayer";
|
|
25
|
+
function buildServerEntry(url, appId) {
|
|
26
|
+
const headers = { Authorization: `Bearer ${API_KEY_ENV_PLACEHOLDER}` };
|
|
27
|
+
if (appId) headers["X-Outerlayer-App-Id"] = appId;
|
|
28
|
+
return { type: "http", url, headers };
|
|
29
|
+
}
|
|
30
|
+
function buildStdioServerEntry(command, url, appId) {
|
|
31
|
+
const args = ["mcp", "serve"];
|
|
32
|
+
if (url) args.push("--url", url);
|
|
33
|
+
if (appId) args.push("--app-id", appId);
|
|
34
|
+
return { type: "stdio", command, args };
|
|
35
|
+
}
|
|
36
|
+
function readMcpText(absPath, relPath) {
|
|
37
|
+
if (!existsSync(absPath)) return void 0;
|
|
38
|
+
try {
|
|
39
|
+
return readFileSync(absPath, "utf8");
|
|
40
|
+
} catch {
|
|
41
|
+
throw new McpInstallError(`${relPath} exists and cannot be read \u2014 fix its permissions or remove it, then run the command again`);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
function installErrorFor(err, relPath) {
|
|
45
|
+
if (!(err instanceof McpFileError)) return err;
|
|
46
|
+
switch (err.problem) {
|
|
47
|
+
case "not-json":
|
|
48
|
+
return new McpInstallError(`${relPath} exists and is not valid JSON \u2014 fix or remove it, then run the command again`);
|
|
49
|
+
case "not-object":
|
|
50
|
+
return new McpInstallError(`${relPath} exists and its top level is not a JSON object \u2014 refusing to overwrite`);
|
|
51
|
+
case "servers-not-object":
|
|
52
|
+
return new McpInstallError(`${relPath} has an "mcpServers" value that is not an object \u2014 refusing to overwrite`);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
function setIn(target, text, name, entry, mode) {
|
|
56
|
+
try {
|
|
57
|
+
return target.mcp.setServer(text, name, entry, mode);
|
|
58
|
+
} catch (err) {
|
|
59
|
+
throw installErrorFor(err, target.relPath);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
function mcpTargets(repoRoot, agents) {
|
|
63
|
+
if (existsSync(join(repoRoot, ".outerlayer", "mcp.json"))) return [{ relPath: ".outerlayer/mcp.json", mcp: legacyAgent(agents).adapter.context.mcp }];
|
|
64
|
+
const seen = /* @__PURE__ */ new Set();
|
|
65
|
+
const targets = [];
|
|
66
|
+
for (const { context } of contextAgents(agents)) {
|
|
67
|
+
if (seen.has(context.mcp.file)) continue;
|
|
68
|
+
seen.add(context.mcp.file);
|
|
69
|
+
targets.push({ relPath: context.mcp.file, mcp: context.mcp });
|
|
70
|
+
}
|
|
71
|
+
return targets;
|
|
72
|
+
}
|
|
73
|
+
function mcpTargetPath(repoRoot, agents = defaultAgents()) {
|
|
74
|
+
return mcpTargets(repoRoot, agents)[0].relPath;
|
|
75
|
+
}
|
|
76
|
+
function addMcpEntryIfAbsent(repoRoot, name, entry, agents) {
|
|
77
|
+
const results = mcpTargets(repoRoot, agents).map((target) => {
|
|
78
|
+
const absPath = join(repoRoot, target.relPath);
|
|
79
|
+
const result = setIn(target, readMcpText(absPath, target.relPath), name, entry, "if-absent");
|
|
80
|
+
if (!result.changed) return { path: target.relPath, added: false };
|
|
81
|
+
mkdirSync(dirname(absPath), { recursive: true });
|
|
82
|
+
writeFileSync(absPath, result.text);
|
|
83
|
+
return { path: target.relPath, added: true };
|
|
84
|
+
});
|
|
85
|
+
const [first, ...others] = results;
|
|
86
|
+
return others.length === 0 ? first : { ...first, others };
|
|
87
|
+
}
|
|
88
|
+
function setMcpEntry(repoRoot, name, entry, agents = defaultAgents()) {
|
|
89
|
+
for (const target of mcpTargets(repoRoot, agents)) {
|
|
90
|
+
const absPath = join(repoRoot, target.relPath);
|
|
91
|
+
const result = setIn(target, readMcpText(absPath, target.relPath), name, entry, "replace");
|
|
92
|
+
mkdirSync(dirname(absPath), { recursive: true });
|
|
93
|
+
writeFileSync(absPath, result.text);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
var INIT_STDIO_ENTRY = { type: "stdio", command: "npx", args: ["-y", "@outerlayer/cli", "mcp", "serve"] };
|
|
97
|
+
function addStdioMcpEntryIfAbsent(repoRoot, name = "outerlayer", agents = defaultAgents()) {
|
|
98
|
+
return addMcpEntryIfAbsent(repoRoot, name, { ...INIT_STDIO_ENTRY, args: [...INIT_STDIO_ENTRY.args] }, agents);
|
|
99
|
+
}
|
|
100
|
+
var DOCS_MCP_SERVER_NAME = "outerlayer-docs";
|
|
101
|
+
var DOCS_MCP_URL = "https://docs.outerlayer.ai/mcp";
|
|
102
|
+
var INIT_DOCS_ENTRY = { type: "http", url: DOCS_MCP_URL };
|
|
103
|
+
function addDocsMcpEntryIfAbsent(repoRoot, agents = defaultAgents()) {
|
|
104
|
+
return addMcpEntryIfAbsent(repoRoot, DOCS_MCP_SERVER_NAME, { ...INIT_DOCS_ENTRY }, agents);
|
|
105
|
+
}
|
|
106
|
+
function runMcpInstall(opts = {}, agents = defaultAgents()) {
|
|
107
|
+
const cwd = opts.cwd ?? process.cwd();
|
|
108
|
+
if (!existsSync(cwd)) throw new McpInstallError(`no such directory: ${cwd}`);
|
|
109
|
+
const name = opts.name ?? "outerlayer";
|
|
110
|
+
const transport = opts.transport ?? DEFAULT_MCP_TRANSPORT;
|
|
111
|
+
const url = transport === "http" ? opts.url ?? defaultMcpUrl(opts.home) : opts.url ?? null;
|
|
112
|
+
const entry = transport === "http" ? buildServerEntry(url, opts.appId) : buildStdioServerEntry(opts.command ?? DEFAULT_MCP_COMMAND, url ?? void 0, opts.appId);
|
|
113
|
+
const written = mcpTargets(cwd, agents).map((target) => {
|
|
114
|
+
const absPath = join(cwd, target.relPath);
|
|
115
|
+
const result = setIn(target, readMcpText(absPath, target.relPath), name, entry, "replace");
|
|
116
|
+
mkdirSync(dirname(absPath), { recursive: true });
|
|
117
|
+
writeFileSync(absPath, result.text);
|
|
118
|
+
return { relPath: target.relPath, changed: result.changed };
|
|
119
|
+
});
|
|
120
|
+
const relPath = written.map((file) => file.relPath).join(", ");
|
|
121
|
+
const changed = written.some((file) => file.changed);
|
|
122
|
+
const where = transport === "http" ? `${url}` : `stdio: ${opts.command ?? DEFAULT_MCP_COMMAND} mcp serve`;
|
|
123
|
+
const keyNote = transport === "http" ? `Set OUTERLAYER_API_KEY in your environment \u2014 the key is referenced as ${API_KEY_ENV_PLACEHOLDER}, never written to this file.` : "The key is read from ~/.outerlayer/config.json (or OUTERLAYER_API_KEY) each time the client connects \u2014 never written to this file.";
|
|
124
|
+
const output = opts.json ? JSON.stringify({ path: written[0].relPath, server: name, transport, url, changed }) : changed ? `${C.green}\u2713${C.reset} Wrote "${name}" MCP server (${where}) to ${relPath}
|
|
125
|
+
${C.dim} ${keyNote}${C.reset}` : `${C.dim}"${name}" MCP server already configured in ${relPath} (no change)${C.reset}`;
|
|
126
|
+
if (!opts.quiet) process.stdout.write(output + "\n");
|
|
127
|
+
return { path: written[0].relPath, paths: written.map((file) => file.relPath), server: name, transport, url, changed, output };
|
|
128
|
+
}
|
|
129
|
+
function handleMcpInstallError(err) {
|
|
130
|
+
if (!(err instanceof McpInstallError)) throw err;
|
|
131
|
+
process.stderr.write(`${C.red}\u2717${C.reset} ${err.message}
|
|
132
|
+
`);
|
|
133
|
+
process.exitCode = 1;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
export { DEFAULT_MCP_COMMAND, DOCS_MCP_SERVER_NAME, INIT_DOCS_ENTRY, INIT_STDIO_ENTRY, McpInstallError, addDocsMcpEntryIfAbsent, addStdioMcpEntryIfAbsent, buildServerEntry, buildStdioServerEntry, defaultMcpUrl, handleMcpInstallError, mcpTargetPath, runMcpInstall, setMcpEntry };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
3
|
import { detectActiveSession } from './chunk-IP7BIBXJ.js';
|
|
4
|
-
import { autoConnect } from './chunk-
|
|
4
|
+
import { autoConnect } from './chunk-5FND4PIU.js';
|
|
5
5
|
import { C } from './chunk-2AM6Z5BP.js';
|
|
6
|
-
import { defaultFetch, unauthorizedMessage, resolveGatewayCredentials } from './chunk-
|
|
7
|
-
import { resolveRepoIdentity } from './chunk-
|
|
6
|
+
import { defaultFetch, unauthorizedMessage, resolveGatewayCredentials } from './chunk-JVCQZDQ6.js';
|
|
7
|
+
import { resolveRepoIdentity } from './chunk-5GHJFETA.js';
|
|
8
8
|
import { parseWorkItemEnv } from './chunk-5WYT3PPE.js';
|
|
9
9
|
import { parseTrackerNumber, trackerNumberError } from './chunk-WZBHBH3J.js';
|
|
10
10
|
import { homeFromEnv } from './chunk-352DHUTP.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
|
-
import { loadMachineSkillFiles, resolvePackRoot } from './chunk-
|
|
3
|
+
import { contextAgents, defaultAgents, userSkillFolderIn, loadMachineSkillFiles, resolvePackRoot } from './chunk-CKPQOQFC.js';
|
|
4
4
|
import { MAINTAINED_SKILLS, maintainedLineVersion } from './chunk-CDDED64E.js';
|
|
5
5
|
import { resolvePackageVersion } from './chunk-RA3O54FC.js';
|
|
6
6
|
import { homeFromEnv } from './chunk-352DHUTP.js';
|
|
@@ -10,7 +10,6 @@ import { join, resolve, dirname, relative } from 'path';
|
|
|
10
10
|
|
|
11
11
|
createRequire(import.meta.url);
|
|
12
12
|
var machineSkillsBase = (home) => join(home, ".agents", "skills");
|
|
13
|
-
var claudeSkillsBase = (home) => join(home, ".claude", "skills");
|
|
14
13
|
var errorMessage = (err) => err instanceof Error ? err.message : String(err);
|
|
15
14
|
var defaultLink = (target, path) => {
|
|
16
15
|
if (process.platform === "win32") symlinkSync(resolve(realpathSync(dirname(path)), target), path, "junction");
|
|
@@ -89,19 +88,18 @@ function linksTo(entry, target) {
|
|
|
89
88
|
return false;
|
|
90
89
|
}
|
|
91
90
|
}
|
|
92
|
-
function
|
|
93
|
-
const claude = claudeSkillsBase(home);
|
|
91
|
+
function reachFromAgent(agentFolder, home, name, version, link, mode) {
|
|
94
92
|
const folder = join(machineSkillsBase(home), name);
|
|
95
|
-
if (sameFolder(
|
|
96
|
-
const entry = join(
|
|
93
|
+
if (sameFolder(agentFolder, machineSkillsBase(home))) return;
|
|
94
|
+
const entry = join(agentFolder, name);
|
|
97
95
|
if (mode === "refresh" && !entryExists(entry)) return;
|
|
98
96
|
if (linksTo(entry, folder)) return;
|
|
99
97
|
if (folderExists(entry) && installedVersion(entry) === version) return;
|
|
100
|
-
mkdirSync(
|
|
98
|
+
mkdirSync(agentFolder, { recursive: true });
|
|
101
99
|
try {
|
|
102
|
-
const temporary = tempName(
|
|
100
|
+
const temporary = tempName(agentFolder, "tmp");
|
|
103
101
|
try {
|
|
104
|
-
link(relative(realpathSync(
|
|
102
|
+
link(relative(realpathSync(agentFolder), realpathSync(folder)), temporary);
|
|
105
103
|
rmSync(entry, { recursive: true, force: true });
|
|
106
104
|
renameSync(temporary, entry);
|
|
107
105
|
} finally {
|
|
@@ -116,6 +114,7 @@ function installMachineSkills(opts) {
|
|
|
116
114
|
const version = opts.version ?? resolvePackageVersion();
|
|
117
115
|
const base = machineSkillsBase(opts.home);
|
|
118
116
|
const link = opts.link ?? defaultLink;
|
|
117
|
+
const agentFolders = contextAgents(opts.agents ?? defaultAgents()).map((agent) => userSkillFolderIn(opts.home, agent.descriptor));
|
|
119
118
|
let files;
|
|
120
119
|
const filesOf = (name) => {
|
|
121
120
|
files ??= loadMachineSkillFiles(opts.packRoot ?? resolvePackRoot(), version);
|
|
@@ -133,10 +132,12 @@ function installMachineSkills(opts) {
|
|
|
133
132
|
result.failures.push(`${folder}: ${errorMessage(err)}`);
|
|
134
133
|
continue;
|
|
135
134
|
}
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
135
|
+
for (const agentFolder of agentFolders) {
|
|
136
|
+
try {
|
|
137
|
+
reachFromAgent(agentFolder, opts.home, name, version, link, opts.mode);
|
|
138
|
+
} catch (err) {
|
|
139
|
+
result.failures.push(`${join(agentFolder, name)}: ${errorMessage(err)}`);
|
|
140
|
+
}
|
|
140
141
|
}
|
|
141
142
|
}
|
|
142
143
|
return result;
|
|
@@ -148,26 +149,28 @@ function machineSkillsState(home, version = resolvePackageVersion()) {
|
|
|
148
149
|
return { name, state: installedVersion(folder) === version ? "current" : "stale" };
|
|
149
150
|
});
|
|
150
151
|
}
|
|
151
|
-
function
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
152
|
+
function staleAgentSkills(home, version = resolvePackageVersion(), agents = defaultAgents()) {
|
|
153
|
+
return contextAgents(agents).flatMap(({ descriptor }) => {
|
|
154
|
+
const agentFolder = userSkillFolderIn(home, descriptor);
|
|
155
|
+
if (sameFolder(agentFolder, machineSkillsBase(home))) return [];
|
|
156
|
+
return MAINTAINED_SKILLS.filter((name) => {
|
|
157
|
+
const entry = join(agentFolder, name);
|
|
158
|
+
if (!entryExists(entry)) return false;
|
|
159
|
+
if (linksTo(entry, join(machineSkillsBase(home), name))) return false;
|
|
160
|
+
return installedVersion(entry) !== version;
|
|
161
|
+
}).map((name) => ({ folder: descriptor.context.userSkillFolder, name }));
|
|
159
162
|
});
|
|
160
163
|
}
|
|
161
|
-
function setupMachineSkills(home = homeFromEnv()) {
|
|
164
|
+
function setupMachineSkills(home = homeFromEnv(), agents) {
|
|
162
165
|
try {
|
|
163
|
-
return installMachineSkills({ home, mode: "setup" });
|
|
166
|
+
return installMachineSkills({ home, mode: "setup", agents });
|
|
164
167
|
} catch (err) {
|
|
165
168
|
return { written: [], failures: [errorMessage(err)] };
|
|
166
169
|
}
|
|
167
170
|
}
|
|
168
|
-
function refreshMachineSkills(home = homeFromEnv()) {
|
|
171
|
+
function refreshMachineSkills(home = homeFromEnv(), agents) {
|
|
169
172
|
try {
|
|
170
|
-
installMachineSkills({ home, mode: "refresh" });
|
|
173
|
+
installMachineSkills({ home, mode: "refresh", agents });
|
|
171
174
|
} catch {
|
|
172
175
|
}
|
|
173
176
|
}
|
|
@@ -179,4 +182,4 @@ function machineRefreshSkipped(commandNames, hidden, argv) {
|
|
|
179
182
|
return top === "sync" && argv.includes("--quiet");
|
|
180
183
|
}
|
|
181
184
|
|
|
182
|
-
export { installMachineSkills, machineRefreshSkipped, machineSkillsState, refreshMachineSkills, setupMachineSkills,
|
|
185
|
+
export { installMachineSkills, machineRefreshSkipped, machineSkillsState, refreshMachineSkills, setupMachineSkills, staleAgentSkills };
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
|
-
import { placeholderQueues, placeholderProblem } from './chunk-
|
|
4
|
-
import { checkFit, RUNNER_RESERVE_BYTES } from './chunk-
|
|
5
|
-
import { isBuiltinVm, builtinKind, EGRESS_SWITCHABLE_KEYS, imageBuildOf, keepsHostBuilder } from './chunk-
|
|
6
|
-
import { realBuildDiskProbe, checkDiskFit, DEFAULT_CACHE_DISK, DEFAULT_BUILD_DISK } from './chunk-
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
3
|
+
import { placeholderQueues, placeholderProblem } from './chunk-6LO62EQ5.js';
|
|
4
|
+
import { checkFit, RUNNER_RESERVE_BYTES } from './chunk-TYCZVJTB.js';
|
|
5
|
+
import { isBuiltinVm, builtinKind, EGRESS_SWITCHABLE_KEYS, imageBuildOf, keepsHostBuilder } from './chunk-NTMRMBLM.js';
|
|
6
|
+
import { realBuildDiskProbe, checkDiskFit, DEFAULT_CACHE_DISK, DEFAULT_BUILD_DISK } from './chunk-ESSJPSJ2.js';
|
|
7
|
+
import { getJson, WorkCommandError } from './chunk-QJDX6VJS.js';
|
|
8
|
+
import { ensureHostKey } from './chunk-6JJITHBI.js';
|
|
9
|
+
import { BUILD_SLICE_MEMORY_ENV, forwardedVariables, credentialAgent, credentialForms, managedKeyName, builderDiskPinned, agentCredentialVariablesSet, agentCredential, storeVariables, credentialEnvPath, parseRunnerEnv } from './chunk-J7Y3PCO2.js';
|
|
10
|
+
import { defaultAgents } from './chunk-CKPQOQFC.js';
|
|
11
11
|
import { closeSync, openSync, constants, readFileSync } from 'fs';
|
|
12
12
|
import { join, dirname } from 'path';
|
|
13
13
|
import { totalmem } from 'os';
|
|
@@ -69,7 +69,7 @@ function sliceMemoryOf(env) {
|
|
|
69
69
|
const bytes = Number(env[BUILD_SLICE_MEMORY_ENV]);
|
|
70
70
|
return Number.isSafeInteger(bytes) && bytes > 0 ? bytes : void 0;
|
|
71
71
|
}
|
|
72
|
-
function managedProblems(facts) {
|
|
72
|
+
function managedProblems(facts, agents = defaultAgents()) {
|
|
73
73
|
const problems = [];
|
|
74
74
|
if (builtinKind(facts.provision) !== "vm") {
|
|
75
75
|
problems.push({
|
|
@@ -83,11 +83,13 @@ function managedProblems(facts) {
|
|
|
83
83
|
const advice = problem.includes("pins no helper") || problem.includes("runner install") ? "" : ". Run `outerlayer runner install --service --replace` to install the root helper, then restart the service";
|
|
84
84
|
problems.push({ condition: "jailer", reason: `builds would run without the jailer, which a managed runner does not allow: ${problem}${advice}` });
|
|
85
85
|
}
|
|
86
|
-
const held =
|
|
87
|
-
|
|
86
|
+
const held = forwardedVariables(agents).filter((variable) => facts.credentials.has(variable));
|
|
87
|
+
const owner = credentialAgent(agents);
|
|
88
|
+
if (held.length > 0 && owner !== void 0) {
|
|
89
|
+
const { label, envFile } = credentialForms(owner.descriptor);
|
|
88
90
|
problems.push({
|
|
89
91
|
condition: "credential",
|
|
90
|
-
reason: `a managed runner holds no
|
|
92
|
+
reason: `a managed runner holds no ${label} credential of its own: it gets the factory's ${managedKeyName(agents)} from each claim. ${held.join(" and ")} ${held.length === 1 ? "is" : "are"} set in the runner's environment, runner.env or ${envFile}. Remove ${held.length === 1 ? "it" : "them"} from the environment and from the runner.env and ${envFile} beside the config, then restart the service`
|
|
91
93
|
});
|
|
92
94
|
}
|
|
93
95
|
if (facts.allowHosts === void 0) {
|
|
@@ -118,10 +120,11 @@ function managedProblems(facts) {
|
|
|
118
120
|
}
|
|
119
121
|
return problems;
|
|
120
122
|
}
|
|
121
|
-
function credentialsInFiles(configPath) {
|
|
123
|
+
function credentialsInFiles(configPath, agents) {
|
|
122
124
|
const found = /* @__PURE__ */ new Set();
|
|
123
125
|
if (configPath === void 0) return found;
|
|
124
|
-
|
|
126
|
+
const own = credentialEnvPath(configPath, agents);
|
|
127
|
+
for (const path of [join(dirname(configPath), "runner.env"), ...own === void 0 ? [] : [own]]) {
|
|
125
128
|
let text;
|
|
126
129
|
try {
|
|
127
130
|
text = readFileSync(path, "utf8");
|
|
@@ -129,28 +132,28 @@ function credentialsInFiles(configPath) {
|
|
|
129
132
|
continue;
|
|
130
133
|
}
|
|
131
134
|
const values = parseRunnerEnv(text);
|
|
132
|
-
for (const variable of
|
|
135
|
+
for (const variable of forwardedVariables(agents)) if ((values[variable] ?? "").trim() !== "") found.add(variable);
|
|
133
136
|
}
|
|
134
137
|
return found;
|
|
135
138
|
}
|
|
136
|
-
function managedFactsOf(config, probes) {
|
|
139
|
+
function managedFactsOf(config, probes, agents = defaultAgents()) {
|
|
137
140
|
return {
|
|
138
141
|
provision: config.hooks.provision,
|
|
139
142
|
jailer: probes.jailer ?? "unknown",
|
|
140
|
-
credentials: /* @__PURE__ */ new Set([...
|
|
143
|
+
credentials: /* @__PURE__ */ new Set([...agentCredentialVariablesSet(probes.env, {}, agents), ...credentialsInFiles(config.configPath, agents)]),
|
|
141
144
|
allowHosts: config.build?.allowHosts,
|
|
142
145
|
egress: config.build?.egress,
|
|
143
146
|
imageBuild: imageBuildOf(config),
|
|
144
147
|
builderDiskPinned: probes.builderDiskPinned ?? builderDiskPinned()
|
|
145
148
|
};
|
|
146
149
|
}
|
|
147
|
-
function checkBlockedWithSlots(config, probes) {
|
|
150
|
+
function checkBlockedWithSlots(config, probes, agents = defaultAgents()) {
|
|
148
151
|
const blocked = (reason) => ({ blocked: { reason } });
|
|
149
152
|
let slots;
|
|
150
153
|
const placeholders = placeholderQueues(config);
|
|
151
154
|
if (placeholders.length > 0) return blocked(`${placeholderProblem(placeholders)}. The runner takes work again once the config is edited`);
|
|
152
155
|
if (config.managed === true) {
|
|
153
|
-
const unmet = managedProblems(managedFactsOf(config, probes))[0];
|
|
156
|
+
const unmet = managedProblems(managedFactsOf(config, probes, agents), agents)[0];
|
|
154
157
|
if (unmet !== void 0) return blocked(unmet.reason);
|
|
155
158
|
}
|
|
156
159
|
const kind = builtinKind(config.hooks.provision);
|
|
@@ -194,11 +197,13 @@ function checkBlockedWithSlots(config, probes) {
|
|
|
194
197
|
}
|
|
195
198
|
if (builder !== "usable") return { blocked: { reason: `${builder.problem}. The runner takes work again once its image builder works` }, slots };
|
|
196
199
|
}
|
|
197
|
-
|
|
200
|
+
const owner = credentialAgent(agents);
|
|
201
|
+
if (kind !== "own" && config.managed !== true && owner !== void 0 && agentCredential(probes.env, {}, agents) === void 0) {
|
|
202
|
+
const forms = credentialForms(owner.descriptor);
|
|
198
203
|
return {
|
|
199
204
|
slots,
|
|
200
205
|
blocked: {
|
|
201
|
-
reason:
|
|
206
|
+
reason: `there is no ${forms.label} credential in the runner's environment. Store ${storeVariables(forms)} with \`outerlayer runner init --agent ${forms.runnerName}\`, which writes the ${forms.envFile} beside the config, then restart the service`
|
|
202
207
|
}
|
|
203
208
|
};
|
|
204
209
|
}
|