@mostra/protocol 0.0.0-stage → 0.1.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 (439) hide show
  1. package/LICENSE +202 -0
  2. package/README.md +38 -2
  3. package/dist/actions.d.ts +273 -0
  4. package/dist/actions.d.ts.map +1 -0
  5. package/dist/actions.js +154 -0
  6. package/dist/actions.js.map +1 -0
  7. package/dist/artifact.d.ts +113 -0
  8. package/dist/artifact.d.ts.map +1 -0
  9. package/dist/artifact.js +79 -0
  10. package/dist/artifact.js.map +1 -0
  11. package/dist/bridge.d.ts +295 -0
  12. package/dist/bridge.d.ts.map +1 -0
  13. package/dist/bridge.js +343 -0
  14. package/dist/bridge.js.map +1 -0
  15. package/dist/browser.d.ts +195 -0
  16. package/dist/browser.d.ts.map +1 -0
  17. package/dist/browser.js +156 -0
  18. package/dist/browser.js.map +1 -0
  19. package/dist/bundle.d.ts +155 -0
  20. package/dist/bundle.d.ts.map +1 -0
  21. package/dist/bundle.js +130 -0
  22. package/dist/bundle.js.map +1 -0
  23. package/dist/canonical.d.ts +23 -0
  24. package/dist/canonical.d.ts.map +1 -0
  25. package/dist/canonical.js +45 -0
  26. package/dist/canonical.js.map +1 -0
  27. package/dist/capability.d.ts +38 -0
  28. package/dist/capability.d.ts.map +1 -0
  29. package/dist/capability.js +61 -0
  30. package/dist/capability.js.map +1 -0
  31. package/dist/diagnostics/codes/a11y.d.ts +8 -0
  32. package/dist/diagnostics/codes/a11y.d.ts.map +1 -0
  33. package/dist/diagnostics/codes/a11y.js +30 -0
  34. package/dist/diagnostics/codes/a11y.js.map +1 -0
  35. package/dist/diagnostics/codes/action.d.ts +8 -0
  36. package/dist/diagnostics/codes/action.d.ts.map +1 -0
  37. package/dist/diagnostics/codes/action.js +110 -0
  38. package/dist/diagnostics/codes/action.js.map +1 -0
  39. package/dist/diagnostics/codes/artifact.d.ts +8 -0
  40. package/dist/diagnostics/codes/artifact.d.ts.map +1 -0
  41. package/dist/diagnostics/codes/artifact.js +121 -0
  42. package/dist/diagnostics/codes/artifact.js.map +1 -0
  43. package/dist/diagnostics/codes/build.d.ts +8 -0
  44. package/dist/diagnostics/codes/build.d.ts.map +1 -0
  45. package/dist/diagnostics/codes/build.js +55 -0
  46. package/dist/diagnostics/codes/build.js.map +1 -0
  47. package/dist/diagnostics/codes/cli.d.ts +8 -0
  48. package/dist/diagnostics/codes/cli.d.ts.map +1 -0
  49. package/dist/diagnostics/codes/cli.js +44 -0
  50. package/dist/diagnostics/codes/cli.js.map +1 -0
  51. package/dist/diagnostics/codes/console.d.ts +8 -0
  52. package/dist/diagnostics/codes/console.d.ts.map +1 -0
  53. package/dist/diagnostics/codes/console.js +30 -0
  54. package/dist/diagnostics/codes/console.js.map +1 -0
  55. package/dist/diagnostics/codes/dep.d.ts +8 -0
  56. package/dist/diagnostics/codes/dep.d.ts.map +1 -0
  57. package/dist/diagnostics/codes/dep.js +88 -0
  58. package/dist/diagnostics/codes/dep.js.map +1 -0
  59. package/dist/diagnostics/codes/env.d.ts +8 -0
  60. package/dist/diagnostics/codes/env.d.ts.map +1 -0
  61. package/dist/diagnostics/codes/env.js +132 -0
  62. package/dist/diagnostics/codes/env.js.map +1 -0
  63. package/dist/diagnostics/codes/field.d.ts +8 -0
  64. package/dist/diagnostics/codes/field.d.ts.map +1 -0
  65. package/dist/diagnostics/codes/field.js +99 -0
  66. package/dist/diagnostics/codes/field.js.map +1 -0
  67. package/dist/diagnostics/codes/home.d.ts +8 -0
  68. package/dist/diagnostics/codes/home.d.ts.map +1 -0
  69. package/dist/diagnostics/codes/home.js +132 -0
  70. package/dist/diagnostics/codes/home.js.map +1 -0
  71. package/dist/diagnostics/codes/host.d.ts +8 -0
  72. package/dist/diagnostics/codes/host.d.ts.map +1 -0
  73. package/dist/diagnostics/codes/host.js +176 -0
  74. package/dist/diagnostics/codes/host.js.map +1 -0
  75. package/dist/diagnostics/codes/hygiene.d.ts +8 -0
  76. package/dist/diagnostics/codes/hygiene.d.ts.map +1 -0
  77. package/dist/diagnostics/codes/hygiene.js +154 -0
  78. package/dist/diagnostics/codes/hygiene.js.map +1 -0
  79. package/dist/diagnostics/codes/index.d.ts +51 -0
  80. package/dist/diagnostics/codes/index.d.ts.map +1 -0
  81. package/dist/diagnostics/codes/index.js +72 -0
  82. package/dist/diagnostics/codes/index.js.map +1 -0
  83. package/dist/diagnostics/codes/live.d.ts +8 -0
  84. package/dist/diagnostics/codes/live.d.ts.map +1 -0
  85. package/dist/diagnostics/codes/live.js +30 -0
  86. package/dist/diagnostics/codes/live.js.map +1 -0
  87. package/dist/diagnostics/codes/manifest.d.ts +8 -0
  88. package/dist/diagnostics/codes/manifest.d.ts.map +1 -0
  89. package/dist/diagnostics/codes/manifest.js +44 -0
  90. package/dist/diagnostics/codes/manifest.js.map +1 -0
  91. package/dist/diagnostics/codes/network.d.ts +8 -0
  92. package/dist/diagnostics/codes/network.d.ts.map +1 -0
  93. package/dist/diagnostics/codes/network.js +30 -0
  94. package/dist/diagnostics/codes/network.js.map +1 -0
  95. package/dist/diagnostics/codes/platform.d.ts +8 -0
  96. package/dist/diagnostics/codes/platform.d.ts.map +1 -0
  97. package/dist/diagnostics/codes/platform.js +18 -0
  98. package/dist/diagnostics/codes/platform.js.map +1 -0
  99. package/dist/diagnostics/codes/publish.d.ts +8 -0
  100. package/dist/diagnostics/codes/publish.d.ts.map +1 -0
  101. package/dist/diagnostics/codes/publish.js +44 -0
  102. package/dist/diagnostics/codes/publish.js.map +1 -0
  103. package/dist/diagnostics/codes/regression.d.ts +8 -0
  104. package/dist/diagnostics/codes/regression.d.ts.map +1 -0
  105. package/dist/diagnostics/codes/regression.js +77 -0
  106. package/dist/diagnostics/codes/regression.js.map +1 -0
  107. package/dist/diagnostics/codes/runtime.d.ts +8 -0
  108. package/dist/diagnostics/codes/runtime.d.ts.map +1 -0
  109. package/dist/diagnostics/codes/runtime.js +66 -0
  110. package/dist/diagnostics/codes/runtime.js.map +1 -0
  111. package/dist/diagnostics/codes/secret.d.ts +8 -0
  112. package/dist/diagnostics/codes/secret.d.ts.map +1 -0
  113. package/dist/diagnostics/codes/secret.js +18 -0
  114. package/dist/diagnostics/codes/secret.js.map +1 -0
  115. package/dist/diagnostics/codes/smoke.d.ts +8 -0
  116. package/dist/diagnostics/codes/smoke.d.ts.map +1 -0
  117. package/dist/diagnostics/codes/smoke.js +30 -0
  118. package/dist/diagnostics/codes/smoke.js.map +1 -0
  119. package/dist/diagnostics/codes/submit.d.ts +8 -0
  120. package/dist/diagnostics/codes/submit.d.ts.map +1 -0
  121. package/dist/diagnostics/codes/submit.js +99 -0
  122. package/dist/diagnostics/codes/submit.js.map +1 -0
  123. package/dist/diagnostics/codes/target.d.ts +8 -0
  124. package/dist/diagnostics/codes/target.d.ts.map +1 -0
  125. package/dist/diagnostics/codes/target.js +18 -0
  126. package/dist/diagnostics/codes/target.js.map +1 -0
  127. package/dist/diagnostics/codes/type.d.ts +8 -0
  128. package/dist/diagnostics/codes/type.d.ts.map +1 -0
  129. package/dist/diagnostics/codes/type.js +30 -0
  130. package/dist/diagnostics/codes/type.js.map +1 -0
  131. package/dist/diagnostics/codes/verify.d.ts +8 -0
  132. package/dist/diagnostics/codes/verify.d.ts.map +1 -0
  133. package/dist/diagnostics/codes/verify.js +99 -0
  134. package/dist/diagnostics/codes/verify.js.map +1 -0
  135. package/dist/diagnostics/diagnostic.d.ts +79 -0
  136. package/dist/diagnostics/diagnostic.d.ts.map +1 -0
  137. package/dist/diagnostics/diagnostic.js +131 -0
  138. package/dist/diagnostics/diagnostic.js.map +1 -0
  139. package/dist/diagnostics/spec.d.ts +49 -0
  140. package/dist/diagnostics/spec.d.ts.map +1 -0
  141. package/dist/diagnostics/spec.js +31 -0
  142. package/dist/diagnostics/spec.js.map +1 -0
  143. package/dist/hygiene.d.ts +66 -0
  144. package/dist/hygiene.d.ts.map +1 -0
  145. package/dist/hygiene.js +134 -0
  146. package/dist/hygiene.js.map +1 -0
  147. package/dist/ids.d.ts +119 -0
  148. package/dist/ids.d.ts.map +1 -0
  149. package/dist/ids.js +135 -0
  150. package/dist/ids.js.map +1 -0
  151. package/dist/index.d.ts +86 -0
  152. package/dist/index.js +86 -0
  153. package/dist/interaction.d.ts +391 -0
  154. package/dist/interaction.d.ts.map +1 -0
  155. package/dist/interaction.js +306 -0
  156. package/dist/interaction.js.map +1 -0
  157. package/dist/manifest.d.ts +97 -0
  158. package/dist/manifest.d.ts.map +1 -0
  159. package/dist/manifest.js +101 -0
  160. package/dist/manifest.js.map +1 -0
  161. package/dist/method.d.ts +26 -0
  162. package/dist/method.d.ts.map +1 -0
  163. package/dist/method.js +10 -0
  164. package/dist/method.js.map +1 -0
  165. package/dist/methods/artifact/create.d.ts +29 -0
  166. package/dist/methods/artifact/create.d.ts.map +1 -0
  167. package/dist/methods/artifact/create.js +31 -0
  168. package/dist/methods/artifact/create.js.map +1 -0
  169. package/dist/methods/artifact/get.d.ts +17 -0
  170. package/dist/methods/artifact/get.d.ts.map +1 -0
  171. package/dist/methods/artifact/get.js +21 -0
  172. package/dist/methods/artifact/get.js.map +1 -0
  173. package/dist/methods/artifact/list.d.ts +22 -0
  174. package/dist/methods/artifact/list.d.ts.map +1 -0
  175. package/dist/methods/artifact/list.js +19 -0
  176. package/dist/methods/artifact/list.js.map +1 -0
  177. package/dist/methods/artifact/publish.d.ts +28 -0
  178. package/dist/methods/artifact/publish.d.ts.map +1 -0
  179. package/dist/methods/artifact/publish.js +28 -0
  180. package/dist/methods/artifact/publish.js.map +1 -0
  181. package/dist/methods/artifact/verify.d.ts +29 -0
  182. package/dist/methods/artifact/verify.d.ts.map +1 -0
  183. package/dist/methods/artifact/verify.js +27 -0
  184. package/dist/methods/artifact/verify.js.map +1 -0
  185. package/dist/methods/deps/add.d.ts +43 -0
  186. package/dist/methods/deps/add.d.ts.map +1 -0
  187. package/dist/methods/deps/add.js +40 -0
  188. package/dist/methods/deps/add.js.map +1 -0
  189. package/dist/methods/dev/start.d.ts +52 -0
  190. package/dist/methods/dev/start.d.ts.map +1 -0
  191. package/dist/methods/dev/start.js +56 -0
  192. package/dist/methods/dev/start.js.map +1 -0
  193. package/dist/methods/dev/stop.d.ts +16 -0
  194. package/dist/methods/dev/stop.d.ts.map +1 -0
  195. package/dist/methods/dev/stop.js +21 -0
  196. package/dist/methods/dev/stop.js.map +1 -0
  197. package/dist/methods/events/ack.d.ts +20 -0
  198. package/dist/methods/events/ack.d.ts.map +1 -0
  199. package/dist/methods/events/ack.js +26 -0
  200. package/dist/methods/events/ack.js.map +1 -0
  201. package/dist/methods/events/read.d.ts +40 -0
  202. package/dist/methods/events/read.d.ts.map +1 -0
  203. package/dist/methods/events/read.js +35 -0
  204. package/dist/methods/events/read.js.map +1 -0
  205. package/dist/methods/events/subscribe.d.ts +54 -0
  206. package/dist/methods/events/subscribe.d.ts.map +1 -0
  207. package/dist/methods/events/subscribe.js +44 -0
  208. package/dist/methods/events/subscribe.js.map +1 -0
  209. package/dist/methods/events/unsubscribe.d.ts +16 -0
  210. package/dist/methods/events/unsubscribe.d.ts.map +1 -0
  211. package/dist/methods/events/unsubscribe.js +21 -0
  212. package/dist/methods/events/unsubscribe.js.map +1 -0
  213. package/dist/methods/gc/run.d.ts +76 -0
  214. package/dist/methods/gc/run.d.ts.map +1 -0
  215. package/dist/methods/gc/run.js +56 -0
  216. package/dist/methods/gc/run.js.map +1 -0
  217. package/dist/methods/index.d.ts +6 -0
  218. package/dist/methods/index.d.ts.map +1 -0
  219. package/dist/methods/index.js +78 -0
  220. package/dist/methods/index.js.map +1 -0
  221. package/dist/methods/instance/check.d.ts +30 -0
  222. package/dist/methods/instance/check.d.ts.map +1 -0
  223. package/dist/methods/instance/check.js +34 -0
  224. package/dist/methods/instance/check.js.map +1 -0
  225. package/dist/methods/instance/status.d.ts +102 -0
  226. package/dist/methods/instance/status.d.ts.map +1 -0
  227. package/dist/methods/instance/status.js +83 -0
  228. package/dist/methods/instance/status.js.map +1 -0
  229. package/dist/methods/live/push.d.ts +28 -0
  230. package/dist/methods/live/push.d.ts.map +1 -0
  231. package/dist/methods/live/push.js +35 -0
  232. package/dist/methods/live/push.js.map +1 -0
  233. package/dist/methods/mostra/initialize.d.ts +143 -0
  234. package/dist/methods/mostra/initialize.d.ts.map +1 -0
  235. package/dist/methods/mostra/initialize.js +97 -0
  236. package/dist/methods/mostra/initialize.js.map +1 -0
  237. package/dist/methods/mostra/shutdown.d.ts +14 -0
  238. package/dist/methods/mostra/shutdown.d.ts.map +1 -0
  239. package/dist/methods/mostra/shutdown.js +22 -0
  240. package/dist/methods/mostra/shutdown.js.map +1 -0
  241. package/dist/methods/port/drafts-mirror.d.ts +30 -0
  242. package/dist/methods/port/drafts-mirror.d.ts.map +1 -0
  243. package/dist/methods/port/drafts-mirror.js +33 -0
  244. package/dist/methods/port/drafts-mirror.js.map +1 -0
  245. package/dist/methods/port/secrets-get.d.ts +19 -0
  246. package/dist/methods/port/secrets-get.d.ts.map +1 -0
  247. package/dist/methods/port/secrets-get.js +31 -0
  248. package/dist/methods/port/secrets-get.js.map +1 -0
  249. package/dist/methods/port/submissions-deliver.d.ts +38 -0
  250. package/dist/methods/port/submissions-deliver.d.ts.map +1 -0
  251. package/dist/methods/port/submissions-deliver.js +38 -0
  252. package/dist/methods/port/submissions-deliver.js.map +1 -0
  253. package/dist/methods/port/trusted-controls-activated.d.ts +27 -0
  254. package/dist/methods/port/trusted-controls-activated.d.ts.map +1 -0
  255. package/dist/methods/port/trusted-controls-activated.js +33 -0
  256. package/dist/methods/port/trusted-controls-activated.js.map +1 -0
  257. package/dist/methods/port/trusted-controls-policy.d.ts +21 -0
  258. package/dist/methods/port/trusted-controls-policy.d.ts.map +1 -0
  259. package/dist/methods/port/trusted-controls-policy.js +27 -0
  260. package/dist/methods/port/trusted-controls-policy.js.map +1 -0
  261. package/dist/methods/results/get.d.ts +32 -0
  262. package/dist/methods/results/get.d.ts.map +1 -0
  263. package/dist/methods/results/get.js +36 -0
  264. package/dist/methods/results/get.js.map +1 -0
  265. package/dist/methods/secret/delete.d.ts +22 -0
  266. package/dist/methods/secret/delete.d.ts.map +1 -0
  267. package/dist/methods/secret/delete.js +32 -0
  268. package/dist/methods/secret/delete.js.map +1 -0
  269. package/dist/methods/secret/list.d.ts +21 -0
  270. package/dist/methods/secret/list.d.ts.map +1 -0
  271. package/dist/methods/secret/list.js +29 -0
  272. package/dist/methods/secret/list.js.map +1 -0
  273. package/dist/methods/secret/set.d.ts +37 -0
  274. package/dist/methods/secret/set.d.ts.map +1 -0
  275. package/dist/methods/secret/set.js +41 -0
  276. package/dist/methods/secret/set.js.map +1 -0
  277. package/dist/methods/state/get.d.ts +25 -0
  278. package/dist/methods/state/get.d.ts.map +1 -0
  279. package/dist/methods/state/get.js +29 -0
  280. package/dist/methods/state/get.js.map +1 -0
  281. package/dist/methods/state/patch.d.ts +32 -0
  282. package/dist/methods/state/patch.d.ts.map +1 -0
  283. package/dist/methods/state/patch.js +29 -0
  284. package/dist/methods/state/patch.js.map +1 -0
  285. package/dist/methods/view/default.d.ts +19 -0
  286. package/dist/methods/view/default.d.ts.map +1 -0
  287. package/dist/methods/view/default.js +23 -0
  288. package/dist/methods/view/default.js.map +1 -0
  289. package/dist/methods/view/launch.d.ts +27 -0
  290. package/dist/methods/view/launch.d.ts.map +1 -0
  291. package/dist/methods/view/launch.js +30 -0
  292. package/dist/methods/view/launch.js.map +1 -0
  293. package/dist/methods/view/revoke.d.ts +19 -0
  294. package/dist/methods/view/revoke.d.ts.map +1 -0
  295. package/dist/methods/view/revoke.js +26 -0
  296. package/dist/methods/view/revoke.js.map +1 -0
  297. package/dist/methods/view/rotate.d.ts +21 -0
  298. package/dist/methods/view/rotate.d.ts.map +1 -0
  299. package/dist/methods/view/rotate.js +27 -0
  300. package/dist/methods/view/rotate.js.map +1 -0
  301. package/dist/methods/view/url.d.ts +52 -0
  302. package/dist/methods/view/url.d.ts.map +1 -0
  303. package/dist/methods/view/url.js +43 -0
  304. package/dist/methods/view/url.js.map +1 -0
  305. package/dist/methods/wait/wait.d.ts +37 -0
  306. package/dist/methods/wait/wait.d.ts.map +1 -0
  307. package/dist/methods/wait/wait.js +39 -0
  308. package/dist/methods/wait/wait.js.map +1 -0
  309. package/dist/revision.d.ts +43 -0
  310. package/dist/revision.d.ts.map +1 -0
  311. package/dist/revision.js +69 -0
  312. package/dist/revision.js.map +1 -0
  313. package/dist/rpc/error.d.ts +47 -0
  314. package/dist/rpc/error.d.ts.map +1 -0
  315. package/dist/rpc/error.js +77 -0
  316. package/dist/rpc/error.js.map +1 -0
  317. package/dist/rpc/lines.d.ts +30 -0
  318. package/dist/rpc/lines.d.ts.map +1 -0
  319. package/dist/rpc/lines.js +63 -0
  320. package/dist/rpc/lines.js.map +1 -0
  321. package/dist/rpc/messages.d.ts +92 -0
  322. package/dist/rpc/messages.d.ts.map +1 -0
  323. package/dist/rpc/messages.js +133 -0
  324. package/dist/rpc/messages.js.map +1 -0
  325. package/dist/rpc/peer.d.ts +81 -0
  326. package/dist/rpc/peer.d.ts.map +1 -0
  327. package/dist/rpc/peer.js +208 -0
  328. package/dist/rpc/peer.js.map +1 -0
  329. package/dist/serializer.d.ts +178 -0
  330. package/dist/serializer.d.ts.map +1 -0
  331. package/dist/serializer.js +929 -0
  332. package/dist/serializer.js.map +1 -0
  333. package/dist/verify.d.ts +254 -0
  334. package/dist/verify.d.ts.map +1 -0
  335. package/dist/verify.js +243 -0
  336. package/dist/verify.js.map +1 -0
  337. package/dist/view.d.ts +103 -0
  338. package/dist/view.d.ts.map +1 -0
  339. package/dist/view.js +110 -0
  340. package/dist/view.js.map +1 -0
  341. package/dist/wire-registry.js +11 -0
  342. package/dist/wire-registry.js.map +1 -0
  343. package/dist/worker.d.ts +249 -0
  344. package/dist/worker.d.ts.map +1 -0
  345. package/dist/worker.js +158 -0
  346. package/dist/worker.js.map +1 -0
  347. package/package.json +114 -3
  348. package/schemas/protocol.draft-07.json +5120 -0
  349. package/schemas/protocol.schema.json +4964 -0
  350. package/src/actions.ts +418 -0
  351. package/src/artifact.ts +187 -0
  352. package/src/bridge.ts +618 -0
  353. package/src/browser.ts +374 -0
  354. package/src/bundle.ts +264 -0
  355. package/src/canonical.ts +49 -0
  356. package/src/capability.ts +92 -0
  357. package/src/diagnostics/codes/a11y.ts +41 -0
  358. package/src/diagnostics/codes/action.ts +125 -0
  359. package/src/diagnostics/codes/artifact.ts +137 -0
  360. package/src/diagnostics/codes/build.ts +65 -0
  361. package/src/diagnostics/codes/cli.ts +53 -0
  362. package/src/diagnostics/codes/console.ts +41 -0
  363. package/src/diagnostics/codes/dep.ts +101 -0
  364. package/src/diagnostics/codes/env.ts +149 -0
  365. package/src/diagnostics/codes/field.ts +113 -0
  366. package/src/diagnostics/codes/home.ts +150 -0
  367. package/src/diagnostics/codes/host.ts +197 -0
  368. package/src/diagnostics/codes/hygiene.ts +175 -0
  369. package/src/diagnostics/codes/index.ts +142 -0
  370. package/src/diagnostics/codes/live.ts +41 -0
  371. package/src/diagnostics/codes/manifest.ts +53 -0
  372. package/src/diagnostics/codes/network.ts +41 -0
  373. package/src/diagnostics/codes/platform.ts +30 -0
  374. package/src/diagnostics/codes/publish.ts +53 -0
  375. package/src/diagnostics/codes/regression.ts +89 -0
  376. package/src/diagnostics/codes/runtime.ts +77 -0
  377. package/src/diagnostics/codes/secret.ts +29 -0
  378. package/src/diagnostics/codes/smoke.ts +41 -0
  379. package/src/diagnostics/codes/submit.ts +113 -0
  380. package/src/diagnostics/codes/target.ts +29 -0
  381. package/src/diagnostics/codes/type.ts +41 -0
  382. package/src/diagnostics/codes/verify.ts +113 -0
  383. package/src/diagnostics/diagnostic.ts +240 -0
  384. package/src/diagnostics/spec.ts +90 -0
  385. package/src/hygiene.ts +224 -0
  386. package/src/ids.ts +279 -0
  387. package/src/index.ts +576 -0
  388. package/src/interaction.ts +728 -0
  389. package/src/manifest.ts +206 -0
  390. package/src/method.ts +42 -0
  391. package/src/methods/artifact/create.ts +56 -0
  392. package/src/methods/artifact/get.ts +30 -0
  393. package/src/methods/artifact/list.ts +42 -0
  394. package/src/methods/artifact/publish.ts +46 -0
  395. package/src/methods/artifact/verify.ts +46 -0
  396. package/src/methods/deps/add.ts +72 -0
  397. package/src/methods/dev/start.ts +84 -0
  398. package/src/methods/dev/stop.ts +32 -0
  399. package/src/methods/events/ack.ts +41 -0
  400. package/src/methods/events/read.ts +67 -0
  401. package/src/methods/events/subscribe.ts +91 -0
  402. package/src/methods/events/unsubscribe.ts +35 -0
  403. package/src/methods/gc/run.ts +125 -0
  404. package/src/methods/index.ts +81 -0
  405. package/src/methods/instance/check.ts +61 -0
  406. package/src/methods/instance/status.ts +172 -0
  407. package/src/methods/live/push.ts +54 -0
  408. package/src/methods/mostra/initialize.ts +249 -0
  409. package/src/methods/mostra/shutdown.ts +31 -0
  410. package/src/methods/port/drafts-mirror.ts +52 -0
  411. package/src/methods/port/secrets-get.ts +40 -0
  412. package/src/methods/port/submissions-deliver.ts +70 -0
  413. package/src/methods/port/trusted-controls-activated.ts +51 -0
  414. package/src/methods/port/trusted-controls-policy.ts +38 -0
  415. package/src/methods/results/get.ts +59 -0
  416. package/src/methods/secret/delete.ts +43 -0
  417. package/src/methods/secret/list.ts +40 -0
  418. package/src/methods/secret/set.ts +69 -0
  419. package/src/methods/state/get.ts +44 -0
  420. package/src/methods/state/patch.ts +51 -0
  421. package/src/methods/view/default.ts +32 -0
  422. package/src/methods/view/launch.ts +47 -0
  423. package/src/methods/view/revoke.ts +39 -0
  424. package/src/methods/view/rotate.ts +37 -0
  425. package/src/methods/view/url.ts +84 -0
  426. package/src/methods/wait/wait.ts +58 -0
  427. package/src/revision.ts +101 -0
  428. package/src/rpc/error.ts +107 -0
  429. package/src/rpc/lines.ts +70 -0
  430. package/src/rpc/messages.ts +188 -0
  431. package/src/rpc/peer.ts +341 -0
  432. package/src/serializer.ts +1217 -0
  433. package/src/timers.d.ts +8 -0
  434. package/src/verify.ts +458 -0
  435. package/src/view.ts +200 -0
  436. package/src/web-crypto.d.ts +9 -0
  437. package/src/web-platform.d.ts +35 -0
  438. package/src/wire-registry.ts +14 -0
  439. package/src/worker.ts +374 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"home.js","names":[],"sources":["../../../src/diagnostics/codes/home.ts"],"sourcesContent":["/**\n * Diagnostic codes of the HOME area: the Mostra home, its ledger and the instance that owns it\n * (DATA_MODEL §1, §6; FAILURE_MODEL §2, §3).\n */\nimport type { AreaCatalog } from \"../spec.ts\";\n\n/** The codes of the HOME area, in the order they were added. */\nexport const homeDiagnosticCodes = [\n \"MOSTRA_HOME_LOCKED\",\n \"MOSTRA_HOME_NOT_OWNED\",\n \"MOSTRA_HOME_SOCKET_TOO_LONG\",\n \"MOSTRA_HOME_TOO_NEW\",\n \"MOSTRA_HOME_LEDGER_UNREADABLE\",\n \"MOSTRA_HOME_DISK_FULL\",\n \"MOSTRA_HOME_GONE\",\n \"MOSTRA_HOME_MISMATCH\",\n \"MOSTRA_HOME_INTEGRITY\",\n \"MOSTRA_HOME_NOT_ALWAYS_ON\",\n \"MOSTRA_HOME_GC_INCOMPLETE\",\n // gen:codes\n] as const;\n\n/** The codes of the HOME area. */\nexport type HomeDiagnosticCode = (typeof homeDiagnosticCodes)[number];\n\n/** The HOME area's catalog entries. */\nexport const homeDiagnostics: AreaCatalog<HomeDiagnosticCode> = {\n MOSTRA_HOME_LOCKED: {\n severity: \"error\",\n phase: \"host\",\n title: \"Home in use by another instance\",\n hint: \"Use the instance that already owns this home, or stop it (`mostra daemon stop`, or end the process named in the message) and start again.\",\n docs: {\n explanation:\n \"One Mostra instance owns a home at a time. It holds an exclusive lock on the home's ledger, and the operating system releases that lock when the process exits. Mostra reports this code in two cases: `mostra host` was started for a home another instance already owns, or a starter found the owner but couldn't reach its control socket. The message names the owner's process ID.\",\n fix: \"To share the running instance, attach to it: start the client with the same home (`MOSTRA_HOME` or `--home`) instead of starting a second instance. To replace it, stop it with `mostra daemon stop`, or end the process named in the message, and start again. A host that needs its own instance gives it its own home.\",\n },\n },\n MOSTRA_HOME_NOT_OWNED: {\n severity: \"error\",\n phase: \"host\",\n title: \"Directory not owned by you\",\n hint: \"Choose a home you own with `--home` or `MOSTRA_HOME`, or give the directory named in the message back to your user with `chown`.\",\n docs: {\n explanation:\n \"Mostra keeps secrets, answers and its ledger in the home, and its control socket in a runtime directory, so it uses only directories that belong to the user running it. It reports this code when the home or the runtime directory is owned by another user, or when the path exists but isn't a directory. Mostra changes nothing in that case.\",\n fix: \"Point Mostra at a directory you own: `--home <dir>` or `MOSTRA_HOME` for the home, `MOSTRA_RUNTIME_DIR` for the runtime directory. If the directory should be yours, change its owner with `chown`. Mostra tightens a directory you own to mode 0700 by itself.\",\n },\n },\n MOSTRA_HOME_SOCKET_TOO_LONG: {\n severity: \"error\",\n phase: \"host\",\n title: \"Control socket path too long\",\n hint: \"Set `MOSTRA_RUNTIME_DIR` to a short directory you own, for example `/tmp/mostra-$USER`, and start again.\",\n docs: {\n explanation:\n \"Clients reach an instance through a Unix socket in a per-user runtime directory. The operating system limits a socket path to 103 bytes on macOS and 107 on Linux, and the path Mostra computed is longer, usually because the home directory's path is long. Mostra stops instead of using a different place that clients couldn't find.\",\n fix: \"Set `MOSTRA_RUNTIME_DIR` to a short directory you own, such as `/tmp/mostra-$USER`, in the environment of every Mostra client and host that uses this home. Mostra creates it with mode 0700 and re-creates its socket if a temporary-file cleanup removes it.\",\n },\n },\n MOSTRA_HOME_TOO_NEW: {\n severity: \"error\",\n phase: \"host\",\n title: \"Home written by a newer Mostra\",\n hint: \"Run a Mostra release at least as new as the one named in the message, or use another home with `--home`.\",\n docs: {\n explanation:\n \"A newer Mostra migrated this home's ledger to a schema version this runtime doesn't know. Reading it could misinterpret or lose data, so this runtime refuses to open it. The message names the schema version and the release that wrote it.\",\n fix: \"Upgrade the runtime (or the host or CLI that bundles it) to at least the release named in the message. Mostra never migrates a ledger backwards; to keep an older release, give it a separate home with `--home` or `MOSTRA_HOME`.\",\n },\n },\n MOSTRA_HOME_LEDGER_UNREADABLE: {\n severity: \"error\",\n phase: \"host\",\n title: \"Ledger can't be read\",\n hint: \"Restore the ledger from the latest `ledger.sqlite.bak-*` backup in the home's `store/` directory, or move the damaged file aside.\",\n docs: {\n explanation:\n \"The ledger (`store/ledger.sqlite` in the home) holds drafts, submissions, events and the rest of the home's interaction data. Mostra reports this code when the file can't be opened, isn't a SQLite database, isn't a Mostra ledger, or fails SQLite's integrity check. Mostra never replaces an existing ledger with an empty one.\",\n fix: \"Stop every Mostra process for this home. Copy `store/ledger.sqlite` somewhere safe, then restore the newest `store/ledger.sqlite.bak-<from>-<to>` in its place, or move the damaged file aside to start an empty ledger. Versions, sources and blobs in the home are untouched either way.\",\n },\n },\n MOSTRA_HOME_DISK_FULL: {\n severity: \"error\",\n phase: \"host\",\n title: \"Disk full\",\n hint: \"Free space on the disk that holds the Mostra home, then retry.\",\n docs: {\n explanation:\n \"A ledger write failed because the disk holding the home is full. The transaction was rolled back, so nothing partial was saved and nothing that was acknowledged earlier is lost. Viewers keep unsaved edits in their browser until a retry succeeds.\",\n fix: \"Free space on that disk (`mostra gc` removes unreferenced versions; build caches can be deleted), then retry the operation. Retries with the same request or mutation ID are safe.\",\n },\n },\n MOSTRA_HOME_GONE: {\n severity: \"error\",\n phase: \"host\",\n title: \"Home directory removed\",\n hint: \"Restore or recreate the home directory, then start Mostra again.\",\n docs: {\n explanation:\n \"The instance's home directory disappeared or was replaced while the instance was running. Writing anywhere else could split the home's data, so the instance stops accepting requests, stops its child processes and exits.\",\n fix: \"Put the home back (or choose a new one with `--home` or `MOSTRA_HOME`) and start Mostra again. Clients reconnect and retry their requests by ID.\",\n },\n },\n MOSTRA_HOME_MISMATCH: {\n severity: \"error\",\n phase: \"host\",\n title: \"Instance serves a different home\",\n hint: \"Connect to the instance for the home you expect, or start it with `--home` set to that home.\",\n docs: {\n explanation:\n \"A client sent `home.path` in `mostra/initialize`, and it names a different home from the one the instance locked at start-up. The home is chosen when the instance starts (`--home`, then `MOSTRA_HOME`, then the platform default), so `home.path` is a check: it stops a client from writing to a home it didn't mean.\",\n fix: \"Start the instance with `--home` set to the home the client expects, or connect to the socket of the instance that serves it. Leave `home.path` out to accept whichever home the instance serves.\",\n },\n },\n MOSTRA_HOME_INTEGRITY: {\n severity: \"error\",\n phase: \"host\",\n title: \"Stored version or file damaged\",\n hint: \"Publish the version's source again to rebuild a damaged version in place, and run `mostra doctor` for other damaged objects.\",\n docs: {\n explanation:\n \"Mostra checks stored versions, source snapshots and blobs against their recorded content digests before using them. This code means a stored object is missing or its content changed after it was written, for example after a disk error or a manual edit inside the home. The message names the object.\",\n fix: \"Leave files inside the home unchanged. To repair a version, publish the same source again: Mostra rebuilds the version's directory and puts it back under the same version ID, and the artifact keeps its version number. If the source has changed since, the publish makes a new version and the damaged one stays as it is; its source snapshot in the home holds the original files. `mostra doctor` lists other damaged objects.\",\n },\n },\n MOSTRA_HOME_NOT_ALWAYS_ON: {\n severity: \"warning\",\n phase: \"host\",\n title: \"Long-lived artifacts without an always-on daemon\",\n hint: \"Run `mostra daemon install` so the home's daemon runs as a login service and these artifacts answer at any hour.\",\n docs: {\n explanation:\n \"The home has artifacts with submission policy `none`, which are meant to stay open (dashboards, task managers, D63), but no login service runs its daemon. Without one, the daemon exits after 30 idle minutes and their links stop answering until a command starts it again.\",\n fix: \"Run `mostra daemon install`. It registers a launchd or systemd user service that keeps the home's daemon running; `mostra daemon uninstall` removes it.\",\n },\n },\n MOSTRA_HOME_GC_INCOMPLETE: {\n severity: \"warning\",\n phase: \"host\",\n title: \"gc didn't finish a step\",\n hint: \"Run `mostra gc` again: what this run removed is in its result, and the next run picks up what it left.\",\n docs: {\n explanation:\n \"`mostra gc` removes what nothing references in steps: version files, source snapshots, lock layouts, the package store, verify's caches and, when asked, events. One step failed (the message names it and why), so it left that step's files in place. Everything an earlier step removed is listed in the result, and the versions it collected stay collected. The home is consistent: what gc left is still recorded as there.\",\n fix: \"Run `mostra gc` again; a failure that repeats names its cause in the message (for example, a file the user can't remove).\",\n },\n },\n // gen:entries\n};\n"],"mappings":";;AAOA,MAAa,sBAAsB;CACjC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AAEF;;AAMA,MAAa,kBAAmD;CAC9D,oBAAoB;EAClB,UAAU;EACV,OAAO;EACP,OAAO;EACP,MAAM;EACN,MAAM;GACJ,aACE;GACF,KAAK;EACP;CACF;CACA,uBAAuB;EACrB,UAAU;EACV,OAAO;EACP,OAAO;EACP,MAAM;EACN,MAAM;GACJ,aACE;GACF,KAAK;EACP;CACF;CACA,6BAA6B;EAC3B,UAAU;EACV,OAAO;EACP,OAAO;EACP,MAAM;EACN,MAAM;GACJ,aACE;GACF,KAAK;EACP;CACF;CACA,qBAAqB;EACnB,UAAU;EACV,OAAO;EACP,OAAO;EACP,MAAM;EACN,MAAM;GACJ,aACE;GACF,KAAK;EACP;CACF;CACA,+BAA+B;EAC7B,UAAU;EACV,OAAO;EACP,OAAO;EACP,MAAM;EACN,MAAM;GACJ,aACE;GACF,KAAK;EACP;CACF;CACA,uBAAuB;EACrB,UAAU;EACV,OAAO;EACP,OAAO;EACP,MAAM;EACN,MAAM;GACJ,aACE;GACF,KAAK;EACP;CACF;CACA,kBAAkB;EAChB,UAAU;EACV,OAAO;EACP,OAAO;EACP,MAAM;EACN,MAAM;GACJ,aACE;GACF,KAAK;EACP;CACF;CACA,sBAAsB;EACpB,UAAU;EACV,OAAO;EACP,OAAO;EACP,MAAM;EACN,MAAM;GACJ,aACE;GACF,KAAK;EACP;CACF;CACA,uBAAuB;EACrB,UAAU;EACV,OAAO;EACP,OAAO;EACP,MAAM;EACN,MAAM;GACJ,aACE;GACF,KAAK;EACP;CACF;CACA,2BAA2B;EACzB,UAAU;EACV,OAAO;EACP,OAAO;EACP,MAAM;EACN,MAAM;GACJ,aACE;GACF,KAAK;EACP;CACF;CACA,2BAA2B;EACzB,UAAU;EACV,OAAO;EACP,OAAO;EACP,MAAM;EACN,MAAM;GACJ,aACE;GACF,KAAK;EACP;CACF;AAEF"}
