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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (206) hide show
  1. package/dist/agent-setup-Q3HDN23U.js +39 -0
  2. package/dist/agent-subcommand-Z6SOLWZW.js +25 -0
  3. package/dist/bridge-4KPODDN7.js +15 -0
  4. package/dist/build-KYXFZQ33.js +23 -0
  5. package/dist/build-disk-W6AL5WHI.js +20 -0
  6. package/dist/build-info.json +1 -1
  7. package/dist/builder-IMNOEYV7.js +19 -0
  8. package/dist/caller-NLRE272L.js +22 -0
  9. package/dist/{check-K4RVAP4L.js → check-WWX32IGY.js} +78 -74
  10. package/dist/{chunk-MKSZHT6S.js → chunk-2YC3TXWX.js} +1 -1
  11. package/dist/{chunk-QIOTIQWD.js → chunk-3UFX6KH2.js} +12 -11
  12. package/dist/{chunk-F2LPX2HS.js → chunk-3YEPLVNW.js} +8 -8
  13. package/dist/chunk-4DLJ343I.js +38 -0
  14. package/dist/{chunk-5WYT3PPE.js → chunk-4OD45RBP.js} +4 -1
  15. package/dist/{chunk-H7SKHAUE.js → chunk-4XXBV37R.js} +6 -6
  16. package/dist/{chunk-XNBUZGRO.js → chunk-6B3V6EGQ.js} +11 -9
  17. package/dist/{chunk-O36YAH2G.js → chunk-6HDXRDC5.js} +4 -4
  18. package/dist/chunk-6JLYU322.js +68 -0
  19. package/dist/{chunk-5GHJFETA.js → chunk-6KH3NMIT.js} +3010 -1196
  20. package/dist/{chunk-SPXVFFQV.js → chunk-AQE6E54X.js} +10 -9
  21. package/dist/{chunk-LGV5N5DG.js → chunk-ATKCHMFD.js} +1 -1
  22. package/dist/{chunk-7J7HRYZ3.js → chunk-B2P72DAE.js} +1 -1
  23. package/dist/{chunk-LEHBDEUG.js → chunk-B36NSEUM.js} +4 -5
  24. package/dist/{chunk-B62TYDP2.js → chunk-B5SWBFVE.js} +5 -4
  25. package/dist/chunk-BSPJI5T7.js +28 -0
  26. package/dist/{chunk-VJYSPH2J.js → chunk-BUYXEU7J.js} +26 -21
  27. package/dist/{chunk-CIUD3436.js → chunk-BZSJ77MO.js} +1 -1
  28. package/dist/{chunk-OEBFKPHK.js → chunk-CDG475ZP.js} +11 -11
  29. package/dist/{chunk-AGKQEOFS.js → chunk-CSBW4LGL.js} +54 -31
  30. package/dist/{chunk-D2OTBS47.js → chunk-CSVJGW3I.js} +2 -2
  31. package/dist/{chunk-GANAOCHR.js → chunk-CXJC3JLN.js} +25 -374
  32. package/dist/{chunk-WAZJPDR2.js → chunk-D4VGJQY7.js} +1 -1
  33. package/dist/{chunk-BRUDBWLO.js → chunk-D5I5SSPU.js} +7 -7
  34. package/dist/{chunk-KFUDKFEH.js → chunk-D6EXW4EB.js} +45 -19
  35. package/dist/{chunk-AF6DQJ5W.js → chunk-DG3M5DZU.js} +1 -1
  36. package/dist/{chunk-WT7J2627.js → chunk-DTCTXDJP.js} +1 -1
  37. package/dist/chunk-DTQPDMHG.js +654 -0
  38. package/dist/{chunk-EZRAR5YG.js → chunk-E3TP4QTM.js} +1 -1
  39. package/dist/{chunk-NFZJ5XHP.js → chunk-ENBOAE2W.js} +33 -32
  40. package/dist/{chunk-R3252UTU.js → chunk-ENMX3VQ7.js} +7 -7
  41. package/dist/{chunk-AH6634HC.js → chunk-FOSYM7TQ.js} +1 -2
  42. package/dist/{chunk-HL7UNTXO.js → chunk-FRMAQ3C4.js} +17 -10
  43. package/dist/{chunk-HAWPG7QW.js → chunk-FTP7SE6Y.js} +3 -3
  44. package/dist/{chunk-IP7BIBXJ.js → chunk-FWSVWPMS.js} +16 -7
  45. package/dist/{chunk-GLUQVET2.js → chunk-GFZ7PELR.js} +6 -6
  46. package/dist/{chunk-UZGQT6OF.js → chunk-H2NJG3TE.js} +6 -3
  47. package/dist/{chunk-46OBCATR.js → chunk-HRHWA6TZ.js} +1 -1
  48. package/dist/chunk-HTRDL42C.js +45 -0
  49. package/dist/{chunk-YBAVN6WS.js → chunk-I4DM7SNX.js} +7 -7
  50. package/dist/{chunk-24FEVLX7.js → chunk-I6U6QPN6.js} +1311 -73
  51. package/dist/{chunk-4DJZSNVT.js → chunk-IKFAJTLZ.js} +1 -1
  52. package/dist/{chunk-55PYF6S2.js → chunk-J2OMKFYB.js} +3 -3
  53. package/dist/{chunk-7Y5VW4JG.js → chunk-K2G3VB7W.js} +1 -1
  54. package/dist/chunk-K7N6LAPC.js +78 -0
  55. package/dist/{chunk-ULBVE7MP.js → chunk-KRCU66AM.js} +9 -9
  56. package/dist/{chunk-JU3VU42K.js → chunk-LHHDX7FB.js} +5 -5
  57. package/dist/{chunk-FUJUFLDC.js → chunk-LO4CK734.js} +8 -14
  58. package/dist/chunk-LSLK4RS4.js +82 -0
  59. package/dist/{chunk-ABAVN4RT.js → chunk-LSZUTI6O.js} +29 -26
  60. package/dist/chunk-MVPOYQQY.js +136 -0
  61. package/dist/{chunk-YQHEJ5SV.js → chunk-NXQK2I3G.js} +3 -3
  62. package/dist/{chunk-DJMR4YPG.js → chunk-O3MJAHLI.js} +82 -96
  63. package/dist/{chunk-B7PYT2BY.js → chunk-PBGNX3PS.js} +6 -3
  64. package/dist/{chunk-CJJDJ7AT.js → chunk-PIZA7OG2.js} +5 -3
  65. package/dist/{chunk-RIHB3HA2.js → chunk-PMA67TIN.js} +3 -3
  66. package/dist/{chunk-DJDTL6AY.js → chunk-QKOJ22OV.js} +148 -293
  67. package/dist/{chunk-RDWKRG4K.js → chunk-RF4JHGGB.js} +7 -7
  68. package/dist/{chunk-MOOZJRKM.js → chunk-SJJXDU2J.js} +27 -30
  69. package/dist/chunk-T5QBWM6M.js +113 -0
  70. package/dist/{chunk-W7I65BKE.js → chunk-TJIFYV2Z.js} +12 -12
  71. package/dist/{chunk-EBOQU6QC.js → chunk-TKY3SDXH.js} +6 -6
  72. package/dist/{chunk-ALEUIS35.js → chunk-ULBYRPAP.js} +1 -1
  73. package/dist/{chunk-ZP7F3OHV.js → chunk-URHS76GV.js} +48 -38
  74. package/dist/{chunk-X2XTCGUS.js → chunk-VAYVTUU4.js} +11 -12
  75. package/dist/{chunk-TSYHUUAT.js → chunk-VUH7KKVD.js} +3 -3
  76. package/dist/{chunk-RIIPBJK6.js → chunk-WACPWYMH.js} +4 -4
  77. package/dist/{chunk-AAGU5FJF.js → chunk-WGC7UFRM.js} +1 -1
  78. package/dist/{chunk-2SRQSGPR.js → chunk-WVAXJOWG.js} +30 -24
  79. package/dist/{chunk-KLXECBIE.js → chunk-XEWG4AB2.js} +151 -108
  80. package/dist/{chunk-KDK6AF7B.js → chunk-XIDDJSQU.js} +7 -6
  81. package/dist/{chunk-MXIFRYLA.js → chunk-Y4E7IS7H.js} +2 -2
  82. package/dist/{chunk-DHFNBNC3.js → chunk-YJQ7YA7J.js} +5 -5
  83. package/dist/{chunk-6A2GEFN3.js → chunk-YMVRCSKD.js} +4 -4
  84. package/dist/{chunk-JW5BENE6.js → chunk-YYQ5NOT5.js} +3 -3
  85. package/dist/chunk-ZHQC43NH.js +130 -0
  86. package/dist/{chunk-KB5B6ZT5.js → chunk-ZSRMJOAK.js} +20 -20
  87. package/dist/{claude-launcher-L77BKZOC.js → claude-launcher-LGKJZH33.js} +99 -120
  88. package/dist/{cli-QQY5UECM.js → cli-Q5L64EEG.js} +327 -298
  89. package/dist/{cli-update-notice-T3CXRWNB.js → cli-update-notice-AWYJ4A7R.js} +2 -2
  90. package/dist/{command-QLHQZ32L.js → command-CGEFJZNC.js} +65 -64
  91. package/dist/{config-5GY7FL35.js → config-T22KVOOT.js} +14 -10
  92. package/dist/connect-cmd-RUBP466E.js +28 -0
  93. package/dist/{container-start-OCJODSMB.js → container-start-JRF3SBUA.js} +65 -62
  94. package/dist/{context-cleanup-A7KBEBIO.js → context-cleanup-3K2AOECJ.js} +6 -2
  95. package/dist/{context-show-cmd-MZ74ZIVO.js → context-show-cmd-4UXO5WQJ.js} +18 -16
  96. package/dist/{control-plane-launch-3TZFOSCX.js → control-plane-launch-AAH4YH56.js} +31 -27
  97. package/dist/{demo-record-cmd-Y57UWBCX.js → demo-record-cmd-2OKCGST7.js} +10 -5
  98. package/dist/{demo-voice-cmd-4INIOVTC.js → demo-voice-cmd-GEPX7GIG.js} +27 -27
  99. package/dist/{dist-6KGTCWKR.js → dist-VVZIGSAF.js} +1 -1
  100. package/dist/docker-5VWK335X.js +19 -0
  101. package/dist/{doctor-DB2AJUAO.js → doctor-EQM3JRZI.js} +81 -76
  102. package/dist/emit-artifact-cmd-TA3MPHLU.js +43 -0
  103. package/dist/{emit-cmd-IOWTTZSA.js → emit-cmd-RO4L4PFZ.js} +9 -8
  104. package/dist/emit-criteria-cmd-NMTUV2KM.js +34 -0
  105. package/dist/emit-demo-cmd-Y2Y6LEL7.js +46 -0
  106. package/dist/{emit-finding-cmd-KQIGM5IF.js → emit-finding-cmd-VECM64UR.js} +20 -19
  107. package/dist/{emit-result-cmd-6Q7OU2NY.js → emit-result-cmd-2ERWFDUN.js} +25 -24
  108. package/dist/{emit-step-cmd-GZU5O2FR.js → emit-step-cmd-V2ET66N4.js} +20 -19
  109. package/dist/exec-client-54XKNPTI.js +16 -0
  110. package/dist/find-unit-CNAPU7XQ.js +23 -0
  111. package/dist/{findings-cmd-T7PQAVJG.js → findings-cmd-QJPPF6BY.js} +20 -19
  112. package/dist/{fleet-readiness-PTMOEX6L.js → fleet-readiness-DKAPHAZN.js} +16 -15
  113. package/dist/governing-source-7PZ6DAJU.js +40 -0
  114. package/dist/guest-init-5QZRGP62.js +18 -0
  115. package/dist/{hook-fast-RW7RU3O6.js → hook-fast-VXROB4KF.js} +7 -5
  116. package/dist/hook-install-GDNRMML4.js +14 -0
  117. package/dist/{hook-wrap-fast-545QJSBJ.js → hook-wrap-fast-LWWKKPGK.js} +4 -2
  118. package/dist/host-checks-WAPO5X7X.js +78 -0
  119. package/dist/host-key-HLLV37NV.js +16 -0
  120. package/dist/image-tag-PBWQBATH.js +17 -0
  121. package/dist/index.js +8 -9
  122. package/dist/init-EK3PUU6W.js +78 -0
  123. package/dist/{init-HUQLVUPO.js → init-Y2URPVVY.js} +62 -59
  124. package/dist/{init-cmd-6NQGBVAJ.js → init-cmd-XNANUDIW.js} +38 -33
  125. package/dist/{init-update-MA6QKX46.js → init-update-EFCTKF6D.js} +55 -46
  126. package/dist/install-cmd-RHFUZFV4.js +19 -0
  127. package/dist/layout-7XMC7S6K.js +13 -0
  128. package/dist/{logs-FEITSC2V.js → logs-E7MGQINH.js} +10 -3
  129. package/dist/loop-L6TX6OR4.js +89 -0
  130. package/dist/machine-VJKAY2GX.js +78 -0
  131. package/dist/{machine-skills-237PQFRC.js → machine-skills-HR4RNRNR.js} +5 -4
  132. package/dist/{mcp-install-cmd-23ZY4IBK.js → mcp-install-cmd-SMPLT43Q.js} +7 -1
  133. package/dist/{mcp-serve-cmd-ZINYSLY6.js → mcp-serve-cmd-XXERT673.js} +11 -7
  134. package/dist/{paths-XEYE7OZ2.js → paths-F2ZR2EKC.js} +10 -3
  135. package/dist/pending-VOFQRXP4.js +16 -0
  136. package/dist/pidfile-7M7O2M7T.js +17 -0
  137. package/dist/record-YCJ6DZOY.js +16 -0
  138. package/dist/{relay-IEYNSKAZ.js → relay-I2T43PPB.js} +8 -1
  139. package/dist/relay-protocol-GI2GC2AM.js +13 -0
  140. package/dist/runner-env-YW55JVU7.js +23 -0
  141. package/dist/runner-identity-Y5ZFCC7V.js +19 -0
  142. package/dist/{runner-key-CFZ47PR3.js → runner-key-R47C6374.js} +54 -54
  143. package/dist/session-sender-UPACLRGG.js +43 -0
  144. package/dist/{shell-function-NRD4KVUK.js → shell-function-GYD2ZQQG.js} +2 -1
  145. package/dist/{spec-cmd-CNASSB6L.js → spec-cmd-7QRE2SZK.js} +21 -20
  146. package/dist/{starter-pack-CCVIEY72.js → starter-pack-IMKIUA56.js} +7 -6
  147. package/dist/state-VAHBIMS5.js +16 -0
  148. package/dist/{status-VNHIHQ57.js → status-BQEYEG2V.js} +54 -54
  149. package/dist/{statusline-fast-E7RWVREA.js → statusline-fast-NUVHCNRX.js} +4 -2
  150. package/dist/{sync-cmd-5JLJBODH.js → sync-cmd-NBLYEPQG.js} +25 -24
  151. package/dist/update-steps-VGKNGWTZ.js +79 -0
  152. package/dist/{watch-AEWWTUEK.js → watch-IHV4V3HZ.js} +25 -24
  153. package/dist/{work-claim-cmd-GUYOJYH7.js → work-claim-cmd-WGTSU5IT.js} +24 -24
  154. package/dist/{work-cmd-YRPYMGII.js → work-cmd-HKOJU5FJ.js} +18 -17
  155. package/dist/{work-comment-cmd-U5Z6FKEU.js → work-comment-cmd-H3JCWQ2J.js} +21 -20
  156. package/dist/{work-demo-cmd-OLCWTVWM.js → work-demo-cmd-J4AZAIVP.js} +18 -17
  157. package/dist/{work-launch-TTGSHLY4.js → work-launch-LWDQXLGI.js} +1 -1
  158. package/dist/{work-logs-cmd-2OA7ENDU.js → work-logs-cmd-UOO4JVLG.js} +18 -17
  159. package/dist/{work-open-pr-cmd-6GUCDYVM.js → work-open-pr-cmd-QFRDDBAM.js} +20 -19
  160. package/dist/{work-pr-cmd-KK3VQUQI.js → work-pr-cmd-3Q2D5RQT.js} +19 -18
  161. package/dist/{work-proofs-cmd-BUOS5OJC.js → work-proofs-cmd-7Y3HGT7C.js} +21 -20
  162. package/dist/{work-proofs-record-6WLMOK53.js → work-proofs-record-QPUM6DY4.js} +31 -31
  163. package/dist/{work-stop-cmd-VZJX5X4L.js → work-stop-cmd-SD2ZRMSY.js} +18 -17
  164. package/package.json +1 -1
  165. package/dist/agent-setup-DJRQFPDU.js +0 -33
  166. package/dist/bridge-XM4QLKIX.js +0 -8
  167. package/dist/build-ZE5IG3V6.js +0 -18
  168. package/dist/build-disk-GMXDIZU4.js +0 -15
  169. package/dist/builder-LJ3FSB36.js +0 -14
  170. package/dist/caller-YLNJJPFU.js +0 -18
  171. package/dist/chunk-CXFJOX2C.js +0 -144
  172. package/dist/chunk-FGF52V4V.js +0 -137
  173. package/dist/chunk-HCVLP7XA.js +0 -53
  174. package/dist/chunk-KYDEBGJG.js +0 -402
  175. package/dist/chunk-MESOOLF4.js +0 -45
  176. package/dist/chunk-OHQMGLJP.js +0 -113
  177. package/dist/chunk-OUPQTA7N.js +0 -145
  178. package/dist/chunk-VRMXYQWR.js +0 -74
  179. package/dist/connect-cmd-THV7XBVP.js +0 -27
  180. package/dist/docker-5YVUZ3J2.js +0 -14
  181. package/dist/emit-artifact-cmd-H27MFSKH.js +0 -42
  182. package/dist/emit-criteria-cmd-IOUVMB2Q.js +0 -33
  183. package/dist/emit-demo-cmd-WJSS7KU2.js +0 -46
  184. package/dist/exec-client-FGGPQSYQ.js +0 -9
  185. package/dist/find-unit-PRZIFBIK.js +0 -19
  186. package/dist/governing-source-CND5ZZC3.js +0 -39
  187. package/dist/guest-init-WPUS45IN.js +0 -11
  188. package/dist/host-checks-S3B7Z4SY.js +0 -78
  189. package/dist/host-key-O4DFMOSV.js +0 -9
  190. package/dist/image-tag-WBD57QBN.js +0 -10
  191. package/dist/init-ILTX4V56.js +0 -78
  192. package/dist/install-cmd-JKPXIOEY.js +0 -12
  193. package/dist/layout-2ZMCT2D3.js +0 -11
  194. package/dist/loop-KDWDOSMQ.js +0 -89
  195. package/dist/machine-Z6K5XXI6.js +0 -78
  196. package/dist/pending-D2NNV54J.js +0 -9
  197. package/dist/pidfile-FLFVRKVW.js +0 -10
  198. package/dist/record-JMZOXD4R.js +0 -9
  199. package/dist/relay-protocol-5LSWUJCW.js +0 -6
  200. package/dist/runner-env-W2UMHY7P.js +0 -19
  201. package/dist/runner-identity-IIY5UJL3.js +0 -14
  202. package/dist/session-sender-NO4F2IQ5.js +0 -42
  203. package/dist/settings-XB2HYBKO.js +0 -7
  204. package/dist/state-UWIM42JH.js +0 -9
  205. package/dist/update-steps-XGOXDCOS.js +0 -79
  206. package/dist/{chunk-OLM2TIOW.js → chunk-NFZMENCY.js} +1 -1
