@outerlayer/cli 0.36.0-next.20261102124202 → 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 (178) hide show
  1. package/dist/agent-setup-Q3HDN23U.js +39 -0
  2. package/dist/agent-subcommand-Z6SOLWZW.js +25 -0
  3. package/dist/{bridge-DFG2GTXQ.js → bridge-4KPODDN7.js} +6 -4
  4. package/dist/{build-THAD3B4Q.js → build-KYXFZQ33.js} +13 -11
  5. package/dist/{build-disk-HO2VPIBJ.js → build-disk-W6AL5WHI.js} +11 -9
  6. package/dist/build-info.json +1 -1
  7. package/dist/{builder-AXJNIF4S.js → builder-IMNOEYV7.js} +10 -8
  8. package/dist/caller-NLRE272L.js +22 -0
  9. package/dist/{check-SF2OVZXB.js → check-WWX32IGY.js} +60 -58
  10. package/dist/{chunk-KN4VIK53.js → chunk-2YC3TXWX.js} +1 -1
  11. package/dist/{chunk-4TNUQLXH.js → chunk-3UFX6KH2.js} +12 -11
  12. package/dist/{chunk-5FIOUQGC.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-OYKAOHX5.js → chunk-4XXBV37R.js} +6 -6
  16. package/dist/{chunk-RSRZDF3K.js → chunk-6B3V6EGQ.js} +11 -9
  17. package/dist/{chunk-XABJMU5A.js → chunk-6HDXRDC5.js} +2 -2
  18. package/dist/{chunk-TWYHSMHM.js → chunk-6JLYU322.js} +3 -2
  19. package/dist/{chunk-5GHJFETA.js → chunk-6KH3NMIT.js} +3010 -1196
  20. package/dist/{chunk-QJDX6VJS.js → chunk-AQE6E54X.js} +10 -9
  21. package/dist/{chunk-564Q2STF.js → chunk-ATKCHMFD.js} +1 -1
  22. package/dist/{chunk-PQDFW422.js → chunk-B2P72DAE.js} +1 -1
  23. package/dist/{chunk-GZ75FRLB.js → chunk-B36NSEUM.js} +1 -1
  24. package/dist/{chunk-XHFSBSIA.js → chunk-B5SWBFVE.js} +3 -2
  25. package/dist/{chunk-NC3QAHOS.js → chunk-BSPJI5T7.js} +4 -2
  26. package/dist/{chunk-I6FRCBMU.js → chunk-BUYXEU7J.js} +8 -8
  27. package/dist/{chunk-A5Y2HBVU.js → chunk-BZSJ77MO.js} +1 -1
  28. package/dist/{chunk-C3JWWPLC.js → chunk-CDG475ZP.js} +8 -7
  29. package/dist/{chunk-TYCZVJTB.js → chunk-CSBW4LGL.js} +5 -5
  30. package/dist/{chunk-EUDG754F.js → chunk-CSVJGW3I.js} +2 -2
  31. package/dist/{chunk-M2NIHHQI.js → chunk-CXJC3JLN.js} +3 -2
  32. package/dist/{chunk-XE3DIJJT.js → chunk-D4VGJQY7.js} +1 -1
  33. package/dist/{chunk-PKO5IDW4.js → chunk-D5I5SSPU.js} +7 -7
  34. package/dist/{chunk-WDQPBAFV.js → chunk-D6EXW4EB.js} +2 -1
  35. package/dist/{chunk-GSXGA6KF.js → chunk-DG3M5DZU.js} +1 -1
  36. package/dist/{chunk-GD6KIHOS.js → chunk-DTCTXDJP.js} +1 -1
  37. package/dist/{chunk-J7Y3PCO2.js → chunk-DTQPDMHG.js} +2 -1
  38. package/dist/{chunk-PT34C6SU.js → chunk-E3TP4QTM.js} +1 -1
  39. package/dist/{chunk-NWBB2SQ4.js → chunk-ENBOAE2W.js} +24 -24
  40. package/dist/{chunk-LSXHTBAM.js → chunk-ENMX3VQ7.js} +7 -7
  41. package/dist/{chunk-XLOM2BNL.js → chunk-FOSYM7TQ.js} +1 -1
  42. package/dist/{chunk-4CTVN3C5.js → chunk-FRMAQ3C4.js} +5 -5
  43. package/dist/{chunk-PTPF36Q7.js → chunk-FTP7SE6Y.js} +3 -3
  44. package/dist/{chunk-IP7BIBXJ.js → chunk-FWSVWPMS.js} +16 -7
  45. package/dist/{chunk-K3X3L5YW.js → chunk-GFZ7PELR.js} +6 -6
  46. package/dist/{chunk-WLMAGMTU.js → chunk-H2NJG3TE.js} +4 -3
  47. package/dist/{chunk-T5Z22NA6.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-CKPQOQFC.js → chunk-I6U6QPN6.js} +769 -101
  51. package/dist/{chunk-6JJITHBI.js → chunk-IKFAJTLZ.js} +1 -1
  52. package/dist/{chunk-FIO6PIZ6.js → chunk-J2OMKFYB.js} +3 -3
  53. package/dist/{chunk-Q42K6XZ6.js → chunk-K2G3VB7W.js} +1 -1
  54. package/dist/{chunk-L3JXQDVH.js → chunk-K7N6LAPC.js} +4 -4
  55. package/dist/{chunk-RK4JQRVT.js → chunk-KRCU66AM.js} +9 -9
  56. package/dist/{chunk-RPZIHELI.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-I626B72C.js → chunk-LSZUTI6O.js} +1 -1
  60. package/dist/{chunk-H2FFONRY.js → chunk-MVPOYQQY.js} +1 -1
  61. package/dist/{chunk-JVCQZDQ6.js → chunk-NXQK2I3G.js} +1 -1
  62. package/dist/{chunk-EBIYRRJW.js → chunk-O3MJAHLI.js} +80 -94
  63. package/dist/{chunk-VRQM4A64.js → chunk-PBGNX3PS.js} +1 -1
  64. package/dist/{chunk-CJJDJ7AT.js → chunk-PIZA7OG2.js} +5 -3
  65. package/dist/{chunk-772ILTCK.js → chunk-PMA67TIN.js} +3 -3
  66. package/dist/{chunk-GDZTL6BI.js → chunk-QKOJ22OV.js} +123 -277
  67. package/dist/{chunk-WNYH42PF.js → chunk-RF4JHGGB.js} +7 -7
  68. package/dist/{chunk-WQB3XOEP.js → chunk-SJJXDU2J.js} +6 -6
  69. package/dist/chunk-T5QBWM6M.js +113 -0
  70. package/dist/{chunk-LYFLUNWK.js → chunk-TJIFYV2Z.js} +7 -7
  71. package/dist/{chunk-OZOATEK3.js → chunk-TKY3SDXH.js} +6 -6
  72. package/dist/{chunk-CVGQ3BNF.js → chunk-ULBYRPAP.js} +1 -1
  73. package/dist/{chunk-LVXR37OG.js → chunk-URHS76GV.js} +9 -8
  74. package/dist/{chunk-J7TCTARR.js → chunk-VAYVTUU4.js} +5 -5
  75. package/dist/{chunk-5FND4PIU.js → chunk-VUH7KKVD.js} +3 -3
  76. package/dist/{chunk-NTMRMBLM.js → chunk-WACPWYMH.js} +4 -4
  77. package/dist/{chunk-AAGU5FJF.js → chunk-WGC7UFRM.js} +1 -1
  78. package/dist/{chunk-XAOIHYPS.js → chunk-WVAXJOWG.js} +5 -4
  79. package/dist/{chunk-6LO62EQ5.js → chunk-XEWG4AB2.js} +28 -28
  80. package/dist/{chunk-AYLYAOHH.js → chunk-XIDDJSQU.js} +3 -2
  81. package/dist/{chunk-ESSJPSJ2.js → chunk-Y4E7IS7H.js} +2 -2
  82. package/dist/{chunk-HIN4BMRW.js → chunk-YJQ7YA7J.js} +5 -5
  83. package/dist/{chunk-LCOQN6NR.js → chunk-YMVRCSKD.js} +4 -4
  84. package/dist/{chunk-JXXHLQQR.js → chunk-YYQ5NOT5.js} +3 -3
  85. package/dist/chunk-ZHQC43NH.js +130 -0
  86. package/dist/{chunk-3FSKTGM6.js → chunk-ZSRMJOAK.js} +3 -3
  87. package/dist/{claude-launcher-LXZPTDNC.js → claude-launcher-LGKJZH33.js} +82 -108
  88. package/dist/{cli-QFUT3UQS.js → cli-Q5L64EEG.js} +323 -293
  89. package/dist/{command-45RZT4CK.js → command-CGEFJZNC.js} +55 -53
  90. package/dist/{config-WYQPXLOP.js → config-T22KVOOT.js} +12 -10
  91. package/dist/{connect-cmd-LUCQ7FSV.js → connect-cmd-RUBP466E.js} +12 -10
  92. package/dist/{container-start-T776VI3M.js → container-start-JRF3SBUA.js} +53 -51
  93. package/dist/{context-cleanup-QE2MIO2Q.js → context-cleanup-3K2AOECJ.js} +4 -2
  94. package/dist/{context-show-cmd-7QEHUOEL.js → context-show-cmd-4UXO5WQJ.js} +13 -11
  95. package/dist/{control-plane-launch-THUH6YU5.js → control-plane-launch-AAH4YH56.js} +25 -21
  96. package/dist/{demo-record-cmd-SBERRQNW.js → demo-record-cmd-2OKCGST7.js} +7 -5
  97. package/dist/{demo-voice-cmd-VM3FITZU.js → demo-voice-cmd-GEPX7GIG.js} +24 -22
  98. package/dist/{dist-6KGTCWKR.js → dist-VVZIGSAF.js} +1 -1
  99. package/dist/{docker-MQNLK4OO.js → docker-5VWK335X.js} +10 -8
  100. package/dist/{doctor-NQOSPJGS.js → doctor-EQM3JRZI.js} +55 -53
  101. package/dist/emit-artifact-cmd-TA3MPHLU.js +43 -0
  102. package/dist/{emit-cmd-ZPFCPVSR.js → emit-cmd-RO4L4PFZ.js} +7 -5
  103. package/dist/emit-criteria-cmd-NMTUV2KM.js +34 -0
  104. package/dist/{emit-demo-cmd-PMQGNNVX.js → emit-demo-cmd-Y2Y6LEL7.js} +24 -22
  105. package/dist/{emit-finding-cmd-MYWQN5WW.js → emit-finding-cmd-VECM64UR.js} +17 -15
  106. package/dist/{emit-result-cmd-GXK3KMAP.js → emit-result-cmd-2ERWFDUN.js} +22 -20
  107. package/dist/{emit-step-cmd-ZV2XTUVT.js → emit-step-cmd-V2ET66N4.js} +17 -15
  108. package/dist/{exec-client-P7RFRUCK.js → exec-client-54XKNPTI.js} +7 -5
  109. package/dist/find-unit-CNAPU7XQ.js +23 -0
  110. package/dist/{findings-cmd-OGMBVVSM.js → findings-cmd-QJPPF6BY.js} +17 -15
  111. package/dist/{fleet-readiness-4RBKLXBQ.js → fleet-readiness-DKAPHAZN.js} +13 -11
  112. package/dist/{governing-source-XJMXFSAR.js → governing-source-7PZ6DAJU.js} +21 -19
  113. package/dist/{guest-init-XZHRPIMG.js → guest-init-5QZRGP62.js} +8 -6
  114. package/dist/{hook-fast-ZOWGWCPO.js → hook-fast-VXROB4KF.js} +4 -2
  115. package/dist/{pending-YU2GE2UV.js → hook-install-GDNRMML4.js} +5 -5
  116. package/dist/{hook-wrap-fast-545QJSBJ.js → hook-wrap-fast-LWWKKPGK.js} +4 -2
  117. package/dist/host-checks-WAPO5X7X.js +78 -0
  118. package/dist/host-key-HLLV37NV.js +16 -0
  119. package/dist/{image-tag-E4JK2APF.js → image-tag-PBWQBATH.js} +7 -5
  120. package/dist/index.js +8 -9
  121. package/dist/init-EK3PUU6W.js +78 -0
  122. package/dist/{init-LO6U7YTW.js → init-Y2URPVVY.js} +51 -49
  123. package/dist/{init-cmd-2JANO5EN.js → init-cmd-XNANUDIW.js} +35 -29
  124. package/dist/{init-update-D6PRTGNE.js → init-update-EFCTKF6D.js} +24 -22
  125. package/dist/{install-cmd-SJMBNQEH.js → install-cmd-RHFUZFV4.js} +9 -7
  126. package/dist/{layout-AQHIMJMO.js → layout-7XMC7S6K.js} +4 -2
  127. package/dist/{logs-NE55HOET.js → logs-E7MGQINH.js} +6 -4
  128. package/dist/loop-L6TX6OR4.js +89 -0
  129. package/dist/machine-VJKAY2GX.js +78 -0
  130. package/dist/{machine-skills-KK2HXYMR.js → machine-skills-HR4RNRNR.js} +4 -2
  131. package/dist/{mcp-install-cmd-2QAS3AQZ.js → mcp-install-cmd-SMPLT43Q.js} +4 -2
  132. package/dist/{mcp-serve-cmd-U6USKHYR.js → mcp-serve-cmd-XXERT673.js} +8 -6
  133. package/dist/{paths-O7LCWY33.js → paths-F2ZR2EKC.js} +6 -4
  134. package/dist/pending-VOFQRXP4.js +16 -0
  135. package/dist/{pidfile-5GDCQ5HA.js → pidfile-7M7O2M7T.js} +7 -5
  136. package/dist/{record-NETSDAO6.js → record-YCJ6DZOY.js} +7 -5
  137. package/dist/{relay-VZ733BVJ.js → relay-I2T43PPB.js} +4 -2
  138. package/dist/{relay-protocol-24GEUGCO.js → relay-protocol-GI2GC2AM.js} +4 -2
  139. package/dist/runner-env-YW55JVU7.js +23 -0
  140. package/dist/{runner-identity-PSCZBILD.js → runner-identity-Y5ZFCC7V.js} +10 -8
  141. package/dist/{runner-key-VM2LYVRK.js → runner-key-R47C6374.js} +51 -49
  142. package/dist/{session-sender-P2RHDM6U.js → session-sender-UPACLRGG.js} +23 -21
  143. package/dist/{shell-function-NRD4KVUK.js → shell-function-GYD2ZQQG.js} +2 -1
  144. package/dist/{spec-cmd-LGKP6MT7.js → spec-cmd-7QRE2SZK.js} +18 -16
  145. package/dist/{starter-pack-SMK6UPRL.js → starter-pack-IMKIUA56.js} +5 -3
  146. package/dist/state-VAHBIMS5.js +16 -0
  147. package/dist/{status-HEHCNIDS.js → status-BQEYEG2V.js} +51 -49
  148. package/dist/{statusline-fast-E7RWVREA.js → statusline-fast-NUVHCNRX.js} +4 -2
  149. package/dist/{sync-cmd-HKN45HXL.js → sync-cmd-NBLYEPQG.js} +22 -20
  150. package/dist/update-steps-VGKNGWTZ.js +79 -0
  151. package/dist/{watch-RGZCUCR3.js → watch-IHV4V3HZ.js} +22 -20
  152. package/dist/{work-claim-cmd-6DSPGCZE.js → work-claim-cmd-WGTSU5IT.js} +21 -19
  153. package/dist/{work-cmd-GPLYLWY7.js → work-cmd-HKOJU5FJ.js} +15 -13
  154. package/dist/{work-comment-cmd-V5WM7LAW.js → work-comment-cmd-H3JCWQ2J.js} +18 -16
  155. package/dist/{work-demo-cmd-SWWI6AGD.js → work-demo-cmd-J4AZAIVP.js} +15 -13
  156. package/dist/{work-launch-TTGSHLY4.js → work-launch-LWDQXLGI.js} +1 -1
  157. package/dist/{work-logs-cmd-CTFBOPCI.js → work-logs-cmd-UOO4JVLG.js} +15 -13
  158. package/dist/{work-open-pr-cmd-HX2U3YBR.js → work-open-pr-cmd-QFRDDBAM.js} +17 -15
  159. package/dist/{work-pr-cmd-EI2R4FQG.js → work-pr-cmd-3Q2D5RQT.js} +16 -14
  160. package/dist/{work-proofs-cmd-QXNPHLYC.js → work-proofs-cmd-7Y3HGT7C.js} +18 -16
  161. package/dist/{work-proofs-record-72OKWEES.js → work-proofs-record-QPUM6DY4.js} +28 -26
  162. package/dist/{work-stop-cmd-7M7ZYUN2.js → work-stop-cmd-SD2ZRMSY.js} +15 -13
  163. package/package.json +1 -1
  164. package/dist/agent-setup-AOB76EDJ.js +0 -37
  165. package/dist/caller-GOY2X6QT.js +0 -20
  166. package/dist/chunk-KYDEBGJG.js +0 -402
  167. package/dist/emit-artifact-cmd-6E365VBQ.js +0 -41
  168. package/dist/emit-criteria-cmd-HWQOYZZ4.js +0 -32
  169. package/dist/find-unit-63SXQ7IM.js +0 -21
  170. package/dist/host-checks-WHW24PJR.js +0 -76
  171. package/dist/host-key-MWLXB5U5.js +0 -14
  172. package/dist/init-EZIAHBMH.js +0 -76
  173. package/dist/loop-2E34CGCX.js +0 -87
  174. package/dist/machine-6ALGG4IO.js +0 -76
  175. package/dist/runner-env-KHCONH2R.js +0 -21
  176. package/dist/settings-XB2HYBKO.js +0 -7
  177. package/dist/state-RJR4PMMX.js +0 -14
  178. package/dist/update-steps-7E4RD47J.js +0 -77
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
- import { hostKeyPath, runnerDir, RUNNER_DIR_MODE, RUNNER_FILE_MODE } from './chunk-GD6KIHOS.js';
3
+ import { hostKeyPath, runnerDir, RUNNER_DIR_MODE, RUNNER_FILE_MODE } from './chunk-DTCTXDJP.js';
4
4
  import { generateKeyPairSync, createPrivateKey, createPublicKey, sign } from 'crypto';
