@outerlayer/cli 0.36.0-next.20261102124202 → 0.36.0-next.20261102135508

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (178) hide show
  1. package/dist/agent-setup-Q3HDN23U.js +39 -0
  2. package/dist/agent-subcommand-Z6SOLWZW.js +25 -0
  3. package/dist/{bridge-DFG2GTXQ.js → bridge-4KPODDN7.js} +6 -4
  4. package/dist/{build-THAD3B4Q.js → build-KYXFZQ33.js} +13 -11
  5. package/dist/{build-disk-HO2VPIBJ.js → build-disk-W6AL5WHI.js} +11 -9
  6. package/dist/build-info.json +1 -1
  7. package/dist/{builder-AXJNIF4S.js → builder-IMNOEYV7.js} +10 -8
  8. package/dist/caller-NLRE272L.js +22 -0
  9. package/dist/{check-SF2OVZXB.js → check-WWX32IGY.js} +60 -58
  10. package/dist/{chunk-KN4VIK53.js → chunk-2YC3TXWX.js} +1 -1
  11. package/dist/{chunk-4TNUQLXH.js → chunk-3UFX6KH2.js} +12 -11
  12. package/dist/{chunk-5FIOUQGC.js → chunk-3YEPLVNW.js} +8 -8
  13. package/dist/chunk-4DLJ343I.js +38 -0
  14. package/dist/{chunk-5WYT3PPE.js → chunk-4OD45RBP.js} +4 -1
  15. package/dist/{chunk-OYKAOHX5.js → chunk-4XXBV37R.js} +6 -6
  16. package/dist/{chunk-RSRZDF3K.js → chunk-6B3V6EGQ.js} +11 -9
  17. package/dist/{chunk-XABJMU5A.js → chunk-6HDXRDC5.js} +2 -2
  18. package/dist/{chunk-TWYHSMHM.js → chunk-6JLYU322.js} +3 -2
  19. package/dist/{chunk-5GHJFETA.js → chunk-6KH3NMIT.js} +3010 -1196
  20. package/dist/{chunk-QJDX6VJS.js → chunk-AQE6E54X.js} +10 -9
  21. package/dist/{chunk-564Q2STF.js → chunk-ATKCHMFD.js} +1 -1
  22. package/dist/{chunk-PQDFW422.js → chunk-B2P72DAE.js} +1 -1
  23. package/dist/{chunk-GZ75FRLB.js → chunk-B36NSEUM.js} +1 -1
  24. package/dist/{chunk-XHFSBSIA.js → chunk-B5SWBFVE.js} +3 -2
  25. package/dist/{chunk-NC3QAHOS.js → chunk-BSPJI5T7.js} +4 -2
  26. package/dist/{chunk-I6FRCBMU.js → chunk-BUYXEU7J.js} +8 -8
  27. package/dist/{chunk-A5Y2HBVU.js → chunk-BZSJ77MO.js} +1 -1
  28. package/dist/{chunk-C3JWWPLC.js → chunk-CDG475ZP.js} +8 -7
  29. package/dist/{chunk-TYCZVJTB.js → chunk-CSBW4LGL.js} +5 -5
  30. package/dist/{chunk-EUDG754F.js → chunk-CSVJGW3I.js} +2 -2
  31. package/dist/{chunk-M2NIHHQI.js → chunk-CXJC3JLN.js} +3 -2
  32. package/dist/{chunk-XE3DIJJT.js → chunk-D4VGJQY7.js} +1 -1
  33. package/dist/{chunk-PKO5IDW4.js → chunk-D5I5SSPU.js} +7 -7
  34. package/dist/{chunk-WDQPBAFV.js → chunk-D6EXW4EB.js} +2 -1
  35. package/dist/{chunk-GSXGA6KF.js → chunk-DG3M5DZU.js} +1 -1
  36. package/dist/{chunk-GD6KIHOS.js → chunk-DTCTXDJP.js} +1 -1
  37. package/dist/{chunk-J7Y3PCO2.js → chunk-DTQPDMHG.js} +2 -1
  38. package/dist/{chunk-PT34C6SU.js → chunk-E3TP4QTM.js} +1 -1
  39. package/dist/{chunk-NWBB2SQ4.js → chunk-ENBOAE2W.js} +24 -24
  40. package/dist/{chunk-LSXHTBAM.js → chunk-ENMX3VQ7.js} +7 -7
  41. package/dist/{chunk-XLOM2BNL.js → chunk-FOSYM7TQ.js} +1 -1
  42. package/dist/{chunk-4CTVN3C5.js → chunk-FRMAQ3C4.js} +5 -5
  43. package/dist/{chunk-PTPF36Q7.js → chunk-FTP7SE6Y.js} +3 -3
  44. package/dist/{chunk-IP7BIBXJ.js → chunk-FWSVWPMS.js} +16 -7
  45. package/dist/{chunk-K3X3L5YW.js → chunk-GFZ7PELR.js} +6 -6
  46. package/dist/{chunk-WLMAGMTU.js → chunk-H2NJG3TE.js} +4 -3
  47. package/dist/{chunk-T5Z22NA6.js → chunk-HRHWA6TZ.js} +1 -1
  48. package/dist/chunk-HTRDL42C.js +45 -0
  49. package/dist/{chunk-YBAVN6WS.js → chunk-I4DM7SNX.js} +7 -7
  50. package/dist/{chunk-CKPQOQFC.js → chunk-I6U6QPN6.js} +769 -101
  51. package/dist/{chunk-6JJITHBI.js → chunk-IKFAJTLZ.js} +1 -1
  52. package/dist/{chunk-FIO6PIZ6.js → chunk-J2OMKFYB.js} +3 -3
  53. package/dist/{chunk-Q42K6XZ6.js → chunk-K2G3VB7W.js} +1 -1
  54. package/dist/{chunk-L3JXQDVH.js → chunk-K7N6LAPC.js} +4 -4
  55. package/dist/{chunk-RK4JQRVT.js → chunk-KRCU66AM.js} +9 -9
  56. package/dist/{chunk-RPZIHELI.js → chunk-LHHDX7FB.js} +5 -5
  57. package/dist/{chunk-FUJUFLDC.js → chunk-LO4CK734.js} +8 -14
  58. package/dist/chunk-LSLK4RS4.js +82 -0
  59. package/dist/{chunk-I626B72C.js → chunk-LSZUTI6O.js} +1 -1
  60. package/dist/{chunk-H2FFONRY.js → chunk-MVPOYQQY.js} +1 -1
  61. package/dist/{chunk-JVCQZDQ6.js → chunk-NXQK2I3G.js} +1 -1
  62. package/dist/{chunk-EBIYRRJW.js → chunk-O3MJAHLI.js} +80 -94
  63. package/dist/{chunk-VRQM4A64.js → chunk-PBGNX3PS.js} +1 -1
  64. package/dist/{chunk-CJJDJ7AT.js → chunk-PIZA7OG2.js} +5 -3
  65. package/dist/{chunk-772ILTCK.js → chunk-PMA67TIN.js} +3 -3
  66. package/dist/{chunk-GDZTL6BI.js → chunk-QKOJ22OV.js} +123 -277
  67. package/dist/{chunk-WNYH42PF.js → chunk-RF4JHGGB.js} +7 -7
  68. package/dist/{chunk-WQB3XOEP.js → chunk-SJJXDU2J.js} +6 -6
  69. package/dist/chunk-T5QBWM6M.js +113 -0
  70. package/dist/{chunk-LYFLUNWK.js → chunk-TJIFYV2Z.js} +7 -7
  71. package/dist/{chunk-OZOATEK3.js → chunk-TKY3SDXH.js} +6 -6
  72. package/dist/{chunk-CVGQ3BNF.js → chunk-ULBYRPAP.js} +1 -1
  73. package/dist/{chunk-LVXR37OG.js → chunk-URHS76GV.js} +9 -8
  74. package/dist/{chunk-J7TCTARR.js → chunk-VAYVTUU4.js} +5 -5
  75. package/dist/{chunk-5FND4PIU.js → chunk-VUH7KKVD.js} +3 -3
  76. package/dist/{chunk-NTMRMBLM.js → chunk-WACPWYMH.js} +4 -4
  77. package/dist/{chunk-AAGU5FJF.js → chunk-WGC7UFRM.js} +1 -1
  78. package/dist/{chunk-XAOIHYPS.js → chunk-WVAXJOWG.js} +5 -4
  79. package/dist/{chunk-6LO62EQ5.js → chunk-XEWG4AB2.js} +28 -28
  80. package/dist/{chunk-AYLYAOHH.js → chunk-XIDDJSQU.js} +3 -2
  81. package/dist/{chunk-ESSJPSJ2.js → chunk-Y4E7IS7H.js} +2 -2
  82. package/dist/{chunk-HIN4BMRW.js → chunk-YJQ7YA7J.js} +5 -5
  83. package/dist/{chunk-LCOQN6NR.js → chunk-YMVRCSKD.js} +4 -4
  84. package/dist/{chunk-JXXHLQQR.js → chunk-YYQ5NOT5.js} +3 -3
  85. package/dist/chunk-ZHQC43NH.js +130 -0
  86. package/dist/{chunk-3FSKTGM6.js → chunk-ZSRMJOAK.js} +3 -3
  87. package/dist/{claude-launcher-LXZPTDNC.js → claude-launcher-LGKJZH33.js} +82 -108
  88. package/dist/{cli-QFUT3UQS.js → cli-Q5L64EEG.js} +323 -293
  89. package/dist/{command-45RZT4CK.js → command-CGEFJZNC.js} +55 -53
  90. package/dist/{config-WYQPXLOP.js → config-T22KVOOT.js} +12 -10
  91. package/dist/{connect-cmd-LUCQ7FSV.js → connect-cmd-RUBP466E.js} +12 -10
  92. package/dist/{container-start-T776VI3M.js → container-start-JRF3SBUA.js} +53 -51
  93. package/dist/{context-cleanup-QE2MIO2Q.js → context-cleanup-3K2AOECJ.js} +4 -2
  94. package/dist/{context-show-cmd-7QEHUOEL.js → context-show-cmd-4UXO5WQJ.js} +13 -11
  95. package/dist/{control-plane-launch-THUH6YU5.js → control-plane-launch-AAH4YH56.js} +25 -21
  96. package/dist/{demo-record-cmd-SBERRQNW.js → demo-record-cmd-2OKCGST7.js} +7 -5
  97. package/dist/{demo-voice-cmd-VM3FITZU.js → demo-voice-cmd-GEPX7GIG.js} +24 -22
  98. package/dist/{dist-6KGTCWKR.js → dist-VVZIGSAF.js} +1 -1
  99. package/dist/{docker-MQNLK4OO.js → docker-5VWK335X.js} +10 -8
  100. package/dist/{doctor-NQOSPJGS.js → doctor-EQM3JRZI.js} +55 -53
  101. package/dist/emit-artifact-cmd-TA3MPHLU.js +43 -0
  102. package/dist/{emit-cmd-ZPFCPVSR.js → emit-cmd-RO4L4PFZ.js} +7 -5
  103. package/dist/emit-criteria-cmd-NMTUV2KM.js +34 -0
  104. package/dist/{emit-demo-cmd-PMQGNNVX.js → emit-demo-cmd-Y2Y6LEL7.js} +24 -22
  105. package/dist/{emit-finding-cmd-MYWQN5WW.js → emit-finding-cmd-VECM64UR.js} +17 -15
  106. package/dist/{emit-result-cmd-GXK3KMAP.js → emit-result-cmd-2ERWFDUN.js} +22 -20
  107. package/dist/{emit-step-cmd-ZV2XTUVT.js → emit-step-cmd-V2ET66N4.js} +17 -15
  108. package/dist/{exec-client-P7RFRUCK.js → exec-client-54XKNPTI.js} +7 -5
  109. package/dist/find-unit-CNAPU7XQ.js +23 -0
  110. package/dist/{findings-cmd-OGMBVVSM.js → findings-cmd-QJPPF6BY.js} +17 -15
  111. package/dist/{fleet-readiness-4RBKLXBQ.js → fleet-readiness-DKAPHAZN.js} +13 -11
  112. package/dist/{governing-source-XJMXFSAR.js → governing-source-7PZ6DAJU.js} +21 -19
  113. package/dist/{guest-init-XZHRPIMG.js → guest-init-5QZRGP62.js} +8 -6
  114. package/dist/{hook-fast-ZOWGWCPO.js → hook-fast-VXROB4KF.js} +4 -2
  115. package/dist/{pending-YU2GE2UV.js → hook-install-GDNRMML4.js} +5 -5
  116. package/dist/{hook-wrap-fast-545QJSBJ.js → hook-wrap-fast-LWWKKPGK.js} +4 -2
  117. package/dist/host-checks-WAPO5X7X.js +78 -0
  118. package/dist/host-key-HLLV37NV.js +16 -0
  119. package/dist/{image-tag-E4JK2APF.js → image-tag-PBWQBATH.js} +7 -5
  120. package/dist/index.js +8 -9
  121. package/dist/init-EK3PUU6W.js +78 -0
  122. package/dist/{init-LO6U7YTW.js → init-Y2URPVVY.js} +51 -49
  123. package/dist/{init-cmd-2JANO5EN.js → init-cmd-XNANUDIW.js} +35 -29
  124. package/dist/{init-update-D6PRTGNE.js → init-update-EFCTKF6D.js} +24 -22
  125. package/dist/{install-cmd-SJMBNQEH.js → install-cmd-RHFUZFV4.js} +9 -7
  126. package/dist/{layout-AQHIMJMO.js → layout-7XMC7S6K.js} +4 -2
  127. package/dist/{logs-NE55HOET.js → logs-E7MGQINH.js} +6 -4
  128. package/dist/loop-L6TX6OR4.js +89 -0
  129. package/dist/machine-VJKAY2GX.js +78 -0
  130. package/dist/{machine-skills-KK2HXYMR.js → machine-skills-HR4RNRNR.js} +4 -2
  131. package/dist/{mcp-install-cmd-2QAS3AQZ.js → mcp-install-cmd-SMPLT43Q.js} +4 -2
  132. package/dist/{mcp-serve-cmd-U6USKHYR.js → mcp-serve-cmd-XXERT673.js} +8 -6
  133. package/dist/{paths-O7LCWY33.js → paths-F2ZR2EKC.js} +6 -4
  134. package/dist/pending-VOFQRXP4.js +16 -0
  135. package/dist/{pidfile-5GDCQ5HA.js → pidfile-7M7O2M7T.js} +7 -5
  136. package/dist/{record-NETSDAO6.js → record-YCJ6DZOY.js} +7 -5
  137. package/dist/{relay-VZ733BVJ.js → relay-I2T43PPB.js} +4 -2
  138. package/dist/{relay-protocol-24GEUGCO.js → relay-protocol-GI2GC2AM.js} +4 -2
  139. package/dist/runner-env-YW55JVU7.js +23 -0
  140. package/dist/{runner-identity-PSCZBILD.js → runner-identity-Y5ZFCC7V.js} +10 -8
  141. package/dist/{runner-key-VM2LYVRK.js → runner-key-R47C6374.js} +51 -49
  142. package/dist/{session-sender-P2RHDM6U.js → session-sender-UPACLRGG.js} +23 -21
  143. package/dist/{shell-function-NRD4KVUK.js → shell-function-GYD2ZQQG.js} +2 -1
  144. package/dist/{spec-cmd-LGKP6MT7.js → spec-cmd-7QRE2SZK.js} +18 -16
  145. package/dist/{starter-pack-SMK6UPRL.js → starter-pack-IMKIUA56.js} +5 -3
  146. package/dist/state-VAHBIMS5.js +16 -0
  147. package/dist/{status-HEHCNIDS.js → status-BQEYEG2V.js} +51 -49
  148. package/dist/{statusline-fast-E7RWVREA.js → statusline-fast-NUVHCNRX.js} +4 -2
  149. package/dist/{sync-cmd-HKN45HXL.js → sync-cmd-NBLYEPQG.js} +22 -20
  150. package/dist/update-steps-VGKNGWTZ.js +79 -0
  151. package/dist/{watch-RGZCUCR3.js → watch-IHV4V3HZ.js} +22 -20
  152. package/dist/{work-claim-cmd-6DSPGCZE.js → work-claim-cmd-WGTSU5IT.js} +21 -19
  153. package/dist/{work-cmd-GPLYLWY7.js → work-cmd-HKOJU5FJ.js} +15 -13
  154. package/dist/{work-comment-cmd-V5WM7LAW.js → work-comment-cmd-H3JCWQ2J.js} +18 -16
  155. package/dist/{work-demo-cmd-SWWI6AGD.js → work-demo-cmd-J4AZAIVP.js} +15 -13
  156. package/dist/{work-launch-TTGSHLY4.js → work-launch-LWDQXLGI.js} +1 -1
  157. package/dist/{work-logs-cmd-CTFBOPCI.js → work-logs-cmd-UOO4JVLG.js} +15 -13
  158. package/dist/{work-open-pr-cmd-HX2U3YBR.js → work-open-pr-cmd-QFRDDBAM.js} +17 -15
  159. package/dist/{work-pr-cmd-EI2R4FQG.js → work-pr-cmd-3Q2D5RQT.js} +16 -14
  160. package/dist/{work-proofs-cmd-QXNPHLYC.js → work-proofs-cmd-7Y3HGT7C.js} +18 -16
  161. package/dist/{work-proofs-record-72OKWEES.js → work-proofs-record-QPUM6DY4.js} +28 -26
  162. package/dist/{work-stop-cmd-7M7ZYUN2.js → work-stop-cmd-SD2ZRMSY.js} +15 -13
  163. package/package.json +1 -1
  164. package/dist/agent-setup-AOB76EDJ.js +0 -37
  165. package/dist/caller-GOY2X6QT.js +0 -20
  166. package/dist/chunk-KYDEBGJG.js +0 -402
  167. package/dist/emit-artifact-cmd-6E365VBQ.js +0 -41
  168. package/dist/emit-criteria-cmd-HWQOYZZ4.js +0 -32
  169. package/dist/find-unit-63SXQ7IM.js +0 -21
  170. package/dist/host-checks-WHW24PJR.js +0 -76
  171. package/dist/host-key-MWLXB5U5.js +0 -14
  172. package/dist/init-EZIAHBMH.js +0 -76
  173. package/dist/loop-2E34CGCX.js +0 -87
  174. package/dist/machine-6ALGG4IO.js +0 -76
  175. package/dist/runner-env-KHCONH2R.js +0 -21
  176. package/dist/settings-XB2HYBKO.js +0 -7
  177. package/dist/state-RJR4PMMX.js +0 -14
  178. 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-RPZIHELI.js';