@@ -1,15 +1,16 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
- import { detectActiveSession } from './chunk-IP7BIBXJ.js';
4
- import { autoConnect } from './chunk-TSYHUUAT.js';
5
- import { workPageUrl } from './chunk-HL7UNTXO.js';
6
- import { C } from './chunk-2AM6Z5BP.js';
3
+ import { detectActiveSession } from './chunk-FWSVWPMS.js';
4
+ import { autoConnect } from './chunk-VUH7KKVD.js';
5
+ import { workPageUrl } from './chunk-FRMAQ3C4.js';
7
6
  import { sanitizeTerminal } from './chunk-P6PHY33P.js';
8
- import { resolveGatewayCredentials, unauthorizedMessage, defaultFetch } from './chunk-YQHEJ5SV.js';
9
- import { signRunnerRequest } from './chunk-4DJZSNVT.js';
7
+ import { resolveRepoIdentity } from './chunk-6KH3NMIT.js';
8
+ import { C } from './chunk-2AM6Z5BP.js';
9
+ import { resolveGatewayCredentials, unauthorizedMessage, defaultFetch } from './chunk-NXQK2I3G.js';
10
+ import { signRunnerRequest } from './chunk-IKFAJTLZ.js';
10
11
  import { readRepoConnection } from './chunk-BJ3KTMDH.js';
