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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (176) hide show
  1. package/dist/agent-setup-AOB76EDJ.js +37 -0
  2. package/dist/bridge-DFG2GTXQ.js +13 -0
  3. package/dist/build-THAD3B4Q.js +21 -0
  4. package/dist/build-disk-HO2VPIBJ.js +18 -0
  5. package/dist/build-info.json +1 -1
  6. package/dist/builder-AXJNIF4S.js +17 -0
  7. package/dist/caller-GOY2X6QT.js +20 -0
  8. package/dist/{check-K4RVAP4L.js → check-SF2OVZXB.js} +68 -66
  9. package/dist/{chunk-KB5B6ZT5.js → chunk-3FSKTGM6.js} +20 -20
  10. package/dist/{chunk-HL7UNTXO.js → chunk-4CTVN3C5.js} +15 -8
  11. package/dist/{chunk-QIOTIQWD.js → chunk-4TNUQLXH.js} +5 -5
  12. package/dist/{chunk-LGV5N5DG.js → chunk-564Q2STF.js} +1 -1
  13. package/dist/{chunk-F2LPX2HS.js → chunk-5FIOUQGC.js} +8 -8
  14. package/dist/{chunk-TSYHUUAT.js → chunk-5FND4PIU.js} +2 -2
  15. package/dist/{chunk-4DJZSNVT.js → chunk-6JJITHBI.js} +1 -1
  16. package/dist/{chunk-KLXECBIE.js → chunk-6LO62EQ5.js} +149 -106
  17. package/dist/{chunk-RIHB3HA2.js → chunk-772ILTCK.js} +3 -3
  18. package/dist/{chunk-CIUD3436.js → chunk-A5Y2HBVU.js} +1 -1
  19. package/dist/{chunk-KDK6AF7B.js → chunk-AYLYAOHH.js} +5 -5
  20. package/dist/{chunk-OEBFKPHK.js → chunk-C3JWWPLC.js} +9 -10
  21. package/dist/{chunk-24FEVLX7.js → chunk-CKPQOQFC.js} +643 -73
  22. package/dist/{chunk-ALEUIS35.js → chunk-CVGQ3BNF.js} +1 -1
  23. package/dist/{chunk-DJMR4YPG.js → chunk-EBIYRRJW.js} +5 -5
  24. package/dist/{chunk-MXIFRYLA.js → chunk-ESSJPSJ2.js} +2 -2
  25. package/dist/{chunk-D2OTBS47.js → chunk-EUDG754F.js} +2 -2
  26. package/dist/{chunk-55PYF6S2.js → chunk-FIO6PIZ6.js} +3 -3
  27. package/dist/{chunk-WT7J2627.js → chunk-GD6KIHOS.js} +1 -1
  28. package/dist/{chunk-DJDTL6AY.js → chunk-GDZTL6BI.js} +40 -31
  29. package/dist/{chunk-AF6DQJ5W.js → chunk-GSXGA6KF.js} +1 -1
  30. package/dist/{chunk-LEHBDEUG.js → chunk-GZ75FRLB.js} +4 -5
  31. package/dist/chunk-H2FFONRY.js +136 -0
  32. package/dist/{chunk-DHFNBNC3.js → chunk-HIN4BMRW.js} +2 -2
  33. package/dist/{chunk-ABAVN4RT.js → chunk-I626B72C.js} +29 -26
  34. package/dist/{chunk-VJYSPH2J.js → chunk-I6FRCBMU.js} +26 -21
  35. package/dist/{chunk-X2XTCGUS.js → chunk-J7TCTARR.js} +11 -12
  36. package/dist/chunk-J7Y3PCO2.js +653 -0
  37. package/dist/{chunk-YQHEJ5SV.js → chunk-JVCQZDQ6.js} +3 -3
  38. package/dist/{chunk-JW5BENE6.js → chunk-JXXHLQQR.js} +3 -3
  39. package/dist/{chunk-GLUQVET2.js → chunk-K3X3L5YW.js} +2 -2
  40. package/dist/{chunk-MKSZHT6S.js → chunk-KN4VIK53.js} +1 -1
  41. package/dist/chunk-L3JXQDVH.js +78 -0
  42. package/dist/{chunk-6A2GEFN3.js → chunk-LCOQN6NR.js} +2 -2
  43. package/dist/{chunk-R3252UTU.js → chunk-LSXHTBAM.js} +2 -2
  44. package/dist/{chunk-ZP7F3OHV.js → chunk-LVXR37OG.js} +47 -38
  45. package/dist/{chunk-W7I65BKE.js → chunk-LYFLUNWK.js} +12 -12
  46. package/dist/{chunk-GANAOCHR.js → chunk-M2NIHHQI.js} +24 -374
  47. package/dist/chunk-NC3QAHOS.js +26 -0
  48. package/dist/{chunk-RIIPBJK6.js → chunk-NTMRMBLM.js} +4 -4
  49. package/dist/{chunk-NFZJ5XHP.js → chunk-NWBB2SQ4.js} +33 -32
  50. package/dist/{chunk-H7SKHAUE.js → chunk-OYKAOHX5.js} +3 -3
  51. package/dist/{chunk-EBOQU6QC.js → chunk-OZOATEK3.js} +2 -2
  52. package/dist/{chunk-BRUDBWLO.js → chunk-PKO5IDW4.js} +7 -7
  53. package/dist/{chunk-7J7HRYZ3.js → chunk-PQDFW422.js} +1 -1
  54. package/dist/{chunk-EZRAR5YG.js → chunk-PT34C6SU.js} +1 -1
  55. package/dist/{chunk-HAWPG7QW.js → chunk-PTPF36Q7.js} +3 -3
  56. package/dist/{chunk-7Y5VW4JG.js → chunk-Q42K6XZ6.js} +1 -1
  57. package/dist/{chunk-SPXVFFQV.js → chunk-QJDX6VJS.js} +5 -5
  58. package/dist/{chunk-ULBVE7MP.js → chunk-RK4JQRVT.js} +6 -6
  59. package/dist/{chunk-JU3VU42K.js → chunk-RPZIHELI.js} +5 -5
  60. package/dist/{chunk-XNBUZGRO.js → chunk-RSRZDF3K.js} +3 -3
  61. package/dist/{chunk-46OBCATR.js → chunk-T5Z22NA6.js} +1 -1
  62. package/dist/chunk-TWYHSMHM.js +67 -0
  63. package/dist/{chunk-AGKQEOFS.js → chunk-TYCZVJTB.js} +54 -31
  64. package/dist/{chunk-B7PYT2BY.js → chunk-VRQM4A64.js} +6 -3
  65. package/dist/{chunk-KFUDKFEH.js → chunk-WDQPBAFV.js} +44 -19
  66. package/dist/{chunk-UZGQT6OF.js → chunk-WLMAGMTU.js} +5 -3
  67. package/dist/{chunk-RDWKRG4K.js → chunk-WNYH42PF.js} +4 -4
  68. package/dist/{chunk-MOOZJRKM.js → chunk-WQB3XOEP.js} +27 -30
  69. package/dist/{chunk-O36YAH2G.js → chunk-XABJMU5A.js} +4 -4
  70. package/dist/{chunk-2SRQSGPR.js → chunk-XAOIHYPS.js} +29 -24
  71. package/dist/{chunk-WAZJPDR2.js → chunk-XE3DIJJT.js} +1 -1
  72. package/dist/{chunk-B62TYDP2.js → chunk-XHFSBSIA.js} +4 -4
  73. package/dist/{chunk-AH6634HC.js → chunk-XLOM2BNL.js} +1 -2
  74. package/dist/{claude-launcher-L77BKZOC.js → claude-launcher-LXZPTDNC.js} +23 -18
  75. package/dist/{cli-QQY5UECM.js → cli-QFUT3UQS.js} +137 -138
  76. package/dist/{cli-update-notice-T3CXRWNB.js → cli-update-notice-AWYJ4A7R.js} +2 -2
  77. package/dist/{command-QLHQZ32L.js → command-45RZT4CK.js} +55 -56
  78. package/dist/{config-5GY7FL35.js → config-WYQPXLOP.js} +11 -9
  79. package/dist/connect-cmd-LUCQ7FSV.js +26 -0
  80. package/dist/{container-start-OCJODSMB.js → container-start-T776VI3M.js} +55 -54
  81. package/dist/{context-cleanup-A7KBEBIO.js → context-cleanup-QE2MIO2Q.js} +4 -2
  82. package/dist/{context-show-cmd-MZ74ZIVO.js → context-show-cmd-7QEHUOEL.js} +14 -14
  83. package/dist/{control-plane-launch-3TZFOSCX.js → control-plane-launch-THUH6YU5.js} +18 -18
  84. package/dist/{demo-record-cmd-Y57UWBCX.js → demo-record-cmd-SBERRQNW.js} +8 -5
  85. package/dist/{demo-voice-cmd-4INIOVTC.js → demo-voice-cmd-VM3FITZU.js} +18 -20
  86. package/dist/docker-MQNLK4OO.js +17 -0
  87. package/dist/{doctor-DB2AJUAO.js → doctor-NQOSPJGS.js} +71 -68
  88. package/dist/{emit-artifact-cmd-H27MFSKH.js → emit-artifact-cmd-6E365VBQ.js} +17 -18
  89. package/dist/{emit-cmd-IOWTTZSA.js → emit-cmd-ZPFCPVSR.js} +7 -8
  90. package/dist/{emit-criteria-cmd-IOUVMB2Q.js → emit-criteria-cmd-HWQOYZZ4.js} +13 -14
  91. package/dist/{emit-demo-cmd-WJSS7KU2.js → emit-demo-cmd-PMQGNNVX.js} +18 -20
  92. package/dist/{emit-finding-cmd-KQIGM5IF.js → emit-finding-cmd-MYWQN5WW.js} +13 -14
  93. package/dist/{emit-result-cmd-6Q7OU2NY.js → emit-result-cmd-GXK3KMAP.js} +16 -17
  94. package/dist/{emit-step-cmd-GZU5O2FR.js → emit-step-cmd-ZV2XTUVT.js} +13 -14
  95. package/dist/exec-client-P7RFRUCK.js +14 -0
  96. package/dist/find-unit-63SXQ7IM.js +21 -0
  97. package/dist/{findings-cmd-T7PQAVJG.js → findings-cmd-OGMBVVSM.js} +13 -14
  98. package/dist/{fleet-readiness-PTMOEX6L.js → fleet-readiness-4RBKLXBQ.js} +14 -15
  99. package/dist/{governing-source-CND5ZZC3.js → governing-source-XJMXFSAR.js} +19 -20
  100. package/dist/guest-init-XZHRPIMG.js +16 -0
  101. package/dist/{hook-fast-RW7RU3O6.js → hook-fast-ZOWGWCPO.js} +5 -5
  102. package/dist/host-checks-WHW24PJR.js +76 -0
  103. package/dist/host-key-MWLXB5U5.js +14 -0
  104. package/dist/{image-tag-WBD57QBN.js → image-tag-E4JK2APF.js} +9 -4
  105. package/dist/index.js +4 -4
  106. package/dist/init-EZIAHBMH.js +76 -0
  107. package/dist/{init-HUQLVUPO.js → init-LO6U7YTW.js} +52 -51
  108. package/dist/{init-cmd-6NQGBVAJ.js → init-cmd-2JANO5EN.js} +23 -24
  109. package/dist/{init-update-MA6QKX46.js → init-update-D6PRTGNE.js} +51 -44
  110. package/dist/install-cmd-SJMBNQEH.js +17 -0
  111. package/dist/{layout-2ZMCT2D3.js → layout-AQHIMJMO.js} +4 -4
  112. package/dist/{logs-FEITSC2V.js → logs-NE55HOET.js} +8 -3
  113. package/dist/loop-2E34CGCX.js +87 -0
  114. package/dist/machine-6ALGG4IO.js +76 -0
  115. package/dist/{machine-skills-237PQFRC.js → machine-skills-KK2HXYMR.js} +3 -4
  116. package/dist/{mcp-install-cmd-23ZY4IBK.js → mcp-install-cmd-2QAS3AQZ.js} +5 -1
  117. package/dist/{mcp-serve-cmd-ZINYSLY6.js → mcp-serve-cmd-U6USKHYR.js} +9 -7
  118. package/dist/{paths-XEYE7OZ2.js → paths-O7LCWY33.js} +8 -3
  119. package/dist/pending-YU2GE2UV.js +14 -0
  120. package/dist/pidfile-5GDCQ5HA.js +15 -0
  121. package/dist/record-NETSDAO6.js +14 -0
  122. package/dist/{relay-IEYNSKAZ.js → relay-VZ733BVJ.js} +6 -1
  123. package/dist/{relay-protocol-5LSWUJCW.js → relay-protocol-24GEUGCO.js} +6 -1
  124. package/dist/runner-env-KHCONH2R.js +21 -0
  125. package/dist/{runner-identity-IIY5UJL3.js → runner-identity-PSCZBILD.js} +10 -7
  126. package/dist/{runner-key-CFZ47PR3.js → runner-key-VM2LYVRK.js} +44 -46
  127. package/dist/{session-sender-NO4F2IQ5.js → session-sender-P2RHDM6U.js} +17 -18
  128. package/dist/{spec-cmd-CNASSB6L.js → spec-cmd-LGKP6MT7.js} +14 -15
  129. package/dist/{starter-pack-CCVIEY72.js → starter-pack-SMK6UPRL.js} +5 -6
  130. package/dist/state-RJR4PMMX.js +14 -0
  131. package/dist/{status-VNHIHQ57.js → status-HEHCNIDS.js} +44 -46
  132. package/dist/{sync-cmd-5JLJBODH.js → sync-cmd-HKN45HXL.js} +16 -17
  133. package/dist/update-steps-7E4RD47J.js +77 -0
  134. package/dist/{watch-AEWWTUEK.js → watch-RGZCUCR3.js} +16 -17
  135. package/dist/{work-claim-cmd-GUYOJYH7.js → work-claim-cmd-6DSPGCZE.js} +19 -21
  136. package/dist/{work-cmd-YRPYMGII.js → work-cmd-GPLYLWY7.js} +13 -14
  137. package/dist/{work-comment-cmd-U5Z6FKEU.js → work-comment-cmd-V5WM7LAW.js} +16 -17
  138. package/dist/{work-demo-cmd-OLCWTVWM.js → work-demo-cmd-SWWI6AGD.js} +13 -14
  139. package/dist/{work-logs-cmd-2OA7ENDU.js → work-logs-cmd-CTFBOPCI.js} +13 -14
  140. package/dist/{work-open-pr-cmd-6GUCDYVM.js → work-open-pr-cmd-HX2U3YBR.js} +14 -15
  141. package/dist/{work-pr-cmd-KK3VQUQI.js → work-pr-cmd-EI2R4FQG.js} +13 -14
  142. package/dist/{work-proofs-cmd-BUOS5OJC.js → work-proofs-cmd-QXNPHLYC.js} +15 -16
  143. package/dist/{work-proofs-record-6WLMOK53.js → work-proofs-record-72OKWEES.js} +22 -24
  144. package/dist/{work-stop-cmd-VZJX5X4L.js → work-stop-cmd-7M7ZYUN2.js} +13 -14
  145. package/package.json +1 -1
  146. package/dist/agent-setup-DJRQFPDU.js +0 -33
  147. package/dist/bridge-XM4QLKIX.js +0 -8
  148. package/dist/build-ZE5IG3V6.js +0 -18
  149. package/dist/build-disk-GMXDIZU4.js +0 -15
  150. package/dist/builder-LJ3FSB36.js +0 -14
  151. package/dist/caller-YLNJJPFU.js +0 -18
  152. package/dist/chunk-CXFJOX2C.js +0 -144
  153. package/dist/chunk-FGF52V4V.js +0 -137
  154. package/dist/chunk-HCVLP7XA.js +0 -53
  155. package/dist/chunk-MESOOLF4.js +0 -45
  156. package/dist/chunk-OHQMGLJP.js +0 -113
  157. package/dist/chunk-OUPQTA7N.js +0 -145
  158. package/dist/chunk-VRMXYQWR.js +0 -74
  159. package/dist/connect-cmd-THV7XBVP.js +0 -27
  160. package/dist/docker-5YVUZ3J2.js +0 -14
  161. package/dist/exec-client-FGGPQSYQ.js +0 -9
  162. package/dist/find-unit-PRZIFBIK.js +0 -19
  163. package/dist/guest-init-WPUS45IN.js +0 -11
  164. package/dist/host-checks-S3B7Z4SY.js +0 -78
  165. package/dist/host-key-O4DFMOSV.js +0 -9
  166. package/dist/init-ILTX4V56.js +0 -78
  167. package/dist/install-cmd-JKPXIOEY.js +0 -12
  168. package/dist/loop-KDWDOSMQ.js +0 -89
  169. package/dist/machine-Z6K5XXI6.js +0 -78
  170. package/dist/pending-D2NNV54J.js +0 -9
  171. package/dist/pidfile-FLFVRKVW.js +0 -10
  172. package/dist/record-JMZOXD4R.js +0 -9
  173. package/dist/runner-env-W2UMHY7P.js +0 -19
  174. package/dist/state-UWIM42JH.js +0 -9
  175. package/dist/update-steps-XGOXDCOS.js +0 -79
  176. package/dist/{chunk-OLM2TIOW.js → chunk-NFZMENCY.js} +1 -1
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
3
  import { isVersion, compareVersions } from './chunk-TQMI335S.js';
