@outerlayer/cli 0.40.0 → 0.41.0-next.20261117195646

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 (217) hide show
  1. package/README.md +8 -5
  2. package/dist/agent-credential-JN5VDRUX.js +16 -0
  3. package/dist/agent-setup-7A66WE3X.js +43 -0
  4. package/dist/{agent-subcommand-U7TXKOF4.js → agent-subcommand-AE42NSHC.js} +6 -6
  5. package/dist/{artifact-link-cmd-HYEM4X5U.js → artifact-link-cmd-YMMRVRQD.js} +2 -2
  6. package/dist/bridge-PJTQ3XHE.js +19 -0
  7. package/dist/build-75I2U74U.js +28 -0
  8. package/dist/build-disk-Z5YFT47Z.js +23 -0
  9. package/dist/build-info.json +1 -1
  10. package/dist/builder-NNNVIN4P.js +22 -0
  11. package/dist/caller-H3KRGMJH.js +25 -0
  12. package/dist/{check-U5P5FFFB.js → check-KFQCKXHZ.js} +108 -90
  13. package/dist/{chunk-4KCWAP5L.js → chunk-23YVVYQC.js} +1 -1
  14. package/dist/{chunk-J3P4WLJA.js → chunk-26RXLXEX.js} +1 -1
  15. package/dist/{chunk-YYHSGZHO.js → chunk-2RUTYYYA.js} +1 -1
  16. package/dist/{chunk-6IGOHB3O.js → chunk-37WA2LQC.js} +6 -1
  17. package/dist/{chunk-WNX2RR5P.js → chunk-3HH2AQKF.js} +1 -1
  18. package/dist/{chunk-ZHRXINEW.js → chunk-3RXLDGWE.js} +7 -7
  19. package/dist/{chunk-ZCBKVSBK.js → chunk-4I3SN7WG.js} +3 -3
  20. package/dist/{chunk-TWKW3BL3.js → chunk-4RPDWURG.js} +1 -1
  21. package/dist/{chunk-Y34AHK7R.js → chunk-4SMKP5QI.js} +2 -2
  22. package/dist/{chunk-XC2ZN7UA.js → chunk-6SYVSIGA.js} +1 -1
  23. package/dist/{chunk-CQIJVNUB.js → chunk-A2AFTKMN.js} +7 -7
  24. package/dist/{chunk-PKBW4RL7.js → chunk-APVMCKLK.js} +1 -1
  25. package/dist/{chunk-4JUAJVOW.js → chunk-ATXTGXGK.js} +2 -2
  26. package/dist/{chunk-24K3CV6P.js → chunk-B2WCKRMW.js} +6 -6
  27. package/dist/{chunk-LA66NWUO.js → chunk-B3ZKYFBI.js} +1 -1
  28. package/dist/{chunk-HS45JMDJ.js → chunk-B6W2LW7E.js} +1 -1
  29. package/dist/{chunk-3UFBSPHM.js → chunk-BO5TMIRG.js} +4 -4
  30. package/dist/{chunk-5VANIC7Z.js → chunk-BPZ23EMS.js} +7 -7
  31. package/dist/{chunk-CDMNKUFT.js → chunk-CUMLCXFI.js} +2 -2
  32. package/dist/{chunk-YZQDTL3T.js → chunk-D47Z2Z7F.js} +190 -173
  33. package/dist/{chunk-VXL7SLO3.js → chunk-D5TZYUGZ.js} +1 -1
  34. package/dist/{chunk-AE6A5DVR.js → chunk-D5YKSWK3.js} +8 -8
  35. package/dist/{chunk-5GJWIATY.js → chunk-DJCSAWBV.js} +4 -4
  36. package/dist/{chunk-F3J4UKBF.js → chunk-DJK3IK6K.js} +1 -1
  37. package/dist/{chunk-CHIKNMWU.js → chunk-DXZ6QBUJ.js} +1 -1
  38. package/dist/{chunk-7N6MB6NR.js → chunk-EVAK6FAS.js} +6 -6
  39. package/dist/{chunk-WGWIB5JH.js → chunk-EYD5HOQ7.js} +1 -1
  40. package/dist/{chunk-AOAXRPXC.js → chunk-FD42O5SH.js} +13 -4
  41. package/dist/{chunk-FIH3QA4E.js → chunk-FMOGX7RR.js} +5 -5
  42. package/dist/{chunk-EOKIUWXY.js → chunk-FRLGVHJP.js} +1 -1
  43. package/dist/{chunk-7RIWXHSY.js → chunk-G4B473J5.js} +3 -3
  44. package/dist/chunk-GAHP2AI3.js +163 -0
  45. package/dist/{chunk-3KT24F2C.js → chunk-GVGHEQCU.js} +9 -9
  46. package/dist/{chunk-WNPLSKH6.js → chunk-H2NTP6OM.js} +1 -1
  47. package/dist/{chunk-F3P7DP7R.js → chunk-I6G5CO3K.js} +1 -1
  48. package/dist/{chunk-D6CU6N5S.js → chunk-IOSONR7N.js} +2 -2
  49. package/dist/{chunk-SKVA4VMG.js → chunk-J2ADYASG.js} +1 -1
  50. package/dist/{chunk-CVDB3ILT.js → chunk-JMSMNKCK.js} +1 -1
  51. package/dist/{chunk-TTPOEZFE.js → chunk-KTZOD7A3.js} +1 -1
  52. package/dist/{chunk-SGVMC66D.js → chunk-LOWZZ4QA.js} +1 -1
  53. package/dist/{chunk-DCY6QUS6.js → chunk-M4YTSRJI.js} +1 -1
  54. package/dist/chunk-MQ6SKVLA.js +9 -0
  55. package/dist/{chunk-ZZN2TUHE.js → chunk-MYFC3HKP.js} +9 -9
  56. package/dist/{chunk-Q5A5WWZI.js → chunk-NCZNYMTB.js} +23 -21
  57. package/dist/{chunk-R2VUU5TC.js → chunk-NEOM73RW.js} +1 -1
  58. package/dist/{chunk-AQNL3XHS.js → chunk-NPVIEJX6.js} +1 -1
  59. package/dist/{chunk-K5J7AKRL.js → chunk-P7WAAN35.js} +1 -1
  60. package/dist/{chunk-SQIFPWGN.js → chunk-PLVLC7SU.js} +2 -2
  61. package/dist/{chunk-A6DFTKQF.js → chunk-PMJGT7SQ.js} +25 -19
  62. package/dist/{chunk-WVEN3DDJ.js → chunk-PTZF6MC5.js} +6 -6
  63. package/dist/{chunk-OLWDENJZ.js → chunk-Q3QJG2P6.js} +3 -3
  64. package/dist/{chunk-JIMISJV2.js → chunk-Q7Z6ELTL.js} +28 -7
  65. package/dist/{chunk-HHOFP647.js → chunk-QDJBEQCE.js} +1 -1
  66. package/dist/{chunk-BV4I6IIT.js → chunk-QFGKTIPS.js} +3 -3
  67. package/dist/{chunk-2SS737DI.js → chunk-QHGVLLOJ.js} +1 -1
  68. package/dist/{chunk-EOO274OK.js → chunk-QKVOUI56.js} +3 -3
  69. package/dist/{chunk-MUDXPJT6.js → chunk-QPC6OKD2.js} +11 -11
  70. package/dist/{chunk-MRM7CQJ3.js → chunk-QS2O5G64.js} +116 -14
  71. package/dist/{chunk-WKO72EYV.js → chunk-R6ME6MWL.js} +3 -3
  72. package/dist/{chunk-H7IY5B2M.js → chunk-RVUOSR2D.js} +526 -107
  73. package/dist/{chunk-L6UD5LKU.js → chunk-SDCECDBS.js} +5 -5
  74. package/dist/{chunk-P6GTJQMA.js → chunk-SE5ZVVDJ.js} +3 -3
  75. package/dist/{chunk-2ZF62BAK.js → chunk-TLCTOEU5.js} +1 -1
  76. package/dist/{chunk-PG4KH7G6.js → chunk-TVU7AL2Z.js} +6 -6
  77. package/dist/{chunk-XEVGUSP6.js → chunk-UTZULAN6.js} +10 -10
  78. package/dist/{chunk-VIIJAM2R.js → chunk-UYIWLYLX.js} +5 -5
  79. package/dist/{chunk-IGYRJWB4.js → chunk-V5MR6BWR.js} +226 -143
  80. package/dist/{chunk-BEPP2C3U.js → chunk-VATN55FQ.js} +8 -8
  81. package/dist/{chunk-ZCFGRVGX.js → chunk-VYF5BILX.js} +34 -7
  82. package/dist/{chunk-U74YD3WB.js → chunk-W7P5QFRN.js} +7 -7
  83. package/dist/{chunk-QMC2MM2S.js → chunk-WNFITHNX.js} +1 -1
  84. package/dist/{chunk-XMUNNJMO.js → chunk-WOQOZCZZ.js} +4 -4
  85. package/dist/{chunk-UHGU2EAK.js → chunk-WRIQGJKT.js} +225 -17
  86. package/dist/{chunk-DAAZIWK2.js → chunk-X7YMKZ7A.js} +23 -21
  87. package/dist/{chunk-WQRFIWYB.js → chunk-XCAPYFJ3.js} +5 -5
  88. package/dist/{chunk-VUSPSY6N.js → chunk-XDAMSCJG.js} +1 -1
  89. package/dist/{chunk-LAO7LRIR.js → chunk-XMJNIIPM.js} +411 -92
  90. package/dist/{chunk-Q7OOS23E.js → chunk-XNB2VFZI.js} +4 -4
  91. package/dist/{chunk-GBCTYHZ4.js → chunk-YLDCYJRP.js} +15 -13
  92. package/dist/{chunk-YKVFVP4A.js → chunk-YLDHHHBJ.js} +43 -13
  93. package/dist/{chunk-2GAQRL4S.js → chunk-YNZVC7XT.js} +4 -4
  94. package/dist/{chunk-HMW3UCME.js → chunk-YXKZGVUL.js} +36 -8
  95. package/dist/{chunk-YVBJ74GP.js → chunk-YXUSSZAE.js} +23 -21
  96. package/dist/{claude-launcher-ZLZ4UMHJ.js → claude-launcher-HNE36BKE.js} +68 -18
  97. package/dist/{cli-EFLEZPHB.js → cli-NEZV54LS.js} +220 -179
  98. package/dist/{command-22NUIO7Z.js → command-H2R6EFUH.js} +68 -61
  99. package/dist/{config-HZEVAUDO.js → config-DIUO2GQY.js} +16 -14
  100. package/dist/{connect-cmd-IUDF62SX.js → connect-cmd-SXSWOHVT.js} +17 -15
  101. package/dist/{container-start-PQAEL5ZS.js → container-start-B7BACAFN.js} +61 -57
  102. package/dist/{context-cleanup-OT7BL2NG.js → context-cleanup-BUZVQNKC.js} +6 -6
  103. package/dist/{context-show-cmd-JDO6DBBU.js → context-show-cmd-ZWOTXOXV.js} +18 -16
  104. package/dist/{control-plane-launch-M545J63D.js → control-plane-launch-BPJQYN6J.js} +19 -17
  105. package/dist/{demo-record-cmd-DGP3CW3A.js → demo-record-cmd-4H2J2N3X.js} +12 -10
  106. package/dist/{demo-voice-cmd-23BV7L6V.js → demo-voice-cmd-VIOM4SF5.js} +26 -24
  107. package/dist/{dist-AKLRKVET.js → dist-FKOMD5MC.js} +2 -2
  108. package/dist/docker-QQEZWBI3.js +22 -0
  109. package/dist/{doctor-5VN6Q4ZU.js → doctor-Y7CIJZX5.js} +115 -64
  110. package/dist/emit-artifact-cmd-HUAKLOH4.js +46 -0
  111. package/dist/{emit-cmd-RM6FHATP.js → emit-cmd-UDTT7ENT.js} +9 -9
  112. package/dist/emit-criteria-cmd-7LKPQRFE.js +37 -0
  113. package/dist/emit-demo-cmd-7TW5Y3MN.js +49 -0
  114. package/dist/{emit-finding-cmd-E7WKK2A4.js → emit-finding-cmd-T3JBAGS2.js} +20 -18
  115. package/dist/{emit-result-cmd-5LKEMUOD.js → emit-result-cmd-ILRQ6OIL.js} +24 -22
  116. package/dist/emit-step-cmd-4ISFOYRC.js +37 -0
  117. package/dist/exec-client-UJKPJRNK.js +20 -0
  118. package/dist/{find-unit-XKWFS4BL.js → find-unit-OAJKRZI2.js} +17 -15
  119. package/dist/{findings-cmd-5BNDO3YM.js → findings-cmd-37RCXQK2.js} +20 -18
  120. package/dist/fleet-readiness-IVFQSHPL.js +33 -0
  121. package/dist/governing-source-RXJBJHN7.js +45 -0
  122. package/dist/guest-init-EXKSBS7A.js +22 -0
  123. package/dist/{hook-fast-CQ2YCZLB.js → hook-fast-BSH6IHRN.js} +4 -4
  124. package/dist/{hook-install-VWF5C6EL.js → hook-install-NOWMUPSI.js} +6 -6
  125. package/dist/{hook-wrap-fast-Y5KKK67C.js → hook-wrap-fast-7E5LAYEU.js} +3 -3
  126. package/dist/host-checks-GWUYRJXA.js +84 -0
  127. package/dist/host-key-7WPFECOD.js +20 -0
  128. package/dist/{image-tag-VZTFHG6T.js → image-tag-GLR3OAO3.js} +12 -10
  129. package/dist/index.js +6 -6
  130. package/dist/init-4MF5M74X.js +84 -0
  131. package/dist/{init-IXQBYUOM.js → init-BEMNWKES.js} +55 -53
  132. package/dist/{init-agent-BWLBRVNP.js → init-agent-6E3FAOEZ.js} +55 -53
  133. package/dist/init-cmd-R5ICA2LP.js +55 -0
  134. package/dist/{init-update-35IRDVWQ.js → init-update-FAFXM2YE.js} +29 -27
  135. package/dist/install-cmd-HI5OQW5J.js +28 -0
  136. package/dist/launch-agent-JLANNHFC.js +28 -0
  137. package/dist/{layout-F6FDPUC2.js → layout-U2ZTNGVB.js} +6 -6
  138. package/dist/{login-browser-G3NBTYT6.js → login-browser-QAPMBSQA.js} +2 -2
  139. package/dist/{logs-NWVFDJS3.js → logs-RVPQEAYN.js} +11 -9
  140. package/dist/loop-PP7QFT3F.js +94 -0
  141. package/dist/machine-JHWQCYS3.js +84 -0
  142. package/dist/{machine-skills-U7RNJTPH.js → machine-skills-2QFBY2II.js} +6 -6
  143. package/dist/{mcp-install-cmd-QDYJB3RW.js → mcp-install-cmd-KRZJVOND.js} +6 -6
  144. package/dist/{mcp-serve-cmd-JEYAQJPY.js → mcp-serve-cmd-UT3YCM5P.js} +13 -11
  145. package/dist/{paths-DWVALEBM.js → paths-72CWJPND.js} +11 -9
  146. package/dist/pending-ES4EF46B.js +20 -0
  147. package/dist/pidfile-WI6SE35U.js +21 -0
  148. package/dist/record-KX763L6R.js +20 -0
  149. package/dist/{relay-SKBUV4HQ.js → relay-ZZWAUA6P.js} +9 -7
  150. package/dist/{relay-protocol-YSGHT7C4.js → relay-protocol-4GCTOIT4.js} +9 -7
  151. package/dist/{run-cmd-S7IQ6OVY.js → run-cmd-SCXMROKB.js} +20 -18
  152. package/dist/runner-agents-QS3IX55G.js +15 -0
  153. package/dist/runner-env-FU6EWMWW.js +26 -0
  154. package/dist/runner-identity-PUW27LAT.js +22 -0
  155. package/dist/{runner-key-OM2HCEVM.js → runner-key-5G2AJD57.js} +55 -53
  156. package/dist/session-sender-A46R3S66.js +46 -0
  157. package/dist/{setup-cmd-S4ZIVRRF.js → setup-cmd-OZS4QOPI.js} +18 -16
  158. package/dist/{setup-wiring-FRY6CKZ7.js → setup-wiring-G2RLSBQ6.js} +64 -62
  159. package/dist/{shell-function-7N3ILFLG.js → shell-function-6ZFAVOSM.js} +2 -2
  160. package/dist/{spec-cmd-PRGEIOJ7.js → spec-cmd-C4KSLTAD.js} +21 -19
  161. package/dist/{starter-pack-YVBD7AKE.js → starter-pack-G5TQVPMW.js} +7 -7
  162. package/dist/state-TCZAKBBZ.js +20 -0
  163. package/dist/{status-JORNKH3T.js → status-T6WDUAI4.js} +65 -53
  164. package/dist/{statusline-fast-ZWMTN36K.js → statusline-fast-VVJF5W7X.js} +3 -3
  165. package/dist/{sync-cmd-QVSAP72U.js → sync-cmd-ZYTJMWET.js} +24 -22
  166. package/dist/update-steps-PU34FN7N.js +85 -0
  167. package/dist/{watch-F2ELGBST.js → watch-VCKWAILU.js} +24 -22
  168. package/dist/{work-claim-cmd-LEM7P2ME.js → work-claim-cmd-7TR6LNIY.js} +27 -25
  169. package/dist/{work-cmd-M2RCHHKE.js → work-cmd-7KOXRPOJ.js} +20 -18
  170. package/dist/work-comment-cmd-EDXP3K7B.js +41 -0
  171. package/dist/{work-demo-cmd-FQMFCLZ6.js → work-demo-cmd-OYZTKNCG.js} +20 -18
  172. package/dist/{work-logs-cmd-KLPX4TYX.js → work-logs-cmd-P3QS5AFY.js} +20 -18
  173. package/dist/{work-mock-cmd-XJEG6AAT.js → work-mock-cmd-3QEXWV43.js} +20 -18
  174. package/dist/{work-needs-attention-cmd-BOINZLEQ.js → work-needs-attention-cmd-ZTQB2DXB.js} +20 -18
  175. package/dist/{work-no-change-cmd-IINJFYBD.js → work-no-change-cmd-FGHOOPLY.js} +20 -18
  176. package/dist/{work-open-pr-cmd-S2XL6OZV.js → work-open-pr-cmd-WFIPFVQR.js} +21 -19
  177. package/dist/work-pr-cmd-262GWNKI.js +36 -0
  178. package/dist/work-proofs-cmd-PAJSCMJ2.js +39 -0
  179. package/dist/{work-proofs-record-34VAOVND.js → work-proofs-record-A4NZTAME.js} +30 -28
  180. package/dist/{work-stop-cmd-HWG6IUFS.js → work-stop-cmd-CBRWKR4Q.js} +20 -18
  181. package/package.json +1 -1
  182. package/dist/agent-setup-KJVEDAHY.js +0 -41
  183. package/dist/bridge-UIT7F5DZ.js +0 -17
  184. package/dist/build-W2Z43HX5.js +0 -26
  185. package/dist/build-disk-AOY6DOEK.js +0 -21
  186. package/dist/builder-PHD5WM6J.js +0 -20
  187. package/dist/caller-WJVESIHQ.js +0 -23
  188. package/dist/docker-S6XFE42W.js +0 -20
  189. package/dist/emit-artifact-cmd-H3HULADF.js +0 -44
  190. package/dist/emit-criteria-cmd-UM3DXOOD.js +0 -35
  191. package/dist/emit-demo-cmd-BMAXX7M2.js +0 -47
  192. package/dist/emit-step-cmd-6TX7FGWI.js +0 -35
  193. package/dist/exec-client-H2AOUP6U.js +0 -18
  194. package/dist/fleet-readiness-YDRQPUI5.js +0 -31
  195. package/dist/governing-source-CLLOKTZF.js +0 -43
  196. package/dist/guest-init-PDLZDDB4.js +0 -20
  197. package/dist/host-checks-43WBI5JE.js +0 -82
  198. package/dist/host-key-AOUOQNV5.js +0 -18
  199. package/dist/init-IZJENDA6.js +0 -82
  200. package/dist/init-cmd-AL3ODKU6.js +0 -53
  201. package/dist/install-cmd-DMAMD7BD.js +0 -26
  202. package/dist/launch-agent-XAPO3FGT.js +0 -26
  203. package/dist/loop-Q5CTVY7B.js +0 -92
  204. package/dist/machine-55WUTHG3.js +0 -82
  205. package/dist/pending-PA5UWRHN.js +0 -18
  206. package/dist/pidfile-KOM3XD4E.js +0 -19
  207. package/dist/record-S2WGEUIM.js +0 -18
  208. package/dist/runner-agents-ZVIM6XVC.js +0 -14
  209. package/dist/runner-env-WD6CPYTN.js +0 -24
  210. package/dist/runner-identity-LDFFB6YB.js +0 -20
  211. package/dist/session-sender-IZP4E562.js +0 -44
  212. package/dist/state-LAKZKWCJ.js +0 -18
  213. package/dist/update-steps-LM3C7MG6.js +0 -83
  214. package/dist/work-comment-cmd-QGAY3QUN.js +0 -39
  215. package/dist/work-pr-cmd-6YTJRHVC.js +0 -34
  216. package/dist/work-proofs-cmd-OC3O264U.js +0 -37
  217. package/dist/{real-deps-B7NMEDXM.js → real-deps-HNNHF3UN.js} +1 -1