11
- import { resolveRepoIdentity } from './chunk-5GHJFETA.js';
12
12
  import { parseTrackerNumber, trackerNumberError } from './chunk-WZBHBH3J.js';
13
+ import { NATIVE_AGENTS, LEGACY_AGENT } from './chunk-LSLK4RS4.js';
13
14
  import { homeFromEnv } from './chunk-352DHUTP.js';
14
15
 
15
16
  createRequire(import.meta.url);
@@ -443,7 +444,7 @@ async function runWorkBuild(opts) {
443
444
  };
444
445
  const { data: data2 } = await postJsonWithRetry(url, "/v1/work-items", apiKey, appId, body2, fetchImpl, retries, sleep);
445
446
  const label = data2.number != null ? `#${data2.number}` : String(data2.workItemId);
446
- const launch = data2.number != null ? `OUTERLAYER_WORK=${data2.number} claude` : null;
447
+ const launch = data2.number != null ? `OUTERLAYER_WORK=${data2.number} ${NATIVE_AGENTS[LEGACY_AGENT].program}` : null;
447
448
  const output2 = opts.json ? JSON.stringify({ ...data2, ...launch !== null ? { launchCommand: launch } : {} }) : `${C.green}\u2713${C.reset} on Work for you to build ${C.dim}\xB7${C.reset} ${label} ${C.dim}\xB7${C.reset} no host will take it` + (launch !== null ? `
448
449
  start your session with: ${launch}` : "");
