@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,30 @@
1
+ //#region src/diagnostics/codes/console.ts
2
+ /** The codes of the CONSOLE area, in the order they were added. */
3
+ const consoleDiagnosticCodes = ["MOSTRA_CONSOLE_ERROR", "MOSTRA_CONSOLE_WARNING"];
4
+ /** The CONSOLE area's catalog entries. */
5
+ const consoleDiagnostics = {
6
+ MOSTRA_CONSOLE_ERROR: {
7
+ severity: "error",
8
+ phase: "console",
9
+ title: "Error logged to the console",
10
+ hint: "Fix what the logged error describes; React logs errors its boundaries catch here too.",
11
+ docs: {
12
+ explanation: "The page logged an error with `console.error` while verify rendered it or used its controls. Errors caught by React error boundaries, the root's included, are logged this way. A viewer's page would log the same.",
13
+ fix: "Read the message and fix its cause in the artifact's code. Errors logged by a library usually name what it was given."
14
+ }
15
+ },
16
+ MOSTRA_CONSOLE_WARNING: {
17
+ severity: "hint",
18
+ phase: "console",
19
+ title: "Warning logged to the console",
20
+ hint: "Read the warning; nothing is broken by it.",
21
+ docs: {
22
+ explanation: "The page logged a warning with `console.warn`. Warnings are often a library's advice, so they are hints.",
23
+ fix: "Nothing is required."
24
+ }
25
+ }
26
+ };
27
+ //#endregion
28
+ export { consoleDiagnosticCodes, consoleDiagnostics };
29
+
30
+ //# sourceMappingURL=console.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"console.js","names":[],"sources":["../../../src/diagnostics/codes/console.ts"],"sourcesContent":["/**\n * Diagnostic codes of the CONSOLE area.\n */\nimport type { AreaCatalog } from \"../spec.ts\";\n\n/** The codes of the CONSOLE area, in the order they were added. */\nexport const consoleDiagnosticCodes = [\n \"MOSTRA_CONSOLE_ERROR\",\n \"MOSTRA_CONSOLE_WARNING\",\n // gen:codes\n] as const;\n\n/** The codes of the CONSOLE area. */\nexport type ConsoleDiagnosticCode = (typeof consoleDiagnosticCodes)[number];\n\n/** The CONSOLE area's catalog entries. */\nexport const consoleDiagnostics: AreaCatalog<ConsoleDiagnosticCode> = {\n MOSTRA_CONSOLE_ERROR: {\n severity: \"error\",\n phase: \"console\",\n title: \"Error logged to the console\",\n hint: \"Fix what the logged error describes; React logs errors its boundaries catch here too.\",\n docs: {\n explanation:\n \"The page logged an error with `console.error` while verify rendered it or used its controls. Errors caught by React error boundaries, the root's included, are logged this way. A viewer's page would log the same.\",\n fix: \"Read the message and fix its cause in the artifact's code. Errors logged by a library usually name what it was given.\",\n },\n },\n MOSTRA_CONSOLE_WARNING: {\n severity: \"hint\",\n phase: \"console\",\n title: \"Warning logged to the console\",\n hint: \"Read the warning; nothing is broken by it.\",\n docs: {\n explanation:\n \"The page logged a warning with `console.warn`. Warnings are often a library's advice, so they are hints.\",\n fix: \"Nothing is required.\",\n },\n },\n // gen:entries\n};\n"],"mappings":";;AAMA,MAAa,yBAAyB,CACpC,wBACA,wBAEF;;AAMA,MAAa,qBAAyD;CACpE,sBAAsB;EACpB,UAAU;EACV,OAAO;EACP,OAAO;EACP,MAAM;EACN,MAAM;GACJ,aACE;GACF,KAAK;EACP;CACF;CACA,wBAAwB;EACtB,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/dep.d.ts
3
+ /** The codes of the DEP area, in the order they were added. */
4
+ export declare const depDiagnosticCodes: readonly ["MOSTRA_DEP_MISSING", "MOSTRA_DEP_NOT_FOUND", "MOSTRA_DEP_OFFLINE", "MOSTRA_DEP_TIMEOUT", "MOSTRA_DEP_INSTALL_FAILED", "MOSTRA_DEP_WARM_CONFLICT", "MOSTRA_DEP_SPEC_INVALID"];
5
+ /** The codes of the DEP area. */
6
+ export type DepDiagnosticCode = (typeof depDiagnosticCodes)[number];
7
+ //#endregion
8
+ //# sourceMappingURL=dep.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dep.d.ts","names":[],"sources":["../../../src/diagnostics/codes/dep.ts"],"mappings":";;;qBAMa;;YAYD,4BAA4B"}
@@ -0,0 +1,88 @@
1
+ //#region src/diagnostics/codes/dep.ts
2
+ /** The codes of the DEP area, in the order they were added. */
3
+ const depDiagnosticCodes = [
4
+ "MOSTRA_DEP_MISSING",
5
+ "MOSTRA_DEP_NOT_FOUND",
6
+ "MOSTRA_DEP_OFFLINE",
7
+ "MOSTRA_DEP_TIMEOUT",
8
+ "MOSTRA_DEP_INSTALL_FAILED",
9
+ "MOSTRA_DEP_WARM_CONFLICT",
10
+ "MOSTRA_DEP_SPEC_INVALID"
11
+ ];
12
+ /** The DEP area's catalog entries. */
13
+ const depDiagnostics = {
14
+ MOSTRA_DEP_MISSING: {
15
+ severity: "error",
16
+ phase: "compile",
17
+ title: "Package not added",
18
+ hint: "Run the `mostra add` command in this diagnostic's fix, then publish again.",
19
+ docs: {
20
+ explanation: "The artifact imports a package that is neither in Mostra's warm set nor in the artifact's lockfile, and the host has set the dependency policy to `explicit`. Under that policy a package enters an artifact's lockfile only when it is added on purpose, so Mostra installs nothing on its own. The location points at the first import of the package, and the fix carries the exact command that adds every missing package.",
21
+ fix: "Run the command from the fix (`mostra add <package…> --artifact <path>`, or the host protocol method `deps/add`), then publish again. To use a package from the warm set instead, change the import."
22
+ }
23
+ },
24
+ MOSTRA_DEP_NOT_FOUND: {
25
+ severity: "error",
26
+ phase: "compile",
27
+ title: "Package not found",
28
+ hint: "Check the package name and version against the npm registry, then fix the import or the spec.",
29
+ docs: {
30
+ explanation: "The registry has no package by that name, or no version that matches the requested one. A spec without an exact version only matches releases at least a day old, so a package whose every release is newer than that isn't found either. The message names the package and what the registry answered.",
31
+ fix: "Correct the package name in the import or in the `mostra add` spec. To use a release less than a day old, add it at its exact version: `mostra add <package>@<version>`."
32
+ }
33
+ },
34
+ MOSTRA_DEP_OFFLINE: {
35
+ severity: "error",
36
+ phase: "compile",
37
+ title: "Package unavailable offline",
38
+ hint: "Connect to the network and publish again, or import a package the home already holds.",
39
+ docs: {
40
+ explanation: "Mostra is offline (`MOSTRA_OFFLINE` is set, no network interface is up, or the registry can't be reached), and the artifact needs a package that the home's package store doesn't hold yet. Everything the store holds keeps working offline, including rebuilds of published versions. The message names the missing package.",
41
+ fix: "Publish again once the registry is reachable; the package then stays in the store for later offline use. Otherwise remove the import, or use a package from the warm set."
42
+ }
43
+ },
44
+ MOSTRA_DEP_TIMEOUT: {
45
+ severity: "error",
46
+ phase: "compile",
47
+ title: "Package install timed out",
48
+ hint: "Check the network and the registry, then publish again.",
49
+ docs: {
50
+ explanation: "Installing the artifact's packages took longer than 300 seconds and was stopped. A slow registry, a stalled download or a lifecycle script that never ends are the usual causes. Nothing was published, and packages already in the store stay there.",
51
+ fix: "Publish again; packages that finished downloading aren't fetched twice. When a package's install script hangs, use another version of the package or another package."
52
+ }
53
+ },
54
+ MOSTRA_DEP_INSTALL_FAILED: {
55
+ severity: "error",
56
+ phase: "compile",
57
+ title: "Package install failed",
58
+ hint: "Read the installer's output in the message, then fix the package spec or choose another version.",
59
+ docs: {
60
+ explanation: "The package installer failed for a reason other than a missing package or the network: most often a package's lifecycle script (`preinstall`, `install`, `postinstall`) exited with an error, or a downloaded package didn't match its integrity hash. Lifecycle scripts run in an install child in the artifact's directory with the artifact's environment. The message carries the end of the installer's output.",
61
+ fix: "Fix what the output names. For a failing install script, check what it needs (a compiler, a system library) or use another version of the package."
62
+ }
63
+ },
64
+ MOSTRA_DEP_WARM_CONFLICT: {
65
+ severity: "error",
66
+ phase: "compile",
67
+ title: "Warm package version requested",
68
+ hint: "Add the package without a version, or with one the warm set's version satisfies.",
69
+ docs: {
70
+ explanation: "The package is part of Mostra's warm set, which every artifact resolves at one fixed version so that React and the other shared packages exist exactly once. The requested version doesn't match the warm one, and an artifact can't replace a warm package.",
71
+ fix: "Drop the version from the spec (`mostra add react`), or request a range the warm version satisfies. The message names the warm version."
72
+ }
73
+ },
74
+ MOSTRA_DEP_SPEC_INVALID: {
75
+ severity: "error",
76
+ phase: "host",
77
+ title: "Invalid package spec",
78
+ hint: "Write the spec as `name`, `name@version`, `name@range` or `name@tag`.",
79
+ docs: {
80
+ explanation: "A package spec given to `mostra add` (`deps/add`) isn't an npm registry spec. Mostra adds packages from the registry by name, optionally with a version, a semver range or a dist-tag; scoped names such as `@scope/name@1.2.3` work too. Git URLs, local paths and tarball URLs aren't registry specs.",
81
+ fix: "Correct the spec, for example `mostra add three@0.186.1` or `mostra add @xyflow/react`."
82
+ }
83
+ }
84
+ };
85
+ //#endregion
86
+ export { depDiagnosticCodes, depDiagnostics };
87
+
88
+ //# sourceMappingURL=dep.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dep.js","names":[],"sources":["../../../src/diagnostics/codes/dep.ts"],"sourcesContent":["/**\n * Diagnostic codes of the DEP area: the packages an artifact imports (D20, D43, D95).\n */\nimport type { AreaCatalog } from \"../spec.ts\";\n\n/** The codes of the DEP area, in the order they were added. */\nexport const depDiagnosticCodes = [\n \"MOSTRA_DEP_MISSING\",\n \"MOSTRA_DEP_NOT_FOUND\",\n \"MOSTRA_DEP_OFFLINE\",\n \"MOSTRA_DEP_TIMEOUT\",\n \"MOSTRA_DEP_INSTALL_FAILED\",\n \"MOSTRA_DEP_WARM_CONFLICT\",\n \"MOSTRA_DEP_SPEC_INVALID\",\n // gen:codes\n] as const;\n\n/** The codes of the DEP area. */\nexport type DepDiagnosticCode = (typeof depDiagnosticCodes)[number];\n\n/** The DEP area's catalog entries. */\nexport const depDiagnostics: AreaCatalog<DepDiagnosticCode> = {\n MOSTRA_DEP_MISSING: {\n severity: \"error\",\n phase: \"compile\",\n title: \"Package not added\",\n hint: \"Run the `mostra add` command in this diagnostic's fix, then publish again.\",\n docs: {\n explanation:\n \"The artifact imports a package that is neither in Mostra's warm set nor in the artifact's lockfile, and the host has set the dependency policy to `explicit`. Under that policy a package enters an artifact's lockfile only when it is added on purpose, so Mostra installs nothing on its own. The location points at the first import of the package, and the fix carries the exact command that adds every missing package.\",\n fix: \"Run the command from the fix (`mostra add <package…> --artifact <path>`, or the host protocol method `deps/add`), then publish again. To use a package from the warm set instead, change the import.\",\n },\n },\n MOSTRA_DEP_NOT_FOUND: {\n severity: \"error\",\n phase: \"compile\",\n title: \"Package not found\",\n hint: \"Check the package name and version against the npm registry, then fix the import or the spec.\",\n docs: {\n explanation:\n \"The registry has no package by that name, or no version that matches the requested one. A spec without an exact version only matches releases at least a day old, so a package whose every release is newer than that isn't found either. The message names the package and what the registry answered.\",\n fix: \"Correct the package name in the import or in the `mostra add` spec. To use a release less than a day old, add it at its exact version: `mostra add <package>@<version>`.\",\n },\n },\n MOSTRA_DEP_OFFLINE: {\n severity: \"error\",\n phase: \"compile\",\n title: \"Package unavailable offline\",\n hint: \"Connect to the network and publish again, or import a package the home already holds.\",\n docs: {\n explanation:\n \"Mostra is offline (`MOSTRA_OFFLINE` is set, no network interface is up, or the registry can't be reached), and the artifact needs a package that the home's package store doesn't hold yet. Everything the store holds keeps working offline, including rebuilds of published versions. The message names the missing package.\",\n fix: \"Publish again once the registry is reachable; the package then stays in the store for later offline use. Otherwise remove the import, or use a package from the warm set.\",\n },\n },\n MOSTRA_DEP_TIMEOUT: {\n severity: \"error\",\n phase: \"compile\",\n title: \"Package install timed out\",\n hint: \"Check the network and the registry, then publish again.\",\n docs: {\n explanation:\n \"Installing the artifact's packages took longer than 300 seconds and was stopped. A slow registry, a stalled download or a lifecycle script that never ends are the usual causes. Nothing was published, and packages already in the store stay there.\",\n fix: \"Publish again; packages that finished downloading aren't fetched twice. When a package's install script hangs, use another version of the package or another package.\",\n },\n },\n MOSTRA_DEP_INSTALL_FAILED: {\n severity: \"error\",\n phase: \"compile\",\n title: \"Package install failed\",\n hint: \"Read the installer's output in the message, then fix the package spec or choose another version.\",\n docs: {\n explanation:\n \"The package installer failed for a reason other than a missing package or the network: most often a package's lifecycle script (`preinstall`, `install`, `postinstall`) exited with an error, or a downloaded package didn't match its integrity hash. Lifecycle scripts run in an install child in the artifact's directory with the artifact's environment. The message carries the end of the installer's output.\",\n fix: \"Fix what the output names. For a failing install script, check what it needs (a compiler, a system library) or use another version of the package.\",\n },\n },\n MOSTRA_DEP_WARM_CONFLICT: {\n severity: \"error\",\n phase: \"compile\",\n title: \"Warm package version requested\",\n hint: \"Add the package without a version, or with one the warm set's version satisfies.\",\n docs: {\n explanation:\n \"The package is part of Mostra's warm set, which every artifact resolves at one fixed version so that React and the other shared packages exist exactly once. The requested version doesn't match the warm one, and an artifact can't replace a warm package.\",\n fix: \"Drop the version from the spec (`mostra add react`), or request a range the warm version satisfies. The message names the warm version.\",\n },\n },\n MOSTRA_DEP_SPEC_INVALID: {\n severity: \"error\",\n phase: \"host\",\n title: \"Invalid package spec\",\n hint: \"Write the spec as `name`, `name@version`, `name@range` or `name@tag`.\",\n docs: {\n explanation:\n \"A package spec given to `mostra add` (`deps/add`) isn't an npm registry spec. Mostra adds packages from the registry by name, optionally with a version, a semver range or a dist-tag; scoped names such as `@scope/name@1.2.3` work too. Git URLs, local paths and tarball URLs aren't registry specs.\",\n fix: \"Correct the spec, for example `mostra add three@0.186.1` or `mostra add @xyflow/react`.\",\n },\n },\n // gen:entries\n};\n"],"mappings":";;AAMA,MAAa,qBAAqB;CAChC;CACA;CACA;CACA;CACA;CACA;CACA;AAEF;;AAMA,MAAa,iBAAiD;CAC5D,oBAAoB;EAClB,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,oBAAoB;EAClB,UAAU;EACV,OAAO;EACP,OAAO;EACP,MAAM;EACN,MAAM;GACJ,aACE;GACF,KAAK;EACP;CACF;CACA,oBAAoB;EAClB,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,0BAA0B;EACxB,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;AAEF"}
@@ -0,0 +1,8 @@
1
+ import "../spec.js";
2
+ //#region src/diagnostics/codes/env.d.ts
3
+ /** The codes of the ENV area, in the order they were added. */
4
+ export declare const envDiagnosticCodes: readonly ["MOSTRA_ENV_WARM_MISSING", "MOSTRA_ENV_PORT_TAKEN", "MOSTRA_ENV_BIND_FAILED", "MOSTRA_ENV_SHELL_MISSING", "MOSTRA_ENV_SERVICE_FAILED", "MOSTRA_ENV_BROWSER_MISSING", "MOSTRA_ENV_RUNTIME_MISSING", "MOSTRA_ENV_BUNDLE_INVALID", "MOSTRA_ENV_BUNDLE_DOWNLOAD_FAILED", "MOSTRA_ENV_BUNDLE_UNAVAILABLE", "MOSTRA_ENV_NODE_UNSUPPORTED"];
5
+ /** The codes of the ENV area. */
6
+ export type EnvDiagnosticCode = (typeof envDiagnosticCodes)[number];
7
+ //#endregion
8
+ //# sourceMappingURL=env.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"env.d.ts","names":[],"sources":["../../../src/diagnostics/codes/env.ts"],"mappings":";;;qBAMa;;YAgBD,4BAA4B"}
@@ -0,0 +1,132 @@
1
+ //#region src/diagnostics/codes/env.ts
2
+ /** The codes of the ENV area, in the order they were added. */
3
+ const envDiagnosticCodes = [
4
+ "MOSTRA_ENV_WARM_MISSING",
5
+ "MOSTRA_ENV_PORT_TAKEN",
6
+ "MOSTRA_ENV_BIND_FAILED",
7
+ "MOSTRA_ENV_SHELL_MISSING",
8
+ "MOSTRA_ENV_SERVICE_FAILED",
9
+ "MOSTRA_ENV_BROWSER_MISSING",
10
+ "MOSTRA_ENV_RUNTIME_MISSING",
11
+ "MOSTRA_ENV_BUNDLE_INVALID",
12
+ "MOSTRA_ENV_BUNDLE_DOWNLOAD_FAILED",
13
+ "MOSTRA_ENV_BUNDLE_UNAVAILABLE",
14
+ "MOSTRA_ENV_NODE_UNSUPPORTED"
15
+ ];
16
+ /** The ENV area's catalog entries. */
17
+ const envDiagnostics = {
18
+ MOSTRA_ENV_WARM_MISSING: {
19
+ severity: "error",
20
+ phase: "host",
21
+ title: "Warm package set missing",
22
+ hint: "Reinstall the Mostra runtime, or set `MOSTRA_WARM_DIR` to its warm package set.",
23
+ docs: {
24
+ explanation: "Builds resolve React, Tailwind and Mostra's own client packages from the warm package set that ships with the runtime. The runtime couldn't find it, which means the runtime installation is incomplete.",
25
+ fix: "Reinstall Mostra so the runtime bundle is complete. A custom layout can point the runtime at the warm set's directory with `MOSTRA_WARM_DIR`."
26
+ }
27
+ },
28
+ MOSTRA_ENV_PORT_TAKEN: {
29
+ severity: "warning",
30
+ phase: "host",
31
+ title: "Leased port taken",
32
+ hint: "Open the artifact through a new link: `view/url` or `mostra open` mints one on the new port.",
33
+ docs: {
34
+ explanation: "The shell's port or an artifact's port is leased per home and reused across restarts, so links keep working (D62, D99). At start-up another program held the leased port, so Mostra leased a new one. Links that named the old port stop working; the shell's port changing affects every link of the home.",
35
+ fix: "Mint new links with `view/url` (the publish receipt of the next publish carries the new default link too). Stop the program that took the port if you want the old links back; `mostra doctor` names it where it can."
36
+ }
37
+ },
38
+ MOSTRA_ENV_BIND_FAILED: {
39
+ severity: "error",
40
+ phase: "host",
41
+ title: "Gateway can't bind",
42
+ hint: "Start Mostra with an address this machine has, or without `--bind` to use the loopback address.",
43
+ docs: {
44
+ explanation: "The gateway couldn't listen on the address it was given: `--bind` named an address no interface has, a wildcard bind came without `--url-host`, or the operating system refused the address. Mostra doesn't start rather than serve on an address nobody asked for.",
45
+ fix: "Omit `--bind` to serve on `127.0.0.1` only (the default). For a wider bind, pass an address of one of this machine's interfaces, and with `0.0.0.0` or `::` also `--url-host <name>`, the name viewers use to reach it."
46
+ }
47
+ },
48
+ MOSTRA_ENV_SHELL_MISSING: {
49
+ severity: "error",
50
+ phase: "host",
51
+ title: "Shell app missing",
52
+ hint: "Reinstall the Mostra runtime, or set `MOSTRA_SHELL_DIR` to its built shell.",
53
+ docs: {
54
+ explanation: "Viewers open artifacts inside the shell, Mostra's trusted page, which ships with the runtime as built files. The runtime couldn't find them, which means the runtime installation is incomplete. Artifact frames are still served.",
55
+ fix: "Reinstall Mostra so the runtime bundle is complete. A custom layout can point the runtime at the shell's built directory with `MOSTRA_SHELL_DIR`."
56
+ }
57
+ },
58
+ MOSTRA_ENV_SERVICE_FAILED: {
59
+ severity: "error",
60
+ phase: "host",
61
+ title: "Login service could not be installed",
62
+ hint: "Read the message, fix what it names, and run the install again.",
63
+ docs: {
64
+ explanation: "`mostra daemon install` couldn't register the home's daemon as a login service: writing the launchd agent or systemd user unit failed, or `launchctl` or `systemctl --user` refused to load it.",
65
+ fix: "Check the named file's directory permissions, and on Linux that a systemd user session is running (`systemctl --user status`). On a machine without one, start the daemon from your own login scripts with `mostra daemon start`."
66
+ }
67
+ },
68
+ MOSTRA_ENV_BROWSER_MISSING: {
69
+ severity: "error",
70
+ phase: "host",
71
+ title: "Browser for verify missing",
72
+ hint: "Run the runtime bundle's `bin/mostra-setup` (with network access) to fetch the browser verify uses, then verify again.",
73
+ docs: {
74
+ explanation: "Verify renders pages in the Chromium headless shell its Playwright release pins. The runtime bundle fetches that browser when it is set up and checks every file of it (D142). It wasn't there, so verify ran only the stages that need no browser (type check, build and the field-ID scan) and reported this error. Publishing needs `--force` until it is installed.",
75
+ fix: "Run `bin/mostra-setup` in the runtime bundle's directory (the message names it) with network access; it fetches and checks the pinned browser. Outside a bundle, in a development checkout, run `npx playwright-core install chromium-headless-shell`. Then verify again."
76
+ }
77
+ },
78
+ MOSTRA_ENV_RUNTIME_MISSING: {
79
+ severity: "error",
80
+ phase: "host",
81
+ title: "Runtime not found",
82
+ hint: "Reinstall Mostra, or set `MOSTRA_RUNTIME_BIN` to the runtime's `mostra-runtime` entry.",
83
+ docs: {
84
+ explanation: "The CLI starts and attaches to the home's instance through the runtime binary (`mostra-runtime`, D85). It looked, in order, for `MOSTRA_BUNDLE`, `MOSTRA_RUNTIME_BIN`, the runtime bundle it runs from, its release's pinned bundle and a development checkout's built runtime (D142), and found nothing it could run: here, `MOSTRA_RUNTIME_BIN` names a file that doesn't exist, or the runtime couldn't be started.",
85
+ fix: "Unset `MOSTRA_RUNTIME_BIN` or point it at a `mostra-runtime` entry (its `dist/bin.js`), or reinstall Mostra so the CLI and its runtime are complete."
86
+ }
87
+ },
88
+ MOSTRA_ENV_BUNDLE_INVALID: {
89
+ severity: "error",
90
+ phase: "platform",
91
+ title: "Runtime bundle failed verification",
92
+ hint: "Nothing was installed; install Mostra again, and if it fails the same way, report it with the message.",
93
+ docs: {
94
+ explanation: "Mostra checks every runtime bundle before it runs anything from it: the archive against the SHA-256 the installing package pins, then each extracted file against the bundle's own file list, and the verify browser against the bundle's browser pin. One of them differed, so the download was corrupted, changed on the way or replaced, and Mostra refused it. A bundle already installed that fails a later check (`mostra doctor --deep`) is refused the same way.",
95
+ fix: "Run the install again (`npm create mostra`, or the command that started it), which downloads a fresh copy. When a mirror is configured (`MOSTRA_BUNDLE_MIRROR`), check that it serves the release's files unchanged. Check a file you downloaded yourself against the release's `SHA256SUMS`, or with `gh attestation verify <file> --repo mostra-dev/mostra`."
96
+ }
97
+ },
98
+ MOSTRA_ENV_BUNDLE_DOWNLOAD_FAILED: {
99
+ severity: "error",
100
+ phase: "platform",
101
+ title: "Runtime bundle download failed",
102
+ hint: "Check the network or proxy (`HTTPS_PROXY`), then run the command again: a retry starts the download over.",
103
+ docs: {
104
+ explanation: "The runtime bundle for this release and platform isn't in the local cache yet, and fetching it failed: the network or a proxy refused it, the server answered with an error, the connection stalled for 60 seconds, or the disk ran out of space while it was written. Nothing partial is kept.",
105
+ fix: "Check the connection, and set `HTTPS_PROXY` (and `NO_PROXY`) when the network needs a proxy. Behind a firewall that blocks GitHub, host the release's files on a reachable server and set `MOSTRA_BUNDLE_MIRROR` to its base URL (a `file:` URL works for a local directory). Free space in the cache directory (`MOSTRA_CACHE_DIR`) if the message says the disk is full."
106
+ }
107
+ },
108
+ MOSTRA_ENV_BUNDLE_UNAVAILABLE: {
109
+ severity: "error",
110
+ phase: "platform",
111
+ title: "No runtime bundle available",
112
+ hint: "Run this once with network access, or point `MOSTRA_BUNDLE` at an extracted bundle.",
113
+ docs: {
114
+ explanation: "Mostra runs on its own runtime bundle, found in the local cache, beside the installed package or at `MOSTRA_BUNDLE`. None was there, and no download could start: Mostra is offline (`MOSTRA_OFFLINE`), this build of the package pins no bundle for this platform, or the platform has none.",
115
+ fix: "Run the command once with network access and without `MOSTRA_OFFLINE`, so the pinned bundle is fetched and cached; later runs work offline. On a machine without network access, extract the release's archive for the platform and set `MOSTRA_BUNDLE` to its directory. A development checkout uses its own built runtime instead."
116
+ }
117
+ },
118
+ MOSTRA_ENV_NODE_UNSUPPORTED: {
119
+ severity: "error",
120
+ phase: "platform",
121
+ title: "Node.js too old to start Mostra",
122
+ hint: "Run `mostra` with Node.js 22.19 or later, or run the runtime bundle's own `bin/mostra`, which needs no Node.js.",
123
+ docs: {
124
+ explanation: "A `mostra` (or `npm create mostra`) installed from npm starts on the machine's Node.js only long enough to find its runtime bundle, then every Mostra process runs on the bundle's own Node.js (RT-01, D142). That start needs Node.js 22.19 or later, and this one is older, so Mostra stopped before loading anything.",
125
+ fix: "Upgrade the machine's Node.js to 22.19 or later, or run Mostra without npm: download the runtime bundle for your platform from the GitHub release, check it against `SHA256SUMS`, extract it, run its `bin/mostra-setup` once, then use its `bin/mostra`."
126
+ }
127
+ }
128
+ };
129
+ //#endregion
130
+ export { envDiagnosticCodes, envDiagnostics };
131
+
132
+ //# sourceMappingURL=env.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"env.js","names":[],"sources":["../../../src/diagnostics/codes/env.ts"],"sourcesContent":["/**\n * Diagnostic codes of the ENV area.\n */\nimport type { AreaCatalog } from \"../spec.ts\";\n\n/** The codes of the ENV area, in the order they were added. */\nexport const envDiagnosticCodes = [\n \"MOSTRA_ENV_WARM_MISSING\",\n \"MOSTRA_ENV_PORT_TAKEN\",\n \"MOSTRA_ENV_BIND_FAILED\",\n \"MOSTRA_ENV_SHELL_MISSING\",\n \"MOSTRA_ENV_SERVICE_FAILED\",\n \"MOSTRA_ENV_BROWSER_MISSING\",\n \"MOSTRA_ENV_RUNTIME_MISSING\",\n \"MOSTRA_ENV_BUNDLE_INVALID\",\n \"MOSTRA_ENV_BUNDLE_DOWNLOAD_FAILED\",\n \"MOSTRA_ENV_BUNDLE_UNAVAILABLE\",\n \"MOSTRA_ENV_NODE_UNSUPPORTED\",\n // gen:codes\n] as const;\n\n/** The codes of the ENV area. */\nexport type EnvDiagnosticCode = (typeof envDiagnosticCodes)[number];\n\n/** The ENV area's catalog entries. */\nexport const envDiagnostics: AreaCatalog<EnvDiagnosticCode> = {\n MOSTRA_ENV_WARM_MISSING: {\n severity: \"error\",\n phase: \"host\",\n title: \"Warm package set missing\",\n hint: \"Reinstall the Mostra runtime, or set `MOSTRA_WARM_DIR` to its warm package set.\",\n docs: {\n explanation:\n \"Builds resolve React, Tailwind and Mostra's own client packages from the warm package set that ships with the runtime. The runtime couldn't find it, which means the runtime installation is incomplete.\",\n fix: \"Reinstall Mostra so the runtime bundle is complete. A custom layout can point the runtime at the warm set's directory with `MOSTRA_WARM_DIR`.\",\n },\n },\n MOSTRA_ENV_PORT_TAKEN: {\n severity: \"warning\",\n phase: \"host\",\n title: \"Leased port taken\",\n hint: \"Open the artifact through a new link: `view/url` or `mostra open` mints one on the new port.\",\n docs: {\n explanation:\n \"The shell's port or an artifact's port is leased per home and reused across restarts, so links keep working (D62, D99). At start-up another program held the leased port, so Mostra leased a new one. Links that named the old port stop working; the shell's port changing affects every link of the home.\",\n fix: \"Mint new links with `view/url` (the publish receipt of the next publish carries the new default link too). Stop the program that took the port if you want the old links back; `mostra doctor` names it where it can.\",\n },\n },\n MOSTRA_ENV_BIND_FAILED: {\n severity: \"error\",\n phase: \"host\",\n title: \"Gateway can't bind\",\n hint: \"Start Mostra with an address this machine has, or without `--bind` to use the loopback address.\",\n docs: {\n explanation:\n \"The gateway couldn't listen on the address it was given: `--bind` named an address no interface has, a wildcard bind came without `--url-host`, or the operating system refused the address. Mostra doesn't start rather than serve on an address nobody asked for.\",\n fix: \"Omit `--bind` to serve on `127.0.0.1` only (the default). For a wider bind, pass an address of one of this machine's interfaces, and with `0.0.0.0` or `::` also `--url-host <name>`, the name viewers use to reach it.\",\n },\n },\n MOSTRA_ENV_SHELL_MISSING: {\n severity: \"error\",\n phase: \"host\",\n title: \"Shell app missing\",\n hint: \"Reinstall the Mostra runtime, or set `MOSTRA_SHELL_DIR` to its built shell.\",\n docs: {\n explanation:\n \"Viewers open artifacts inside the shell, Mostra's trusted page, which ships with the runtime as built files. The runtime couldn't find them, which means the runtime installation is incomplete. Artifact frames are still served.\",\n fix: \"Reinstall Mostra so the runtime bundle is complete. A custom layout can point the runtime at the shell's built directory with `MOSTRA_SHELL_DIR`.\",\n },\n },\n MOSTRA_ENV_SERVICE_FAILED: {\n severity: \"error\",\n phase: \"host\",\n title: \"Login service could not be installed\",\n hint: \"Read the message, fix what it names, and run the install again.\",\n docs: {\n explanation:\n \"`mostra daemon install` couldn't register the home's daemon as a login service: writing the launchd agent or systemd user unit failed, or `launchctl` or `systemctl --user` refused to load it.\",\n fix: \"Check the named file's directory permissions, and on Linux that a systemd user session is running (`systemctl --user status`). On a machine without one, start the daemon from your own login scripts with `mostra daemon start`.\",\n },\n },\n MOSTRA_ENV_BROWSER_MISSING: {\n severity: \"error\",\n phase: \"host\",\n title: \"Browser for verify missing\",\n hint: \"Run the runtime bundle's `bin/mostra-setup` (with network access) to fetch the browser verify uses, then verify again.\",\n docs: {\n explanation:\n \"Verify renders pages in the Chromium headless shell its Playwright release pins. The runtime bundle fetches that browser when it is set up and checks every file of it (D142). It wasn't there, so verify ran only the stages that need no browser (type check, build and the field-ID scan) and reported this error. Publishing needs `--force` until it is installed.\",\n fix: \"Run `bin/mostra-setup` in the runtime bundle's directory (the message names it) with network access; it fetches and checks the pinned browser. Outside a bundle, in a development checkout, run `npx playwright-core install chromium-headless-shell`. Then verify again.\",\n },\n },\n MOSTRA_ENV_RUNTIME_MISSING: {\n severity: \"error\",\n phase: \"host\",\n title: \"Runtime not found\",\n hint: \"Reinstall Mostra, or set `MOSTRA_RUNTIME_BIN` to the runtime's `mostra-runtime` entry.\",\n docs: {\n explanation:\n \"The CLI starts and attaches to the home's instance through the runtime binary (`mostra-runtime`, D85). It looked, in order, for `MOSTRA_BUNDLE`, `MOSTRA_RUNTIME_BIN`, the runtime bundle it runs from, its release's pinned bundle and a development checkout's built runtime (D142), and found nothing it could run: here, `MOSTRA_RUNTIME_BIN` names a file that doesn't exist, or the runtime couldn't be started.\",\n fix: \"Unset `MOSTRA_RUNTIME_BIN` or point it at a `mostra-runtime` entry (its `dist/bin.js`), or reinstall Mostra so the CLI and its runtime are complete.\",\n },\n },\n MOSTRA_ENV_BUNDLE_INVALID: {\n severity: \"error\",\n phase: \"platform\",\n title: \"Runtime bundle failed verification\",\n hint: \"Nothing was installed; install Mostra again, and if it fails the same way, report it with the message.\",\n docs: {\n explanation:\n \"Mostra checks every runtime bundle before it runs anything from it: the archive against the SHA-256 the installing package pins, then each extracted file against the bundle's own file list, and the verify browser against the bundle's browser pin. One of them differed, so the download was corrupted, changed on the way or replaced, and Mostra refused it. A bundle already installed that fails a later check (`mostra doctor --deep`) is refused the same way.\",\n fix: \"Run the install again (`npm create mostra`, or the command that started it), which downloads a fresh copy. When a mirror is configured (`MOSTRA_BUNDLE_MIRROR`), check that it serves the release's files unchanged. Check a file you downloaded yourself against the release's `SHA256SUMS`, or with `gh attestation verify <file> --repo mostra-dev/mostra`.\",\n },\n },\n MOSTRA_ENV_BUNDLE_DOWNLOAD_FAILED: {\n severity: \"error\",\n phase: \"platform\",\n title: \"Runtime bundle download failed\",\n hint: \"Check the network or proxy (`HTTPS_PROXY`), then run the command again: a retry starts the download over.\",\n docs: {\n explanation:\n \"The runtime bundle for this release and platform isn't in the local cache yet, and fetching it failed: the network or a proxy refused it, the server answered with an error, the connection stalled for 60 seconds, or the disk ran out of space while it was written. Nothing partial is kept.\",\n fix: \"Check the connection, and set `HTTPS_PROXY` (and `NO_PROXY`) when the network needs a proxy. Behind a firewall that blocks GitHub, host the release's files on a reachable server and set `MOSTRA_BUNDLE_MIRROR` to its base URL (a `file:` URL works for a local directory). Free space in the cache directory (`MOSTRA_CACHE_DIR`) if the message says the disk is full.\",\n },\n },\n MOSTRA_ENV_BUNDLE_UNAVAILABLE: {\n severity: \"error\",\n phase: \"platform\",\n title: \"No runtime bundle available\",\n hint: \"Run this once with network access, or point `MOSTRA_BUNDLE` at an extracted bundle.\",\n docs: {\n explanation:\n \"Mostra runs on its own runtime bundle, found in the local cache, beside the installed package or at `MOSTRA_BUNDLE`. None was there, and no download could start: Mostra is offline (`MOSTRA_OFFLINE`), this build of the package pins no bundle for this platform, or the platform has none.\",\n fix: \"Run the command once with network access and without `MOSTRA_OFFLINE`, so the pinned bundle is fetched and cached; later runs work offline. On a machine without network access, extract the release's archive for the platform and set `MOSTRA_BUNDLE` to its directory. A development checkout uses its own built runtime instead.\",\n },\n },\n MOSTRA_ENV_NODE_UNSUPPORTED: {\n severity: \"error\",\n phase: \"platform\",\n title: \"Node.js too old to start Mostra\",\n hint: \"Run `mostra` with Node.js 22.19 or later, or run the runtime bundle's own `bin/mostra`, which needs no Node.js.\",\n docs: {\n explanation:\n \"A `mostra` (or `npm create mostra`) installed from npm starts on the machine's Node.js only long enough to find its runtime bundle, then every Mostra process runs on the bundle's own Node.js (RT-01, D142). That start needs Node.js 22.19 or later, and this one is older, so Mostra stopped before loading anything.\",\n fix: \"Upgrade the machine's Node.js to 22.19 or later, or run Mostra without npm: download the runtime bundle for your platform from the GitHub release, check it against `SHA256SUMS`, extract it, run its `bin/mostra-setup` once, then use its `bin/mostra`.\",\n },\n },\n // gen:entries\n};\n"],"mappings":";;AAMA,MAAa,qBAAqB;CAChC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AAEF;;AAMA,MAAa,iBAAiD;CAC5D,yBAAyB;EACvB,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,wBAAwB;EACtB,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,2BAA2B;EACzB,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,2BAA2B;EACzB,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,+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;AAEF"}
@@ -0,0 +1,8 @@
1
+ import "../spec.js";
2
+ //#region src/diagnostics/codes/field.d.ts
3
+ /** The codes of the FIELD area, in the order they were added. */
4
+ export declare const fieldDiagnosticCodes: readonly ["MOSTRA_FIELD_TOO_LARGE", "MOSTRA_FIELD_ID_INVALID", "MOSTRA_FIELD_MUTATION_ID_REUSED", "MOSTRA_FIELD_CONFLICT", "MOSTRA_FIELD_DUPLICATE_ID", "MOSTRA_FIELD_ID_UNSTABLE", "MOSTRA_FIELD_SHARED", "MOSTRA_FIELD_UNBOUND"];
5
+ /** The codes of the FIELD area. */
6
+ export type FieldDiagnosticCode = (typeof fieldDiagnosticCodes)[number];
7
+ //#endregion
8
+ //# sourceMappingURL=field.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"field.d.ts","names":[],"sources":["../../../src/diagnostics/codes/field.ts"],"mappings":";;;qBAMa;;YAaD,8BAA8B"}
@@ -0,0 +1,99 @@
1
+ //#region src/diagnostics/codes/field.ts
2
+ /** The codes of the FIELD area, in the order they were added. */
3
+ const fieldDiagnosticCodes = [
4
+ "MOSTRA_FIELD_TOO_LARGE",
5
+ "MOSTRA_FIELD_ID_INVALID",
6
+ "MOSTRA_FIELD_MUTATION_ID_REUSED",
7
+ "MOSTRA_FIELD_CONFLICT",
8
+ "MOSTRA_FIELD_DUPLICATE_ID",
9
+ "MOSTRA_FIELD_ID_UNSTABLE",
10
+ "MOSTRA_FIELD_SHARED",
11
+ "MOSTRA_FIELD_UNBOUND"
12
+ ];
13
+ /** The FIELD area's catalog entries. */
14
+ const fieldDiagnostics = {
15
+ MOSTRA_FIELD_TOO_LARGE: {
16
+ severity: "error",
17
+ phase: "runtime",
18
+ title: "Field value too large",
19
+ hint: "Split large data across fields, keeping each value under 1 MiB and the whole document under 16 MiB.",
20
+ docs: {
21
+ explanation: "A field value is at most 1 MiB of JSON and a draft or artifact state at most 16 MiB in all (DATA_MODEL §5). This write would pass one of those limits, so Mostra refused it whole: nothing was truncated, and the page keeps the value locally.",
22
+ fix: "Split the value across several fields under one dotted prefix (`report.part1`, `report.part2`); they nest again in results."
23
+ }
24
+ },
25
+ MOSTRA_FIELD_ID_INVALID: {
26
+ severity: "error",
27
+ phase: "runtime",
28
+ title: "Invalid field ID",
29
+ hint: "Use a stable field ID of 1 to 256 characters: dot-separated parts, none empty.",
30
+ docs: {
31
+ explanation: "Every persisted value has an explicit, stable field ID (D52). An ID is 1 to 256 characters with no control characters; dots separate the parts that nest in results (`reply.m1`), so it can't start or end with a dot or hold two in a row.",
32
+ fix: "Give the field a fixed ID such as `layout` or `reply.m1` (one per message, from its ID), and keep it the same across renders and versions so drafts carry over."
33
+ }
34
+ },
35
+ MOSTRA_FIELD_MUTATION_ID_REUSED: {
36
+ severity: "error",
37
+ phase: "runtime",
38
+ title: "Mutation ID reused",
39
+ hint: "Generate a new mutation ID for every new change.",
40
+ docs: {
41
+ explanation: "A mutation ID identifies one change, so a retry after a timeout replays its recorded result (IN-01). This ID was already used for a change with other contents or another target. Mostra refuses it rather than answer with the result of a change nobody sent now.",
42
+ fix: "Create a fresh `mut_` ID for each change and reuse an ID only to retry exactly the same change."
43
+ }
44
+ },
45
+ MOSTRA_FIELD_CONFLICT: {
46
+ severity: "error",
47
+ phase: "runtime",
48
+ title: "Field changed by another writer",
49
+ hint: "Read the value again, then write it; for a value several writers change often, give each writer a field of its own.",
50
+ docs: {
51
+ explanation: "Every write names the revision it was based on, and a field changed after it is a conflict, never overwritten silently (D22). `window.storage` writes end with the last write: on a conflict it writes again over the newer value, a few times. When another writer kept changing the field each time, the write is refused with this code, and the field keeps the other writer's value.",
52
+ fix: "Read the key again and write the new value. For a counter or a list that many viewers change at once, store each viewer's part under its own key (`votes.<viewer>`) and combine them when reading."
53
+ }
54
+ },
55
+ MOSTRA_FIELD_DUPLICATE_ID: {
56
+ severity: "error",
57
+ phase: "lint",
58
+ title: "Field ID used for two different fields",
59
+ hint: "Give each of these fields its own ID.",
60
+ docs: {
61
+ explanation: "One field ID is used for two different fields: with two hook kinds (`useField` and `useChoice`, say), two scopes (`viewer` and `artifact`), or initial values of two types. The two would overwrite each other's saved value. The same ID used the same way twice is a deliberately shared value and isn't reported here.",
62
+ fix: "Rename one of them, for example `notes` and `notes.summary`, so each persisted value has its own ID."
63
+ }
64
+ },
65
+ MOSTRA_FIELD_ID_UNSTABLE: {
66
+ severity: "error",
67
+ phase: "lint",
68
+ title: "Field ID changes between renders",
69
+ hint: "Build the field's ID from stable data, such as a record's ID, never from random numbers or the time.",
70
+ docs: {
71
+ explanation: "Verify loaded the page twice with identical inputs and a fixed clock, and a field ID differed between the two loads. A viewer's saved answer would then be lost on every reload. IDs an interaction creates, such as a new list row's, are new fields and aren't reported.",
72
+ fix: "Derive the ID from something stable, for example a template with the record's ID instead of one with `Math.random()`."
73
+ }
74
+ },
75
+ MOSTRA_FIELD_SHARED: {
76
+ severity: "hint",
77
+ phase: "lint",
78
+ title: "Field ID shared by several controls",
79
+ hint: "Nothing to fix if these controls are meant to edit one value; give each its own ID if not.",
80
+ docs: {
81
+ explanation: "Several mounted components use one field ID in the same way, so they all edit one saved value. That is how a value is shared deliberately; in a list, it can also mean every row edits the same answer.",
82
+ fix: "If each row should keep its own answer, include the row's identity in the ID, such as a template that adds the task's ID after `done.`."
83
+ }
84
+ },
85
+ MOSTRA_FIELD_UNBOUND: {
86
+ severity: "hint",
87
+ phase: "smoke",
88
+ title: "Input not bound to a field",
89
+ hint: "Bind the input with `useField` (or a kit input with an `id`) if its value should be saved and submitted.",
90
+ docs: {
91
+ explanation: "Verify's smoke test typed into an input and the page saved nothing: the input isn't bound to a field, so what a viewer types there is lost on reload and isn't part of a submission. A search box or a filter may be meant that way.",
92
+ fix: "Use `const [value, setValue] = useField(\"<id>\", \"\")` for the input's value, or leave it if it isn't meant to persist."
93
+ }
94
+ }
95
+ };
96
+ //#endregion
97
+ export { fieldDiagnosticCodes, fieldDiagnostics };
98
+
99
+ //# sourceMappingURL=field.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"field.js","names":[],"sources":["../../../src/diagnostics/codes/field.ts"],"sourcesContent":["/**\n * Diagnostic codes of the FIELD area.\n */\nimport type { AreaCatalog } from \"../spec.ts\";\n\n/** The codes of the FIELD area, in the order they were added. */\nexport const fieldDiagnosticCodes = [\n \"MOSTRA_FIELD_TOO_LARGE\",\n \"MOSTRA_FIELD_ID_INVALID\",\n \"MOSTRA_FIELD_MUTATION_ID_REUSED\",\n \"MOSTRA_FIELD_CONFLICT\",\n \"MOSTRA_FIELD_DUPLICATE_ID\",\n \"MOSTRA_FIELD_ID_UNSTABLE\",\n \"MOSTRA_FIELD_SHARED\",\n \"MOSTRA_FIELD_UNBOUND\",\n // gen:codes\n] as const;\n\n/** The codes of the FIELD area. */\nexport type FieldDiagnosticCode = (typeof fieldDiagnosticCodes)[number];\n\n/** The FIELD area's catalog entries. */\nexport const fieldDiagnostics: AreaCatalog<FieldDiagnosticCode> = {\n MOSTRA_FIELD_TOO_LARGE: {\n severity: \"error\",\n phase: \"runtime\",\n title: \"Field value too large\",\n hint: \"Split large data across fields, keeping each value under 1 MiB and the whole document under 16 MiB.\",\n docs: {\n explanation:\n \"A field value is at most 1 MiB of JSON and a draft or artifact state at most 16 MiB in all (DATA_MODEL §5). This write would pass one of those limits, so Mostra refused it whole: nothing was truncated, and the page keeps the value locally.\",\n fix: \"Split the value across several fields under one dotted prefix (`report.part1`, `report.part2`); they nest again in results.\",\n },\n },\n MOSTRA_FIELD_ID_INVALID: {\n severity: \"error\",\n phase: \"runtime\",\n title: \"Invalid field ID\",\n hint: \"Use a stable field ID of 1 to 256 characters: dot-separated parts, none empty.\",\n docs: {\n explanation:\n \"Every persisted value has an explicit, stable field ID (D52). An ID is 1 to 256 characters with no control characters; dots separate the parts that nest in results (`reply.m1`), so it can't start or end with a dot or hold two in a row.\",\n fix: \"Give the field a fixed ID such as `layout` or `reply.m1` (one per message, from its ID), and keep it the same across renders and versions so drafts carry over.\",\n },\n },\n MOSTRA_FIELD_MUTATION_ID_REUSED: {\n severity: \"error\",\n phase: \"runtime\",\n title: \"Mutation ID reused\",\n hint: \"Generate a new mutation ID for every new change.\",\n docs: {\n explanation:\n \"A mutation ID identifies one change, so a retry after a timeout replays its recorded result (IN-01). This ID was already used for a change with other contents or another target. Mostra refuses it rather than answer with the result of a change nobody sent now.\",\n fix: \"Create a fresh `mut_` ID for each change and reuse an ID only to retry exactly the same change.\",\n },\n },\n MOSTRA_FIELD_CONFLICT: {\n severity: \"error\",\n phase: \"runtime\",\n title: \"Field changed by another writer\",\n hint: \"Read the value again, then write it; for a value several writers change often, give each writer a field of its own.\",\n docs: {\n explanation:\n \"Every write names the revision it was based on, and a field changed after it is a conflict, never overwritten silently (D22). `window.storage` writes end with the last write: on a conflict it writes again over the newer value, a few times. When another writer kept changing the field each time, the write is refused with this code, and the field keeps the other writer's value.\",\n fix: \"Read the key again and write the new value. For a counter or a list that many viewers change at once, store each viewer's part under its own key (`votes.<viewer>`) and combine them when reading.\",\n },\n },\n MOSTRA_FIELD_DUPLICATE_ID: {\n severity: \"error\",\n phase: \"lint\",\n title: \"Field ID used for two different fields\",\n hint: \"Give each of these fields its own ID.\",\n docs: {\n explanation:\n \"One field ID is used for two different fields: with two hook kinds (`useField` and `useChoice`, say), two scopes (`viewer` and `artifact`), or initial values of two types. The two would overwrite each other's saved value. The same ID used the same way twice is a deliberately shared value and isn't reported here.\",\n fix: \"Rename one of them, for example `notes` and `notes.summary`, so each persisted value has its own ID.\",\n },\n },\n MOSTRA_FIELD_ID_UNSTABLE: {\n severity: \"error\",\n phase: \"lint\",\n title: \"Field ID changes between renders\",\n hint: \"Build the field's ID from stable data, such as a record's ID, never from random numbers or the time.\",\n docs: {\n explanation:\n \"Verify loaded the page twice with identical inputs and a fixed clock, and a field ID differed between the two loads. A viewer's saved answer would then be lost on every reload. IDs an interaction creates, such as a new list row's, are new fields and aren't reported.\",\n fix: \"Derive the ID from something stable, for example a template with the record's ID instead of one with `Math.random()`.\",\n },\n },\n MOSTRA_FIELD_SHARED: {\n severity: \"hint\",\n phase: \"lint\",\n title: \"Field ID shared by several controls\",\n hint: \"Nothing to fix if these controls are meant to edit one value; give each its own ID if not.\",\n docs: {\n explanation:\n \"Several mounted components use one field ID in the same way, so they all edit one saved value. That is how a value is shared deliberately; in a list, it can also mean every row edits the same answer.\",\n fix: \"If each row should keep its own answer, include the row's identity in the ID, such as a template that adds the task's ID after `done.`.\",\n },\n },\n MOSTRA_FIELD_UNBOUND: {\n severity: \"hint\",\n phase: \"smoke\",\n title: \"Input not bound to a field\",\n hint: \"Bind the input with `useField` (or a kit input with an `id`) if its value should be saved and submitted.\",\n docs: {\n explanation:\n \"Verify's smoke test typed into an input and the page saved nothing: the input isn't bound to a field, so what a viewer types there is lost on reload and isn't part of a submission. A search box or a filter may be meant that way.\",\n fix: 'Use `const [value, setValue] = useField(\"<id>\", \"\")` for the input\\'s value, or leave it if it isn\\'t meant to persist.',\n },\n },\n // gen:entries\n};\n"],"mappings":";;AAMA,MAAa,uBAAuB;CAClC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AAEF;;AAMA,MAAa,mBAAqD;CAChE,wBAAwB;EACtB,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,iCAAiC;EAC/B,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,0BAA0B;EACxB,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,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/home.d.ts
3
+ /** The codes of the HOME area, in the order they were added. */
4
+ export declare const homeDiagnosticCodes: readonly ["MOSTRA_HOME_LOCKED", "MOSTRA_HOME_NOT_OWNED", "MOSTRA_HOME_SOCKET_TOO_LONG", "MOSTRA_HOME_TOO_NEW", "MOSTRA_HOME_LEDGER_UNREADABLE", "MOSTRA_HOME_DISK_FULL", "MOSTRA_HOME_GONE", "MOSTRA_HOME_MISMATCH", "MOSTRA_HOME_INTEGRITY", "MOSTRA_HOME_NOT_ALWAYS_ON", "MOSTRA_HOME_GC_INCOMPLETE"];
5
+ /** The codes of the HOME area. */
6
+ export type HomeDiagnosticCode = (typeof homeDiagnosticCodes)[number];
7
+ //#endregion
8
+ //# sourceMappingURL=home.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"home.d.ts","names":[],"sources":["../../../src/diagnostics/codes/home.ts"],"mappings":";;;qBAOa;;YAgBD,6BAA6B"}
@@ -0,0 +1,132 @@
1
+ //#region src/diagnostics/codes/home.ts
2
+ /** The codes of the HOME area, in the order they were added. */
3
+ const homeDiagnosticCodes = [
4
+ "MOSTRA_HOME_LOCKED",
5
+ "MOSTRA_HOME_NOT_OWNED",
6
+ "MOSTRA_HOME_SOCKET_TOO_LONG",
7
+ "MOSTRA_HOME_TOO_NEW",
8
+ "MOSTRA_HOME_LEDGER_UNREADABLE",
9
+ "MOSTRA_HOME_DISK_FULL",
10
+ "MOSTRA_HOME_GONE",
11
+ "MOSTRA_HOME_MISMATCH",
12
+ "MOSTRA_HOME_INTEGRITY",
13
+ "MOSTRA_HOME_NOT_ALWAYS_ON",
14
+ "MOSTRA_HOME_GC_INCOMPLETE"
15
+ ];
16
+ /** The HOME area's catalog entries. */
17
+ const homeDiagnostics = {
18
+ MOSTRA_HOME_LOCKED: {
19
+ severity: "error",
20
+ phase: "host",
21
+ title: "Home in use by another instance",
22
+ 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.",
23
+ docs: {
24
+ explanation: "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.",
25
+ 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."
26
+ }
27
+ },
28
+ MOSTRA_HOME_NOT_OWNED: {
29
+ severity: "error",
30
+ phase: "host",
31
+ title: "Directory not owned by you",
32
+ 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`.",
33
+ docs: {
34
+ explanation: "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.",
35
+ 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."
36
+ }
37
+ },
38
+ MOSTRA_HOME_SOCKET_TOO_LONG: {
39
+ severity: "error",
40
+ phase: "host",
41
+ title: "Control socket path too long",
42
+ hint: "Set `MOSTRA_RUNTIME_DIR` to a short directory you own, for example `/tmp/mostra-$USER`, and start again.",
43
+ docs: {
44
+ explanation: "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.",
45
+ 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."
46
+ }
47
+ },
48
+ MOSTRA_HOME_TOO_NEW: {
49
+ severity: "error",
50
+ phase: "host",
51
+ title: "Home written by a newer Mostra",
52
+ hint: "Run a Mostra release at least as new as the one named in the message, or use another home with `--home`.",
53
+ docs: {
54
+ explanation: "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.",
55
+ 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`."
56
+ }
57
+ },
58
+ MOSTRA_HOME_LEDGER_UNREADABLE: {
59
+ severity: "error",
60
+ phase: "host",
61
+ title: "Ledger can't be read",
62
+ hint: "Restore the ledger from the latest `ledger.sqlite.bak-*` backup in the home's `store/` directory, or move the damaged file aside.",
63
+ docs: {
64
+ explanation: "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.",
65
+ 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."
66
+ }
67
+ },
68
+ MOSTRA_HOME_DISK_FULL: {
69
+ severity: "error",
70
+ phase: "host",
71
+ title: "Disk full",
72
+ hint: "Free space on the disk that holds the Mostra home, then retry.",
73
+ docs: {
74
+ explanation: "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.",
75
+ 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."
76
+ }
77
+ },
78
+ MOSTRA_HOME_GONE: {
79
+ severity: "error",
80
+ phase: "host",
81
+ title: "Home directory removed",
82
+ hint: "Restore or recreate the home directory, then start Mostra again.",
83
+ docs: {
84
+ explanation: "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.",
85
+ 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."
86
+ }
87
+ },
88
+ MOSTRA_HOME_MISMATCH: {
89
+ severity: "error",
90
+ phase: "host",
91
+ title: "Instance serves a different home",
92
+ hint: "Connect to the instance for the home you expect, or start it with `--home` set to that home.",
93
+ docs: {
94
+ explanation: "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.",
95
+ 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."
96
+ }
97
+ },
98
+ MOSTRA_HOME_INTEGRITY: {
99
+ severity: "error",
100
+ phase: "host",
101
+ title: "Stored version or file damaged",
102
+ hint: "Publish the version's source again to rebuild a damaged version in place, and run `mostra doctor` for other damaged objects.",
103
+ docs: {
104
+ explanation: "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.",
105
+ 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."
106
+ }
107
+ },
108
+ MOSTRA_HOME_NOT_ALWAYS_ON: {
109
+ severity: "warning",
110
+ phase: "host",
111
+ title: "Long-lived artifacts without an always-on daemon",
112
+ hint: "Run `mostra daemon install` so the home's daemon runs as a login service and these artifacts answer at any hour.",
113
+ docs: {
114
+ explanation: "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.",
115
+ 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."
116
+ }
117
+ },
118
+ MOSTRA_HOME_GC_INCOMPLETE: {
119
+ severity: "warning",
120
+ phase: "host",
121
+ title: "gc didn't finish a step",
122
+ hint: "Run `mostra gc` again: what this run removed is in its result, and the next run picks up what it left.",
123
+ docs: {
124
+ explanation: "`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.",
125
+ fix: "Run `mostra gc` again; a failure that repeats names its cause in the message (for example, a file the user can't remove)."
126
+ }
127
+ }
128
+ };
129
+ //#endregion
130
+ export { homeDiagnosticCodes, homeDiagnostics };
131
+
132
+ //# sourceMappingURL=home.js.map