@@ -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 } from './chunk-VXL7SLO3.js';
3
+ import { RUNNER_DIR_MODE, RUNNER_FILE_MODE } from './chunk-D5TZYUGZ.js';
4
4
  import { readFileSync, existsSync, rmSync, mkdirSync, writeFileSync, renameSync } from 'fs';
5
5
  import { join } from 'path';
6
6
 
@@ -1,13 +1,13 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
- import { scrubReason, stripTerminalControls } from './chunk-H7IY5B2M.js';
4
- import { checkFit, RUNNER_RESERVE_BYTES } from './chunk-Q5A5WWZI.js';
5
- import { RunnerAlreadyRunningError, readPidFile } from './chunk-AQNL3XHS.js';
3
+ import { scrubReason, stripTerminalControls } from './chunk-RVUOSR2D.js';
4
+ import { checkFit, RUNNER_RESERVE_BYTES } from './chunk-NCZNYMTB.js';
5
+ import { RunnerAlreadyRunningError, readPidFile } from './chunk-NPVIEJX6.js';
6
6
  import { isSameProcess } from './chunk-JBJTC3UU.js';
7
- import { isSignatureRefusal, postJson } from './chunk-YKVFVP4A.js';
8
- import { keyRunnerFactory } from './chunk-ZCFGRVGX.js';
9
- import { signerFor } from './chunk-F3P7DP7R.js';
10
- import { pidFilePath } from './chunk-VXL7SLO3.js';
7
+ import { isSignatureRefusal, postJson } from './chunk-YLDHHHBJ.js';
8
+ import { keyRunnerFactory } from './chunk-VYF5BILX.js';
9
+ import { signerFor } from './chunk-I6G5CO3K.js';
10
+ import { pidFilePath } from './chunk-D5TZYUGZ.js';
11
11
  import { readFileSync } from 'fs';