449
450
  if (!opts.quiet) process.stdout.write(output2 + "\n");
@@ -474,7 +475,7 @@ async function runWorkLinkSession(opts) {
474
475
  return await linkSession(opts);
475
476
  } catch (err) {
476
477
  if (opts.logFailures) {
477
- const { logHookError } = await import('./hook-fast-RW7RU3O6.js');
478
+ const { logHookError } = await import('./hook-fast-VXROB4KF.js');
478
479
  const reason = err instanceof Error ? err.message : String(err);
479
480
  logHookError(opts.home ?? homeFromEnv(opts.env ?? process.env), new Error(`work link-session #${opts.number} failed: ${reason}`));
480
481
  }
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
- import { RUNNER_DIR_MODE, RUNNER_FILE_MODE, runnerDir } from './chunk-WT7J2627.js';
3
+ import { RUNNER_DIR_MODE, RUNNER_FILE_MODE, runnerDir } from './chunk-DTCTXDJP.js';
4
4
  import { mkdirSync, writeFileSync, renameSync, existsSync, readFileSync } from 'fs';
5
5
  import { dirname, join } from 'path';
6
6
 
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
- import { currentLink } from './chunk-AF6DQJ5W.js';
3
+ import { currentLink } from './chunk-DG3M5DZU.js';
4
4
  import { readFileSync, statSync, chmodSync, mkdirSync, writeFileSync, renameSync, rmSync, existsSync, lstatSync, accessSync, constants, realpathSync } from 'fs';
5
5
  import { randomBytes } from 'crypto';
6
6
  import { join, dirname, delimiter, resolve } from 'path';
@@ -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-I6U6QPN6.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();
@@ -1,11 +1,12 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
3
  import { C } from './chunk-2AM6Z5BP.js';
4
- import { resolvePackRoot, OUTERLAYER_SKILLS_BASE, loadTemplateFiles, AGENTS_SKILLS_BASE, loadMaintainedFiles, rewriteSkillPaths, TEMPLATE_SKILLS, skillDir, writeMaintainedFiles, MACHINE_SKILL_PATH } from './chunk-CXFJOX2C.js';
4
+ import { cliInvocation } from './chunk-FZKNTIOJ.js';
5
+ import { linkedAgentsPath } from './chunk-PBGNX3PS.js';
6
+ import { resolvePackRoot, OUTERLAYER_SKILLS_BASE, loadTemplateFiles, AGENTS_SKILLS_BASE, loadMaintainedFiles, rewriteSkillPaths, TEMPLATE_SKILLS, skillDir, writeMaintainedFiles, MACHINE_SKILL_PATH } from './chunk-I6U6QPN6.js';
7
+ import { LEGACY_AGENT } from './chunk-LSLK4RS4.js';
5
8
  import { MAINTAINED_SKILLS } from './chunk-CDDED64E.js';
6
9
  import { resolvePackageVersion } from './chunk-RA3O54FC.js';
7
- import { cliInvocation } from './chunk-FZKNTIOJ.js';
8
- import { linkedAgentsPath } from './chunk-B7PYT2BY.js';
9
10
  import { readFileSync, existsSync, mkdirSync, writeFileSync } from 'fs';
10
11
  import { join, dirname } from 'path';
11
12
 
@@ -111,7 +112,7 @@ function formatStarterPackOutput(result) {
111
112
  ...result.validatorsKept.map((path) => `${C.dim}${path} already exists \u2014 left as it is${C.reset}`),
112
113
  "",
113
114
  ...base === OUTERLAYER_SKILLS_BASE ? [
114
- `Next: create .outerlayer/config.json naming your agent tools, for example {"targets": ["claude-code"]},`,
115
+ `Next: create .outerlayer/config.json naming your agent tools, for example {"targets": ["${LEGACY_AGENT}"]},`,
115
116
  `then run ${C.yellow}${cliInvocation()} context emit${C.reset} to compile the skills into their native files.`
116
117
  ] : [`Agents read these skills from ${base}/ as they are. Nothing needs compiling.`]
117
118
  );
@@ -0,0 +1,28 @@
1
+ #!/usr/bin/env node
2
+ import { createRequire } from 'node:module';
3
+ import { NATIVE_AGENTS, LEGACY_AGENT } from './chunk-LSLK4RS4.js';
4
+
5
+ createRequire(import.meta.url);
6
+
7
+ // src/control-plane-paths.ts
8
+ var LEGACY = NATIVE_AGENTS[LEGACY_AGENT];
9
+ var CONTROL_PLANE_DIR_VARIABLE = "OUTERLAYER_CONTROL_PLANE_DIR";
10
+ var GOVERNANCE_VARIABLE = "OUTERLAYER_GOVERNANCE";
11
+ var SUPPORTED_CONTROL_PLANE_LAYOUT = 2;
12
+ var MINIMUM_CLAUDE_VERSION = LEGACY.versions.minimum;
13
+ function versionParts(text) {
14
+ const found = /(\d+)\.(\d+)\.(\d+)/.exec(text);
15
+ return found === null ? void 0 : [Number(found[1]), Number(found[2]), Number(found[3])];
16
+ }
17
+ function versionAtLeast(text, minimum = MINIMUM_CLAUDE_VERSION) {
18
+ const have = versionParts(text);
19
+ const need = versionParts(minimum);
20
+ if (have === void 0 || need === void 0) return false;
21
+ const difference = have.map((part, i) => part - need[i]).find((delta) => delta !== 0);
22
+ return (difference ?? 0) >= 0;
23
+ }
24
+ var SHIM_SCRIPT = `#!/bin/sh
25
+ exec outerlayer ${LEGACY.legacy.subcommand} "$@"
26
+ `;
27
+
28
+ export { CONTROL_PLANE_DIR_VARIABLE, GOVERNANCE_VARIABLE, MINIMUM_CLAUDE_VERSION, SHIM_SCRIPT, SUPPORTED_CONTROL_PLANE_LAYOUT, versionAtLeast };
@@ -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-XEWG4AB2.js';
4
+ import { checkFit, RUNNER_RESERVE_BYTES } from './chunk-CSBW4LGL.js';
5
+ import { isBuiltinVm, builtinKind, EGRESS_SWITCHABLE_KEYS, imageBuildOf, keepsHostBuilder } from './chunk-WACPWYMH.js';
6
+ import { realBuildDiskProbe, checkDiskFit, DEFAULT_CACHE_DISK, DEFAULT_BUILD_DISK } from './chunk-Y4E7IS7H.js';
7
+ import { getJson, WorkCommandError } from './chunk-AQE6E54X.js';
8
+ import { ensureHostKey } from './chunk-IKFAJTLZ.js';
9
+ import { BUILD_SLICE_MEMORY_ENV, forwardedVariables, credentialAgent, credentialForms, managedKeyName, builderDiskPinned, agentCredentialVariablesSet, agentCredential, storeVariables, credentialEnvPath, parseRunnerEnv } from './chunk-DTQPDMHG.js';
10
+ import { defaultAgents } from './chunk-I6U6QPN6.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
  }
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
- import { UNIVERSAL_IMAGE_REPOSITORY, UNIVERSAL_IMAGE_DIGEST } from './chunk-OUPQTA7N.js';
3
+ import { UNIVERSAL_IMAGE_REPOSITORY, UNIVERSAL_IMAGE_DIGEST } from './chunk-DTQPDMHG.js';
4
4
  import { existsSync, readdirSync, readFileSync, lstatSync, realpathSync, writeFileSync } from 'fs';
