@outerlayer/cli 0.36.0-next.20261102124202 → 0.36.0-next.20261102195652
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-5UWZZMZM.js +39 -0
- package/dist/agent-subcommand-4TEUJJNL.js +25 -0
- package/dist/{bridge-DFG2GTXQ.js → bridge-4KPODDN7.js} +6 -4
- package/dist/{build-THAD3B4Q.js → build-3CEFKWGY.js} +13 -11
- package/dist/{build-disk-HO2VPIBJ.js → build-disk-DLW3WKC5.js} +11 -9
- package/dist/build-info.json +1 -1
- package/dist/{builder-AXJNIF4S.js → builder-ALMQ5AWP.js} +10 -8
- package/dist/caller-XNBGW4SP.js +22 -0
- package/dist/{check-SF2OVZXB.js → check-AEDFTYH6.js} +61 -59
- package/dist/{chunk-772ILTCK.js → chunk-2XN34EKQ.js} +3 -3
- package/dist/{chunk-KN4VIK53.js → chunk-2YC3TXWX.js} +1 -1
- package/dist/{chunk-6JJITHBI.js → chunk-42DBDDHP.js} +1 -1
- package/dist/chunk-4DLJ343I.js +38 -0
- package/dist/{chunk-5WYT3PPE.js → chunk-4OD45RBP.js} +4 -1
- package/dist/{chunk-PTPF36Q7.js → chunk-4UUKUOS7.js} +3 -3
- package/dist/{chunk-RK4JQRVT.js → chunk-5XX75FJ6.js} +9 -9
- package/dist/{chunk-TWYHSMHM.js → chunk-6JLYU322.js} +3 -2
- package/dist/{chunk-5GHJFETA.js → chunk-6KH3NMIT.js} +3010 -1196
- package/dist/{chunk-GSXGA6KF.js → chunk-6QSIK5VA.js} +1 -1
- package/dist/{chunk-5FIOUQGC.js → chunk-6Z7R24XA.js} +8 -8
- package/dist/{chunk-LVXR37OG.js → chunk-73E33ZA2.js} +9 -8
- package/dist/{chunk-4TNUQLXH.js → chunk-7UGMB5VS.js} +12 -11
- package/dist/{chunk-J7TCTARR.js → chunk-7XTLS5PG.js} +5 -5
- package/dist/{chunk-K3X3L5YW.js → chunk-A24PDRNU.js} +6 -6
- package/dist/{chunk-GDZTL6BI.js → chunk-A2U7T4ZH.js} +123 -277
- package/dist/{chunk-GZ75FRLB.js → chunk-B36NSEUM.js} +1 -1
- package/dist/{chunk-XHFSBSIA.js → chunk-B5SWBFVE.js} +3 -2
- package/dist/{chunk-NTMRMBLM.js → chunk-BACWWK3E.js} +22 -7
- package/dist/{chunk-RSRZDF3K.js → chunk-BN5U4RJU.js} +11 -9
- package/dist/{chunk-NC3QAHOS.js → chunk-BSPJI5T7.js} +4 -2
- package/dist/{chunk-A5Y2HBVU.js → chunk-BZSJ77MO.js} +1 -1
- package/dist/{chunk-L3JXQDVH.js → chunk-CA4OE2QT.js} +4 -4
- package/dist/{chunk-ESSJPSJ2.js → chunk-CI5LFLKH.js} +2 -2
- package/dist/{chunk-M2NIHHQI.js → chunk-CXJC3JLN.js} +3 -2
- package/dist/{chunk-WDQPBAFV.js → chunk-D6EXW4EB.js} +2 -1
- package/dist/{chunk-PQDFW422.js → chunk-D74RGORK.js} +1 -1
- package/dist/{chunk-NWBB2SQ4.js → chunk-DL2RYNXQ.js} +66 -25
- package/dist/{chunk-J7Y3PCO2.js → chunk-DTQPDMHG.js} +2 -1
- package/dist/{chunk-6LO62EQ5.js → chunk-F36EKGMP.js} +712 -249
- package/dist/{chunk-HIN4BMRW.js → chunk-FIUUESD4.js} +5 -5
- package/dist/{chunk-XLOM2BNL.js → chunk-FOSYM7TQ.js} +1 -1
- package/dist/{chunk-LCOQN6NR.js → chunk-FWKQHKCR.js} +4 -4
- package/dist/{chunk-IP7BIBXJ.js → chunk-FWSVWPMS.js} +16 -7
- package/dist/{chunk-GD6KIHOS.js → chunk-G35Y4LN5.js} +5 -2
- package/dist/{chunk-LSXHTBAM.js → chunk-GBGJGYEE.js} +7 -7
- package/dist/{chunk-Q42K6XZ6.js → chunk-H23JP73I.js} +1 -1
- package/dist/{chunk-WLMAGMTU.js → chunk-H2NJG3TE.js} +4 -3
- package/dist/{chunk-4CTVN3C5.js → chunk-HRBSEXYC.js} +5 -5
- package/dist/{chunk-T5Z22NA6.js → chunk-HRHWA6TZ.js} +1 -1
- package/dist/chunk-HTRDL42C.js +45 -0
- package/dist/{chunk-WNYH42PF.js → chunk-HZVS4MGL.js} +7 -7
- package/dist/{chunk-YBAVN6WS.js → chunk-I4DM7SNX.js} +7 -7
- package/dist/{chunk-CKPQOQFC.js → chunk-I6U6QPN6.js} +769 -101
- package/dist/{chunk-QJDX6VJS.js → chunk-IX6CFXSW.js} +10 -9
- package/dist/{chunk-FIO6PIZ6.js → chunk-J2OMKFYB.js} +3 -3
- package/dist/{chunk-C3JWWPLC.js → chunk-J6HWRVN2.js} +10 -8
- package/dist/{chunk-PT34C6SU.js → chunk-J6VC3JCG.js} +1 -1
- package/dist/{chunk-I6FRCBMU.js → chunk-JBPVEXHQ.js} +8 -8
- package/dist/{chunk-EBIYRRJW.js → chunk-JVHWWJ2J.js} +80 -94
- package/dist/{chunk-LYFLUNWK.js → chunk-KN3TDNF7.js} +7 -7
- package/dist/{chunk-RPZIHELI.js → chunk-LHHDX7FB.js} +5 -5
- package/dist/{chunk-FUJUFLDC.js → chunk-LO4CK734.js} +8 -14
- package/dist/chunk-LSLK4RS4.js +82 -0
- package/dist/{chunk-I626B72C.js → chunk-LSZUTI6O.js} +1 -1
- package/dist/{chunk-JVCQZDQ6.js → chunk-LZS5EYZ6.js} +1 -1
- package/dist/{chunk-OYKAOHX5.js → chunk-M4HH2F64.js} +6 -6
- package/dist/{chunk-CVGQ3BNF.js → chunk-ML5YKV3B.js} +1 -1
- package/dist/{chunk-H2FFONRY.js → chunk-MVPOYQQY.js} +1 -1
- package/dist/{chunk-JXXHLQQR.js → chunk-NMBXA3AT.js} +3 -3
- package/dist/{chunk-VRQM4A64.js → chunk-PBGNX3PS.js} +1 -1
- package/dist/{chunk-CJJDJ7AT.js → chunk-PIZA7OG2.js} +5 -3
- package/dist/{chunk-L2BA2HXM.js → chunk-PN4LWT5F.js} +1 -1
- package/dist/{chunk-TYCZVJTB.js → chunk-PSQEGJPN.js} +5 -5
- package/dist/{chunk-EUDG754F.js → chunk-SBZ545DH.js} +2 -2
- package/dist/{chunk-5FND4PIU.js → chunk-T2KBHW6P.js} +3 -3
- package/dist/chunk-T5QBWM6M.js +113 -0
- package/dist/{chunk-XABJMU5A.js → chunk-UCMIS74X.js} +2 -2
- package/dist/{chunk-564Q2STF.js → chunk-VKKKVYA4.js} +1 -1
- package/dist/{chunk-AAGU5FJF.js → chunk-WGC7UFRM.js} +1 -1
- package/dist/{chunk-XAOIHYPS.js → chunk-WVAXJOWG.js} +5 -4
- package/dist/{chunk-AYLYAOHH.js → chunk-XIDDJSQU.js} +3 -2
- package/dist/{chunk-OZOATEK3.js → chunk-Y2P3HWUG.js} +6 -6
- package/dist/{chunk-PKO5IDW4.js → chunk-Y5S2G2EZ.js} +7 -7
- package/dist/{chunk-WQB3XOEP.js → chunk-Z3MB7SV7.js} +6 -6
- package/dist/{chunk-XE3DIJJT.js → chunk-Z66CKWOM.js} +1 -1
- package/dist/chunk-ZHQC43NH.js +130 -0
- package/dist/{chunk-3FSKTGM6.js → chunk-ZSRMJOAK.js} +3 -3
- package/dist/{claude-launcher-LXZPTDNC.js → claude-launcher-NJGZUB3P.js} +82 -108
- package/dist/{cli-QFUT3UQS.js → cli-POIDBCZA.js} +323 -293
- package/dist/{command-45RZT4CK.js → command-ZLBFX553.js} +55 -53
- package/dist/config-GKSSGMXD.js +21 -0
- package/dist/{connect-cmd-LUCQ7FSV.js → connect-cmd-6YKNFJJR.js} +12 -10
- package/dist/{container-start-T776VI3M.js → container-start-55QELXPJ.js} +53 -51
- package/dist/{context-cleanup-QE2MIO2Q.js → context-cleanup-3K2AOECJ.js} +4 -2
- package/dist/{context-show-cmd-7QEHUOEL.js → context-show-cmd-FGMRJ7IG.js} +13 -11
- package/dist/{control-plane-launch-THUH6YU5.js → control-plane-launch-DGPA3ONU.js} +25 -21
- package/dist/{demo-record-cmd-SBERRQNW.js → demo-record-cmd-2OKCGST7.js} +7 -5
- package/dist/{demo-voice-cmd-VM3FITZU.js → demo-voice-cmd-BPTSL7JA.js} +24 -22
- package/dist/{dist-6KGTCWKR.js → dist-VVZIGSAF.js} +1 -1
- package/dist/{docker-MQNLK4OO.js → docker-GFEEV42Z.js} +10 -8
- package/dist/{doctor-NQOSPJGS.js → doctor-ZOQSI3HL.js} +55 -53
- package/dist/emit-artifact-cmd-3LDJ4VRW.js +43 -0
- package/dist/{emit-cmd-ZPFCPVSR.js → emit-cmd-RO4L4PFZ.js} +7 -5
- package/dist/emit-criteria-cmd-V3ERJXHB.js +34 -0
- package/dist/{emit-demo-cmd-PMQGNNVX.js → emit-demo-cmd-5KL64L74.js} +24 -22
- package/dist/{emit-finding-cmd-MYWQN5WW.js → emit-finding-cmd-R4OEWQQR.js} +17 -15
- package/dist/{emit-result-cmd-GXK3KMAP.js → emit-result-cmd-5YNQDTYG.js} +22 -20
- package/dist/{emit-step-cmd-ZV2XTUVT.js → emit-step-cmd-Z5WC7UEQ.js} +17 -15
- package/dist/{exec-client-P7RFRUCK.js → exec-client-54XKNPTI.js} +7 -5
- package/dist/find-unit-OI56YEX5.js +23 -0
- package/dist/{findings-cmd-OGMBVVSM.js → findings-cmd-J5ZCY2AT.js} +17 -15
- package/dist/{fleet-readiness-4RBKLXBQ.js → fleet-readiness-DKCFOUYP.js} +13 -11
- package/dist/{governing-source-XJMXFSAR.js → governing-source-7PD4ISRN.js} +21 -19
- package/dist/{guest-init-XZHRPIMG.js → guest-init-5QZRGP62.js} +8 -6
- package/dist/{hook-fast-ZOWGWCPO.js → hook-fast-ICT2PRQX.js} +4 -2
- package/dist/{pending-YU2GE2UV.js → hook-install-GDNRMML4.js} +5 -5
- package/dist/{hook-wrap-fast-545QJSBJ.js → hook-wrap-fast-LWWKKPGK.js} +4 -2
- package/dist/host-checks-GADKYJFN.js +78 -0
- package/dist/host-key-FI6KWMJC.js +16 -0
- package/dist/{image-tag-E4JK2APF.js → image-tag-RX4WTHJH.js} +7 -5
- package/dist/index.js +8 -9
- package/dist/{init-LO6U7YTW.js → init-BZXVQO22.js} +51 -49
- package/dist/init-EKF4ILHF.js +78 -0
- package/dist/{init-cmd-2JANO5EN.js → init-cmd-3LWFEKHD.js} +35 -29
- package/dist/{init-update-D6PRTGNE.js → init-update-THEHC25C.js} +24 -22
- package/dist/{install-cmd-SJMBNQEH.js → install-cmd-WBVTTE5Z.js} +9 -7
- package/dist/{layout-AQHIMJMO.js → layout-7XMC7S6K.js} +4 -2
- package/dist/{logs-NE55HOET.js → logs-7YIXBO2K.js} +6 -4
- package/dist/loop-RUQQ4L5A.js +89 -0
- package/dist/machine-IGHZW3IO.js +78 -0
- package/dist/{machine-skills-KK2HXYMR.js → machine-skills-HR4RNRNR.js} +4 -2
- package/dist/{mcp-install-cmd-2QAS3AQZ.js → mcp-install-cmd-SMPLT43Q.js} +4 -2
- package/dist/{mcp-serve-cmd-U6USKHYR.js → mcp-serve-cmd-HLS24XCG.js} +8 -6
- package/dist/{paths-O7LCWY33.js → paths-2YTU4QIO.js} +6 -4
- package/dist/pending-S2SKIBCB.js +16 -0
- package/dist/{pidfile-5GDCQ5HA.js → pidfile-SPBTMTCJ.js} +7 -5
- package/dist/{record-NETSDAO6.js → record-3KXRFK5C.js} +7 -5
- package/dist/{relay-VZ733BVJ.js → relay-I2T43PPB.js} +4 -2
- package/dist/{relay-protocol-24GEUGCO.js → relay-protocol-GI2GC2AM.js} +4 -2
- package/dist/runner-env-HOWRS6I6.js +23 -0
- package/dist/{runner-identity-PSCZBILD.js → runner-identity-32MTGA2F.js} +10 -8
- package/dist/{runner-key-VM2LYVRK.js → runner-key-FXYWHMMO.js} +51 -49
- package/dist/{session-sender-P2RHDM6U.js → session-sender-B6INUY7G.js} +23 -21
- package/dist/{shell-function-NRD4KVUK.js → shell-function-GYD2ZQQG.js} +2 -1
- package/dist/{spec-cmd-LGKP6MT7.js → spec-cmd-ZEZFMC4A.js} +18 -16
- package/dist/{starter-pack-SMK6UPRL.js → starter-pack-IMKIUA56.js} +5 -3
- package/dist/state-DVKFUWB3.js +16 -0
- package/dist/{status-HEHCNIDS.js → status-VPFIIHOZ.js} +51 -49
- package/dist/{statusline-fast-E7RWVREA.js → statusline-fast-NUVHCNRX.js} +4 -2
- package/dist/{sync-cmd-HKN45HXL.js → sync-cmd-W756BQWX.js} +22 -20
- package/dist/update-steps-D6L6AG6E.js +79 -0
- package/dist/{watch-RGZCUCR3.js → watch-6EDRJZMG.js} +22 -20
- package/dist/{work-claim-cmd-6DSPGCZE.js → work-claim-cmd-7HR4AVCT.js} +22 -20
- package/dist/{work-cmd-GPLYLWY7.js → work-cmd-ZP4UIHBT.js} +15 -13
- package/dist/{work-comment-cmd-V5WM7LAW.js → work-comment-cmd-CYDOEMW3.js} +18 -16
- package/dist/{work-demo-cmd-SWWI6AGD.js → work-demo-cmd-3A7Z3VVS.js} +15 -13
- package/dist/{work-launch-TTGSHLY4.js → work-launch-LWDQXLGI.js} +1 -1
- package/dist/{work-logs-cmd-CTFBOPCI.js → work-logs-cmd-NDPSRSCM.js} +15 -13
- package/dist/{work-open-pr-cmd-HX2U3YBR.js → work-open-pr-cmd-Z5B3ERAU.js} +17 -15
- package/dist/{work-pr-cmd-EI2R4FQG.js → work-pr-cmd-ZVPGCDWD.js} +16 -14
- package/dist/{work-proofs-cmd-QXNPHLYC.js → work-proofs-cmd-VAXJ5UBF.js} +18 -16
- package/dist/{work-proofs-record-72OKWEES.js → work-proofs-record-K467JH24.js} +28 -26
- package/dist/{work-stop-cmd-7M7ZYUN2.js → work-stop-cmd-J45Q2QT7.js} +15 -13
- package/package.json +3 -3
- package/dist/agent-setup-AOB76EDJ.js +0 -37
- package/dist/caller-GOY2X6QT.js +0 -20
- package/dist/chunk-KYDEBGJG.js +0 -402
- package/dist/config-WYQPXLOP.js +0 -19
- package/dist/emit-artifact-cmd-6E365VBQ.js +0 -41
- package/dist/emit-criteria-cmd-HWQOYZZ4.js +0 -32
- package/dist/find-unit-63SXQ7IM.js +0 -21
- package/dist/host-checks-WHW24PJR.js +0 -76
- package/dist/host-key-MWLXB5U5.js +0 -14
- package/dist/init-EZIAHBMH.js +0 -76
- package/dist/loop-2E34CGCX.js +0 -87
- package/dist/machine-6ALGG4IO.js +0 -76
- package/dist/runner-env-KHCONH2R.js +0 -21
- package/dist/settings-XB2HYBKO.js +0 -7
- package/dist/state-RJR4PMMX.js +0 -14
- package/dist/update-steps-7E4RD47J.js +0 -77
|
@@ -1,26 +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-WQB3XOEP.js';
|
|
3
|
+
import { checkStarterFiles, contextIsGoverned } from './chunk-LHHDX7FB.js';
|
|
4
|
+
import { fleetCheck, checkBuildSkill, checkMachineSkills, checkCommittedMaintainedSkills, checkMaintainedReferences, checkIgnoredSkillFolders } from './chunk-Z3MB7SV7.js';
|
|
5
|
+
import { resolveCredentials, getJson, WorkCommandError } from './chunk-IX6CFXSW.js';
|
|
6
|
+
import { isLinkedRepository } from './chunk-HRBSEXYC.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-LZS5EYZ6.js';
|
|
12
|
+
import { sanitizeForContext, spoolDir, assessSyncHealth, readSyncStatus, SYNC_STALE_AFTER_MS, formatAgo, checkInstalledCliStaleness, workspaceRootOf, hookFiredMarkerPath, refreshCommand } from './chunk-JVHWWJ2J.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';
|
|
20
|
-
import {
|
|
22
|
+
import { defaultAgents, legacyAgent, contextAgents } from './chunk-I6U6QPN6.js';
|
|
21
23
|
import { homeFromEnv } from './chunk-352DHUTP.js';
|
|
22
|
-
import { readFileSync, mkdirSync, writeFileSync, renameSync, existsSync, accessSync, constants, statSync
|
|
23
|
-
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';
|
|
24
26
|
import { execFileSync } from 'child_process';
|
|
25
27
|
|
|
26
28
|
createRequire(import.meta.url);
|
|
@@ -75,42 +77,42 @@ function updateManifest(home, opts, mutate) {
|
|
|
75
77
|
if (manifest && JSON.stringify(withoutUpdatedAt(next)) === JSON.stringify(withoutUpdatedAt(JSON.parse(before)))) return;
|
|
76
78
|
writeManifest(home, next);
|
|
77
79
|
}
|
|
78
|
-
function recordInstall(home,
|
|
80
|
+
function recordInstall(home, settingsPath, record, now = Date.now) {
|
|
79
81
|
updateManifest(home, { createIfMissing: true }, (manifest) => {
|
|
80
|
-
manifest.installs[
|
|
82
|
+
manifest.installs[settingsPath] = {
|
|
81
83
|
cliBin: record.cliBin,
|
|
82
84
|
events: [...record.events],
|
|
83
85
|
updatedAt: new Date(now()).toISOString()
|
|
84
86
|
};
|
|
85
87
|
});
|
|
86
88
|
}
|
|
87
|
-
function recordRemoval(home,
|
|
89
|
+
function recordRemoval(home, settingsPath) {
|
|
88
90
|
updateManifest(home, { createIfMissing: false }, (manifest) => {
|
|
89
|
-
delete manifest.installs[
|
|
90
|
-
delete manifest.wrapped[
|
|
91
|
-
delete manifest.statusline[
|
|
91
|
+
delete manifest.installs[settingsPath];
|
|
92
|
+
delete manifest.wrapped[settingsPath];
|
|
93
|
+
delete manifest.statusline[settingsPath];
|
|
92
94
|
});
|
|
93
95
|
}
|
|
94
|
-
function recordWrapped(home,
|
|
96
|
+
function recordWrapped(home, settingsPath, wrapped, now = Date.now) {
|
|
95
97
|
if (wrapped.length === 0) return;
|
|
96
98
|
updateManifest(home, { createIfMissing: true }, (manifest) => {
|
|
97
|
-
const existing = manifest.wrapped[
|
|
99
|
+
const existing = manifest.wrapped[settingsPath] ?? [];
|
|
98
100
|
const at = new Date(now()).toISOString();
|
|
99
101
|
for (const w of wrapped) {
|
|
100
102
|
if (existing.some((e) => e.event === w.event && e.original === w.original)) continue;
|
|
101
103
|
existing.push({ event: w.event, original: w.original, updatedAt: at });
|
|
102
104
|
}
|
|
103
|
-
manifest.wrapped[
|
|
105
|
+
manifest.wrapped[settingsPath] = existing;
|
|
104
106
|
});
|
|
105
107
|
}
|
|
106
|
-
function recordUnwrapped(home,
|
|
108
|
+
function recordUnwrapped(home, settingsPath) {
|
|
107
109
|
updateManifest(home, { createIfMissing: false }, (manifest) => {
|
|
108
|
-
delete manifest.wrapped[
|
|
110
|
+
delete manifest.wrapped[settingsPath];
|
|
109
111
|
});
|
|
110
112
|
}
|
|
111
|
-
function recordStatusline(home,
|
|
113
|
+
function recordStatusline(home, settingsPath, outcome, original, now = Date.now) {
|
|
112
114
|
updateManifest(home, { createIfMissing: true }, (manifest) => {
|
|
113
|
-
manifest.statusline[
|
|
115
|
+
manifest.statusline[settingsPath] = {
|
|
114
116
|
outcome,
|
|
115
117
|
...original !== void 0 ? { original } : {},
|
|
116
118
|
updatedAt: new Date(now()).toISOString()
|
|
@@ -175,38 +177,47 @@ function checkMcpCommand(cwd, env = process.env, platform = process.platform, ag
|
|
|
175
177
|
}
|
|
176
178
|
|
|
177
179
|
// src/doctor.ts
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
}
|
|
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
|
+
}
|
|
183
187
|
function runDoctor(env = {}) {
|
|
184
188
|
const home = env.home ?? homeFromEnv();
|
|
185
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);
|
|
186
193
|
const laptop = env.runnerHost !== true;
|
|
187
194
|
const buildsInOwnImages = env.runnerHost === true && (env.runnerHooks === "builtin:container" || env.runnerHooks === "builtin:vm");
|
|
188
|
-
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;
|
|
189
200
|
const starter = laptop ? checkStarterFiles(env.cwd) : void 0;
|
|
190
201
|
return [
|
|
191
|
-
...laptop ? [
|
|
202
|
+
...laptop ? [...section("home"), checkTranscripts(transcripts, now, legacy), ...checkHooks(home, env.cwd, transcripts, now, agents)] : [laptopChecksNotApplicable(legacy.descriptor.label)],
|
|
192
203
|
...checkDeadHooksState(env.cwd),
|
|
193
|
-
...laptop ? [checkSpoolWritable(home)] : [],
|
|
204
|
+
...laptop ? [checkSpoolWritable(home, legacy)] : [],
|
|
194
205
|
...buildsInOwnImages ? [] : [checkLastSync(home, now)],
|
|
195
206
|
...laptop ? [checkDaemon(home)] : [],
|
|
196
|
-
|
|
207
|
+
...section("retention"),
|
|
197
208
|
checkDiskHeadroom(home),
|
|
198
|
-
...buildsInOwnImages ? [] :
|
|
199
|
-
|
|
200
|
-
...laptop ? checkStatusline(home, now, env.cwd) : [],
|
|
201
|
-
...
|
|
209
|
+
...buildsInOwnImages ? [] : section("version"),
|
|
210
|
+
...section("settings"),
|
|
211
|
+
...laptop ? checkStatusline(home, now, env.cwd, agents) : [],
|
|
212
|
+
...section("installs"),
|
|
202
213
|
...starter?.checks ?? [],
|
|
203
214
|
...laptop ? checkRenamedSkills(env.cwd) : [],
|
|
204
215
|
...checkBuildSkillState(env.cwd, home),
|
|
205
216
|
...checkIgnoredSkills(env.cwd),
|
|
206
217
|
...starter !== void 0 && !starter.mcpOutdated ? checkMcpCommand(env.cwd, env.processEnv) : [],
|
|
207
|
-
...checkContextSource(env.cwd),
|
|
218
|
+
...checkContextSource(env.cwd, legacy),
|
|
208
219
|
...checkGovernsList(env.cwd),
|
|
209
|
-
...
|
|
220
|
+
...section("control-plane-hooks"),
|
|
210
221
|
...checkInstalledCli(home, env.cwd ?? process.cwd())
|
|
211
222
|
];
|
|
212
223
|
}
|
|
@@ -273,31 +284,31 @@ function installedCliFix(workspaceDistDir, trusted) {
|
|
|
273
284
|
const root = sanitizeForContext(workspaceRootOf(workspaceDistDir));
|
|
274
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.`;
|
|
275
286
|
}
|
|
276
|
-
function checkStatusline(home, now, cwd) {
|
|
287
|
+
function checkStatusline(home, now, cwd, agents) {
|
|
277
288
|
const name = "Status line";
|
|
278
289
|
let installed = false;
|
|
279
290
|
let wrapping;
|
|
280
291
|
let foreign;
|
|
292
|
+
const agent = legacyInstallAgent(agents);
|
|
293
|
+
const where = { home, cwd: cwd ?? process.cwd() };
|
|
294
|
+
const cli = cliForInstall();
|
|
281
295
|
for (const scope of ["user", "project"]) {
|
|
282
|
-
let
|
|
296
|
+
let state2;
|
|
283
297
|
try {
|
|
284
|
-
|
|
298
|
+
state2 = installedState(agent, agent.install.settingsFile(scope, where), cli);
|
|
285
299
|
} catch {
|
|
286
300
|
continue;
|
|
287
301
|
}
|
|
288
|
-
|
|
289
|
-
if (!slot || typeof slot !== "object") continue;
|
|
290
|
-
if (isOurStatuslineSlot(slot)) {
|
|
302
|
+
if (state2.statusline.slot === "ours") {
|
|
291
303
|
installed = true;
|
|
292
|
-
|
|
293
|
-
if (original !== null) wrapping = original;
|
|
304
|
+
wrapping = state2.statusline.wrapping;
|
|
294
305
|
break;
|
|
295
306
|
}
|
|
296
|
-
if (
|
|
307
|
+
if (state2.statusline.slot === "foreign") foreign = state2.statusline.command;
|
|
297
308
|
}
|
|
298
309
|
if (!installed) {
|
|
299
310
|
const manifest = readManifest(home);
|
|
300
|
-
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);
|
|
301
312
|
if (record) {
|
|
302
313
|
return [{
|
|
303
314
|
name,
|
|
@@ -327,47 +338,21 @@ function checkStatusline(home, now, cwd) {
|
|
|
327
338
|
checks.push({ name: stateName, status: "pass", detail: `fresh (${formatAgo(age)})` });
|
|
328
339
|
return checks;
|
|
329
340
|
}
|
|
330
|
-
function
|
|
331
|
-
const
|
|
332
|
-
|
|
333
|
-
}
|
|
334
|
-
|
|
335
|
-
const root = join(home, ".claude", "projects");
|
|
336
|
-
let count = 0;
|
|
337
|
-
let newest = 0;
|
|
338
|
-
if (!existsSync(root)) return { exists: false, count, newest };
|
|
339
|
-
const walk = (dir) => {
|
|
340
|
-
let entries;
|
|
341
|
-
try {
|
|
342
|
-
entries = readdirSync(dir, { withFileTypes: true });
|
|
343
|
-
} catch {
|
|
344
|
-
return;
|
|
345
|
-
}
|
|
346
|
-
for (const entry of entries) {
|
|
347
|
-
const p = join(dir, entry.name);
|
|
348
|
-
if (!entry.isDirectory() && !entry.isSymbolicLink() && !entry.name.endsWith(".jsonl")) continue;
|
|
349
|
-
let st;
|
|
350
|
-
try {
|
|
351
|
-
st = statSync(p);
|
|
352
|
-
} catch {
|
|
353
|
-
continue;
|
|
354
|
-
}
|
|
355
|
-
if (st.isDirectory()) walk(p);
|
|
356
|
-
else if (entry.name.endsWith(".jsonl") && st.size > 0) {
|
|
357
|
-
count += 1;
|
|
358
|
-
if (st.mtimeMs > newest) newest = st.mtimeMs;
|
|
359
|
-
}
|
|
360
|
-
}
|
|
361
|
-
};
|
|
362
|
-
walk(root);
|
|
363
|
-
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;
|
|
364
346
|
}
|
|
365
|
-
function
|
|
347
|
+
function installedState(agent, path, cli) {
|
|
348
|
+
return withSettingsText(path, (text) => agent.install.installed(text, cli));
|
|
349
|
+
}
|
|
350
|
+
function checkTranscripts(transcripts, now, agent) {
|
|
366
351
|
if (!transcripts.exists) {
|
|
367
|
-
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.` };
|
|
368
353
|
}
|
|
369
354
|
if (transcripts.count === 0) {
|
|
370
|
-
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.` };
|
|
371
356
|
}
|
|
372
357
|
const age = formatAgeH(now() - transcripts.newest);
|
|
373
358
|
return { name: "Transcripts", status: "pass", detail: `${transcripts.count} transcripts, newest ${age}` };
|
|
@@ -377,9 +362,9 @@ function formatAgeH(ms) {
|
|
|
377
362
|
return ageH < 1 ? "<1h ago" : ageH < 48 ? `${Math.round(ageH)}h ago` : `${Math.round(ageH / 24)}d ago`;
|
|
378
363
|
}
|
|
379
364
|
var HOOK_FIRING_GAP_MS = 24 * 60 * 60 * 1e3;
|
|
380
|
-
function newestHookFiring(home) {
|
|
365
|
+
function newestHookFiring(home, events) {
|
|
381
366
|
let newest = null;
|
|
382
|
-
for (const event of
|
|
367
|
+
for (const event of events) {
|
|
383
368
|
try {
|
|
384
369
|
const ms = statSync(hookFiredMarkerPath(event, home)).mtimeMs;
|
|
385
370
|
if (newest === null || ms > newest) newest = ms;
|
|
@@ -388,13 +373,14 @@ function newestHookFiring(home) {
|
|
|
388
373
|
}
|
|
389
374
|
return newest;
|
|
390
375
|
}
|
|
391
|
-
function checkHooks(home, cwd, transcripts, now) {
|
|
392
|
-
const
|
|
376
|
+
function checkHooks(home, cwd, transcripts, now, agents) {
|
|
377
|
+
const agent = legacyInstallAgent(agents);
|
|
378
|
+
const lastFired = newestHookFiring(home, agent.events);
|
|
393
379
|
const firingFresh = lastFired !== null && transcripts.count > 0 && transcripts.newest - lastFired <= HOOK_FIRING_GAP_MS;
|
|
394
|
-
const checks = [checkHooksInstalled(home, cwd, firingFresh)];
|
|
395
|
-
const firing = checkHooksFiring(transcripts, lastFired, now);
|
|
380
|
+
const checks = [checkHooksInstalled(home, cwd, firingFresh, agent)];
|
|
381
|
+
const firing = checkHooksFiring(transcripts, lastFired, now, agent.entry);
|
|
396
382
|
if (firing) checks.push(firing);
|
|
397
|
-
const wrapped = checkWrappedHooks(home, cwd);
|
|
383
|
+
const wrapped = checkWrappedHooks(home, cwd, agent);
|
|
398
384
|
if (wrapped) checks.push(wrapped);
|
|
399
385
|
return checks;
|
|
400
386
|
}
|
|
@@ -407,24 +393,24 @@ function isExecutable(path) {
|
|
|
407
393
|
return false;
|
|
408
394
|
}
|
|
409
395
|
}
|
|
410
|
-
function checkHooksInstalled(home, cwd, firingFresh) {
|
|
396
|
+
function checkHooksInstalled(home, cwd, firingFresh, agent) {
|
|
411
397
|
const name = "Hooks installed";
|
|
398
|
+
const where = { home, cwd: cwd ?? process.cwd() };
|
|
399
|
+
const cli = cliForInstall();
|
|
412
400
|
const readablePaths = [];
|
|
413
401
|
for (const scope of ["user", "project"]) {
|
|
414
|
-
const path =
|
|
415
|
-
let
|
|
402
|
+
const path = agent.install.settingsFile(scope, where);
|
|
403
|
+
let state;
|
|
416
404
|
try {
|
|
417
|
-
|
|
405
|
+
state = installedState(agent, path, cli);
|
|
418
406
|
} catch {
|
|
419
407
|
continue;
|
|
420
408
|
}
|
|
421
409
|
readablePaths.push(path);
|
|
422
|
-
if (!
|
|
423
|
-
const installed =
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
if (installed.length === REGISTERED_EVENTS.length) {
|
|
427
|
-
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));
|
|
428
414
|
if (missing.length > 0) {
|
|
429
415
|
return {
|
|
430
416
|
name,
|
|
@@ -433,7 +419,7 @@ function checkHooksInstalled(home, cwd, firingFresh) {
|
|
|
433
419
|
fix: `Run \`${cliInvocation()} init\` to reinstall.`
|
|
434
420
|
};
|
|
435
421
|
}
|
|
436
|
-
const unexecutable =
|
|
422
|
+
const unexecutable = state.directScriptBins.filter((bin) => !isExecutable(bin));
|
|
437
423
|
if (unexecutable.length > 0) {
|
|
438
424
|
return {
|
|
439
425
|
name,
|
|
@@ -464,30 +450,23 @@ function checkHooksInstalled(home, cwd, firingFresh) {
|
|
|
464
450
|
}
|
|
465
451
|
return { name, status: "fail", detail: "no OuterLayer hooks found", fix: `Run \`${cliInvocation()} init\`.` };
|
|
466
452
|
}
|
|
467
|
-
function checkWrappedHooks(home, cwd) {
|
|
453
|
+
function checkWrappedHooks(home, cwd, agent) {
|
|
468
454
|
const manifest = readManifest(home);
|
|
469
455
|
if (!manifest) return null;
|
|
456
|
+
const where = { home, cwd: cwd ?? process.cwd() };
|
|
457
|
+
const cli = cliForInstall();
|
|
470
458
|
const missing = [];
|
|
471
459
|
for (const scope of ["user", "project"]) {
|
|
472
|
-
const path =
|
|
460
|
+
const path = agent.install.settingsFile(scope, where);
|
|
473
461
|
const records = manifest.wrapped[path];
|
|
474
462
|
if (!records || records.length === 0) continue;
|
|
475
|
-
let
|
|
463
|
+
let state;
|
|
476
464
|
try {
|
|
477
|
-
|
|
465
|
+
state = installedState(agent, path, cli);
|
|
478
466
|
} catch {
|
|
479
467
|
continue;
|
|
480
468
|
}
|
|
481
|
-
const present =
|
|
482
|
-
const hooks = settings?.hooks ?? {};
|
|
483
|
-
for (const event of Object.keys(hooks)) {
|
|
484
|
-
for (const block of hooks[event] ?? []) {
|
|
485
|
-
for (const h of block.hooks ?? []) {
|
|
486
|
-
const original = wrappedOriginalCommand(h);
|
|
487
|
-
if (original !== null) present.add(`${event}\0${original}`);
|
|
488
|
-
}
|
|
489
|
-
}
|
|
490
|
-
}
|
|
469
|
+
const present = new Set(state.wrapped.map((entry) => `${entry.event}\0${entry.original}`));
|
|
491
470
|
for (const r of records) {
|
|
492
471
|
if (!present.has(`${r.event}\0${r.original}`)) missing.push(`${r.event}: ${r.original}`);
|
|
493
472
|
}
|
|
@@ -500,7 +479,7 @@ function checkWrappedHooks(home, cwd) {
|
|
|
500
479
|
fix: `Run \`${cliInvocation()} hooks wrap\` to re-wrap, or \`${cliInvocation()} hooks unwrap\` if the wrap is no longer wanted.`
|
|
501
480
|
};
|
|
502
481
|
}
|
|
503
|
-
function checkHooksFiring(transcripts, lastFired, now) {
|
|
482
|
+
function checkHooksFiring(transcripts, lastFired, now, agent) {
|
|
504
483
|
const name = "Hooks firing";
|
|
505
484
|
if (transcripts.count === 0) return null;
|
|
506
485
|
if (lastFired === null) {
|
|
@@ -508,7 +487,7 @@ function checkHooksFiring(transcripts, lastFired, now) {
|
|
|
508
487
|
name,
|
|
509
488
|
status: "warn",
|
|
510
489
|
detail: "no firing evidence recorded yet \u2014 every hook run writes a marker, and none exists",
|
|
511
|
-
fix:
|
|
490
|
+
fix: `Start a ${agent.descriptor.label} session, then re-run doctor.`
|
|
512
491
|
};
|
|
513
492
|
}
|
|
514
493
|
if (transcripts.newest - lastFired > HOOK_FIRING_GAP_MS) {
|
|
@@ -516,7 +495,7 @@ function checkHooksFiring(transcripts, lastFired, now) {
|
|
|
516
495
|
name,
|
|
517
496
|
status: "fail",
|
|
518
497
|
detail: `sessions as recent as ${formatAgeH(now() - transcripts.newest)}, but no lifecycle hook has fired since ${formatAgeH(now() - lastFired)}`,
|
|
519
|
-
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.`
|
|
520
499
|
};
|
|
521
500
|
}
|
|
522
501
|
return { name, status: "pass", detail: `last fired ${formatAgeH(now() - lastFired)}` };
|
|
@@ -549,11 +528,11 @@ function checkDeadHooksState(cwd) {
|
|
|
549
528
|
}
|
|
550
529
|
];
|
|
551
530
|
}
|
|
552
|
-
function checkSpoolWritable(home) {
|
|
531
|
+
function checkSpoolWritable(home, agent) {
|
|
553
532
|
const dir = spoolDir(home);
|
|
554
533
|
try {
|
|
555
534
|
if (!existsSync(dir)) {
|
|
556
|
-
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.` };
|
|
557
536
|
}
|
|
558
537
|
accessSync(dir, constants.W_OK);
|
|
559
538
|
return { name: "Spool writable", status: "pass", detail: dir };
|
|
@@ -593,29 +572,6 @@ function checkDaemon(home) {
|
|
|
593
572
|
return { name: "Daemon running", status: "warn", detail: "pidfile present, no heartbeat", fix: `Restart \`${cliInvocation()} daemon\`.` };
|
|
594
573
|
}
|
|
595
574
|
}
|
|
596
|
-
function checkCleanupPeriod(home) {
|
|
597
|
-
const path = join(home, ".claude", "settings.json");
|
|
598
|
-
let settings;
|
|
599
|
-
try {
|
|
600
|
-
settings = readSettings(path);
|
|
601
|
-
} catch {
|
|
602
|
-
return { name: "Retention (cleanupPeriodDays)", status: "warn", detail: "settings unreadable" };
|
|
603
|
-
}
|
|
604
|
-
const raw = settings?.cleanupPeriodDays;
|
|
605
|
-
const days = typeof raw === "number" ? raw : 30;
|
|
606
|
-
if (days === 0) {
|
|
607
|
-
return {
|
|
608
|
-
name: "Retention (cleanupPeriodDays)",
|
|
609
|
-
status: "fail",
|
|
610
|
-
detail: "set to 0 \u2014 this DISABLES transcript persistence (upstream anthropics/claude-code#23710 and #59248)",
|
|
611
|
-
fix: `Remove cleanupPeriodDays or set it \u226514; run \`${cliInvocation()} daemon\` to mirror before deletion.`
|
|
612
|
-
};
|
|
613
|
-
}
|
|
614
|
-
if (days < 14) {
|
|
615
|
-
return { name: "Retention (cleanupPeriodDays)", status: "warn", detail: `${days}d \u2014 transcripts deleted quickly`, fix: `Run \`${cliInvocation()} daemon\` so raws are mirrored before cleanup.` };
|
|
616
|
-
}
|
|
617
|
-
return { name: "Retention (cleanupPeriodDays)", status: "pass", detail: `${days}d` };
|
|
618
|
-
}
|
|
619
575
|
function checkDiskHeadroom(home) {
|
|
620
576
|
try {
|
|
621
577
|
accessSync(home, constants.W_OK);
|
|
@@ -624,87 +580,24 @@ function checkDiskHeadroom(home) {
|
|
|
624
580
|
return { name: "Disk headroom", status: "fail", detail: "home not writable", fix: "Free space / fix permissions on your home directory." };
|
|
625
581
|
}
|
|
626
582
|
}
|
|
627
|
-
function
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
return { name: "Claude Code version", status: "warn", detail: "could not run `claude --version`", fix: "Ensure `claude` is on PATH." };
|
|
633
|
-
}
|
|
634
|
-
const parsed = version.match(/\d+\.\d+\.\d+/)?.[0];
|
|
635
|
-
if (!parsed) return { name: "Claude Code version", status: "warn", detail: `unrecognized: ${version}` };
|
|
636
|
-
if (compareVersions(parsed, SUPPORTED_VERSIONS.max) > 0) {
|
|
637
|
-
return { name: "Claude Code version", status: "pass", detail: `${parsed} (newer than ${SUPPORTED_VERSIONS.max}, the latest version this release was tested with)` };
|
|
638
|
-
}
|
|
639
|
-
if (compareVersions(parsed, SUPPORTED_VERSIONS.min) < 0) {
|
|
640
|
-
return { name: "Claude Code version", status: "warn", detail: `${parsed} is older than validated (${SUPPORTED_VERSIONS.min})` };
|
|
641
|
-
}
|
|
642
|
-
return { name: "Claude Code version", status: "pass", detail: parsed };
|
|
643
|
-
}
|
|
644
|
-
function checkSettingsValid(home, cwd) {
|
|
645
|
-
for (const scope of ["user", "project"]) {
|
|
646
|
-
const path = settingsPath(scope, { home, cwd });
|
|
647
|
-
if (!existsSync(path)) continue;
|
|
648
|
-
try {
|
|
649
|
-
readSettings(path);
|
|
650
|
-
} catch (err) {
|
|
651
|
-
return { name: "Settings JSON valid", status: "fail", detail: `${path} is corrupt`, fix: err instanceof Error ? err.message : "Fix the JSON syntax." };
|
|
652
|
-
}
|
|
653
|
-
}
|
|
654
|
-
return { name: "Settings JSON valid", status: "pass", detail: "all settings files parse" };
|
|
655
|
-
}
|
|
656
|
-
function distinctInstalls(paths) {
|
|
657
|
-
const seen = /* @__PURE__ */ new Set();
|
|
658
|
-
const out = [];
|
|
659
|
-
for (const path of paths) {
|
|
660
|
-
let real = path;
|
|
661
|
-
try {
|
|
662
|
-
real = realpathSync(path);
|
|
663
|
-
} catch {
|
|
664
|
-
}
|
|
665
|
-
if (seen.has(real)) continue;
|
|
666
|
-
seen.add(real);
|
|
667
|
-
out.push(path);
|
|
668
|
-
}
|
|
669
|
-
return out;
|
|
670
|
-
}
|
|
671
|
-
function checkInstalls(env) {
|
|
672
|
-
let installs;
|
|
673
|
-
try {
|
|
674
|
-
installs = distinctInstalls((env.claudeInstalls ?? defaultClaudeInstalls)());
|
|
675
|
-
} catch {
|
|
676
|
-
return [];
|
|
677
|
-
}
|
|
678
|
-
if (installs.length > 1) {
|
|
679
|
-
return [{ name: "Claude Code installs", status: "warn", detail: `multiple found: ${installs.join(", ")}`, fix: "Multiple installs can diverge in version; keep one." }];
|
|
680
|
-
}
|
|
681
|
-
return [];
|
|
682
|
-
}
|
|
683
|
-
function defaultClaudeVersion() {
|
|
684
|
-
return execFileSync("claude", ["--version"], { encoding: "utf8", timeout: 5e3 }).trim();
|
|
685
|
-
}
|
|
686
|
-
function defaultClaudeInstalls() {
|
|
687
|
-
try {
|
|
688
|
-
const out = execFileSync(process.platform === "win32" ? "where" : "which", ["-a", "claude"], { encoding: "utf8", timeout: 5e3 });
|
|
689
|
-
return out.split(/\r?\n/).filter((l) => l.trim().length > 0);
|
|
690
|
-
} catch {
|
|
691
|
-
return [];
|
|
692
|
-
}
|
|
693
|
-
}
|
|
694
|
-
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] ?? "";
|
|
695
588
|
switch (kind) {
|
|
696
589
|
case "unreachable":
|
|
697
|
-
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}\`.`;
|
|
698
591
|
case "no-access":
|
|
699
592
|
return "Check your git credentials (SSH key or token) and org/SSO access to the control plane, then retry.";
|
|
700
593
|
case "designation-unverified":
|
|
701
|
-
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}\`.`;
|
|
702
595
|
case "not-governed":
|
|
703
|
-
return
|
|
596
|
+
return `A record from an earlier CLI. It is cleared the next time \`${plain}\` asks which control plane governs this repository.`;
|
|
704
597
|
case "adoption-conflict":
|
|
705
|
-
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.`;
|
|
706
599
|
case "conflict":
|
|
707
|
-
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.`;
|
|
708
601
|
}
|
|
709
602
|
}
|
|
710
603
|
function checkGovernsList(cwd) {
|
|
@@ -734,54 +627,7 @@ function checkGovernsList(cwd) {
|
|
|
734
627
|
}
|
|
735
628
|
];
|
|
736
629
|
}
|
|
737
|
-
function
|
|
738
|
-
const hooks = settings?.hooks;
|
|
739
|
-
if (typeof hooks !== "object" || hooks === null) return [];
|
|
740
|
-
const commands = [];
|
|
741
|
-
for (const groups of Object.values(hooks)) {
|
|
742
|
-
if (!Array.isArray(groups)) continue;
|
|
743
|
-
for (const group of groups) {
|
|
744
|
-
const entries = group?.hooks;
|
|
745
|
-
if (!Array.isArray(entries)) continue;
|
|
746
|
-
for (const entry of entries) {
|
|
747
|
-
const command = entry?.command;
|
|
748
|
-
if (typeof command === "string") commands.push(command);
|
|
749
|
-
}
|
|
750
|
-
}
|
|
751
|
-
}
|
|
752
|
-
return commands;
|
|
753
|
-
}
|
|
754
|
-
function checkControlPlaneHooks(cwd) {
|
|
755
|
-
let repoRoot;
|
|
756
|
-
try {
|
|
757
|
-
repoRoot = execFileSync("git", ["-C", cwd ?? process.cwd(), "rev-parse", "--show-toplevel"], {
|
|
758
|
-
encoding: "utf8",
|
|
759
|
-
stdio: ["ignore", "pipe", "ignore"],
|
|
760
|
-
timeout: 2e3
|
|
761
|
-
}).trim();
|
|
762
|
-
} catch {
|
|
763
|
-
return [];
|
|
764
|
-
}
|
|
765
|
-
if (!existsSync(join(repoRoot, ".outerlayer"))) return [];
|
|
766
|
-
let settings;
|
|
767
|
-
try {
|
|
768
|
-
settings = JSON.parse(readFileSync(join(repoRoot, ".claude", "settings.json"), "utf8"));
|
|
769
|
-
} catch {
|
|
770
|
-
return [];
|
|
771
|
-
}
|
|
772
|
-
const escapesDelivery = legacyAgent().adapter.context?.escapesDelivery;
|
|
773
|
-
const escaping = escapesDelivery === void 0 ? [] : hookCommandsOf(settings).filter((command) => escapesDelivery(command, CONTROL_PLANE_DIR_VARIABLE));
|
|
774
|
-
if (escaping.length === 0) return [];
|
|
775
|
-
return [
|
|
776
|
-
{
|
|
777
|
-
name: "Control plane hook paths",
|
|
778
|
-
status: "warn",
|
|
779
|
-
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(", ")}`,
|
|
780
|
-
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.`
|
|
781
|
-
}
|
|
782
|
-
];
|
|
783
|
-
}
|
|
784
|
-
function checkContextSource(cwd) {
|
|
630
|
+
function checkContextSource(cwd, agent) {
|
|
785
631
|
const dir = cwd ?? process.cwd();
|
|
786
632
|
let gitCommonDir;
|
|
787
633
|
try {
|
|
@@ -807,7 +653,7 @@ function checkContextSource(cwd) {
|
|
|
807
653
|
name,
|
|
808
654
|
status: "warn",
|
|
809
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}`,
|
|
810
|
-
fix: `Start
|
|
656
|
+
fix: `Start ${agent.descriptor.label} with \`${cliInvocation()} ${agent.descriptor.legacy?.subcommand ?? agent.descriptor.id}\`.`
|
|
811
657
|
});
|
|
812
658
|
}
|
|
813
659
|
if (degraded) {
|
|
@@ -815,7 +661,7 @@ function checkContextSource(cwd) {
|
|
|
815
661
|
name: "Control plane degradation",
|
|
816
662
|
status: degraded.kind === "conflict" ? "fail" : "warn",
|
|
817
663
|
detail: degraded.message,
|
|
818
|
-
fix: contextDegradedFix(degraded.kind)
|
|
664
|
+
fix: contextDegradedFix(degraded.kind, agent)
|
|
819
665
|
});
|
|
820
666
|
}
|
|
821
667
|
return checks;
|
|
@@ -1204,8 +1050,8 @@ function doctorExitCode(checks) {
|
|
|
1204
1050
|
|
|
1205
1051
|
// src/doctor-report.ts
|
|
1206
1052
|
async function gatherDoctorChecks() {
|
|
1207
|
-
const { DEFAULT_BUILD_DISK, DEFAULT_CACHE_DISK } = await import('./build-disk-
|
|
1208
|
-
const { defaultRunnerConfigPath, hasRunnerBlock, keyRunnerFactory, loadRunnerConfig, runnerVmOf } = await import('./config-
|
|
1053
|
+
const { DEFAULT_BUILD_DISK, DEFAULT_CACHE_DISK } = await import('./build-disk-DLW3WKC5.js');
|
|
1054
|
+
const { defaultRunnerConfigPath, hasRunnerBlock, keyRunnerFactory, loadRunnerConfig, runnerVmOf } = await import('./config-GKSSGMXD.js');
|
|
1209
1055
|
const configPath = defaultRunnerConfigPath();
|
|
1210
1056
|
const runnerHost = hasRunnerBlock(configPath);
|
|
1211
1057
|
const hooks = (() => {
|
|
@@ -1233,7 +1079,7 @@ async function gatherDoctorChecks() {
|
|
|
1233
1079
|
const { runnerVmCheck } = await import('./doctor-53F2PYY7.js');
|
|
1234
1080
|
checks.push(runnerVmCheck(configPath, { lima: realLima(), home: homeFromEnv(), instance: runnerVm.instance }));
|
|
1235
1081
|
} else if (hasRunnerBlock(configPath)) {
|
|
1236
|
-
const { runnerHostChecks } = await import('./doctor-
|
|
1082
|
+
const { runnerHostChecks } = await import('./doctor-ZOQSI3HL.js');
|
|
1237
1083
|
const gateway = (() => {
|
|
1238
1084
|
try {
|
|
1239
1085
|
const loaded = loadRunnerConfig(configPath);
|
|
@@ -1261,7 +1107,7 @@ async function gatherDoctorChecks() {
|
|
|
1261
1107
|
const service = await (async () => {
|
|
1262
1108
|
const { existsSync: existsSync3 } = await import('fs');
|
|
1263
1109
|
if (process.platform !== "linux" || !existsSync3("/run/systemd/system")) return void 0;
|
|
1264
|
-
const { inspectRunnerService } = await import('./find-unit-
|
|
1110
|
+
const { inspectRunnerService } = await import('./find-unit-OI56YEX5.js');
|
|
1265
1111
|
return inspectRunnerService(configPath);
|
|
1266
1112
|
})();
|
|
1267
1113
|
checks.push(...await runnerHostChecks({ configPath, hooks, gateway, repos, runner, service }));
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
3
|
import { cliInvocation } from './chunk-FZKNTIOJ.js';
|
|
4
|
-
import { skillDir, emitTree, targetIds, classifyTree, emitBuilders, defaultAgents, FORMER_MAINTAINED_NAMES, isMaintainedCopy } from './chunk-
|
|
4
|
+
import { skillDir, emitTree, targetIds, classifyTree, emitBuilders, defaultAgents, FORMER_MAINTAINED_NAMES, isMaintainedCopy } from './chunk-I6U6QPN6.js';
|
|
5
5
|
import { readFileSync, existsSync, unlinkSync, rmdirSync, readdirSync } from 'fs';
|
|
6
6
|
import { join, dirname, relative, sep } from 'path';
|
|
7
7
|
|