12
12
 
13
13
  createRequire(import.meta.url);
@@ -3,7 +3,7 @@ import { createRequire } from 'node:module';
3
3
  import { C } from './chunk-2AM6Z5BP.js';
4
4
  import { readCloudConfig } from './chunk-HWVMRETT.js';
5
5
  import { cliInvocation } from './chunk-FZKNTIOJ.js';
6
- import { legacyAgent, laptopAgents, defaultAgents, McpFileError } from './chunk-LAO7LRIR.js';
6
+ import { legacyAgent, laptopAgents, defaultAgents, McpFileError } from './chunk-XMJNIIPM.js';
7
7
  import { existsSync, mkdirSync, writeFileSync, readFileSync } from 'fs';
8
8
  import { join, dirname } from 'path';
9
9
 
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
- import { parseOuterlayerConfig, targetIds, defaultAgents } from './chunk-LAO7LRIR.js';
4
- import { NATIVE_AGENTS, LEGACY_AGENT } from './chunk-JIMISJV2.js';
3
+ import { parseOuterlayerConfig, targetIds, defaultAgents } from './chunk-XMJNIIPM.js';
4
+ import { NATIVE_AGENTS, LEGACY_AGENT } from './chunk-Q7Z6ELTL.js';
5
5
  import { readFileSync } from 'fs';