5
5
  import { join, resolve, relative, dirname, sep, basename } from 'path';
6
6
  import { createRequire as createRequire$1 } from 'module';
@@ -1,12 +1,13 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
- import { resolveDevcontainerCli, devcontainerBuildInvocation, universalImagePending, RecipeError } from './chunk-CIUD3436.js';
4
- import { universalImagePinned, UNIVERSAL_IMAGE, BUILDKIT_IMAGE } from './chunk-OUPQTA7N.js';
5
- import { ensureHostKey } from './chunk-4DJZSNVT.js';
6
- import { compareVersions } from './chunk-5GHJFETA.js';
7
- import { RUNNER_DIR_MODE, RUNNER_FILE_MODE, runnerDir, jobsDir } from './chunk-WT7J2627.js';
8
- import { CLAUDE_PORT, BUILD_HOME, JOB_MOUNT, GATEWAY_PORT, GATEWAY_SOCKET, CLAUDE_SOCKET, RELAY_PORT, DESTINATION_BASE_PORT } from './chunk-GANAOCHR.js';
9
- import { JOIN_DIR, RELAY_ID, JOIN_SOCKET, TARGET_GATEWAY, TARGET_CLAUDE, destinationTarget, RELAY_USER } from './chunk-MESOOLF4.js';
3
+ import { resolveDevcontainerCli, devcontainerBuildInvocation, universalImagePending, RecipeError } from './chunk-BZSJ77MO.js';
4
+ import { compareVersions } from './chunk-6KH3NMIT.js';
5
+ import { ensureHostKey } from './chunk-IKFAJTLZ.js';
6
+ import { RUNNER_DIR_MODE, RUNNER_FILE_MODE, runnerDir, jobsDir } from './chunk-DTCTXDJP.js';
7
+ import { BUILD_HOME, JOB_MOUNT, RELAY_PORT, DESTINATION_BASE_PORT } from './chunk-CXJC3JLN.js';
8
+ import { universalImagePinned, UNIVERSAL_IMAGE, primaryDestination, JOIN_DIR, RELAY_ID, JOIN_SOCKET, GATEWAY_PORT, TARGET_GATEWAY, GATEWAY_SOCKET, destinationTarget, providerDestinations, BUILDKIT_IMAGE, RELAY_USER } from './chunk-DTQPDMHG.js';
9
+ import { defaultAgents } from './chunk-I6U6QPN6.js';
10
+ import { PROVIDERS } from './chunk-LSLK4RS4.js';
10
11
  import { createHash } from 'crypto';