4
- import { resolveCredentials, getJson, WorkCommandError } from './chunk-QJDX6VJS.js';
5
- import { isLinkedRepository } from './chunk-4CTVN3C5.js';
6
- import { C } from './chunk-2AM6Z5BP.js';
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-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 { checkFormerSkillNames } from './chunk-GZ75FRLB.js';
10
- import { resolveGatewayCredentials, defaultFetch } from './chunk-JVCQZDQ6.js';
11
- import { sanitizeForContext, spoolDir, assessSyncHealth, readSyncStatus, SYNC_STALE_AFTER_MS, formatAgo, checkInstalledCliStaleness, workspaceRootOf, hookFiredMarkerPath, refreshCommand } from './chunk-EBIYRRJW.js';
12
- import { readStatuslineState, STATE_FRESH_MS } from './chunk-YBAVN6WS.js';
13
- import { CONTROL_PLANE_DIR_VARIABLE } from './chunk-NC3QAHOS.js';
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 { readSettings, settingsPath, isOurStatuslineSlot, statuslineWrappedOriginal, REGISTERED_EVENTS, isOurHookCommand, ourCommandBins, cliBinResolvable, ourDirectScriptBins, wrappedOriginalCommand } from './chunk-KYDEBGJG.js';
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 { contextAgents, defaultAgents, legacyAgent } from './chunk-CKPQOQFC.js';
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, readdirSync, realpathSync } from 'fs';
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, settingsPath2, record, now = Date.now) {
80
+ function recordInstall(home, settingsPath, record, now = Date.now) {
79
81
  updateManifest(home, { createIfMissing: true }, (manifest) => {
80
- manifest.installs[settingsPath2] = {
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, settingsPath2) {
89
+ function recordRemoval(home, settingsPath) {
88
90
  updateManifest(home, { createIfMissing: false }, (manifest) => {
89
- delete manifest.installs[settingsPath2];
90
- delete manifest.wrapped[settingsPath2];
91
- delete manifest.statusline[settingsPath2];
91
+ delete manifest.installs[settingsPath];
92
+ delete manifest.wrapped[settingsPath];
93
+ delete manifest.statusline[settingsPath];
92
94
  });
93
95
  }
94
- function recordWrapped(home, settingsPath2, wrapped, now = Date.now) {
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[settingsPath2] ?? [];
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[settingsPath2] = existing;
105
+ manifest.wrapped[settingsPath] = existing;
104
106
  });
105
107
  }
106
- function recordUnwrapped(home, settingsPath2) {
108
+ function recordUnwrapped(home, settingsPath) {
107
109
  updateManifest(home, { createIfMissing: false }, (manifest) => {
108
- delete manifest.wrapped[settingsPath2];
110
+ delete manifest.wrapped[settingsPath];
109
111
  });
110
112
  }
111
- function recordStatusline(home, settingsPath2, outcome, original, now = Date.now) {
113
+ function recordStatusline(home, settingsPath, outcome, original, now = Date.now) {
112
114
  updateManifest(home, { createIfMissing: true }, (manifest) => {
113
- manifest.statusline[settingsPath2] = {
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
- var LAPTOP_CHECKS_NOT_APPLICABLE = {
179
- name: "Laptop checks",
180
- status: "skipped",
181
- detail: "this is a runner host, which runs builds and no sessions of its own, so the Claude Code home, transcripts, hooks, spool, daemon and status line do not apply"
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 transcripts = laptop ? scanTranscripts(home) : void 0;
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 ? [checkClaudeDir(home), checkTranscripts(transcripts, now), ...checkHooks(home, env.cwd, transcripts, now)] : [LAPTOP_CHECKS_NOT_APPLICABLE],
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
- checkCleanupPeriod(home),
207
+ ...section("retention"),
197
208
  checkDiskHeadroom(home),
198
- ...buildsInOwnImages ? [] : [checkClaudeVersion(env)],
199
- checkSettingsValid(home, env.cwd),
200
- ...laptop ? checkStatusline(home, now, env.cwd) : [],
201
- ...checkInstalls(env),
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
- ...checkControlPlaneHooks(env.cwd),
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 settings;
296
+ let state2;
283
297
  try {
284
- settings = readSettings(settingsPath(scope, { home, cwd }));
298
+ state2 = installedState(agent, agent.install.settingsFile(scope, where), cli);
285
299
  } catch {
286
300
  continue;
287
301
  }
288
- const slot = settings?.statusLine;
289
- if (!slot || typeof slot !== "object") continue;
290
- if (isOurStatuslineSlot(slot)) {
302
+ if (state2.statusline.slot === "ours") {
291
303
  installed = true;
292
- const original = statuslineWrappedOriginal(slot);
293
- if (original !== null) wrapping = original;
304
+ wrapping = state2.statusline.wrapping;
294
305
  break;
295
306
  }
296
- if (typeof slot.command === "string") foreign = slot.command;
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[settingsPath(scope, { home, cwd })]).find((r) => r !== void 0);
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 checkClaudeDir(home) {
331
- const dir = join(home, ".claude");
332
- return existsSync(dir) ? { name: "Claude Code home", status: "pass", detail: dir } : { name: "Claude Code home", status: "fail", detail: `${dir} not found`, fix: "Install Claude Code, then run a session so transcripts exist." };
333
- }
334
- function scanTranscripts(home) {
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 checkTranscripts(transcripts, now) {
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: "Run a Claude Code session, then re-check." };
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 Claude Code session, then run \`${cliInvocation()} doctor\` again.` };
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 REGISTERED_EVENTS) {
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 lastFired = newestHookFiring(home);
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 = settingsPath(scope, { home, cwd });
415
- let settings;
402
+ const path = agent.install.settingsFile(scope, where);
403
+ let state;
416
404
  try {
417
- settings = readSettings(path);
405
+ state = installedState(agent, path, cli);
418
406
  } catch {
419
407
  continue;
420
408
  }
421
409
  readablePaths.push(path);
422
- if (!settings?.hooks) continue;
423
- const installed = REGISTERED_EVENTS.filter(
424
- (event) => (settings.hooks?.[event] ?? []).some((b) => (b.hooks ?? []).some(isOurHookCommand))
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 = ourDirectScriptBins(settings).filter((bin) => !isExecutable(bin));
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 = settingsPath(scope, { home, cwd });
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 settings;
463
+ let state;
476
464
  try {
477
- settings = readSettings(path);
465
+ state = installedState(agent, path, cli);
478
466
  } catch {
479
467
  continue;
480
468
  }
481
- const present = /* @__PURE__ */ new Set();
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: "Start a Claude Code session, then re-run doctor."
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 \`claude --debug\` hook output.`
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: "The first hook run creates it: start a Claude Code session in the repository." };
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 checkClaudeVersion(env) {
628
- let version;
629
- try {
630
- version = (env.claudeVersion ?? defaultClaudeVersion)();
631
- } catch {
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 Claude Code with \`${cliInvocation()} claude\`.`;
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 Claude Code with \`${cliInvocation()} claude\`.`;
594
+ return `Check OuterLayer cloud connectivity/config (~/.outerlayer/config.json), then start ${label} with \`${launcher}\`.`;
702
595
  case "not-governed":
703
- return "A record from an earlier CLI. It is cleared the next time `outerlayer claude` asks which control plane governs this repository.";
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 "A record from an earlier CLI. Committed AGENTS.md or .claude files no longer block the control plane, and the record is cleared the next time `outerlayer claude` asks which control plane governs this repository.";
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 Claude Code with \`${cliInvocation()} claude\` to clear it.`;
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 hookCommandsOf(settings) {
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 Claude Code with \`${cliInvocation()} claude\`.`
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-HO2VPIBJ.js');
1208
- const { defaultRunnerConfigPath, hasRunnerBlock, keyRunnerFactory, loadRunnerConfig, runnerVmOf } = await import('./config-WYQPXLOP.js');
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');
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-NQOSPJGS.js');
1082
+ const { runnerHostChecks } = await import('./doctor-EQM3JRZI.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-63SXQ7IM.js');
1110
+ const { inspectRunnerService } = await import('./find-unit-CNAPU7XQ.js');
1265
1111
  return inspectRunnerService(configPath);
1266
1112
  })();
1267
1113
  checks.push(...await runnerHostChecks({ configPath, hooks, gateway, repos, runner, service }));