6
6
  import { join } from 'path';
7
7
 
@@ -1,14 +1,14 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
- import { sanitizeTerminal } from './chunk-QMC2MM2S.js';
4
- import { mcpFiles, skillLinkFolders, isAgentsMdLayout } from './chunk-Y34AHK7R.js';
5
- import { DEFAULT_DASHBOARD } from './chunk-VUSPSY6N.js';
6
- import { cliFetch, resolveGatewayCredentials } from './chunk-EOKIUWXY.js';
3
+ import { sanitizeTerminal } from './chunk-WNFITHNX.js';
4
+ import { mcpFiles, skillLinkFolders, isAgentsMdLayout } from './chunk-4SMKP5QI.js';
5
+ import { DEFAULT_DASHBOARD } from './chunk-XDAMSCJG.js';
6
+ import { cliFetch, resolveGatewayCredentials } from './chunk-FRLGVHJP.js';
7
7
  import { readCloudConfig } from './chunk-HWVMRETT.js';
8
8
  import { findGitDirs, writeRepoConnection, readRepoConnection } from './chunk-BJ3KTMDH.js';
9
9
  import { cliInvocation } from './chunk-FZKNTIOJ.js';
10
- import { defaultAgents } from './chunk-LAO7LRIR.js';
11
- import { remoteLookupFailed } from './chunk-TTPOEZFE.js';
10
+ import { defaultAgents } from './chunk-XMJNIIPM.js';
11
+ import { remoteLookupFailed } from './chunk-KTZOD7A3.js';
12
12
  import { execFileSync } from 'child_process';
13
13
  import { lstatSync } from 'fs';
14
14
  import { join, relative } from 'path';
@@ -3,7 +3,7 @@ import { createRequire } from 'node:module';
3
3
  import { recordReportedCost } from './chunk-BKO6JEZI.js';
4
4
  import { cliInvocation } from './chunk-FZKNTIOJ.js';
5
5
  import { decodeWrappedCommand } from './chunk-ZHQC43NH.js';
6
- import { hookCodec } from './chunk-HS45JMDJ.js';
6
+ import { hookCodec } from './chunk-B6W2LW7E.js';
7
7
  import { homeFromEnv } from './chunk-352DHUTP.js';
8
8
  import { readFileSync } from 'fs';
9
9
  import { spawn } from 'child_process';
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
- import { LEGACY_AGENT } from './chunk-JIMISJV2.js';
3
+ import { LEGACY_AGENT } from './chunk-Q7Z6ELTL.js';
4
4
 
5
5
  createRequire(import.meta.url);
6
6
 
@@ -1,11 +1,11 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
- import { summarizeChecks, summaryText, renderDoctorText } from './chunk-DAAZIWK2.js';
4
- import { shellFunctionInstalled, removeShellFunction, installShellFunction, SHELL_FUNCTION_LINE } from './chunk-4KCWAP5L.js';
5
- import { runConnect, hasUncommittedPolicy, commitCommandsFor } from './chunk-24K3CV6P.js';
3
+ import { summarizeChecks, summaryText, renderDoctorText } from './chunk-X7YMKZ7A.js';
4
+ import { shellFunctionInstalled, removeShellFunction, installShellFunction, SHELL_FUNCTION_LINE } from './chunk-23YVVYQC.js';
5
+ import { runConnect, hasUncommittedPolicy, commitCommandsFor } from './chunk-B2WCKRMW.js';
6
6
  import { C } from './chunk-2AM6Z5BP.js';
7
7
  import { cliInvocation } from './chunk-FZKNTIOJ.js';
8
- import { NATIVE_AGENTS, LEGACY_AGENT } from './chunk-JIMISJV2.js';
8
+ import { NATIVE_AGENTS, LEGACY_AGENT } from './chunk-Q7Z6ELTL.js';
9
9
 
10
10
  createRequire(import.meta.url);
11
11
 
@@ -1,14 +1,14 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
- import { sanitizeTerminal } from './chunk-QMC2MM2S.js';
4
- import { isAgentsMdLayout } from './chunk-Y34AHK7R.js';
5
- import { resolveGatewayCredentials, defaultFetch } from './chunk-EOKIUWXY.js';
6
- import { versionAtLeast } from './chunk-F3J4UKBF.js';
3
+ import { sanitizeTerminal } from './chunk-WNFITHNX.js';
4
+ import { machineSkillsState, staleAgentSkills } from './chunk-LOWZZ4QA.js';
5
+ import { isAgentsMdLayout } from './chunk-4SMKP5QI.js';
6
+ import { resolveGatewayCredentials, defaultFetch } from './chunk-FRLGVHJP.js';
7
+ import { versionAtLeast } from './chunk-DJK3IK6K.js';
7
8
  import { findGitDirs } from './chunk-BJ3KTMDH.js';
8
- import { machineSkillsState, staleAgentSkills } from './chunk-SGVMC66D.js';
9
9
  import { cliInvocation } from './chunk-FZKNTIOJ.js';
10
- import { hasSymlinkComponent } from './chunk-K5J7AKRL.js';
11
- import { skillDir, emitTree, targetIds, classifyTree, emitBuilders, AGENTS_SKILLS_BASE, defaultAgents, namesCore, MACHINE_SKILL_PATH, skillBases, isMaintainedCopy, contextAgents, loadTemplateFiles, splitRawFile } from './chunk-LAO7LRIR.js';
10
+ import { hasSymlinkComponent } from './chunk-P7WAAN35.js';
11
+ import { skillDir, emitTree, targetIds, classifyTree, emitBuilders, AGENTS_SKILLS_BASE, defaultAgents, namesCore, MACHINE_SKILL_PATH, skillBases, isMaintainedCopy, contextAgents, loadTemplateFiles, splitRawFile } from './chunk-XMJNIIPM.js';
12
12
  import { MAINTAINED_SKILLS } from './chunk-VSBG7MMU.js';
13
13
  import { execFileSync } from 'child_process';
14
14
  import { existsSync, readFileSync, writeFileSync, realpathSync, readdirSync } from 'fs';
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
- import { linkedBranches, setupCommitPaths, commitCommandsFor, ownerAndName } from './chunk-24K3CV6P.js';
4
- import { resolveGatewayCredentials } from './chunk-EOKIUWXY.js';
3
+ import { linkedBranches, setupCommitPaths, commitCommandsFor, ownerAndName } from './chunk-B2WCKRMW.js';
4
+ import { resolveGatewayCredentials } from './chunk-FRLGVHJP.js';
5
5
  import { findGitDirs } from './chunk-BJ3KTMDH.js';
6
6
  import { execFileSync } from 'child_process';
7
7
  import { existsSync, mkdirSync, writeFileSync } from 'fs';
@@ -1,10 +1,9 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
- import { providersOf, credentialEnvPath, credentialNames, credentialForms, runnerAgents, credentialAgent, orList, credentialShapes, strippedVariables, jobAgent, forwardedVariables, MANAGED_KIND } from './chunk-MRM7CQJ3.js';
4
- import { defaultAgents } from './chunk-LAO7LRIR.js';
5
- import { PROVIDERS } from './chunk-JIMISJV2.js';
3
+ import { credentialEnvPath, runnerAgents, credentialNames, credentialForms, credentialAgent, strippedVariables, orList, credentialShapes, managedOfferedAgents, listedAgents, agentsNeedingCredential, judgeAgent, forwardedVariables } from './chunk-QS2O5G64.js';
4
+ import { defaultAgents } from './chunk-XMJNIIPM.js';
6
5
  import { statSync, readFileSync } from 'fs';
