@mostra/protocol 0.0.0-placeholder → 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 +37 -1
  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 -4
  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,61 @@
1
+ import { wireRegistry } from "./wire-registry.js";
2
+ import * as z from "zod";
3
+ //#region src/capability.ts
4
+ /**
5
+ * Capability links (D06, D97): the scopes a capability token grants and how long it lasts. A
6
+ * token is the authorization: whoever holds its link may do what its scopes allow, and nothing
7
+ * else limits an artifact or its viewers (D05).
8
+ */
9
+ /** The Zod schema of the `CapabilityScope` type. */
10
+ const CapabilityScope = z.string().regex(/^(view|draft|submit|review|signal|action:(\*|[^\s#*]+(#[^\s#*]+)?))$/).register(wireRegistry, {
11
+ id: "CapabilityScope",
12
+ description: "A capability token's scope: view, draft, submit, review, signal, action:*, action:<export> or action:<module path>#<export>."
13
+ });
14
+ /** Every scope at once: what a link minted without `scopes`, and every default link, carries. */
15
+ const ALL_SCOPES = [
16
+ "view",
17
+ "draft",
18
+ "submit",
19
+ "review",
20
+ "signal",
21
+ "action:*"
22
+ ];
23
+ /** The Zod schema of the `Duration` type. */
24
+ const Duration = z.string().regex(/^[1-9][0-9]{0,8}[smhd]$/).register(wireRegistry, {
25
+ id: "Duration",
26
+ description: "A duration: a positive whole number and s, m, h or d, such as 30m, 24h or 7d."
27
+ });
28
+ const UNIT_MS = {
29
+ s: 1e3,
30
+ m: 6e4,
31
+ h: 36e5,
32
+ d: 864e5
33
+ };
34
+ /** The length of a `Duration` in milliseconds. */
35
+ function durationMs(duration) {
36
+ const unit = duration.slice(-1);
37
+ return Number(duration.slice(0, -1)) * UNIT_MS[unit];
38
+ }
39
+ /**
40
+ * The scopes a token holds after normalization: `view` added, duplicates removed, sorted, so equal
41
+ * grants compare equal.
42
+ */
43
+ function normalizeScopes(scopes) {
44
+ return [.../* @__PURE__ */ new Set(["view", ...scopes])].sort();
45
+ }
46
+ /**
47
+ * Whether `scopes` grant `required`. A plain scope must be held as written. An action scope
48
+ * `action:<module path>#<export>` is granted by `action:*`, by `action:<export>` and by itself.
49
+ */
50
+ function scopeAllows(scopes, required) {
51
+ if (scopes.includes(required)) return true;
52
+ if (!required.startsWith("action:")) return false;
53
+ if (scopes.includes("action:*")) return true;
54
+ const functionId = required.slice(7);
55
+ const hash = functionId.lastIndexOf("#");
56
+ return hash >= 0 && scopes.includes(`action:${functionId.slice(hash + 1)}`);
57
+ }
58
+ //#endregion
59
+ export { ALL_SCOPES, CapabilityScope, Duration, durationMs, normalizeScopes, scopeAllows };
60
+
61
+ //# sourceMappingURL=capability.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"capability.js","names":[],"sources":["../src/capability.ts"],"sourcesContent":["/**\n * Capability links (D06, D97): the scopes a capability token grants and how long it lasts. A\n * token is the authorization: whoever holds its link may do what its scopes allow, and nothing\n * else limits an artifact or its viewers (D05).\n */\nimport * as z from \"zod\";\nimport { wireRegistry } from \"./wire-registry.ts\";\n\n/**\n * What a capability token allows (HY-03, D97):\n * - `view`: open the artifact; every token has it.\n * - `draft`: save answers and other field values.\n * - `submit`: submit.\n * - `review`: comment and choose.\n * - `signal`: raise a signal for the host's attention (D10), which a waiting agent may act on.\n * - `action:*`: run every server function; `action:<export>` runs that export of any\n * `\"use server\"` module; `action:<module path>#<export>` runs one function ID.\n */\nexport type CapabilityScope =\n | \"view\"\n | \"draft\"\n | \"submit\"\n | \"review\"\n | \"signal\"\n | `action:${string}`;\n\n/** The Zod schema of the `CapabilityScope` type. */\nexport const CapabilityScope: z.ZodType<CapabilityScope> = z\n .string()\n .regex(/^(view|draft|submit|review|signal|action:(\\*|[^\\s#*]+(#[^\\s#*]+)?))$/)\n .register(wireRegistry, {\n id: \"CapabilityScope\",\n description:\n \"A capability token's scope: view, draft, submit, review, signal, action:*, action:<export> or action:<module path>#<export>.\",\n }) as z.ZodType<CapabilityScope>;\n\n/** Every scope at once: what a link minted without `scopes`, and every default link, carries. */\nexport const ALL_SCOPES: readonly CapabilityScope[] = [\n \"view\",\n \"draft\",\n \"submit\",\n \"review\",\n \"signal\",\n \"action:*\",\n];\n\n/**\n * A duration: a positive whole number and a unit, `s`, `m`, `h` or `d` (`30m`, `24h`, `7d`), as\n * INTERFACES §1 writes durations in flags and manifests.\n */\nexport type Duration = `${number}${\"s\" | \"m\" | \"h\" | \"d\"}`;\n\n/** The Zod schema of the `Duration` type. */\nexport const Duration: z.ZodType<Duration> = z\n .string()\n .regex(/^[1-9][0-9]{0,8}[smhd]$/)\n .register(wireRegistry, {\n id: \"Duration\",\n description: \"A duration: a positive whole number and s, m, h or d, such as 30m, 24h or 7d.\",\n }) as z.ZodType<Duration>;\n\nconst UNIT_MS = { s: 1_000, m: 60_000, h: 3_600_000, d: 86_400_000 } as const;\n\n/** The length of a `Duration` in milliseconds. */\nexport function durationMs(duration: Duration): number {\n const unit = duration.slice(-1) as keyof typeof UNIT_MS;\n return Number(duration.slice(0, -1)) * UNIT_MS[unit];\n}\n\n/**\n * The scopes a token holds after normalization: `view` added, duplicates removed, sorted, so equal\n * grants compare equal.\n */\nexport function normalizeScopes(scopes: readonly CapabilityScope[]): CapabilityScope[] {\n return [...new Set<CapabilityScope>([\"view\", ...scopes])].sort();\n}\n\n/**\n * Whether `scopes` grant `required`. A plain scope must be held as written. An action scope\n * `action:<module path>#<export>` is granted by `action:*`, by `action:<export>` and by itself.\n */\nexport function scopeAllows(\n scopes: readonly CapabilityScope[],\n required: CapabilityScope,\n): boolean {\n if (scopes.includes(required)) return true;\n if (!required.startsWith(\"action:\")) return false;\n if (scopes.includes(\"action:*\")) return true;\n const functionId = required.slice(\"action:\".length);\n const hash = functionId.lastIndexOf(\"#\");\n return hash >= 0 && scopes.includes(`action:${functionId.slice(hash + 1)}`);\n}\n"],"mappings":";;;;;;;;;AA2BA,MAAa,kBAA8C,EACxD,OAAO,CAAC,CACR,MAAM,sEAAsE,CAAC,CAC7E,SAAS,cAAc;CACtB,IAAI;CACJ,aACE;AACJ,CAAC;;AAGH,MAAa,aAAyC;CACpD;CACA;CACA;CACA;CACA;CACA;AACF;;AASA,MAAa,WAAgC,EAC1C,OAAO,CAAC,CACR,MAAM,yBAAyB,CAAC,CAChC,SAAS,cAAc;CACtB,IAAI;CACJ,aAAa;AACf,CAAC;AAEH,MAAM,UAAU;CAAE,GAAG;CAAO,GAAG;CAAQ,GAAG;CAAW,GAAG;AAAW;;AAGnE,SAAgB,WAAW,UAA4B;CACrD,MAAM,OAAO,SAAS,MAAM,EAAE;CAC9B,OAAO,OAAO,SAAS,MAAM,GAAG,EAAE,CAAC,IAAI,QAAQ;AACjD;;;;;AAMA,SAAgB,gBAAgB,QAAuD;CACrF,OAAO,CAAC,mBAAG,IAAI,IAAqB,CAAC,QAAQ,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC,KAAK;AACjE;;;;;AAMA,SAAgB,YACd,QACA,UACS;CACT,IAAI,OAAO,SAAS,QAAQ,GAAG,OAAO;CACtC,IAAI,CAAC,SAAS,WAAW,SAAS,GAAG,OAAO;CAC5C,IAAI,OAAO,SAAS,UAAU,GAAG,OAAO;CACxC,MAAM,aAAa,SAAS,MAAM,CAAgB;CAClD,MAAM,OAAO,WAAW,YAAY,GAAG;CACvC,OAAO,QAAQ,KAAK,OAAO,SAAS,UAAU,WAAW,MAAM,OAAO,CAAC,GAAG;AAC5E"}
@@ -0,0 +1,8 @@
1
+ import "../spec.js";
2
+ //#region src/diagnostics/codes/a11y.d.ts
3
+ /** The codes of the A11Y area, in the order they were added. */
4
+ export declare const a11yDiagnosticCodes: readonly ["MOSTRA_A11Y_SERIOUS", "MOSTRA_A11Y_MINOR"];
5
+ /** The codes of the A11Y area. */
6
+ export type A11yDiagnosticCode = (typeof a11yDiagnosticCodes)[number];
7
+ //#endregion
8
+ //# sourceMappingURL=a11y.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"a11y.d.ts","names":[],"sources":["../../../src/diagnostics/codes/a11y.ts"],"mappings":";;;qBAMa;;YAOD,6BAA6B"}
@@ -0,0 +1,30 @@
1
+ //#region src/diagnostics/codes/a11y.ts
2
+ /** The codes of the A11Y area, in the order they were added. */
3
+ const a11yDiagnosticCodes = ["MOSTRA_A11Y_SERIOUS", "MOSTRA_A11Y_MINOR"];
4
+ /** The A11Y area's catalog entries. */
5
+ const a11yDiagnostics = {
6
+ MOSTRA_A11Y_SERIOUS: {
7
+ severity: "warning",
8
+ phase: "a11y",
9
+ title: "Serious accessibility problem",
10
+ hint: "Read axe's description of the rule in the message; it names the elements it found.",
11
+ docs: {
12
+ explanation: "axe-core found a problem it rates critical or serious, such as a button with no accessible name or text with too little contrast. The message names axe's rule and the elements; `count` says how many.",
13
+ fix: "Follow the rule's advice for each element named, for example add an `aria-label` to an icon button."
14
+ }
15
+ },
16
+ MOSTRA_A11Y_MINOR: {
17
+ severity: "hint",
18
+ phase: "a11y",
19
+ title: "Minor accessibility problem",
20
+ hint: "Read axe's description of the rule in the message.",
21
+ docs: {
22
+ explanation: "axe-core found a problem it rates moderate or minor. The message names axe's rule and the elements.",
23
+ fix: "Optionally follow the rule's advice."
24
+ }
25
+ }
26
+ };
27
+ //#endregion
28
+ export { a11yDiagnosticCodes, a11yDiagnostics };
29
+
30
+ //# sourceMappingURL=a11y.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"a11y.js","names":[],"sources":["../../../src/diagnostics/codes/a11y.ts"],"sourcesContent":["/**\n * Diagnostic codes of the A11Y area.\n */\nimport type { AreaCatalog } from \"../spec.ts\";\n\n/** The codes of the A11Y area, in the order they were added. */\nexport const a11yDiagnosticCodes = [\n \"MOSTRA_A11Y_SERIOUS\",\n \"MOSTRA_A11Y_MINOR\",\n // gen:codes\n] as const;\n\n/** The codes of the A11Y area. */\nexport type A11yDiagnosticCode = (typeof a11yDiagnosticCodes)[number];\n\n/** The A11Y area's catalog entries. */\nexport const a11yDiagnostics: AreaCatalog<A11yDiagnosticCode> = {\n MOSTRA_A11Y_SERIOUS: {\n severity: \"warning\",\n phase: \"a11y\",\n title: \"Serious accessibility problem\",\n hint: \"Read axe's description of the rule in the message; it names the elements it found.\",\n docs: {\n explanation:\n \"axe-core found a problem it rates critical or serious, such as a button with no accessible name or text with too little contrast. The message names axe's rule and the elements; `count` says how many.\",\n fix: \"Follow the rule's advice for each element named, for example add an `aria-label` to an icon button.\",\n },\n },\n MOSTRA_A11Y_MINOR: {\n severity: \"hint\",\n phase: \"a11y\",\n title: \"Minor accessibility problem\",\n hint: \"Read axe's description of the rule in the message.\",\n docs: {\n explanation:\n \"axe-core found a problem it rates moderate or minor. The message names axe's rule and the elements.\",\n fix: \"Optionally follow the rule's advice.\",\n },\n },\n // gen:entries\n};\n"],"mappings":";;AAMA,MAAa,sBAAsB,CACjC,uBACA,mBAEF;;AAMA,MAAa,kBAAmD;CAC9D,qBAAqB;EACnB,UAAU;EACV,OAAO;EACP,OAAO;EACP,MAAM;EACN,MAAM;GACJ,aACE;GACF,KAAK;EACP;CACF;CACA,mBAAmB;EACjB,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/action.d.ts
3
+ /** The codes of the ACTION area, in the order they were added. */
4
+ export declare const actionDiagnosticCodes: readonly ["MOSTRA_ACTION_EXPORT_INVALID", "MOSTRA_ACTION_UNSERIALIZABLE", "MOSTRA_ACTION_THREW", "MOSTRA_ACTION_UNKNOWN_FUNCTION", "MOSTRA_ACTION_INTERRUPTED", "MOSTRA_ACTION_CANCELLED", "MOSTRA_ACTION_TOO_LARGE", "MOSTRA_ACTION_RUN_NOT_FOUND", "MOSTRA_ACTION_EVENT_INVALID"];
5
+ /** The codes of the ACTION area. */
6
+ export type ActionDiagnosticCode = (typeof actionDiagnosticCodes)[number];
7
+ //#endregion
8
+ //# sourceMappingURL=action.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"action.d.ts","names":[],"sources":["../../../src/diagnostics/codes/action.ts"],"mappings":";;;qBAMa;;YAcD,+BAA+B"}
@@ -0,0 +1,110 @@
1
+ //#region src/diagnostics/codes/action.ts
2
+ /** The codes of the ACTION area, in the order they were added. */
3
+ const actionDiagnosticCodes = [
4
+ "MOSTRA_ACTION_EXPORT_INVALID",
5
+ "MOSTRA_ACTION_UNSERIALIZABLE",
6
+ "MOSTRA_ACTION_THREW",
7
+ "MOSTRA_ACTION_UNKNOWN_FUNCTION",
8
+ "MOSTRA_ACTION_INTERRUPTED",
9
+ "MOSTRA_ACTION_CANCELLED",
10
+ "MOSTRA_ACTION_TOO_LARGE",
11
+ "MOSTRA_ACTION_RUN_NOT_FOUND",
12
+ "MOSTRA_ACTION_EVENT_INVALID"
13
+ ];
14
+ /** The ACTION area's catalog entries. */
15
+ const actionDiagnostics = {
16
+ MOSTRA_ACTION_EXPORT_INVALID: {
17
+ severity: "error",
18
+ phase: "compile",
19
+ title: "Server module exports something other than an async function",
20
+ hint: "Export only async functions from a \"use server\" module; move other exports to an ordinary module.",
21
+ docs: {
22
+ explanation: "A module that starts with `\"use server\"` makes every export a server function the page can call. React's contract allows only async functions there. Mostra reports this code for any other export (a constant, a class, a non-async function, `export *`), naming the export.",
23
+ fix: "Make the function `async`, or move the value to a separate module without the directive and import it from both sides."
24
+ }
25
+ },
26
+ MOSTRA_ACTION_UNSERIALIZABLE: {
27
+ severity: "error",
28
+ phase: "runtime",
29
+ title: "Server function argument or result outside React's serializable types",
30
+ hint: "Pass and return only plain objects, arrays, primitives, Map, Set, Date, typed arrays, FormData and promises; convert class instances to plain objects first.",
31
+ docs: {
32
+ explanation: "Server function arguments and results cross a process boundary, so Mostra accepts exactly the types React documents for Server Functions (D54): strings, numbers, bigints, booleans, `undefined`, `null`, symbols registered with `Symbol.for`, arrays, `Map`, `Set`, typed arrays, `ArrayBuffer`, `Date`, `FormData`, plain objects, other server functions and promises. A result may also be an async iterable, whose items stream to the page. Mostra reports this code for anything else (a class instance, an `Error`, a `RegExp`, an object with a null prototype, a function that isn't a server function, an unregistered symbol, JSX) and names where in the value it is, such as `Argument 2 at .items[1]`. A promise in an argument that rejects fails the call the same way.",
33
+ fix: "Convert the value to the supported types before the call or the return: `{ ...instance }` or a mapping for class instances, `error.message` for errors and `regexp.source` for regular expressions."
34
+ }
35
+ },
36
+ MOSTRA_ACTION_THREW: {
37
+ severity: "error",
38
+ phase: "runtime",
39
+ title: "Server function threw",
40
+ hint: "Read the run's log for the stack, then fix the server function or catch the error and return a result instead.",
41
+ docs: {
42
+ explanation: "A server function threw while it ran. The page gets `{ code: \"MOSTRA_ACTION_THREW\", message }` with the thrown error's message (`useAction`'s `error`, or the rejected promise of a plain call); the stack goes to the action run's log, never to the page. When the error carried a diagnostic code of its own (a `MOSTRA_SECRET_MISSING`, say), that code is reported instead.",
43
+ fix: "Fix the cause in the function, or catch the error inside it and return a value the page can show. Mostra never retries a run by itself (D24); retry in your own code, or call the action again with a new key."
44
+ }
45
+ },
46
+ MOSTRA_ACTION_UNKNOWN_FUNCTION: {
47
+ severity: "error",
48
+ phase: "runtime",
49
+ title: "No such server function in this version",
50
+ hint: "Publish the artifact again so the page and its server code come from the same version.",
51
+ docs: {
52
+ explanation: "The page called a server function ID (`<module path>#<export>`) that the version's server bundle doesn't export. Pages call only functions their own build references, so this means a page and a worker of different versions, or a request written by hand.",
53
+ fix: "Republish the artifact and reload the page. Call server functions by importing them from their `\"use server\"` module, never by ID."
54
+ }
55
+ },
56
+ MOSTRA_ACTION_INTERRUPTED: {
57
+ severity: "error",
58
+ phase: "runtime",
59
+ title: "Action run interrupted",
60
+ hint: "Check the run's effects at their provider, then start it again with a new key if it should run again.",
61
+ docs: {
62
+ explanation: "The action run's worker crashed, ran out of memory, was stopped by the event-loop watchdog, or the instance stopped while the run was running. The run ends `failed` with the reason `interrupted`, and Mostra never retries it by itself (D24): an action that had already started a side effect, such as sending an email, may or may not have finished it.",
63
+ fix: "Look at the effect where it happens (the mail provider's sent folder, say) before running the action again. Pass the provider's own idempotency key from the action (for example, the run's key) so a repeated request can't act twice."
64
+ }
65
+ },
66
+ MOSTRA_ACTION_CANCELLED: {
67
+ severity: "warning",
68
+ phase: "runtime",
69
+ title: "Action run cancelled",
70
+ hint: "Start the action again if it should still run.",
71
+ docs: {
72
+ explanation: "The action run was cancelled from a page, and its `abortSignal` fired. The run ends `cancelled` when the action stops; an action that ignores the signal ends with whatever it returns.",
73
+ fix: "Nothing to fix. Pass `abortSignal` from `@mostra/server` to `fetch` and other cancellable calls so cancelling stops the work."
74
+ }
75
+ },
76
+ MOSTRA_ACTION_TOO_LARGE: {
77
+ severity: "error",
78
+ phase: "runtime",
79
+ title: "Server function arguments or result too large",
80
+ hint: "Return or pass less data: page through it, or write it to artifact state or a live source instead.",
81
+ docs: {
82
+ explanation: "A server function's serialized arguments, or an action run's serialized result, is over 16 MiB. A plain call or run with arguments that large is refused before it starts; a run whose result grows past the limit is stopped and ends `failed`.",
83
+ fix: "Send identifiers rather than whole documents, return a page of results at a time, or publish large data through a live source or artifact state, which the page reads on its own."
84
+ }
85
+ },
86
+ MOSTRA_ACTION_RUN_NOT_FOUND: {
87
+ severity: "error",
88
+ phase: "runtime",
89
+ title: "No such action run",
90
+ hint: "Start the action again; the run ID names no run of this artifact.",
91
+ docs: {
92
+ explanation: "A page asked for or cancelled an action run that this artifact doesn't have, or one started from another artifact.",
93
+ fix: "Use the run IDs `useAction` reports. A page that keeps run IDs itself should drop IDs from other artifacts."
94
+ }
95
+ },
96
+ MOSTRA_ACTION_EVENT_INVALID: {
97
+ severity: "error",
98
+ phase: "runtime",
99
+ title: "Host event type or payload invalid",
100
+ hint: "Name the event `host.<name>` with 1 to 64 letters, digits, `.`, `_` and `-`, and keep its payload JSON of at most 64 KiB.",
101
+ docs: {
102
+ explanation: "Server code called `emit(type, payload)` from `@mostra/server` with a type that isn't `host.` followed by a name, or a payload that isn't JSON or is larger than 64 KiB. The event is not appended; `emit` throws.",
103
+ fix: "Use a type such as `host.reply-sent` and a small JSON payload. Put larger data in artifact state or a live source and send its key in the event."
104
+ }
105
+ }
106
+ };
107
+ //#endregion
108
+ export { actionDiagnosticCodes, actionDiagnostics };
109
+
110
+ //# sourceMappingURL=action.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"action.js","names":[],"sources":["../../../src/diagnostics/codes/action.ts"],"sourcesContent":["/**\n * Diagnostic codes of the ACTION area.\n */\nimport type { AreaCatalog } from \"../spec.ts\";\n\n/** The codes of the ACTION area, in the order they were added. */\nexport const actionDiagnosticCodes = [\n \"MOSTRA_ACTION_EXPORT_INVALID\",\n \"MOSTRA_ACTION_UNSERIALIZABLE\",\n \"MOSTRA_ACTION_THREW\",\n \"MOSTRA_ACTION_UNKNOWN_FUNCTION\",\n \"MOSTRA_ACTION_INTERRUPTED\",\n \"MOSTRA_ACTION_CANCELLED\",\n \"MOSTRA_ACTION_TOO_LARGE\",\n \"MOSTRA_ACTION_RUN_NOT_FOUND\",\n \"MOSTRA_ACTION_EVENT_INVALID\",\n // gen:codes\n] as const;\n\n/** The codes of the ACTION area. */\nexport type ActionDiagnosticCode = (typeof actionDiagnosticCodes)[number];\n\n/** The ACTION area's catalog entries. */\nexport const actionDiagnostics: AreaCatalog<ActionDiagnosticCode> = {\n MOSTRA_ACTION_EXPORT_INVALID: {\n severity: \"error\",\n phase: \"compile\",\n title: \"Server module exports something other than an async function\",\n hint: 'Export only async functions from a \"use server\" module; move other exports to an ordinary module.',\n docs: {\n explanation:\n 'A module that starts with `\"use server\"` makes every export a server function the page can call. React\\'s contract allows only async functions there. Mostra reports this code for any other export (a constant, a class, a non-async function, `export *`), naming the export.',\n fix: \"Make the function `async`, or move the value to a separate module without the directive and import it from both sides.\",\n },\n },\n MOSTRA_ACTION_UNSERIALIZABLE: {\n severity: \"error\",\n phase: \"runtime\",\n title: \"Server function argument or result outside React's serializable types\",\n hint: \"Pass and return only plain objects, arrays, primitives, Map, Set, Date, typed arrays, FormData and promises; convert class instances to plain objects first.\",\n docs: {\n explanation:\n \"Server function arguments and results cross a process boundary, so Mostra accepts exactly the types React documents for Server Functions (D54): strings, numbers, bigints, booleans, `undefined`, `null`, symbols registered with `Symbol.for`, arrays, `Map`, `Set`, typed arrays, `ArrayBuffer`, `Date`, `FormData`, plain objects, other server functions and promises. A result may also be an async iterable, whose items stream to the page. Mostra reports this code for anything else (a class instance, an `Error`, a `RegExp`, an object with a null prototype, a function that isn't a server function, an unregistered symbol, JSX) and names where in the value it is, such as `Argument 2 at .items[1]`. A promise in an argument that rejects fails the call the same way.\",\n fix: \"Convert the value to the supported types before the call or the return: `{ ...instance }` or a mapping for class instances, `error.message` for errors and `regexp.source` for regular expressions.\",\n },\n },\n MOSTRA_ACTION_THREW: {\n severity: \"error\",\n phase: \"runtime\",\n title: \"Server function threw\",\n hint: \"Read the run's log for the stack, then fix the server function or catch the error and return a result instead.\",\n docs: {\n explanation:\n \"A server function threw while it ran. The page gets `{ code: \\\"MOSTRA_ACTION_THREW\\\", message }` with the thrown error's message (`useAction`'s `error`, or the rejected promise of a plain call); the stack goes to the action run's log, never to the page. When the error carried a diagnostic code of its own (a `MOSTRA_SECRET_MISSING`, say), that code is reported instead.\",\n fix: \"Fix the cause in the function, or catch the error inside it and return a value the page can show. Mostra never retries a run by itself (D24); retry in your own code, or call the action again with a new key.\",\n },\n },\n MOSTRA_ACTION_UNKNOWN_FUNCTION: {\n severity: \"error\",\n phase: \"runtime\",\n title: \"No such server function in this version\",\n hint: \"Publish the artifact again so the page and its server code come from the same version.\",\n docs: {\n explanation:\n \"The page called a server function ID (`<module path>#<export>`) that the version's server bundle doesn't export. Pages call only functions their own build references, so this means a page and a worker of different versions, or a request written by hand.\",\n fix: 'Republish the artifact and reload the page. Call server functions by importing them from their `\"use server\"` module, never by ID.',\n },\n },\n MOSTRA_ACTION_INTERRUPTED: {\n severity: \"error\",\n phase: \"runtime\",\n title: \"Action run interrupted\",\n hint: \"Check the run's effects at their provider, then start it again with a new key if it should run again.\",\n docs: {\n explanation:\n \"The action run's worker crashed, ran out of memory, was stopped by the event-loop watchdog, or the instance stopped while the run was running. The run ends `failed` with the reason `interrupted`, and Mostra never retries it by itself (D24): an action that had already started a side effect, such as sending an email, may or may not have finished it.\",\n fix: \"Look at the effect where it happens (the mail provider's sent folder, say) before running the action again. Pass the provider's own idempotency key from the action (for example, the run's key) so a repeated request can't act twice.\",\n },\n },\n MOSTRA_ACTION_CANCELLED: {\n severity: \"warning\",\n phase: \"runtime\",\n title: \"Action run cancelled\",\n hint: \"Start the action again if it should still run.\",\n docs: {\n explanation:\n \"The action run was cancelled from a page, and its `abortSignal` fired. The run ends `cancelled` when the action stops; an action that ignores the signal ends with whatever it returns.\",\n fix: \"Nothing to fix. Pass `abortSignal` from `@mostra/server` to `fetch` and other cancellable calls so cancelling stops the work.\",\n },\n },\n MOSTRA_ACTION_TOO_LARGE: {\n severity: \"error\",\n phase: \"runtime\",\n title: \"Server function arguments or result too large\",\n hint: \"Return or pass less data: page through it, or write it to artifact state or a live source instead.\",\n docs: {\n explanation:\n \"A server function's serialized arguments, or an action run's serialized result, is over 16 MiB. A plain call or run with arguments that large is refused before it starts; a run whose result grows past the limit is stopped and ends `failed`.\",\n fix: \"Send identifiers rather than whole documents, return a page of results at a time, or publish large data through a live source or artifact state, which the page reads on its own.\",\n },\n },\n MOSTRA_ACTION_RUN_NOT_FOUND: {\n severity: \"error\",\n phase: \"runtime\",\n title: \"No such action run\",\n hint: \"Start the action again; the run ID names no run of this artifact.\",\n docs: {\n explanation:\n \"A page asked for or cancelled an action run that this artifact doesn't have, or one started from another artifact.\",\n fix: \"Use the run IDs `useAction` reports. A page that keeps run IDs itself should drop IDs from other artifacts.\",\n },\n },\n MOSTRA_ACTION_EVENT_INVALID: {\n severity: \"error\",\n phase: \"runtime\",\n title: \"Host event type or payload invalid\",\n hint: \"Name the event `host.<name>` with 1 to 64 letters, digits, `.`, `_` and `-`, and keep its payload JSON of at most 64 KiB.\",\n docs: {\n explanation:\n \"Server code called `emit(type, payload)` from `@mostra/server` with a type that isn't `host.` followed by a name, or a payload that isn't JSON or is larger than 64 KiB. The event is not appended; `emit` throws.\",\n fix: \"Use a type such as `host.reply-sent` and a small JSON payload. Put larger data in artifact state or a live source and send its key in the event.\",\n },\n },\n // gen:entries\n};\n"],"mappings":";;AAMA,MAAa,wBAAwB;CACnC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AAEF;;AAMA,MAAa,oBAAuD;CAClE,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,qBAAqB;EACnB,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,2BAA2B;EACzB,UAAU;EACV,OAAO;EACP,OAAO;EACP,MAAM;EACN,MAAM;GACJ,aACE;GACF,KAAK;EACP;CACF;CACA,yBAAyB;EACvB,UAAU;EACV,OAAO;EACP,OAAO;EACP,MAAM;EACN,MAAM;GACJ,aACE;GACF,KAAK;EACP;CACF;CACA,yBAAyB;EACvB,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;AAEF"}
@@ -0,0 +1,8 @@
1
+ import "../spec.js";
2
+ //#region src/diagnostics/codes/artifact.d.ts
3
+ /** The codes of the ARTIFACT area, in the order they were added. */
4
+ export declare const artifactDiagnosticCodes: readonly ["MOSTRA_ARTIFACT_NOT_FOUND", "MOSTRA_ARTIFACT_SOURCE_MISSING", "MOSTRA_ARTIFACT_SOURCE_UNREADABLE", "MOSTRA_ARTIFACT_NO_ENTRY", "MOSTRA_ARTIFACT_ENTRY_AMBIGUOUS", "MOSTRA_ARTIFACT_NO_PAGE", "MOSTRA_ARTIFACT_DIR_NOT_EMPTY", "MOSTRA_ARTIFACT_TEMPLATE_UNKNOWN", "MOSTRA_ARTIFACT_VERSION_NOT_FOUND", "MOSTRA_ARTIFACT_VERSION_COLLECTED"];
5
+ /** The codes of the ARTIFACT area. */
6
+ export type ArtifactDiagnosticCode = (typeof artifactDiagnosticCodes)[number];
7
+ //#endregion
8
+ //# sourceMappingURL=artifact.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"artifact.d.ts","names":[],"sources":["../../../src/diagnostics/codes/artifact.ts"],"mappings":";;;qBAMa;;YAeD,iCAAiC"}
@@ -0,0 +1,121 @@
1
+ //#region src/diagnostics/codes/artifact.ts
2
+ /** The codes of the ARTIFACT area, in the order they were added. */
3
+ const artifactDiagnosticCodes = [
4
+ "MOSTRA_ARTIFACT_NOT_FOUND",
5
+ "MOSTRA_ARTIFACT_SOURCE_MISSING",
6
+ "MOSTRA_ARTIFACT_SOURCE_UNREADABLE",
7
+ "MOSTRA_ARTIFACT_NO_ENTRY",
8
+ "MOSTRA_ARTIFACT_ENTRY_AMBIGUOUS",
9
+ "MOSTRA_ARTIFACT_NO_PAGE",
10
+ "MOSTRA_ARTIFACT_DIR_NOT_EMPTY",
11
+ "MOSTRA_ARTIFACT_TEMPLATE_UNKNOWN",
12
+ "MOSTRA_ARTIFACT_VERSION_NOT_FOUND",
13
+ "MOSTRA_ARTIFACT_VERSION_COLLECTED"
14
+ ];
15
+ /** The ARTIFACT area's catalog entries. */
16
+ const artifactDiagnostics = {
17
+ MOSTRA_ARTIFACT_NOT_FOUND: {
18
+ severity: "error",
19
+ phase: "host",
20
+ title: "Artifact not found",
21
+ hint: "Check the artifact ID or source path, or list the home's artifacts with `mostra list`.",
22
+ docs: {
23
+ explanation: "The artifact named by an ID or a source path doesn't exist in this home: the ID was never published here, or the path was never published.",
24
+ fix: "Use an ID or path from `mostra list`. A source that was never published becomes an artifact at its first `mostra publish`. A host that uses its own home sees only the artifacts published there."
25
+ }
26
+ },
27
+ MOSTRA_ARTIFACT_SOURCE_MISSING: {
28
+ severity: "error",
29
+ phase: "publish",
30
+ title: "Artifact source missing",
31
+ hint: "Publish from the artifact's source path, or restore the directory the message names.",
32
+ docs: {
33
+ explanation: "Publishing needs the artifact's source files. The path given, or the path the artifact was last published from, doesn't exist. Versions already published stay readable, because Mostra keeps a snapshot of their source in the home.",
34
+ fix: "Pass the path where the source lives now. Its manifest `id`, if it has one, keeps the artifact identity at the new path."
35
+ }
36
+ },
37
+ MOSTRA_ARTIFACT_SOURCE_UNREADABLE: {
38
+ severity: "error",
39
+ phase: "publish",
40
+ title: "Artifact source can't be read",
41
+ hint: "Fix the file or directory the message names so your user can read it, then publish again.",
42
+ docs: {
43
+ explanation: "Mostra couldn't read a file of the artifact's source: permissions, a file that disappeared while it was copied, or two names that are the same after Unicode normalization. Nothing was published.",
44
+ fix: "Make the named file readable, rename one of two clashing names, or exclude the file with `.mostraignore` in the artifact's root."
45
+ }
46
+ },
47
+ MOSTRA_ARTIFACT_NO_ENTRY: {
48
+ severity: "error",
49
+ phase: "manifest",
50
+ title: "No entry file",
51
+ hint: "Add `index.tsx` or `index.mdx` to the directory, or publish a single `.tsx` or `.mdx` file.",
52
+ docs: {
53
+ explanation: "An artifact is a single `.tsx`, `.jsx` or `.mdx` file, or a directory whose entry is `index.tsx`, `index.jsx` or `index.mdx`. The source given is neither.",
54
+ fix: "Create the entry: its default export is the page, and its manifest is `export const artifact = defineArtifact({ title: \"...\" })` (or frontmatter in MDX). For a single page, publish the file itself."
55
+ }
56
+ },
57
+ MOSTRA_ARTIFACT_ENTRY_AMBIGUOUS: {
58
+ severity: "error",
59
+ phase: "manifest",
60
+ title: "More than one entry file",
61
+ hint: "Keep one entry file in the directory and rename or remove the others.",
62
+ docs: {
63
+ explanation: "A directory artifact has exactly one entry, and this directory has more than one of `index.tsx`, `index.jsx` and `index.mdx`, so Mostra can't tell which one is the page.",
64
+ fix: "Keep the entry you mean and rename the others, for example into `components/`."
65
+ }
66
+ },
67
+ MOSTRA_ARTIFACT_NO_PAGE: {
68
+ severity: "error",
69
+ phase: "manifest",
70
+ title: "Entry has no page",
71
+ hint: "Export the page component as the entry's default export, or add a `pages/` folder.",
72
+ docs: {
73
+ explanation: "The entry has no default export and the artifact has no `pages/` folder, so there is nothing to render. With `pages/`, each file there is a route and the entry's default export, when present, is the layout around them.",
74
+ fix: "Add `export default function Page() { ... }` to the entry, or move pages into `pages/index.tsx`, `pages/settings.tsx` and so on."
75
+ }
76
+ },
77
+ MOSTRA_ARTIFACT_DIR_NOT_EMPTY: {
78
+ severity: "error",
79
+ phase: "host",
80
+ title: "Directory isn't empty",
81
+ hint: "Choose a new or empty directory for the artifact.",
82
+ docs: {
83
+ explanation: "Creating an artifact writes its entry into a directory, and the directory given already has files. Mostra never overwrites them.",
84
+ fix: "Pass a path that doesn't exist yet or an empty directory. To make existing files an artifact, add the entry yourself and publish."
85
+ }
86
+ },
87
+ MOSTRA_ARTIFACT_TEMPLATE_UNKNOWN: {
88
+ severity: "error",
89
+ phase: "host",
90
+ title: "Unknown template",
91
+ hint: "Create the artifact without a template, or use a template this Mostra release provides.",
92
+ docs: {
93
+ explanation: "The template named isn't one this runtime provides. Without a template, Mostra writes a minimal entry with a generated artifact ID.",
94
+ fix: "Leave out the template, or use one of the templates of this release."
95
+ }
96
+ },
97
+ MOSTRA_ARTIFACT_VERSION_NOT_FOUND: {
98
+ severity: "error",
99
+ phase: "host",
100
+ title: "No such version",
101
+ hint: "Name a version the artifact has (`artifact/get` lists them), or leave the version out for the latest.",
102
+ docs: {
103
+ explanation: "The request named a version number or version ID that this artifact never published in this home. Viewers only ever open published versions (D09), so there is nothing to show.",
104
+ fix: "List the artifact's versions with `artifact/get` and pick one, or omit the version to open the latest. A link to `/a/<artifactId>/v/<number>` needs a number from that list."
105
+ }
106
+ },
107
+ MOSTRA_ARTIFACT_VERSION_COLLECTED: {
108
+ severity: "error",
109
+ phase: "host",
110
+ title: "Version collected",
111
+ hint: "Open the artifact's latest version, or publish this version's source again to restore its files.",
112
+ docs: {
113
+ explanation: "`mostra gc` removed this version's files because nothing referenced it (D140). Its ID and number stay in the ledger forever, so history and events still name it, but it can't be opened or linked.",
114
+ fix: "Open a version that still exists (`artifact/get` marks collected ones), or publish the exact source of this version again: publish restores its files under the same ID and number."
115
+ }
116
+ }
117
+ };
118
+ //#endregion
119
+ export { artifactDiagnosticCodes, artifactDiagnostics };
120
+
121
+ //# sourceMappingURL=artifact.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"artifact.js","names":[],"sources":["../../../src/diagnostics/codes/artifact.ts"],"sourcesContent":["/**\n * Diagnostic codes of the ARTIFACT area.\n */\nimport type { AreaCatalog } from \"../spec.ts\";\n\n/** The codes of the ARTIFACT area, in the order they were added. */\nexport const artifactDiagnosticCodes = [\n \"MOSTRA_ARTIFACT_NOT_FOUND\",\n \"MOSTRA_ARTIFACT_SOURCE_MISSING\",\n \"MOSTRA_ARTIFACT_SOURCE_UNREADABLE\",\n \"MOSTRA_ARTIFACT_NO_ENTRY\",\n \"MOSTRA_ARTIFACT_ENTRY_AMBIGUOUS\",\n \"MOSTRA_ARTIFACT_NO_PAGE\",\n \"MOSTRA_ARTIFACT_DIR_NOT_EMPTY\",\n \"MOSTRA_ARTIFACT_TEMPLATE_UNKNOWN\",\n \"MOSTRA_ARTIFACT_VERSION_NOT_FOUND\",\n \"MOSTRA_ARTIFACT_VERSION_COLLECTED\",\n // gen:codes\n] as const;\n\n/** The codes of the ARTIFACT area. */\nexport type ArtifactDiagnosticCode = (typeof artifactDiagnosticCodes)[number];\n\n/** The ARTIFACT area's catalog entries. */\nexport const artifactDiagnostics: AreaCatalog<ArtifactDiagnosticCode> = {\n MOSTRA_ARTIFACT_NOT_FOUND: {\n severity: \"error\",\n phase: \"host\",\n title: \"Artifact not found\",\n hint: \"Check the artifact ID or source path, or list the home's artifacts with `mostra list`.\",\n docs: {\n explanation:\n \"The artifact named by an ID or a source path doesn't exist in this home: the ID was never published here, or the path was never published.\",\n fix: \"Use an ID or path from `mostra list`. A source that was never published becomes an artifact at its first `mostra publish`. A host that uses its own home sees only the artifacts published there.\",\n },\n },\n MOSTRA_ARTIFACT_SOURCE_MISSING: {\n severity: \"error\",\n phase: \"publish\",\n title: \"Artifact source missing\",\n hint: \"Publish from the artifact's source path, or restore the directory the message names.\",\n docs: {\n explanation:\n \"Publishing needs the artifact's source files. The path given, or the path the artifact was last published from, doesn't exist. Versions already published stay readable, because Mostra keeps a snapshot of their source in the home.\",\n fix: \"Pass the path where the source lives now. Its manifest `id`, if it has one, keeps the artifact identity at the new path.\",\n },\n },\n MOSTRA_ARTIFACT_SOURCE_UNREADABLE: {\n severity: \"error\",\n phase: \"publish\",\n title: \"Artifact source can't be read\",\n hint: \"Fix the file or directory the message names so your user can read it, then publish again.\",\n docs: {\n explanation:\n \"Mostra couldn't read a file of the artifact's source: permissions, a file that disappeared while it was copied, or two names that are the same after Unicode normalization. Nothing was published.\",\n fix: \"Make the named file readable, rename one of two clashing names, or exclude the file with `.mostraignore` in the artifact's root.\",\n },\n },\n MOSTRA_ARTIFACT_NO_ENTRY: {\n severity: \"error\",\n phase: \"manifest\",\n title: \"No entry file\",\n hint: \"Add `index.tsx` or `index.mdx` to the directory, or publish a single `.tsx` or `.mdx` file.\",\n docs: {\n explanation:\n \"An artifact is a single `.tsx`, `.jsx` or `.mdx` file, or a directory whose entry is `index.tsx`, `index.jsx` or `index.mdx`. The source given is neither.\",\n fix: 'Create the entry: its default export is the page, and its manifest is `export const artifact = defineArtifact({ title: \"...\" })` (or frontmatter in MDX). For a single page, publish the file itself.',\n },\n },\n MOSTRA_ARTIFACT_ENTRY_AMBIGUOUS: {\n severity: \"error\",\n phase: \"manifest\",\n title: \"More than one entry file\",\n hint: \"Keep one entry file in the directory and rename or remove the others.\",\n docs: {\n explanation:\n \"A directory artifact has exactly one entry, and this directory has more than one of `index.tsx`, `index.jsx` and `index.mdx`, so Mostra can't tell which one is the page.\",\n fix: \"Keep the entry you mean and rename the others, for example into `components/`.\",\n },\n },\n MOSTRA_ARTIFACT_NO_PAGE: {\n severity: \"error\",\n phase: \"manifest\",\n title: \"Entry has no page\",\n hint: \"Export the page component as the entry's default export, or add a `pages/` folder.\",\n docs: {\n explanation:\n \"The entry has no default export and the artifact has no `pages/` folder, so there is nothing to render. With `pages/`, each file there is a route and the entry's default export, when present, is the layout around them.\",\n fix: \"Add `export default function Page() { ... }` to the entry, or move pages into `pages/index.tsx`, `pages/settings.tsx` and so on.\",\n },\n },\n MOSTRA_ARTIFACT_DIR_NOT_EMPTY: {\n severity: \"error\",\n phase: \"host\",\n title: \"Directory isn't empty\",\n hint: \"Choose a new or empty directory for the artifact.\",\n docs: {\n explanation:\n \"Creating an artifact writes its entry into a directory, and the directory given already has files. Mostra never overwrites them.\",\n fix: \"Pass a path that doesn't exist yet or an empty directory. To make existing files an artifact, add the entry yourself and publish.\",\n },\n },\n MOSTRA_ARTIFACT_TEMPLATE_UNKNOWN: {\n severity: \"error\",\n phase: \"host\",\n title: \"Unknown template\",\n hint: \"Create the artifact without a template, or use a template this Mostra release provides.\",\n docs: {\n explanation:\n \"The template named isn't one this runtime provides. Without a template, Mostra writes a minimal entry with a generated artifact ID.\",\n fix: \"Leave out the template, or use one of the templates of this release.\",\n },\n },\n MOSTRA_ARTIFACT_VERSION_NOT_FOUND: {\n severity: \"error\",\n phase: \"host\",\n title: \"No such version\",\n hint: \"Name a version the artifact has (`artifact/get` lists them), or leave the version out for the latest.\",\n docs: {\n explanation:\n \"The request named a version number or version ID that this artifact never published in this home. Viewers only ever open published versions (D09), so there is nothing to show.\",\n fix: \"List the artifact's versions with `artifact/get` and pick one, or omit the version to open the latest. A link to `/a/<artifactId>/v/<number>` needs a number from that list.\",\n },\n },\n MOSTRA_ARTIFACT_VERSION_COLLECTED: {\n severity: \"error\",\n phase: \"host\",\n title: \"Version collected\",\n hint: \"Open the artifact's latest version, or publish this version's source again to restore its files.\",\n docs: {\n explanation:\n \"`mostra gc` removed this version's files because nothing referenced it (D140). Its ID and number stay in the ledger forever, so history and events still name it, but it can't be opened or linked.\",\n fix: \"Open a version that still exists (`artifact/get` marks collected ones), or publish the exact source of this version again: publish restores its files under the same ID and number.\",\n },\n },\n // gen:entries\n};\n"],"mappings":";;AAMA,MAAa,0BAA0B;CACrC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AAEF;;AAMA,MAAa,sBAA2D;CACtE,2BAA2B;EACzB,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,mCAAmC;EACjC,UAAU;EACV,OAAO;EACP,OAAO;EACP,MAAM;EACN,MAAM;GACJ,aACE;GACF,KAAK;EACP;CACF;CACA,0BAA0B;EACxB,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,yBAAyB;EACvB,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,kCAAkC;EAChC,UAAU;EACV,OAAO;EACP,OAAO;EACP,MAAM;EACN,MAAM;GACJ,aACE;GACF,KAAK;EACP;CACF;CACA,mCAAmC;EACjC,UAAU;EACV,OAAO;EACP,OAAO;EACP,MAAM;EACN,MAAM;GACJ,aACE;GACF,KAAK;EACP;CACF;CACA,mCAAmC;EACjC,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/build.d.ts
3
+ /** The codes of the BUILD area, in the order they were added. */
4
+ export declare const buildDiagnosticCodes: readonly ["MOSTRA_BUILD_FAILED", "MOSTRA_BUILD_UNRESOLVED", "MOSTRA_BUILD_CRASHED", "MOSTRA_BUILD_TIMEOUT"];
5
+ /** The codes of the BUILD area. */
6
+ export type BuildDiagnosticCode = (typeof buildDiagnosticCodes)[number];
7
+ //#endregion
8
+ //# sourceMappingURL=build.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"build.d.ts","names":[],"sources":["../../../src/diagnostics/codes/build.ts"],"mappings":";;;qBAMa;;YASD,8BAA8B"}
@@ -0,0 +1,55 @@
1
+ //#region src/diagnostics/codes/build.ts
2
+ /** The codes of the BUILD area, in the order they were added. */
3
+ const buildDiagnosticCodes = [
4
+ "MOSTRA_BUILD_FAILED",
5
+ "MOSTRA_BUILD_UNRESOLVED",
6
+ "MOSTRA_BUILD_CRASHED",
7
+ "MOSTRA_BUILD_TIMEOUT"
8
+ ];
9
+ /** The BUILD area's catalog entries. */
10
+ const buildDiagnostics = {
11
+ MOSTRA_BUILD_FAILED: {
12
+ severity: "error",
13
+ phase: "compile",
14
+ title: "Build failed",
15
+ hint: "Fix the error at the reported location, then publish again.",
16
+ docs: {
17
+ explanation: "The builder couldn't bundle the artifact: a syntax error, an invalid JSX or MDX construct, a CSS error or another bundler error. The message carries the bundler's own explanation, and the location points at the file, line and column when the bundler reports one. Nothing was published.",
18
+ fix: "Open the reported file at the reported line and fix the code there. For MDX, check that JSX in the document is closed and that `{` and `<` in prose are escaped. Run `mostra verify` to see the same error with the type checker's findings."
19
+ }
20
+ },
21
+ MOSTRA_BUILD_UNRESOLVED: {
22
+ severity: "error",
23
+ phase: "compile",
24
+ title: "Import can't be resolved",
25
+ hint: "Correct the import path, or import the package from the warm set or add it with `mostra add`.",
26
+ docs: {
27
+ explanation: "An import in the artifact names a file or package the builder can't find. Relative imports resolve inside the artifact's own files, `@/...` resolves from the artifact's root, and package imports resolve from Mostra's warm set and the artifact's installed packages. The message names the import and the file that contains it.",
28
+ fix: "For a file, check the path and its extension against the artifact's files. For a package, check its name; packages outside the warm set install with `mostra add <package>`."
29
+ }
30
+ },
31
+ MOSTRA_BUILD_CRASHED: {
32
+ severity: "error",
33
+ phase: "compile",
34
+ title: "Builder crashed",
35
+ hint: "Publish again; if it crashes again, report the builder's last output from the message.",
36
+ docs: {
37
+ explanation: "The builder child process exited before it finished, for example after running out of memory or on a signal. The supervisor and everything else in the instance keep working, and nothing was published. The message carries the builder's last lines of error output.",
38
+ fix: "Run the publish again, which starts a fresh builder. A crash that repeats points at the artifact's size or at a defect in Mostra: very large inline data is better kept in `public/` or loaded through a live source."
39
+ }
40
+ },
41
+ MOSTRA_BUILD_TIMEOUT: {
42
+ severity: "error",
43
+ phase: "compile",
44
+ title: "Build timed out",
45
+ hint: "Make the build smaller, for example by moving large data into `public/`, then publish again.",
46
+ docs: {
47
+ explanation: "The build took longer than its limit (180 seconds) and was stopped. Nothing was published.",
48
+ fix: "Move large data files that are imported into code into `public/` and fetch them at run time, split very large modules, and remove unused imports of heavy libraries. Then publish again."
49
+ }
50
+ }
51
+ };
52
+ //#endregion
53
+ export { buildDiagnosticCodes, buildDiagnostics };
54
+
55
+ //# sourceMappingURL=build.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"build.js","names":[],"sources":["../../../src/diagnostics/codes/build.ts"],"sourcesContent":["/**\n * Diagnostic codes of the BUILD area.\n */\nimport type { AreaCatalog } from \"../spec.ts\";\n\n/** The codes of the BUILD area, in the order they were added. */\nexport const buildDiagnosticCodes = [\n \"MOSTRA_BUILD_FAILED\",\n \"MOSTRA_BUILD_UNRESOLVED\",\n \"MOSTRA_BUILD_CRASHED\",\n \"MOSTRA_BUILD_TIMEOUT\",\n // gen:codes\n] as const;\n\n/** The codes of the BUILD area. */\nexport type BuildDiagnosticCode = (typeof buildDiagnosticCodes)[number];\n\n/** The BUILD area's catalog entries. */\nexport const buildDiagnostics: AreaCatalog<BuildDiagnosticCode> = {\n MOSTRA_BUILD_FAILED: {\n severity: \"error\",\n phase: \"compile\",\n title: \"Build failed\",\n hint: \"Fix the error at the reported location, then publish again.\",\n docs: {\n explanation:\n \"The builder couldn't bundle the artifact: a syntax error, an invalid JSX or MDX construct, a CSS error or another bundler error. The message carries the bundler's own explanation, and the location points at the file, line and column when the bundler reports one. Nothing was published.\",\n fix: \"Open the reported file at the reported line and fix the code there. For MDX, check that JSX in the document is closed and that `{` and `<` in prose are escaped. Run `mostra verify` to see the same error with the type checker's findings.\",\n },\n },\n MOSTRA_BUILD_UNRESOLVED: {\n severity: \"error\",\n phase: \"compile\",\n title: \"Import can't be resolved\",\n hint: \"Correct the import path, or import the package from the warm set or add it with `mostra add`.\",\n docs: {\n explanation:\n \"An import in the artifact names a file or package the builder can't find. Relative imports resolve inside the artifact's own files, `@/...` resolves from the artifact's root, and package imports resolve from Mostra's warm set and the artifact's installed packages. The message names the import and the file that contains it.\",\n fix: \"For a file, check the path and its extension against the artifact's files. For a package, check its name; packages outside the warm set install with `mostra add <package>`.\",\n },\n },\n MOSTRA_BUILD_CRASHED: {\n severity: \"error\",\n phase: \"compile\",\n title: \"Builder crashed\",\n hint: \"Publish again; if it crashes again, report the builder's last output from the message.\",\n docs: {\n explanation:\n \"The builder child process exited before it finished, for example after running out of memory or on a signal. The supervisor and everything else in the instance keep working, and nothing was published. The message carries the builder's last lines of error output.\",\n fix: \"Run the publish again, which starts a fresh builder. A crash that repeats points at the artifact's size or at a defect in Mostra: very large inline data is better kept in `public/` or loaded through a live source.\",\n },\n },\n MOSTRA_BUILD_TIMEOUT: {\n severity: \"error\",\n phase: \"compile\",\n title: \"Build timed out\",\n hint: \"Make the build smaller, for example by moving large data into `public/`, then publish again.\",\n docs: {\n explanation:\n \"The build took longer than its limit (180 seconds) and was stopped. Nothing was published.\",\n fix: \"Move large data files that are imported into code into `public/` and fetch them at run time, split very large modules, and remove unused imports of heavy libraries. Then publish again.\",\n },\n },\n // gen:entries\n};\n"],"mappings":";;AAMA,MAAa,uBAAuB;CAClC;CACA;CACA;CACA;AAEF;;AAMA,MAAa,mBAAqD;CAChE,qBAAqB;EACnB,UAAU;EACV,OAAO;EACP,OAAO;EACP,MAAM;EACN,MAAM;GACJ,aACE;GACF,KAAK;EACP;CACF;CACA,yBAAyB;EACvB,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,sBAAsB;EACpB,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/cli.d.ts
3
+ /** The codes of the CLI area, in the order they were added. */
4
+ export declare const cliDiagnosticCodes: readonly ["MOSTRA_CLI_USAGE", "MOSTRA_CLI_UNKNOWN_COMMAND", "MOSTRA_CLI_CONFIG_UNWRITABLE"];
5
+ /** The codes of the CLI area. */
6
+ export type CliDiagnosticCode = (typeof cliDiagnosticCodes)[number];
7
+ //#endregion
8
+ //# sourceMappingURL=cli.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli.d.ts","names":[],"sources":["../../../src/diagnostics/codes/cli.ts"],"mappings":";;;qBAMa;;YAQD,4BAA4B"}
@@ -0,0 +1,44 @@
1
+ //#region src/diagnostics/codes/cli.ts
2
+ /** The codes of the CLI area, in the order they were added. */
3
+ const cliDiagnosticCodes = [
4
+ "MOSTRA_CLI_USAGE",
5
+ "MOSTRA_CLI_UNKNOWN_COMMAND",
6
+ "MOSTRA_CLI_CONFIG_UNWRITABLE"
7
+ ];
8
+ /** The CLI area's catalog entries. */
9
+ const cliDiagnostics = {
10
+ MOSTRA_CLI_USAGE: {
11
+ severity: "error",
12
+ phase: "host",
13
+ title: "Command used wrongly",
14
+ hint: "Run `mostra <command> --help` for the command's arguments and flags, then run it again.",
15
+ docs: {
16
+ explanation: "The command line didn't fit the command's definition: a missing or extra argument, an unknown flag, a flag without its value, or a value of the wrong form (a duration, a number, JSON). Nothing ran. In `--json` mode the error is the envelope's `error`, and the exit code is 2.",
17
+ fix: "Read `mostra <command> --help` (or `--help --json` for the machine-readable definition) and correct the arguments."
18
+ }
19
+ },
20
+ MOSTRA_CLI_UNKNOWN_COMMAND: {
21
+ severity: "error",
22
+ phase: "host",
23
+ title: "Unknown command",
24
+ hint: "Pick one of the commands this message lists; `mostra --help` describes each.",
25
+ docs: {
26
+ explanation: "The first word after `mostra` isn't a command this CLI has. The message lists the commands that exist. Commands that later releases add (sharing, export, plugins, terminals) appear only once they exist, never as placeholders.",
27
+ fix: "Run one of the listed commands. `mostra --help` lists every command with a one-line summary."
28
+ }
29
+ },
30
+ MOSTRA_CLI_CONFIG_UNWRITABLE: {
31
+ severity: "error",
32
+ phase: "platform",
33
+ title: "The CLI's config directory can't be written",
34
+ hint: "Make the directory the message names yours and writable (or point MOSTRA_CONFIG_DIR at one that is), then run the command again; DO_NOT_TRACK=1 turns telemetry off without writing anything.",
35
+ docs: {
36
+ explanation: "`mostra telemetry on` and `off` record the choice in the CLI's config directory (`MOSTRA_CONFIG_DIR`, else `${XDG_CONFIG_HOME:-~/.config}/mostra`). The directory or its `telemetry.json` can't be written (another user owns it, the disk is full, it's read-only), so the choice wasn't recorded and nothing changed. Telemetry never stops another command for this: a store that can't be written means nothing is sent.",
37
+ fix: "Fix the directory's owner or mode, or set `MOSTRA_CONFIG_DIR` to a directory you own, and run the command again. `DO_NOT_TRACK=1` or `MOSTRA_TELEMETRY=0` in your environment turn telemetry off without a file."
38
+ }
39
+ }
40
+ };
41
+ //#endregion
42
+ export { cliDiagnosticCodes, cliDiagnostics };
43
+
44
+ //# sourceMappingURL=cli.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli.js","names":[],"sources":["../../../src/diagnostics/codes/cli.ts"],"sourcesContent":["/**\n * Diagnostic codes of the CLI area.\n */\nimport type { AreaCatalog } from \"../spec.ts\";\n\n/** The codes of the CLI area, in the order they were added. */\nexport const cliDiagnosticCodes = [\n \"MOSTRA_CLI_USAGE\",\n \"MOSTRA_CLI_UNKNOWN_COMMAND\",\n \"MOSTRA_CLI_CONFIG_UNWRITABLE\",\n // gen:codes\n] as const;\n\n/** The codes of the CLI area. */\nexport type CliDiagnosticCode = (typeof cliDiagnosticCodes)[number];\n\n/** The CLI area's catalog entries. */\nexport const cliDiagnostics: AreaCatalog<CliDiagnosticCode> = {\n MOSTRA_CLI_USAGE: {\n severity: \"error\",\n phase: \"host\",\n title: \"Command used wrongly\",\n hint: \"Run `mostra <command> --help` for the command's arguments and flags, then run it again.\",\n docs: {\n explanation:\n \"The command line didn't fit the command's definition: a missing or extra argument, an unknown flag, a flag without its value, or a value of the wrong form (a duration, a number, JSON). Nothing ran. In `--json` mode the error is the envelope's `error`, and the exit code is 2.\",\n fix: \"Read `mostra <command> --help` (or `--help --json` for the machine-readable definition) and correct the arguments.\",\n },\n },\n MOSTRA_CLI_UNKNOWN_COMMAND: {\n severity: \"error\",\n phase: \"host\",\n title: \"Unknown command\",\n hint: \"Pick one of the commands this message lists; `mostra --help` describes each.\",\n docs: {\n explanation:\n \"The first word after `mostra` isn't a command this CLI has. The message lists the commands that exist. Commands that later releases add (sharing, export, plugins, terminals) appear only once they exist, never as placeholders.\",\n fix: \"Run one of the listed commands. `mostra --help` lists every command with a one-line summary.\",\n },\n },\n MOSTRA_CLI_CONFIG_UNWRITABLE: {\n severity: \"error\",\n phase: \"platform\",\n title: \"The CLI's config directory can't be written\",\n hint: \"Make the directory the message names yours and writable (or point MOSTRA_CONFIG_DIR at one that is), then run the command again; DO_NOT_TRACK=1 turns telemetry off without writing anything.\",\n docs: {\n explanation:\n \"`mostra telemetry on` and `off` record the choice in the CLI's config directory (`MOSTRA_CONFIG_DIR`, else `${XDG_CONFIG_HOME:-~/.config}/mostra`). The directory or its `telemetry.json` can't be written (another user owns it, the disk is full, it's read-only), so the choice wasn't recorded and nothing changed. Telemetry never stops another command for this: a store that can't be written means nothing is sent.\",\n fix: \"Fix the directory's owner or mode, or set `MOSTRA_CONFIG_DIR` to a directory you own, and run the command again. `DO_NOT_TRACK=1` or `MOSTRA_TELEMETRY=0` in your environment turn telemetry off without a file.\",\n },\n },\n // gen:entries\n};\n"],"mappings":";;AAMA,MAAa,qBAAqB;CAChC;CACA;CACA;AAEF;;AAMA,MAAa,iBAAiD;CAC5D,kBAAkB;EAChB,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;AAEF"}
@@ -0,0 +1,8 @@
1
+ import "../spec.js";
2
+ //#region src/diagnostics/codes/console.d.ts
3
+ /** The codes of the CONSOLE area, in the order they were added. */
4
+ export declare const consoleDiagnosticCodes: readonly ["MOSTRA_CONSOLE_ERROR", "MOSTRA_CONSOLE_WARNING"];
5
+ /** The codes of the CONSOLE area. */
6
+ export type ConsoleDiagnosticCode = (typeof consoleDiagnosticCodes)[number];
7
+ //#endregion
8
+ //# sourceMappingURL=console.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"console.d.ts","names":[],"sources":["../../../src/diagnostics/codes/console.ts"],"mappings":";;;qBAMa;;YAOD,gCAAgC"}