4
- import { RUNNER_DIR_MODE, RUNNER_FILE_MODE } from './chunk-WT7J2627.js';
4
+ import { RUNNER_DIR_MODE, RUNNER_FILE_MODE } from './chunk-GD6KIHOS.js';
5
5
  import { readFileSync, mkdirSync, writeFileSync, renameSync } from 'fs';
6
6
  import { join } from 'path';
7
7
 
@@ -1,12 +1,12 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
3
  import { appendContextProvenance } from './chunk-545P7JY7.js';
4
- import { CONTROL_PLANE_DIR_VARIABLE } from './chunk-HCVLP7XA.js';
4
+ import { CONTROL_PLANE_DIR_VARIABLE } from './chunk-NC3QAHOS.js';
5
5
  import { readRepoConnection, findGitDirs } from './chunk-BJ3KTMDH.js';
6
- import { updateNoticeContext, staleMachineCopiesContext } from './chunk-OLM2TIOW.js';
7
- import { resolvePackageVersion } from './chunk-RA3O54FC.js';
6
+ import { updateNoticeContext, staleMachineCopiesContext } from './chunk-NFZMENCY.js';
8
7
  import { cliInvocation } from './chunk-FZKNTIOJ.js';
9
8
  import { deadHooksState, huskyPrepareScript, preparePackageManagerCommand } from './chunk-CJPTUU2E.js';