7
- import { join } from 'path';
6
+ import { join, basename } from 'path';
8
7
  import { spawn, spawnSync } from 'child_process';
9
8
 
10
9
  createRequire(import.meta.url);
@@ -118,15 +117,40 @@ function holdsGroup(status, gid) {
118
117
  const supplementary = /^Groups:[ \t]*(.*)$/m.exec(status)?.[1]?.trim().split(/\s+/).filter((g) => g !== "") ?? [];
119
118
  return [primary, ...supplementary].some((g) => g !== void 0 && Number(g) === gid);
120
119
  }
120
+ var ENV_LINE = /^\s*(?:export\s+)?([A-Za-z_][A-Za-z0-9_]*)=(.*)$/;
121
+ function envFileValue(raw) {
122
+ const text = raw.trim();
123
+ const quote = text[0];
124
+ if (quote === '"' || quote === "'") {
125
+ const end = text.indexOf(quote, 1);
126
+ if (end === -1) return void 0;
127
+ const rest = text.slice(end + 1).trim();
128
+ return rest === "" || rest.startsWith("#") ? text.slice(1, end) : void 0;
129
+ }
130
+ const comment = /\s#/.exec(text);
131
+ return comment === null ? text : text.slice(0, comment.index).trimEnd();
132
+ }
133
+ function envLines(text) {
134
+ return text.replace(/^\uFEFF/, "").split(/\r?\n/);
135
+ }
121
136
  function parseRunnerEnv(text) {
122
137
  const env = {};
123
- for (const line of text.split("\n")) {
124
- const match = /^\s*(?:export\s+)?([A-Za-z_][A-Za-z0-9_]*)=(.*)$/.exec(line);
138
+ for (const line of envLines(text)) {
139
+ const match = ENV_LINE.exec(line);
125
140
  if (match === null) continue;
126
- env[match[1]] = match[2].trim().replace(/^(["'])(.*)\1$/, "$2");
141
+ const value = envFileValue(match[2]);
142
+ if (value !== void 0) env[match[1]] = value;
127
143
  }
128
144
  return env;
129
145
  }
146
+ function unreadableEnvLines(text) {
147
+ return envLines(text).flatMap((line, index) => {
148
+ const trimmed = line.trim();
149
+ if (trimmed === "" || trimmed.startsWith("#")) return [];
150
+ const match = ENV_LINE.exec(line);
151
+ return match !== null && envFileValue(match[2]) !== void 0 ? [] : [index + 1];
152
+ });
153
+ }
130
154
  function credentialNames2(env, agents) {
131
155
  const set = parseRunnerEnv(env ?? "");
132
156
  return forwardedVariables(agents).filter((name) => (set[name] ?? "").trim() !== "");
@@ -147,6 +171,7 @@ function inspectService(unit, configDir, probes, agents = defaultAgents()) {
147
171
  const systemd = Number(/^systemd (\d+)/.exec(probes.systemctlVersion?.() ?? "")?.[1]);
148
172
  const kvm = probes.kvmGid();
149
173
  const credentialFile = credentialEnvPath(join(configDir, "config.json"), agents);
174
+ const agentFiles = runnerAgents(agents).map((agent) => join(configDir, credentialNames(agent.descriptor).envFile));
150
175
  const sliceMemory = Number(new RegExp(`(?:^|\\s)${BUILD_SLICE_MEMORY_ENV}=(\\d+)(?:\\s|$)`).exec(property(shown, "Environment") ?? "")?.[1]);
151
176
  return {
152
177
  unit,
@@ -158,7 +183,7 @@ function inspectService(unit, configDir, probes, agents = defaultAgents()) {
158
183
  ...environ === void 0 ? {} : { startedWithStore: startedWithStore(environ) },
159
184
  ...systemd > 0 ? { systemdVersion: systemd } : {},
160
185
  // The credential file first, where the service loads the credential from; `runner.env` holds one that was never moved.
161
- credentialVariables: [.../* @__PURE__ */ new Set([...credentialNames2(credentialFile === void 0 ? void 0 : probes.readFile(credentialFile), agents), ...credentialNames2(probes.readFile(join(configDir, "runner.env")), agents)])]
186
+ credentialVariables: [.../* @__PURE__ */ new Set([...credentialNames2(credentialFile === void 0 ? void 0 : probes.readFile(credentialFile), agents), ...agentFiles.filter((file) => file !== credentialFile).flatMap((file) => credentialNames2(probes.readFile(file), agents)), ...credentialNames2(probes.readFile(join(configDir, "runner.env")), agents)])]
162
187
  };
163
188
  }
164
189
  function realInspectProbes() {
@@ -189,36 +214,60 @@ function realInspectProbes() {
189
214
  }
190
215
 
191
216
  // src/runner/agent-credential.ts
217
+ var readFrom = /* @__PURE__ */ new WeakMap();
192
218
  function agentOf(agentId, agents) {
193
219
  return runnerAgents(agents).find((agent) => agent.descriptor.id === agentId);
194
220
  }
195
- function firstOf(agent, values, source) {
196
- const found = agent.credentials.classify(values);
197
- return found === void 0 ? void 0 : { variable: found.variable, value: values[found.variable], source };
221
+ var OPENAI_ONLY_PREFIXES = ["sk-proj-", "sk-svcacct-", "sk-admin-"];
222
+ function wrongKind(variable, raw, agent, agents) {
223
+ const own = agent.descriptor.credentials.kinds[variable];
224
+ const value = envFileValue(raw) ?? raw.trim().replace(/^["']/, "");
225
+ if (own === void 0 || new RegExp(own.pattern).test(value)) return false;
226
+ if (own.provider !== "openai" && OPENAI_ONLY_PREFIXES.some((prefix) => value.startsWith(prefix))) return true;
227
+ return runnerAgents(agents).some(
228
+ (other) => Object.values(other.descriptor.credentials.kinds).some(
229
+ (kind) => kind.starts !== "" && !own.starts.startsWith(kind.starts) && (kind.provider !== own.provider || kind.providerKind !== own.providerKind) && (new RegExp(kind.pattern).test(value) || value.startsWith(kind.starts))
230
+ )
231
+ );
232
+ }
233
+ function firstOf(agent, values, source, agents, path, rejected) {
234
+ for (const variable of agent.descriptor.credentials.forwarded) {
235
+ const value = values[variable];
236
+ if (value === void 0 || value === "") continue;
237
+ if (wrongKind(variable, value.trim(), agent, agents)) {
238
+ rejected?.push({ variable, path: path ?? "" });
239
+ continue;
240
+ }
241
+ const read = { variable, value, source };
242
+ if (path !== void 0) readFrom.set(read, path);
243
+ return read;
244
+ }
245
+ return void 0;
198
246
  }
199
- function readCredentialFiles(configDir, agent) {
247
+ function readCredentialFiles(configDir, agent, agents, rejected) {
200
248
  for (const name of [credentialNames(agent.descriptor).envFile, "runner.env"]) {
201
249
  const path = join(configDir, name);
202
250
  try {
203
- const found = firstOf(agent, parseRunnerEnv(readFileSync(path, "utf8")), "credential-file");
251
+ const found = firstOf(agent, parseRunnerEnv(readFileSync(path, "utf8")), "credential-file", agents, path, rejected);
204
252
  if (found !== void 0) return found;
205
253
  } catch {
206
254
  }
207
255
  }
208
256
  return void 0;
209
257
  }
210
- function readAgentCredential(env, agentId, agents = defaultAgents(), configDir) {
258
+ function readAgentCredential(env, agentId, agents = defaultAgents(), configDir, rejected) {
211
259
  const agent = agentOf(agentId, agents);
212
260
  if (agent === void 0) return void 0;
213
- const fromEnvironment = firstOf(agent, env, "environment");
261
+ const fromEnvironment = firstOf(agent, env, "environment", agents, void 0, rejected);
214
262
  if (fromEnvironment !== void 0) return fromEnvironment;
215
263
  const directory = env.CREDENTIALS_DIRECTORY;
216
- if (directory === void 0 || directory === "") return configDir === void 0 ? void 0 : readCredentialFiles(configDir, agent);
264
+ if (directory === void 0 || directory === "") return configDir === void 0 ? void 0 : readCredentialFiles(configDir, agent, agents, rejected);
217
265
  const path = join(directory, credentialNames(agent.descriptor).credentialId);
218
266
  try {
219
267
  const text = readFileSync(path, "utf8");
220
- const found = firstOf(agent, parseRunnerEnv(text), "credentials-directory");
221
- if (found === void 0 && text.trim() !== "") {
268
+ const before = rejected?.length ?? 0;
269
+ const found = firstOf(agent, parseRunnerEnv(text), "credentials-directory", agents, path, rejected);
270
+ if (found === void 0 && text.trim() !== "" && (rejected?.length ?? 0) === before) {
222
271
  const { label, variables } = credentialForms(agent.descriptor);
223
272
  complain(path, label, `it sets neither ${variables.join(" nor ")}, each as NAME=value`);
224
273
  }
@@ -230,15 +279,11 @@ function readAgentCredential(env, agentId, agents = defaultAgents(), configDir)
230
279
  }
231
280
  function agentCredentialVariablesSet(env, options = {}, agents = defaultAgents()) {
232
281
  const found = /* @__PURE__ */ new Set();
233
- const covered = /* @__PURE__ */ new Set();
234
282
  for (const agent of runnerAgents(agents)) {
235
283
  const add = (values) => {
236
284
  for (const variable of agent.descriptor.credentials.forwarded) if ((values[variable] ?? "") !== "") found.add(variable);
237
285
  };
238
286
  add(env);
239
- const shared = agent.descriptor.credentials.forwarded.every((variable) => covered.has(variable));
240
- for (const variable of agent.descriptor.credentials.forwarded) covered.add(variable);
241
- if (shared) continue;
242
287
  const directory = env.CREDENTIALS_DIRECTORY;
243
288
  if (directory) {
244
289
  try {
@@ -260,21 +305,47 @@ function complain(path, label, reason) {
260
305
  }
261
306
  var heldCopies = /* @__PURE__ */ new Map();
262
307
  var removedValues = /* @__PURE__ */ new Set();
263
- function holdAgentCredentials(env = process.env, agents = defaultAgents(), configDir) {
308
+ function readBorrowedCredential(env, agent, agents, configDir, rejected) {
309
+ const directory = env.CREDENTIALS_DIRECTORY === void 0 || env.CREDENTIALS_DIRECTORY === "" ? void 0 : env.CREDENTIALS_DIRECTORY;
310
+ for (const other of runnerAgents(agents)) {
311
+ if (other.descriptor.id === agent.descriptor.id) continue;
312
+ const names = credentialNames(other.descriptor);
313
+ const paths = [...directory === void 0 ? [] : [join(directory, names.credentialId)], ...configDir === void 0 ? [] : [join(configDir, names.envFile)]];
314
+ for (const path of paths) {
315
+ try {
316
+ const found = firstOf(agent, parseRunnerEnv(readFileSync(path, "utf8")), directory !== void 0 && path.startsWith(directory) ? "credentials-directory" : "credential-file", agents, path, rejected);
317
+ if (found !== void 0) return found;
318
+ } catch {
319
+ }
320
+ }
321
+ }
322
+ return void 0;
323
+ }
324
+ function findAgentCredential(env, agentId, agents = defaultAgents(), configDir) {
325
+ const rejected = [];
326
+ const agent = agentOf(agentId, agents);
327
+ if (agent === void 0) return { found: void 0, foundIn: void 0, rejected };
328
+ const found = readAgentCredential(env, agentId, agents, configDir, rejected) ?? readBorrowedCredential(env, agent, agents, configDir, rejected);
329
+ return { found, foundIn: found === void 0 ? void 0 : readFrom.get(found), rejected: found === void 0 ? rejected : [] };
330
+ }
331
+ function holdAgentCredentials(env = process.env, agents = defaultAgents(), configDir, listed) {
264
332
  const first = credentialAgent(agents);
265
- if (first !== void 0 && !heldCopies.has(first.descriptor.id)) {
266
- const read = readAgentCredential(env, first.descriptor.id, agents, configDir);
267
- if (read !== void 0) heldCopies.set(first.descriptor.id, read);
333
+ for (const agent of runnerAgents(agents).filter((entry) => listed === void 0 || listed.includes(entry.descriptor.id))) {
334
+ if (heldCopies.has(agent.descriptor.id)) continue;
335
+ const { found: read, rejected } = findAgentCredential(env, agent.descriptor.id, agents, configDir);
336
+ if (read !== void 0) heldCopies.set(agent.descriptor.id, read);
337
+ else if (rejected.length > 0) process.stderr.write(`${credentialForms(agent.descriptor, agents).label} holds no credential: ${rejectedCredentialText(credentialForms(agent.descriptor, agents).label, rejected)}
338
+ `);
268
339
  }
269
- for (const name of strippedVariables(agents)) {
340
+ for (const name of strippedVariables(agents, listed)) {
270
341
  const value = env[name];
271
342
  if (value !== void 0 && value !== "") removedValues.add(value);
272
343
  delete env[name];
273
344
  }
274
345
  return first === void 0 ? void 0 : heldCopies.get(first.descriptor.id);
275
346
  }
276
- function takeAgentCredentials(env, hooks, agents = defaultAgents(), configDir) {
277
- return /^builtin:(container|vm|sandbox)$/.test(hooks.provision) ? holdAgentCredentials(env, agents, configDir) : void 0;
347
+ function takeAgentCredentials(env, hooks, agents = defaultAgents(), configDir, listed) {
348
+ return /^builtin:(container|vm|sandbox)$/.test(hooks.provision) ? holdAgentCredentials(env, agents, configDir, listed) : void 0;
278
349
  }
279
350
  function removedAgentCredentialValues() {
280
351
  return [...removedValues];
@@ -285,16 +356,102 @@ function heldAgentCredential(agentId) {
285
356
  function currentAgentCredential(env, agentId, agents = defaultAgents()) {
286
357
  return heldCopies.get(agentId) ?? readAgentCredential(env, agentId, agents);
287
358
  }
359
+ function credentialForAgent(env, agentId, agents = defaultAgents()) {
360
+ const agent = agentOf(agentId, agents);
361
+ if (agent === void 0) return void 0;
362
+ const own = currentAgentCredential(env, agentId, agents);
363
+ if (own !== void 0) return own;
364
+ const { forwarded } = agent.descriptor.credentials;
365
+ for (const other of runnerAgents(agents)) {
366
+ if (other.descriptor.id === agentId) continue;
367
+ const copy = currentAgentCredential(env, other.descriptor.id, agents);
368
+ if (copy !== void 0 && forwarded.includes(copy.variable)) return copy;
369
+ }
370
+ return void 0;
371
+ }
288
372
  function jobCredentialProblem(agent, env, agents = defaultAgents()) {
289
373
  const owner = credentialAgent(agents);
290
- if (owner === void 0 || agent.descriptor.id === owner.descriptor.id || agent.adapter.credentials === void 0) return void 0;
291
- const held = currentAgentCredential(env, owner.descriptor.id, agents);
374
+ if (owner === void 0 || agent.adapter.credentials === void 0) return void 0;
375
+ if (credentialForAgent(env, agent.descriptor.id, agents) !== void 0) return void 0;
376
+ const held = owner === void 0 ? void 0 : currentAgentCredential(env, owner.descriptor.id, agents);
292
377
  const { forwarded } = agent.descriptor.credentials;
293
- if (held !== void 0 && forwarded.includes(held.variable)) return void 0;
294
378
  const { runnerName } = credentialForms(agent.descriptor, agents);
295
379
  const needs = orList(credentialShapes(agent.descriptor).map((shape) => shape.phrase));
296
380
  return `${agent.descriptor.label} needs ${needs} in ${forwarded.join(" or ")}, and the runner holds ${held === void 0 ? "no credential" : held.variable}. Run \`outerlayer runner init --agent ${runnerName}\` with ${needs} on stdin.`;
297
381
  }
382
+ function reportedAgents(config, env, agents = defaultAgents()) {
383
+ if (config.fleet === true) return managedOfferedAgents(config, agents);
384
+ const listed = listedAgents(config, agents);
385
+ const own = !/^builtin:(container|vm|sandbox)$/.test(config.hooks.provision);
386
+ if (own) return listed;
387
+ return listed.filter((id) => credentialForAgent(env, id, agents) !== void 0);
388
+ }
389
+ function rejectedCredentialText(label, rejected) {
390
+ const seen = [...new Set(rejected.map((entry) => `${entry.path === "" ? "the environment" : basename(entry.path)} holds a value under ${entry.variable}`))];
391
+ return `${seen.join(" and ")} that is not a kind of credential ${label} takes`;
392
+ }
393
+ function noCredentialSentence(label) {
394
+ return `the runner holds no ${label} credential, so it takes no items that name ${label}`;
395
+ }
396
+ function credentialFilesIn(configDir, agents = defaultAgents()) {
397
+ return [.../* @__PURE__ */ new Set([...runnerAgents(agents).map((agent) => join(configDir, credentialNames(agent.descriptor).envFile)), join(configDir, "runner.env")])];
398
+ }
399
+ function unreadableCredentialLines(configDir, agents = defaultAgents(), read = readOrNothing) {
400
+ return credentialFilesIn(configDir, agents).flatMap((path) => {
401
+ const text = read(path);
402
+ if (text === void 0) return [];
403
+ return unreadableEnvLines(text).map((line) => `${path} line ${line} is not a NAME=value line the runner can read, so the runner skips it`);
404
+ });
405
+ }
406
+ function looseCredentialFiles(configDir, agents = defaultAgents(), modeOf = modeOrNothing) {
407
+ return credentialFilesIn(configDir, agents).flatMap((path) => {
408
+ const mode = modeOf(path);
409
+ if (mode === void 0 || (mode & 63) === 0) return [];
410
+ return [`${path} can be read by other accounts (mode ${(mode & 511).toString(8)}): run chmod 600 ${path}`];
411
+ });
412
+ }
413
+ function readOrNothing(path) {
414
+ try {
415
+ return readFileSync(path, "utf8");
416
+ } catch {
417
+ return void 0;
418
+ }
419
+ }
420
+ function modeOrNothing(path) {
421
+ try {
422
+ return statSync(path).mode;
423
+ } catch {
424
+ return void 0;
425
+ }
426
+ }
427
+ function agentsWithoutCredential(config, env, configDir, agents = defaultAgents()) {
428
+ const own = !/^builtin:(container|vm|sandbox)$/.test(config.hooks.provision);
429
+ if (config.fleet === true || own) return [];
430
+ return runnerAgents(agents).flatMap((agent) => {
431
+ if (!agentsNeedingCredential(config, agents).includes(agent.descriptor.id)) return [];
432
+ const { found, rejected } = findAgentCredential(env, agent.descriptor.id, agents, configDir);
433
+ if (found !== void 0) return [];
434
+ const { label, runnerName, variables } = credentialForms(agent.descriptor, agents);
435
+ return [{ id: agent.descriptor.id, label, runnerName, variables, rejected }];
436
+ });
437
+ }
438
+ function judgeWithoutCredential(config, env, configDir, agents = defaultAgents()) {
439
+ const own = !/^builtin:(container|vm|sandbox)$/.test(config.hooks.provision);
440
+ if (config.fleet === true || own) return void 0;
441
+ const needing = agentsNeedingCredential(config, agents);
442
+ const judge = needing.map((id) => judgeAgent(agents, { agent: id })).find((candidate) => candidate !== void 0 && !needing.includes(candidate.descriptor.id));
443
+ if (judge === void 0 || judge.adapter.credentials === void 0) return void 0;
444
+ const { found, rejected } = findAgentCredential(env, judge.descriptor.id, agents, configDir);
445
+ if (found !== void 0) return void 0;
446
+ const { label, runnerName, variables } = credentialForms(judge.descriptor, agents);
447
+ const fix = `pipe a ${label} credential to \`outerlayer runner init --agent ${runnerName}\`, which adds ${label} to the agents the runner offers`;
448
+ return { id: judge.descriptor.id, label, runnerName, variables, rejected, fix };
449
+ }
450
+ function resetHeldAgentCredentials() {
451
+ heldCopies.clear();
452
+ removedValues.clear();
453
+ complained.clear();
454
+ }
298
455
  var SETS = /^\s*(?:export\s+)?([A-Za-z_][A-Za-z0-9_]*)=/;
299
456
  function credentialLineIn(text, agents = defaultAgents()) {
300
457
  const set = parseRunnerEnv(text);
@@ -317,144 +474,4 @@ function withoutCredentialLines(text, agents = defaultAgents()) {
317
474
  `;
318
475
  }
319
476
 
320
- // src/runner/builtin-destinations.ts
321
- var GATEWAY_DESTINATION = "gateway";
322
- var GATEWAY_PORT = 3126;
323
- var GATEWAY_SOCKET = "gateway.sock";
324
- function builtInNames(agents = defaultAgents(), providers = PROVIDERS) {
325
- return [GATEWAY_DESTINATION, ...providersOf(agents, providers).map((provider) => provider.destination.name)];
326
- }
327
- builtInNames();
328
- function providerDestinations(agents = defaultAgents(), providers = PROVIDERS) {
329
- return providersOf(agents, providers).map((provider) => provider.destination);
330
- }
331
- function destinationPort(name, agents = defaultAgents(), providers = PROVIDERS) {
332
- return name === GATEWAY_DESTINATION ? GATEWAY_PORT : providerDestinations(agents, providers).find((destination) => destination.name === name)?.port ?? GATEWAY_PORT;
333
- }
334
- function primaryDestination(agents = defaultAgents(), providers = PROVIDERS) {
335
- return providerDestinations(agents, providers)[0];
336
- }
337
- var AGENT_CREDENTIAL_MISSING = "agent_credential_missing";
338
- var ITEM_KEY_PLACEHOLDER = "olitem_placeholder-not-a-real-key";
339
- var RUN_KEY_PLACEHOLDER = "olrun_placeholder-not-a-real-key";
340
- var ITEM_KEY_VARIABLE = "OUTERLAYER_ITEM_KEY";
341
- function agentCredential(hostEnv, options = {}, agents = defaultAgents()) {
342
- const agent = credentialAgent(agents);
343
- if (agent === void 0) return void 0;
344
- const id = agent.descriptor.id;
345
- const credential = options.ignoreHeld === true ? readAgentCredential(hostEnv, id, agents) : currentAgentCredential(hostEnv, id, agents);
346
- if (credential === void 0) return void 0;
347
- return { variable: credential.variable, placeholder: agent.descriptor.credentials.placeholders[credential.variable] };
348
- }
349
- function variableOfKind(agent, provider, kind) {
350
- const { forwarded, kinds } = agent.descriptor.credentials;
351
- return forwarded.find((variable) => kinds[variable]?.provider === provider.id && kinds[variable].providerKind === kind);
352
- }
353
- function managedAgentCredential(agents = defaultAgents(), providers = PROVIDERS) {
354
- const agent = credentialAgent(agents);
355
- const provider = providersOf(agents, providers)[0];
356
- if (agent === void 0 || provider === void 0) return void 0;
357
- const variable = variableOfKind(agent, provider, MANAGED_KIND);
358
- return { variable, placeholder: agent.descriptor.credentials.placeholders[variable] };
359
- }
360
- function gatewayUpstream(gatewayUrl) {
361
- return `${new URL(gatewayUrl).origin}/`;
362
- }
363
- function forwardedEnvironment(hostEnv, agent, agents) {
364
- const env = {};
365
- for (const name of agent.descriptor.credentials.forwarded) {
366
- Object.defineProperty(env, name, {
367
- enumerable: true,
368
- get: () => {
369
- const current = currentAgentCredential(hostEnv, agent.descriptor.id, agents);
370
- return current !== void 0 && current.variable === name ? current.value : hostEnv[name];
371
- }
372
- });
373
- }
374
- return env;
375
- }
376
- function providerDestination(provider, input, managedKey, agents) {
377
- const owner = runnerAgents(agents).find((agent) => agent.descriptor.providers.includes(provider.id));
378
- const managed = managedKey !== void 0 && managedKey !== "" && owner.descriptor.id === credentialAgent(agents).descriptor.id;
379
- const held = managed ? void 0 : currentAgentCredential(input.hostEnv, owner.descriptor.id, agents);
380
- const variable = managed ? variableOfKind(owner, provider, MANAGED_KIND) : held?.variable ?? owner.descriptor.credentials.forwarded[0];
381
- const kind = provider.credentialKinds.find((candidate) => candidate.id === owner.descriptor.credentials.kinds[variable].providerKind);
382
- return {
383
- destination: {
384
- name: provider.destination.name,
385
- upstream: input.upstreams?.[provider.id] ?? provider.upstream,
386
- header: { name: kind.header, value: `${kind.prefix}\${${variable}}`, variables: [variable] },
387
- env: {}
388
- },
389
- hostEnv: managed ? { [variable]: managedKey } : forwardedEnvironment(input.hostEnv, owner, agents),
390
- // A build's own key in either header would sit beside the runner's, and the upstream takes one of them.
391
- drop: [...provider.droppedHeaders],
392
- socket: provider.destination.socket
393
- };
394
- }
395
- function builtInDestinations(input, agents = defaultAgents(), providers = PROVIDERS) {
396
- const { claudeApiKey: managedKey } = input;
397
- return [
398
- {
399
- destination: {
400
- name: GATEWAY_DESTINATION,
401
- upstream: gatewayUpstream(input.gatewayUrl),
402
- header: { name: "Authorization", value: `Bearer \${${ITEM_KEY_VARIABLE}}`, variables: [ITEM_KEY_VARIABLE] },
403
- env: {}
404
- },
405
- hostEnv: input.itemKey === void 0 ? {} : { [ITEM_KEY_VARIABLE]: input.itemKey },
406
- drop: [],
407
- socket: GATEWAY_SOCKET
408
- },
409
- ...providersOf(agents, providers).map((provider) => providerDestination(provider, input, managedKey, agents))
410
- ];
411
- }
412
- function builtInEnvironment(localFor, credential, agents = defaultAgents(), providers = PROVIDERS, job, run2 = false) {
413
- const agent = job === void 0 ? credentialAgent(agents)?.credentials : jobAgent(job, agents)?.adapter.credentials;
414
- return {
415
- OUTERLAYER_URL: localFor(GATEWAY_DESTINATION),
416
- OUTERLAYER_API_KEY: run2 ? RUN_KEY_PLACEHOLDER : ITEM_KEY_PLACEHOLDER,
417
- ...agent === void 0 ? {} : agent.buildEnvironment({ providerUrl: (id) => localFor(providers[id].destination.name), variable: credential?.variable })
418
- };
419
- }
420
-
421
- // src/runner/container/relay-protocol.ts
422
- var RELAY_USER = "ol-relay";
423
- var RELAY_ID = 60100;
424
- var JOIN_DIR = "/run/outerlayer-relay";
425
- var JOIN_SOCKET = `${JOIN_DIR}/join.sock`;
426
- var MAX_OPEN_STREAMS = 1024;
427
- var JOIN_WAIT_MS = 3e4;
428
- var MAX_MALFORMED_SESSIONS = 5;
429
- var STREAM_WINDOW = 256 * 1024;
430
- var SESSION_WINDOW = MAX_OPEN_STREAMS * STREAM_WINDOW;
431
- var STREAM_RESET_BURST = 10 * MAX_OPEN_STREAMS;
432
- var STREAM_RESET_RATE = 1e3;
433
- var TARGET_TUNNEL = "tunnel";
434
- var TARGET_GATEWAY = "gateway";
435
- var TARGET_LEASE = "lease";
436
- function destinationTarget(index) {
437
- return `destination/${index}`;
438
- }
439
- function targetOfPath(path, builtIns = builtInNames()) {
440
- if (path === void 0 || !path.startsWith("/")) return void 0;
441
- const target = path.slice(1);
442
- if ([TARGET_TUNNEL, TARGET_LEASE, ...builtIns].includes(target)) return target;
443
- return /^destination\/\d{1,4}$/.test(target) ? target : void 0;
444
- }
445
- var MALFORMED_REASON = `the build broke its connection to the runner ${MAX_MALFORMED_SESSIONS} times`;
446
- var UNKNOWN_TRANSPORT_REASON = "the runner cannot tell how this build reaches it";
447
- var COMMAND_LOST_REASON = "the build's command ended without recording an exit code";
448
- var CONTAINER_STOPPED_REASON = "the build's container stopped while no runner was managing it";
449
- var UNKNOWN_TRACKING_REASON = "the runner cannot tell how this build is tracked";
450
- var DOCKER_DESKTOP_REASON = "Docker Desktop is accepted only for a runner in the runner image, so container builds here need Docker Engine: install it (on Windows, inside WSL2), or run the runner image";
451
- var RUNNER_WORDED_REASONS = /* @__PURE__ */ new Set([
452
- MALFORMED_REASON,
453
- UNKNOWN_TRANSPORT_REASON,
454
- COMMAND_LOST_REASON,
455
- CONTAINER_STOPPED_REASON,
456
- UNKNOWN_TRACKING_REASON,
457
- DOCKER_DESKTOP_REASON
458
- ]);
459
-
460
- export { AGENT_CREDENTIAL_MISSING, BUILD_SLICE_MEMORY_ENV, COMMAND_LOST_REASON, CONTAINER_STOPPED_REASON, DOCKER_DESKTOP_REASON, FD_SLOTS_PER_BUILD, FD_STORE_ENV, GATEWAY_PORT, GATEWAY_SOCKET, JOIN_DIR, JOIN_SOCKET, JOIN_WAIT_MS, MALFORMED_REASON, MAX_MALFORMED_SESSIONS, MAX_OPEN_STREAMS, MIN_SYSTEMD, RELAY_ID, RELAY_USER, RUNNER_WORDED_REASONS, SESSION_WINDOW, STREAM_RESET_BURST, STREAM_RESET_RATE, STREAM_WINDOW, TARGET_GATEWAY, TARGET_LEASE, TARGET_TUNNEL, UNKNOWN_TRACKING_REASON, UNKNOWN_TRANSPORT_REASON, agentCredential, agentCredentialVariablesSet, builtInDestinations, builtInEnvironment, builtInNames, credentialLineIn, currentAgentCredential, destinationPort, destinationTarget, fdName, heldAgentCredential, inspectService, jobCredentialProblem, managedAgentCredential, parseRunnerEnv, primaryDestination, providerDestinations, readAgentCredential, realFdStorePort, realInspectProbes, removedAgentCredentialValues, takeAgentCredentials, targetOfPath, withoutCredentialLines };
477
+ export { BUILD_SLICE_MEMORY_ENV, FD_SLOTS_PER_BUILD, FD_STORE_ENV, MIN_SYSTEMD, agentCredentialVariablesSet, agentsWithoutCredential, credentialForAgent, credentialLineIn, currentAgentCredential, fdName, findAgentCredential, heldAgentCredential, holdAgentCredentials, inspectService, jobCredentialProblem, judgeWithoutCredential, looseCredentialFiles, noCredentialSentence, parseRunnerEnv, readAgentCredential, realFdStorePort, realInspectProbes, rejectedCredentialText, removedAgentCredentialValues, reportedAgents, resetHeldAgentCredentials, takeAgentCredentials, unreadableCredentialLines, withoutCredentialLines };
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
- import { BUILD_HOME } from './chunk-UHGU2EAK.js';
3
+ import { BUILD_HOME } from './chunk-WRIQGJKT.js';
4
4
  import { readdirSync } from 'fs';
5
5
  import { join, dirname } from 'path';
6
6