@sentropic/h2a 0.85.25 → 0.87.0

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 (295) hide show
  1. package/.claude-plugin/plugin.json +1 -1
  2. package/.codex-plugin/plugin.json +1 -1
  3. package/dist/bin.js +51 -2
  4. package/dist/bin.js.map +1 -1
  5. package/dist/cli-command-map.d.ts +119 -0
  6. package/dist/cli-command-map.d.ts.map +1 -0
  7. package/dist/cli-command-map.js +396 -0
  8. package/dist/cli-command-map.js.map +1 -0
  9. package/dist/cli-contract.d.ts.map +1 -1
  10. package/dist/cli-contract.js +39 -1
  11. package/dist/cli-contract.js.map +1 -1
  12. package/dist/cli.d.ts +25 -1
  13. package/dist/cli.d.ts.map +1 -1
  14. package/dist/cli.js +356 -7
  15. package/dist/cli.js.map +1 -1
  16. package/dist/identity.d.ts +37 -3
  17. package/dist/identity.d.ts.map +1 -1
  18. package/dist/identity.js +0 -0
  19. package/dist/identity.js.map +1 -1
  20. package/dist/index.d.ts +7 -2
  21. package/dist/index.d.ts.map +1 -1
  22. package/dist/index.js +9 -2
  23. package/dist/index.js.map +1 -1
  24. package/dist/runtime/enrollment/ceremony.d.ts +542 -0
  25. package/dist/runtime/enrollment/ceremony.d.ts.map +1 -0
  26. package/dist/runtime/enrollment/ceremony.js +777 -0
  27. package/dist/runtime/enrollment/ceremony.js.map +1 -0
  28. package/dist/runtime/enrollment/index.d.ts +16 -0
  29. package/dist/runtime/enrollment/index.d.ts.map +1 -0
  30. package/dist/runtime/enrollment/index.js +16 -0
  31. package/dist/runtime/enrollment/index.js.map +1 -0
  32. package/dist/runtime/feed/descriptors.d.ts +261 -0
  33. package/dist/runtime/feed/descriptors.d.ts.map +1 -0
  34. package/dist/runtime/feed/descriptors.js +425 -0
  35. package/dist/runtime/feed/descriptors.js.map +1 -0
  36. package/dist/runtime/feed/index.d.ts +12 -0
  37. package/dist/runtime/feed/index.d.ts.map +1 -0
  38. package/dist/runtime/feed/index.js +12 -0
  39. package/dist/runtime/feed/index.js.map +1 -0
  40. package/dist/runtime/identity/index.d.ts +3 -3
  41. package/dist/runtime/identity/index.d.ts.map +1 -1
  42. package/dist/runtime/identity/index.js +2 -2
  43. package/dist/runtime/identity/index.js.map +1 -1
  44. package/dist/runtime/identity/live.d.ts +68 -0
  45. package/dist/runtime/identity/live.d.ts.map +1 -1
  46. package/dist/runtime/identity/live.js +78 -2
  47. package/dist/runtime/identity/live.js.map +1 -1
  48. package/dist/runtime/identity/readers.d.ts +89 -5
  49. package/dist/runtime/identity/readers.d.ts.map +1 -1
  50. package/dist/runtime/identity/readers.js +242 -33
  51. package/dist/runtime/identity/readers.js.map +1 -1
  52. package/dist/runtime/local-files/presence.d.ts +16 -1
  53. package/dist/runtime/local-files/presence.d.ts.map +1 -1
  54. package/dist/runtime/local-files/presence.js +32 -20
  55. package/dist/runtime/local-files/presence.js.map +1 -1
  56. package/dist/runtime/loop/index.d.ts +5 -0
  57. package/dist/runtime/loop/index.d.ts.map +1 -1
  58. package/dist/runtime/loop/index.js +48 -5
  59. package/dist/runtime/loop/index.js.map +1 -1
  60. package/dist/runtime/mcp/agent-launch.d.ts +15 -1
  61. package/dist/runtime/mcp/agent-launch.d.ts.map +1 -1
  62. package/dist/runtime/mcp/agent-launch.js +45 -4
  63. package/dist/runtime/mcp/agent-launch.js.map +1 -1
  64. package/dist/runtime/mcp/index.d.ts +1 -1
  65. package/dist/runtime/mcp/index.d.ts.map +1 -1
  66. package/dist/runtime/mcp/index.js +1 -1
  67. package/dist/runtime/mcp/index.js.map +1 -1
  68. package/dist/runtime/mcp/server.d.ts +3 -1
  69. package/dist/runtime/mcp/server.d.ts.map +1 -1
  70. package/dist/runtime/mcp/server.js +7 -2
  71. package/dist/runtime/mcp/server.js.map +1 -1
  72. package/dist/runtime/mcp/sessions.d.ts +19 -0
  73. package/dist/runtime/mcp/sessions.d.ts.map +1 -1
  74. package/dist/runtime/mcp/sessions.js +44 -2
  75. package/dist/runtime/mcp/sessions.js.map +1 -1
  76. package/dist/runtime/mcp/stdio.d.ts +8 -0
  77. package/dist/runtime/mcp/stdio.d.ts.map +1 -1
  78. package/dist/runtime/mcp/stdio.js +42 -0
  79. package/dist/runtime/mcp/stdio.js.map +1 -1
  80. package/dist/runtime/mcp-registry/broker.d.ts +175 -0
  81. package/dist/runtime/mcp-registry/broker.d.ts.map +1 -0
  82. package/dist/runtime/mcp-registry/broker.js +203 -0
  83. package/dist/runtime/mcp-registry/broker.js.map +1 -0
  84. package/dist/runtime/mcp-registry/broker.typecheck.d.ts +2 -0
  85. package/dist/runtime/mcp-registry/broker.typecheck.d.ts.map +1 -0
  86. package/dist/runtime/mcp-registry/broker.typecheck.js +48 -0
  87. package/dist/runtime/mcp-registry/broker.typecheck.js.map +1 -0
  88. package/dist/runtime/mirror/accept.d.ts +43 -5
  89. package/dist/runtime/mirror/accept.d.ts.map +1 -1
  90. package/dist/runtime/mirror/accept.js +55 -7
  91. package/dist/runtime/mirror/accept.js.map +1 -1
  92. package/dist/runtime/mirror/build.d.ts +23 -4
  93. package/dist/runtime/mirror/build.d.ts.map +1 -1
  94. package/dist/runtime/mirror/build.js +34 -4
  95. package/dist/runtime/mirror/build.js.map +1 -1
  96. package/dist/runtime/mirror/index.d.ts +3 -0
  97. package/dist/runtime/mirror/index.d.ts.map +1 -1
  98. package/dist/runtime/mirror/index.js +3 -0
  99. package/dist/runtime/mirror/index.js.map +1 -1
  100. package/dist/runtime/mirror/ingest.d.ts +109 -0
  101. package/dist/runtime/mirror/ingest.d.ts.map +1 -0
  102. package/dist/runtime/mirror/ingest.js +117 -0
  103. package/dist/runtime/mirror/ingest.js.map +1 -0
  104. package/dist/runtime/mirror/push-daemon.d.ts +376 -0
  105. package/dist/runtime/mirror/push-daemon.d.ts.map +1 -0
  106. package/dist/runtime/mirror/push-daemon.js +644 -0
  107. package/dist/runtime/mirror/push-daemon.js.map +1 -0
  108. package/dist/runtime/mirror/sanitize.d.ts +477 -0
  109. package/dist/runtime/mirror/sanitize.d.ts.map +1 -0
  110. package/dist/runtime/mirror/sanitize.js +625 -0
  111. package/dist/runtime/mirror/sanitize.js.map +1 -0
  112. package/dist/runtime/mirror/serve.d.ts.map +1 -1
  113. package/dist/runtime/mirror/serve.js +104 -24
  114. package/dist/runtime/mirror/serve.js.map +1 -1
  115. package/dist/runtime/reporting/report-ai.d.ts.map +1 -1
  116. package/dist/runtime/reporting/report-ai.js +1 -0
  117. package/dist/runtime/reporting/report-ai.js.map +1 -1
  118. package/dist/runtime/reporting/stdin.d.ts +2 -0
  119. package/dist/runtime/reporting/stdin.d.ts.map +1 -0
  120. package/dist/runtime/reporting/stdin.js +8 -0
  121. package/dist/runtime/reporting/stdin.js.map +1 -0
  122. package/dist/status-surface.d.ts +167 -0
  123. package/dist/status-surface.d.ts.map +1 -0
  124. package/dist/status-surface.js +670 -0
  125. package/dist/status-surface.js.map +1 -0
  126. package/dist/types.d.ts +17 -0
  127. package/dist/types.d.ts.map +1 -1
  128. package/dist/types.js +3 -0
  129. package/dist/types.js.map +1 -1
  130. package/dist/vendor/harness/skills/manifest.d.ts.map +1 -1
  131. package/dist/vendor/harness/skills/manifest.js +2 -0
  132. package/dist/vendor/harness/skills/manifest.js.map +1 -1
  133. package/focus-app/client/_app/immutable/assets/{0.BdzHFb9q.css → 0.CgEVz9YW.css} +1 -1
  134. package/focus-app/client/_app/immutable/assets/0.CgEVz9YW.css.br +0 -0
  135. package/focus-app/client/_app/immutable/assets/0.CgEVz9YW.css.gz +0 -0
  136. package/focus-app/client/_app/immutable/assets/2.DaTmt6o7.css +1 -0
  137. package/focus-app/client/_app/immutable/assets/2.DaTmt6o7.css.br +0 -0
  138. package/focus-app/client/_app/immutable/assets/2.DaTmt6o7.css.gz +0 -0
  139. package/focus-app/client/_app/immutable/assets/3.vWQUAHjz.css +1 -0
  140. package/focus-app/client/_app/immutable/assets/3.vWQUAHjz.css.br +0 -0
  141. package/focus-app/client/_app/immutable/assets/3.vWQUAHjz.css.gz +0 -0
  142. package/focus-app/client/_app/immutable/assets/AppShell.CDPwj3zU.css +1 -0
  143. package/focus-app/client/_app/immutable/assets/AppShell.CDPwj3zU.css.br +0 -0
  144. package/focus-app/client/_app/immutable/assets/AppShell.CDPwj3zU.css.gz +0 -0
  145. package/focus-app/client/_app/immutable/chunks/{Cj6wo28J.js → 1NK_OeRJ.js} +1 -1
  146. package/focus-app/client/_app/immutable/chunks/1NK_OeRJ.js.br +0 -0
  147. package/focus-app/client/_app/immutable/chunks/1NK_OeRJ.js.gz +0 -0
  148. package/focus-app/client/_app/immutable/chunks/{Bs3f1UbD.js → B1veta3r.js} +2 -2
  149. package/focus-app/client/_app/immutable/chunks/B1veta3r.js.br +0 -0
  150. package/focus-app/client/_app/immutable/chunks/B1veta3r.js.gz +0 -0
  151. package/focus-app/client/_app/immutable/chunks/{DEmooz0s.js → BZ4lcC0v.js} +1 -1
  152. package/focus-app/client/_app/immutable/chunks/BZ4lcC0v.js.br +0 -0
  153. package/focus-app/client/_app/immutable/chunks/BZ4lcC0v.js.gz +0 -0
  154. package/focus-app/client/_app/immutable/chunks/Bu7F9NOv.js +2 -0
  155. package/focus-app/client/_app/immutable/chunks/Bu7F9NOv.js.br +0 -0
  156. package/focus-app/client/_app/immutable/chunks/Bu7F9NOv.js.gz +0 -0
  157. package/focus-app/client/_app/immutable/chunks/C6KhNEX3.js +1 -0
  158. package/focus-app/client/_app/immutable/chunks/C6KhNEX3.js.br +0 -0
  159. package/focus-app/client/_app/immutable/chunks/C6KhNEX3.js.gz +0 -0
  160. package/focus-app/client/_app/immutable/chunks/DIljKPJN.js +1 -0
  161. package/focus-app/client/_app/immutable/chunks/DIljKPJN.js.br +0 -0
  162. package/focus-app/client/_app/immutable/chunks/DIljKPJN.js.gz +0 -0
  163. package/focus-app/client/_app/immutable/chunks/iXQate3J.js +2 -0
  164. package/focus-app/client/_app/immutable/chunks/iXQate3J.js.br +0 -0
  165. package/focus-app/client/_app/immutable/chunks/iXQate3J.js.gz +0 -0
  166. package/focus-app/client/_app/immutable/chunks/{ZxFklh9T.js → kCE9wz0g.js} +1 -1
  167. package/focus-app/client/_app/immutable/chunks/kCE9wz0g.js.br +0 -0
  168. package/focus-app/client/_app/immutable/chunks/kCE9wz0g.js.gz +0 -0
  169. package/focus-app/client/_app/immutable/chunks/x-hq5fDG.js +1 -0
  170. package/focus-app/client/_app/immutable/chunks/x-hq5fDG.js.br +0 -0
  171. package/focus-app/client/_app/immutable/chunks/x-hq5fDG.js.gz +0 -0
  172. package/focus-app/client/_app/immutable/entry/app.C1sDdCg5.js +2 -0
  173. package/focus-app/client/_app/immutable/entry/app.C1sDdCg5.js.br +0 -0
  174. package/focus-app/client/_app/immutable/entry/app.C1sDdCg5.js.gz +0 -0
  175. package/focus-app/client/_app/immutable/entry/start.X3j_A5RN.js +1 -0
  176. package/focus-app/client/_app/immutable/entry/start.X3j_A5RN.js.br +2 -0
  177. package/focus-app/client/_app/immutable/entry/start.X3j_A5RN.js.gz +0 -0
  178. package/focus-app/client/_app/immutable/nodes/0.gLl44WzG.js +5 -0
  179. package/focus-app/client/_app/immutable/nodes/0.gLl44WzG.js.br +0 -0
  180. package/focus-app/client/_app/immutable/nodes/0.gLl44WzG.js.gz +0 -0
  181. package/focus-app/client/_app/immutable/nodes/1.DUrghq2x.js +1 -0
  182. package/focus-app/client/_app/immutable/nodes/1.DUrghq2x.js.br +0 -0
  183. package/focus-app/client/_app/immutable/nodes/1.DUrghq2x.js.gz +0 -0
  184. package/focus-app/client/_app/immutable/nodes/2.Bp7JE7Pz.js +1 -0
  185. package/focus-app/client/_app/immutable/nodes/2.Bp7JE7Pz.js.br +0 -0
  186. package/focus-app/client/_app/immutable/nodes/2.Bp7JE7Pz.js.gz +0 -0
  187. package/focus-app/client/_app/immutable/nodes/3.Cml8enOG.js +12 -0
  188. package/focus-app/client/_app/immutable/nodes/3.Cml8enOG.js.br +0 -0
  189. package/focus-app/client/_app/immutable/nodes/3.Cml8enOG.js.gz +0 -0
  190. package/focus-app/client/_app/version.json +1 -1
  191. package/focus-app/client/_app/version.json.br +0 -0
  192. package/focus-app/client/_app/version.json.gz +0 -0
  193. package/focus-app/h2a-focus.json +108 -80
  194. package/focus-app/handler.js +7 -7
  195. package/focus-app/index.js +7 -7
  196. package/focus-app/server/chunks/chunks/AppShell.js-6Pi87dO0.js +1353 -0
  197. package/focus-app/server/chunks/chunks/AppShell.js-6Pi87dO0.js.map +1 -0
  198. package/focus-app/server/chunks/chunks/agent-memory-dossier.js-nmFG_rgx.js +1036 -0
  199. package/focus-app/server/chunks/chunks/agent-memory-dossier.js-nmFG_rgx.js.map +1 -0
  200. package/focus-app/server/chunks/chunks/{exports.js-DUTkELZq.js → exports.js-CdqPbjm1.js} +3 -3
  201. package/focus-app/server/chunks/chunks/{exports.js-DUTkELZq.js.map → exports.js-CdqPbjm1.js.map} +1 -1
  202. package/focus-app/server/chunks/chunks/h2a-bus.js-bLEJ_Adi.js +233 -0
  203. package/focus-app/server/chunks/chunks/h2a-bus.js-bLEJ_Adi.js.map +1 -0
  204. package/focus-app/server/chunks/chunks/{index.js-Di21TltP.js → index.js-laGHLarB.js} +5 -2
  205. package/focus-app/server/chunks/chunks/index.js-laGHLarB.js.map +1 -0
  206. package/focus-app/server/chunks/chunks/{internal.js-33vbd70h.js → internal.js-C6T8nHkl.js} +4 -4
  207. package/focus-app/server/chunks/chunks/{internal.js-33vbd70h.js.map → internal.js-C6T8nHkl.js.map} +1 -1
  208. package/focus-app/server/chunks/chunks/{root.js-DO1m-gJA.js → root.js-CtVQOgDw.js} +2 -2
  209. package/focus-app/server/chunks/chunks/{root.js-DO1m-gJA.js.map → root.js-CtVQOgDw.js.map} +1 -1
  210. package/focus-app/server/chunks/entries/endpoints/api/decisions/inject/{_server.ts.js-j0NNcOSZ.js → _server.ts.js-hrbMnsV0.js} +13 -42
  211. package/focus-app/server/chunks/entries/endpoints/api/decisions/inject/_server.ts.js-hrbMnsV0.js.map +1 -0
  212. package/focus-app/server/chunks/entries/endpoints/api/dossiers/agent-memory/include/_server.ts.js-Dw4odGdV.js +138 -0
  213. package/focus-app/server/chunks/entries/endpoints/api/dossiers/agent-memory/include/_server.ts.js-Dw4odGdV.js.map +1 -0
  214. package/focus-app/server/chunks/entries/endpoints/api/h2a/targets/_server.ts.js-BLjYv7vg.js +41 -0
  215. package/focus-app/server/chunks/entries/endpoints/api/h2a/targets/_server.ts.js-BLjYv7vg.js.map +1 -0
  216. package/focus-app/server/chunks/entries/fallbacks/{error.svelte.js-Dj3sETSX.js → error.svelte.js-RbeaNF5a.js} +4 -4
  217. package/focus-app/server/chunks/entries/fallbacks/{error.svelte.js-Dj3sETSX.js.map → error.svelte.js-RbeaNF5a.js.map} +1 -1
  218. package/focus-app/server/chunks/entries/pages/{_layout.svelte.js-BoLsbuC2.js → _layout.svelte.js-e1E_I04z.js} +2 -2
  219. package/focus-app/server/chunks/entries/pages/{_layout.svelte.js-BoLsbuC2.js.map → _layout.svelte.js-e1E_I04z.js.map} +1 -1
  220. package/focus-app/server/chunks/entries/pages/{_page.svelte.js-QDldMYhk.js → _page.svelte.js-DbaEG23x.js} +31 -1373
  221. package/focus-app/server/chunks/entries/pages/_page.svelte.js-DbaEG23x.js.map +1 -0
  222. package/focus-app/server/chunks/entries/pages/dossier/agent-memory/_page.server.ts.js-CFC-wn6U.js +88 -0
  223. package/focus-app/server/chunks/entries/pages/dossier/agent-memory/_page.server.ts.js-CFC-wn6U.js.map +1 -0
  224. package/focus-app/server/chunks/entries/pages/dossier/agent-memory/_page.svelte.js-BpR26NMa.js +1574 -0
  225. package/focus-app/server/chunks/entries/pages/dossier/agent-memory/_page.svelte.js-BpR26NMa.js.map +1 -0
  226. package/focus-app/server/chunks/{handler-Cp_5hLyY.js → handler-Be3dyNi0.js} +3 -3
  227. package/focus-app/server/chunks/{handler-Cp_5hLyY.js.map → handler-Be3dyNi0.js.map} +1 -1
  228. package/focus-app/server/chunks/{index.js-CBh7Wjqp.js → index.js-siUxMMnK.js} +3 -3
  229. package/focus-app/server/chunks/{index.js-CBh7Wjqp.js.map → index.js-siUxMMnK.js.map} +1 -1
  230. package/focus-app/server/chunks/manifest.js-CXJqSHHn.js +78 -0
  231. package/focus-app/server/chunks/manifest.js-CXJqSHHn.js.map +1 -0
  232. package/focus-app/server/chunks/nodes/0.js-leU6sfRR.js +9 -0
  233. package/focus-app/server/chunks/nodes/{0.js-4wlmdsk8.js.map → 0.js-leU6sfRR.js.map} +1 -1
  234. package/focus-app/server/chunks/nodes/1.js-os6QXm6B.js +9 -0
  235. package/focus-app/server/chunks/nodes/{1.js-B-LpY-lC.js.map → 1.js-os6QXm6B.js.map} +1 -1
  236. package/focus-app/server/chunks/nodes/2.js-DAaLjh93.js +19 -0
  237. package/focus-app/server/chunks/nodes/2.js-DAaLjh93.js.map +1 -0
  238. package/focus-app/server/chunks/nodes/3.js-Cmgi6Uy0.js +18 -0
  239. package/focus-app/server/chunks/nodes/3.js-Cmgi6Uy0.js.map +1 -0
  240. package/package.json +5 -5
  241. package/skills/h2a-run/SKILL.md +100 -0
  242. package/skills/harness/SKILL.md +3 -1
  243. package/skills/harness/review/SKILL.md +99 -8
  244. package/skills/harness/security/SKILL.md +55 -0
  245. package/skills/harness/track-report/SKILL.md +103 -0
  246. package/skills/harness/using-harness/SKILL.md +3 -1
  247. package/focus-app/client/_app/immutable/assets/0.BdzHFb9q.css.br +0 -2
  248. package/focus-app/client/_app/immutable/assets/0.BdzHFb9q.css.gz +0 -0
  249. package/focus-app/client/_app/immutable/assets/2.Ddxq02y4.css +0 -1
  250. package/focus-app/client/_app/immutable/assets/2.Ddxq02y4.css.br +0 -0
  251. package/focus-app/client/_app/immutable/assets/2.Ddxq02y4.css.gz +0 -0
  252. package/focus-app/client/_app/immutable/chunks/Bs3f1UbD.js.br +0 -0
  253. package/focus-app/client/_app/immutable/chunks/Bs3f1UbD.js.gz +0 -0
  254. package/focus-app/client/_app/immutable/chunks/Bv8OL8ib.js +0 -1
  255. package/focus-app/client/_app/immutable/chunks/Bv8OL8ib.js.br +0 -0
  256. package/focus-app/client/_app/immutable/chunks/Bv8OL8ib.js.gz +0 -0
  257. package/focus-app/client/_app/immutable/chunks/CVq_IFFr.js +0 -2
  258. package/focus-app/client/_app/immutable/chunks/CVq_IFFr.js.br +0 -0
  259. package/focus-app/client/_app/immutable/chunks/CVq_IFFr.js.gz +0 -0
  260. package/focus-app/client/_app/immutable/chunks/Cj6wo28J.js.br +0 -0
  261. package/focus-app/client/_app/immutable/chunks/Cj6wo28J.js.gz +0 -0
  262. package/focus-app/client/_app/immutable/chunks/DEmooz0s.js.br +0 -0
  263. package/focus-app/client/_app/immutable/chunks/DEmooz0s.js.gz +0 -0
  264. package/focus-app/client/_app/immutable/chunks/DQIRXgdC.js +0 -2
  265. package/focus-app/client/_app/immutable/chunks/DQIRXgdC.js.br +0 -0
  266. package/focus-app/client/_app/immutable/chunks/DQIRXgdC.js.gz +0 -0
  267. package/focus-app/client/_app/immutable/chunks/ZxFklh9T.js.br +0 -0
  268. package/focus-app/client/_app/immutable/chunks/ZxFklh9T.js.gz +0 -0
  269. package/focus-app/client/_app/immutable/chunks/_wRuVGPs.js +0 -1
  270. package/focus-app/client/_app/immutable/chunks/_wRuVGPs.js.br +0 -0
  271. package/focus-app/client/_app/immutable/chunks/_wRuVGPs.js.gz +0 -0
  272. package/focus-app/client/_app/immutable/entry/app.6DKouWRt.js +0 -2
  273. package/focus-app/client/_app/immutable/entry/app.6DKouWRt.js.br +0 -0
  274. package/focus-app/client/_app/immutable/entry/app.6DKouWRt.js.gz +0 -0
  275. package/focus-app/client/_app/immutable/entry/start.DlLmkUb7.js +0 -1
  276. package/focus-app/client/_app/immutable/entry/start.DlLmkUb7.js.br +0 -2
  277. package/focus-app/client/_app/immutable/entry/start.DlLmkUb7.js.gz +0 -0
  278. package/focus-app/client/_app/immutable/nodes/0.CuSOF0Of.js +0 -5
  279. package/focus-app/client/_app/immutable/nodes/0.CuSOF0Of.js.br +0 -0
  280. package/focus-app/client/_app/immutable/nodes/0.CuSOF0Of.js.gz +0 -0
  281. package/focus-app/client/_app/immutable/nodes/1.D39jdnqm.js +0 -1
  282. package/focus-app/client/_app/immutable/nodes/1.D39jdnqm.js.br +0 -0
  283. package/focus-app/client/_app/immutable/nodes/1.D39jdnqm.js.gz +0 -0
  284. package/focus-app/client/_app/immutable/nodes/2.CnU8ifRl.js +0 -1
  285. package/focus-app/client/_app/immutable/nodes/2.CnU8ifRl.js.br +0 -0
  286. package/focus-app/client/_app/immutable/nodes/2.CnU8ifRl.js.gz +0 -0
  287. package/focus-app/server/chunks/chunks/index.js-Di21TltP.js.map +0 -1
  288. package/focus-app/server/chunks/entries/endpoints/api/decisions/inject/_server.ts.js-j0NNcOSZ.js.map +0 -1
  289. package/focus-app/server/chunks/entries/pages/_page.svelte.js-QDldMYhk.js.map +0 -1
  290. package/focus-app/server/chunks/manifest.js-Cm6cC7mC.js +0 -56
  291. package/focus-app/server/chunks/manifest.js-Cm6cC7mC.js.map +0 -1
  292. package/focus-app/server/chunks/nodes/0.js-4wlmdsk8.js +0 -9
  293. package/focus-app/server/chunks/nodes/1.js-B-LpY-lC.js +0 -9
  294. package/focus-app/server/chunks/nodes/2.js-F6jp5eD9.js +0 -19
  295. package/focus-app/server/chunks/nodes/2.js-F6jp5eD9.js.map +0 -1