9
+ import { resolvePackageVersion } from './chunk-RA3O54FC.js';
10
10
  import { homeFromEnv } from './chunk-352DHUTP.js';
11
11
  import { readFileSync, mkdirSync, writeFileSync, renameSync, existsSync, readdirSync, unlinkSync, statSync, appendFileSync, opendirSync } from 'fs';
12
12
  import { spawn, execFileSync } from 'child_process';
@@ -808,11 +808,11 @@ async function missingControlPlane(cwd, sessionId, home, env) {
808
808
  const dirs = findGitDirs(cwd);
809
809
  if (dirs === void 0) return void 0;
810
810
  if (existsSync(join(dirs.gitCommonDir, "outerlayer", "materialized.json")) || hasExcludeBlock(dirs.gitCommonDir)) {
811
- const { cleanupEarlierCopies } = await import('./context-cleanup-A7KBEBIO.js');
811
+ const { cleanupEarlierCopies } = await import('./context-cleanup-QE2MIO2Q.js');
812
812
  cleanupEarlierCopies(dirs);
813
813
  }
814
814
  if (!contextPossiblyGoverned(cwd, home)) return void 0;
815
- const { governanceOf } = await import('./control-plane-launch-3TZFOSCX.js');
815
+ const { governanceOf } = await import('./control-plane-launch-THUH6YU5.js');
816
816
  if (await governanceOf({ cwd, env, home }) !== "governed") return void 0;
817
817
  recordMissingContext(dirs, sessionId, home);
818
818
  const launcher = `${cliInvocation()} claude`;
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
- import { parseSize, BUILD_LABEL, RUNNER_LABEL, runnerLabelValue } from './chunk-OEBFKPHK.js';
4
- import { buildsDir, storeScopes, rootfsDir, orgStoreIn, runnerDir, imagesDir, builderCacheDiskPath } from './chunk-WT7J2627.js';
3
+ import { parseSize, BUILD_LABEL, RUNNER_LABEL, runnerLabelValue } from './chunk-C3JWWPLC.js';
4
+ import { buildsDir, storeScopes, rootfsDir, orgStoreIn, runnerDir, imagesDir, builderCacheDiskPath } from './chunk-GD6KIHOS.js';
5
5
  import { spawnSync } from 'child_process';
6
6
  import { statfsSync, statSync, existsSync, readdirSync } from 'fs';
7
7
  import { dirname, join } from 'path';
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
- import { keyRunnerFactory, RunnerConfigError } from './chunk-RIIPBJK6.js';
4
- import { orgHomeDir } from './chunk-WT7J2627.js';
3
+ import { keyRunnerFactory, RunnerConfigError } from './chunk-NTMRMBLM.js';
4
+ import { orgHomeDir } from './chunk-GD6KIHOS.js';
5
5
 
6
6
  createRequire(import.meta.url);
7
7
 
@@ -1,9 +1,9 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
3
  import { startTimeOf } from './chunk-JBJTC3UU.js';
4
- import { EXEC_PORT } from './chunk-UZGQT6OF.js';
5
- import { TUNNEL_PORT, BRIDGE_ADDRESS, BRIDGE_CIDR } from './chunk-MKSZHT6S.js';
6
- import { RELAY_PORT } from './chunk-GANAOCHR.js';
4
+ import { EXEC_PORT } from './chunk-WLMAGMTU.js';
5
+ import { TUNNEL_PORT, BRIDGE_ADDRESS, BRIDGE_CIDR } from './chunk-KN4VIK53.js';
6
+ import { RELAY_PORT } from './chunk-M2NIHHQI.js';
7
7
  import { spawn, spawnSync } from 'child_process';
8
8
  import { symlinkSync, lstatSync, writeFileSync, chmodSync, mkdirSync, existsSync } from 'fs';
9
9
 
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
- import { BUILD_HOME } from './chunk-GANAOCHR.js';
3
+ import { BUILD_HOME } from './chunk-M2NIHHQI.js';
4
4
  import { readdirSync } from 'fs';
5
5
  import { join, dirname } from 'path';
6
6
 
@@ -1,22 +1,23 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
- import { checkStarterFiles, contextIsGoverned } from './chunk-JU3VU42K.js';
4
- import { resolveCredentials, getJson, WorkCommandError } from './chunk-SPXVFFQV.js';
5
- import { isLinkedRepository } from './chunk-HL7UNTXO.js';
3
+ import { checkStarterFiles, contextIsGoverned } from './chunk-RPZIHELI.js';
4
+ import { resolveCredentials, getJson, WorkCommandError } from './chunk-QJDX6VJS.js';
5
+ import { isLinkedRepository } from './chunk-4CTVN3C5.js';
6
6
  import { C } from './chunk-2AM6Z5BP.js';
7
- import { fleetCheck, checkBuildSkill, checkMachineSkills, checkCommittedMaintainedSkills, checkMaintainedReferences, checkIgnoredSkillFolders } from './chunk-MOOZJRKM.js';
7
+ import { fleetCheck, checkBuildSkill, checkMachineSkills, checkCommittedMaintainedSkills, checkMaintainedReferences, checkIgnoredSkillFolders } from './chunk-WQB3XOEP.js';
8
8
  import { sanitizeTerminal } from './chunk-P6PHY33P.js';
9
- import { checkFormerSkillNames } from './chunk-LEHBDEUG.js';
10
- import { resolveGatewayCredentials, defaultFetch } from './chunk-YQHEJ5SV.js';
11
- import { sanitizeForContext, spoolDir, assessSyncHealth, readSyncStatus, SYNC_STALE_AFTER_MS, formatAgo, checkInstalledCliStaleness, workspaceRootOf, hookFiredMarkerPath, refreshCommand } from './chunk-DJMR4YPG.js';
9
+ import { checkFormerSkillNames } from './chunk-GZ75FRLB.js';
10
+ import { resolveGatewayCredentials, defaultFetch } from './chunk-JVCQZDQ6.js';
11
+ import { sanitizeForContext, spoolDir, assessSyncHealth, readSyncStatus, SYNC_STALE_AFTER_MS, formatAgo, checkInstalledCliStaleness, workspaceRootOf, hookFiredMarkerPath, refreshCommand } from './chunk-EBIYRRJW.js';
12
12
  import { readStatuslineState, STATE_FRESH_MS } from './chunk-YBAVN6WS.js';
13
- import { hookCommandEscapesControlPlane, CONTROL_PLANE_DIR_VARIABLE } from './chunk-HCVLP7XA.js';
13
+ import { CONTROL_PLANE_DIR_VARIABLE } from './chunk-NC3QAHOS.js';
14
14
  import { findGitDirs } from './chunk-BJ3KTMDH.js';
15
15
  import { resolveRepoIdentity, compareVersions, SUPPORTED_VERSIONS } from './chunk-5GHJFETA.js';
16
16
  import { cliInvocation } from './chunk-FZKNTIOJ.js';
17
17
  import { readSettings, settingsPath, isOurStatuslineSlot, statuslineWrappedOriginal, REGISTERED_EVENTS, isOurHookCommand, ourCommandBins, cliBinResolvable, ourDirectScriptBins, wrappedOriginalCommand } from './chunk-KYDEBGJG.js';
18
18
  import { readDeliveryRecord, readDegraded, readSourceCache } from './chunk-YQR6E6OV.js';
19
19
  import { deadHooksState, preparePackageManagerCommand } from './chunk-CJPTUU2E.js';
20
+ import { contextAgents, defaultAgents, legacyAgent } from './chunk-CKPQOQFC.js';
20
21
  import { homeFromEnv } from './chunk-352DHUTP.js';
21
22
  import { readFileSync, mkdirSync, writeFileSync, renameSync, existsSync, accessSync, constants, statSync, readdirSync, realpathSync } from 'fs';
22
23
  import { join, dirname, resolve, delimiter } from 'path';
@@ -118,7 +119,7 @@ function recordStatusline(home, settingsPath2, outcome, original, now = Date.now
118
119
  }
119
120
  var NAME = "MCP server";
120
121
  var SERVER = "outerlayer";
121
- var NPX_FIX = 'Change the "outerlayer" entry in .mcp.json to run `npx -y @outerlayer/cli mcp serve`, or install the CLI with `npm install -g @outerlayer/cli`.';
122
+ var npxFix = (file) => `Change the "outerlayer" entry in ${file} to run \`npx -y @outerlayer/cli mcp serve\`, or install the CLI with \`npm install -g @outerlayer/cli\`.`;
122
123
  function expand(value, env) {
123
124
  return value.replace(/\$\{([A-Za-z_][A-Za-z0-9_]*)\}/g, (_m, name) => env[name] ?? "");
124
125
  }
@@ -145,25 +146,32 @@ function resolveCommand(command, root, env, platform) {
145
146
  }
146
147
  return void 0;
147
148
  }
