@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,137 +0,0 @@
1
- #!/usr/bin/env node
2
- import { createRequire } from 'node:module';
3
- import { rewriteControlPlanePaths, rewriteAgentsFilePaths, SUPPORTED_CONTROL_PLANE_LAYOUT, rewriteHookCommand } from './chunk-HCVLP7XA.js';
4
- import { MAINTAINED_SKILLS } from './chunk-CDDED64E.js';
5
- import { existsSync, mkdirSync, copyFileSync, lstatSync, readdirSync, writeFileSync, readFileSync } from 'fs';
6
- import { join, dirname } from 'path';
7
-
8
- createRequire(import.meta.url);
9
- function deliverySection(dir) {
10
- return `This repository's control plane is not in the checkout. Its files are in \`${dir}\`. When the instructions name a file under \`.agents/\` that this directory holds, or a path under \`.outerlayer/\` or \`.claude/\`, read it under \`${dir}\`.`;
11
- }
12
- function isFile(path) {
13
- try {
14
- return lstatSync(path).isFile();
15
- } catch {
16
- return false;
17
- }
18
- }
19
- function filesUnder(dir, base = dir) {
20
- if (!existsSync(dir) || !lstatSync(dir).isDirectory()) return [];
21
- const out = [];
22
- for (const entry of readdirSync(dir, { withFileTypes: true })) {
23
- const abs = join(dir, entry.name);
24
- if (entry.isDirectory()) out.push(...filesUnder(abs, base));
25
- else if (entry.isFile()) out.push(abs.slice(base.length + 1));
26
- }
27
- return out.sort();
28
- }
29
- function readText(path) {
30
- if (!isFile(path)) return void 0;
31
- const content = readFileSync(path);
32
- return content.includes(0) ? void 0 : content.toString("utf8");
33
- }
34
- function deliveredSettings(raw, dir) {
35
- if (raw === void 0) return "{}\n";
36
- const rewrite = (value) => {
37
- if (typeof value === "string") return rewriteHookCommand(value, dir);
38
- if (Array.isArray(value)) return value.map(rewrite);
39
- if (typeof value === "object" && value !== null) return Object.fromEntries(Object.entries(value).map(([key, inner]) => [key, rewrite(inner)]));
40
- return value;
41
- };
42
- try {
43
- return `${JSON.stringify(rewrite(JSON.parse(raw)), null, 2)}
44
- `;
45
- } catch {
46
- return rewriteHookCommand(raw, dir);
47
- }
48
- }
49
- function composeDelivery(input) {
50
- const { tree, dir } = input;
51
- const added = [];
52
- const put = (rel, content) => {
53
- mkdirSync(dirname(join(tree, rel)), { recursive: true });
54
- writeFileSync(join(tree, rel), content);
55
- added.push(rel);
56
- };
57
- for (const skill of MAINTAINED_SKILLS) {
58
- for (const rel of filesUnder(join(tree, ".outerlayer/skills", skill))) {
59
- const target = `.claude/skills/${skill}/${rel}`;
60
- if (existsSync(join(tree, target))) continue;
61
- mkdirSync(dirname(join(tree, target)), { recursive: true });
62
- copyFileSync(join(tree, ".outerlayer/skills", skill, rel), join(tree, target));
63
- added.push(target);
64
- }
65
- }
66
- const agentSkills = join(tree, ".agents/skills");
67
- if (existsSync(agentSkills) && lstatSync(agentSkills).isDirectory()) {
68
- for (const entry of readdirSync(agentSkills, { withFileTypes: true })) {
69
- if (!entry.isDirectory() || existsSync(join(tree, ".claude/skills", entry.name))) continue;
70
- for (const rel of filesUnder(join(agentSkills, entry.name))) {
71
- const target = `.claude/skills/${entry.name}/${rel}`;
72
- mkdirSync(dirname(join(tree, target)), { recursive: true });
73
- copyFileSync(join(agentSkills, entry.name, rel), join(tree, target));
74
- added.push(target);
75
- }
76
- }
77
- }
78
- for (const rel of [...filesUnder(join(tree, ".claude/skills"), tree), ...filesUnder(join(tree, ".claude/agents"), tree)]) {
79
- const text = readText(join(tree, rel));
80
- if (text === void 0) continue;
81
- const rewritten = rewriteControlPlanePaths(text, dir);
82
- if (rewritten !== text) writeFileSync(join(tree, rel), rewritten);
83
- }
84
- const agents = readText(join(tree, "AGENTS.md"));
85
- const instructions = agents === void 0 ? void 0 : rewriteAgentsFilePaths(rewriteControlPlanePaths(agents, dir), dir, (path) => isFile(join(tree, path)));
86
- put("CLAUDE.md", instructions === void 0 ? `${deliverySection(dir)}
87
- ` : `${deliverySection(dir)}
88
-
89
- ${instructions}`);
90
- put("settings.json", deliveredSettings(readText(join(tree, ".claude/settings.json")), dir));
91
- return added;
92
- }
93
- function sharedSkillNames(tree) {
94
- const dir = join(tree, ".claude/skills");
95
- if (!existsSync(dir)) return [];
96
- return readdirSync(dir, { withFileTypes: true }).filter((entry) => entry.isDirectory()).map((entry) => entry.name).sort();
97
- }
98
- function skillConflictMessage(input) {
99
- return `${input.folder}/${input.skill} in ${input.repository} has the same name as the shared skill ${input.skill} from ${input.controlPlane}`;
100
- }
101
- var UNPARSABLE_CONFIG = "unparsable";
102
- function isNewerLayout(declared) {
103
- return /^[1-9][0-9]*$/.test(declared) && Number(declared) > SUPPORTED_CONTROL_PLANE_LAYOUT;
104
- }
105
- function layoutProblem(repository, declared, upgrade) {
106
- if (declared === UNPARSABLE_CONFIG) {
107
- return { what: `the control plane ${repository} has an .outerlayer/config.json that is not valid JSON`, advice: "fix the file" };
108
- }
109
- return {
110
- what: `the control plane ${repository} declares layout ${declared}`,
111
- advice: isNewerLayout(declared) ? `${upgrade} to a version that reads layout ${declared}` : `set "layout" in .outerlayer/config.json to 1 or ${SUPPORTED_CONTROL_PLANE_LAYOUT}`
112
- };
113
- }
114
- function unsupportedLayout(root) {
115
- const text = readText(join(root, ".outerlayer/config.json"));
116
- if (text === void 0) return void 0;
117
- let declared;
118
- try {
119
- declared = JSON.parse(text)?.layout;
120
- } catch {
121
- return UNPARSABLE_CONFIG;
122
- }
123
- if (declared === void 0) return void 0;
124
- if (typeof declared === "number" && Number.isInteger(declared) && declared >= 1 && declared <= SUPPORTED_CONTROL_PLANE_LAYOUT) return void 0;
125
- return JSON.stringify(declared);
126
- }
127
- function layoutRefusalMessage(repository, declared) {
128
- const { what, advice } = layoutProblem(repository, declared, "upgrade the CLI");
129
- return `outerlayer claude: ${what}, and this CLI reads layouts 1 and ${SUPPORTED_CONTROL_PLANE_LAYOUT}; ${advice}
130
- `;
131
- }
132
- function layoutRefusalReason(repository, declared) {
133
- const { what, advice } = layoutProblem(repository, declared, "upgrade the CLI on the runner host");
134
- return `context_layout_unsupported: ${what}, and this runner's CLI reads layouts 1 and ${SUPPORTED_CONTROL_PLANE_LAYOUT}; ${advice}`;
135
- }
136
-
137
- export { composeDelivery, layoutRefusalMessage, layoutRefusalReason, sharedSkillNames, skillConflictMessage, unsupportedLayout };
@@ -1,53 +0,0 @@
1
- #!/usr/bin/env node
2
- import { createRequire } from 'node:module';
3
-
4
- createRequire(import.meta.url);
5
-
6
- // src/control-plane-paths.ts
7
- var CONTROL_PLANE_DIR_VARIABLE = "OUTERLAYER_CONTROL_PLANE_DIR";
8
- var PROJECT_DIR_SPELLINGS = [
9
- /"\$\{?CLAUDE_PROJECT_DIR\}?"\/\.claude(?![\w.-])/g,
10
- /\$\{CLAUDE_PROJECT_DIR\}\/\.claude(?![\w.-])/g,
11
- /\$CLAUDE_PROJECT_DIR\/\.claude(?![\w.-])/g
12
- ];
13
- var CONTROL_PLANE_VARIABLE_FORMS = [
14
- new RegExp(`\\$\\{${CONTROL_PLANE_DIR_VARIABLE}:-[^}]*\\}/\\.claude(?![\\w.-])`, "g"),
15
- new RegExp(`\\$\\{${CONTROL_PLANE_DIR_VARIABLE}\\}/\\.claude(?![\\w.-])`, "g"),
16
- new RegExp(`\\$${CONTROL_PLANE_DIR_VARIABLE}/\\.claude(?![\\w.-])`, "g")
17
- ];
18
- function rewriteHookCommand(command, dir) {
19
- return PROJECT_DIR_SPELLINGS.reduce((text, pattern) => text.replace(pattern, () => `${dir}/.claude`), command);
20
- }
21
- function rewriteControlPlanePaths(text, dir) {
22
- return text.replace(/(?<![\w./~$}:-])(\.outerlayer|\.claude)\//g, (_match, root) => `${dir}/${root}/`);
23
- }
24
- function rewriteAgentsFilePaths(text, dir, holds) {
25
- return text.replace(/(?<![\w./~$}:-])\.agents\/[\w@+./-]*/g, (match) => {
26
- const path = match.replace(/\.+$/, "");
27
- if (path.split("/").includes("..") || !holds(path)) return match;
28
- return `${dir}/${path}${match.slice(path.length)}`;
29
- });
30
- }
31
- function hookCommandEscapesControlPlane(command) {
32
- const remaining = [...PROJECT_DIR_SPELLINGS, ...CONTROL_PLANE_VARIABLE_FORMS].reduce((text, pattern) => text.replace(pattern, " "), command);
33
- return /\.claude(?:\/|["'\s;|&)]|$)/.test(remaining) || /\$\{?CLAUDE_PROJECT_DIR\}?"?\/\.claude/.test(remaining);
34
- }
35
- var GOVERNANCE_VARIABLE = "OUTERLAYER_GOVERNANCE";
36
- var SUPPORTED_CONTROL_PLANE_LAYOUT = 2;
37
- var MINIMUM_CLAUDE_VERSION = "2.1.284";
38
- function versionParts(text) {
39
- const found = /(\d+)\.(\d+)\.(\d+)/.exec(text);
40
- return found === null ? void 0 : [Number(found[1]), Number(found[2]), Number(found[3])];
41
- }
42
- function versionAtLeast(text, minimum = MINIMUM_CLAUDE_VERSION) {
43
- const have = versionParts(text);
44
- const need = versionParts(minimum);
45
- if (have === void 0 || need === void 0) return false;
46
- const difference = have.map((part, i) => part - need[i]).find((delta) => delta !== 0);
47
- return (difference ?? 0) >= 0;
48
- }
49
- var SHIM_SCRIPT = `#!/bin/sh
50
- exec outerlayer claude "$@"
51
- `;
52
-
53
- export { CONTROL_PLANE_DIR_VARIABLE, GOVERNANCE_VARIABLE, MINIMUM_CLAUDE_VERSION, SHIM_SCRIPT, SUPPORTED_CONTROL_PLANE_LAYOUT, hookCommandEscapesControlPlane, rewriteAgentsFilePaths, rewriteControlPlanePaths, rewriteHookCommand, versionAtLeast };
@@ -1,402 +0,0 @@
1
- #!/usr/bin/env node
2
- import { createRequire } from 'node:module';
3
- import { homeFromEnv } from './chunk-352DHUTP.js';
4
- import { existsSync, readFileSync, mkdirSync, copyFileSync, writeFileSync } from 'fs';
5
- import { join, dirname, isAbsolute } from 'path';
6
-
7
- createRequire(import.meta.url);
8
- var REGISTERED_EVENTS = ["SessionStart", "SessionEnd", "Stop", "PostToolUse"];
9
- var MARKER = "_outerlayer";
10
- function settingsPath(scope, opts = {}) {
11
- const home = opts.home ?? homeFromEnv();
12
- const cwd = opts.cwd ?? process.cwd();
13
- return scope === "user" ? join(home, ".claude", "settings.json") : join(cwd, ".claude", "settings.json");
14
- }
15
- var WRAP_MARKER = "_outerlayerWrapped";
16
- function tokenizeCommand(command) {
17
- const tokens = [];
18
- let current = "";
19
- let inToken = false;
20
- let quote = null;
21
- for (const ch of command) {
22
- if (quote !== null) {
23
- if (ch === quote) quote = null;
24
- else current += ch;
25
- } else if (ch === '"' || ch === "'") {
26
- quote = ch;
27
- inToken = true;
28
- } else if (/\s/.test(ch)) {
29
- if (inToken) {
30
- tokens.push(current);
31
- current = "";
32
- inToken = false;
33
- }
34
- } else {
35
- current += ch;
36
- inToken = true;
37
- }
38
- }
39
- if (quote !== null) return null;
40
- if (inToken) tokens.push(current);
41
- return tokens;
42
- }
43
- function quoteBin(bin) {
44
- return /\s/.test(bin) ? `"${bin}"` : bin;
45
- }
46
- function isScriptBin(bin) {
47
- return /\.[cm]?js$/i.test(bin);
48
- }
49
- function cliCommand(cliBin) {
50
- return isScriptBin(cliBin) ? `node ${quoteBin(cliBin)}` : quoteBin(cliBin);
51
- }
52
- var PORTABLE_BIN = "outerlayer";
53
- function isOurBin(bin, cliBin) {
54
- if (cliBin !== void 0 && normalizeBinPath(bin) === normalizeBinPath(cliBin)) return true;
55
- const parts = bin.replace(/\\/g, "/").split("/");
56
- if (isPublishedPackageBin(parts)) return true;
57
- const base = (parts.pop() ?? "").toLowerCase();
58
- if (base === "outerlayer" || base === "outerlayer.exe" || base === "outerlayer.cmd") return true;
59
- return parts.some((p) => p.toLowerCase() === ".outerlayer");
60
- }
61
- function isPublishedPackageBin(parts) {
62
- const n = parts.length;
63
- if (n === 2 && parts[0] === "@outerlayer" && /^cli(@[^/]+)?$/.test(parts[1])) return true;
64
- return parts[n - 4] === "@outerlayer" && parts[n - 3] === "cli" && parts[n - 2] === "dist" && parts[n - 1] === "index.js";
65
- }
66
- function normalizeBinPath(bin) {
67
- return bin.replace(/\\/g, "/");
68
- }
69
- function splitCliInvocation(command, cliBin) {
70
- if (typeof command !== "string") return null;
71
- const tokens = tokenizeCommand(command.trim());
72
- if (!tokens) return null;
73
- const launcher = (tokens[0] ?? "").replace(/\\/g, "/").split("/").pop() ?? "";
74
- const viaNode = launcher === "node" || launcher === "node.exe";
75
- const viaNpx = launcher === "npx";
76
- const i = viaNode || viaNpx ? 1 : 0;
77
- const bin = tokens[i];
78
- if (!bin || !isOurBin(bin, cliBin)) return null;
79
- return { bin, args: tokens.slice(i + 1), viaNpx, viaNode };
80
- }
81
- function parseCliInvocation(command, cliBin) {
82
- return splitCliInvocation(command, cliBin)?.args ?? null;
83
- }
84
- function ourCommandBins(settings) {
85
- return unique(ourCommandLaunches(settings).map((l) => l.bin));
86
- }
87
- function ourDirectScriptBins(settings) {
88
- return unique(ourCommandLaunches(settings).filter((l) => !l.viaNode && isScriptBin(l.bin)).map((l) => l.bin));
89
- }
90
- function ourCommandLaunches(settings) {
91
- const launches = [];
92
- const add = (command) => {
93
- const parsed = splitCliInvocation(command);
94
- if (!parsed || parsed.viaNpx) return;
95
- if (!["hook", "hook-wrap", "statusline"].includes(parsed.args[0] ?? "")) return;
96
- if (parsed.bin.includes("$") || !isAbsolute(parsed.bin)) return;
97
- launches.push({ bin: parsed.bin, viaNode: parsed.viaNode });
98
- };
99
- for (const matchers of Object.values(settings?.hooks ?? {})) {
100
- for (const matcher of matchers ?? []) for (const h of matcher.hooks ?? []) add(h.command);
101
- }
102
- add(settings?.statusLine?.command);
103
- return launches;
104
- }
105
- function unique(values) {
106
- return [...new Set(values)];
107
- }
108
- function parseLifecycleHookCommand(command, cliBin) {
109
- const args = parseCliInvocation(command, cliBin);
110
- if (!args || args.length !== 2 || args[0] !== "hook") return null;
111
- return REGISTERED_EVENTS.includes(args[1]) ? args[1] : null;
112
- }
113
- function decodeVerifiedWrapId(token) {
114
- if (typeof token !== "string") return null;
115
- const original = decodeWrappedCommand(token);
116
- const canonical = encodeWrappedCommand(original);
117
- return canonical.replace(/=+$/, "") === token.replace(/=+$/, "") ? original : null;
118
- }
119
- function parseWrappedHookCommand(command, cliBin) {
120
- const args = parseCliInvocation(command, cliBin);
121
- if (!args || args[0] !== "hook-wrap" || args[1] !== "--id") return null;
122
- if (args.length === 4 ? args[3] !== "--capture-output" : args.length !== 3) return null;
123
- return decodeVerifiedWrapId(args[2]);
124
- }
125
- function isOurHookCommand(h) {
126
- return isOurHookCommandFor(h, void 0);
127
- }
128
- function isOurHookCommandFor(h, cliBin) {
129
- return h[MARKER] === true || parseLifecycleHookCommand(h.command, cliBin) !== null;
130
- }
131
- function wrappedOriginalCommand(h, cliBin) {
132
- if (typeof h[WRAP_MARKER] === "string") return h[WRAP_MARKER];
133
- return parseWrappedHookCommand(h.command, cliBin);
134
- }
135
- function isWrapped(h, cliBin) {
136
- return wrappedOriginalCommand(h, cliBin) !== null;
137
- }
138
- function cliBinResolvable(cliBin) {
139
- if (!cliBin.includes("/") && !cliBin.includes("\\")) return true;
140
- return existsSync(cliBin);
141
- }
142
- function readSettings(path) {
143
- if (!existsSync(path)) return null;
144
- const text = readFileSync(path, "utf8");
145
- if (text.trim() === "") return {};
146
- try {
147
- return JSON.parse(text);
148
- } catch (err) {
149
- throw new SettingsParseError(path, err);
150
- }
151
- }
152
- var SettingsParseError = class extends Error {
153
- constructor(path, cause) {
154
- super(`refusing to modify ${path}: it is not valid JSON (${cause instanceof Error ? cause.message : cause})`);
155
- this.path = path;
156
- this.cause = cause;
157
- this.name = "SettingsParseError";
158
- }
159
- };
160
- function ourEntry(cliBin, event) {
161
- return {
162
- hooks: [{ type: "command", command: `${cliCommand(cliBin)} hook ${event}`, [MARKER]: true }]
163
- };
164
- }
165
- function pruneOurHooks(blocks, cliBin) {
166
- let removedAny = false;
167
- const kept = blocks.filter((block) => {
168
- const original = block.hooks ?? [];
169
- const remaining = original.filter((h) => !isOurHookCommandFor(h, cliBin));
170
- if (remaining.length !== original.length) {
171
- removedAny = true;
172
- block.hooks = remaining;
173
- }
174
- return remaining.length > 0 || original.length === 0;
175
- });
176
- return { kept, removedAny };
177
- }
178
- function mergeHooks(settings, cliBin) {
179
- const next = settings ? structuredClone(settings) : {};
180
- next.hooks = next.hooks ? { ...next.hooks } : {};
181
- let changed = false;
182
- for (const event of REGISTERED_EVENTS) {
183
- const existing = next.hooks[event] ?? [];
184
- const before = JSON.stringify(existing);
185
- const foreign = pruneOurHooks(existing, cliBin).kept;
186
- const desired = [...foreign, ourEntry(cliBin, event)];
187
- if (before !== JSON.stringify(desired)) changed = true;
188
- next.hooks[event] = desired;
189
- }
190
- return { next, changed };
191
- }
192
- function removeHooks(settings, cliBin) {
193
- const next = settings ? structuredClone(settings) : {};
194
- if (!next.hooks) return { next, changed: false };
195
- let changed = false;
196
- for (const event of Object.keys(next.hooks)) {
197
- const { kept, removedAny } = pruneOurHooks(next.hooks[event] ?? [], cliBin);
198
- if (removedAny) changed = true;
199
- if (kept.length === 0) delete next.hooks[event];
200
- else next.hooks[event] = kept;
201
- }
202
- if (next.hooks && Object.keys(next.hooks).length === 0) delete next.hooks;
203
- return { next, changed };
204
- }
205
- function writeSettings(path, settings, now = Date.now) {
206
- mkdirSync(dirname(path), { recursive: true });
207
- let backupPath;
208
- if (existsSync(path)) {
209
- backupPath = `${path}.bak-${now()}`;
210
- copyFileSync(path, backupPath);
211
- }
212
- writeSettingsPreservingTrailingNewline(path, settings);
213
- return backupPath;
214
- }
215
- function writeSettingsPreservingTrailingNewline(path, settings) {
216
- writeFileSync(path, JSON.stringify(settings, null, 2) + "\n");
217
- }
218
- function encodeWrappedCommand(command) {
219
- return Buffer.from(command, "utf8").toString("base64");
220
- }
221
- function decodeWrappedCommand(id) {
222
- return Buffer.from(id, "base64").toString("utf8");
223
- }
224
- function runsCommand(h) {
225
- return typeof h.command === "string";
226
- }
227
- function listHookCandidates(settings, cliBin) {
228
- const out = [];
229
- const hooks = settings?.hooks ?? {};
230
- for (const event of Object.keys(hooks)) {
231
- (hooks[event] ?? []).forEach((matcher, matcherIndex) => {
232
- matcher.hooks.forEach((h, hookIndex) => {
233
- if (!runsCommand(h) || isOurHookCommandFor(h, cliBin)) return;
234
- const original = wrappedOriginalCommand(h, cliBin);
235
- out.push({
236
- event,
237
- matcherIndex,
238
- hookIndex,
239
- matcher: matcher.matcher,
240
- command: original ?? h.command,
241
- wrapped: original !== null
242
- });
243
- });
244
- });
245
- }
246
- return out;
247
- }
248
- function wrapHookCommand(cliBin, h, opts = {}) {
249
- if (isWrapped(h, cliBin)) return h;
250
- const id = encodeWrappedCommand(h.command);
251
- const flag = opts.captureOutput ? " --capture-output" : "";
252
- return { ...h, command: `${cliCommand(cliBin)} hook-wrap --id ${id}${flag}`, [WRAP_MARKER]: h.command };
253
- }
254
- function unwrapHookCommand(h, cliBin) {
255
- const original = wrappedOriginalCommand(h, cliBin);
256
- if (original === null) return h;
257
- const restored = { ...h, command: original };
258
- delete restored[WRAP_MARKER];
259
- return restored;
260
- }
261
- var AUTO_WRAP_EVENTS = ["PreToolUse", "PostToolUse"];
262
- function wrapHooks(settings, cliBin, opts = {}) {
263
- const next = settings ? structuredClone(settings) : {};
264
- const wrapped = [];
265
- if (!cliBinResolvable(cliBin)) {
266
- return { next, changed: false, wrapped, skippedUnresolvedBin: true };
267
- }
268
- let changed = false;
269
- if (!next.hooks) return { next, changed, wrapped };
270
- for (const event of Object.keys(next.hooks)) {
271
- if (opts.events && !opts.events.includes(event)) continue;
272
- const matchers = next.hooks[event] ?? [];
273
- for (let mi = 0; mi < matchers.length; mi++) {
274
- const matcher = matchers[mi];
275
- for (let hi = 0; hi < matcher.hooks.length; hi++) {
276
- const h = matcher.hooks[hi];
277
- if (!runsCommand(h) || isOurHookCommandFor(h, cliBin) || isWrapped(h, cliBin)) continue;
278
- const candidate = {
279
- event,
280
- matcherIndex: mi,
281
- hookIndex: hi,
282
- matcher: matcher.matcher,
283
- command: h.command,
284
- wrapped: false
285
- };
286
- if (opts.select && !opts.select(candidate)) continue;
287
- matcher.hooks[hi] = wrapHookCommand(cliBin, h, { captureOutput: opts.captureOutput });
288
- wrapped.push(candidate);
289
- changed = true;
290
- }
291
- }
292
- }
293
- return { next, changed, wrapped };
294
- }
295
- function repointWrappedHooks(settings, cliBin) {
296
- const next = settings ? structuredClone(settings) : {};
297
- let changed = false;
298
- if (!next.hooks || !cliBinResolvable(cliBin)) return { next, changed };
299
- for (const matchers of Object.values(next.hooks)) {
300
- for (const matcher of matchers ?? []) {
301
- for (let hi = 0; hi < matcher.hooks.length; hi++) {
302
- const h = matcher.hooks[hi];
303
- const parsed = splitCliInvocation(h.command, cliBin);
304
- if (!parsed || parsed.args[0] !== "hook-wrap") continue;
305
- if (normalizeBinPath(parsed.bin) === normalizeBinPath(cliBin) && parsed.viaNode === isScriptBin(cliBin)) continue;
306
- const original = wrappedOriginalCommand(h, cliBin);
307
- if (original === null) continue;
308
- const flag = parsed.args.includes("--capture-output") ? " --capture-output" : "";
309
- const desired = `${cliCommand(cliBin)} hook-wrap --id ${encodeWrappedCommand(original)}${flag}`;
310
- matcher.hooks[hi] = { ...h, command: desired, [WRAP_MARKER]: original };
311
- changed = true;
312
- }
313
- }
314
- }
315
- return { next, changed };
316
- }
317
- function statuslineCommand(cliBin) {
318
- return `${cliCommand(cliBin)} statusline`;
319
- }
320
- function statuslineWrapCommand(cliBin, original) {
321
- return `${cliCommand(cliBin)} statusline --wrap-id ${encodeWrappedCommand(original)}`;
322
- }
323
- function isOurStatuslineSlot(slot, cliBin) {
324
- if (slot[MARKER] === true) return true;
325
- const args = parseCliInvocation(slot.command, cliBin);
326
- if (!args || args[0] !== "statusline") return false;
327
- return args.length === 1 || statuslineWrappedOriginal(slot, cliBin) !== null;
328
- }
329
- function statuslineWrappedOriginal(slot, cliBin) {
330
- if (typeof slot[WRAP_MARKER] === "string") return slot[WRAP_MARKER];
331
- const args = parseCliInvocation(slot.command, cliBin);
332
- if (!args || args.length !== 3 || args[0] !== "statusline" || args[1] !== "--wrap-id") return null;
333
- return decodeVerifiedWrapId(args[2]);
334
- }
335
- function mergeStatusline(settings, cliBin) {
336
- const next = settings ? structuredClone(settings) : {};
337
- const slot = next.statusLine;
338
- if (slot === void 0 || slot === null) {
339
- next.statusLine = { type: "command", command: statuslineCommand(cliBin), [MARKER]: true };
340
- return { next, changed: true, outcome: "installed" };
341
- }
342
- if (typeof slot !== "object") {
343
- return { next, changed: false, outcome: "skipped" };
344
- }
345
- if (isOurStatuslineSlot(slot, cliBin)) {
346
- const original2 = statuslineWrappedOriginal(slot, cliBin);
347
- const desired = original2 !== null ? statuslineWrapCommand(cliBin, original2) : statuslineCommand(cliBin);
348
- const stripped = slot[MARKER] !== true || original2 !== null && typeof slot[WRAP_MARKER] !== "string";
349
- if (slot.command === desired && !stripped) {
350
- return { next, changed: false, outcome: "unchanged", ...original2 !== null ? { wrappedCommand: original2 } : {} };
351
- }
352
- slot.command = desired;
353
- slot[MARKER] = true;
354
- if (original2 !== null) slot[WRAP_MARKER] = original2;
355
- return { next, changed: true, outcome: "repaired", ...original2 !== null ? { wrappedCommand: original2 } : {} };
356
- }
357
- if (slot.type !== "command" || typeof slot.command !== "string") {
358
- return { next, changed: false, outcome: "skipped" };
359
- }
360
- const original = slot.command;
361
- slot.command = statuslineWrapCommand(cliBin, original);
362
- slot[MARKER] = true;
363
- slot[WRAP_MARKER] = original;
364
- return { next, changed: true, outcome: "wrapped", wrappedCommand: original };
365
- }
366
- function removeStatusline(settings, cliBin) {
367
- const next = settings ? structuredClone(settings) : {};
368
- const slot = next.statusLine;
369
- if (!slot || typeof slot !== "object" || !isOurStatuslineSlot(slot, cliBin)) {
370
- return { next, changed: false };
371
- }
372
- const original = statuslineWrappedOriginal(slot, cliBin);
373
- if (original !== null) {
374
- delete slot[MARKER];
375
- delete slot[WRAP_MARKER];
376
- slot.command = original;
377
- return { next, changed: true, restoredCommand: original };
378
- }
379
- delete next.statusLine;
380
- return { next, changed: true };
381
- }
382
- function unwrapHooks(settings, cliBin) {
383
- const next = settings ? structuredClone(settings) : {};
384
- let changed = false;
385
- let unwrapped = 0;
386
- if (!next.hooks) return { next, changed, unwrapped };
387
- for (const event of Object.keys(next.hooks)) {
388
- const matchers = next.hooks[event] ?? [];
389
- for (const matcher of matchers) {
390
- for (let hi = 0; hi < matcher.hooks.length; hi++) {
391
- const h = matcher.hooks[hi];
392
- if (!isWrapped(h, cliBin)) continue;
393
- matcher.hooks[hi] = unwrapHookCommand(h, cliBin);
394
- unwrapped++;
395
- changed = true;
396
- }
397
- }
398
- }
399
- return { next, changed, unwrapped };
400
- }
401
-
402
- export { AUTO_WRAP_EVENTS, PORTABLE_BIN, REGISTERED_EVENTS, SettingsParseError, cliBinResolvable, cliCommand, decodeWrappedCommand, encodeWrappedCommand, isOurHookCommand, isOurHookCommandFor, isOurStatuslineSlot, isWrapped, listHookCandidates, mergeHooks, mergeStatusline, ourCommandBins, ourDirectScriptBins, parseLifecycleHookCommand, readSettings, removeHooks, removeStatusline, repointWrappedHooks, settingsPath, statuslineCommand, statuslineWrappedOriginal, unwrapHooks, wrapHooks, wrappedOriginalCommand, writeSettings };
@@ -1,45 +0,0 @@
1
- #!/usr/bin/env node
2
- import { createRequire } from 'node:module';
3
-
4
- createRequire(import.meta.url);
5
-
6
- // src/runner/container/relay-protocol.ts
7
- var RELAY_USER = "ol-relay";
8
- var RELAY_ID = 60100;
9
- var JOIN_DIR = "/run/outerlayer-relay";
10
- var JOIN_SOCKET = `${JOIN_DIR}/join.sock`;
11
- var MAX_OPEN_STREAMS = 1024;
12
- var JOIN_WAIT_MS = 3e4;
13
- var MAX_MALFORMED_SESSIONS = 5;
14
- var STREAM_WINDOW = 256 * 1024;
15
- var SESSION_WINDOW = MAX_OPEN_STREAMS * STREAM_WINDOW;
16
- var STREAM_RESET_BURST = 10 * MAX_OPEN_STREAMS;
17
- var STREAM_RESET_RATE = 1e3;
18
- var TARGET_TUNNEL = "tunnel";
19
- var TARGET_GATEWAY = "gateway";
20
- var TARGET_CLAUDE = "claude";
21
- var TARGET_LEASE = "lease";
22
- function destinationTarget(index) {
23
- return `destination/${index}`;
24
- }
25
- function targetOfPath(path) {
26
- if (path === void 0 || !path.startsWith("/")) return void 0;
27
- const target = path.slice(1);
28
- return /^(tunnel|gateway|claude|lease|destination\/\d{1,4})$/.test(target) ? target : void 0;
29
- }
30
- var MALFORMED_REASON = `the build broke its connection to the runner ${MAX_MALFORMED_SESSIONS} times`;
31
- var UNKNOWN_TRANSPORT_REASON = "the runner cannot tell how this build reaches it";
32
- var COMMAND_LOST_REASON = "the build's command ended without recording an exit code";
33
- var CONTAINER_STOPPED_REASON = "the build's container stopped while no runner was managing it";
34
- var UNKNOWN_TRACKING_REASON = "the runner cannot tell how this build is tracked";
35
- 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), run the runner image, or use builtin:process";
36
- var RUNNER_WORDED_REASONS = /* @__PURE__ */ new Set([
37
- MALFORMED_REASON,
38
- UNKNOWN_TRANSPORT_REASON,
39
- COMMAND_LOST_REASON,
40
- CONTAINER_STOPPED_REASON,
41
- UNKNOWN_TRACKING_REASON,
42
- DOCKER_DESKTOP_REASON
43
- ]);
44
-
45
- export { COMMAND_LOST_REASON, CONTAINER_STOPPED_REASON, DOCKER_DESKTOP_REASON, JOIN_DIR, JOIN_SOCKET, JOIN_WAIT_MS, MALFORMED_REASON, MAX_MALFORMED_SESSIONS, MAX_OPEN_STREAMS, RELAY_ID, RELAY_USER, RUNNER_WORDED_REASONS, SESSION_WINDOW, STREAM_RESET_BURST, STREAM_RESET_RATE, STREAM_WINDOW, TARGET_CLAUDE, TARGET_GATEWAY, TARGET_LEASE, TARGET_TUNNEL, UNKNOWN_TRACKING_REASON, UNKNOWN_TRANSPORT_REASON, destinationTarget, targetOfPath };