5
5
  import { existsSync, mkdirSync, writeFileSync, readFileSync } from 'fs';
6
6
 
@@ -1,9 +1,9 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
3
  import { startTimeOf } from './chunk-JBJTC3UU.js';
4
- import { EXEC_PORT } from './chunk-WLMAGMTU.js';
5
- import { TUNNEL_PORT, BRIDGE_ADDRESS, BRIDGE_CIDR } from './chunk-KN4VIK53.js';
6
- import { RELAY_PORT } from './chunk-M2NIHHQI.js';
4
+ import { EXEC_PORT } from './chunk-H2NJG3TE.js';
5
+ import { TUNNEL_PORT, BRIDGE_ADDRESS, BRIDGE_CIDR } from './chunk-2YC3TXWX.js';
6
+ import { RELAY_PORT } from './chunk-CXJC3JLN.js';
7
7
  import { spawn, spawnSync } from 'child_process';
8
8
  import { symlinkSync, lstatSync, writeFileSync, chmodSync, mkdirSync, existsSync } from 'fs';
9
9
 
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
- import { RUNNER_DIR_MODE, RUNNER_FILE_MODE } from './chunk-GD6KIHOS.js';
3
+ import { RUNNER_DIR_MODE, RUNNER_FILE_MODE } from './chunk-DTCTXDJP.js';
4
4
  import { readFileSync, mkdirSync, writeFileSync, renameSync } from 'fs';
