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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (192) hide show
  1. package/dist/agent-setup-AOB76EDJ.js +37 -0
  2. package/dist/{artifact-link-cmd-W7LRR76D.js → artifact-link-cmd-ZCMQIT5Y.js} +2 -2
  3. package/dist/bridge-DFG2GTXQ.js +13 -0
  4. package/dist/build-THAD3B4Q.js +21 -0
  5. package/dist/build-disk-HO2VPIBJ.js +18 -0
  6. package/dist/build-info.json +1 -1
  7. package/dist/builder-AXJNIF4S.js +17 -0
  8. package/dist/caller-GOY2X6QT.js +20 -0
  9. package/dist/{check-G4TVQKN3.js → check-SF2OVZXB.js} +73 -71
  10. package/dist/{chunk-KB5B6ZT5.js → chunk-3FSKTGM6.js} +20 -20
  11. package/dist/{chunk-CONA2WNE.js → chunk-4CTVN3C5.js} +18 -11
  12. package/dist/{chunk-2QW2PLWT.js → chunk-4TNUQLXH.js} +8 -8
  13. package/dist/{chunk-LGV5N5DG.js → chunk-564Q2STF.js} +1 -1
  14. package/dist/{chunk-2ANBJ7DB.js → chunk-5FIOUQGC.js} +8 -8
  15. package/dist/{chunk-4W7CPTKY.js → chunk-5FND4PIU.js} +3 -3
  16. package/dist/{chunk-SQ6HDN7A.js → chunk-5GHJFETA.js} +1 -1
  17. package/dist/{chunk-4DJZSNVT.js → chunk-6JJITHBI.js} +1 -1
  18. package/dist/{chunk-6CYNPWZT.js → chunk-6LO62EQ5.js} +151 -108
  19. package/dist/{chunk-RIHB3HA2.js → chunk-772ILTCK.js} +3 -3
  20. package/dist/{chunk-CIUD3436.js → chunk-A5Y2HBVU.js} +1 -1
  21. package/dist/{chunk-F3ZMVUAS.js → chunk-AYLYAOHH.js} +5 -5
  22. package/dist/{chunk-DZDTSDHQ.js → chunk-C3JWWPLC.js} +10 -11
  23. package/dist/{chunk-JFMSFHER.js → chunk-CKPQOQFC.js} +644 -74
  24. package/dist/{chunk-ALEUIS35.js → chunk-CVGQ3BNF.js} +1 -1
  25. package/dist/{chunk-GDMAN42R.js → chunk-EBIYRRJW.js} +5 -5
  26. package/dist/{chunk-UIKUH2UQ.js → chunk-ESSJPSJ2.js} +2 -2
  27. package/dist/{chunk-A67A5SWG.js → chunk-EUDG754F.js} +2 -2
  28. package/dist/{chunk-55PYF6S2.js → chunk-FIO6PIZ6.js} +3 -3
  29. package/dist/{chunk-WT7J2627.js → chunk-GD6KIHOS.js} +1 -1
  30. package/dist/{chunk-SRENPED2.js → chunk-GDZTL6BI.js} +42 -33
  31. package/dist/{chunk-AF6DQJ5W.js → chunk-GSXGA6KF.js} +1 -1
  32. package/dist/{chunk-T3AJOPUR.js → chunk-GZ75FRLB.js} +4 -5
  33. package/dist/chunk-H2FFONRY.js +136 -0
  34. package/dist/{chunk-IM2DECLP.js → chunk-HIN4BMRW.js} +3 -3
  35. package/dist/{chunk-OLENS2DD.js → chunk-I626B72C.js} +29 -26
  36. package/dist/{chunk-YCUUZGFF.js → chunk-I6FRCBMU.js} +26 -21
  37. package/dist/{chunk-PN6TNCQI.js → chunk-J7TCTARR.js} +11 -12
  38. package/dist/chunk-J7Y3PCO2.js +653 -0
  39. package/dist/{chunk-YQHEJ5SV.js → chunk-JVCQZDQ6.js} +3 -3
  40. package/dist/{chunk-5DYL6FJA.js → chunk-JXXHLQQR.js} +3 -3
  41. package/dist/{chunk-VI6Z4EJZ.js → chunk-K3X3L5YW.js} +4 -4
  42. package/dist/{chunk-MKSZHT6S.js → chunk-KN4VIK53.js} +1 -1
  43. package/dist/{chunk-3LCXSD26.js → chunk-L2BA2HXM.js} +1 -1
  44. package/dist/chunk-L3JXQDVH.js +78 -0
  45. package/dist/{chunk-3ONYQMGD.js → chunk-LCOQN6NR.js} +3 -3
  46. package/dist/{chunk-6KHQGLNT.js → chunk-LSXHTBAM.js} +5 -5
  47. package/dist/{chunk-RGH5GYU2.js → chunk-LVXR37OG.js} +47 -38
  48. package/dist/{chunk-HGGR7Y3V.js → chunk-LYFLUNWK.js} +12 -12
  49. package/dist/{chunk-GANAOCHR.js → chunk-M2NIHHQI.js} +24 -374
  50. package/dist/chunk-NC3QAHOS.js +26 -0
  51. package/dist/{chunk-UFRRRF64.js → chunk-NTMRMBLM.js} +10 -5
  52. package/dist/{chunk-RGU6LHPI.js → chunk-NWBB2SQ4.js} +38 -35
  53. package/dist/{chunk-A7D5BMII.js → chunk-OYKAOHX5.js} +5 -5
  54. package/dist/{chunk-46YRS7QS.js → chunk-OZOATEK3.js} +4 -4
  55. package/dist/{chunk-3PQTOKML.js → chunk-P6PHY33P.js} +1 -1
  56. package/dist/{chunk-GQ7VVBUA.js → chunk-PKO5IDW4.js} +7 -7
  57. package/dist/{chunk-7J7HRYZ3.js → chunk-PQDFW422.js} +1 -1
  58. package/dist/{chunk-EZRAR5YG.js → chunk-PT34C6SU.js} +1 -1
  59. package/dist/{chunk-K66FIV2S.js → chunk-PTPF36Q7.js} +3 -3
  60. package/dist/{chunk-7Y5VW4JG.js → chunk-Q42K6XZ6.js} +1 -1
  61. package/dist/{chunk-VIJWXQMT.js → chunk-QJDX6VJS.js} +7 -7
  62. package/dist/{chunk-W46566FP.js → chunk-RK4JQRVT.js} +9 -9
  63. package/dist/{chunk-U553JKMO.js → chunk-RPZIHELI.js} +5 -5
  64. package/dist/{chunk-CIEX2ZKQ.js → chunk-RSRZDF3K.js} +6 -6
  65. package/dist/{chunk-46OBCATR.js → chunk-T5Z22NA6.js} +1 -1
  66. package/dist/{chunk-5H57X7YC.js → chunk-TPMLB3VZ.js} +1 -1
  67. package/dist/chunk-TWYHSMHM.js +67 -0
  68. package/dist/{chunk-6GA5BJTH.js → chunk-TYCZVJTB.js} +54 -31
  69. package/dist/{chunk-4SFHEARD.js → chunk-VRQM4A64.js} +6 -3
  70. package/dist/{chunk-LRCGXRQI.js → chunk-WDQPBAFV.js} +44 -19
  71. package/dist/{chunk-UZGQT6OF.js → chunk-WLMAGMTU.js} +5 -3
  72. package/dist/{chunk-KCUX5I5W.js → chunk-WNYH42PF.js} +6 -6
  73. package/dist/{chunk-C4YULCXX.js → chunk-WQB3XOEP.js} +28 -31
  74. package/dist/{chunk-VUG4IZ7H.js → chunk-WUKLQWGY.js} +1 -1
  75. package/dist/{chunk-MDFOS4OM.js → chunk-XABJMU5A.js} +4 -4
  76. package/dist/{chunk-MMXPNEEQ.js → chunk-XAOIHYPS.js} +29 -24
  77. package/dist/{chunk-WAZJPDR2.js → chunk-XE3DIJJT.js} +1 -1
  78. package/dist/{chunk-3SQZ5LIK.js → chunk-XHFSBSIA.js} +4 -4
  79. package/dist/{chunk-GDIVOYDA.js → chunk-XLOM2BNL.js} +3 -4
  80. package/dist/{claude-launcher-YV3TDXBU.js → claude-launcher-LXZPTDNC.js} +23 -18
  81. package/dist/{cli-EMQEIYSR.js → cli-QFUT3UQS.js} +145 -146
  82. package/dist/{cli-update-notice-T3CXRWNB.js → cli-update-notice-AWYJ4A7R.js} +2 -2
  83. package/dist/{command-GKVKI74I.js → command-45RZT4CK.js} +59 -60
  84. package/dist/{config-4HXUXX3M.js → config-WYQPXLOP.js} +13 -11
  85. package/dist/connect-cmd-LUCQ7FSV.js +26 -0
  86. package/dist/{container-start-OMF3ZUIB.js → container-start-T776VI3M.js} +59 -58
  87. package/dist/{context-cleanup-TPHCVVFV.js → context-cleanup-QE2MIO2Q.js} +5 -3
  88. package/dist/{context-show-cmd-MKQAAR7R.js → context-show-cmd-7QEHUOEL.js} +17 -17
  89. package/dist/{control-plane-launch-UWFQWMWB.js → control-plane-launch-THUH6YU5.js} +19 -19
  90. package/dist/{demo-record-cmd-Y57UWBCX.js → demo-record-cmd-SBERRQNW.js} +8 -5
  91. package/dist/{demo-voice-cmd-H4PCO2PT.js → demo-voice-cmd-VM3FITZU.js} +22 -24
  92. package/dist/{dist-Y3WSK7OZ.js → dist-6KGTCWKR.js} +2 -2
  93. package/dist/docker-MQNLK4OO.js +17 -0
  94. package/dist/{doctor-FEBZ3DZB.js → doctor-NQOSPJGS.js} +75 -72
  95. package/dist/emit-artifact-cmd-6E365VBQ.js +41 -0
  96. package/dist/emit-cmd-ZPFCPVSR.js +16 -0
  97. package/dist/emit-criteria-cmd-HWQOYZZ4.js +32 -0
  98. package/dist/{emit-demo-cmd-VKGN74NW.js → emit-demo-cmd-PMQGNNVX.js} +22 -24
  99. package/dist/{emit-finding-cmd-DNFJEYQS.js → emit-finding-cmd-MYWQN5WW.js} +17 -18
  100. package/dist/{emit-result-cmd-OR5WTW4P.js → emit-result-cmd-GXK3KMAP.js} +20 -21
  101. package/dist/{emit-step-cmd-AAEBYW3L.js → emit-step-cmd-ZV2XTUVT.js} +17 -18
  102. package/dist/exec-client-P7RFRUCK.js +14 -0
  103. package/dist/find-unit-63SXQ7IM.js +21 -0
  104. package/dist/{findings-cmd-LTM62M3K.js → findings-cmd-OGMBVVSM.js} +17 -18
  105. package/dist/fleet-readiness-4RBKLXBQ.js +27 -0
  106. package/dist/governing-source-XJMXFSAR.js +38 -0
  107. package/dist/guest-init-XZHRPIMG.js +16 -0
  108. package/dist/{hook-fast-3HPWMSFB.js → hook-fast-ZOWGWCPO.js} +5 -5
  109. package/dist/host-checks-WHW24PJR.js +76 -0
  110. package/dist/host-key-MWLXB5U5.js +14 -0
  111. package/dist/{image-tag-WBD57QBN.js → image-tag-E4JK2APF.js} +9 -4
  112. package/dist/index.js +4 -4
  113. package/dist/init-EZIAHBMH.js +76 -0
  114. package/dist/{init-O5H4TWA7.js → init-LO6U7YTW.js} +56 -55
  115. package/dist/{init-cmd-HWAXEEOD.js → init-cmd-2JANO5EN.js} +27 -28
  116. package/dist/{init-update-3W2TOJQV.js → init-update-D6PRTGNE.js} +55 -48
  117. package/dist/install-cmd-SJMBNQEH.js +17 -0
  118. package/dist/layout-AQHIMJMO.js +11 -0
  119. package/dist/{login-browser-ODTJEGDN.js → login-browser-QH4KYG3F.js} +2 -2
  120. package/dist/{logs-FEITSC2V.js → logs-NE55HOET.js} +8 -3
  121. package/dist/loop-2E34CGCX.js +87 -0
  122. package/dist/machine-6ALGG4IO.js +76 -0
  123. package/dist/{machine-skills-VRUJVBQV.js → machine-skills-KK2HXYMR.js} +3 -4
  124. package/dist/{mcp-install-cmd-23ZY4IBK.js → mcp-install-cmd-2QAS3AQZ.js} +5 -1
  125. package/dist/{mcp-serve-cmd-ZINYSLY6.js → mcp-serve-cmd-U6USKHYR.js} +9 -7
  126. package/dist/{paths-XEYE7OZ2.js → paths-O7LCWY33.js} +8 -3
  127. package/dist/pending-YU2GE2UV.js +14 -0
  128. package/dist/pidfile-5GDCQ5HA.js +15 -0
  129. package/dist/record-NETSDAO6.js +14 -0
  130. package/dist/{relay-IEYNSKAZ.js → relay-VZ733BVJ.js} +6 -1
  131. package/dist/{relay-protocol-5LSWUJCW.js → relay-protocol-24GEUGCO.js} +6 -1
  132. package/dist/runner-env-KHCONH2R.js +21 -0
  133. package/dist/runner-identity-PSCZBILD.js +17 -0
  134. package/dist/{runner-key-HUOW7X7B.js → runner-key-VM2LYVRK.js} +48 -50
  135. package/dist/{session-sender-32UAV25N.js → session-sender-P2RHDM6U.js} +21 -22
  136. package/dist/{spec-cmd-TPRHZ3EV.js → spec-cmd-LGKP6MT7.js} +18 -19
  137. package/dist/{starter-pack-7QNUT74O.js → starter-pack-SMK6UPRL.js} +6 -7
  138. package/dist/state-RJR4PMMX.js +14 -0
  139. package/dist/{status-HDJ2V5UD.js → status-HEHCNIDS.js} +48 -50
  140. package/dist/{sync-cmd-AHXCXMVP.js → sync-cmd-HKN45HXL.js} +20 -21
  141. package/dist/update-steps-7E4RD47J.js +77 -0
  142. package/dist/{watch-4EDI4CTS.js → watch-RGZCUCR3.js} +20 -21
  143. package/dist/{work-claim-cmd-GFRZBX2V.js → work-claim-cmd-6DSPGCZE.js} +24 -26
  144. package/dist/{work-cmd-FLKJQWGQ.js → work-cmd-GPLYLWY7.js} +17 -18
  145. package/dist/work-comment-cmd-V5WM7LAW.js +35 -0
  146. package/dist/{work-demo-cmd-FDPDTXG6.js → work-demo-cmd-SWWI6AGD.js} +17 -18
  147. package/dist/{work-logs-cmd-PSB44DT5.js → work-logs-cmd-CTFBOPCI.js} +17 -18
  148. package/dist/{work-open-pr-cmd-QJW5PNT2.js → work-open-pr-cmd-HX2U3YBR.js} +18 -19
  149. package/dist/{work-pr-cmd-HMGBUHGL.js → work-pr-cmd-EI2R4FQG.js} +17 -18
  150. package/dist/{work-proofs-cmd-3GPGH4RL.js → work-proofs-cmd-QXNPHLYC.js} +19 -20
  151. package/dist/{work-proofs-record-AC4GYMQA.js → work-proofs-record-72OKWEES.js} +26 -28
  152. package/dist/{work-stop-cmd-YO7SBPNF.js → work-stop-cmd-7M7ZYUN2.js} +17 -18
  153. package/package.json +2 -1
  154. package/dist/agent-setup-UYTS2PHZ.js +0 -33
  155. package/dist/bridge-XM4QLKIX.js +0 -8
  156. package/dist/build-IENNKWWC.js +0 -18
  157. package/dist/build-disk-M33Q6L22.js +0 -15
  158. package/dist/builder-YNMSYR75.js +0 -14
  159. package/dist/caller-2GU5V52U.js +0 -18
  160. package/dist/chunk-3DMCCCVM.js +0 -74
  161. package/dist/chunk-7O7LJWQO.js +0 -144
  162. package/dist/chunk-FGF52V4V.js +0 -137
  163. package/dist/chunk-HCVLP7XA.js +0 -53
  164. package/dist/chunk-MESOOLF4.js +0 -45
  165. package/dist/chunk-OHQMGLJP.js +0 -113
  166. package/dist/chunk-OUPQTA7N.js +0 -145
  167. package/dist/connect-cmd-GLB2X7YA.js +0 -27
  168. package/dist/docker-AFJABU7U.js +0 -14
  169. package/dist/emit-artifact-cmd-DGFH4MUK.js +0 -42
  170. package/dist/emit-cmd-HNXRGC5Z.js +0 -17
  171. package/dist/emit-criteria-cmd-B23VYUF6.js +0 -33
  172. package/dist/exec-client-FGGPQSYQ.js +0 -9
  173. package/dist/find-unit-4XKMNIE7.js +0 -19
  174. package/dist/fleet-readiness-FAKMWCJV.js +0 -28
  175. package/dist/governing-source-75MBT2IE.js +0 -39
  176. package/dist/guest-init-WPUS45IN.js +0 -11
  177. package/dist/host-checks-PUI32LIA.js +0 -78
  178. package/dist/host-key-O4DFMOSV.js +0 -9
  179. package/dist/init-Y672J4BW.js +0 -78
  180. package/dist/install-cmd-JKPXIOEY.js +0 -12
  181. package/dist/layout-TLUOMM6F.js +0 -11
  182. package/dist/loop-QJGPNIT4.js +0 -89
  183. package/dist/machine-YKQSW22W.js +0 -78
  184. package/dist/pending-D2NNV54J.js +0 -9
  185. package/dist/pidfile-FLFVRKVW.js +0 -10
  186. package/dist/record-JMZOXD4R.js +0 -9
  187. package/dist/runner-env-FK3SUT3Q.js +0 -19
  188. package/dist/runner-identity-WYAGV6UQ.js +0 -14
  189. package/dist/state-UWIM42JH.js +0 -9
  190. package/dist/update-steps-F37GQWLJ.js +0 -79
  191. package/dist/work-comment-cmd-3HUIIEQD.js +0 -36
  192. package/dist/{chunk-OLM2TIOW.js → chunk-NFZMENCY.js} +1 -1