11
12
  import { mkdirSync, createWriteStream, rmSync, existsSync, readFileSync, chmodSync, writeFileSync, realpathSync, readdirSync, renameSync } from 'fs';
12
13
  import { dirname, join, posix, resolve } from 'path';
@@ -403,7 +404,7 @@ function judgeCommand(input) {
403
404
  HOME: JUDGE_HOME,
404
405
  TMPDIR: `${JUDGE_HOME}/tmp`,
405
406
  PATH: JUDGE_PATH,
406
- ANTHROPIC_BASE_URL: `http://127.0.0.1:${CLAUDE_PORT}`,
407
+ ANTHROPIC_BASE_URL: `http://127.0.0.1:${primaryDestination().port}`,
407
408
  CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC: "1",
408
409
  DISABLE_AUTOUPDATER: "1",
409
410
  ...input.credential === void 0 ? {} : { [input.credential.variable]: input.credential.placeholder }
@@ -557,7 +558,7 @@ function mountedDir(dir, what) {
557
558
  if (dir === void 0) throw new Error(`${what} is required for a build whose files are not copied`);
558
559
  return dir;
559
560
  }
560
- function containerRunArgs(input) {
561
+ function containerRunArgs(input, agents = defaultAgents(), providers = PROVIDERS) {
561
562
  const exec = input.transport === "exec";
562
563
  const copied = input.jobFiles === "copied";
563
564
  if (copied && !exec) throw new Error("a build's files are copied in only through docker exec");
@@ -604,8 +605,7 @@ function containerRunArgs(input) {
604
605
  ...input.builtIns === true ? [
605
606
  "--forward",
606
607
  `${GATEWAY_PORT}=${exec ? TARGET_GATEWAY : `${JOB_MOUNT}/${GATEWAY_SOCKET}`}`,
607
- "--forward",
608
- `${CLAUDE_PORT}=${exec ? TARGET_CLAUDE : `${JOB_MOUNT}/${CLAUDE_SOCKET}`}`
608
+ ...providerDestinations(agents, providers).flatMap((destination) => ["--forward", `${destination.port}=${exec ? destination.name : `${JOB_MOUNT}/${destination.socket}`}`])
609
609
  ] : []
610
610
  ];
611
611
  }
@@ -1,9 +1,10 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
- import { builtinKind, keepsHostBuilder } from './chunk-RIIPBJK6.js';
4
- import { parseSize } from './chunk-OEBFKPHK.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-WACPWYMH.js';
4
+ import { parseSize } from './chunk-CDG475ZP.js';
5
+ import { runnerDir } from './chunk-DTCTXDJP.js';
6
+ import { FD_SLOTS_PER_BUILD, runnerAgents, credentialNames, FD_STORE_ENV, BUILD_SLICE_MEMORY_ENV, credentialAgent, credentialForms, credentialLineIn, withoutCredentialLines } from './chunk-DTQPDMHG.js';
7
+ import { defaultAgents } from './chunk-I6U6QPN6.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);
@@ -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-WACPWYMH.js';
4
+ import { orgHomeDir } from './chunk-DTCTXDJP.js';
5
5
 
6
6
  createRequire(import.meta.url);
7
7