5
5
  import { join } from 'path';
6
6
 
@@ -1,9 +1,9 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
- import { DEFAULT_UNIT_NAME } from './chunk-TYCZVJTB.js';
4
- import { RUNNER_FILE_MODE } from './chunk-GD6KIHOS.js';
5
- import { runnerAgents, credentialAgent, credentialForms, orList, credentialShapes, credentialEnvPath, withoutCredentialLines, parseRunnerEnv, forwardedVariables } from './chunk-J7Y3PCO2.js';
6
- import { defaultAgents } from './chunk-CKPQOQFC.js';
3
+ import { DEFAULT_UNIT_NAME } from './chunk-CSBW4LGL.js';
4
+ import { RUNNER_FILE_MODE } from './chunk-DTCTXDJP.js';
5
+ import { runnerAgents, credentialAgent, credentialForms, orList, credentialShapes, credentialEnvPath, withoutCredentialLines, parseRunnerEnv, forwardedVariables } from './chunk-DTQPDMHG.js';
6
+ import { defaultAgents } from './chunk-I6U6QPN6.js';
7
7
  import { existsSync, readFileSync, writeFileSync, renameSync, rmSync } from 'fs';
8
8
  import { join, dirname } from 'path';
9
9
 
@@ -1,12 +1,12 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
- import { criteriaOf, loadCitationFinder, hostItemsOf, criterionInputs, NO_CITING_TEST_REASON, NO_TEST_FILES_REASON, NO_VERDICT_REASON, isFoundInReason, uncitedIds, planCriteria, pickSearchable, IdScan, testFileMatcher, foundInReason, MAX_TEST_FILE_BYTES, MAX_TEST_FILES, groupBySize } from './chunk-XLOM2BNL.js';
4
- import { WorkCommandError, resolveCredentials, getJson } from './chunk-QJDX6VJS.js';
5
- import { C } from './chunk-2AM6Z5BP.js';
3
+ import { criteriaOf, loadCitationFinder, hostItemsOf, criterionInputs, NO_CITING_TEST_REASON, NO_TEST_FILES_REASON, NO_VERDICT_REASON, isFoundInReason, uncitedIds, planCriteria, pickSearchable, IdScan, testFileMatcher, foundInReason, MAX_TEST_FILE_BYTES, MAX_TEST_FILES, groupBySize } from './chunk-FOSYM7TQ.js';
4
+ import { WorkCommandError, resolveCredentials, getJson } from './chunk-AQE6E54X.js';
6
5
  import { sanitizeTerminal } from './chunk-P6PHY33P.js';
7
- import { defaultFetch } from './chunk-JVCQZDQ6.js';
8
- import { resolveRepoIdentity } from './chunk-5GHJFETA.js';
9
- import { parseWorkItemEnv } from './chunk-5WYT3PPE.js';
6
+ import { resolveRepoIdentity } from './chunk-6KH3NMIT.js';
7
+ import { C } from './chunk-2AM6Z5BP.js';
8
+ import { defaultFetch } from './chunk-NXQK2I3G.js';
9
+ import { parseWorkItemEnv } from './chunk-4OD45RBP.js';
10
10
  import { parseTrackerNumber, trackerNumberError } from './chunk-WZBHBH3J.js';