@@ -0,0 +1,477 @@
1
+ import type { H2AActorRef, H2AActorRegistration, H2AAgentVersion, H2ASession, H2ASessionInterests, H2ASessionNotificationTopic, H2ASessionState, H2ASubagentBinding, H2AWorkStatus, H2AWorkspaceRef } from "@sentropic/h2a";
2
+ /**
3
+ * Why a field is withheld. A closed vocabulary rather than free text: the
4
+ * reasons are asserted by tests and read by reviewers, and "some comment
5
+ * somewhere" is not a contract.
6
+ */
7
+ export type MirrorWithholdReason =
8
+ /** A real path on the sender's filesystem. */
9
+ "filesystem-path"
10
+ /** A command line — reveals tooling, flags, and often paths inside it. */
11
+ | "command-line"
12
+ /** Identifies a process on the sender's machine (pid, tty). */
13
+ | "process-identity"
14
+ /** tmux session/window/pane — coordinates of a live terminal. */
15
+ | "terminal-coordinates"
16
+ /** The RECEIVER establishes this itself; a sender's value would be a forgery. */
17
+ | "receiver-stamped"
18
+ /** Nothing downstream reads it, so it has no business travelling. */
19
+ | "not-consumed-downstream";
20
+ interface SendPlan {
21
+ readonly kind: "send";
22
+ }
23
+ interface WithholdPlan {
24
+ readonly kind: "withhold";
25
+ readonly because: MirrorWithholdReason;
26
+ }
27
+ interface NarrowPlan<T> {
28
+ readonly kind: "narrow";
29
+ readonly narrow: (value: NonNullable<T>) => unknown;
30
+ }
31
+ /**
32
+ * A value that may be transmitted VERBATIM: a primitive, or an array of
33
+ * primitives. Deliberately narrow — an array of arrays or an array of objects is
34
+ * composite and does not qualify.
35
+ *
36
+ * This is the type that makes "no composite is ever copied by reference" a
37
+ * STRUCTURAL property instead of a convention, and it exists because convention
38
+ * demonstrably was not enough. The `interests` leak this module was written to
39
+ * fix was precisely a composite classified `send`: `applyPlan` copied the whole
40
+ * object by reference, `isInterests` tolerated the extra keys, and a nested
41
+ * `cwd`/`pid`/tmux payload came to rest on the receiver's disk. The field plan
42
+ * was already in place at the time. It forced a classification and the
43
+ * classification was `send`, which is a LEGAL classification — so the ratchet
44
+ * fired, was answered, and the leak shipped anyway.
45
+ *
46
+ * A plan that forces you to classify does not force you to classify CORRECTLY.
47
+ * Making `send` inexpressible for a composite removes the wrong answer from the
48
+ * menu rather than trusting the next author not to pick it.
49
+ *
50
+ * ── WHERE THIS RULE STOPS ──────────────────────────────────────────────────
51
+ *
52
+ * It is structural for any field with a real type, and it is NOT structural for
53
+ * a field typed `any`: a conditional type on `any` resolves to both branches, so
54
+ * `SEND` stays assignable and the compiler says nothing. `unknown` is fine
55
+ * (forced to `narrow`); `any` is the hole, and `any` is exactly what a field
56
+ * added in a hurry looks like. That case is covered one rung lower, by a runtime
57
+ * test that reads the plans directly rather than through a fixture
58
+ * (`mirror-send-boundary.test.js`, "no plan classifies a COMPOSITE field as
59
+ * `send`"). Naming the boundary here rather than letting "structural" be heard
60
+ * as "total".
61
+ */
62
+ type MirrorSendableValue = string | number | boolean | readonly (string | number | boolean)[];
63
+ /**
64
+ * How one source field is treated at the send boundary.
65
+ *
66
+ * `send` is only in the union when the field's type is a
67
+ * {@link MirrorSendableValue}. For a composite field the union collapses to
68
+ * `withhold | narrow`, so `SEND` is not assignable and the build fails until the
69
+ * field gets a plan of its own. That is the difference between "the ratchet
70
+ * forces you to classify" and "the ratchet forces a classification that cannot
71
+ * copy by reference".
72
+ */
73
+ export type MirrorFieldPlan<T> = ([NonNullable<T>] extends [MirrorSendableValue] ? SendPlan : never) | WithholdPlan | NarrowPlan<T>;
74
+ /** Never transmitted, with the reason recorded in the closed vocabulary. */
75
+ declare function withhold(because: MirrorWithholdReason): WithholdPlan;
76
+ /** Transmitted, but through its own nested allowlist. */
77
+ declare function narrow<T>(fn: (value: NonNullable<T>) => unknown): NarrowPlan<T>;
78
+ /** A plan covering EVERY field of `Source` — the `satisfies` target. */
79
+ type MirrorPlanFor<Source> = {
80
+ readonly [K in keyof Required<Source>]: MirrorFieldPlan<Required<Source>[K]>;
81
+ };
82
+ /** Keys a plan withholds. */
83
+ type WithheldKey<Plan> = {
84
+ [K in keyof Plan]: Plan[K] extends WithholdPlan ? K : never;
85
+ }[keyof Plan];
86
+ /** Keys a plan transmits (verbatim or narrowed). */
87
+ type SentKey<Plan> = Exclude<keyof Plan, WithheldKey<Plan>>;
88
+ /**
89
+ * Compile-time type equality. Used to pin each `H2AMirrored*` wire type's key
90
+ * set to its plan: if they drift, `true` stops being assignable to `false` and
91
+ * the build fails.
92
+ */
93
+ type Exact<A, B> = [A] extends [B] ? ([B] extends [A] ? true : false) : false;
94
+ /**
95
+ * Apply a plan: iterate the PLAN (never the record's own keys) and copy only
96
+ * what it permits.
97
+ *
98
+ * Iterating the plan is what makes this an allowlist rather than a filter — an
99
+ * unclassified field on `record` is not skipped, it is never looked at. Absent
100
+ * values are omitted rather than serialized as `undefined`, so the payload keeps
101
+ * the same "optional field absent" shape the store and the guards expect.
102
+ *
103
+ * ── THE TWO RUNTIME CHECKS, AND WHY A TYPE IS NOT ENOUGH ───────────────────
104
+ *
105
+ * Both exist because this function's input is UNVALIDATED. The compile-time
106
+ * ratchet governs the plan; nothing governs the record.
107
+ *
108
+ * - A `send` value that is not a primitive or an array of primitives is
109
+ * DROPPED. The declared type says what the field must be, so anything else is
110
+ * a lie, and a lie shaped like an object is how a `cwd` and a command line
111
+ * ride out through a field declared `string`. Dropped rather than thrown:
112
+ * throwing here would let any hostile registry row kill the push for every
113
+ * session on the machine, trading availability for a confidentiality win
114
+ * that dropping already secures. If the dropped field was required, the
115
+ * receiver's own guard rejects the record — fail-closed, and visible.
116
+ * - A `narrow` whose output was not itself built by this function is DROPPED.
117
+ * `NarrowPlan.narrow` is an arbitrary callback returning `unknown`, so
118
+ * `narrow((value) => value)` — an identity narrow — type-checks and copies a
119
+ * composite wholesale, which is precisely the leak the plans exist to stop.
120
+ * The compiler cannot reject it (identity returns a structurally compatible
121
+ * type), so the membership test in {@link PLAN_BUILT} does.
122
+ *
123
+ * `null` is passed THROUGH to a narrow rather than short-circuited, so the
124
+ * narrow's own hostile-input handling can run. That is what makes
125
+ * `endpoints: null` produce `[]` instead of an absent field.
126
+ */
127
+ declare function applyPlan<Source extends object>(record: Source, plan: MirrorPlanFor<Source>): Record<string, unknown>;
128
+ /**
129
+ * {@link applyPlan} and the plan constructors, exported for the send-boundary
130
+ * tests ONLY.
131
+ *
132
+ * Exporting internals to test them is usually a smell. It is justified here
133
+ * because the property under test is "a hostile PLAN cannot defeat the
134
+ * boundary", and a plan cannot be made hostile from outside without these. The
135
+ * alternative — trusting that no future plan uses an identity narrow — is the
136
+ * assumption this module exists to eliminate.
137
+ */
138
+ export declare const MIRROR_TEST_HOOKS: {
139
+ readonly applyPlan: typeof applyPlan;
140
+ readonly send: SendPlan;
141
+ readonly narrow: typeof narrow;
142
+ readonly withhold: typeof withhold;
143
+ };
144
+ /**
145
+ * Fields present on `record` that the plan does not classify at all.
146
+ *
147
+ * **This is a TEST-TIME assertion helper, not a runtime half of the ratchet.**
148
+ * It is called from `test/mirror-send-boundary.test.js` and from nowhere on the
149
+ * send path, and the earlier claim that it "covers the paths the compiler cannot
150
+ * see" was wider than what is built — a guard that is never invoked cannot cover
151
+ * anything. It is kept, and kept exported, because it is what lets a test fail by
152
+ * NAMING the unclassified field instead of asserting an opaque key-set equality.
153
+ *
154
+ * It is deliberately not wired into the builders. Two reasons, and the second is
155
+ * the honest one: (a) throwing on an unclassified field would turn an additive,
156
+ * harmless field into a dead mirror pipeline — availability lost for no
157
+ * confidentiality gained, since `applyPlan` never reads the field anyway; and
158
+ * (b) the alternative, warning or counting, would make this module impure, and
159
+ * the purity claim above ("everything here is PURE and happens before signing")
160
+ * is load-bearing for the signature argument. The ratchet that actually holds is
161
+ * the compiler (`satisfies MirrorPlanFor<Source>` on every plan in the table) plus
162
+ * plan-iteration in {@link applyPlan}. There is no runtime ratchet; if one is
163
+ * wanted it belongs in the caller, where a side effect is allowed.
164
+ */
165
+ export declare function unclassifiedMirrorFields(record: object, plan: Record<string, unknown>): string[];
166
+ /**
167
+ * A workspace as it may LEAVE the machine: identity + label, never a path.
168
+ *
169
+ * `H2AWorkspaceRef.path` is "the absolute realpath on **this machine**" — by its
170
+ * own definition it means nothing on any other host, and it is the single field
171
+ * the feed's opacity boundary names first. `repo` is withheld too: nothing
172
+ * downstream reads it and a git remote may itself be a local filesystem path.
173
+ *
174
+ * `id` survives because it lets a UI GROUP an owner's agents by place and because
175
+ * it is not reversible into a path. Be precise about WHY it is not, because the
176
+ * usual shorthand ("the salted `ws:<uuid>` digest") describes the wrong branch:
177
+ *
178
+ * - The PRIMARY id, tried first at `runtime/identity/live.ts`, is
179
+ * `durableWorkspaceId` (`runtime/identity/workspace-id.ts`) — an **unsalted**
180
+ * `sha256(rootCommitSHA + "\n" + worktreeRelPath)` rendered as `ws:<64 hex>`.
181
+ * Both inputs are PUBLIC: the repo's root-commit SHAs and a worktree name. It
182
+ * carries no path because the path is not an input, not because a secret hides
183
+ * it — so it is portable across clones by design, and an observer who already
184
+ * knows the repo can confirm a guess at the worktree name. That is the actual
185
+ * property, and it is weaker than "salted digest" implies.
186
+ * - The SECOND fallback is `provider.workspaceHint`, which for `host: "remote"`
187
+ * is the **unconstrained** `SESSION_WORKSPACE_ID` env var (`identity/
188
+ * resolver.ts` checks truthiness only — no prefix, charset or length check).
189
+ * - Only the THIRD fallback, reached in a non-git directory, is the salted
190
+ * `deriveWorkspaceId` (`identity.ts`: `sha256(machineId \0 realpath)` as
191
+ * `ws:<uuid>`). It is the branch the old comment described and the one least
192
+ * often taken.
193
+ *
194
+ * None of the three transmits a path, which is the property this boundary needs;
195
+ * the rationale is corrected because an inaccurate rationale inside a security
196
+ * module is how the next reader over-trusts the field.
197
+ *
198
+ * `host` survives because it is a CLI name (`claude` / `codex` / ...) and because
199
+ * `isH2AWorkspaceRef` requires it — see the note on `path` in `identity.ts`.
200
+ */
201
+ export interface H2AMirroredWorkspaceRef {
202
+ readonly id: string;
203
+ readonly host: string;
204
+ readonly label: string;
205
+ }
206
+ declare const WORKSPACE_PLAN: {
207
+ id: SendPlan;
208
+ host: SendPlan;
209
+ label: SendPlan;
210
+ path: WithholdPlan;
211
+ repo: WithholdPlan;
212
+ };
213
+ /** The plan, for tests. */
214
+ export declare const MIRROR_WORKSPACE_PLAN: Readonly<Record<string, MirrorFieldPlan<never>>>;
215
+ /** Pins {@link H2AMirroredWorkspaceRef} to {@link WORKSPACE_PLAN}. */
216
+ export type WorkspaceKeysMatchPlan = Exact<keyof H2AMirroredWorkspaceRef, SentKey<typeof WORKSPACE_PLAN>>;
217
+ export declare function sanitizeWorkspaceRefForMirror(workspace: H2AWorkspaceRef): H2AMirroredWorkspaceRef;
218
+ /** The plan, for tests. */
219
+ export declare const MIRROR_VERSION_PLAN: Readonly<Record<string, MirrorFieldPlan<never>>>;
220
+ /**
221
+ * Session interests as they may LEAVE the machine.
222
+ *
223
+ * This type and its plan exist because `interests` used to be classified `SEND`,
224
+ * which made {@link applyPlan} copy the whole object **by reference**. The
225
+ * consequence was not theoretical: `isH2ASession` validates `interests` through a
226
+ * two-field spot-check (`session.ts` `isInterests` asserts `scopes` and
227
+ * `negotiations` are string arrays and does **not** reject extra keys), so a
228
+ * record carrying `interests: { scopes: [], negotiations: [], lc: { tmux: …,
229
+ * cwd: …, pid: … } }` was well-formed by the guard, travelled whole, and came to
230
+ * rest on the receiver's disk. A nested composite reached by reference is outside
231
+ * both halves of the ratchet: the plan cannot filter what it does not iterate,
232
+ * and `satisfies MirrorPlanFor<H2ASession>` says nothing about the fields of
233
+ * `H2ASessionInterests`.
234
+ *
235
+ * Both fields are transmitted — the hosted `writePresence` REQUIRES them, since
236
+ * `isInterests` rejects a record missing either — but the object is now rebuilt
237
+ * from the plan rather than passed through, so a third field cannot ride along.
238
+ * The element VALUES stay free text: `runtime/mcp/sessions.ts` copies
239
+ * `interests.scopes` verbatim from the `h2a_session_open` caller, so a scope
240
+ * naming a real directory is transmissible and is disclosed as such. A field
241
+ * allowlist bounds the SHAPE, never the content.
242
+ */
243
+ export interface H2AMirroredSessionInterests {
244
+ readonly scopes: readonly string[];
245
+ readonly negotiations: readonly string[];
246
+ }
247
+ declare const INTERESTS_PLAN: {
248
+ scopes: SendPlan;
249
+ negotiations: SendPlan;
250
+ };
251
+ /** The plan, for tests. */
252
+ export declare const MIRROR_INTERESTS_PLAN: Readonly<Record<string, MirrorFieldPlan<never>>>;
253
+ /** Pins {@link H2AMirroredSessionInterests} to {@link INTERESTS_PLAN}. */
254
+ export type InterestsKeysMatchPlan = Exact<keyof H2AMirroredSessionInterests, SentKey<typeof INTERESTS_PLAN>>;
255
+ /**
256
+ * A presence record as it may LEAVE the machine.
257
+ *
258
+ * Assignable to `H2ASession` on purpose: the hosted ingester writes it through
259
+ * `writePresence`, which validates with `isH2ASession`, and the feed's
260
+ * descriptor builders consume it as a session. Narrowing the payload therefore
261
+ * required exactly one type change elsewhere — `H2AWorkspaceRef.path` became
262
+ * optional, because a type that makes a filesystem path MANDATORY on every
263
+ * workspace reference cannot express a sanitized reference at all. That
264
+ * mandatory field was compelling the leak, not merely permitting it.
265
+ */
266
+ export interface H2AMirroredSession {
267
+ readonly sessionId: string;
268
+ readonly instance: string;
269
+ readonly host?: string;
270
+ readonly name?: string;
271
+ readonly startedAt: string;
272
+ readonly heartbeatAt: string;
273
+ readonly state: H2ASessionState;
274
+ readonly interests: H2AMirroredSessionInterests;
275
+ readonly subscribedTopics: readonly H2ASessionNotificationTopic[];
276
+ readonly workStatus?: H2AWorkStatus;
277
+ readonly lastMcpActivityAt?: string;
278
+ readonly version?: H2AAgentVersion;
279
+ readonly workspace?: H2AMirroredWorkspaceRef;
280
+ }
281
+ /**
282
+ * Every field of `H2ASession`, classified.
283
+ *
284
+ * The `send` set is exactly what a consumer of the mirror demonstrably needs:
285
+ * - `sessionId` / `instance` — the row's own identity (`accept.ts` authorizes a
286
+ * session by `instance`; the feed keys rows on both);
287
+ * - `startedAt` / `heartbeatAt` / `state` / `lastMcpActivityAt` — the liveness
288
+ * derivation (`deriveSessionState`, `deriveLiveness`, `isSessionExpired`);
289
+ * - `interests` / `subscribedTopics` — required by `isH2ASession`, so the
290
+ * hosted `writePresence` rejects the record without them;
291
+ * - `host` / `name` / `workspace` — the feed's `host`, `topicOrTitle`,
292
+ * `displayName` and `workspaceLabel`;
293
+ * - `workStatus` / `version` — closed vocabularies, shown by `h2a_discover_*`.
294
+ */
295
+ declare const PRESENCE_PLAN: {
296
+ sessionId: SendPlan;
297
+ instance: SendPlan;
298
+ host: SendPlan;
299
+ name: SendPlan;
300
+ startedAt: SendPlan;
301
+ heartbeatAt: SendPlan;
302
+ state: SendPlan;
303
+ interests: NarrowPlan<H2ASessionInterests>;
304
+ subscribedTopics: SendPlan;
305
+ workStatus: SendPlan;
306
+ lastMcpActivityAt: SendPlan;
307
+ version: NarrowPlan<H2AAgentVersion>;
308
+ workspace: NarrowPlan<H2AWorkspaceRef>;
309
+ launchContext: WithholdPlan;
310
+ pid: WithholdPlan;
311
+ mirroredAt: WithholdPlan;
312
+ };
313
+ /** The plan, for tests and for callers that want to state the contract. */
314
+ export declare const MIRROR_PRESENCE_PLAN: Readonly<Record<string, MirrorFieldPlan<never>>>;
315
+ /** Pins {@link H2AMirroredSession} to {@link PRESENCE_PLAN}. */
316
+ export type PresenceKeysMatchPlan = Exact<keyof H2AMirroredSession, SentKey<typeof PRESENCE_PLAN>>;
317
+ /** One presence record → the record as it may leave the machine. */
318
+ export declare function sanitizePresenceForMirror(session: H2ASession): H2AMirroredSession;
319
+ /** One endpoint of a registration, as declared locally. */
320
+ type H2AEndpointDeclaration = H2AActorRegistration["endpoints"][number];
321
+ /**
322
+ * One endpoint as it may LEAVE the machine. Its own plan, so a field added to
323
+ * the endpoints ELEMENT type fails the build instead of travelling — before
324
+ * this, the element was copied whole by `Array.prototype.filter`, which is a
325
+ * pass-through, and the ratchet stopped at `H2AActorRegistration`.
326
+ */
327
+ export interface H2AMirroredEndpoint {
328
+ readonly kind: H2AEndpointDeclaration["kind"];
329
+ readonly uri: string;
330
+ }
331
+ declare const ENDPOINT_PLAN: {
332
+ kind: SendPlan;
333
+ uri: SendPlan;
334
+ };
335
+ /** The plan, for tests. */
336
+ export declare const MIRROR_ENDPOINT_PLAN: Readonly<Record<string, MirrorFieldPlan<never>>>;
337
+ /** Pins {@link H2AMirroredEndpoint} to {@link ENDPOINT_PLAN}. */
338
+ export type EndpointKeysMatchPlan = Exact<keyof H2AMirroredEndpoint, SentKey<typeof ENDPOINT_PLAN>>;
339
+ /**
340
+ * A registry row as it may LEAVE the machine. Structurally assignable to
341
+ * `H2AActorRegistration`, which is what the ingest path expects when it applies
342
+ * the row via `store.registerInstance`.
343
+ *
344
+ * That assignability is a TYPE-level property only, and deliberately stated that
345
+ * way: `store.registerInstance` does **not** validate with
346
+ * `isH2AActorRegistration` — nothing in production does (see
347
+ * `sanitizeEndpointsForMirror`). So being assignable is what keeps the compiler
348
+ * honest here; it is not evidence that the receiver checks the shape.
349
+ */
350
+ export interface H2AMirroredRegistration {
351
+ readonly id: string;
352
+ readonly instance: string;
353
+ readonly roles: H2AActorRegistration["roles"];
354
+ readonly scopes: string[];
355
+ readonly capabilities: string[];
356
+ readonly declaredCapabilities?: string[];
357
+ readonly endpoints: H2AMirroredEndpoint[];
358
+ readonly publicKeys: string[];
359
+ readonly acceptedPolicies: string[];
360
+ readonly createdAt: string;
361
+ readonly principal?: string;
362
+ readonly conductor?: string;
363
+ readonly agentUuid?: string;
364
+ readonly name?: string;
365
+ readonly workspace?: H2AMirroredWorkspaceRef;
366
+ }
367
+ /**
368
+ * Every field of `H2AActorRegistration`, classified.
369
+ *
370
+ * `capabilities` is transmitted DELIBERATELY, though it is authority-bearing and
371
+ * the feed never displays it. Two gates on the RECEIVING side read it off the
372
+ * registry row: the subagent capability ceiling (`subagents.ts`
373
+ * `capabilities-exceed-parent` compares a binding against `parent.capabilities`)
374
+ * and the attestation right (`canAttestComprehension(role,
375
+ * registration.capabilities)` in `mcp/handlers.ts`). Withholding it would not be
376
+ * "sanitizing" — it would silently change an authorization outcome on the
377
+ * receiver, which is a worse failure than the one being fixed. It carries no
378
+ * path, no command and no process identity.
379
+ */
380
+ declare const REGISTRATION_PLAN: {
381
+ id: SendPlan;
382
+ instance: SendPlan;
383
+ roles: SendPlan;
384
+ scopes: SendPlan;
385
+ capabilities: SendPlan;
386
+ declaredCapabilities: SendPlan;
387
+ publicKeys: SendPlan;
388
+ acceptedPolicies: SendPlan;
389
+ createdAt: SendPlan;
390
+ principal: SendPlan;
391
+ conductor: SendPlan;
392
+ agentUuid: SendPlan;
393
+ name: SendPlan;
394
+ endpoints: NarrowPlan<{
395
+ kind: "mcp" | "local-files" | "remote";
396
+ uri: string;
397
+ }[]>;
398
+ workspace: NarrowPlan<H2AWorkspaceRef>;
399
+ };
400
+ /** The plan, for tests. */
401
+ export declare const MIRROR_REGISTRATION_PLAN: Readonly<Record<string, MirrorFieldPlan<never>>>;
402
+ /** Pins {@link H2AMirroredRegistration} to {@link REGISTRATION_PLAN}. */
403
+ export type RegistrationKeysMatchPlan = Exact<keyof H2AMirroredRegistration, SentKey<typeof REGISTRATION_PLAN>>;
404
+ export declare function sanitizeRegistrationForMirror(registration: H2AActorRegistration): H2AMirroredRegistration;
405
+ /**
406
+ * The envelope's `actor`, derived from the SANITIZED registration.
407
+ *
408
+ * Taking `H2AMirroredRegistration` rather than `H2AActorRegistration` is the
409
+ * whole point and is worth not "simplifying" later: the raw record is not in
410
+ * scope here, so this function CANNOT read a withheld field even by mistake.
411
+ * Every value it can reach has already been through {@link REGISTRATION_PLAN},
412
+ * which makes "the envelope carries nothing the body does not already carry" a
413
+ * consequence of the signature instead of a claim in a comment.
414
+ *
415
+ * `role` is re-intersected against `H2A_ROLES`. That is a genuinely closed
416
+ * vocabulary check, not a shape check: `roles[]` element VALUES are otherwise
417
+ * free text (disclosed above), and this is the one place where an element value
418
+ * escapes the body into the envelope, so it is the one place worth closing.
419
+ *
420
+ * ── STRUCK, AND LEFT VISIBLE ON PURPOSE ────────────────────────────────────
421
+ *
422
+ * An earlier version of this comment continued: ~~"`isH2AEnvelope` requires a
423
+ * vocabulary role anyway, so a non-role here produced an envelope that fails the
424
+ * protocol's own guard."~~ **That is false.** `isH2AEnvelope` delegates to
425
+ * `validateH2AEnvelope` (`envelope.ts:109`), which checks `actor` only for
426
+ * `typeof actor.instance === "string"`. It never looks at `role`. Measured:
427
+ *
428
+ * isH2AEnvelope(actor.role = "/home/antoinefa/NOTAROLE") -> true
429
+ * isH2AEnvelope(actor with no role at all) -> true
430
+ * isH2AEnvelope(actor with no instance) -> false
431
+ *
432
+ * There IS a function that checks the vocabulary — `isActorRef`, `envelope.ts:27`
433
+ * — but it is module-private and referenced nowhere in the tree. A guard that
434
+ * cannot fire.
435
+ *
436
+ * The sentence is struck rather than deleted because of what it was doing: it
437
+ * supplied a REASON TO DELETE THE RE-INTERSECTION BELOW. "The protocol guard
438
+ * catches it anyway" is exactly the argument someone would use to remove that
439
+ * line, and removing it restores the leak. A false justification for a live
440
+ * guard is more dangerous than no justification at all — nothing downstream
441
+ * validates this field, so the check here is the only one there is.
442
+ *
443
+ * `scope` is NOT closed — there is no scope vocabulary to close it against — but
444
+ * it is now sourced from the sanitized registration rather than hardcoded, so
445
+ * the trap is disarmed by construction: the "obvious edit" has already been made
446
+ * here, safely, under test. Its value is free text and rides out under the same
447
+ * disclosed gap as `scopes[]` in the body, which already transmits it verbatim.
448
+ */
449
+ export declare function sanitizeActorForMirror(instance: string, mirrored: H2AMirroredRegistration): H2AActorRef;
450
+ /**
451
+ * A subagent (NHI) binding as it may leave the machine. Every field is
452
+ * transmitted — checked one by one, none is a path, a command or a process id —
453
+ * but the plan exists anyway, so a future field on `H2ASubagentBinding` must be
454
+ * classified before it can travel. That is the ratchet, not a formality: this
455
+ * payload member had no boundary of its own before.
456
+ */
457
+ export interface H2AMirroredSubagentBinding {
458
+ readonly id: string;
459
+ readonly parentInstance: string;
460
+ readonly name: string;
461
+ readonly capabilities?: readonly string[];
462
+ readonly createdAt: string;
463
+ }
464
+ declare const SUBAGENT_PLAN: {
465
+ id: SendPlan;
466
+ parentInstance: SendPlan;
467
+ name: SendPlan;
468
+ capabilities: SendPlan;
469
+ createdAt: SendPlan;
470
+ };
471
+ /** The plan, for tests. */
472
+ export declare const MIRROR_SUBAGENT_PLAN: Readonly<Record<string, MirrorFieldPlan<never>>>;
473
+ /** Pins {@link H2AMirroredSubagentBinding} to {@link SUBAGENT_PLAN}. */
474
+ export type SubagentKeysMatchPlan = Exact<keyof H2AMirroredSubagentBinding, SentKey<typeof SUBAGENT_PLAN>>;
475
+ export declare function sanitizeSubagentForMirror(binding: H2ASubagentBinding): H2AMirroredSubagentBinding;
476
+ export {};
477
+ //# sourceMappingURL=sanitize.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sanitize.d.ts","sourceRoot":"","sources":["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