@@ -1,9 +1,10 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
- import { builtinKind, keepsHostBuilder } from './chunk-UFRRRF64.js';
4
- import { parseSize } from './chunk-DZDTSDHQ.js';
5
- import { runnerDir } from './chunk-WT7J2627.js';
6
- import { FD_SLOTS_PER_BUILD, FD_STORE_ENV, BUILD_SLICE_MEMORY_ENV, CLAUDE_CREDENTIAL_ID, CLAUDE_ENV_FILE, credentialLineIn, withoutCredentialLines } from './chunk-GANAOCHR.js';
3
+ import { builtinKind, keepsHostBuilder } from './chunk-NTMRMBLM.js';
4
+ import { parseSize } from './chunk-C3JWWPLC.js';
5
+ import { runnerDir } from './chunk-GD6KIHOS.js';
6
+ import { FD_SLOTS_PER_BUILD, runnerAgents, credentialNames, FD_STORE_ENV, BUILD_SLICE_MEMORY_ENV, credentialAgent, credentialForms, credentialLineIn, withoutCredentialLines } from './chunk-J7Y3PCO2.js';
7
+ import { defaultAgents } from './chunk-CKPQOQFC.js';
7
8
  import { existsSync, readFileSync, writeFileSync, chmodSync, renameSync } from 'fs';