148
- function checkMcpCommand(cwd, env = process.env, platform = process.platform) {
149
+ function checkMcpCommand(cwd, env = process.env, platform = process.platform, agents = defaultAgents()) {
149
150
  const root = findGitDirs(cwd ?? process.cwd())?.repoRoot;
150
151
  if (root === void 0) return [];
151
- const path = join(root, ".mcp.json");
152
- if (!existsSync(path)) return [];
153
- let entry;
154
- try {
155
- entry = JSON.parse(readFileSync(path, "utf8")).mcpServers?.[SERVER];
156
- } catch {
157
- return [{ name: NAME, status: "warn", detail: ".mcp.json is not valid JSON, so the agent starts none of its servers", fix: "Fix the JSON syntax in .mcp.json." }];
158
- }
159
- const command = entry?.command;
160
- if (typeof command !== "string") return [];
161
- const shown = sanitizeTerminal(command);
162
- const resolved = resolveCommand(expand(command, env), root, env, platform);
163
- if (resolved === void 0) {
164
- return [{ name: NAME, status: "warn", detail: `the "outerlayer" server runs \`${shown}\`, which is not on PATH here, so the agent has no OuterLayer tools`, fix: NPX_FIX }];
165
- }
166
- return [{ name: NAME, status: "pass", detail: `the "outerlayer" server runs ${sanitizeTerminal(resolved)}` }];
152
+ const files = [...new Set(contextAgents(agents).map((agent) => agent.context.mcp))];
153
+ return files.flatMap((mcp) => {
154
+ const path = join(root, mcp.file);
155
+ if (!existsSync(path)) return [];
156
+ let text;
157
+ try {
158
+ text = readFileSync(path, "utf8");
159
+ } catch {
160
+ text = void 0;
161
+ }
162
+ const servers = text === void 0 ? void 0 : mcp.servers(text);
163
+ if (servers === void 0) {
164
+ return [{ name: NAME, status: "warn", detail: `${mcp.file} is not valid JSON, so the agent starts none of its servers`, fix: `Fix the JSON syntax in ${mcp.file}.` }];
165
+ }
166
+ const command = servers[SERVER]?.command;
167
+ if (typeof command !== "string") return [];
168
+ const shown = sanitizeTerminal(command);
169
+ const resolved = resolveCommand(expand(command, env), root, env, platform);
170
+ if (resolved === void 0) {
171
+ return [{ name: NAME, status: "warn", detail: `the "outerlayer" server runs \`${shown}\`, which is not on PATH here, so the agent has no OuterLayer tools`, fix: npxFix(mcp.file) }];
172
+ }
173
+ return [{ name: NAME, status: "pass", detail: `the "outerlayer" server runs ${sanitizeTerminal(resolved)}` }];
174
+ });
167
175
  }
168
176
 
169
177
  // src/doctor.ts
@@ -761,7 +769,8 @@ function checkControlPlaneHooks(cwd) {
761
769
  } catch {
762
770
  return [];
763
771
  }
764
- const escaping = hookCommandsOf(settings).filter(hookCommandEscapesControlPlane);
772
+ const escapesDelivery = legacyAgent().adapter.context?.escapesDelivery;
773
+ const escaping = escapesDelivery === void 0 ? [] : hookCommandsOf(settings).filter((command) => escapesDelivery(command, CONTROL_PLANE_DIR_VARIABLE));
765
774
  if (escaping.length === 0) return [];
766
775
  return [
767
776
  {
@@ -1195,8 +1204,8 @@ function doctorExitCode(checks) {
1195
1204
 
1196
1205
  // src/doctor-report.ts
1197
1206
  async function gatherDoctorChecks() {
1198
- const { DEFAULT_BUILD_DISK, DEFAULT_CACHE_DISK } = await import('./build-disk-GMXDIZU4.js');
1199
- const { defaultRunnerConfigPath, hasRunnerBlock, keyRunnerFactory, loadRunnerConfig, runnerVmOf } = await import('./config-5GY7FL35.js');
1207
+ const { DEFAULT_BUILD_DISK, DEFAULT_CACHE_DISK } = await import('./build-disk-HO2VPIBJ.js');
1208
+ const { defaultRunnerConfigPath, hasRunnerBlock, keyRunnerFactory, loadRunnerConfig, runnerVmOf } = await import('./config-WYQPXLOP.js');
1200
1209
  const configPath = defaultRunnerConfigPath();
1201
1210
  const runnerHost = hasRunnerBlock(configPath);
1202
1211
  const hooks = (() => {
@@ -1224,7 +1233,7 @@ async function gatherDoctorChecks() {
1224
1233
  const { runnerVmCheck } = await import('./doctor-53F2PYY7.js');
1225
1234
  checks.push(runnerVmCheck(configPath, { lima: realLima(), home: homeFromEnv(), instance: runnerVm.instance }));
1226
1235
  } else if (hasRunnerBlock(configPath)) {
1227
- const { runnerHostChecks } = await import('./doctor-DB2AJUAO.js');
1236
+ const { runnerHostChecks } = await import('./doctor-NQOSPJGS.js');
1228
1237
  const gateway = (() => {
1229
1238
  try {
1230
1239
  const loaded = loadRunnerConfig(configPath);
@@ -1252,7 +1261,7 @@ async function gatherDoctorChecks() {
1252
1261
  const service = await (async () => {
1253
1262
  const { existsSync: existsSync3 } = await import('fs');
1254
1263
  if (process.platform !== "linux" || !existsSync3("/run/systemd/system")) return void 0;
1255
- const { inspectRunnerService } = await import('./find-unit-PRZIFBIK.js');
1264
+ const { inspectRunnerService } = await import('./find-unit-63SXQ7IM.js');
1256
1265
  return inspectRunnerService(configPath);
1257
1266
  })();
1258
1267
  checks.push(...await runnerHostChecks({ configPath, hooks, gateway, repos, runner, service }));
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
- import { runnerDir, RUNNER_DIR_MODE, RUNNER_FILE_MODE } from './chunk-WT7J2627.js';
3
+ import { runnerDir, RUNNER_DIR_MODE, RUNNER_FILE_MODE } from './chunk-GD6KIHOS.js';
4
4
  import { readlinkSync, realpathSync, mkdirSync, unlinkSync, symlinkSync, renameSync, readFileSync, writeFileSync, rmSync, existsSync, readdirSync } from 'fs';
5
5
  import { join, basename, sep, resolve } from 'path';
6
6
 
@@ -1,8 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
- import { skillDir, FORMER_MAINTAINED_NAMES, isMaintainedCopy } from './chunk-CXFJOX2C.js';
4
3
  import { cliInvocation } from './chunk-FZKNTIOJ.js';
5
- import { emitTree, ALL_TARGET_IDS, classifyTree } from './chunk-24FEVLX7.js';
4
+ import { skillDir, emitTree, targetIds, classifyTree, emitBuilders, defaultAgents, FORMER_MAINTAINED_NAMES, isMaintainedCopy } from './chunk-CKPQOQFC.js';
6
5
  import { readFileSync, existsSync, unlinkSync, rmdirSync, readdirSync } from 'fs';
7
6
  import { join, dirname, relative, sep } from 'path';
8
7
 
@@ -17,7 +16,7 @@ function filesUnder(repoRoot, rel) {
17
16
  function retiredSkillsPresent(repoRoot) {
18
17
  return Object.keys(FORMER_MAINTAINED_NAMES).filter((former) => isMaintainedCopy(repoRoot, former));
19
18
  }
20
- function retiredSkillPaths(repoRoot, retired = retiredSkillsPresent(repoRoot)) {
19
+ function retiredSkillPaths(repoRoot, retired = retiredSkillsPresent(repoRoot), agents = defaultAgents()) {
21
20
  const paths = /* @__PURE__ */ new Set();
22
21
  for (const former of retired) {
23
22
  const sources = filesUnder(repoRoot, skillDir(former));
@@ -26,8 +25,8 @@ function retiredSkillPaths(repoRoot, retired = retiredSkillsPresent(repoRoot)) {
26
25
  contents: new Map(sources.map((path) => [path, readFileSync(join(repoRoot, path), "utf8")])),
27
26
  // A superset is safe: targets ignore a path that is not a skill asset.
28
27
  assetPaths: sources,
29
- targets: [...ALL_TARGET_IDS]
30
- });
28
+ targets: targetIds(agents)
29
+ }, emitBuilders(agents));
31
30
  for (const path of [...sources, ...compiled.files.map((f) => f.path), ...compiled.copies.map((c) => c.toPath)]) paths.add(path);
32
31
  }
33
32
  return [...paths].filter((path) => existsSync(join(repoRoot, path))).sort();
@@ -0,0 +1,136 @@
1
+ #!/usr/bin/env node
2
+ import { createRequire } from 'node:module';
3
+ import { C } from './chunk-2AM6Z5BP.js';
4
+ import { readCloudConfig } from './chunk-HWVMRETT.js';
5
+ import { cliInvocation } from './chunk-FZKNTIOJ.js';
6
+ import { defaultAgents, legacyAgent, contextAgents, McpFileError } from './chunk-CKPQOQFC.js';
7
+ import { mkdirSync, writeFileSync, existsSync, readFileSync } from 'fs';
8
+ import { join, dirname } from 'path';
9
+
10
+ createRequire(import.meta.url);
11
+ var McpInstallError = class extends Error {
12
+ };
13
+ function defaultMcpUrl(home) {
14
+ const origin = readCloudConfig(home).url;
15
+ if (!origin) {
16
+ throw new McpInstallError(
17
+ `no gateway URL: pass --url <your gateway>, or run \`${cliInvocation()} login\` first.`
18
+ );
19
+ }
20
+ return `${origin.replace(/\/+$/, "")}/v1/mcp`;
21
+ }
22
+ var API_KEY_ENV_PLACEHOLDER = "${OUTERLAYER_API_KEY}";
23
+ var DEFAULT_MCP_TRANSPORT = "stdio";
24
+ var DEFAULT_MCP_COMMAND = "outerlayer";
25
+ function buildServerEntry(url, appId) {
26
+ const headers = { Authorization: `Bearer ${API_KEY_ENV_PLACEHOLDER}` };
27
+ if (appId) headers["X-Outerlayer-App-Id"] = appId;
28
+ return { type: "http", url, headers };
29
+ }
30
+ function buildStdioServerEntry(command, url, appId) {
31
+ const args = ["mcp", "serve"];
32
+ if (url) args.push("--url", url);
33
+ if (appId) args.push("--app-id", appId);
34
+ return { type: "stdio", command, args };
35
+ }
36
+ function readMcpText(absPath, relPath) {
37
+ if (!existsSync(absPath)) return void 0;
38
+ try {
39
+ return readFileSync(absPath, "utf8");
40
+ } catch {
41
+ throw new McpInstallError(`${relPath} exists and cannot be read \u2014 fix its permissions or remove it, then run the command again`);
42
+ }
43
+ }
44
+ function installErrorFor(err, relPath) {
45
+ if (!(err instanceof McpFileError)) return err;
46
+ switch (err.problem) {
47
+ case "not-json":
48
+ return new McpInstallError(`${relPath} exists and is not valid JSON \u2014 fix or remove it, then run the command again`);
49
+ case "not-object":
50
+ return new McpInstallError(`${relPath} exists and its top level is not a JSON object \u2014 refusing to overwrite`);
51
+ case "servers-not-object":
52
+ return new McpInstallError(`${relPath} has an "mcpServers" value that is not an object \u2014 refusing to overwrite`);
53
+ }
54
+ }
55
+ function setIn(target, text, name, entry, mode) {
56
+ try {
57
+ return target.mcp.setServer(text, name, entry, mode);
58
+ } catch (err) {
59
+ throw installErrorFor(err, target.relPath);
60
+ }
61
+ }
62
+ function mcpTargets(repoRoot, agents) {
63
+ if (existsSync(join(repoRoot, ".outerlayer", "mcp.json"))) return [{ relPath: ".outerlayer/mcp.json", mcp: legacyAgent(agents).adapter.context.mcp }];
64
+ const seen = /* @__PURE__ */ new Set();
65
+ const targets = [];
66
+ for (const { context } of contextAgents(agents)) {
67
+ if (seen.has(context.mcp.file)) continue;
68
+ seen.add(context.mcp.file);
69
+ targets.push({ relPath: context.mcp.file, mcp: context.mcp });
70
+ }
71
+ return targets;
72
+ }
73
+ function mcpTargetPath(repoRoot, agents = defaultAgents()) {
74
+ return mcpTargets(repoRoot, agents)[0].relPath;
75
+ }
76
+ function addMcpEntryIfAbsent(repoRoot, name, entry, agents) {
77
+ const results = mcpTargets(repoRoot, agents).map((target) => {
78
+ const absPath = join(repoRoot, target.relPath);
79
+ const result = setIn(target, readMcpText(absPath, target.relPath), name, entry, "if-absent");
80
+ if (!result.changed) return { path: target.relPath, added: false };
81
+ mkdirSync(dirname(absPath), { recursive: true });
82
+ writeFileSync(absPath, result.text);
83
+ return { path: target.relPath, added: true };
84
+ });
85
+ const [first, ...others] = results;
86
+ return others.length === 0 ? first : { ...first, others };
87
+ }
88
+ function setMcpEntry(repoRoot, name, entry, agents = defaultAgents()) {
89
+ for (const target of mcpTargets(repoRoot, agents)) {
90
+ const absPath = join(repoRoot, target.relPath);
91
+ const result = setIn(target, readMcpText(absPath, target.relPath), name, entry, "replace");
92
+ mkdirSync(dirname(absPath), { recursive: true });
93
+ writeFileSync(absPath, result.text);
94
+ }
95
+ }
96
+ var INIT_STDIO_ENTRY = { type: "stdio", command: "npx", args: ["-y", "@outerlayer/cli", "mcp", "serve"] };
97
+ function addStdioMcpEntryIfAbsent(repoRoot, name = "outerlayer", agents = defaultAgents()) {
98
+ return addMcpEntryIfAbsent(repoRoot, name, { ...INIT_STDIO_ENTRY, args: [...INIT_STDIO_ENTRY.args] }, agents);
99
+ }
100
+ var DOCS_MCP_SERVER_NAME = "outerlayer-docs";
101
+ var DOCS_MCP_URL = "https://docs.outerlayer.ai/mcp";
102
+ var INIT_DOCS_ENTRY = { type: "http", url: DOCS_MCP_URL };
103
+ function addDocsMcpEntryIfAbsent(repoRoot, agents = defaultAgents()) {
104
+ return addMcpEntryIfAbsent(repoRoot, DOCS_MCP_SERVER_NAME, { ...INIT_DOCS_ENTRY }, agents);
105
+ }
106
+ function runMcpInstall(opts = {}, agents = defaultAgents()) {
107
+ const cwd = opts.cwd ?? process.cwd();
108
+ if (!existsSync(cwd)) throw new McpInstallError(`no such directory: ${cwd}`);
109
+ const name = opts.name ?? "outerlayer";
110
+ const transport = opts.transport ?? DEFAULT_MCP_TRANSPORT;
111
+ const url = transport === "http" ? opts.url ?? defaultMcpUrl(opts.home) : opts.url ?? null;
112
+ const entry = transport === "http" ? buildServerEntry(url, opts.appId) : buildStdioServerEntry(opts.command ?? DEFAULT_MCP_COMMAND, url ?? void 0, opts.appId);
113
+ const written = mcpTargets(cwd, agents).map((target) => {
114
+ const absPath = join(cwd, target.relPath);
115
+ const result = setIn(target, readMcpText(absPath, target.relPath), name, entry, "replace");
116
+ mkdirSync(dirname(absPath), { recursive: true });
117
+ writeFileSync(absPath, result.text);
118
+ return { relPath: target.relPath, changed: result.changed };
119
+ });
120
+ const relPath = written.map((file) => file.relPath).join(", ");
121
+ const changed = written.some((file) => file.changed);
122
+ const where = transport === "http" ? `${url}` : `stdio: ${opts.command ?? DEFAULT_MCP_COMMAND} mcp serve`;
123
+ const keyNote = transport === "http" ? `Set OUTERLAYER_API_KEY in your environment \u2014 the key is referenced as ${API_KEY_ENV_PLACEHOLDER}, never written to this file.` : "The key is read from ~/.outerlayer/config.json (or OUTERLAYER_API_KEY) each time the client connects \u2014 never written to this file.";
124
+ const output = opts.json ? JSON.stringify({ path: written[0].relPath, server: name, transport, url, changed }) : changed ? `${C.green}\u2713${C.reset} Wrote "${name}" MCP server (${where}) to ${relPath}
125
+ ${C.dim} ${keyNote}${C.reset}` : `${C.dim}"${name}" MCP server already configured in ${relPath} (no change)${C.reset}`;
126
+ if (!opts.quiet) process.stdout.write(output + "\n");
127
+ return { path: written[0].relPath, paths: written.map((file) => file.relPath), server: name, transport, url, changed, output };
128
+ }
129
+ function handleMcpInstallError(err) {
130
+ if (!(err instanceof McpInstallError)) throw err;
131
+ process.stderr.write(`${C.red}\u2717${C.reset} ${err.message}
132
+ `);
133
+ process.exitCode = 1;
134
+ }
135
+
136
+ export { DEFAULT_MCP_COMMAND, DOCS_MCP_SERVER_NAME, INIT_DOCS_ENTRY, INIT_STDIO_ENTRY, McpInstallError, addDocsMcpEntryIfAbsent, addStdioMcpEntryIfAbsent, buildServerEntry, buildStdioServerEntry, defaultMcpUrl, handleMcpInstallError, mcpTargetPath, runMcpInstall, setMcpEntry };
@@ -1,9 +1,9 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
3
  import { detectActiveSession } from './chunk-IP7BIBXJ.js';
4
- import { autoConnect } from './chunk-TSYHUUAT.js';
4
+ import { autoConnect } from './chunk-5FND4PIU.js';
5
5
  import { C } from './chunk-2AM6Z5BP.js';
6
- import { defaultFetch, unauthorizedMessage, resolveGatewayCredentials } from './chunk-YQHEJ5SV.js';
6
+ import { defaultFetch, unauthorizedMessage, resolveGatewayCredentials } from './chunk-JVCQZDQ6.js';
7
7
  import { resolveRepoIdentity } from './chunk-5GHJFETA.js';
8
8
  import { parseWorkItemEnv } from './chunk-5WYT3PPE.js';
9
9
  import { parseTrackerNumber, trackerNumberError } from './chunk-WZBHBH3J.js';
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
- import { loadMachineSkillFiles, resolvePackRoot } from './chunk-CXFJOX2C.js';
3
+ import { contextAgents, defaultAgents, userSkillFolderIn, loadMachineSkillFiles, resolvePackRoot } from './chunk-CKPQOQFC.js';
4
4
  import { MAINTAINED_SKILLS, maintainedLineVersion } from './chunk-CDDED64E.js';
5
5
  import { resolvePackageVersion } from './chunk-RA3O54FC.js';
6
6
  import { homeFromEnv } from './chunk-352DHUTP.js';
@@ -10,7 +10,6 @@ import { join, resolve, dirname, relative } from 'path';
10
10
 
11
11
  createRequire(import.meta.url);
12
12
  var machineSkillsBase = (home) => join(home, ".agents", "skills");
13
- var claudeSkillsBase = (home) => join(home, ".claude", "skills");
14
13
  var errorMessage = (err) => err instanceof Error ? err.message : String(err);
15
14
  var defaultLink = (target, path) => {
16
15
  if (process.platform === "win32") symlinkSync(resolve(realpathSync(dirname(path)), target), path, "junction");
@@ -89,19 +88,18 @@ function linksTo(entry, target) {
89
88
  return false;
90
89
  }
91
90
  }
92
- function reachFromClaude(home, name, version, link, mode) {
93
- const claude = claudeSkillsBase(home);
91
+ function reachFromAgent(agentFolder, home, name, version, link, mode) {
94
92
  const folder = join(machineSkillsBase(home), name);
95
- if (sameFolder(claude, machineSkillsBase(home))) return;
96
- const entry = join(claude, name);
93
+ if (sameFolder(agentFolder, machineSkillsBase(home))) return;
94
+ const entry = join(agentFolder, name);
97
95
  if (mode === "refresh" && !entryExists(entry)) return;
98
96
  if (linksTo(entry, folder)) return;
99
97
  if (folderExists(entry) && installedVersion(entry) === version) return;
100
- mkdirSync(claude, { recursive: true });
98
+ mkdirSync(agentFolder, { recursive: true });
101
99
  try {
102
- const temporary = tempName(claude, "tmp");
100
+ const temporary = tempName(agentFolder, "tmp");
103
101
  try {
104
- link(relative(realpathSync(claude), realpathSync(folder)), temporary);
102
+ link(relative(realpathSync(agentFolder), realpathSync(folder)), temporary);
105
103
  rmSync(entry, { recursive: true, force: true });
106
104
  renameSync(temporary, entry);
107
105
  } finally {
@@ -116,6 +114,7 @@ function installMachineSkills(opts) {
116
114
  const version = opts.version ?? resolvePackageVersion();
117
115
  const base = machineSkillsBase(opts.home);
118
116
  const link = opts.link ?? defaultLink;
117
+ const agentFolders = contextAgents(opts.agents ?? defaultAgents()).map((agent) => userSkillFolderIn(opts.home, agent.descriptor));
119
118
  let files;
120
119
  const filesOf = (name) => {
121
120
  files ??= loadMachineSkillFiles(opts.packRoot ?? resolvePackRoot(), version);
@@ -133,10 +132,12 @@ function installMachineSkills(opts) {
133
132
  result.failures.push(`${folder}: ${errorMessage(err)}`);
134
133
  continue;
135
134
  }
136
- try {
137
- reachFromClaude(opts.home, name, version, link, opts.mode);
138
- } catch (err) {
139
- result.failures.push(`${join(claudeSkillsBase(opts.home), name)}: ${errorMessage(err)}`);
135
+ for (const agentFolder of agentFolders) {
136
+ try {
137
+ reachFromAgent(agentFolder, opts.home, name, version, link, opts.mode);
138
+ } catch (err) {
139
+ result.failures.push(`${join(agentFolder, name)}: ${errorMessage(err)}`);
140
+ }
140
141
  }
141
142
  }
142
143
  return result;
@@ -148,26 +149,28 @@ function machineSkillsState(home, version = resolvePackageVersion()) {
148
149
  return { name, state: installedVersion(folder) === version ? "current" : "stale" };
149
150
  });
150
151
  }
151
- function staleClaudeSkills(home, version = resolvePackageVersion()) {
152
- const claude = claudeSkillsBase(home);
153
- if (sameFolder(claude, machineSkillsBase(home))) return [];
154
- return MAINTAINED_SKILLS.filter((name) => {
155
- const entry = join(claude, name);
156
- if (!entryExists(entry)) return false;
157
- if (linksTo(entry, join(machineSkillsBase(home), name))) return false;
158
- return installedVersion(entry) !== version;
152
+ function staleAgentSkills(home, version = resolvePackageVersion(), agents = defaultAgents()) {
153
+ return contextAgents(agents).flatMap(({ descriptor }) => {
154
+ const agentFolder = userSkillFolderIn(home, descriptor);
155
+ if (sameFolder(agentFolder, machineSkillsBase(home))) return [];
156
+ return MAINTAINED_SKILLS.filter((name) => {
157
+ const entry = join(agentFolder, name);
158
+ if (!entryExists(entry)) return false;
159
+ if (linksTo(entry, join(machineSkillsBase(home), name))) return false;
160
+ return installedVersion(entry) !== version;
161
+ }).map((name) => ({ folder: descriptor.context.userSkillFolder, name }));
159
162
  });
160
163
  }
161
- function setupMachineSkills(home = homeFromEnv()) {
164
+ function setupMachineSkills(home = homeFromEnv(), agents) {
162
165
  try {
163
- return installMachineSkills({ home, mode: "setup" });
166
+ return installMachineSkills({ home, mode: "setup", agents });
164
167
  } catch (err) {
165
168
  return { written: [], failures: [errorMessage(err)] };
166
169
  }
167
170
  }
168
- function refreshMachineSkills(home = homeFromEnv()) {
171
+ function refreshMachineSkills(home = homeFromEnv(), agents) {
169
172
  try {
170
- installMachineSkills({ home, mode: "refresh" });
173
+ installMachineSkills({ home, mode: "refresh", agents });
171
174
  } catch {
172
175
  }
173
176
  }
@@ -179,4 +182,4 @@ function machineRefreshSkipped(commandNames, hidden, argv) {
179
182
  return top === "sync" && argv.includes("--quiet");
180
183
  }
181
184
 
182
- export { installMachineSkills, machineRefreshSkipped, machineSkillsState, refreshMachineSkills, setupMachineSkills, staleClaudeSkills };
185
+ export { installMachineSkills, machineRefreshSkipped, machineSkillsState, refreshMachineSkills, setupMachineSkills, staleAgentSkills };
@@ -1,13 +1,13 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
- import { placeholderQueues, placeholderProblem } from './chunk-KLXECBIE.js';
4
- import { checkFit, RUNNER_RESERVE_BYTES } from './chunk-AGKQEOFS.js';
5
- import { isBuiltinVm, builtinKind, EGRESS_SWITCHABLE_KEYS, imageBuildOf, keepsHostBuilder } from './chunk-RIIPBJK6.js';
6
- import { realBuildDiskProbe, checkDiskFit, DEFAULT_CACHE_DISK, DEFAULT_BUILD_DISK } from './chunk-MXIFRYLA.js';
7
- import { builderDiskPinned } from './chunk-OUPQTA7N.js';
8
- import { getJson, WorkCommandError } from './chunk-SPXVFFQV.js';
9
- import { ensureHostKey } from './chunk-4DJZSNVT.js';
10
- import { BUILD_SLICE_MEMORY_ENV, FORWARDED_CLAUDE_CREDENTIAL_VARIABLES, claudeCredentialVariablesSet, claudeCredential, claudeEnvPath, parseRunnerEnv } from './chunk-GANAOCHR.js';
3
+ import { placeholderQueues, placeholderProblem } from './chunk-6LO62EQ5.js';
4
+ import { checkFit, RUNNER_RESERVE_BYTES } from './chunk-TYCZVJTB.js';
5
+ import { isBuiltinVm, builtinKind, EGRESS_SWITCHABLE_KEYS, imageBuildOf, keepsHostBuilder } from './chunk-NTMRMBLM.js';
6
+ import { realBuildDiskProbe, checkDiskFit, DEFAULT_CACHE_DISK, DEFAULT_BUILD_DISK } from './chunk-ESSJPSJ2.js';
7
+ import { getJson, WorkCommandError } from './chunk-QJDX6VJS.js';
8
+ import { ensureHostKey } from './chunk-6JJITHBI.js';
9
+ import { BUILD_SLICE_MEMORY_ENV, forwardedVariables, credentialAgent, credentialForms, managedKeyName, builderDiskPinned, agentCredentialVariablesSet, agentCredential, storeVariables, credentialEnvPath, parseRunnerEnv } from './chunk-J7Y3PCO2.js';
10
+ import { defaultAgents } from './chunk-CKPQOQFC.js';
11
11
  import { closeSync, openSync, constants, readFileSync } from 'fs';
12
12
  import { join, dirname } from 'path';
13
13
  import { totalmem } from 'os';
@@ -69,7 +69,7 @@ function sliceMemoryOf(env) {
69
69
  const bytes = Number(env[BUILD_SLICE_MEMORY_ENV]);
70
70
  return Number.isSafeInteger(bytes) && bytes > 0 ? bytes : void 0;
71
71
  }
72
- function managedProblems(facts) {
72
+ function managedProblems(facts, agents = defaultAgents()) {
73
73
  const problems = [];
74
74
  if (builtinKind(facts.provision) !== "vm") {
75
75
  problems.push({
@@ -83,11 +83,13 @@ function managedProblems(facts) {
83
83
  const advice = problem.includes("pins no helper") || problem.includes("runner install") ? "" : ". Run `outerlayer runner install --service --replace` to install the root helper, then restart the service";
84
84
  problems.push({ condition: "jailer", reason: `builds would run without the jailer, which a managed runner does not allow: ${problem}${advice}` });
85
85
  }
86
- const held = FORWARDED_CLAUDE_CREDENTIAL_VARIABLES.filter((variable) => facts.credentials.has(variable));
87
- if (held.length > 0) {
86
+ const held = forwardedVariables(agents).filter((variable) => facts.credentials.has(variable));
87
+ const owner = credentialAgent(agents);
88
+ if (held.length > 0 && owner !== void 0) {
89
+ const { label, envFile } = credentialForms(owner.descriptor);
88
90
  problems.push({
89
91
  condition: "credential",
90
- reason: `a managed runner holds no Claude credential of its own: it gets the factory's Anthropic API key from each claim. ${held.join(" and ")} ${held.length === 1 ? "is" : "are"} set in the runner's environment, runner.env or claude.env. Remove ${held.length === 1 ? "it" : "them"} from the environment and from the runner.env and claude.env beside the config, then restart the service`
92
+ reason: `a managed runner holds no ${label} credential of its own: it gets the factory's ${managedKeyName(agents)} from each claim. ${held.join(" and ")} ${held.length === 1 ? "is" : "are"} set in the runner's environment, runner.env or ${envFile}. Remove ${held.length === 1 ? "it" : "them"} from the environment and from the runner.env and ${envFile} beside the config, then restart the service`
91
93
  });
92
94
  }
93
95
  if (facts.allowHosts === void 0) {
@@ -118,10 +120,11 @@ function managedProblems(facts) {
118
120
  }
119
121
  return problems;
120
122
  }
121
- function credentialsInFiles(configPath) {
123
+ function credentialsInFiles(configPath, agents) {
122
124
  const found = /* @__PURE__ */ new Set();
123
125
  if (configPath === void 0) return found;
124
- for (const path of [join(dirname(configPath), "runner.env"), claudeEnvPath(configPath)]) {
126
+ const own = credentialEnvPath(configPath, agents);
127
+ for (const path of [join(dirname(configPath), "runner.env"), ...own === void 0 ? [] : [own]]) {
125
128
  let text;
126
129
  try {
127
130
  text = readFileSync(path, "utf8");
@@ -129,28 +132,28 @@ function credentialsInFiles(configPath) {
129
132
  continue;
130
133
  }
131
134
  const values = parseRunnerEnv(text);
132
- for (const variable of FORWARDED_CLAUDE_CREDENTIAL_VARIABLES) if ((values[variable] ?? "").trim() !== "") found.add(variable);
135
+ for (const variable of forwardedVariables(agents)) if ((values[variable] ?? "").trim() !== "") found.add(variable);
133
136
  }
134
137
  return found;
135
138
  }
136
- function managedFactsOf(config, probes) {
139
+ function managedFactsOf(config, probes, agents = defaultAgents()) {
137
140
  return {
138
141
  provision: config.hooks.provision,
139
142
  jailer: probes.jailer ?? "unknown",
140
- credentials: /* @__PURE__ */ new Set([...claudeCredentialVariablesSet(probes.env), ...credentialsInFiles(config.configPath)]),
143
+ credentials: /* @__PURE__ */ new Set([...agentCredentialVariablesSet(probes.env, {}, agents), ...credentialsInFiles(config.configPath, agents)]),
141
144
  allowHosts: config.build?.allowHosts,
142
145
  egress: config.build?.egress,
143
146
  imageBuild: imageBuildOf(config),
144
147
  builderDiskPinned: probes.builderDiskPinned ?? builderDiskPinned()
145
148
  };
146
149
  }
147
- function checkBlockedWithSlots(config, probes) {
150
+ function checkBlockedWithSlots(config, probes, agents = defaultAgents()) {
148
151
  const blocked = (reason) => ({ blocked: { reason } });
149
152
  let slots;
150
153
  const placeholders = placeholderQueues(config);
151
154
  if (placeholders.length > 0) return blocked(`${placeholderProblem(placeholders)}. The runner takes work again once the config is edited`);
152
155
  if (config.managed === true) {
153
- const unmet = managedProblems(managedFactsOf(config, probes))[0];
156
+ const unmet = managedProblems(managedFactsOf(config, probes, agents), agents)[0];
154
157
  if (unmet !== void 0) return blocked(unmet.reason);
155
158
  }
156
159
  const kind = builtinKind(config.hooks.provision);
@@ -194,11 +197,13 @@ function checkBlockedWithSlots(config, probes) {
194
197
  }
195
198
  if (builder !== "usable") return { blocked: { reason: `${builder.problem}. The runner takes work again once its image builder works` }, slots };
196
199
  }
197
- if (kind !== "own" && config.managed !== true && claudeCredential(probes.env) === void 0) {
200
+ const owner = credentialAgent(agents);
201
+ if (kind !== "own" && config.managed !== true && owner !== void 0 && agentCredential(probes.env, {}, agents) === void 0) {
202
+ const forms = credentialForms(owner.descriptor);
198
203
  return {
199
204
  slots,
200
205
  blocked: {
201
- reason: "there is no Claude credential in the runner's environment. Store CLAUDE_CODE_OAUTH_TOKEN (from `claude setup-token`) or ANTHROPIC_API_KEY with `outerlayer runner init --agent claude`, which writes the claude.env beside the config, then restart the service"
206
+ reason: `there is no ${forms.label} credential in the runner's environment. Store ${storeVariables(forms)} with \`outerlayer runner init --agent ${forms.runnerName}\`, which writes the ${forms.envFile} beside the config, then restart the service`
202
207
  }
203
208
  };
204
209
  }