11
11
  import { readDeliveryRecord } from './chunk-YQR6E6OV.js';
12
12
  import { inferArtifactKind, mediaTypeForArtifactPath, WORK_ITEM_COMMENT_MAX_BODY_LENGTH } from './chunk-WUKLQWGY.js';
@@ -217,14 +217,14 @@ function governingDir(cwd) {
217
217
  async function testProofMode(cwd) {
218
218
  const dir = governingDir(cwd);
219
219
  if (dir === void 0) return "any";
220
- const { testProofIn } = await import('./host-checks-WHW24PJR.js');
220
+ const { testProofIn } = await import('./host-checks-WAPO5X7X.js');
221
221
  return testProofIn(dir);
222
222
  }
223
223
  async function judgeCheckName(cwd) {
224
224
  const dir = governingDir(cwd);
225
225
  if (dir === void 0) return {};
226
226
  if (!existsSync(dir)) return { note: `the governed context at ${dir} is not readable` };
227
- const { checksIn, isJudgeCheck } = await import('./host-checks-WHW24PJR.js');
227
+ const { checksIn, isJudgeCheck } = await import('./host-checks-WAPO5X7X.js');
228
228
  const quiet = { line: () => void 0, error: () => void 0 };
229
229
  const check = checksIn(dir, quiet, "").checks.find((c) => isJudgeCheck(c) && c.judge.subjects === "criteria");
230
230
  return check === void 0 ? {} : { name: check.name };
@@ -369,7 +369,7 @@ async function runWorkProofs(opts) {
369
369
  async function runWorkProofsCommand(opts) {
370
370
  try {
371
371
  if (opts.record) {
372
- const { runWorkProofsRecord } = await import('./work-proofs-record-72OKWEES.js');
372
+ const { runWorkProofsRecord } = await import('./work-proofs-record-QPUM6DY4.js');
373
373
  const result2 = await runWorkProofsRecord(opts);
374
374
  process.exitCode = result2.exitCode;
375
375
  return;
@@ -1,13 +1,13 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
- import { mcpTargetPath, INIT_STDIO_ENTRY, INIT_DOCS_ENTRY, DOCS_MCP_SERVER_NAME } from './chunk-H2FFONRY.js';
4
- import { VALIDATOR_FILES, VALIDATORS_DIR, POLICY_PATH, POLICY_CONTENT } from './chunk-XHFSBSIA.js';
5
- import { skillsBaseFor } from './chunk-WDQPBAFV.js';
3
+ import { mcpTargetPath, INIT_STDIO_ENTRY, INIT_DOCS_ENTRY, DOCS_MCP_SERVER_NAME } from './chunk-MVPOYQQY.js';
4
+ import { VALIDATOR_FILES, VALIDATORS_DIR, POLICY_PATH, POLICY_CONTENT } from './chunk-B5SWBFVE.js';
5
+ import { skillsBaseFor } from './chunk-D6EXW4EB.js';
6
6
  import { findGitDirs } from './chunk-BJ3KTMDH.js';
7
7
  import { cliInvocation } from './chunk-FZKNTIOJ.js';
8
- import { hasSymlinkComponent } from './chunk-VRQM4A64.js';
8
+ import { hasSymlinkComponent } from './chunk-PBGNX3PS.js';
9
9
  import { cloneIsGoverned } from './chunk-YQR6E6OV.js';
10
- import { resolvePackRoot, AGENTS_SKILLS_BASE, OUTERLAYER_SKILLS_BASE, restoreSkillPaths, rewriteSkillPaths, skillDir, loadTemplateFiles, TEMPLATE_SKILLS } from './chunk-CKPQOQFC.js';
10
+ import { resolvePackRoot, AGENTS_SKILLS_BASE, OUTERLAYER_SKILLS_BASE, restoreSkillPaths, rewriteSkillPaths, skillDir, loadTemplateFiles, TEMPLATE_SKILLS } from './chunk-I6U6QPN6.js';
11
11
  import { createHash } from 'crypto';
12
12
  import { existsSync, readFileSync } from 'fs';
13
13
  import { join } from 'path';
@@ -1,6 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
- import { decodeWrappedCommand } from './chunk-KYDEBGJG.js';
3
+ import { decodeWrappedCommand } from './chunk-ZHQC43NH.js';
4
+ import { hookCodec } from './chunk-T5QBWM6M.js';
4
5
  import { homeFromEnv } from './chunk-352DHUTP.js';
5
6
  import { readFileSync, mkdirSync, appendFileSync, writeFileSync } from 'fs';
6
7
  import { spawn } from 'child_process';
@@ -48,14 +49,6 @@ function logError(home, err) {
48
49
  } catch {
49
50
  }
50
51
  }
51
- function parsePayload(bytes) {
52
- try {
53
- if (bytes.length === 0) return {};
54
- return JSON.parse(bytes.toString("utf8"));
55
- } catch {
56
- return {};
57
- }
58
- }
59
52
  function makeTailCollector(max = MAX_TAIL_BYTES) {
60
53
  let buf = Buffer.alloc(0);
61
54
  return {
@@ -110,6 +103,7 @@ async function runHookWrapFast(id, opts = {}) {
110
103
  const now = opts.now ?? Date.now;
111
104
  const captureOutput = opts.captureOutput ?? false;
112
105
  const proc = opts.proc ?? process;
106
+ const codec = opts.codec ?? hookCodec();
113
107
  if (!id) {
114
108
  logError(home, new Error("hook-wrap: missing --id"));
115
109
  return 0;
@@ -127,20 +121,20 @@ async function runHookWrapFast(id, opts = {}) {
127
121
  } catch {
128
122
  stdinBytes = Buffer.alloc(0);
129
123
  }
130
- const payload = parsePayload(stdinBytes);
131
124
  const execId = randomUUID();
132
125
  const startedAt = now();
133
126
  try {
127
+ const hook = codec.decode(void 0, stdinBytes.toString("utf8"));
134
128
  spool({
135
129
  rec: "started",
136
130
  execId,
137
131
  t: new Date(startedAt).toISOString(),
138
- sessionId: payload.session_id ?? null,
139
- hookEvent: payload.hook_event_name ?? null,
140
- toolUseId: payload.tool_use_id ?? null,
132
+ sessionId: hook.spool.sessionId ?? null,
133
+ hookEvent: hook.spool.payloadEvent ?? null,
134
+ toolUseId: hook.tool?.useId ?? null,
141
135
  // Costs a few bytes; makes an orphaned started-only record
142
136
  // self-describing ("PostToolUse Edit hung" vs. a bare uuid).
143
- toolName: payload.tool_name ?? null,
137
+ toolName: hook.tool?.name ?? null,
144
138
  cmdSha: createHash("sha256").update(original).digest("hex"),
145
139
  cmd: original.slice(0, MAX_CMD_LEN),
146
140
  pid: process.pid
@@ -0,0 +1,82 @@
1
+ #!/usr/bin/env node
2
+ import { createRequire } from 'node:module';
3
+
4
+ createRequire(import.meta.url);
5
+
6
+ // ../agents/src/claude-code/descriptor.ts
7
+ var CLAUDE_CODE = {
8
+ id: "claude-code",
9
+ label: "Claude Code",
10
+ color: "#D97757",
11
+ program: "claude",
12
+ legacy: {
13
+ subcommand: "claude",
14
+ runnerName: "claude",
15
+ usageEventValue: "claude_code",
16
+ envFile: "claude.env",
17
+ credentialId: "claude",
18
+ imagePaths: ["/opt/outerlayer/claude", "/usr/local/bin/claude", "/etc/claude-code"],
19
+ toolsVersionKey: "claudeCodeVersion",
20
+ handOffKey: "claudeCredential"
21
+ },
22
+ versions: { minimum: "2.1.284", tested: { from: "2.1.0", to: "2.1.255" } },
23
+ providers: ["anthropic"],
24
+ credentials: {
25
+ label: "Claude",
26
+ setupCommand: "claude setup-token",
27
+ forwarded: ["CLAUDE_CODE_OAUTH_TOKEN", "ANTHROPIC_API_KEY"],
28
+ stripped: ["CLAUDE_CODE_OAUTH_TOKEN", "ANTHROPIC_API_KEY", "ANTHROPIC_AUTH_TOKEN"],
29
+ placeholders: {
30
+ CLAUDE_CODE_OAUTH_TOKEN: "sk-ant-oat01-placeholder-not-a-real-token",
31
+ ANTHROPIC_API_KEY: "sk-ant-api03-placeholder-not-a-real-key"
32
+ },
33
+ kinds: {
34
+ CLAUDE_CODE_OAUTH_TOKEN: { pattern: "^sk-ant-oat[0-9]*-[A-Za-z0-9_-]+$", provider: "anthropic", providerKind: "oauth-token", starts: "sk-ant-oat" },
35
+ ANTHROPIC_API_KEY: { pattern: "^sk-ant-api[0-9]*-[A-Za-z0-9_-]+$", provider: "anthropic", providerKind: "api-key", starts: "sk-ant-api" },
36
+ ANTHROPIC_AUTH_TOKEN: { pattern: ".+", provider: "anthropic", providerKind: "oauth-token", starts: "" }
37
+ }
38
+ },
39
+ context: {
40
+ instructionFiles: ["CLAUDE.md"],
41
+ repoSkillFolders: [".claude/skills"],
42
+ userSkillFolder: "~/.claude/skills",
43
+ attach: "additive",
44
+ native: ["agents-md", "skills", "settings-hooks", "subagents", "commands", "mcp"]
45
+ },
46
+ capabilities: {
47
+ sessionId: "assignable",
48
+ resume: true,
49
+ fork: true,
50
+ subagents: { spawnTools: ["Agent", "Task"], transcript: "separate-file" },
51
+ cost: "status-line",
52
+ longCommands: "blocking",
53
+ permission: { unattended: "bypassPermissions", "accept-edits": "acceptEdits", plan: "plan", default: "default" },
54
+ structuredOutput: true,
55
+ mcp: true,
56
+ judge: true
57
+ },
58
+ hooks: { contextCap: 1e4, timeoutCeilingMs: 6e5 }
59
+ };
60
+
61
+ // ../agents/src/native/agents.ts
62
+ var NATIVE_AGENTS = {
63
+ "claude-code": CLAUDE_CODE
64
+ };
65
+ var LEGACY_AGENT = "claude-code";
66
+
67
+ // ../agents/src/providers/index.ts
68
+ var PROVIDERS = {
69
+ anthropic: {
70
+ id: "anthropic",
71
+ label: "Anthropic",
72
+ upstream: "https://api.anthropic.com/",
73
+ credentialKinds: [
74
+ { id: "api-key", label: "API key", header: "x-api-key", prefix: "" },
75
+ { id: "oauth-token", label: "OAuth token", header: "Authorization", prefix: "Bearer " }
76
+ ],
77
+ droppedHeaders: ["x-api-key", "authorization"],
78
+ destination: { name: "claude", port: 3127, socket: "claude.sock" }
79
+ }
80
+ };
81
+
82
+ export { CLAUDE_CODE, LEGACY_AGENT, NATIVE_AGENTS, PROVIDERS };
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
- import { contextAgents, defaultAgents, userSkillFolderIn, loadMachineSkillFiles, resolvePackRoot } from './chunk-CKPQOQFC.js';
3
+ import { contextAgents, defaultAgents, userSkillFolderIn, loadMachineSkillFiles, resolvePackRoot } from './chunk-I6U6QPN6.js';
4
4
  import { MAINTAINED_SKILLS, maintainedLineVersion } from './chunk-CDDED64E.js';
5
5
  import { resolvePackageVersion } from './chunk-RA3O54FC.js';
6
6
  import { homeFromEnv } from './chunk-352DHUTP.js';
@@ -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 { defaultAgents, legacyAgent, contextAgents, McpFileError } from './chunk-CKPQOQFC.js';
6
+ import { defaultAgents, legacyAgent, contextAgents, McpFileError } from './chunk-I6U6QPN6.js';
7
7
  import { mkdirSync, writeFileSync, existsSync, 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
3
  import { readCloudConfigStrict, readCloudConfig, cloudConfigPath } from './chunk-HWVMRETT.js';
4
- import { signRunnerRequest, signerFor } from './chunk-6JJITHBI.js';
4
+ import { signRunnerRequest, signerFor } from './chunk-IKFAJTLZ.js';
5
5
  import { readRepoConnection, findGitDirs } from './chunk-BJ3KTMDH.js';
6
6
  import { PLAIN_VERSION, recordCliVersion, removeRecordedVersion } from './chunk-NFZMENCY.js';
7
7
  import { cliInvocation } from './chunk-FZKNTIOJ.js';
@@ -1,11 +1,13 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
3
  import { appendContextProvenance } from './chunk-545P7JY7.js';
4
- import { CONTROL_PLANE_DIR_VARIABLE } from './chunk-NC3QAHOS.js';
4
+ import { CONTROL_PLANE_DIR_VARIABLE } from './chunk-BSPJI5T7.js';
5
5
  import { readRepoConnection, findGitDirs } from './chunk-BJ3KTMDH.js';
6
6
  import { updateNoticeContext, staleMachineCopiesContext } from './chunk-NFZMENCY.js';
7
7
  import { cliInvocation } from './chunk-FZKNTIOJ.js';
8
8
  import { deadHooksState, huskyPrepareScript, preparePackageManagerCommand } from './chunk-CJPTUU2E.js';
9
+ import { hookCodec } from './chunk-T5QBWM6M.js';
10
+ import { NATIVE_AGENTS, LEGACY_AGENT } from './chunk-LSLK4RS4.js';
9
11
  import { resolvePackageVersion } from './chunk-RA3O54FC.js';
10
12
  import { homeFromEnv } from './chunk-352DHUTP.js';
11
13
  import { readFileSync, mkdirSync, writeFileSync, renameSync, existsSync, readdirSync, unlinkSync, statSync, appendFileSync, opendirSync } from 'fs';
@@ -120,22 +122,19 @@ function logFailure(home, err) {
120
122
  } catch {
121
123
  }
122
124
  }
123
- function deliverInbox(event, payload, home, env, spawnImpl, write) {
125
+ function deliverInbox(decoded, home, env, spawnImpl, write, codec) {
124
126
  try {
125
- if (event !== "PostToolUse" && event !== "Stop") return;
127
+ const kind = decoded.kind;
128
+ if (kind !== "tool-used" && kind !== "turn-ended") return;
126
129
  const jobDir = env.OUTERLAYER_JOB_DIR;
127
130
  if (jobDir === void 0 || jobDir === "") return;
128
- if (event === "PostToolUse" && payload.agent_id !== void 0) return;
131
+ if (kind === "tool-used" && decoded.fromSubagent) return;
129
132
  const inbox = listInbox(jobDir);
130
133
  if (inbox.length === 0) return;
131
134
  const delivered = readDelivered(home);
132
135
  const chosen = selectForDelivery(inbox.filter((comment) => !delivered.has(comment.id)));
133
136
  if (chosen === void 0) return;
134
- write(
135
- JSON.stringify(
136
- event === "Stop" ? { decision: "block", reason: chosen.text } : { hookSpecificOutput: { hookEventName: "PostToolUse", additionalContext: chosen.text } }
137
- )
138
- );
137
+ write(codec.reply(kind === "turn-ended" ? { kind, continueWith: chosen.text } : { kind, context: chosen.text }));
139
138
  markDelivered(home, chosen.ids);
140
139
  spawnImpl(process.execPath, [process.argv[1], "work", "comments-read", "--item", chosen.item, ...chosen.ids]);
141
140
  } catch (err) {
@@ -438,6 +437,11 @@ function refreshCommand(workspaceDistDir, trusted) {
438
437
  function spoolDir(home = homeFromEnv()) {
439
438
  return join(home, ".outerlayer", "spool");
440
439
  }
440
+ var LEGACY = NATIVE_AGENTS[LEGACY_AGENT];
441
+ var defaultCodec = () => hookCodec();
442
+ function kindOf(codec, name) {
443
+ return codec.decode(name, "").kind;
444
+ }
441
445
  var DUPLICATE_RUN_WINDOW_MS = 2e3;
442
446
  var DUPLICATE_RUN_CLAIM_TTL_MS = 6e4;
443
447
  function isDuplicateRun(dir, event, input, now = Date.now(), claim = claimRun) {
@@ -527,9 +531,10 @@ var spawnDetached = (command, args, cwd) => {
527
531
  });
528
532
  child.unref();
529
533
  };
530
- function maybeAutoSync(event, home = homeFromEnv(), spawnImpl = spawnDetached, now = Date.now(), cwd = process.cwd()) {
534
+ function maybeAutoSync(event, home = homeFromEnv(), spawnImpl = spawnDetached, now = Date.now(), cwd = process.cwd(), codec = defaultCodec()) {
531
535
  try {
532
- if (event !== "SessionEnd" && event !== "Stop") return;
536
+ const kind = kindOf(codec, event);
537
+ if (kind !== "session-ended" && kind !== "turn-ended") return;
533
538
  const marker = join(spoolDir(home), "last-auto-sync");
534
539
  try {
535
540
  if (now - statSync(marker).mtimeMs < AUTO_SYNC_DEBOUNCE_MS) return;
@@ -557,7 +562,7 @@ function hookErrorsContext(home, writtenBytes, seenBytes) {
557
562
  }
558
563
  async function handleWorkLaunch(sessionId, home, env, spawnImpl = spawnDetached, cwd = process.cwd()) {
559
564
  if (!sessionId || env.OUTERLAYER_WORK === void 0) return void 0;
560
- const { parseWorkItemEnv, appendLaunchRecord } = await import('./work-launch-TTGSHLY4.js');
565
+ const { parseWorkItemEnv, appendLaunchRecord, linkSessionArgs } = await import('./work-launch-LWDQXLGI.js');
561
566
  const parsed = parseWorkItemEnv(env.OUTERLAYER_WORK);
562
567
  if ("reason" in parsed) {
563
568
  logHookError(home, new Error(`OUTERLAYER_WORK ignored: ${parsed.reason}`));
@@ -566,21 +571,18 @@ async function handleWorkLaunch(sessionId, home, env, spawnImpl = spawnDetached,
566
571
  appendLaunchRecord({ sessionId, item: parsed.number, ...env.OUTERLAYER_JOB_DIR === void 0 ? {} : { job: env.OUTERLAYER_JOB_DIR } }, home);
567
572
  const args = [
568
573
  process.argv[1],
569
- "work",
570
- "link-session",
571
- String(parsed.number),
572
- "--session-id",
573
- sessionId,
574
- // The ordinary failure is a gateway that is briefly unreachable — a
575
- // laptop that has not joined the network yet, a restart. Nothing else
576
- // ever retries this link: the launch record is already written, so
577
- // the session uploads whether or not Work ever hears about the
578
- // link. Retrying costs nothing here (this process is detached; the
579
- // hook has already returned) and cannot double-link, because the
580
- // link is keyed by the session id passed above.
581
- "--retry",
582
- String(WORK_LINK_RETRIES),
583
- LOG_FAILURES_FLAG
574
+ ...linkSessionArgs(parsed.number, sessionId, [
575
+ // The ordinary failure is a gateway that is briefly unreachable — a
576
+ // laptop that has not joined the network yet, a restart. Nothing else
577
+ // ever retries this link: the launch record is already written, so
578
+ // the session uploads whether or not Work ever hears about the
579
+ // link. Retrying costs nothing here (this process is detached; the
580
+ // hook has already returned) and cannot double-link, because the
581
+ // link is keyed by the session id passed above.
582
+ "--retry",
583
+ String(WORK_LINK_RETRIES),
584
+ LOG_FAILURES_FLAG
585
+ ])
584
586
  ];
585
587
  if (env.OUTERLAYER_JOB_DIR !== void 0) args.push("--no-lease");
586
588
  spawnImpl(
@@ -593,16 +595,14 @@ async function handleWorkLaunch(sessionId, home, env, spawnImpl = spawnDetached,
593
595
  );
594
596
  return void 0;
595
597
  }
596
- async function missingRenewalHookContext(home, cwd) {
598
+ async function missingRenewalHookContext(home, cwd, codec) {
597
599
  try {
598
- const { settingsPath, readSettings, isOurHookCommand } = await import('./settings-XB2HYBKO.js');
599
- const userSettings = readSettings(settingsPath("user", { home }));
600
- const projectSettings = readSettings(settingsPath("project", { cwd }));
601
- if (userSettings === null && projectSettings === null) return void 0;
602
- const registeredIn = (settings) => (settings.hooks?.PostToolUse ?? []).some((block) => (block.hooks ?? []).some((h) => isOurHookCommand(h)));
603
- const registered = userSettings !== null && registeredIn(userSettings) || projectSettings !== null && registeredIn(projectSettings);
604
- if (registered) return void 0;
605
- return `This install has no PostToolUse hook, so this session's work-item lease will never be renewed while it works and may be lost to another worker mid-session. Run \`${cliInvocation()} init\` to register it.`;
600
+ const event = codec.events.find((name) => kindOf(codec, name) === "tool-used");
601
+ if (event === void 0) return void 0;
602
+ const { hookRegistered } = await import('./hook-install-GDNRMML4.js');
603
+ const registered = hookRegistered(event, { home, cwd });
604
+ if (registered !== false) return void 0;
605
+ return `This install has no ${event} hook, so this session's work-item lease will never be renewed while it works and may be lost to another worker mid-session. Run \`${cliInvocation()} init\` to register it.`;
606
606
  } catch {
607
607
  return void 0;
608
608
  }
@@ -614,39 +614,31 @@ function markWorkLeaseRenewed(sessionId, home = homeFromEnv(), now = Date.now())
614
614
  } catch {
615
615
  }
616
616
  }
617
- async function maybeRenewWorkLease(event, sessionId, home = homeFromEnv(), env = process.env, spawnImpl = spawnDetached, now = Date.now(), cwd = process.cwd()) {
617
+ async function maybeRenewWorkLease(event, sessionId, home = homeFromEnv(), env = process.env, spawnImpl = spawnDetached, now = Date.now(), cwd = process.cwd(), codec = defaultCodec()) {
618
618
  try {
619
- if (event !== "PostToolUse") return;
619
+ if (kindOf(codec, event) !== "tool-used") return;
620
620
  if (!sessionId || env.OUTERLAYER_WORK === void 0 || env.OUTERLAYER_JOB_DIR !== void 0) return;
621
621
  const marker = join(spoolDir(home), `work-lease-renew-${sessionId}`);
622
622
  try {
623
623
  if (now - statSync(marker).mtimeMs < WORK_LEASE_RENEW_DEBOUNCE_MS) return;
624
624
  } catch {
625
625
  }
626
- const { parseWorkItemEnv } = await import('./work-launch-TTGSHLY4.js');
626
+ const { parseWorkItemEnv, linkSessionArgs } = await import('./work-launch-LWDQXLGI.js');
627
627
  const parsed = parseWorkItemEnv(env.OUTERLAYER_WORK);
628
628
  if ("reason" in parsed) return;
629
629
  writeFileSync(marker, String(now));
630
- spawnImpl(
631
- process.execPath,
632
- [process.argv[1], "work", "link-session", String(parsed.number), "--session-id", sessionId, LOG_FAILURES_FLAG],
633
- cwd
634
- );
630
+ spawnImpl(process.execPath, [process.argv[1], ...linkSessionArgs(parsed.number, sessionId, [LOG_FAILURES_FLAG])], cwd);
635
631
  } catch {
636
632
  }
637
633
  }
638
- async function handleWorkSessionEnd(event, sessionId, _home = homeFromEnv(), env = process.env, spawnImpl = spawnDetached, cwd = process.cwd()) {
634
+ async function releaseWorkLeaseOnEnd(event, sessionId, _home = homeFromEnv(), env = process.env, spawnImpl = spawnDetached, cwd = process.cwd(), codec = defaultCodec()) {
639
635
  try {
640
- if (event !== "SessionEnd") return;
636
+ if (kindOf(codec, event) !== "session-ended") return;
641
637
  if (!sessionId || env.OUTERLAYER_WORK === void 0) return;
642
- const { parseWorkItemEnv } = await import('./work-launch-TTGSHLY4.js');
638
+ const { parseWorkItemEnv, linkSessionArgs } = await import('./work-launch-LWDQXLGI.js');
643
639
  const parsed = parseWorkItemEnv(env.OUTERLAYER_WORK);
644
640
  if ("reason" in parsed) return;
645
- spawnImpl(
646
- process.execPath,
647
- [process.argv[1], "work", "link-session", String(parsed.number), "--session-id", sessionId, "--ended", LOG_FAILURES_FLAG],
648
- cwd
649
- );
641
+ spawnImpl(process.execPath, [process.argv[1], ...linkSessionArgs(parsed.number, sessionId, ["--ended", LOG_FAILURES_FLAG])], cwd);
650
642
  } catch {
651
643
  }
652
644
  }
@@ -668,24 +660,23 @@ function installedCliStalenessContext(home, cwd) {
668
660
  return `The installed OuterLayer CLI (~/.outerlayer/cli) is behind the workspace build: installed ${installedLabel}, workspace ${workspaceLabel}.
669
661
  ${howToRefresh}`;
670
662
  }
671
- function writeSessionStartContext(event, home, cwd, write, systemMessage, extraParts = []) {
663
+ function writeStartContext(codec, kind, home, cwd, write, systemMessage, extraParts = []) {
672
664
  try {
673
- if (event !== "SessionStart") return;
665
+ if (kind !== "session-start") return;
674
666
  const parts = [syncHealthContext(home), installedCliStalenessContext(home, cwd), ...extraParts].filter(
675
667
  (s) => s !== null
676
668
  );
677
669
  if (parts.length === 0 && systemMessage === void 0) return;
678
- write(
679
- JSON.stringify({
680
- ...systemMessage === void 0 ? {} : { systemMessage },
681
- hookSpecificOutput: { hookEventName: "SessionStart", additionalContext: parts.join("\n\n") }
682
- })
683
- );
670
+ write(codec.reply({ kind: "session-start", context: parts.join("\n\n"), ...systemMessage === void 0 ? {} : { notice: systemMessage } }));
684
671
  } catch {
685
672
  }
686
673
  }
687
674
  var MACHINE_CORE = "~/.agents/skills/outerlayer-build/SKILL.md";
688
- var BUILD_SKILL_FILES = [".agents/skills/build/SKILL.md", ".outerlayer/skills/build/SKILL.md", ".claude/skills/build/SKILL.md"];
675
+ var BUILD_SKILL_FILES = [
676
+ ".agents/skills/build/SKILL.md",
677
+ ".outerlayer/skills/build/SKILL.md",
678
+ ...Object.values(NATIVE_AGENTS).flatMap((agent) => agent.context.repoSkillFolders.map((folder) => `${folder}/build/SKILL.md`))
679
+ ];
689
680
  function machineSkillsContext(home, cwd) {
690
681
  for (let dir = cwd; ; dir = join(dir, "..")) {
691
682
  for (const file of BUILD_SKILL_FILES) {
@@ -808,17 +799,17 @@ async function missingControlPlane(cwd, sessionId, home, env) {
808
799
  const dirs = findGitDirs(cwd);
809
800
  if (dirs === void 0) return void 0;
810
801
  if (existsSync(join(dirs.gitCommonDir, "outerlayer", "materialized.json")) || hasExcludeBlock(dirs.gitCommonDir)) {
811
- const { cleanupEarlierCopies } = await import('./context-cleanup-QE2MIO2Q.js');
802
+ const { cleanupEarlierCopies } = await import('./context-cleanup-3K2AOECJ.js');
812
803
  cleanupEarlierCopies(dirs);
813
804
  }
814
805
  if (!contextPossiblyGoverned(cwd, home)) return void 0;
815
- const { governanceOf } = await import('./control-plane-launch-THUH6YU5.js');
806
+ const { governanceOf } = await import('./control-plane-launch-AAH4YH56.js');
816
807
  if (await governanceOf({ cwd, env, home }) !== "governed") return void 0;
817
808
  recordMissingContext(dirs, sessionId, home);
818
- const launcher = `${cliInvocation()} claude`;
809
+ const launcher = `${cliInvocation()} ${LEGACY.legacy.subcommand}`;
819
810
  return {
820
- person: `This repository's shared instructions and skills are missing from this session, because it did not start through \`${launcher}\`. Start Claude Code with \`${launcher}\`, or run \`${cliInvocation()} init\` once to make plain \`claude\` do the same.`,
821
- agent: `This repository is governed by a control plane, and this session did not start through \`${launcher}\`, so the control plane's shared instructions and skills are not loaded. Tell the person to start Claude Code with \`${launcher}\`.`
811
+ person: `This repository's shared instructions and skills are missing from this session, because it did not start through \`${launcher}\`. Start ${LEGACY.label} with \`${launcher}\`, or run \`${cliInvocation()} init\` once to make plain \`${LEGACY.program}\` do the same.`,
812
+ agent: `This repository is governed by a control plane, and this session did not start through \`${launcher}\`, so the control plane's shared instructions and skills are not loaded. Tell the person to start ${LEGACY.label} with \`${launcher}\`.`
822
813
  };
823
814
  }
824
815
  function recordMissingContext(dirs, sessionId, home) {
@@ -848,18 +839,13 @@ function hasExcludeBlock(gitCommonDir) {
848
839
  return false;
849
840
  }
850
841
  }
851
- async function runHookFast(event, home = homeFromEnv(), read = readStdin, env = process.env, spawnImpl = spawnDetached, write = (out) => void process.stdout.write(out)) {
842
+ async function runHookFast(event, home = homeFromEnv(), read = readStdin, env = process.env, spawnImpl = spawnDetached, write = (out) => void process.stdout.write(out), codec = defaultCodec()) {
852
843
  try {
853
844
  const stdin = read();
854
- let payload = {};
855
- try {
856
- payload = stdin ? JSON.parse(stdin) : {};
857
- } catch {
858
- payload = {};
859
- }
860
- const resolvedEvent = String(event ?? payload.hook_event_name ?? "unknown");
861
- deliverInbox(resolvedEvent, payload, home, env, spawnImpl, write);
862
- if (resolvedEvent === "PostToolUse" && (env.OUTERLAYER_WORK === void 0 || env.OUTERLAYER_JOB_DIR !== void 0)) {
845
+ const decoded = codec.decode(event, stdin);
846
+ const resolvedEvent = decoded.nativeName;
847
+ deliverInbox(decoded, home, env, spawnImpl, write, codec);
848
+ if (decoded.kind === "tool-used" && (env.OUTERLAYER_WORK === void 0 || env.OUTERLAYER_JOB_DIR !== void 0)) {
863
849
  return;
864
850
  }
865
851
  const dir = spoolDir(home);
@@ -868,17 +854,17 @@ async function runHookFast(event, home = homeFromEnv(), read = readStdin, env =
868
854
  const record = {
869
855
  t: (/* @__PURE__ */ new Date()).toISOString(),
870
856
  event: resolvedEvent,
871
- sessionId: payload.session_id ?? null,
872
- transcriptPath: payload.transcript_path ?? null,
873
- cwd: payload.cwd ?? null
857
+ sessionId: decoded.spool.sessionId,
858
+ transcriptPath: decoded.spool.transcriptPath,
859
+ cwd: decoded.spool.cwd
874
860
  };
875
861
  appendFileSync(join(dir, "events.jsonl"), JSON.stringify(record) + "\n");
876
862
  markHookFired(resolvedEvent, home);
877
- const sessionCwd = typeof payload.cwd === "string" ? payload.cwd : process.cwd();
878
- maybeAutoSync(resolvedEvent, home, spawnImpl, Date.now(), sessionCwd);
879
- const hookSessionId = typeof payload.session_id === "string" ? payload.session_id : void 0;
880
- await maybeRenewWorkLease(resolvedEvent, hookSessionId, home, env, spawnImpl, Date.now(), sessionCwd);
881
- await handleWorkSessionEnd(resolvedEvent, hookSessionId, home, env, spawnImpl, sessionCwd);
863
+ const sessionCwd = typeof decoded.spool.cwd === "string" ? decoded.spool.cwd : process.cwd();
864
+ const hookSessionId = typeof decoded.spool.sessionId === "string" ? decoded.spool.sessionId : void 0;
865
+ maybeAutoSync(resolvedEvent, home, spawnImpl, Date.now(), sessionCwd, codec);
866
+ await maybeRenewWorkLease(resolvedEvent, hookSessionId, home, env, spawnImpl, Date.now(), sessionCwd, codec);
867
+ await releaseWorkLeaseOnEnd(resolvedEvent, hookSessionId, home, env, spawnImpl, sessionCwd, codec);
882
868
  let missingPlane;
883
869
  let deadHooksMessage;
884
870
  let workLaunchMessage;
@@ -887,19 +873,19 @@ async function runHookFast(event, home = homeFromEnv(), read = readStdin, env =
887
873
  let machineSkillsMessage;
888
874
  let updateNoticeMessage;
889
875
  let staleCopiesMessage;
890
- if (resolvedEvent === "SessionStart") {
876
+ if (decoded.kind === "session-start") {
891
877
  const hookErrorsBytes = fileSizeBytes(join(dir, "hook-errors.log"));
892
878
  const hookErrorsSeen = hookErrorsSeenBytes(home);
893
879
  recordHookErrorsSeen(home, hookErrorsBytes);
894
880
  if (env[CONTROL_PLANE_DIR_VARIABLE] !== void 0) {
895
881
  try {
896
- recordDeliveredContext(sessionCwd, typeof payload.session_id === "string" ? payload.session_id : "unknown", home);
882
+ recordDeliveredContext(sessionCwd, hookSessionId ?? "unknown", home);
897
883
  } catch (err) {
898
884
  logHookError(home, err);
899
885
  }
900
886
  } else {
901
887
  try {
902
- missingPlane = await missingControlPlane(sessionCwd, typeof payload.session_id === "string" ? payload.session_id : "unknown", home, env);
888
+ missingPlane = await missingControlPlane(sessionCwd, hookSessionId ?? "unknown", home, env);
903
889
  } catch (err) {
904
890
  logHookError(home, err);
905
891
  }
@@ -927,8 +913,7 @@ async function runHookFast(event, home = homeFromEnv(), read = readStdin, env =
927
913
  logHookError(home, err);
928
914
  }
929
915
  try {
930
- const sessionId = typeof payload.session_id === "string" ? payload.session_id : void 0;
931
- workLaunchMessage = await handleWorkLaunch(sessionId, home, env, spawnImpl, sessionCwd);
916
+ workLaunchMessage = await handleWorkLaunch(hookSessionId, home, env, spawnImpl, sessionCwd);
932
917
  } catch (err) {
933
918
  logHookError(home, err);
934
919
  }
@@ -936,14 +921,15 @@ async function runHookFast(event, home = homeFromEnv(), read = readStdin, env =
936
921
  hookErrorsMessage = hookErrorsContext(home, hookErrorsBytes, hookErrorsSeen) ?? void 0;
937
922
  }
938
923
  if (env.OUTERLAYER_WORK !== void 0 && env.OUTERLAYER_JOB_DIR === void 0 && workLaunchMessage === void 0) {
939
- renewalHookMessage = await missingRenewalHookContext(home, sessionCwd);
924
+ renewalHookMessage = await missingRenewalHookContext(home, sessionCwd, codec);
940
925
  }
941
926
  }
942
- writeSessionStartContext(
943
- resolvedEvent,
927
+ writeStartContext(
928
+ codec,
929
+ decoded.kind,
944
930
  home,
945
931
  sessionCwd,
946
- (out) => process.stdout.write(out),
932
+ write,
947
933
  missingPlane?.person,
948
934
  [missingPlane?.agent, machineSkillsMessage, staleCopiesMessage, updateNoticeMessage, deadHooksMessage, workLaunchMessage, hookErrorsMessage, renewalHookMessage].filter(
949
935
  (s) => s !== void 0
@@ -979,4 +965,4 @@ function recordLinkExitFailure(argv, home = homeFromEnv(), target = process) {
979
965
  });
980
966
  }
981
967
 
982
- export { AUTO_SYNC_DEBOUNCE_MS, DUPLICATE_RUN_WINDOW_MS, SYNC_STALE_AFTER_MS, WORK_LEASE_RENEW_DEBOUNCE_MS, WORK_LINK_RETRIES, assessSyncHealth, checkInstalledCliStaleness, contextPossiblyGoverned, formatAgo, handleWorkLaunch, handleWorkSessionEnd, hookFiredMarkerPath, installedCliDistDir, isDuplicateRun, logHookError, machineSkillsContext, markWorkLeaseRenewed, maybeAutoSync, maybeRenewWorkLease, readSyncStatus, recordLinkExitFailure, refreshCommand, runHookFast, sanitizeForContext, spoolDir, workspaceRootOf, writeSyncStatus };
968
+ export { AUTO_SYNC_DEBOUNCE_MS, DUPLICATE_RUN_WINDOW_MS, SYNC_STALE_AFTER_MS, WORK_LEASE_RENEW_DEBOUNCE_MS, WORK_LINK_RETRIES, assessSyncHealth, checkInstalledCliStaleness, contextPossiblyGoverned, formatAgo, handleWorkLaunch, hookFiredMarkerPath, installedCliDistDir, isDuplicateRun, logHookError, machineSkillsContext, markWorkLeaseRenewed, maybeAutoSync, maybeRenewWorkLease, readSyncStatus, recordLinkExitFailure, refreshCommand, releaseWorkLeaseOnEnd, runHookFast, sanitizeForContext, spoolDir, workspaceRootOf, writeSyncStatus };