@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,25 +1,28 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
|
-
import { checkStarterFiles, contextIsGoverned } from './chunk-
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { fleetCheck, checkBuildSkill, checkMachineSkills, checkCommittedMaintainedSkills, checkMaintainedReferences, checkIgnoredSkillFolders } from './chunk-MOOZJRKM.js';
|
|
3
|
+
import { checkStarterFiles, contextIsGoverned } from './chunk-LHHDX7FB.js';
|
|
4
|
+
import { fleetCheck, checkBuildSkill, checkMachineSkills, checkCommittedMaintainedSkills, checkMaintainedReferences, checkIgnoredSkillFolders } from './chunk-SJJXDU2J.js';
|
|
5
|
+
import { resolveCredentials, getJson, WorkCommandError } from './chunk-AQE6E54X.js';
|
|
6
|
+
import { isLinkedRepository } from './chunk-FRMAQ3C4.js';
|
|
8
7
|
import { sanitizeTerminal } from './chunk-P6PHY33P.js';
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
8
|
+
import { SUPPORTED_VERSIONS, resolveRepoIdentity } from './chunk-6KH3NMIT.js';
|
|
9
|
+
import { C } from './chunk-2AM6Z5BP.js';
|
|
10
|
+
import { checkFormerSkillNames } from './chunk-B36NSEUM.js';
|
|
11
|
+
import { resolveGatewayCredentials, defaultFetch } from './chunk-NXQK2I3G.js';
|
|
12
|
+
import { sanitizeForContext, spoolDir, assessSyncHealth, readSyncStatus, SYNC_STALE_AFTER_MS, formatAgo, checkInstalledCliStaleness, workspaceRootOf, hookFiredMarkerPath, refreshCommand } from './chunk-O3MJAHLI.js';
|
|
13
|
+
import { readStatuslineState, STATE_FRESH_MS } from './chunk-I4DM7SNX.js';
|
|
14
|
+
import { withInjectedPrograms } from './chunk-4DLJ343I.js';
|
|
15
|
+
import { CONTROL_PLANE_DIR_VARIABLE } from './chunk-BSPJI5T7.js';
|
|
14
16
|
import { findGitDirs } from './chunk-BJ3KTMDH.js';
|
|
15
|
-
import { resolveRepoIdentity, compareVersions, SUPPORTED_VERSIONS } from './chunk-5GHJFETA.js';
|
|
16
17
|
import { cliInvocation } from './chunk-FZKNTIOJ.js';
|
|
17
|
-
import {
|
|
18
|
+
import { installAgents, withSettingsText } from './chunk-HTRDL42C.js';
|
|
19
|
+
import { cliForInstall, cliBinResolvable } from './chunk-ZHQC43NH.js';
|
|
18
20
|
import { readDeliveryRecord, readDegraded, readSourceCache } from './chunk-YQR6E6OV.js';
|
|
19
21
|
import { deadHooksState, preparePackageManagerCommand } from './chunk-CJPTUU2E.js';
|
|
22
|
+
import { defaultAgents, legacyAgent, contextAgents } from './chunk-I6U6QPN6.js';
|
|
20
23
|
import { homeFromEnv } from './chunk-352DHUTP.js';
|
|
21
|
-
import { readFileSync, mkdirSync, writeFileSync, renameSync, existsSync, accessSync, constants, statSync
|
|
22
|
-
import { join, dirname, resolve, delimiter } from 'path';
|
|
24
|
+
import { readFileSync, mkdirSync, writeFileSync, renameSync, existsSync, accessSync, constants, statSync } from 'fs';
|
|
25
|
+
import { sep, join, dirname, resolve, delimiter } from 'path';
|
|
23
26
|
import { execFileSync } from 'child_process';
|
|
24
27
|
|
|
25
28
|
createRequire(import.meta.url);
|
|
@@ -74,42 +77,42 @@ function updateManifest(home, opts, mutate) {
|
|
|
74
77
|
if (manifest && JSON.stringify(withoutUpdatedAt(next)) === JSON.stringify(withoutUpdatedAt(JSON.parse(before)))) return;
|
|
75
78
|
writeManifest(home, next);
|
|
76
79
|
}
|
|
77
|
-
function recordInstall(home,
|
|
80
|
+
function recordInstall(home, settingsPath, record, now = Date.now) {
|
|
78
81
|
updateManifest(home, { createIfMissing: true }, (manifest) => {
|
|
79
|
-
manifest.installs[
|
|
82
|
+
manifest.installs[settingsPath] = {
|
|
80
83
|
cliBin: record.cliBin,
|
|
81
84
|
events: [...record.events],
|
|
82
85
|
updatedAt: new Date(now()).toISOString()
|
|
83
86
|
};
|
|
84
87
|
});
|
|
85
88
|
}
|
|
86
|
-
function recordRemoval(home,
|
|
89
|
+
function recordRemoval(home, settingsPath) {
|
|
87
90
|
updateManifest(home, { createIfMissing: false }, (manifest) => {
|
|
88
|
-
delete manifest.installs[
|
|
89
|
-
delete manifest.wrapped[
|
|
90
|
-
delete manifest.statusline[
|
|
91
|
+
delete manifest.installs[settingsPath];
|
|
92
|
+
delete manifest.wrapped[settingsPath];
|
|
93
|
+
delete manifest.statusline[settingsPath];
|
|
91
94
|
});
|
|
92
95
|
}
|
|
93
|
-
function recordWrapped(home,
|
|
96
|
+
function recordWrapped(home, settingsPath, wrapped, now = Date.now) {
|
|
94
97
|
if (wrapped.length === 0) return;
|
|
95
98
|
updateManifest(home, { createIfMissing: true }, (manifest) => {
|
|
96
|
-
const existing = manifest.wrapped[
|
|
99
|
+
const existing = manifest.wrapped[settingsPath] ?? [];
|
|
97
100
|
const at = new Date(now()).toISOString();
|
|
98
101
|
for (const w of wrapped) {
|
|
99
102
|
if (existing.some((e) => e.event === w.event && e.original === w.original)) continue;
|
|
100
103
|
existing.push({ event: w.event, original: w.original, updatedAt: at });
|
|
101
104
|
}
|
|
102
|
-
manifest.wrapped[
|
|
105
|
+
manifest.wrapped[settingsPath] = existing;
|
|
103
106
|
});
|
|
104
107
|
}
|
|
105
|
-
function recordUnwrapped(home,
|
|
108
|
+
function recordUnwrapped(home, settingsPath) {
|
|
106
109
|
updateManifest(home, { createIfMissing: false }, (manifest) => {
|
|
107
|
-
delete manifest.wrapped[
|
|
110
|
+
delete manifest.wrapped[settingsPath];
|
|
108
111
|
});
|
|
109
112
|
}
|
|
110
|
-
function recordStatusline(home,
|
|
113
|
+
function recordStatusline(home, settingsPath, outcome, original, now = Date.now) {
|
|
111
114
|
updateManifest(home, { createIfMissing: true }, (manifest) => {
|
|
112
|
-
manifest.statusline[
|
|
115
|
+
manifest.statusline[settingsPath] = {
|
|
113
116
|
outcome,
|
|
114
117
|
...original !== void 0 ? { original } : {},
|
|
115
118
|
updatedAt: new Date(now()).toISOString()
|
|
@@ -118,7 +121,7 @@ function recordStatusline(home, settingsPath2, outcome, original, now = Date.now
|
|
|
118
121
|
}
|
|
119
122
|
var NAME = "MCP server";
|
|
120
123
|
var SERVER = "outerlayer";
|
|
121
|
-
var
|
|
124
|
+
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
125
|
function expand(value, env) {
|
|
123
126
|
return value.replace(/\$\{([A-Za-z_][A-Za-z0-9_]*)\}/g, (_m, name) => env[name] ?? "");
|
|
124
127
|
}
|
|
@@ -145,60 +148,76 @@ function resolveCommand(command, root, env, platform) {
|
|
|
145
148
|
}
|
|
146
149
|
return void 0;
|
|
147
150
|
}
|
|
148
|
-
function checkMcpCommand(cwd, env = process.env, platform = process.platform) {
|
|
151
|
+
function checkMcpCommand(cwd, env = process.env, platform = process.platform, agents = defaultAgents()) {
|
|
149
152
|
const root = findGitDirs(cwd ?? process.cwd())?.repoRoot;
|
|
150
153
|
if (root === void 0) return [];
|
|
151
|
-
const
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
154
|
+
const files = [...new Set(contextAgents(agents).map((agent) => agent.context.mcp))];
|
|
155
|
+
return files.flatMap((mcp) => {
|
|
156
|
+
const path = join(root, mcp.file);
|
|
157
|
+
if (!existsSync(path)) return [];
|
|
158
|
+
let text;
|
|
159
|
+
try {
|
|
160
|
+
text = readFileSync(path, "utf8");
|
|
161
|
+
} catch {
|
|
162
|
+
text = void 0;
|
|
163
|
+
}
|
|
164
|
+
const servers = text === void 0 ? void 0 : mcp.servers(text);
|
|
165
|
+
if (servers === void 0) {
|
|
166
|
+
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}.` }];
|
|
167
|
+
}
|
|
168
|
+
const command = servers[SERVER]?.command;
|
|
169
|
+
if (typeof command !== "string") return [];
|
|
170
|
+
const shown = sanitizeTerminal(command);
|
|
171
|
+
const resolved = resolveCommand(expand(command, env), root, env, platform);
|
|
172
|
+
if (resolved === void 0) {
|
|
173
|
+
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) }];
|
|
174
|
+
}
|
|
175
|
+
return [{ name: NAME, status: "pass", detail: `the "outerlayer" server runs ${sanitizeTerminal(resolved)}` }];
|
|
176
|
+
});
|
|
167
177
|
}
|
|
168
178
|
|
|
169
179
|
// src/doctor.ts
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
}
|
|
180
|
+
function laptopChecksNotApplicable(label) {
|
|
181
|
+
return {
|
|
182
|
+
name: "Laptop checks",
|
|
183
|
+
status: "skipped",
|
|
184
|
+
detail: `this is a runner host, which runs builds and no sessions of its own, so the ${label} home, transcripts, hooks, spool, daemon and status line do not apply`
|
|
185
|
+
};
|
|
186
|
+
}
|
|
175
187
|
function runDoctor(env = {}) {
|
|
176
188
|
const home = env.home ?? homeFromEnv();
|
|
177
189
|
const now = env.now ?? Date.now;
|
|
190
|
+
const cwd = env.cwd ?? process.cwd();
|
|
191
|
+
const agents = withInjectedPrograms(env.agents ?? defaultAgents(), { version: env.claudeVersion, installs: env.claudeInstalls });
|
|
192
|
+
const legacy = legacyAgent(agents);
|
|
178
193
|
const laptop = env.runnerHost !== true;
|
|
179
194
|
const buildsInOwnImages = env.runnerHost === true && (env.runnerHooks === "builtin:container" || env.runnerHooks === "builtin:vm");
|
|
180
|
-
const
|
|
195
|
+
const sections = ["retention", "settings", "installs", "control-plane-hooks", ...laptop ? ["home"] : [], ...buildsInOwnImages ? [] : ["version"]];
|
|
196
|
+
const byAgent = agents.map((agent) => agent.adapter.diagnostics?.checks({ home, cwd, now, runnerHost: !laptop, sections, cli: cliInvocation(), controlPlaneVariable: CONTROL_PLANE_DIR_VARIABLE, separator: sep, tested: { from: SUPPORTED_VERSIONS.min, to: SUPPORTED_VERSIONS.max } }) ?? {});
|
|
197
|
+
const section = (name) => byAgent.flatMap((checks) => checks[name] ?? []);
|
|
198
|
+
const found = laptop ? legacy.adapter.diagnostics?.sessions(home) : void 0;
|
|
199
|
+
const transcripts = laptop ? { exists: found !== void 0, count: found?.count ?? 0, newest: found?.newest ?? 0 } : void 0;
|
|
181
200
|
const starter = laptop ? checkStarterFiles(env.cwd) : void 0;
|
|
182
201
|
return [
|
|
183
|
-
...laptop ? [
|
|
202
|
+
...laptop ? [...section("home"), checkTranscripts(transcripts, now, legacy), ...checkHooks(home, env.cwd, transcripts, now, agents)] : [laptopChecksNotApplicable(legacy.descriptor.label)],
|
|
184
203
|
...checkDeadHooksState(env.cwd),
|
|
185
|
-
...laptop ? [checkSpoolWritable(home)] : [],
|
|
204
|
+
...laptop ? [checkSpoolWritable(home, legacy)] : [],
|
|
186
205
|
...buildsInOwnImages ? [] : [checkLastSync(home, now)],
|
|
187
206
|
...laptop ? [checkDaemon(home)] : [],
|
|
188
|
-
|
|
207
|
+
...section("retention"),
|
|
189
208
|
checkDiskHeadroom(home),
|
|
190
|
-
...buildsInOwnImages ? [] :
|
|
191
|
-
|
|
192
|
-
...laptop ? checkStatusline(home, now, env.cwd) : [],
|
|
193
|
-
...
|
|
209
|
+
...buildsInOwnImages ? [] : section("version"),
|
|
210
|
+
...section("settings"),
|
|
211
|
+
...laptop ? checkStatusline(home, now, env.cwd, agents) : [],
|
|
212
|
+
...section("installs"),
|
|
194
213
|
...starter?.checks ?? [],
|
|
195
214
|
...laptop ? checkRenamedSkills(env.cwd) : [],
|
|
196
215
|
...checkBuildSkillState(env.cwd, home),
|
|
197
216
|
...checkIgnoredSkills(env.cwd),
|
|
198
217
|
...starter !== void 0 && !starter.mcpOutdated ? checkMcpCommand(env.cwd, env.processEnv) : [],
|
|
199
|
-
...checkContextSource(env.cwd),
|
|
218
|
+
...checkContextSource(env.cwd, legacy),
|
|
200
219
|
...checkGovernsList(env.cwd),
|
|
201
|
-
...
|
|
220
|
+
...section("control-plane-hooks"),
|
|
202
221
|
...checkInstalledCli(home, env.cwd ?? process.cwd())
|
|
203
222
|
];
|
|
204
223
|
}
|
|
@@ -265,31 +284,31 @@ function installedCliFix(workspaceDistDir, trusted) {
|
|
|
265
284
|
const root = sanitizeForContext(workspaceRootOf(workspaceDistDir));
|
|
266
285
|
return `Workspace build found at ${root}. Rebuild it (yarn workspace @outerlayer/cli build) and copy packages/cli/dist to ~/.outerlayer/cli/dist to refresh the installed copy.`;
|
|
267
286
|
}
|
|
268
|
-
function checkStatusline(home, now, cwd) {
|
|
287
|
+
function checkStatusline(home, now, cwd, agents) {
|
|
269
288
|
const name = "Status line";
|
|
270
289
|
let installed = false;
|
|
271
290
|
let wrapping;
|
|
272
291
|
let foreign;
|
|
292
|
+
const agent = legacyInstallAgent(agents);
|
|
293
|
+
const where = { home, cwd: cwd ?? process.cwd() };
|
|
294
|
+
const cli = cliForInstall();
|
|
273
295
|
for (const scope of ["user", "project"]) {
|
|
274
|
-
let
|
|
296
|
+
let state2;
|
|
275
297
|
try {
|
|
276
|
-
|
|
298
|
+
state2 = installedState(agent, agent.install.settingsFile(scope, where), cli);
|
|
277
299
|
} catch {
|
|
278
300
|
continue;
|
|
279
301
|
}
|
|
280
|
-
|
|
281
|
-
if (!slot || typeof slot !== "object") continue;
|
|
282
|
-
if (isOurStatuslineSlot(slot)) {
|
|
302
|
+
if (state2.statusline.slot === "ours") {
|
|
283
303
|
installed = true;
|
|
284
|
-
|
|
285
|
-
if (original !== null) wrapping = original;
|
|
304
|
+
wrapping = state2.statusline.wrapping;
|
|
286
305
|
break;
|
|
287
306
|
}
|
|
288
|
-
if (
|
|
307
|
+
if (state2.statusline.slot === "foreign") foreign = state2.statusline.command;
|
|
289
308
|
}
|
|
290
309
|
if (!installed) {
|
|
291
310
|
const manifest = readManifest(home);
|
|
292
|
-
const record = ["user", "project"].map((scope) => manifest?.statusline[
|
|
311
|
+
const record = ["user", "project"].map((scope) => manifest?.statusline[agent.install.settingsFile(scope, where)]).find((r) => r !== void 0);
|
|
293
312
|
if (record) {
|
|
294
313
|
return [{
|
|
295
314
|
name,
|
|
@@ -319,47 +338,21 @@ function checkStatusline(home, now, cwd) {
|
|
|
319
338
|
checks.push({ name: stateName, status: "pass", detail: `fresh (${formatAgo(age)})` });
|
|
320
339
|
return checks;
|
|
321
340
|
}
|
|
322
|
-
function
|
|
323
|
-
const
|
|
324
|
-
|
|
325
|
-
}
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
if (!existsSync(root)) return { exists: false, count, newest };
|
|
331
|
-
const walk = (dir) => {
|
|
332
|
-
let entries;
|
|
333
|
-
try {
|
|
334
|
-
entries = readdirSync(dir, { withFileTypes: true });
|
|
335
|
-
} catch {
|
|
336
|
-
return;
|
|
337
|
-
}
|
|
338
|
-
for (const entry of entries) {
|
|
339
|
-
const p = join(dir, entry.name);
|
|
340
|
-
if (!entry.isDirectory() && !entry.isSymbolicLink() && !entry.name.endsWith(".jsonl")) continue;
|
|
341
|
-
let st;
|
|
342
|
-
try {
|
|
343
|
-
st = statSync(p);
|
|
344
|
-
} catch {
|
|
345
|
-
continue;
|
|
346
|
-
}
|
|
347
|
-
if (st.isDirectory()) walk(p);
|
|
348
|
-
else if (entry.name.endsWith(".jsonl") && st.size > 0) {
|
|
349
|
-
count += 1;
|
|
350
|
-
if (st.mtimeMs > newest) newest = st.mtimeMs;
|
|
351
|
-
}
|
|
352
|
-
}
|
|
353
|
-
};
|
|
354
|
-
walk(root);
|
|
355
|
-
return { exists: true, count, newest };
|
|
341
|
+
function legacyInstallAgent(agents) {
|
|
342
|
+
const id = legacyAgent(agents).descriptor.id;
|
|
343
|
+
const found = installAgents(agents).find((agent) => agent.entry.descriptor.id === id);
|
|
344
|
+
if (found === void 0) throw new Error(`the agent ${id} keeps no hook settings`);
|
|
345
|
+
return found;
|
|
346
|
+
}
|
|
347
|
+
function installedState(agent, path, cli) {
|
|
348
|
+
return withSettingsText(path, (text) => agent.install.installed(text, cli));
|
|
356
349
|
}
|
|
357
|
-
function checkTranscripts(transcripts, now) {
|
|
350
|
+
function checkTranscripts(transcripts, now, agent) {
|
|
358
351
|
if (!transcripts.exists) {
|
|
359
|
-
return { name: "Transcripts", status: "warn", detail: "no projects directory yet", fix:
|
|
352
|
+
return { name: "Transcripts", status: "warn", detail: "no projects directory yet", fix: `Run a ${agent.descriptor.label} session, then re-check.` };
|
|
360
353
|
}
|
|
361
354
|
if (transcripts.count === 0) {
|
|
362
|
-
return { name: "Transcripts", status: "warn", detail: "0 transcripts found", fix: `Run a
|
|
355
|
+
return { name: "Transcripts", status: "warn", detail: "0 transcripts found", fix: `Run a ${agent.descriptor.label} session, then run \`${cliInvocation()} doctor\` again.` };
|
|
363
356
|
}
|
|
364
357
|
const age = formatAgeH(now() - transcripts.newest);
|
|
365
358
|
return { name: "Transcripts", status: "pass", detail: `${transcripts.count} transcripts, newest ${age}` };
|
|
@@ -369,9 +362,9 @@ function formatAgeH(ms) {
|
|
|
369
362
|
return ageH < 1 ? "<1h ago" : ageH < 48 ? `${Math.round(ageH)}h ago` : `${Math.round(ageH / 24)}d ago`;
|
|
370
363
|
}
|
|
371
364
|
var HOOK_FIRING_GAP_MS = 24 * 60 * 60 * 1e3;
|
|
372
|
-
function newestHookFiring(home) {
|
|
365
|
+
function newestHookFiring(home, events) {
|
|
373
366
|
let newest = null;
|
|
374
|
-
for (const event of
|
|
367
|
+
for (const event of events) {
|
|
375
368
|
try {
|
|
376
369
|
const ms = statSync(hookFiredMarkerPath(event, home)).mtimeMs;
|
|
377
370
|
if (newest === null || ms > newest) newest = ms;
|
|
@@ -380,13 +373,14 @@ function newestHookFiring(home) {
|
|
|
380
373
|
}
|
|
381
374
|
return newest;
|
|
382
375
|
}
|
|
383
|
-
function checkHooks(home, cwd, transcripts, now) {
|
|
384
|
-
const
|
|
376
|
+
function checkHooks(home, cwd, transcripts, now, agents) {
|
|
377
|
+
const agent = legacyInstallAgent(agents);
|
|
378
|
+
const lastFired = newestHookFiring(home, agent.events);
|
|
385
379
|
const firingFresh = lastFired !== null && transcripts.count > 0 && transcripts.newest - lastFired <= HOOK_FIRING_GAP_MS;
|
|
386
|
-
const checks = [checkHooksInstalled(home, cwd, firingFresh)];
|
|
387
|
-
const firing = checkHooksFiring(transcripts, lastFired, now);
|
|
380
|
+
const checks = [checkHooksInstalled(home, cwd, firingFresh, agent)];
|
|
381
|
+
const firing = checkHooksFiring(transcripts, lastFired, now, agent.entry);
|
|
388
382
|
if (firing) checks.push(firing);
|
|
389
|
-
const wrapped = checkWrappedHooks(home, cwd);
|
|
383
|
+
const wrapped = checkWrappedHooks(home, cwd, agent);
|
|
390
384
|
if (wrapped) checks.push(wrapped);
|
|
391
385
|
return checks;
|
|
392
386
|
}
|
|
@@ -399,24 +393,24 @@ function isExecutable(path) {
|
|
|
399
393
|
return false;
|
|
400
394
|
}
|
|
401
395
|
}
|
|
402
|
-
function checkHooksInstalled(home, cwd, firingFresh) {
|
|
396
|
+
function checkHooksInstalled(home, cwd, firingFresh, agent) {
|
|
403
397
|
const name = "Hooks installed";
|
|
398
|
+
const where = { home, cwd: cwd ?? process.cwd() };
|
|
399
|
+
const cli = cliForInstall();
|
|
404
400
|
const readablePaths = [];
|
|
405
401
|
for (const scope of ["user", "project"]) {
|
|
406
|
-
const path =
|
|
407
|
-
let
|
|
402
|
+
const path = agent.install.settingsFile(scope, where);
|
|
403
|
+
let state;
|
|
408
404
|
try {
|
|
409
|
-
|
|
405
|
+
state = installedState(agent, path, cli);
|
|
410
406
|
} catch {
|
|
411
407
|
continue;
|
|
412
408
|
}
|
|
413
409
|
readablePaths.push(path);
|
|
414
|
-
if (!
|
|
415
|
-
const installed =
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
if (installed.length === REGISTERED_EVENTS.length) {
|
|
419
|
-
const missing = ourCommandBins(settings).filter((bin) => !cliBinResolvable(bin));
|
|
410
|
+
if (!state.hasHooks) continue;
|
|
411
|
+
const installed = state.events;
|
|
412
|
+
if (installed.length === agent.events.length) {
|
|
413
|
+
const missing = state.bins.filter((bin) => !cliBinResolvable(bin));
|
|
420
414
|
if (missing.length > 0) {
|
|
421
415
|
return {
|
|
422
416
|
name,
|
|
@@ -425,7 +419,7 @@ function checkHooksInstalled(home, cwd, firingFresh) {
|
|
|
425
419
|
fix: `Run \`${cliInvocation()} init\` to reinstall.`
|
|
426
420
|
};
|
|
427
421
|
}
|
|
428
|
-
const unexecutable =
|
|
422
|
+
const unexecutable = state.directScriptBins.filter((bin) => !isExecutable(bin));
|
|
429
423
|
if (unexecutable.length > 0) {
|
|
430
424
|
return {
|
|
431
425
|
name,
|
|
@@ -456,30 +450,23 @@ function checkHooksInstalled(home, cwd, firingFresh) {
|
|
|
456
450
|
}
|
|
457
451
|
return { name, status: "fail", detail: "no OuterLayer hooks found", fix: `Run \`${cliInvocation()} init\`.` };
|
|
458
452
|
}
|
|
459
|
-
function checkWrappedHooks(home, cwd) {
|
|
453
|
+
function checkWrappedHooks(home, cwd, agent) {
|
|
460
454
|
const manifest = readManifest(home);
|
|
461
455
|
if (!manifest) return null;
|
|
456
|
+
const where = { home, cwd: cwd ?? process.cwd() };
|
|
457
|
+
const cli = cliForInstall();
|
|
462
458
|
const missing = [];
|
|
463
459
|
for (const scope of ["user", "project"]) {
|
|
464
|
-
const path =
|
|
460
|
+
const path = agent.install.settingsFile(scope, where);
|
|
465
461
|
const records = manifest.wrapped[path];
|
|
466
462
|
if (!records || records.length === 0) continue;
|
|
467
|
-
let
|
|
463
|
+
let state;
|
|
468
464
|
try {
|
|
469
|
-
|
|
465
|
+
state = installedState(agent, path, cli);
|
|
470
466
|
} catch {
|
|
471
467
|
continue;
|
|
472
468
|
}
|
|
473
|
-
const present =
|
|
474
|
-
const hooks = settings?.hooks ?? {};
|
|
475
|
-
for (const event of Object.keys(hooks)) {
|
|
476
|
-
for (const block of hooks[event] ?? []) {
|
|
477
|
-
for (const h of block.hooks ?? []) {
|
|
478
|
-
const original = wrappedOriginalCommand(h);
|
|
479
|
-
if (original !== null) present.add(`${event}\0${original}`);
|
|
480
|
-
}
|
|
481
|
-
}
|
|
482
|
-
}
|
|
469
|
+
const present = new Set(state.wrapped.map((entry) => `${entry.event}\0${entry.original}`));
|
|
483
470
|
for (const r of records) {
|
|
484
471
|
if (!present.has(`${r.event}\0${r.original}`)) missing.push(`${r.event}: ${r.original}`);
|
|
485
472
|
}
|
|
@@ -492,7 +479,7 @@ function checkWrappedHooks(home, cwd) {
|
|
|
492
479
|
fix: `Run \`${cliInvocation()} hooks wrap\` to re-wrap, or \`${cliInvocation()} hooks unwrap\` if the wrap is no longer wanted.`
|
|
493
480
|
};
|
|
494
481
|
}
|
|
495
|
-
function checkHooksFiring(transcripts, lastFired, now) {
|
|
482
|
+
function checkHooksFiring(transcripts, lastFired, now, agent) {
|
|
496
483
|
const name = "Hooks firing";
|
|
497
484
|
if (transcripts.count === 0) return null;
|
|
498
485
|
if (lastFired === null) {
|
|
@@ -500,7 +487,7 @@ function checkHooksFiring(transcripts, lastFired, now) {
|
|
|
500
487
|
name,
|
|
501
488
|
status: "warn",
|
|
502
489
|
detail: "no firing evidence recorded yet \u2014 every hook run writes a marker, and none exists",
|
|
503
|
-
fix:
|
|
490
|
+
fix: `Start a ${agent.descriptor.label} session, then re-run doctor.`
|
|
504
491
|
};
|
|
505
492
|
}
|
|
506
493
|
if (transcripts.newest - lastFired > HOOK_FIRING_GAP_MS) {
|
|
@@ -508,7 +495,7 @@ function checkHooksFiring(transcripts, lastFired, now) {
|
|
|
508
495
|
name,
|
|
509
496
|
status: "fail",
|
|
510
497
|
detail: `sessions as recent as ${formatAgeH(now() - transcripts.newest)}, but no lifecycle hook has fired since ${formatAgeH(now() - lastFired)}`,
|
|
511
|
-
fix: `Hooks are configured but not running \u2014 run \`${cliInvocation()} init\` and check
|
|
498
|
+
fix: `Hooks are configured but not running \u2014 run \`${cliInvocation()} init\` and check \`${agent.descriptor.program} --debug\` hook output.`
|
|
512
499
|
};
|
|
513
500
|
}
|
|
514
501
|
return { name, status: "pass", detail: `last fired ${formatAgeH(now() - lastFired)}` };
|
|
@@ -541,11 +528,11 @@ function checkDeadHooksState(cwd) {
|
|
|
541
528
|
}
|
|
542
529
|
];
|
|
543
530
|
}
|
|
544
|
-
function checkSpoolWritable(home) {
|
|
531
|
+
function checkSpoolWritable(home, agent) {
|
|
545
532
|
const dir = spoolDir(home);
|
|
546
533
|
try {
|
|
547
534
|
if (!existsSync(dir)) {
|
|
548
|
-
return { name: "Spool writable", status: "warn", detail: "spool not created yet", fix:
|
|
535
|
+
return { name: "Spool writable", status: "warn", detail: "spool not created yet", fix: `The first hook run creates it: start a ${agent.descriptor.label} session in the repository.` };
|
|
549
536
|
}
|
|
550
537
|
accessSync(dir, constants.W_OK);
|
|
551
538
|
return { name: "Spool writable", status: "pass", detail: dir };
|
|
@@ -585,29 +572,6 @@ function checkDaemon(home) {
|
|
|
585
572
|
return { name: "Daemon running", status: "warn", detail: "pidfile present, no heartbeat", fix: `Restart \`${cliInvocation()} daemon\`.` };
|
|
586
573
|
}
|
|
587
574
|
}
|
|
588
|
-
function checkCleanupPeriod(home) {
|
|
589
|
-
const path = join(home, ".claude", "settings.json");
|
|
590
|
-
let settings;
|
|
591
|
-
try {
|
|
592
|
-
settings = readSettings(path);
|
|
593
|
-
} catch {
|
|
594
|
-
return { name: "Retention (cleanupPeriodDays)", status: "warn", detail: "settings unreadable" };
|
|
595
|
-
}
|
|
596
|
-
const raw = settings?.cleanupPeriodDays;
|
|
597
|
-
const days = typeof raw === "number" ? raw : 30;
|
|
598
|
-
if (days === 0) {
|
|
599
|
-
return {
|
|
600
|
-
name: "Retention (cleanupPeriodDays)",
|
|
601
|
-
status: "fail",
|
|
602
|
-
detail: "set to 0 \u2014 this DISABLES transcript persistence (upstream anthropics/claude-code#23710 and #59248)",
|
|
603
|
-
fix: `Remove cleanupPeriodDays or set it \u226514; run \`${cliInvocation()} daemon\` to mirror before deletion.`
|
|
604
|
-
};
|
|
605
|
-
}
|
|
606
|
-
if (days < 14) {
|
|
607
|
-
return { name: "Retention (cleanupPeriodDays)", status: "warn", detail: `${days}d \u2014 transcripts deleted quickly`, fix: `Run \`${cliInvocation()} daemon\` so raws are mirrored before cleanup.` };
|
|
608
|
-
}
|
|
609
|
-
return { name: "Retention (cleanupPeriodDays)", status: "pass", detail: `${days}d` };
|
|
610
|
-
}
|
|
611
575
|
function checkDiskHeadroom(home) {
|
|
612
576
|
try {
|
|
613
577
|
accessSync(home, constants.W_OK);
|
|
@@ -616,87 +580,24 @@ function checkDiskHeadroom(home) {
|
|
|
616
580
|
return { name: "Disk headroom", status: "fail", detail: "home not writable", fix: "Free space / fix permissions on your home directory." };
|
|
617
581
|
}
|
|
618
582
|
}
|
|
619
|
-
function
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
return { name: "Claude Code version", status: "warn", detail: "could not run `claude --version`", fix: "Ensure `claude` is on PATH." };
|
|
625
|
-
}
|
|
626
|
-
const parsed = version.match(/\d+\.\d+\.\d+/)?.[0];
|
|
627
|
-
if (!parsed) return { name: "Claude Code version", status: "warn", detail: `unrecognized: ${version}` };
|
|
628
|
-
if (compareVersions(parsed, SUPPORTED_VERSIONS.max) > 0) {
|
|
629
|
-
return { name: "Claude Code version", status: "pass", detail: `${parsed} (newer than ${SUPPORTED_VERSIONS.max}, the latest version this release was tested with)` };
|
|
630
|
-
}
|
|
631
|
-
if (compareVersions(parsed, SUPPORTED_VERSIONS.min) < 0) {
|
|
632
|
-
return { name: "Claude Code version", status: "warn", detail: `${parsed} is older than validated (${SUPPORTED_VERSIONS.min})` };
|
|
633
|
-
}
|
|
634
|
-
return { name: "Claude Code version", status: "pass", detail: parsed };
|
|
635
|
-
}
|
|
636
|
-
function checkSettingsValid(home, cwd) {
|
|
637
|
-
for (const scope of ["user", "project"]) {
|
|
638
|
-
const path = settingsPath(scope, { home, cwd });
|
|
639
|
-
if (!existsSync(path)) continue;
|
|
640
|
-
try {
|
|
641
|
-
readSettings(path);
|
|
642
|
-
} catch (err) {
|
|
643
|
-
return { name: "Settings JSON valid", status: "fail", detail: `${path} is corrupt`, fix: err instanceof Error ? err.message : "Fix the JSON syntax." };
|
|
644
|
-
}
|
|
645
|
-
}
|
|
646
|
-
return { name: "Settings JSON valid", status: "pass", detail: "all settings files parse" };
|
|
647
|
-
}
|
|
648
|
-
function distinctInstalls(paths) {
|
|
649
|
-
const seen = /* @__PURE__ */ new Set();
|
|
650
|
-
const out = [];
|
|
651
|
-
for (const path of paths) {
|
|
652
|
-
let real = path;
|
|
653
|
-
try {
|
|
654
|
-
real = realpathSync(path);
|
|
655
|
-
} catch {
|
|
656
|
-
}
|
|
657
|
-
if (seen.has(real)) continue;
|
|
658
|
-
seen.add(real);
|
|
659
|
-
out.push(path);
|
|
660
|
-
}
|
|
661
|
-
return out;
|
|
662
|
-
}
|
|
663
|
-
function checkInstalls(env) {
|
|
664
|
-
let installs;
|
|
665
|
-
try {
|
|
666
|
-
installs = distinctInstalls((env.claudeInstalls ?? defaultClaudeInstalls)());
|
|
667
|
-
} catch {
|
|
668
|
-
return [];
|
|
669
|
-
}
|
|
670
|
-
if (installs.length > 1) {
|
|
671
|
-
return [{ name: "Claude Code installs", status: "warn", detail: `multiple found: ${installs.join(", ")}`, fix: "Multiple installs can diverge in version; keep one." }];
|
|
672
|
-
}
|
|
673
|
-
return [];
|
|
674
|
-
}
|
|
675
|
-
function defaultClaudeVersion() {
|
|
676
|
-
return execFileSync("claude", ["--version"], { encoding: "utf8", timeout: 5e3 }).trim();
|
|
677
|
-
}
|
|
678
|
-
function defaultClaudeInstalls() {
|
|
679
|
-
try {
|
|
680
|
-
const out = execFileSync(process.platform === "win32" ? "where" : "which", ["-a", "claude"], { encoding: "utf8", timeout: 5e3 });
|
|
681
|
-
return out.split(/\r?\n/).filter((l) => l.trim().length > 0);
|
|
682
|
-
} catch {
|
|
683
|
-
return [];
|
|
684
|
-
}
|
|
685
|
-
}
|
|
686
|
-
function contextDegradedFix(kind) {
|
|
583
|
+
function contextDegradedFix(kind, agent) {
|
|
584
|
+
const { label, legacy, id, context } = agent.descriptor;
|
|
585
|
+
const launcher = `${cliInvocation()} ${legacy?.subcommand ?? id}`;
|
|
586
|
+
const plain = `outerlayer ${legacy?.subcommand ?? id}`;
|
|
587
|
+
const folder = context.repoSkillFolders[0]?.split("/")[0] ?? "";
|
|
687
588
|
switch (kind) {
|
|
688
589
|
case "unreachable":
|
|
689
|
-
return `Check network/VPN access to the control plane, then start
|
|
590
|
+
return `Check network/VPN access to the control plane, then start ${label} with \`${launcher}\`.`;
|
|
690
591
|
case "no-access":
|
|
691
592
|
return "Check your git credentials (SSH key or token) and org/SSO access to the control plane, then retry.";
|
|
692
593
|
case "designation-unverified":
|
|
693
|
-
return `Check OuterLayer cloud connectivity/config (~/.outerlayer/config.json), then start
|
|
594
|
+
return `Check OuterLayer cloud connectivity/config (~/.outerlayer/config.json), then start ${label} with \`${launcher}\`.`;
|
|
694
595
|
case "not-governed":
|
|
695
|
-
return
|
|
596
|
+
return `A record from an earlier CLI. It is cleared the next time \`${plain}\` asks which control plane governs this repository.`;
|
|
696
597
|
case "adoption-conflict":
|
|
697
|
-
return
|
|
598
|
+
return `A record from an earlier CLI. Committed AGENTS.md or ${folder} files no longer block the control plane, and the record is cleared the next time \`${plain}\` asks which control plane governs this repository.`;
|
|
698
599
|
case "conflict":
|
|
699
|
-
return `This record is stale: a gateway that stores the control plane never reports two. Start
|
|
600
|
+
return `This record is stale: a gateway that stores the control plane never reports two. Start ${label} with \`${launcher}\` to clear it.`;
|
|
700
601
|
}
|
|
701
602
|
}
|
|
702
603
|
function checkGovernsList(cwd) {
|
|
@@ -726,53 +627,7 @@ function checkGovernsList(cwd) {
|
|
|
726
627
|
}
|
|
727
628
|
];
|
|
728
629
|
}
|
|
729
|
-
function
|
|
730
|
-
const hooks = settings?.hooks;
|
|
731
|
-
if (typeof hooks !== "object" || hooks === null) return [];
|
|
732
|
-
const commands = [];
|
|
733
|
-
for (const groups of Object.values(hooks)) {
|
|
734
|
-
if (!Array.isArray(groups)) continue;
|
|
735
|
-
for (const group of groups) {
|
|
736
|
-
const entries = group?.hooks;
|
|
737
|
-
if (!Array.isArray(entries)) continue;
|
|
738
|
-
for (const entry of entries) {
|
|
739
|
-
const command = entry?.command;
|
|
740
|
-
if (typeof command === "string") commands.push(command);
|
|
741
|
-
}
|
|
742
|
-
}
|
|
743
|
-
}
|
|
744
|
-
return commands;
|
|
745
|
-
}
|
|
746
|
-
function checkControlPlaneHooks(cwd) {
|
|
747
|
-
let repoRoot;
|
|
748
|
-
try {
|
|
749
|
-
repoRoot = execFileSync("git", ["-C", cwd ?? process.cwd(), "rev-parse", "--show-toplevel"], {
|
|
750
|
-
encoding: "utf8",
|
|
751
|
-
stdio: ["ignore", "pipe", "ignore"],
|
|
752
|
-
timeout: 2e3
|
|
753
|
-
}).trim();
|
|
754
|
-
} catch {
|
|
755
|
-
return [];
|
|
756
|
-
}
|
|
757
|
-
if (!existsSync(join(repoRoot, ".outerlayer"))) return [];
|
|
758
|
-
let settings;
|
|
759
|
-
try {
|
|
760
|
-
settings = JSON.parse(readFileSync(join(repoRoot, ".claude", "settings.json"), "utf8"));
|
|
761
|
-
} catch {
|
|
762
|
-
return [];
|
|
763
|
-
}
|
|
764
|
-
const escaping = hookCommandsOf(settings).filter(hookCommandEscapesControlPlane);
|
|
765
|
-
if (escaping.length === 0) return [];
|
|
766
|
-
return [
|
|
767
|
-
{
|
|
768
|
-
name: "Control plane hook paths",
|
|
769
|
-
status: "warn",
|
|
770
|
-
detail: `${escaping.length === 1 ? "this hook command reaches" : "these hook commands reach"} a .claude directory by a path a governed build does not provide, so ${escaping.length === 1 ? "it fails" : "they fail"} there without a message: ${escaping.map((command) => `\`${command}\``).join(", ")}`,
|
|
771
|
-
fix: `Name the script as \`\${${CONTROL_PLANE_DIR_VARIABLE}:-$CLAUDE_PROJECT_DIR}/.claude/\u2026\`. A governed build sets ${CONTROL_PLANE_DIR_VARIABLE} to where it reads the control plane; a checkout that holds its own copy falls back to the project directory.`
|
|
772
|
-
}
|
|
773
|
-
];
|
|
774
|
-
}
|
|
775
|
-
function checkContextSource(cwd) {
|
|
630
|
+
function checkContextSource(cwd, agent) {
|
|
776
631
|
const dir = cwd ?? process.cwd();
|
|
777
632
|
let gitCommonDir;
|
|
778
633
|
try {
|
|
@@ -798,7 +653,7 @@ function checkContextSource(cwd) {
|
|
|
798
653
|
name,
|
|
799
654
|
status: "warn",
|
|
800
655
|
detail: delivery === void 0 ? "a control plane governs this repository, and no copy of it has been delivered to this machine" : `the delivered control plane is no longer at ${delivery.dir}`,
|
|
801
|
-
fix: `Start
|
|
656
|
+
fix: `Start ${agent.descriptor.label} with \`${cliInvocation()} ${agent.descriptor.legacy?.subcommand ?? agent.descriptor.id}\`.`
|
|
802
657
|
});
|
|
803
658
|
}
|
|
804
659
|
if (degraded) {
|
|
@@ -806,7 +661,7 @@ function checkContextSource(cwd) {
|
|
|
806
661
|
name: "Control plane degradation",
|
|
807
662
|
status: degraded.kind === "conflict" ? "fail" : "warn",
|
|
808
663
|
detail: degraded.message,
|
|
809
|
-
fix: contextDegradedFix(degraded.kind)
|
|
664
|
+
fix: contextDegradedFix(degraded.kind, agent)
|
|
810
665
|
});
|
|
811
666
|
}
|
|
812
667
|
return checks;
|
|
@@ -1195,8 +1050,8 @@ function doctorExitCode(checks) {
|
|
|
1195
1050
|
|
|
1196
1051
|
// src/doctor-report.ts
|
|
1197
1052
|
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-
|
|
1053
|
+
const { DEFAULT_BUILD_DISK, DEFAULT_CACHE_DISK } = await import('./build-disk-W6AL5WHI.js');
|
|
1054
|
+
const { defaultRunnerConfigPath, hasRunnerBlock, keyRunnerFactory, loadRunnerConfig, runnerVmOf } = await import('./config-T22KVOOT.js');
|
|
1200
1055
|
const configPath = defaultRunnerConfigPath();
|
|
1201
1056
|
const runnerHost = hasRunnerBlock(configPath);
|
|
1202
1057
|
const hooks = (() => {
|
|
@@ -1224,7 +1079,7 @@ async function gatherDoctorChecks() {
|
|
|
1224
1079
|
const { runnerVmCheck } = await import('./doctor-53F2PYY7.js');
|
|
1225
1080
|
checks.push(runnerVmCheck(configPath, { lima: realLima(), home: homeFromEnv(), instance: runnerVm.instance }));
|
|
1226
1081
|
} else if (hasRunnerBlock(configPath)) {
|
|
1227
|
-
const { runnerHostChecks } = await import('./doctor-
|
|
1082
|
+
const { runnerHostChecks } = await import('./doctor-EQM3JRZI.js');
|
|
1228
1083
|
const gateway = (() => {
|
|
1229
1084
|
try {
|
|
1230
1085
|
const loaded = loadRunnerConfig(configPath);
|
|
@@ -1252,7 +1107,7 @@ async function gatherDoctorChecks() {
|
|
|
1252
1107
|
const service = await (async () => {
|
|
1253
1108
|
const { existsSync: existsSync3 } = await import('fs');
|
|
1254
1109
|
if (process.platform !== "linux" || !existsSync3("/run/systemd/system")) return void 0;
|
|
1255
|
-
const { inspectRunnerService } = await import('./find-unit-
|
|
1110
|
+
const { inspectRunnerService } = await import('./find-unit-CNAPU7XQ.js');
|
|
1256
1111
|
return inspectRunnerService(configPath);
|
|
1257
1112
|
})();
|
|
1258
1113
|
checks.push(...await runnerHostChecks({ configPath, hooks, gateway, repos, runner, service }));
|