@@ -0,0 +1,8 @@
1
+ import "../spec.js";
2
+ //#region src/diagnostics/codes/host.d.ts
3
+ /** The codes of the HOST area, in the order they were added. */
4
+ export declare const hostDiagnosticCodes: readonly ["MOSTRA_HOST_REVISION_UNSUPPORTED", "MOSTRA_HOST_MALFORMED", "MOSTRA_HOST_METHOD_UNKNOWN", "MOSTRA_HOST_INVALID_PARAMS", "MOSTRA_HOST_INTERNAL_ERROR", "MOSTRA_HOST_INITIALIZE_ORDER", "MOSTRA_HOST_PORT_UNSUPPORTED", "MOSTRA_HOST_CONNECTION_CLOSED", "MOSTRA_HOST_TIMEOUT", "MOSTRA_HOST_SHUTDOWN_REFUSED", "MOSTRA_HOST_REQUEST_ID_REUSED", "MOSTRA_HOST_CURSOR_COMPACTED", "MOSTRA_HOST_SUBSCRIPTION_UNKNOWN", "MOSTRA_HOST_NOTIFICATION_UNSUPPORTED", "MOSTRA_HOST_MESSAGE_TOO_LARGE"];
5
+ /** The codes of the HOST area. */
6
+ export type HostDiagnosticCode = (typeof hostDiagnosticCodes)[number];
7
+ //#endregion
8
+ //# sourceMappingURL=host.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"host.d.ts","names":[],"sources":["../../../src/diagnostics/codes/host.ts"],"mappings":";;;qBAMa;;YAoBD,6BAA6B"}
@@ -0,0 +1,176 @@
1
+ //#region src/diagnostics/codes/host.ts
2
+ /** The codes of the HOST area, in the order they were added. */
3
+ const hostDiagnosticCodes = [
4
+ "MOSTRA_HOST_REVISION_UNSUPPORTED",
5
+ "MOSTRA_HOST_MALFORMED",
6
+ "MOSTRA_HOST_METHOD_UNKNOWN",
7
+ "MOSTRA_HOST_INVALID_PARAMS",
8
+ "MOSTRA_HOST_INTERNAL_ERROR",
9
+ "MOSTRA_HOST_INITIALIZE_ORDER",
10
+ "MOSTRA_HOST_PORT_UNSUPPORTED",
11
+ "MOSTRA_HOST_CONNECTION_CLOSED",
12
+ "MOSTRA_HOST_TIMEOUT",
13
+ "MOSTRA_HOST_SHUTDOWN_REFUSED",
14
+ "MOSTRA_HOST_REQUEST_ID_REUSED",
15
+ "MOSTRA_HOST_CURSOR_COMPACTED",
16
+ "MOSTRA_HOST_SUBSCRIPTION_UNKNOWN",
17
+ "MOSTRA_HOST_NOTIFICATION_UNSUPPORTED",
18
+ "MOSTRA_HOST_MESSAGE_TOO_LARGE"
19
+ ];
20
+ /** The HOST area's catalog entries. */
21
+ const hostDiagnostics = {
22
+ MOSTRA_HOST_REVISION_UNSUPPORTED: {
23
+ severity: "error",
24
+ phase: "host",
25
+ title: "No common host protocol revision",
26
+ hint: "Run the client and the instance from the same Mostra release, for example with `mostra daemon restart`.",
27
+ docs: {
28
+ explanation: "A client and a Mostra instance agree on a host protocol revision when they connect (`mostra/initialize`). The client offers the revisions it speaks, and the instance picks the newest one it also supports. This code means the two lists have nothing in common, usually because the client and the running daemon come from Mostra releases far apart.",
29
+ fix: "Restart the daemon so it runs the same release as the client: `mostra daemon restart`. Durable state survives the restart, and open views reconnect. A host that embeds Mostra updates its pinned Mostra runtime or its host library until both support a common revision."
30
+ }
31
+ },
32
+ MOSTRA_HOST_MALFORMED: {
33
+ severity: "error",
34
+ phase: "host",
35
+ title: "Malformed protocol message",
36
+ hint: "Send each message as one line of JSON holding a single JSON-RPC 2.0 request or notification.",
37
+ docs: {
38
+ explanation: "Every message on a Mostra connection is one line of JSON with one JSON-RPC 2.0 object. This code means a line wasn't valid JSON, wasn't a JSON-RPC 2.0 request or response, or was a batch (a JSON array), which revision `2026-10-10` doesn't accept. A client also reports it when a response doesn't match the method's result schema.",
39
+ fix: "Encode one request per line with `\"jsonrpc\": \"2.0\"`, a `method`, an `id` for requests, and `params` as an object. Send several requests as separate lines instead of a batch."
40
+ }
41
+ },
42
+ MOSTRA_HOST_METHOD_UNKNOWN: {
43
+ severity: "error",
44
+ phase: "host",
45
+ title: "Unknown protocol method",
46
+ hint: "Call only the methods listed in `capabilities.methods` of the `mostra/initialize` result.",
47
+ docs: {
48
+ explanation: "The instance doesn't serve the method that was called. Either the name is misspelled, or the client is newer than the instance and calls a method the instance's release doesn't have.",
49
+ fix: "Check the method name against INTERFACES §6, and against `capabilities.methods` in the `mostra/initialize` result, which lists every method this instance serves. Upgrade the instance if the client needs a newer method."
50
+ }
51
+ },
52
+ MOSTRA_HOST_INVALID_PARAMS: {
53
+ severity: "error",
54
+ phase: "host",
55
+ title: "Invalid method params",
56
+ hint: "Fix the params named in the message so they match the method's schema.",
57
+ docs: {
58
+ explanation: "The request's `params` don't match the method's published schema: a required field is missing, a value has the wrong type, or a value is outside its allowed range. The message names the first problem found.",
59
+ fix: "Compare the request with the method's schema in `@mostra/protocol` (or the published JSON Schema) and correct the field named in the message."
60
+ }
61
+ },
62
+ MOSTRA_HOST_INTERNAL_ERROR: {
63
+ severity: "error",
64
+ phase: "host",
65
+ title: "Unexpected failure in the instance",
66
+ hint: "Retry the request with the same request ID; if it fails again, report it with the instance's log.",
67
+ docs: {
68
+ explanation: "The instance failed while handling the request, for a reason that isn't one of its known conditions. Durable state is unaffected: a request is acknowledged only after its ledger transaction commits. The details are in the instance's log (`logs/supervisor.log` in the home), not in the response.",
69
+ fix: "Retry the request with the same request ID; retries are idempotent. If the failure repeats, report it with the relevant lines of `logs/supervisor.log`."
70
+ }
71
+ },
72
+ MOSTRA_HOST_INITIALIZE_ORDER: {
73
+ severity: "error",
74
+ phase: "host",
75
+ title: "Initialize first, and only once",
76
+ hint: "Send `mostra/initialize` as the first request on the connection, and only once.",
77
+ docs: {
78
+ explanation: "Every connection starts with `mostra/initialize`, which agrees the protocol revision and registers the client's ports. The instance received another request before it, or a second `mostra/initialize` on the same connection.",
79
+ fix: "Send `mostra/initialize` first and wait for its result before any other request. To renegotiate, open a new connection."
80
+ }
81
+ },
82
+ MOSTRA_HOST_PORT_UNSUPPORTED: {
83
+ severity: "warning",
84
+ phase: "host",
85
+ title: "Port not supported by this instance",
86
+ hint: "Leave the port out of `mostra/initialize`, or run a Mostra release that lists it in `capabilities.ports`.",
87
+ docs: {
88
+ explanation: "The client registered a port this instance doesn't call, so registering it has no effect. The port may be reserved for a later release (such as `ai`), or the client may be newer than the instance. The session continues without the port, and Mostra uses its standalone behavior instead.",
89
+ fix: "Register only the ports listed in `capabilities.ports` of the `mostra/initialize` result. If the host needs the port, upgrade the instance to a release that supports it."
90
+ }
91
+ },
92
+ MOSTRA_HOST_CONNECTION_CLOSED: {
93
+ severity: "error",
94
+ phase: "host",
95
+ title: "Connection closed",
96
+ hint: "Reconnect, then retry the request with the same request ID.",
97
+ docs: {
98
+ explanation: "The connection to the other side closed before a response arrived, for example because the instance exited or restarted. The request may or may not have taken effect.",
99
+ fix: "Reconnect and send `mostra/initialize` again, then retry the request with the same request ID. Mutating methods are idempotent by request ID, so a retry never applies twice."
100
+ }
101
+ },
102
+ MOSTRA_HOST_TIMEOUT: {
103
+ severity: "error",
104
+ phase: "host",
105
+ title: "Request timed out",
106
+ hint: "Retry the request with the same request ID, or allow it more time.",
107
+ docs: {
108
+ explanation: "No response arrived within the time the caller allowed. The other side may still be working on the request, and it may still take effect.",
109
+ fix: "Retry with the same request ID, which returns the recorded result if the first attempt completed. Allow a longer timeout for slow operations."
110
+ }
111
+ },
112
+ MOSTRA_HOST_SHUTDOWN_REFUSED: {
113
+ severity: "error",
114
+ phase: "host",
115
+ title: "Only the spawning host can stop this instance",
116
+ hint: "Ask the host that started this instance to stop it, or end the connection you opened instead.",
117
+ docs: {
118
+ explanation: "An instance started by a host over stdio (`mostra host`) lives as long as that host's connection, so only the host may stop it with `mostra/shutdown`. A client that attached through the home's socket asked it to stop. A daemon (`mostra daemon`) accepts `mostra/shutdown` from every attached client (D87).",
119
+ fix: "Close your own connection when you are done. To stop the instance, stop the host that spawned it, or have the host send `mostra/shutdown` or close its stdio."
120
+ }
121
+ },
122
+ MOSTRA_HOST_REQUEST_ID_REUSED: {
123
+ severity: "error",
124
+ phase: "host",
125
+ title: "A requestId was reused with other parameters",
126
+ hint: "Send a new `requestId` for a new request; repeat the exact parameters only to retry one.",
127
+ docs: {
128
+ explanation: "A mutating method recorded its result under this `requestId` for different parameters. Replaying that result would answer a request nobody made (a link for another artifact or with other scopes, another source's publish), so the instance refuses (H-03). Retries with the same parameters still return the recorded result.",
129
+ fix: "Generate a fresh `requestId` for every new request, and reuse one only to retry the same request after a timeout or a lost connection."
130
+ }
131
+ },
132
+ MOSTRA_HOST_CURSOR_COMPACTED: {
133
+ severity: "error",
134
+ phase: "host",
135
+ title: "Events compacted",
136
+ hint: "Read from the cursor in the message to receive the compaction summary, then continue from there.",
137
+ docs: {
138
+ explanation: "Events before a cursor were compacted on request (`mostra gc --compact-events`, DATA_MODEL §4): an artifact's old events were replaced by one `artifact.compacted` event that summarizes them. A reader asking for events after an earlier cursor would miss some, and Mostra never leaves a silent gap.",
139
+ fix: "Read again with `after` set to the cursor the message names: the next event is the `artifact.compacted` summary. Rebuild what you track from it and continue as usual."
140
+ }
141
+ },
142
+ MOSTRA_HOST_SUBSCRIPTION_UNKNOWN: {
143
+ severity: "error",
144
+ phase: "host",
145
+ title: "Unknown subscription",
146
+ hint: "Subscribe again with `events/subscribe`, then use the ID it returns.",
147
+ docs: {
148
+ explanation: "The subscription ID belongs to no subscription on this connection: it was never created here, was ended with `events/unsubscribe`, or belonged to a connection that closed. Subscriptions live as long as their connection; a named subscriber's acknowledged cursor outlives it.",
149
+ fix: "Call `events/subscribe` again on this connection. With the same `name`, delivery resumes after the last acknowledged cursor."
150
+ }
151
+ },
152
+ MOSTRA_HOST_NOTIFICATION_UNSUPPORTED: {
153
+ severity: "error",
154
+ phase: "host",
155
+ title: "Notification not accepted",
156
+ hint: "List the notification in `capabilities.notifications` when you initialize.",
157
+ docs: {
158
+ explanation: "Mostra sends a client only the notifications it listed in `mostra/initialize` (D84). This method would send one the client didn't list, such as `events/notify` for `events/subscribe`.",
159
+ fix: "Reconnect and initialize with `capabilities: { notifications: [\"events/notify\"] }`, or poll with `events/read` instead."
160
+ }
161
+ },
162
+ MOSTRA_HOST_MESSAGE_TOO_LARGE: {
163
+ severity: "error",
164
+ phase: "host",
165
+ title: "Message too large for the protocol",
166
+ hint: "Ask for less at once: a specific submission, fewer events, or smaller values.",
167
+ docs: {
168
+ explanation: "One host-protocol message is one line of JSON, and a line holds at most 64 Mi characters (`MAX_LINE_LENGTH`), so neither side buffers without bound. Mostra checks every message before it writes it: an answer that would be longer is replaced by this error, and a delivery whose envelope would be longer is recorded as undeliverable instead of being sent and retried forever.",
169
+ fix: "Read less per request (`events/read` with a smaller `limit`, `results/get` for one submission), and keep artifacts' values within the field and document limits."
170
+ }
171
+ }
172
+ };
173
+ //#endregion
174
+ export { hostDiagnosticCodes, hostDiagnostics };
175
+
176
+ //# sourceMappingURL=host.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"host.js","names":[],"sources":["../../../src/diagnostics/codes/host.ts"],"sourcesContent":["/**\n * Diagnostic codes of the HOST area: the host protocol between clients and an instance.\n */\nimport type { AreaCatalog } from \"../spec.ts\";\n\n/** The codes of the HOST area, in the order they were added. */\nexport const hostDiagnosticCodes = [\n \"MOSTRA_HOST_REVISION_UNSUPPORTED\",\n \"MOSTRA_HOST_MALFORMED\",\n \"MOSTRA_HOST_METHOD_UNKNOWN\",\n \"MOSTRA_HOST_INVALID_PARAMS\",\n \"MOSTRA_HOST_INTERNAL_ERROR\",\n \"MOSTRA_HOST_INITIALIZE_ORDER\",\n \"MOSTRA_HOST_PORT_UNSUPPORTED\",\n \"MOSTRA_HOST_CONNECTION_CLOSED\",\n \"MOSTRA_HOST_TIMEOUT\",\n \"MOSTRA_HOST_SHUTDOWN_REFUSED\",\n \"MOSTRA_HOST_REQUEST_ID_REUSED\",\n \"MOSTRA_HOST_CURSOR_COMPACTED\",\n \"MOSTRA_HOST_SUBSCRIPTION_UNKNOWN\",\n \"MOSTRA_HOST_NOTIFICATION_UNSUPPORTED\",\n \"MOSTRA_HOST_MESSAGE_TOO_LARGE\",\n // gen:codes\n] as const;\n\n/** The codes of the HOST area. */\nexport type HostDiagnosticCode = (typeof hostDiagnosticCodes)[number];\n\n/** The HOST area's catalog entries. */\nexport const hostDiagnostics: AreaCatalog<HostDiagnosticCode> = {\n MOSTRA_HOST_REVISION_UNSUPPORTED: {\n severity: \"error\",\n phase: \"host\",\n title: \"No common host protocol revision\",\n hint: \"Run the client and the instance from the same Mostra release, for example with `mostra daemon restart`.\",\n docs: {\n explanation:\n \"A client and a Mostra instance agree on a host protocol revision when they connect (`mostra/initialize`). The client offers the revisions it speaks, and the instance picks the newest one it also supports. This code means the two lists have nothing in common, usually because the client and the running daemon come from Mostra releases far apart.\",\n fix: \"Restart the daemon so it runs the same release as the client: `mostra daemon restart`. Durable state survives the restart, and open views reconnect. A host that embeds Mostra updates its pinned Mostra runtime or its host library until both support a common revision.\",\n },\n },\n MOSTRA_HOST_MALFORMED: {\n severity: \"error\",\n phase: \"host\",\n title: \"Malformed protocol message\",\n hint: \"Send each message as one line of JSON holding a single JSON-RPC 2.0 request or notification.\",\n docs: {\n explanation:\n \"Every message on a Mostra connection is one line of JSON with one JSON-RPC 2.0 object. This code means a line wasn't valid JSON, wasn't a JSON-RPC 2.0 request or response, or was a batch (a JSON array), which revision `2026-10-10` doesn't accept. A client also reports it when a response doesn't match the method's result schema.\",\n fix: 'Encode one request per line with `\"jsonrpc\": \"2.0\"`, a `method`, an `id` for requests, and `params` as an object. Send several requests as separate lines instead of a batch.',\n },\n },\n MOSTRA_HOST_METHOD_UNKNOWN: {\n severity: \"error\",\n phase: \"host\",\n title: \"Unknown protocol method\",\n hint: \"Call only the methods listed in `capabilities.methods` of the `mostra/initialize` result.\",\n docs: {\n explanation:\n \"The instance doesn't serve the method that was called. Either the name is misspelled, or the client is newer than the instance and calls a method the instance's release doesn't have.\",\n fix: \"Check the method name against INTERFACES \\u00a76, and against `capabilities.methods` in the `mostra/initialize` result, which lists every method this instance serves. Upgrade the instance if the client needs a newer method.\",\n },\n },\n MOSTRA_HOST_INVALID_PARAMS: {\n severity: \"error\",\n phase: \"host\",\n title: \"Invalid method params\",\n hint: \"Fix the params named in the message so they match the method's schema.\",\n docs: {\n explanation:\n \"The request's `params` don't match the method's published schema: a required field is missing, a value has the wrong type, or a value is outside its allowed range. The message names the first problem found.\",\n fix: \"Compare the request with the method's schema in `@mostra/protocol` (or the published JSON Schema) and correct the field named in the message.\",\n },\n },\n MOSTRA_HOST_INTERNAL_ERROR: {\n severity: \"error\",\n phase: \"host\",\n title: \"Unexpected failure in the instance\",\n hint: \"Retry the request with the same request ID; if it fails again, report it with the instance's log.\",\n docs: {\n explanation:\n \"The instance failed while handling the request, for a reason that isn't one of its known conditions. Durable state is unaffected: a request is acknowledged only after its ledger transaction commits. The details are in the instance's log (`logs/supervisor.log` in the home), not in the response.\",\n fix: \"Retry the request with the same request ID; retries are idempotent. If the failure repeats, report it with the relevant lines of `logs/supervisor.log`.\",\n },\n },\n MOSTRA_HOST_INITIALIZE_ORDER: {\n severity: \"error\",\n phase: \"host\",\n title: \"Initialize first, and only once\",\n hint: \"Send `mostra/initialize` as the first request on the connection, and only once.\",\n docs: {\n explanation:\n \"Every connection starts with `mostra/initialize`, which agrees the protocol revision and registers the client's ports. The instance received another request before it, or a second `mostra/initialize` on the same connection.\",\n fix: \"Send `mostra/initialize` first and wait for its result before any other request. To renegotiate, open a new connection.\",\n },\n },\n MOSTRA_HOST_PORT_UNSUPPORTED: {\n severity: \"warning\",\n phase: \"host\",\n title: \"Port not supported by this instance\",\n hint: \"Leave the port out of `mostra/initialize`, or run a Mostra release that lists it in `capabilities.ports`.\",\n docs: {\n explanation:\n \"The client registered a port this instance doesn't call, so registering it has no effect. The port may be reserved for a later release (such as `ai`), or the client may be newer than the instance. The session continues without the port, and Mostra uses its standalone behavior instead.\",\n fix: \"Register only the ports listed in `capabilities.ports` of the `mostra/initialize` result. If the host needs the port, upgrade the instance to a release that supports it.\",\n },\n },\n MOSTRA_HOST_CONNECTION_CLOSED: {\n severity: \"error\",\n phase: \"host\",\n title: \"Connection closed\",\n hint: \"Reconnect, then retry the request with the same request ID.\",\n docs: {\n explanation:\n \"The connection to the other side closed before a response arrived, for example because the instance exited or restarted. The request may or may not have taken effect.\",\n fix: \"Reconnect and send `mostra/initialize` again, then retry the request with the same request ID. Mutating methods are idempotent by request ID, so a retry never applies twice.\",\n },\n },\n MOSTRA_HOST_TIMEOUT: {\n severity: \"error\",\n phase: \"host\",\n title: \"Request timed out\",\n hint: \"Retry the request with the same request ID, or allow it more time.\",\n docs: {\n explanation:\n \"No response arrived within the time the caller allowed. The other side may still be working on the request, and it may still take effect.\",\n fix: \"Retry with the same request ID, which returns the recorded result if the first attempt completed. Allow a longer timeout for slow operations.\",\n },\n },\n MOSTRA_HOST_SHUTDOWN_REFUSED: {\n severity: \"error\",\n phase: \"host\",\n title: \"Only the spawning host can stop this instance\",\n hint: \"Ask the host that started this instance to stop it, or end the connection you opened instead.\",\n docs: {\n explanation:\n \"An instance started by a host over stdio (`mostra host`) lives as long as that host's connection, so only the host may stop it with `mostra/shutdown`. A client that attached through the home's socket asked it to stop. A daemon (`mostra daemon`) accepts `mostra/shutdown` from every attached client (D87).\",\n fix: \"Close your own connection when you are done. To stop the instance, stop the host that spawned it, or have the host send `mostra/shutdown` or close its stdio.\",\n },\n },\n MOSTRA_HOST_REQUEST_ID_REUSED: {\n severity: \"error\",\n phase: \"host\",\n title: \"A requestId was reused with other parameters\",\n hint: \"Send a new `requestId` for a new request; repeat the exact parameters only to retry one.\",\n docs: {\n explanation:\n \"A mutating method recorded its result under this `requestId` for different parameters. Replaying that result would answer a request nobody made (a link for another artifact or with other scopes, another source's publish), so the instance refuses (H-03). Retries with the same parameters still return the recorded result.\",\n fix: \"Generate a fresh `requestId` for every new request, and reuse one only to retry the same request after a timeout or a lost connection.\",\n },\n },\n MOSTRA_HOST_CURSOR_COMPACTED: {\n severity: \"error\",\n phase: \"host\",\n title: \"Events compacted\",\n hint: \"Read from the cursor in the message to receive the compaction summary, then continue from there.\",\n docs: {\n explanation:\n \"Events before a cursor were compacted on request (`mostra gc --compact-events`, DATA_MODEL §4): an artifact's old events were replaced by one `artifact.compacted` event that summarizes them. A reader asking for events after an earlier cursor would miss some, and Mostra never leaves a silent gap.\",\n fix: \"Read again with `after` set to the cursor the message names: the next event is the `artifact.compacted` summary. Rebuild what you track from it and continue as usual.\",\n },\n },\n MOSTRA_HOST_SUBSCRIPTION_UNKNOWN: {\n severity: \"error\",\n phase: \"host\",\n title: \"Unknown subscription\",\n hint: \"Subscribe again with `events/subscribe`, then use the ID it returns.\",\n docs: {\n explanation:\n \"The subscription ID belongs to no subscription on this connection: it was never created here, was ended with `events/unsubscribe`, or belonged to a connection that closed. Subscriptions live as long as their connection; a named subscriber's acknowledged cursor outlives it.\",\n fix: \"Call `events/subscribe` again on this connection. With the same `name`, delivery resumes after the last acknowledged cursor.\",\n },\n },\n MOSTRA_HOST_NOTIFICATION_UNSUPPORTED: {\n severity: \"error\",\n phase: \"host\",\n title: \"Notification not accepted\",\n hint: \"List the notification in `capabilities.notifications` when you initialize.\",\n docs: {\n explanation:\n \"Mostra sends a client only the notifications it listed in `mostra/initialize` (D84). This method would send one the client didn't list, such as `events/notify` for `events/subscribe`.\",\n fix: 'Reconnect and initialize with `capabilities: { notifications: [\"events/notify\"] }`, or poll with `events/read` instead.',\n },\n },\n MOSTRA_HOST_MESSAGE_TOO_LARGE: {\n severity: \"error\",\n phase: \"host\",\n title: \"Message too large for the protocol\",\n hint: \"Ask for less at once: a specific submission, fewer events, or smaller values.\",\n docs: {\n explanation:\n \"One host-protocol message is one line of JSON, and a line holds at most 64 Mi characters (`MAX_LINE_LENGTH`), so neither side buffers without bound. Mostra checks every message before it writes it: an answer that would be longer is replaced by this error, and a delivery whose envelope would be longer is recorded as undeliverable instead of being sent and retried forever.\",\n fix: \"Read less per request (`events/read` with a smaller `limit`, `results/get` for one submission), and keep artifacts' values within the field and document limits.\",\n },\n },\n // gen:entries\n};\n"],"mappings":";;AAMA,MAAa,sBAAsB;CACjC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AAEF;;AAMA,MAAa,kBAAmD;CAC9D,kCAAkC;EAChC,UAAU;EACV,OAAO;EACP,OAAO;EACP,MAAM;EACN,MAAM;GACJ,aACE;GACF,KAAK;EACP;CACF;CACA,uBAAuB;EACrB,UAAU;EACV,OAAO;EACP,OAAO;EACP,MAAM;EACN,MAAM;GACJ,aACE;GACF,KAAK;EACP;CACF;CACA,4BAA4B;EAC1B,UAAU;EACV,OAAO;EACP,OAAO;EACP,MAAM;EACN,MAAM;GACJ,aACE;GACF,KAAK;EACP;CACF;CACA,4BAA4B;EAC1B,UAAU;EACV,OAAO;EACP,OAAO;EACP,MAAM;EACN,MAAM;GACJ,aACE;GACF,KAAK;EACP;CACF;CACA,4BAA4B;EAC1B,UAAU;EACV,OAAO;EACP,OAAO;EACP,MAAM;EACN,MAAM;GACJ,aACE;GACF,KAAK;EACP;CACF;CACA,8BAA8B;EAC5B,UAAU;EACV,OAAO;EACP,OAAO;EACP,MAAM;EACN,MAAM;GACJ,aACE;GACF,KAAK;EACP;CACF;CACA,8BAA8B;EAC5B,UAAU;EACV,OAAO;EACP,OAAO;EACP,MAAM;EACN,MAAM;GACJ,aACE;GACF,KAAK;EACP;CACF;CACA,+BAA+B;EAC7B,UAAU;EACV,OAAO;EACP,OAAO;EACP,MAAM;EACN,MAAM;GACJ,aACE;GACF,KAAK;EACP;CACF;CACA,qBAAqB;EACnB,UAAU;EACV,OAAO;EACP,OAAO;EACP,MAAM;EACN,MAAM;GACJ,aACE;GACF,KAAK;EACP;CACF;CACA,8BAA8B;EAC5B,UAAU;EACV,OAAO;EACP,OAAO;EACP,MAAM;EACN,MAAM;GACJ,aACE;GACF,KAAK;EACP;CACF;CACA,+BAA+B;EAC7B,UAAU;EACV,OAAO;EACP,OAAO;EACP,MAAM;EACN,MAAM;GACJ,aACE;GACF,KAAK;EACP;CACF;CACA,8BAA8B;EAC5B,UAAU;EACV,OAAO;EACP,OAAO;EACP,MAAM;EACN,MAAM;GACJ,aACE;GACF,KAAK;EACP;CACF;CACA,kCAAkC;EAChC,UAAU;EACV,OAAO;EACP,OAAO;EACP,MAAM;EACN,MAAM;GACJ,aACE;GACF,KAAK;EACP;CACF;CACA,sCAAsC;EACpC,UAAU;EACV,OAAO;EACP,OAAO;EACP,MAAM;EACN,MAAM;GACJ,aACE;GACF,KAAK;EACP;CACF;CACA,+BAA+B;EAC7B,UAAU;EACV,OAAO;EACP,OAAO;EACP,MAAM;EACN,MAAM;GACJ,aACE;GACF,KAAK;EACP;CACF;AAEF"}
@@ -0,0 +1,8 @@
1
+ import "../spec.js";
2
+ //#region src/diagnostics/codes/hygiene.d.ts
3
+ /** The codes of the HYGIENE area, in the order they were added. */
4
+ export declare const hygieneDiagnosticCodes: readonly ["MOSTRA_HYGIENE_HOST_REFUSED", "MOSTRA_HYGIENE_ORIGIN_REFUSED", "MOSTRA_HYGIENE_CSRF_MISSING", "MOSTRA_HYGIENE_CONTENT_TYPE", "MOSTRA_HYGIENE_REQUEST_MALFORMED", "MOSTRA_HYGIENE_SESSION_MISSING", "MOSTRA_HYGIENE_TOKEN_INVALID", "MOSTRA_HYGIENE_TOKEN_REVOKED", "MOSTRA_HYGIENE_SCOPE_DENIED", "MOSTRA_HYGIENE_RATE_LIMITED", "MOSTRA_HYGIENE_NOT_SERVED", "MOSTRA_HYGIENE_SESSION_CONFLICT", "MOSTRA_HYGIENE_HEADERS_TOO_LARGE"];
5
+ /** The codes of the HYGIENE area. */
6
+ export type HygieneDiagnosticCode = (typeof hygieneDiagnosticCodes)[number];
7
+ //#endregion
8
+ //# sourceMappingURL=hygiene.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hygiene.d.ts","names":[],"sources":["../../../src/diagnostics/codes/hygiene.ts"],"mappings":";;;qBAQa;;YAkBD,gCAAgC"}
@@ -0,0 +1,154 @@
1
+ //#region src/diagnostics/codes/hygiene.ts
2
+ /** The codes of the HYGIENE area, in the order they were added. */
3
+ const hygieneDiagnosticCodes = [
4
+ "MOSTRA_HYGIENE_HOST_REFUSED",
5
+ "MOSTRA_HYGIENE_ORIGIN_REFUSED",
6
+ "MOSTRA_HYGIENE_CSRF_MISSING",
7
+ "MOSTRA_HYGIENE_CONTENT_TYPE",
8
+ "MOSTRA_HYGIENE_REQUEST_MALFORMED",
9
+ "MOSTRA_HYGIENE_SESSION_MISSING",
10
+ "MOSTRA_HYGIENE_TOKEN_INVALID",
11
+ "MOSTRA_HYGIENE_TOKEN_REVOKED",
12
+ "MOSTRA_HYGIENE_SCOPE_DENIED",
13
+ "MOSTRA_HYGIENE_RATE_LIMITED",
14
+ "MOSTRA_HYGIENE_NOT_SERVED",
15
+ "MOSTRA_HYGIENE_SESSION_CONFLICT",
16
+ "MOSTRA_HYGIENE_HEADERS_TOO_LARGE"
17
+ ];
18
+ /** The HYGIENE area's catalog entries. */
19
+ const hygieneDiagnostics = {
20
+ MOSTRA_HYGIENE_HOST_REFUSED: {
21
+ severity: "error",
22
+ phase: "hygiene",
23
+ title: "Host not served",
24
+ hint: "Open the artifact through the exact link Mostra gave you.",
25
+ docs: {
26
+ explanation: "The request's `Host` header named a host this gateway doesn't serve. Each gateway listener accepts exactly the host and port its capability URLs use, so a page that rebinds its own DNS name to the loopback address can't reach an artifact (DNS rebinding). The gateway answers 421.",
27
+ fix: "Use the URL from `view/url` or the publish receipt as it is, without replacing `127.0.0.1` by `localhost` or another name. A gateway started with `--bind` and `--url-host` accepts the URL host it was given."
28
+ }
29
+ },
30
+ MOSTRA_HYGIENE_ORIGIN_REFUSED: {
31
+ severity: "error",
32
+ phase: "hygiene",
33
+ title: "Origin refused",
34
+ hint: "Send the request from the page's own origin.",
35
+ docs: {
36
+ explanation: "A request that changes state, opens a stream or upgrades to a WebSocket must carry an `Origin` header equal to the origin it is sent to. The gateway compares the strings exactly and answers 403 otherwise, so another website, or another artifact on a different port, can't drive this one.",
37
+ fix: "Call the gateway from the page it serves: the shell from the shell, the artifact from its own frame. Tools outside a browser send the listener's own origin."
38
+ }
39
+ },
40
+ MOSTRA_HYGIENE_CSRF_MISSING: {
41
+ severity: "error",
42
+ phase: "hygiene",
43
+ title: "CSRF token missing or wrong",
44
+ hint: "Send the session's CSRF token from `GET /_mostra/session` in the `X-Mostra-CSRF` header.",
45
+ docs: {
46
+ explanation: "Every request that changes state through a session carries the session's CSRF token in the `X-Mostra-CSRF` header. The token comes only from the session endpoint of the same origin, which no other page can read. A missing or different token is answered with 403.",
47
+ fix: "Read `csrf` from `GET /_mostra/session` (on the shell, `GET /a/<artifactId>/_mostra/session`) and send it with every POST. Mostra's client runtime and shell do this for you."
48
+ }
49
+ },
50
+ MOSTRA_HYGIENE_CONTENT_TYPE: {
51
+ severity: "error",
52
+ phase: "hygiene",
53
+ title: "JSON content type required",
54
+ hint: "Send the body as JSON with `Content-Type: application/json`.",
55
+ docs: {
56
+ explanation: "Requests that change state must have a JSON body. A form or plain-text body is something any website can send without asking the browser first, so the gateway refuses it with 415.",
57
+ fix: "Send `Content-Type: application/json` and a JSON body."
58
+ }
59
+ },
60
+ MOSTRA_HYGIENE_REQUEST_MALFORMED: {
61
+ severity: "error",
62
+ phase: "hygiene",
63
+ title: "Malformed request",
64
+ hint: "Send one well-formed HTTP request with a path that starts with `/`.",
65
+ docs: {
66
+ explanation: "The gateway refused a request it can't interpret safely: a repeated `Host` or `Origin` header, a request target that isn't a path, an encoded `/` or `..` that would leave the served tree, a body that isn't valid JSON, or a header with control characters. It answers 400 rather than guess.",
67
+ fix: "Send a single request with one `Host` header and a plain path. Browsers always do; this usually means a hand-written client or a probe."
68
+ }
69
+ },
70
+ MOSTRA_HYGIENE_SESSION_MISSING: {
71
+ severity: "error",
72
+ phase: "hygiene",
73
+ title: "No session",
74
+ hint: "Open the artifact's capability link again to start a session.",
75
+ docs: {
76
+ explanation: "The request carried no valid session for this origin. Sessions start when a capability link is opened: the shell exchanges the link's token for a session cookie, and gives the artifact frame a single-use ticket for its own. A session issued for another origin never counts, because every port of the host shares the browser's cookies. The gateway answers 401.",
77
+ fix: "Open the full capability link, including the part after `#`. A bookmark of the page without it works while the browser keeps the session cookie (400 days)."
78
+ }
79
+ },
80
+ MOSTRA_HYGIENE_TOKEN_INVALID: {
81
+ severity: "error",
82
+ phase: "hygiene",
83
+ title: "Unknown capability token",
84
+ hint: "Use the complete capability link Mostra gave you, or mint a new one with `view/url`.",
85
+ docs: {
86
+ explanation: "The capability token or frame ticket matched nothing in this home: it was mistyped, cut short, belongs to another home or artifact, or the ticket was already used or expired (tickets last 60 seconds and work once). Over the host protocol, the token ID named in `view/revoke` or `view/rotate` doesn't exist. The gateway answers 401, and failed attempts count towards the rate limit.",
87
+ fix: "Copy the whole link again. An agent or host mints a fresh one with `view/url`; the shell gets a new frame ticket by reloading."
88
+ }
89
+ },
90
+ MOSTRA_HYGIENE_TOKEN_REVOKED: {
91
+ severity: "error",
92
+ phase: "hygiene",
93
+ title: "Link revoked or expired",
94
+ hint: "Ask for a new link: `view/url` mints one, or `view/rotate` replaces this one.",
95
+ docs: {
96
+ explanation: "The capability link was revoked (`view/revoke`), replaced (`view/rotate`), or reached the end of its `ttl`. Every session started from it ends too. The gateway answers 410. Local links have no expiry unless one was asked for.",
97
+ fix: "Get a new link from whoever shared this one. An agent mints it with `view/url`, or rotates the old one with `view/rotate`, and shares the new URL."
98
+ }
99
+ },
100
+ MOSTRA_HYGIENE_SCOPE_DENIED: {
101
+ severity: "error",
102
+ phase: "hygiene",
103
+ title: "Not allowed by this link",
104
+ hint: "Open a link minted with this scope (`view/url` with `scopes`).",
105
+ docs: {
106
+ explanation: "The session's link doesn't carry the scope this request needs: `draft` to save answers, `submit` to submit, `review` to comment, and `action:*`, `action:<export>` or `action:<module path>#<export>` to run a server function. A view-and-comment link, for example, can't submit or run an action. The gateway answers 403.",
107
+ fix: "Mint a link with the scopes the viewer needs, such as `view/url` with `scopes: [\"view\", \"draft\", \"submit\"]`. Without `scopes`, a link carries every scope."
108
+ }
109
+ },
110
+ MOSTRA_HYGIENE_RATE_LIMITED: {
111
+ severity: "error",
112
+ phase: "hygiene",
113
+ title: "Too many failed attempts",
114
+ hint: "Wait for the time in `Retry-After`, then open the link again.",
115
+ docs: {
116
+ explanation: "More than 30 capability tokens failed for this artifact within a minute, so the gateway refuses every token for it, valid ones included, until the minute has passed. A guess can't succeed while the limit holds, and only this artifact's links wait. The gateway answers 429 with `Retry-After`.",
117
+ fix: "Wait, then open the link again. Repeated failures usually come from a mistyped link or a script retrying an old one."
118
+ }
119
+ },
120
+ MOSTRA_HYGIENE_NOT_SERVED: {
121
+ severity: "error",
122
+ phase: "hygiene",
123
+ title: "Nothing served here",
124
+ hint: "Request a published version's files or a documented `/_mostra/` path.",
125
+ docs: {
126
+ explanation: "The gateway serves only published versions' client files and the browser-protocol paths under `/_mostra/`. Everything else in the home, such as sources, server bundles, staging and unpublished builds, has no URL. A path or method nothing answers gets 404 or 405.",
127
+ fix: "Check the path. Server code runs through the browser protocol, never as a file, and an artifact becomes viewable only once it is published."
128
+ }
129
+ },
130
+ MOSTRA_HYGIENE_SESSION_CONFLICT: {
131
+ severity: "warning",
132
+ phase: "hygiene",
133
+ title: "Another link is already open for this artifact",
134
+ hint: "Choose which link to keep; send `replace: true` to use the new one.",
135
+ docs: {
136
+ explanation: "This browser already has a live session for the artifact from a different link. Opening a link never silently replaces it, because a page elsewhere could send the viewer to its own, narrower link and take over their tabs (D98). The shell shows both links' access and lets the viewer choose; the answer is 409 with `current` and `offered`.",
137
+ fix: "In the shell, choose the link to keep. A client exchanging tokens itself sends `replace: true` to replace the session."
138
+ }
139
+ },
140
+ MOSTRA_HYGIENE_HEADERS_TOO_LARGE: {
141
+ severity: "error",
142
+ phase: "hygiene",
143
+ title: "The request's headers are too large",
144
+ hint: "Open the link again: this page cleared the cookies that made the request too large.",
145
+ docs: {
146
+ explanation: "The request's headers passed the gateway's limit of 1 MiB, more than any browser sends for one host's cookies. Every port of the loopback host shares one cookie jar, so a page on any of them can fill it. The gateway answers 431 with `Clear-Site-Data: \"cookies\"`, which empties the host's cookies, so the next request works. Mostra's sessions go with them and come back when a link is opened again.",
147
+ fix: "Open the artifact's link again. If it keeps happening, find the page that sets the cookies: it runs on this host."
148
+ }
149
+ }
150
+ };
151
+ //#endregion
152
+ export { hygieneDiagnosticCodes, hygieneDiagnostics };
153
+
154
+ //# sourceMappingURL=hygiene.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hygiene.js","names":[],"sources":["../../../src/diagnostics/codes/hygiene.ts"],"sourcesContent":["/**\n * Diagnostic codes of the HYGIENE area: requests the gateway refuses because they don't come from\n * the holder of an artifact's capability URL (D06, HY-01). None of them limits what an artifact\n * or an agent may do; each keeps strangers out.\n */\nimport type { AreaCatalog } from \"../spec.ts\";\n\n/** The codes of the HYGIENE area, in the order they were added. */\nexport const hygieneDiagnosticCodes = [\n \"MOSTRA_HYGIENE_HOST_REFUSED\",\n \"MOSTRA_HYGIENE_ORIGIN_REFUSED\",\n \"MOSTRA_HYGIENE_CSRF_MISSING\",\n \"MOSTRA_HYGIENE_CONTENT_TYPE\",\n \"MOSTRA_HYGIENE_REQUEST_MALFORMED\",\n \"MOSTRA_HYGIENE_SESSION_MISSING\",\n \"MOSTRA_HYGIENE_TOKEN_INVALID\",\n \"MOSTRA_HYGIENE_TOKEN_REVOKED\",\n \"MOSTRA_HYGIENE_SCOPE_DENIED\",\n \"MOSTRA_HYGIENE_RATE_LIMITED\",\n \"MOSTRA_HYGIENE_NOT_SERVED\",\n \"MOSTRA_HYGIENE_SESSION_CONFLICT\",\n \"MOSTRA_HYGIENE_HEADERS_TOO_LARGE\",\n // gen:codes\n] as const;\n\n/** The codes of the HYGIENE area. */\nexport type HygieneDiagnosticCode = (typeof hygieneDiagnosticCodes)[number];\n\n/** The HYGIENE area's catalog entries. */\nexport const hygieneDiagnostics: AreaCatalog<HygieneDiagnosticCode> = {\n MOSTRA_HYGIENE_HOST_REFUSED: {\n severity: \"error\",\n phase: \"hygiene\",\n title: \"Host not served\",\n hint: \"Open the artifact through the exact link Mostra gave you.\",\n docs: {\n explanation:\n \"The request's `Host` header named a host this gateway doesn't serve. Each gateway listener accepts exactly the host and port its capability URLs use, so a page that rebinds its own DNS name to the loopback address can't reach an artifact (DNS rebinding). The gateway answers 421.\",\n fix: \"Use the URL from `view/url` or the publish receipt as it is, without replacing `127.0.0.1` by `localhost` or another name. A gateway started with `--bind` and `--url-host` accepts the URL host it was given.\",\n },\n },\n MOSTRA_HYGIENE_ORIGIN_REFUSED: {\n severity: \"error\",\n phase: \"hygiene\",\n title: \"Origin refused\",\n hint: \"Send the request from the page's own origin.\",\n docs: {\n explanation:\n \"A request that changes state, opens a stream or upgrades to a WebSocket must carry an `Origin` header equal to the origin it is sent to. The gateway compares the strings exactly and answers 403 otherwise, so another website, or another artifact on a different port, can't drive this one.\",\n fix: \"Call the gateway from the page it serves: the shell from the shell, the artifact from its own frame. Tools outside a browser send the listener's own origin.\",\n },\n },\n MOSTRA_HYGIENE_CSRF_MISSING: {\n severity: \"error\",\n phase: \"hygiene\",\n title: \"CSRF token missing or wrong\",\n hint: \"Send the session's CSRF token from `GET /_mostra/session` in the `X-Mostra-CSRF` header.\",\n docs: {\n explanation:\n \"Every request that changes state through a session carries the session's CSRF token in the `X-Mostra-CSRF` header. The token comes only from the session endpoint of the same origin, which no other page can read. A missing or different token is answered with 403.\",\n fix: \"Read `csrf` from `GET /_mostra/session` (on the shell, `GET /a/<artifactId>/_mostra/session`) and send it with every POST. Mostra's client runtime and shell do this for you.\",\n },\n },\n MOSTRA_HYGIENE_CONTENT_TYPE: {\n severity: \"error\",\n phase: \"hygiene\",\n title: \"JSON content type required\",\n hint: \"Send the body as JSON with `Content-Type: application/json`.\",\n docs: {\n explanation:\n \"Requests that change state must have a JSON body. A form or plain-text body is something any website can send without asking the browser first, so the gateway refuses it with 415.\",\n fix: \"Send `Content-Type: application/json` and a JSON body.\",\n },\n },\n MOSTRA_HYGIENE_REQUEST_MALFORMED: {\n severity: \"error\",\n phase: \"hygiene\",\n title: \"Malformed request\",\n hint: \"Send one well-formed HTTP request with a path that starts with `/`.\",\n docs: {\n explanation:\n \"The gateway refused a request it can't interpret safely: a repeated `Host` or `Origin` header, a request target that isn't a path, an encoded `/` or `..` that would leave the served tree, a body that isn't valid JSON, or a header with control characters. It answers 400 rather than guess.\",\n fix: \"Send a single request with one `Host` header and a plain path. Browsers always do; this usually means a hand-written client or a probe.\",\n },\n },\n MOSTRA_HYGIENE_SESSION_MISSING: {\n severity: \"error\",\n phase: \"hygiene\",\n title: \"No session\",\n hint: \"Open the artifact's capability link again to start a session.\",\n docs: {\n explanation:\n \"The request carried no valid session for this origin. Sessions start when a capability link is opened: the shell exchanges the link's token for a session cookie, and gives the artifact frame a single-use ticket for its own. A session issued for another origin never counts, because every port of the host shares the browser's cookies. The gateway answers 401.\",\n fix: \"Open the full capability link, including the part after `#`. A bookmark of the page without it works while the browser keeps the session cookie (400 days).\",\n },\n },\n MOSTRA_HYGIENE_TOKEN_INVALID: {\n severity: \"error\",\n phase: \"hygiene\",\n title: \"Unknown capability token\",\n hint: \"Use the complete capability link Mostra gave you, or mint a new one with `view/url`.\",\n docs: {\n explanation:\n \"The capability token or frame ticket matched nothing in this home: it was mistyped, cut short, belongs to another home or artifact, or the ticket was already used or expired (tickets last 60 seconds and work once). Over the host protocol, the token ID named in `view/revoke` or `view/rotate` doesn't exist. The gateway answers 401, and failed attempts count towards the rate limit.\",\n fix: \"Copy the whole link again. An agent or host mints a fresh one with `view/url`; the shell gets a new frame ticket by reloading.\",\n },\n },\n MOSTRA_HYGIENE_TOKEN_REVOKED: {\n severity: \"error\",\n phase: \"hygiene\",\n title: \"Link revoked or expired\",\n hint: \"Ask for a new link: `view/url` mints one, or `view/rotate` replaces this one.\",\n docs: {\n explanation:\n \"The capability link was revoked (`view/revoke`), replaced (`view/rotate`), or reached the end of its `ttl`. Every session started from it ends too. The gateway answers 410. Local links have no expiry unless one was asked for.\",\n fix: \"Get a new link from whoever shared this one. An agent mints it with `view/url`, or rotates the old one with `view/rotate`, and shares the new URL.\",\n },\n },\n MOSTRA_HYGIENE_SCOPE_DENIED: {\n severity: \"error\",\n phase: \"hygiene\",\n title: \"Not allowed by this link\",\n hint: \"Open a link minted with this scope (`view/url` with `scopes`).\",\n docs: {\n explanation:\n \"The session's link doesn't carry the scope this request needs: `draft` to save answers, `submit` to submit, `review` to comment, and `action:*`, `action:<export>` or `action:<module path>#<export>` to run a server function. A view-and-comment link, for example, can't submit or run an action. The gateway answers 403.\",\n fix: 'Mint a link with the scopes the viewer needs, such as `view/url` with `scopes: [\"view\", \"draft\", \"submit\"]`. Without `scopes`, a link carries every scope.',\n },\n },\n MOSTRA_HYGIENE_RATE_LIMITED: {\n severity: \"error\",\n phase: \"hygiene\",\n title: \"Too many failed attempts\",\n hint: \"Wait for the time in `Retry-After`, then open the link again.\",\n docs: {\n explanation:\n \"More than 30 capability tokens failed for this artifact within a minute, so the gateway refuses every token for it, valid ones included, until the minute has passed. A guess can't succeed while the limit holds, and only this artifact's links wait. The gateway answers 429 with `Retry-After`.\",\n fix: \"Wait, then open the link again. Repeated failures usually come from a mistyped link or a script retrying an old one.\",\n },\n },\n MOSTRA_HYGIENE_NOT_SERVED: {\n severity: \"error\",\n phase: \"hygiene\",\n title: \"Nothing served here\",\n hint: \"Request a published version's files or a documented `/_mostra/` path.\",\n docs: {\n explanation:\n \"The gateway serves only published versions' client files and the browser-protocol paths under `/_mostra/`. Everything else in the home, such as sources, server bundles, staging and unpublished builds, has no URL. A path or method nothing answers gets 404 or 405.\",\n fix: \"Check the path. Server code runs through the browser protocol, never as a file, and an artifact becomes viewable only once it is published.\",\n },\n },\n MOSTRA_HYGIENE_SESSION_CONFLICT: {\n severity: \"warning\",\n phase: \"hygiene\",\n title: \"Another link is already open for this artifact\",\n hint: \"Choose which link to keep; send `replace: true` to use the new one.\",\n docs: {\n explanation:\n \"This browser already has a live session for the artifact from a different link. Opening a link never silently replaces it, because a page elsewhere could send the viewer to its own, narrower link and take over their tabs (D98). The shell shows both links' access and lets the viewer choose; the answer is 409 with `current` and `offered`.\",\n fix: \"In the shell, choose the link to keep. A client exchanging tokens itself sends `replace: true` to replace the session.\",\n },\n },\n MOSTRA_HYGIENE_HEADERS_TOO_LARGE: {\n severity: \"error\",\n phase: \"hygiene\",\n title: \"The request's headers are too large\",\n hint: \"Open the link again: this page cleared the cookies that made the request too large.\",\n docs: {\n explanation:\n \"The request's headers passed the gateway's limit of 1 MiB, more than any browser sends for one host's cookies. Every port of the loopback host shares one cookie jar, so a page on any of them can fill it. The gateway answers 431 with `Clear-Site-Data: \\\"cookies\\\"`, which empties the host's cookies, so the next request works. Mostra's sessions go with them and come back when a link is opened again.\",\n fix: \"Open the artifact's link again. If it keeps happening, find the page that sets the cookies: it runs on this host.\",\n },\n },\n // gen:entries\n};\n"],"mappings":";;AAQA,MAAa,yBAAyB;CACpC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AAEF;;AAMA,MAAa,qBAAyD;CACpE,6BAA6B;EAC3B,UAAU;EACV,OAAO;EACP,OAAO;EACP,MAAM;EACN,MAAM;GACJ,aACE;GACF,KAAK;EACP;CACF;CACA,+BAA+B;EAC7B,UAAU;EACV,OAAO;EACP,OAAO;EACP,MAAM;EACN,MAAM;GACJ,aACE;GACF,KAAK;EACP;CACF;CACA,6BAA6B;EAC3B,UAAU;EACV,OAAO;EACP,OAAO;EACP,MAAM;EACN,MAAM;GACJ,aACE;GACF,KAAK;EACP;CACF;CACA,6BAA6B;EAC3B,UAAU;EACV,OAAO;EACP,OAAO;EACP,MAAM;EACN,MAAM;GACJ,aACE;GACF,KAAK;EACP;CACF;CACA,kCAAkC;EAChC,UAAU;EACV,OAAO;EACP,OAAO;EACP,MAAM;EACN,MAAM;GACJ,aACE;GACF,KAAK;EACP;CACF;CACA,gCAAgC;EAC9B,UAAU;EACV,OAAO;EACP,OAAO;EACP,MAAM;EACN,MAAM;GACJ,aACE;GACF,KAAK;EACP;CACF;CACA,8BAA8B;EAC5B,UAAU;EACV,OAAO;EACP,OAAO;EACP,MAAM;EACN,MAAM;GACJ,aACE;GACF,KAAK;EACP;CACF;CACA,8BAA8B;EAC5B,UAAU;EACV,OAAO;EACP,OAAO;EACP,MAAM;EACN,MAAM;GACJ,aACE;GACF,KAAK;EACP;CACF;CACA,6BAA6B;EAC3B,UAAU;EACV,OAAO;EACP,OAAO;EACP,MAAM;EACN,MAAM;GACJ,aACE;GACF,KAAK;EACP;CACF;CACA,6BAA6B;EAC3B,UAAU;EACV,OAAO;EACP,OAAO;EACP,MAAM;EACN,MAAM;GACJ,aACE;GACF,KAAK;EACP;CACF;CACA,2BAA2B;EACzB,UAAU;EACV,OAAO;EACP,OAAO;EACP,MAAM;EACN,MAAM;GACJ,aACE;GACF,KAAK;EACP;CACF;CACA,iCAAiC;EAC/B,UAAU;EACV,OAAO;EACP,OAAO;EACP,MAAM;EACN,MAAM;GACJ,aACE;GACF,KAAK;EACP;CACF;CACA,kCAAkC;EAChC,UAAU;EACV,OAAO;EACP,OAAO;EACP,MAAM;EACN,MAAM;GACJ,aACE;GACF,KAAK;EACP;CACF;AAEF"}
@@ -0,0 +1,51 @@
1
+ import { Diagnostic } from "../diagnostic.js";
2
+ import { DiagnosticDetails, DiagnosticSpec } from "../spec.js";
3
+ import { A11yDiagnosticCode, a11yDiagnosticCodes } from "./a11y.js";
4
+ import { ActionDiagnosticCode, actionDiagnosticCodes } from "./action.js";
5
+ import { ArtifactDiagnosticCode, artifactDiagnosticCodes } from "./artifact.js";
6
+ import { BuildDiagnosticCode, buildDiagnosticCodes } from "./build.js";
7
+ import { CliDiagnosticCode, cliDiagnosticCodes } from "./cli.js";
8
+ import { ConsoleDiagnosticCode, consoleDiagnosticCodes } from "./console.js";
9
+ import { DepDiagnosticCode, depDiagnosticCodes } from "./dep.js";
10
+ import { EnvDiagnosticCode, envDiagnosticCodes } from "./env.js";
11
+ import { FieldDiagnosticCode, fieldDiagnosticCodes } from "./field.js";
12
+ import { HomeDiagnosticCode, homeDiagnosticCodes } from "./home.js";
13
+ import { HostDiagnosticCode, hostDiagnosticCodes } from "./host.js";
14
+ import { HygieneDiagnosticCode, hygieneDiagnosticCodes } from "./hygiene.js";
15
+ import { LiveDiagnosticCode, liveDiagnosticCodes } from "./live.js";
16
+ import { ManifestDiagnosticCode, manifestDiagnosticCodes } from "./manifest.js";
17
+ import { NetworkDiagnosticCode, networkDiagnosticCodes } from "./network.js";
18
+ import { PlatformDiagnosticCode, platformDiagnosticCodes } from "./platform.js";
19
+ import { PublishDiagnosticCode, publishDiagnosticCodes } from "./publish.js";
20
+ import { RegressionDiagnosticCode, regressionDiagnosticCodes } from "./regression.js";
21
+ import { RuntimeDiagnosticCode, runtimeDiagnosticCodes } from "./runtime.js";
22
+ import { SecretDiagnosticCode, secretDiagnosticCodes } from "./secret.js";
23
+ import { SmokeDiagnosticCode, smokeDiagnosticCodes } from "./smoke.js";
24
+ import { SubmitDiagnosticCode, submitDiagnosticCodes } from "./submit.js";
25
+ import { TargetDiagnosticCode, targetDiagnosticCodes } from "./target.js";
26
+ import { TypeDiagnosticCode, typeDiagnosticCodes } from "./type.js";
27
+ import { VerifyDiagnosticCode, verifyDiagnosticCodes } from "./verify.js";
28
+ //#region src/diagnostics/codes/index.d.ts
29
+ /** Every code in the catalog. Codes are semver surface and are never removed (AX-03). */
30
+ export type KnownDiagnosticCode = CliDiagnosticCode | RegressionDiagnosticCode | SmokeDiagnosticCode | A11yDiagnosticCode | NetworkDiagnosticCode | ConsoleDiagnosticCode | TypeDiagnosticCode | VerifyDiagnosticCode | LiveDiagnosticCode | SecretDiagnosticCode | RuntimeDiagnosticCode | FieldDiagnosticCode | SubmitDiagnosticCode | HygieneDiagnosticCode | DepDiagnosticCode | EnvDiagnosticCode | TargetDiagnosticCode | ArtifactDiagnosticCode | PublishDiagnosticCode | ActionDiagnosticCode | BuildDiagnosticCode | ManifestDiagnosticCode | HomeDiagnosticCode | PlatformDiagnosticCode | HostDiagnosticCode;
31
+ /** Every cataloged code with its severity, phase, title, default hint and docs text. */
32
+ export declare const diagnosticCatalog: Readonly<Record<KnownDiagnosticCode, DiagnosticSpec>>;
33
+ /** Options for {@link createDiagnostic}. */
34
+ export interface CreateDiagnosticOptions {
35
+ /** The docs site base URL. Defaults to `DEFAULT_DOCS_BASE`. */
36
+ readonly docsBase?: string;
37
+ }
38
+ /**
39
+ * Creates the diagnostic for one occurrence of a cataloged code. Severity, phase, the default hint
40
+ * and the docs link come from the catalog.
41
+ *
42
+ * ```ts
43
+ * createDiagnostic("MOSTRA_HOST_REVISION_UNSUPPORTED", {
44
+ * message: "The client offered 2026-01-01; this instance supports 2026-10-10.",
45
+ * });
46
+ * ```
47
+ */
48
+ export declare function createDiagnostic(code: KnownDiagnosticCode, details: DiagnosticDetails, options?: CreateDiagnosticOptions): Diagnostic;
49
+ //#endregion
50
+ export { type A11yDiagnosticCode, type ActionDiagnosticCode, type ArtifactDiagnosticCode, type BuildDiagnosticCode, type CliDiagnosticCode, type ConsoleDiagnosticCode, type DepDiagnosticCode, type EnvDiagnosticCode, type FieldDiagnosticCode, type HomeDiagnosticCode, type HostDiagnosticCode, type HygieneDiagnosticCode, type LiveDiagnosticCode, type ManifestDiagnosticCode, type NetworkDiagnosticCode, type PlatformDiagnosticCode, type PublishDiagnosticCode, type RegressionDiagnosticCode, type RuntimeDiagnosticCode, type SecretDiagnosticCode, type SmokeDiagnosticCode, type SubmitDiagnosticCode, type TargetDiagnosticCode, type TypeDiagnosticCode, type VerifyDiagnosticCode, a11yDiagnosticCodes, actionDiagnosticCodes, artifactDiagnosticCodes, buildDiagnosticCodes, cliDiagnosticCodes, consoleDiagnosticCodes, depDiagnosticCodes, envDiagnosticCodes, fieldDiagnosticCodes, homeDiagnosticCodes, hostDiagnosticCodes, hygieneDiagnosticCodes, liveDiagnosticCodes, manifestDiagnosticCodes, networkDiagnosticCodes, platformDiagnosticCodes, publishDiagnosticCodes, regressionDiagnosticCodes, runtimeDiagnosticCodes, secretDiagnosticCodes, smokeDiagnosticCodes, submitDiagnosticCodes, targetDiagnosticCodes, typeDiagnosticCodes, verifyDiagnosticCodes };
51
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","names":[],"sources":["../../../src/diagnostics/codes/index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;YA6DY,sBAER,oBACA,2BACA,sBACA,qBACA,wBACA,wBACA,qBACA,uBACA,qBACA,uBACA,wBACA,sBACA,uBACA,wBACA,oBACA,oBACA,uBACA,yBACA,wBACA,uBACA,sBACA,yBACA,qBACA,yBACA;;qBAGS,mBAAmB,SAAS,OAAO,qBAAqB;;iBA8BpD;;WAEN;;;;;;;;;;;;wBAaK,iBACd,MAAM,qBACN,SAAS,mBACT,UAAS,0BACR"}
@@ -0,0 +1,72 @@
1
+ import { hostDiagnosticCodes, hostDiagnostics } from "./host.js";
2
+ import { buildDiagnostic } from "../spec.js";
3
+ import { a11yDiagnosticCodes, a11yDiagnostics } from "./a11y.js";
4
+ import { actionDiagnosticCodes, actionDiagnostics } from "./action.js";
5
+ import { artifactDiagnosticCodes, artifactDiagnostics } from "./artifact.js";
6
+ import { buildDiagnosticCodes, buildDiagnostics } from "./build.js";
7
+ import { cliDiagnosticCodes, cliDiagnostics } from "./cli.js";
8
+ import { consoleDiagnosticCodes, consoleDiagnostics } from "./console.js";
9
+ import { depDiagnosticCodes, depDiagnostics } from "./dep.js";
10
+ import { envDiagnosticCodes, envDiagnostics } from "./env.js";
11
+ import { fieldDiagnosticCodes, fieldDiagnostics } from "./field.js";
12
+ import { homeDiagnosticCodes, homeDiagnostics } from "./home.js";
13
+ import { hygieneDiagnosticCodes, hygieneDiagnostics } from "./hygiene.js";
14
+ import { liveDiagnosticCodes, liveDiagnostics } from "./live.js";
15
+ import { manifestDiagnosticCodes, manifestDiagnostics } from "./manifest.js";
16
+ import { networkDiagnosticCodes, networkDiagnostics } from "./network.js";
17
+ import { platformDiagnosticCodes, platformDiagnostics } from "./platform.js";
18
+ import { publishDiagnosticCodes, publishDiagnostics } from "./publish.js";
19
+ import { regressionDiagnosticCodes, regressionDiagnostics } from "./regression.js";
20
+ import { runtimeDiagnosticCodes, runtimeDiagnostics } from "./runtime.js";
21
+ import { secretDiagnosticCodes, secretDiagnostics } from "./secret.js";
22
+ import { smokeDiagnosticCodes, smokeDiagnostics } from "./smoke.js";
23
+ import { submitDiagnosticCodes, submitDiagnostics } from "./submit.js";
24
+ import { targetDiagnosticCodes, targetDiagnostics } from "./target.js";
25
+ import { typeDiagnosticCodes, typeDiagnostics } from "./type.js";
26
+ import { verifyDiagnosticCodes, verifyDiagnostics } from "./verify.js";
27
+ //#region src/diagnostics/codes/index.ts
28
+ /** Every cataloged code with its severity, phase, title, default hint and docs text. */
29
+ const diagnosticCatalog = {
30
+ ...cliDiagnostics,
31
+ ...regressionDiagnostics,
32
+ ...smokeDiagnostics,
33
+ ...a11yDiagnostics,
34
+ ...networkDiagnostics,
35
+ ...consoleDiagnostics,
36
+ ...typeDiagnostics,
37
+ ...verifyDiagnostics,
38
+ ...liveDiagnostics,
39
+ ...secretDiagnostics,
40
+ ...runtimeDiagnostics,
41
+ ...fieldDiagnostics,
42
+ ...submitDiagnostics,
43
+ ...hygieneDiagnostics,
44
+ ...depDiagnostics,
45
+ ...envDiagnostics,
46
+ ...targetDiagnostics,
47
+ ...artifactDiagnostics,
48
+ ...publishDiagnostics,
49
+ ...actionDiagnostics,
50
+ ...buildDiagnostics,
51
+ ...manifestDiagnostics,
52
+ ...homeDiagnostics,
53
+ ...platformDiagnostics,
54
+ ...hostDiagnostics
55
+ };
56
+ /**
57
+ * Creates the diagnostic for one occurrence of a cataloged code. Severity, phase, the default hint
58
+ * and the docs link come from the catalog.
59
+ *
60
+ * ```ts
61
+ * createDiagnostic("MOSTRA_HOST_REVISION_UNSUPPORTED", {
62
+ * message: "The client offered 2026-01-01; this instance supports 2026-10-10.",
63
+ * });
64
+ * ```
65
+ */
66
+ function createDiagnostic(code, details, options = {}) {
67
+ return buildDiagnostic(code, diagnosticCatalog[code], details, options.docsBase);
68
+ }
69
+ //#endregion
70
+ export { a11yDiagnosticCodes, actionDiagnosticCodes, artifactDiagnosticCodes, buildDiagnosticCodes, cliDiagnosticCodes, consoleDiagnosticCodes, createDiagnostic, depDiagnosticCodes, diagnosticCatalog, envDiagnosticCodes, fieldDiagnosticCodes, homeDiagnosticCodes, hostDiagnosticCodes, hygieneDiagnosticCodes, liveDiagnosticCodes, manifestDiagnosticCodes, networkDiagnosticCodes, platformDiagnosticCodes, publishDiagnosticCodes, regressionDiagnosticCodes, runtimeDiagnosticCodes, secretDiagnosticCodes, smokeDiagnosticCodes, submitDiagnosticCodes, targetDiagnosticCodes, typeDiagnosticCodes, verifyDiagnosticCodes };
71
+
72
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../../src/diagnostics/codes/index.ts"],"sourcesContent":["/**\n * The diagnostic catalog, assembled from one source file per area. `pnpm gen diagnostic` keeps\n * the lists below in step with the area files; edit the area files, not these lists.\n */\nimport type { Diagnostic } from \"../diagnostic.ts\";\nimport { buildDiagnostic, type DiagnosticDetails, type DiagnosticSpec } from \"../spec.ts\";\nimport { type A11yDiagnosticCode, a11yDiagnostics } from \"./a11y.ts\";\nimport { type ActionDiagnosticCode, actionDiagnostics } from \"./action.ts\";\nimport { type ArtifactDiagnosticCode, artifactDiagnostics } from \"./artifact.ts\";\nimport { type BuildDiagnosticCode, buildDiagnostics } from \"./build.ts\";\n// gen:area-imports\nimport { type CliDiagnosticCode, cliDiagnostics } from \"./cli.ts\";\nimport { type ConsoleDiagnosticCode, consoleDiagnostics } from \"./console.ts\";\nimport { type DepDiagnosticCode, depDiagnostics } from \"./dep.ts\";\nimport { type EnvDiagnosticCode, envDiagnostics } from \"./env.ts\";\nimport { type FieldDiagnosticCode, fieldDiagnostics } from \"./field.ts\";\nimport { type HomeDiagnosticCode, homeDiagnostics } from \"./home.ts\";\nimport { type HostDiagnosticCode, hostDiagnostics } from \"./host.ts\";\nimport { type HygieneDiagnosticCode, hygieneDiagnostics } from \"./hygiene.ts\";\nimport { type LiveDiagnosticCode, liveDiagnostics } from \"./live.ts\";\nimport { type ManifestDiagnosticCode, manifestDiagnostics } from \"./manifest.ts\";\nimport { type NetworkDiagnosticCode, networkDiagnostics } from \"./network.ts\";\nimport { type PlatformDiagnosticCode, platformDiagnostics } from \"./platform.ts\";\nimport { type PublishDiagnosticCode, publishDiagnostics } from \"./publish.ts\";\nimport { type RegressionDiagnosticCode, regressionDiagnostics } from \"./regression.ts\";\nimport { type RuntimeDiagnosticCode, runtimeDiagnostics } from \"./runtime.ts\";\nimport { type SecretDiagnosticCode, secretDiagnostics } from \"./secret.ts\";\nimport { type SmokeDiagnosticCode, smokeDiagnostics } from \"./smoke.ts\";\nimport { type SubmitDiagnosticCode, submitDiagnostics } from \"./submit.ts\";\nimport { type TargetDiagnosticCode, targetDiagnostics } from \"./target.ts\";\nimport { type TypeDiagnosticCode, typeDiagnostics } from \"./type.ts\";\nimport { type VerifyDiagnosticCode, verifyDiagnostics } from \"./verify.ts\";\n\nexport { type A11yDiagnosticCode, a11yDiagnosticCodes } from \"./a11y.ts\";\nexport { type ActionDiagnosticCode, actionDiagnosticCodes } from \"./action.ts\";\nexport { type ArtifactDiagnosticCode, artifactDiagnosticCodes } from \"./artifact.ts\";\nexport { type BuildDiagnosticCode, buildDiagnosticCodes } from \"./build.ts\";\n// gen:area-exports\nexport { type CliDiagnosticCode, cliDiagnosticCodes } from \"./cli.ts\";\nexport { type ConsoleDiagnosticCode, consoleDiagnosticCodes } from \"./console.ts\";\nexport { type DepDiagnosticCode, depDiagnosticCodes } from \"./dep.ts\";\nexport { type EnvDiagnosticCode, envDiagnosticCodes } from \"./env.ts\";\nexport { type FieldDiagnosticCode, fieldDiagnosticCodes } from \"./field.ts\";\nexport { type HomeDiagnosticCode, homeDiagnosticCodes } from \"./home.ts\";\nexport { type HostDiagnosticCode, hostDiagnosticCodes } from \"./host.ts\";\nexport { type HygieneDiagnosticCode, hygieneDiagnosticCodes } from \"./hygiene.ts\";\nexport { type LiveDiagnosticCode, liveDiagnosticCodes } from \"./live.ts\";\nexport { type ManifestDiagnosticCode, manifestDiagnosticCodes } from \"./manifest.ts\";\nexport { type NetworkDiagnosticCode, networkDiagnosticCodes } from \"./network.ts\";\nexport { type PlatformDiagnosticCode, platformDiagnosticCodes } from \"./platform.ts\";\nexport { type PublishDiagnosticCode, publishDiagnosticCodes } from \"./publish.ts\";\nexport { type RegressionDiagnosticCode, regressionDiagnosticCodes } from \"./regression.ts\";\nexport { type RuntimeDiagnosticCode, runtimeDiagnosticCodes } from \"./runtime.ts\";\nexport { type SecretDiagnosticCode, secretDiagnosticCodes } from \"./secret.ts\";\nexport { type SmokeDiagnosticCode, smokeDiagnosticCodes } from \"./smoke.ts\";\nexport { type SubmitDiagnosticCode, submitDiagnosticCodes } from \"./submit.ts\";\nexport { type TargetDiagnosticCode, targetDiagnosticCodes } from \"./target.ts\";\nexport { type TypeDiagnosticCode, typeDiagnosticCodes } from \"./type.ts\";\nexport { type VerifyDiagnosticCode, verifyDiagnosticCodes } from \"./verify.ts\";\n\n/** Every code in the catalog. Codes are semver surface and are never removed (AX-03). */\nexport type KnownDiagnosticCode =\n // gen:area-codes\n | CliDiagnosticCode\n | RegressionDiagnosticCode\n | SmokeDiagnosticCode\n | A11yDiagnosticCode\n | NetworkDiagnosticCode\n | ConsoleDiagnosticCode\n | TypeDiagnosticCode\n | VerifyDiagnosticCode\n | LiveDiagnosticCode\n | SecretDiagnosticCode\n | RuntimeDiagnosticCode\n | FieldDiagnosticCode\n | SubmitDiagnosticCode\n | HygieneDiagnosticCode\n | DepDiagnosticCode\n | EnvDiagnosticCode\n | TargetDiagnosticCode\n | ArtifactDiagnosticCode\n | PublishDiagnosticCode\n | ActionDiagnosticCode\n | BuildDiagnosticCode\n | ManifestDiagnosticCode\n | HomeDiagnosticCode\n | PlatformDiagnosticCode\n | HostDiagnosticCode;\n\n/** Every cataloged code with its severity, phase, title, default hint and docs text. */\nexport const diagnosticCatalog: Readonly<Record<KnownDiagnosticCode, DiagnosticSpec>> = {\n // gen:area-spreads\n ...cliDiagnostics,\n ...regressionDiagnostics,\n ...smokeDiagnostics,\n ...a11yDiagnostics,\n ...networkDiagnostics,\n ...consoleDiagnostics,\n ...typeDiagnostics,\n ...verifyDiagnostics,\n ...liveDiagnostics,\n ...secretDiagnostics,\n ...runtimeDiagnostics,\n ...fieldDiagnostics,\n ...submitDiagnostics,\n ...hygieneDiagnostics,\n ...depDiagnostics,\n ...envDiagnostics,\n ...targetDiagnostics,\n ...artifactDiagnostics,\n ...publishDiagnostics,\n ...actionDiagnostics,\n ...buildDiagnostics,\n ...manifestDiagnostics,\n ...homeDiagnostics,\n ...platformDiagnostics,\n ...hostDiagnostics,\n};\n\n/** Options for {@link createDiagnostic}. */\nexport interface CreateDiagnosticOptions {\n /** The docs site base URL. Defaults to `DEFAULT_DOCS_BASE`. */\n readonly docsBase?: string;\n}\n\n/**\n * Creates the diagnostic for one occurrence of a cataloged code. Severity, phase, the default hint\n * and the docs link come from the catalog.\n *\n * ```ts\n * createDiagnostic(\"MOSTRA_HOST_REVISION_UNSUPPORTED\", {\n * message: \"The client offered 2026-01-01; this instance supports 2026-10-10.\",\n * });\n * ```\n */\nexport function createDiagnostic(\n code: KnownDiagnosticCode,\n details: DiagnosticDetails,\n options: CreateDiagnosticOptions = {},\n): Diagnostic {\n return buildDiagnostic(code, diagnosticCatalog[code], details, options.docsBase);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0FA,MAAa,oBAA2E;CAEtF,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;AACL;;;;;;;;;;;AAkBA,SAAgB,iBACd,MACA,SACA,UAAmC,CAAC,GACxB;CACZ,OAAO,gBAAgB,MAAM,kBAAkB,OAAO,SAAS,QAAQ,QAAQ;AACjF"}
@@ -0,0 +1,8 @@
1
+ import "../spec.js";
2
+ //#region src/diagnostics/codes/live.d.ts
3
+ /** The codes of the LIVE area, in the order they were added. */
4
+ export declare const liveDiagnosticCodes: readonly ["MOSTRA_LIVE_TOO_LARGE", "MOSTRA_LIVE_SOURCE_FAILED"];
5
+ /** The codes of the LIVE area. */
6
+ export type LiveDiagnosticCode = (typeof liveDiagnosticCodes)[number];
7
+ //#endregion
8
+ //# sourceMappingURL=live.d.ts.map