8
9
  import { dirname, join } from 'path';
9
10
  import { spawnSync } from 'child_process';
@@ -20,7 +21,11 @@ function escapeUnitPath(path) {
20
21
  function credentialPath(path) {
21
22
  return path.replace(/%/g, "%%");
22
23
  }
23
- function runnerUnit(unit) {
24
+ function runnerUnit(unit, agents = defaultAgents()) {
25
+ const credentialLines = runnerAgents(agents).map((agent) => {
26
+ const { envFile, credentialId } = credentialNames(agent.descriptor);
27
+ return unit.credential === "load" ? `LoadCredential=${credentialId}:${credentialPath(`${unit.configDir}/${envFile}`)}` : `EnvironmentFile=-${escapeUnitPath(`${unit.configDir}/${envFile}`)}`;
28
+ });
24
29
  const helperService = unit.helper === void 0 ? void 0 : `${unit.helper.unit}.service`;
25
30
  return `${UNIT_MARKER}
26
31
  [Unit]
@@ -36,8 +41,8 @@ ${unit.helper === void 0 ? "" : `Environment=OUTERLAYER_HELPER_SOCKET=${unit.hel
36
41
  `}${unit.fdStore === void 0 ? "" : `Environment=${FD_STORE_ENV}=${unit.fdStore}
37
42
  `}${unit.sliceMemoryBytes === void 0 ? "" : `Environment=${BUILD_SLICE_MEMORY_ENV}=${unit.sliceMemoryBytes}
38
43
  `}EnvironmentFile=-${escapeUnitPath(`${unit.configDir}/runner.env`)}
39
- ${unit.credential === "load" ? `LoadCredential=${CLAUDE_CREDENTIAL_ID}:${credentialPath(`${unit.configDir}/${CLAUDE_ENV_FILE}`)}` : `EnvironmentFile=-${escapeUnitPath(`${unit.configDir}/${CLAUDE_ENV_FILE}`)}`}
40
- Restart=on-failure
44
+ ${credentialLines.map((line) => `${line}
45
+ `).join("")}Restart=on-failure
41
46
  RestartForceExitStatus=75
42
47
  RestartSec=30
43
48
  KillSignal=SIGTERM
@@ -188,36 +193,53 @@ function unitNameProblem(name) {
188
193
  }
189
194
  var LOAD_CREDENTIAL_SINCE = 247;
190
195
  var CREDENTIAL_FILE_MODE = 384;
191
- function prepareCredentialFile(configDir, lines) {
192
- const claudePath = join(configDir, CLAUDE_ENV_FILE);
196
+ function credentialFileOf(configDir, agent) {
197
+ const { envFile, label } = credentialForms(agent.descriptor);
198
+ return { path: join(configDir, envFile), label, envFile };
199
+ }
200
+ function credentialFileIn(configDir, agents) {
201
+ const agent = credentialAgent(agents);
202
+ return agent === void 0 ? void 0 : credentialFileOf(configDir, agent);
203
+ }
204
+ function prepareCredentialFile(configDir, lines, agents) {
205
+ return runnerAgents(agents).every((agent) => prepareAgentCredentialFile(configDir, lines, agent));
206
+ }
207
+ function prepareAgentCredentialFile(configDir, lines, agent) {
208
+ const file = credentialFileOf(configDir, agent);
209
+ const agents = [{ descriptor: agent.descriptor, adapter: agent.adapter }];
193
210
  const runnerPath = join(configDir, "runner.env");
194
211
  try {
195
- const stored = existsSync(claudePath) ? readFileSync(claudePath, "utf8") : void 0;
196
- if (stored !== void 0 && credentialLineIn(stored) !== void 0) return true;
197
- const moved = existsSync(runnerPath) ? credentialLineIn(readFileSync(runnerPath, "utf8")) : void 0;
212
+ const stored = existsSync(file.path) ? readFileSync(file.path, "utf8") : void 0;
213
+ if (stored !== void 0 && credentialLineIn(stored, agents) !== void 0) return true;
214
+ const moved = existsSync(runnerPath) ? credentialLineIn(readFileSync(runnerPath, "utf8"), agents) : void 0;
198
215
  if (stored !== void 0 && moved === void 0) return true;
199
216
  const kept = stored === void 0 || stored === "" ? "" : stored.endsWith("\n") ? stored : `${stored}
200
217
  `;
201
- const temporary = `${claudePath}.${process.pid}.tmp`;
218
+ const temporary = `${file.path}.${process.pid}.tmp`;
202
219
  writeFileSync(temporary, moved === void 0 ? kept : `${kept}${moved}
203
220
  `, { mode: CREDENTIAL_FILE_MODE });
204
221
  chmodSync(temporary, CREDENTIAL_FILE_MODE);
205
- renameSync(temporary, claudePath);
222
+ renameSync(temporary, file.path);
206
223
  return true;
207
224
  } catch (err) {
208
- lines.push(`${claudePath} could not be written (${err instanceof Error ? err.message : String(err)}), so nothing was changed`);
225
+ lines.push(`${file.path} could not be written (${err instanceof Error ? err.message : String(err)}), so nothing was changed`);
209
226
  return false;
210
227
  }
211
228
  }
212
- function finishCredentialMove(configDir, lines, reload) {
229
+ function finishCredentialMove(configDir, lines, agents, reload) {
230
+ for (const agent of runnerAgents(agents)) finishAgentCredentialMove(configDir, lines, agent, reload);
231
+ }
232
+ function finishAgentCredentialMove(configDir, lines, agent, reload) {
233
+ const file = credentialFileOf(configDir, agent);
234
+ const agents = [{ descriptor: agent.descriptor, adapter: agent.adapter }];
213
235
  const runnerPath = join(configDir, "runner.env");
214
236
  try {
215
237
  if (!existsSync(runnerPath)) return;
216
- if (credentialLineIn(readFileSync(join(configDir, CLAUDE_ENV_FILE), "utf8")) === void 0) return;
217
- const text = withoutCredentialLines(readFileSync(runnerPath, "utf8"));
238
+ if (credentialLineIn(readFileSync(file.path, "utf8"), agents) === void 0) return;
239
+ const text = withoutCredentialLines(readFileSync(runnerPath, "utf8"), agents);
218
240
  if (text === void 0) return;
219
241
  if (reload !== void 0 && !reload()) {
220
- lines.push(`the Claude credential is in ${join(configDir, CLAUDE_ENV_FILE)} and is also still in ${runnerPath}, because systemd may still hold the old unit: run \`sudo systemctl daemon-reload\`, then this command again`);
242
+ lines.push(`the ${file.label} credential is in ${file.path} and is also still in ${runnerPath}, because systemd may still hold the old unit: run \`sudo systemctl daemon-reload\`, then this command again`);
221
243
  return;
222
244
  }
223
245
  const temporary = `${runnerPath}.${process.pid}.tmp`;
@@ -225,7 +247,7 @@ function finishCredentialMove(configDir, lines, reload) {
225
247
  chmodSync(temporary, CREDENTIAL_FILE_MODE);
226
248
  renameSync(temporary, runnerPath);
227
249
  } catch (err) {
228
- lines.push(`the Claude credential is in ${join(configDir, CLAUDE_ENV_FILE)} and is also still in ${runnerPath}, which could not be changed (${err instanceof Error ? err.message : String(err)}): remove its line by hand`);
250
+ lines.push(`the ${file.label} credential is in ${file.path} and is also still in ${runnerPath}, which could not be changed (${err instanceof Error ? err.message : String(err)}): remove its line by hand`);
229
251
  }
230
252
  }
231
253
  function unitPathFor(unitName = DEFAULT_UNIT_NAME) {
@@ -254,7 +276,7 @@ function needsHostDocker(request) {
254
276
  if (cleanup === "vm" && !keepsHostBuilder({ hooks: request.hooks, build: { imageBuild: request.imageBuild } }, request.builderDiskPinned)) return false;
255
277
  return provision === "container" || provision === "vm" || cleanup === "container" || cleanup === "vm";
256
278
  }
257
- function installService(request, deps) {
279
+ function installService(request, deps, agents = defaultAgents()) {
258
280
  const unitName = request.unitName ?? DEFAULT_UNIT_NAME;
259
281
  const unitPath = unitPathFor(unitName);
260
282
  const lines = [];
@@ -275,7 +297,8 @@ function installService(request, deps) {
275
297
  // A microVM build under the helper keeps its sockets in the descriptor store, so the runner can restart and the build goes on.
276
298
  ...kind === "vm" && request.helperSocket !== void 0 && request.helperUnit !== void 0 ? { fdStore: Math.max(1, request.concurrency) * FD_SLOTS_PER_BUILD } : {},
277
299
  sliceMemoryBytes: request.buildSliceMemoryBytes
278
- });
300
+ }, agents);
301
+ const envFile = credentialFileIn(configDir, agents)?.envFile ?? "the credential file";
279
302
  if (request.print === true) return outcome(true, "printed", [], unit);
280
303
  if (own) return outcome(false, "refused", [OWN_HOOKS]);
281
304
  if (deps.platform === "darwin" || deps.platform === "windows") {
@@ -308,7 +331,7 @@ function installService(request, deps) {
308
331
  const fallbackNote = () => {
309
332
  if (credential === "load") return;
310
333
  lines.push(
311
- `the Claude credential stays in the service's environment: ${version === void 0 ? "the systemd version could not be read" : `systemd ${version} is older than ${LOAD_CREDENTIAL_SINCE}`}, and LoadCredential= needs ${LOAD_CREDENTIAL_SINCE} or later, so the unit loads claude.env with EnvironmentFile=`
334
+ `the ${credentialFileIn(configDir, agents)?.label ?? "agent"} credential stays in the service's environment: ${version === void 0 ? "the systemd version could not be read" : `systemd ${version} is older than ${LOAD_CREDENTIAL_SINCE}`}, and LoadCredential= needs ${LOAD_CREDENTIAL_SINCE} or later, so the unit loads ${envFile} with EnvironmentFile=`
312
335
  );
313
336
  };
314
337
  const write = () => {
@@ -322,20 +345,20 @@ function installService(request, deps) {
322
345
  return ensureWindowsAccessOff(deps, unitName, say, lines);
323
346
  };
324
347
  if (existing === unit) {
325
- if (!prepareCredentialFile(configDir, lines)) return outcome(false, "refused", lines);
348
+ if (!prepareCredentialFile(configDir, lines, agents)) return outcome(false, "refused", lines);
326
349
  const wasRunning = running();
327
350
  if (!wasRunning && !asRoot(deps, lines, say, ["enable", "--now", unitName])) return outcome(false, "refused", lines);
328
- finishCredentialMove(configDir, lines, () => asRoot(deps, lines, say, ["daemon-reload"]));
351
+ finishCredentialMove(configDir, lines, agents, () => asRoot(deps, lines, say, ["daemon-reload"]));
329
352
  if (wasRunning && request.restart === true) {
330
353
  const windowsOk2 = windowsSteps();
331
354
  const finish2 = (state) => windowsOk2 ? outcome(true, state, lines) : outcome(false, "refused", lines);
332
355
  if (deps.buildsRunning(runnerDir(request.configPath))) {
333
- lines.push(`the service ${unitName} is current; a build is running, so it was not restarted and reads claude.env and runner.env at its next restart`);
356
+ lines.push(`the service ${unitName} is current; a build is running, so it was not restarted and reads ${envFile} and runner.env at its next restart`);
334
357
  fallbackNote();
335
358
  return finish2("pending-restart");
336
359
  }
337
360
  if (!asRoot(deps, lines, say, ["restart", unitName])) return outcome(false, "refused", lines);
338
- lines.push(`restarted the service ${unitName}, so it reads claude.env and runner.env`);
361
+ lines.push(`restarted the service ${unitName}, so it reads ${envFile} and runner.env`);
339
362
  fallbackNote();
340
363
  return finish2("updated");
341
364
  }
@@ -345,14 +368,14 @@ function installService(request, deps) {
345
368
  return outcome(true, "current", lines);
346
369
  }
347
370
  if (existing === void 0) {
348
- if (!prepareCredentialFile(configDir, lines)) return outcome(false, "refused", lines);
371
+ if (!prepareCredentialFile(configDir, lines, agents)) return outcome(false, "refused", lines);
349
372
  if (!write()) return outcome(false, "refused", lines);
350
373
  if (!asRoot(deps, lines, say, ["daemon-reload"]) || !asRoot(deps, lines, say, ["enable", "--now", unitName])) {
351
374
  say(`sudo rm ${unitPath}`);
352
375
  if (attempt(lines, () => deps.systemd.remove(unitPath))) deps.systemd.systemctl(["daemon-reload"], { sudo: true });
353
376
  return outcome(false, "refused", lines);
354
377
  }
355
- finishCredentialMove(configDir, lines);
378
+ finishCredentialMove(configDir, lines, agents);
356
379
  lines.push(`installed and started the service ${unitName}: the runner starts at boot and after a crash`);
357
380
  fallbackNote();
358
381
  if (!windowsSteps()) return outcome(false, "refused", lines);
@@ -362,11 +385,11 @@ function installService(request, deps) {
362
385
  lines.push(`${unitPath} differs from what this command writes, and it was not written by it, so it was left alone. Pass --replace to replace it, or \`--print\` to compare`);
363
386
  return outcome(false, "differs", lines);
364
387
  }
365
- if (!prepareCredentialFile(configDir, lines)) return outcome(false, "refused", lines);
388
+ if (!prepareCredentialFile(configDir, lines, agents)) return outcome(false, "refused", lines);
366
389
  if (!write()) return outcome(false, "refused", lines);
367
390
  if (!asRoot(deps, lines, say, ["daemon-reload"])) return outcome(false, "refused", lines);
368
391
  if ((!existing.startsWith(UNIT_MARKER) || !running()) && !asRoot(deps, lines, say, ["enable", "--now", unitName])) return outcome(false, "refused", lines);
369
- finishCredentialMove(configDir, lines);
392
+ finishCredentialMove(configDir, lines, agents);
370
393
  fallbackNote();
371
394
  const windowsOk = windowsSteps();
372
395
  const finish = (state) => windowsOk ? outcome(true, state, lines) : outcome(false, "refused", lines);
@@ -2,7 +2,7 @@
2
2
  import { createRequire } from 'node:module';
3
3
  import { readContextManifest, removeContextManifest } from './chunk-YQR6E6OV.js';
4
4
  import { removePreCommitGuardHook } from './chunk-CJPTUU2E.js';
5
- import { CONTEXT_PIN_FILENAME } from './chunk-JFMSFHER.js';
5
+ import { CONTEXT_PIN_FILENAME, agentRootFolders } from './chunk-CKPQOQFC.js';
6
6
  import { execFileSync } from 'child_process';
7
7
  import { lstatSync, existsSync, unlinkSync, readdirSync, rmdirSync, readFileSync, mkdirSync, writeFileSync } from 'fs';
8
8
  import { join, dirname, isAbsolute } from 'path';
@@ -64,9 +64,12 @@ function contextExcludesPresent(gitCommonDir) {
64
64
  function hasEarlierCopies(gitCommonDir) {
65
65
  return readContextManifest(gitCommonDir) !== void 0 || contextExcludesPresent(gitCommonDir);
66
66
  }
67
+ function copiedRoots() {
68
+ return ["AGENTS.md", ...agentRootFolders(), ".outerlayer"];
69
+ }
67
70
  function isCopiedPath(rel) {
68
71
  if (isAbsolute(rel) || rel.split("/").includes("..")) return false;
69
- return rel === "AGENTS.md" || rel.startsWith(".claude/") || rel.startsWith(".outerlayer/");
72
+ return copiedRoots().some((root) => root === "AGENTS.md" ? rel === root : rel.startsWith(`${root}/`));
70
73
  }
71
74
  function hasSymlinkComponent(root, rel) {
72
75
  let current = root;
@@ -85,7 +88,7 @@ function linkedAgentsPath(root) {
85
88
  }
86
89
  function trackedPaths(repoRoot) {
87
90
  try {
88
- const out = execFileSync("git", ["ls-files", "-z", "--", "AGENTS.md", ".claude", ".outerlayer"], {
91
+ const out = execFileSync("git", ["ls-files", "-z", "--", ...copiedRoots()], {
89
92
  cwd: repoRoot,
90
93
  encoding: "utf8",
91
94
  stdio: ["ignore", "pipe", "ignore"],
@@ -1,9 +1,8 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
- import { AGENTS_SKILLS_BASE, OUTERLAYER_SKILLS_BASE } from './chunk-7O7LJWQO.js';
4
- import { normalizePath, CONTEXT_PIN_FILENAME } from './chunk-JFMSFHER.js';
3
+ import { normalizePath, CONTEXT_PIN_FILENAME, contextAgents, defaultAgents, AGENTS_SKILLS_BASE, OUTERLAYER_SKILLS_BASE, LEGACY_AGENT, legacyAgent, legacySubcommand } from './chunk-CKPQOQFC.js';
5
4
  import { existsSync, readdirSync, readFileSync, mkdirSync, writeFileSync, lstatSync, readlinkSync, symlinkSync, rmdirSync } from 'fs';
6
- import { relative, sep, join } from 'path';
5
+ import { relative, sep, join, posix } from 'path';
7
6
 
8
7
  createRequire(import.meta.url);
9
8
  var SKIP_DIRS = /* @__PURE__ */ new Set(["node_modules", ".git"]);
@@ -41,8 +40,15 @@ function walk(dir, repoRoot, insideOuterlayer, out) {
41
40
  // src/layout.ts
42
41
  var AGENTS_MD_LAYOUT = 2;
43
42
  var FIRST_VERSION_READING_AGENTS_SKILLS = "0.21.0";
44
- var SKILLS_LINK_PATH = ".claude/skills";
45
- var SKILLS_LINK_TARGET = "../.agents/skills";
43
+ function linkTargetFor(folder) {
44
+ return posix.relative(posix.dirname(folder), AGENTS_SKILLS_BASE);
45
+ }
46
+ function mcpFiles(agents = defaultAgents()) {
47
+ return [...new Set(contextAgents(agents).map((agent) => agent.context.mcp.file))];
48
+ }
49
+ function skillLinkFolders(agents = defaultAgents()) {
50
+ return contextAgents(agents).flatMap((agent) => agent.descriptor.context.repoSkillFolders);
51
+ }
46
52
  var CONFIG_PATH = ".outerlayer/config.json";
47
53
  function readConfigObject(repoRoot) {
48
54
  try {
@@ -97,8 +103,9 @@ function filesBelow(repoRoot, rel) {
97
103
  }
98
104
  return out.sort();
99
105
  }
100
- function linkClaudeSkills(repoRoot) {
101
- const abs = join(repoRoot, SKILLS_LINK_PATH);
106
+ function linkFolder(repoRoot, folder) {
107
+ const abs = join(repoRoot, folder);
108
+ const target = linkTargetFor(folder);
102
109
  let stat;
103
110
  try {
104
111
  stat = lstatSync(abs);
@@ -107,45 +114,63 @@ function linkClaudeSkills(repoRoot) {
107
114
  }
108
115
  if (stat?.isSymbolicLink()) {
109
116
  try {
110
- return readlinkSync(abs) === SKILLS_LINK_TARGET ? { status: "present" } : { status: "elsewhere" };
117
+ return readlinkSync(abs) === target ? { status: "present" } : { status: "elsewhere" };
111
118
  } catch {
112
119
  return { status: "elsewhere" };
113
120
  }
114
121
  }
115
122
  if (stat !== void 0) {
116
- if (!stat.isDirectory()) return { status: "blocked", blocking: [SKILLS_LINK_PATH] };
117
- const files = filesBelow(repoRoot, SKILLS_LINK_PATH);
123
+ if (!stat.isDirectory()) return { status: "blocked", blocking: [folder] };
124
+ const files = filesBelow(repoRoot, folder);
118
125
  if (files.length > 0) return { status: "blocked", blocking: files };
119
126
  removeEmptyTree(abs);
120
127
  }
121
128
  try {
122
- mkdirSync(join(repoRoot, ".claude"), { recursive: true });
123
- symlinkSync(SKILLS_LINK_TARGET, abs, "dir");
129
+ mkdirSync(join(repoRoot, posix.dirname(folder)), { recursive: true });
130
+ symlinkSync(target, abs, "dir");
124
131
  return { status: "linked" };
125
132
  } catch (err) {
126
133
  return { status: "failed", reason: err instanceof Error ? err.message : String(err) };
127
134
  }
128
135
  }
136
+ var URGENCY = { failed: 4, blocked: 3, elsewhere: 2, linked: 1, present: 0 };
137
+ function linkAgentSkills(repoRoot, agents = defaultAgents()) {
138
+ const outcomes = contextAgents(agents).flatMap(
139
+ (agent) => agent.descriptor.context.repoSkillFolders.map((folder) => {
140
+ const outcome = linkFolder(repoRoot, folder);
141
+ return agent.descriptor.id === LEGACY_AGENT ? outcome : { ...outcome, folder, agent: agent.descriptor.label };
142
+ })
143
+ );
144
+ const first = outcomes.reduce((pick, outcome) => pick === void 0 || URGENCY[outcome.status] > URGENCY[pick.status] ? outcome : pick, void 0);
145
+ if (first === void 0) return { status: "present" };
146
+ const linkedFolders = contextAgents(agents).flatMap((agent) => agent.descriptor.context.repoSkillFolders.map((folder) => ({ folder, id: agent.descriptor.id })));
147
+ if (first.status !== "linked" || linkedFolders.every((entry) => entry.id === LEGACY_AGENT)) return first;
148
+ return { ...first, folders: outcomes.flatMap((outcome, index) => outcome.status === "linked" ? [linkedFolders[index].folder] : []) };
149
+ }
129
150
  function removeEmptyTree(abs) {
130
151
  for (const entry of readdirSync(abs, { withFileTypes: true })) {
131
152
  if (entry.isDirectory()) removeEmptyTree(join(abs, entry.name));
132
153
  }
133
154
  rmdirSync(abs);
134
155
  }
135
- var WINDOWS_LINK_NOTE = "On Windows, git commits a link only when core.symlinks is true. Without it, git writes a text file and Claude Code finds no skills.";
136
- function describeSkillsLink(outcome) {
156
+ var windowsLinkNote = (agent) => `On Windows, git commits a link only when core.symlinks is true. Without it, git writes a text file and ${agent} finds no skills.`;
157
+ function describeSkillsLink(outcome, agents = defaultAgents()) {
158
+ const fallback = legacyAgent(agents);
159
+ const folder = outcome.folder ?? fallback.descriptor.context.repoSkillFolders[0];
160
+ const agent = outcome.agent ?? fallback.descriptor.label;
161
+ const target = linkTargetFor(folder);
137
162
  switch (outcome.status) {
138
163
  case "linked":
139
- return `Linked ${SKILLS_LINK_PATH} to ${SKILLS_LINK_TARGET}, so Claude Code finds the skills. ${WINDOWS_LINK_NOTE}`;
164
+ return `Linked ${folder} to ${target}, so ${agent} finds the skills. ${windowsLinkNote(agent)}`;
140
165
  case "present":
141
166
  return "";
142
167
  case "blocked":
143
- return `Left ${SKILLS_LINK_PATH}/ as it is and made no link, because it still holds ${outcome.blocking.join(", ")}.`;
168
+ return `Left ${folder}/ as it is and made no link, because it still holds ${outcome.blocking.join(", ")}.`;
144
169
  case "elsewhere":
145
- return `Left ${SKILLS_LINK_PATH} as it is: it is a link to somewhere other than ${SKILLS_LINK_TARGET}.`;
170
+ return `Left ${folder} as it is: it is a link to somewhere other than ${target}.`;
146
171
  case "failed":
147
- return `Could not link ${SKILLS_LINK_PATH} to ${SKILLS_LINK_TARGET}: ${outcome.reason}. On Windows, git needs core.symlinks and a permission to create links. The launcher, \`outerlayer claude\`, does not need the link.`;
172
+ return `Could not link ${folder} to ${target}: ${outcome.reason}. On Windows, git needs core.symlinks and a permission to create links. The launcher, \`outerlayer ${legacySubcommand(agents)}\`, does not need the link.`;
148
173
  }
149
174
  }
150
175
 
151
- export { AGENTS_MD_LAYOUT, FIRST_VERSION_READING_AGENTS_SKILLS, SKILLS_LINK_PATH, declareAgentsMdLayout, describeSkillsLink, discoverOuterlayerPaths, filesBelow, holdsTodaysLayoutSources, isAgentsMdLayout, isForeignTree, linkClaudeSkills, readConfigObject, skillsBaseFor, toRepoRelative };
176
+ export { AGENTS_MD_LAYOUT, FIRST_VERSION_READING_AGENTS_SKILLS, declareAgentsMdLayout, describeSkillsLink, discoverOuterlayerPaths, filesBelow, holdsTodaysLayoutSources, isAgentsMdLayout, isForeignTree, linkAgentSkills, mcpFiles, readConfigObject, skillLinkFolders, skillsBaseFor, toRepoRelative };
@@ -1,6 +1,8 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
- import { RELAY_PORT, GATEWAY_SOCKET, GATEWAY_PORT, CLAUDE_SOCKET, CLAUDE_PORT, DESTINATION_BASE_PORT } from './chunk-GANAOCHR.js';
3
+ import { RELAY_PORT, DESTINATION_BASE_PORT } from './chunk-M2NIHHQI.js';
4
+ import { GATEWAY_SOCKET, GATEWAY_PORT, providerDestinations } from './chunk-J7Y3PCO2.js';
5
+ import { PROVIDERS, defaultAgents } from './chunk-CKPQOQFC.js';
4
6
  import { symlinkSync, unlinkSync } from 'fs';
5
7
  import { join } from 'path';
6
8
 
@@ -10,13 +12,13 @@ var LEASE_PORT = 3125;
10
12
  var GUEST_CID = 3;
11
13
  var MAX_SOCKET_PATH = 107;
12
14
  var LEASE_LINK = { port: LEASE_PORT, socket: "lease.sock" };
13
- function vsockLinks(input) {
15
+ function vsockLinks(input, agents = defaultAgents(), providers = PROVIDERS) {
14
16
  return [
15
17
  { port: RELAY_PORT, socket: "tunnel.sock" },
16
18
  ...Array.from({ length: input.destinations }, (_unused, index) => ({ port: DESTINATION_BASE_PORT + index, socket: `dest-${index}.sock` })),
17
19
  ...input.builtIns ? [
18
20
  { port: GATEWAY_PORT, socket: GATEWAY_SOCKET },
19
- { port: CLAUDE_PORT, socket: CLAUDE_SOCKET }
21
+ ...providerDestinations(agents, providers).map((destination) => ({ port: destination.port, socket: destination.socket }))
20
22
  ] : []
21
23
  ];
22
24
  }
@@ -1,16 +1,16 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
3
  import { readNewestDemo } from './chunk-ER6KQCVJ.js';
4
- import { runEmitArtifact } from './chunk-CIEX2ZKQ.js';
4
+ import { runEmitArtifact } from './chunk-RSRZDF3K.js';
5
5
  import { VoiceDownloadError, downloadPinned, sha256OfFile } from './chunk-2PGI6RDE.js';
6
- import { VOICE_PACK_FILES, VOICE_PACK_VERSION } from './chunk-OUPQTA7N.js';
7
6
  import { detectActiveSession } from './chunk-IP7BIBXJ.js';
8
- import { autoConnect } from './chunk-4W7CPTKY.js';
7
+ import { autoConnect } from './chunk-5FND4PIU.js';
9
8
  import { C } from './chunk-2AM6Z5BP.js';
10
- import { defaultFetch, resolveGatewayCredentials } from './chunk-YQHEJ5SV.js';
11
- import { resolveRepoIdentity } from './chunk-SQ6HDN7A.js';
9
+ import { defaultFetch, resolveGatewayCredentials } from './chunk-JVCQZDQ6.js';
10
+ import { resolveRepoIdentity } from './chunk-5GHJFETA.js';
12
11
  import { launchedItemForSession } from './chunk-5WYT3PPE.js';
13
- import { ARTIFACT_MAX_BYTES, ARTIFACT_MAX_CAPTION_LENGTH, DEMO_RECORD_MEDIA_TYPE, ARTIFACT_MAX_REPLACES_TARGETS, DEMO_MANIFEST_LATEST_VERSION, DemoManifestSchema, ARTIFACT_KINDS } from './chunk-VUG4IZ7H.js';
12
+ import { VOICE_PACK_FILES, VOICE_PACK_VERSION } from './chunk-J7Y3PCO2.js';
13
+ import { ARTIFACT_MAX_BYTES, ARTIFACT_MAX_CAPTION_LENGTH, DEMO_RECORD_MEDIA_TYPE, ARTIFACT_MAX_REPLACES_TARGETS, DEMO_MANIFEST_LATEST_VERSION, DemoManifestSchema, ARTIFACT_KINDS } from './chunk-WUKLQWGY.js';
14
14
  import { homeFromEnv } from './chunk-352DHUTP.js';
15
15
  import { __commonJS, __require, __toESM } from './chunk-Z5GEFMRW.js';
16
16
  import { createHash } from 'crypto';
@@ -1,25 +1,23 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
- import { sanitizeTerminal } from './chunk-3PQTOKML.js';
4
- import { isAgentsMdLayout } from './chunk-LRCGXRQI.js';
5
- import { resolveGatewayCredentials, defaultFetch } from './chunk-YQHEJ5SV.js';
6
- import { versionAtLeast } from './chunk-HCVLP7XA.js';
3
+ import { sanitizeTerminal } from './chunk-P6PHY33P.js';
4
+ import { isAgentsMdLayout } from './chunk-WDQPBAFV.js';
5
+ import { resolveGatewayCredentials, defaultFetch } from './chunk-JVCQZDQ6.js';
6
+ import { versionAtLeast } from './chunk-NC3QAHOS.js';
7
7
  import { findGitDirs } from './chunk-BJ3KTMDH.js';
8
- import { machineSkillsState, staleClaudeSkills } from './chunk-OLENS2DD.js';
9
- import { AGENTS_SKILLS_BASE, skillDir, namesCore, MACHINE_SKILL_PATH, isMaintainedCopy, loadTemplateFiles } from './chunk-7O7LJWQO.js';
10
- import { MAINTAINED_SKILLS } from './chunk-CDDED64E.js';
8
+ import { machineSkillsState, staleAgentSkills } from './chunk-I626B72C.js';
11
9
  import { cliInvocation } from './chunk-FZKNTIOJ.js';
12
- import { hasSymlinkComponent } from './chunk-4SFHEARD.js';
13
- import { emitTree, ALL_TARGET_IDS, classifyTree, splitRawFile } from './chunk-JFMSFHER.js';
10
+ import { hasSymlinkComponent } from './chunk-VRQM4A64.js';
11
+ import { skillDir, emitTree, targetIds, classifyTree, emitBuilders, AGENTS_SKILLS_BASE, defaultAgents, namesCore, MACHINE_SKILL_PATH, skillBases, isMaintainedCopy, contextAgents, loadTemplateFiles, splitRawFile } from './chunk-CKPQOQFC.js';
12
+ import { MAINTAINED_SKILLS } from './chunk-CDDED64E.js';
14
13
  import { execFileSync } from 'child_process';
15
14
  import { existsSync, readFileSync, writeFileSync, realpathSync, readdirSync } from 'fs';
16
15
  import { join, dirname, posix, basename, isAbsolute, relative } from 'path';
17
16
 
18
17
  createRequire(import.meta.url);
19
18
  var PROSE_FILE = /\.mdc?$/;
20
- var ROOT_FILES = ["AGENTS.md", "CLAUDE.md"];
21
- var FOLDERS = [AGENTS_SKILLS_BASE, ".claude/skills"];
22
- var SKILL_BASES = [AGENTS_SKILLS_BASE, ".claude/skills"];
19
+ var rootFiles = () => ["AGENTS.md", ...contextAgents().flatMap((agent) => agent.descriptor.context.instructionFiles)];
20
+ var skillFolders = () => skillBases();
23
21
  var RELATIVE_NOTE = ", relative to this skill's folder";
24
22
  var escape = (s) => s.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
25
23
  function withMachinePaths(text, fileDir, skills) {
@@ -27,7 +25,7 @@ function withMachinePaths(text, fileDir, skills) {
27
25
  const named2 = [];
28
26
  for (const skill of skills) {
29
27
  const spellings = /* @__PURE__ */ new Set();
30
- for (const base of SKILL_BASES) {
28
+ for (const base of skillFolders()) {
31
29
  const folder = skillDir(skill, base);
32
30
  spellings.add(folder);
33
31
  spellings.add(`./${folder}`);
@@ -53,9 +51,9 @@ function filesUnder(root, rel) {
53
51
  function maintainedReferenceRewrites(root, removing) {
54
52
  const removed = (folder) => removing.includes(folder);
55
53
  const holds = (folder) => !removed(folder) && !hasSymlinkComponent(root, folder) && existsSync(join(root, folder));
56
- const absent = MAINTAINED_SKILLS.filter((skill) => !SKILL_BASES.some((base) => holds(skillDir(skill, base))));
57
- const folders = FOLDERS.filter((folder) => !hasSymlinkComponent(root, folder) && existsSync(join(root, folder)));
58
- const candidates = /* @__PURE__ */ new Set([...ROOT_FILES, ...folders.flatMap((folder) => filesUnder(root, folder))]);
54
+ const absent = MAINTAINED_SKILLS.filter((skill) => !skillFolders().some((base) => holds(skillDir(skill, base))));
55
+ const folders = skillFolders().filter((folder) => !hasSymlinkComponent(root, folder) && existsSync(join(root, folder)));
56
+ const candidates = /* @__PURE__ */ new Set([...rootFiles(), ...folders.flatMap((folder) => filesUnder(root, folder))]);
59
57
  const rewrites = [];
60
58
  for (const path of [...candidates].sort()) {
61
59
  if (removing.some((folder) => path.startsWith(`${folder}/`)) || hasSymlinkComponent(root, path)) continue;
@@ -91,14 +89,14 @@ function changeHeadings(text) {
91
89
  }
92
90
  return headings;
93
91
  }
94
- function skillsFolders() {
92
+ function skillsFolders(agents = defaultAgents()) {
95
93
  const probe = `${skillDir("probe")}/SKILL.md`;
96
94
  const compiled = emitTree({
97
95
  entries: classifyTree([probe]).entries,
98
96
  contents: /* @__PURE__ */ new Map([[probe, "---\nname: probe\ndescription: probe\n---\n"]]),
99
97
  assetPaths: [],
100
- targets: [...ALL_TARGET_IDS]
101
- });
98
+ targets: targetIds(agents)
99
+ }, emitBuilders(agents));
102
100
  return [.../* @__PURE__ */ new Set([AGENTS_SKILLS_BASE, ...compiled.files.map((file) => dirname(dirname(file.path)))])];
103
101
  }
104
102
  function shortBuild() {
@@ -166,9 +164,9 @@ ${shortBuild()}`
166
164
  }
167
165
  return checks;
168
166
  }
169
- function committedMaintainedFolders(repoRoot) {
167
+ function committedMaintainedFolders(repoRoot, agents = defaultAgents()) {
170
168
  const found = [];
171
- for (const base of [AGENTS_SKILLS_BASE, ".claude/skills"]) {
169
+ for (const base of skillBases(agents)) {
172
170
  for (const name of MAINTAINED_SKILLS) {
173
171
  const folder = skillDir(name, base);
174
172
  if (!hasSymlinkComponent(repoRoot, folder) && isMaintainedCopy(repoRoot, name, base)) found.push(folder);
@@ -203,14 +201,14 @@ function checkMaintainedReferences(repoRoot) {
203
201
  ];
204
202
  }
205
203
  function checkMachineSkills(opts) {
206
- const build = buildsOf(opts.repoRoot, [".outerlayer/skills", ...skillsFolders()]).find((b) => b.text.includes(MACHINE_CORE));
204
+ const build = buildsOf(opts.repoRoot, [".outerlayer/skills", ...skillsFolders(opts.agents)]).find((b) => b.text.includes(MACHINE_CORE));
207
205
  if (build === void 0) return [];
208
206
  const problems = machineSkillsState(opts.home, opts.version).filter((s) => s.state !== "current");
209
- const claudeStale = staleClaudeSkills(opts.home, opts.version);
210
- if (problems.length === 0 && claudeStale.length === 0) return [];
207
+ const agentStale = staleAgentSkills(opts.home, opts.version, opts.agents);
208
+ if (problems.length === 0 && agentStale.length === 0) return [];
211
209
  const parts = [
212
210
  ...problems.map((s) => `${MACHINE_SKILL_PATH}/${s.name} ${s.state === "missing" ? "is missing" : "is from another CLI version"}`),
213
- ...claudeStale.map((name) => `~/.claude/skills/${name} is not this CLI version's copy`)
211
+ ...agentStale.map(({ folder, name }) => `${folder}/${name} is not this CLI version's copy`)
214
212
  ];
215
213
  return [
216
214
  {
@@ -221,7 +219,6 @@ function checkMachineSkills(opts) {
221
219
  }
222
220
  ];
223
221
  }
224
- var SKILL_BASES2 = [".agents/skills", ".claude/skills"];
225
222
  function ignoreRuleFor(repoRoot, path) {
226
223
  let out;
227
224
  try {
@@ -233,11 +230,11 @@ function ignoreRuleFor(repoRoot, path) {
233
230
  if (match === null || match[3].startsWith("!")) return void 0;
234
231
  return { source: match[1], line: match[2], pattern: match[3] };
235
232
  }
236
- function ignoredSkillFolders(repoRoot) {
233
+ function ignoredSkillFolders(repoRoot, agents) {
237
234
  const found = [];
238
235
  let any = false;
239
236
  const ruleFor = (path) => ignoreRuleFor(repoRoot, path);
240
- for (const base of SKILL_BASES2) {
237
+ for (const base of skillBases(agents)) {
241
238
  let names;
242
239
  try {
243
240
  names = readdirSync(join(repoRoot, base), { withFileTypes: true }).filter((entry) => entry.isDirectory() || entry.isSymbolicLink()).map((entry) => entry.name).sort();
@@ -266,10 +263,10 @@ function ignoredSkillFix({ folder, ignored, source, line }) {
266
263
  const anchored = path.slice(0, -1).includes("/") ? path : `/${path}`;
267
264
  return `Add the line \`!${anchored}\` to ${source} below line ${line}, then commit the folder.`;
268
265
  }
269
- function checkIgnoredSkillFolders(repoRoot) {
270
- const { found, any } = ignoredSkillFolders(repoRoot);
266
+ function checkIgnoredSkillFolders(repoRoot, agents = defaultAgents()) {
267
+ const { found, any } = ignoredSkillFolders(repoRoot, agents);
271
268
  if (found.length === 0) {
272
- return !any ? [] : [{ name: "Skills", status: "pass", detail: `no folder under ${SKILL_BASES2.join(" or ")} is ignored by git` }];
269
+ return !any ? [] : [{ name: "Skills", status: "pass", detail: `no folder under ${skillBases(agents).join(" or ")} is ignored by git` }];
273
270
  }
274
271
  return found.map((ignored) => ({
275
272
  name: "Skills",
@@ -22626,7 +22626,7 @@ var SAME_PROBLEM_RULES = [
22626
22626
  "2. A gap in the instructions is its own problem, separate from the thing it fails to mention. They are fixed in different places.",
22627
22627
  "3. A finding can report more than one problem. Link each one, or record one finding per problem."
22628
22628
  ].join("\n");
22629
- var WORK_ITEM_COMMENT_ACTIONS = ["pass", "fail", "attach", "ready", "request"];
22629
+ var WORK_ITEM_COMMENT_ACTIONS = ["pass", "fail", "attach", "ready", "request", "follow_up"];
22630
22630
  var WORK_ITEM_COMMENT_MAX_BODY_LENGTH = 2e3;
22631
22631
  var REVIEW_SEND_ID_PATTERN = /^[A-Za-z0-9_.-]{1,100}$/;
22632
22632
  external_exports.object({
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
- import { escapeUnitPath, UNIT_MARKER, DEFAULT_UNIT_NAME } from './chunk-6GA5BJTH.js';
4
- import { inspectService, realInspectProbes } from './chunk-GANAOCHR.js';
3
+ import { escapeUnitPath, UNIT_MARKER, DEFAULT_UNIT_NAME } from './chunk-TYCZVJTB.js';
4
+ import { inspectService, realInspectProbes } from './chunk-J7Y3PCO2.js';
5
5
  import { realpathSync, readFileSync, readdirSync } from 'fs';
6
6
  import { resolve, dirname, join } from 'path';
7
7
 
@@ -43,9 +43,9 @@ function resolvedOr(path) {
43
43
  return path;
44
44
  }
45
45
  }
46
- function inspectRunnerService(configPath, probes = realInspectProbes(), units = realUnitFiles()) {
46
+ function inspectRunnerService(configPath, probes = realInspectProbes(), units = realUnitFiles(), agents) {
47
47
  const configDir = dirname(configPath);
48
- return inspectService(findServiceUnit(configDir, units), configDir, probes);
48
+ return inspectService(findServiceUnit(configDir, units), configDir, probes, ...agents === void 0 ? [] : [agents]);
49
49
  }
50
50
 
51
51
  export { findServiceUnit, inspectRunnerService };