@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.
- package/LICENSE +202 -0
- package/README.md +38 -2
- package/dist/actions.d.ts +273 -0
- package/dist/actions.d.ts.map +1 -0
- package/dist/actions.js +154 -0
- package/dist/actions.js.map +1 -0
- package/dist/artifact.d.ts +113 -0
- package/dist/artifact.d.ts.map +1 -0
- package/dist/artifact.js +79 -0
- package/dist/artifact.js.map +1 -0
- package/dist/bridge.d.ts +295 -0
- package/dist/bridge.d.ts.map +1 -0
- package/dist/bridge.js +343 -0
- package/dist/bridge.js.map +1 -0
- package/dist/browser.d.ts +195 -0
- package/dist/browser.d.ts.map +1 -0
- package/dist/browser.js +156 -0
- package/dist/browser.js.map +1 -0
- package/dist/bundle.d.ts +155 -0
- package/dist/bundle.d.ts.map +1 -0
- package/dist/bundle.js +130 -0
- package/dist/bundle.js.map +1 -0
- package/dist/canonical.d.ts +23 -0
- package/dist/canonical.d.ts.map +1 -0
- package/dist/canonical.js +45 -0
- package/dist/canonical.js.map +1 -0
- package/dist/capability.d.ts +38 -0
- package/dist/capability.d.ts.map +1 -0
- package/dist/capability.js +61 -0
- package/dist/capability.js.map +1 -0
- package/dist/diagnostics/codes/a11y.d.ts +8 -0
- package/dist/diagnostics/codes/a11y.d.ts.map +1 -0
- package/dist/diagnostics/codes/a11y.js +30 -0
- package/dist/diagnostics/codes/a11y.js.map +1 -0
- package/dist/diagnostics/codes/action.d.ts +8 -0
- package/dist/diagnostics/codes/action.d.ts.map +1 -0
- package/dist/diagnostics/codes/action.js +110 -0
- package/dist/diagnostics/codes/action.js.map +1 -0
- package/dist/diagnostics/codes/artifact.d.ts +8 -0
- package/dist/diagnostics/codes/artifact.d.ts.map +1 -0
- package/dist/diagnostics/codes/artifact.js +121 -0
- package/dist/diagnostics/codes/artifact.js.map +1 -0
- package/dist/diagnostics/codes/build.d.ts +8 -0
- package/dist/diagnostics/codes/build.d.ts.map +1 -0
- package/dist/diagnostics/codes/build.js +55 -0
- package/dist/diagnostics/codes/build.js.map +1 -0
- package/dist/diagnostics/codes/cli.d.ts +8 -0
- package/dist/diagnostics/codes/cli.d.ts.map +1 -0
- package/dist/diagnostics/codes/cli.js +44 -0
- package/dist/diagnostics/codes/cli.js.map +1 -0
- package/dist/diagnostics/codes/console.d.ts +8 -0
- package/dist/diagnostics/codes/console.d.ts.map +1 -0
- package/dist/diagnostics/codes/console.js +30 -0
- package/dist/diagnostics/codes/console.js.map +1 -0
- package/dist/diagnostics/codes/dep.d.ts +8 -0
- package/dist/diagnostics/codes/dep.d.ts.map +1 -0
- package/dist/diagnostics/codes/dep.js +88 -0
- package/dist/diagnostics/codes/dep.js.map +1 -0
- package/dist/diagnostics/codes/env.d.ts +8 -0
- package/dist/diagnostics/codes/env.d.ts.map +1 -0
- package/dist/diagnostics/codes/env.js +132 -0
- package/dist/diagnostics/codes/env.js.map +1 -0
- package/dist/diagnostics/codes/field.d.ts +8 -0
- package/dist/diagnostics/codes/field.d.ts.map +1 -0
- package/dist/diagnostics/codes/field.js +99 -0
- package/dist/diagnostics/codes/field.js.map +1 -0
- package/dist/diagnostics/codes/home.d.ts +8 -0
- package/dist/diagnostics/codes/home.d.ts.map +1 -0
- package/dist/diagnostics/codes/home.js +132 -0
- package/dist/diagnostics/codes/home.js.map +1 -0
- package/dist/diagnostics/codes/host.d.ts +8 -0
- package/dist/diagnostics/codes/host.d.ts.map +1 -0
- package/dist/diagnostics/codes/host.js +176 -0
- package/dist/diagnostics/codes/host.js.map +1 -0
- package/dist/diagnostics/codes/hygiene.d.ts +8 -0
- package/dist/diagnostics/codes/hygiene.d.ts.map +1 -0
- package/dist/diagnostics/codes/hygiene.js +154 -0
- package/dist/diagnostics/codes/hygiene.js.map +1 -0
- package/dist/diagnostics/codes/index.d.ts +51 -0
- package/dist/diagnostics/codes/index.d.ts.map +1 -0
- package/dist/diagnostics/codes/index.js +72 -0
- package/dist/diagnostics/codes/index.js.map +1 -0
- package/dist/diagnostics/codes/live.d.ts +8 -0
- package/dist/diagnostics/codes/live.d.ts.map +1 -0
- package/dist/diagnostics/codes/live.js +30 -0
- package/dist/diagnostics/codes/live.js.map +1 -0
- package/dist/diagnostics/codes/manifest.d.ts +8 -0
- package/dist/diagnostics/codes/manifest.d.ts.map +1 -0
- package/dist/diagnostics/codes/manifest.js +44 -0
- package/dist/diagnostics/codes/manifest.js.map +1 -0
- package/dist/diagnostics/codes/network.d.ts +8 -0
- package/dist/diagnostics/codes/network.d.ts.map +1 -0
- package/dist/diagnostics/codes/network.js +30 -0
- package/dist/diagnostics/codes/network.js.map +1 -0
- package/dist/diagnostics/codes/platform.d.ts +8 -0
- package/dist/diagnostics/codes/platform.d.ts.map +1 -0
- package/dist/diagnostics/codes/platform.js +18 -0
- package/dist/diagnostics/codes/platform.js.map +1 -0
- package/dist/diagnostics/codes/publish.d.ts +8 -0
- package/dist/diagnostics/codes/publish.d.ts.map +1 -0
- package/dist/diagnostics/codes/publish.js +44 -0
- package/dist/diagnostics/codes/publish.js.map +1 -0
- package/dist/diagnostics/codes/regression.d.ts +8 -0
- package/dist/diagnostics/codes/regression.d.ts.map +1 -0
- package/dist/diagnostics/codes/regression.js +77 -0
- package/dist/diagnostics/codes/regression.js.map +1 -0
- package/dist/diagnostics/codes/runtime.d.ts +8 -0
- package/dist/diagnostics/codes/runtime.d.ts.map +1 -0
- package/dist/diagnostics/codes/runtime.js +66 -0
- package/dist/diagnostics/codes/runtime.js.map +1 -0
- package/dist/diagnostics/codes/secret.d.ts +8 -0
- package/dist/diagnostics/codes/secret.d.ts.map +1 -0
- package/dist/diagnostics/codes/secret.js +18 -0
- package/dist/diagnostics/codes/secret.js.map +1 -0
- package/dist/diagnostics/codes/smoke.d.ts +8 -0
- package/dist/diagnostics/codes/smoke.d.ts.map +1 -0
- package/dist/diagnostics/codes/smoke.js +30 -0
- package/dist/diagnostics/codes/smoke.js.map +1 -0
- package/dist/diagnostics/codes/submit.d.ts +8 -0
- package/dist/diagnostics/codes/submit.d.ts.map +1 -0
- package/dist/diagnostics/codes/submit.js +99 -0
- package/dist/diagnostics/codes/submit.js.map +1 -0
- package/dist/diagnostics/codes/target.d.ts +8 -0
- package/dist/diagnostics/codes/target.d.ts.map +1 -0
- package/dist/diagnostics/codes/target.js +18 -0
- package/dist/diagnostics/codes/target.js.map +1 -0
- package/dist/diagnostics/codes/type.d.ts +8 -0
- package/dist/diagnostics/codes/type.d.ts.map +1 -0
- package/dist/diagnostics/codes/type.js +30 -0
- package/dist/diagnostics/codes/type.js.map +1 -0
- package/dist/diagnostics/codes/verify.d.ts +8 -0
- package/dist/diagnostics/codes/verify.d.ts.map +1 -0
- package/dist/diagnostics/codes/verify.js +99 -0
- package/dist/diagnostics/codes/verify.js.map +1 -0
- package/dist/diagnostics/diagnostic.d.ts +79 -0
- package/dist/diagnostics/diagnostic.d.ts.map +1 -0
- package/dist/diagnostics/diagnostic.js +131 -0
- package/dist/diagnostics/diagnostic.js.map +1 -0
- package/dist/diagnostics/spec.d.ts +49 -0
- package/dist/diagnostics/spec.d.ts.map +1 -0
- package/dist/diagnostics/spec.js +31 -0
- package/dist/diagnostics/spec.js.map +1 -0
- package/dist/hygiene.d.ts +66 -0
- package/dist/hygiene.d.ts.map +1 -0
- package/dist/hygiene.js +134 -0
- package/dist/hygiene.js.map +1 -0
- package/dist/ids.d.ts +119 -0
- package/dist/ids.d.ts.map +1 -0
- package/dist/ids.js +135 -0
- package/dist/ids.js.map +1 -0
- package/dist/index.d.ts +86 -0
- package/dist/index.js +86 -0
- package/dist/interaction.d.ts +391 -0
- package/dist/interaction.d.ts.map +1 -0
- package/dist/interaction.js +306 -0
- package/dist/interaction.js.map +1 -0
- package/dist/manifest.d.ts +97 -0
- package/dist/manifest.d.ts.map +1 -0
- package/dist/manifest.js +101 -0
- package/dist/manifest.js.map +1 -0
- package/dist/method.d.ts +26 -0
- package/dist/method.d.ts.map +1 -0
- package/dist/method.js +10 -0
- package/dist/method.js.map +1 -0
- package/dist/methods/artifact/create.d.ts +29 -0
- package/dist/methods/artifact/create.d.ts.map +1 -0
- package/dist/methods/artifact/create.js +31 -0
- package/dist/methods/artifact/create.js.map +1 -0
- package/dist/methods/artifact/get.d.ts +17 -0
- package/dist/methods/artifact/get.d.ts.map +1 -0
- package/dist/methods/artifact/get.js +21 -0
- package/dist/methods/artifact/get.js.map +1 -0
- package/dist/methods/artifact/list.d.ts +22 -0
- package/dist/methods/artifact/list.d.ts.map +1 -0
- package/dist/methods/artifact/list.js +19 -0
- package/dist/methods/artifact/list.js.map +1 -0
- package/dist/methods/artifact/publish.d.ts +28 -0
- package/dist/methods/artifact/publish.d.ts.map +1 -0
- package/dist/methods/artifact/publish.js +28 -0
- package/dist/methods/artifact/publish.js.map +1 -0
- package/dist/methods/artifact/verify.d.ts +29 -0
- package/dist/methods/artifact/verify.d.ts.map +1 -0
- package/dist/methods/artifact/verify.js +27 -0
- package/dist/methods/artifact/verify.js.map +1 -0
- package/dist/methods/deps/add.d.ts +43 -0
- package/dist/methods/deps/add.d.ts.map +1 -0
- package/dist/methods/deps/add.js +40 -0
- package/dist/methods/deps/add.js.map +1 -0
- package/dist/methods/dev/start.d.ts +52 -0
- package/dist/methods/dev/start.d.ts.map +1 -0
- package/dist/methods/dev/start.js +56 -0
- package/dist/methods/dev/start.js.map +1 -0
- package/dist/methods/dev/stop.d.ts +16 -0
- package/dist/methods/dev/stop.d.ts.map +1 -0
- package/dist/methods/dev/stop.js +21 -0
- package/dist/methods/dev/stop.js.map +1 -0
- package/dist/methods/events/ack.d.ts +20 -0
- package/dist/methods/events/ack.d.ts.map +1 -0
- package/dist/methods/events/ack.js +26 -0
- package/dist/methods/events/ack.js.map +1 -0
- package/dist/methods/events/read.d.ts +40 -0
- package/dist/methods/events/read.d.ts.map +1 -0
- package/dist/methods/events/read.js +35 -0
- package/dist/methods/events/read.js.map +1 -0
- package/dist/methods/events/subscribe.d.ts +54 -0
- package/dist/methods/events/subscribe.d.ts.map +1 -0
- package/dist/methods/events/subscribe.js +44 -0
- package/dist/methods/events/subscribe.js.map +1 -0
- package/dist/methods/events/unsubscribe.d.ts +16 -0
- package/dist/methods/events/unsubscribe.d.ts.map +1 -0
- package/dist/methods/events/unsubscribe.js +21 -0
- package/dist/methods/events/unsubscribe.js.map +1 -0
- package/dist/methods/gc/run.d.ts +76 -0
- package/dist/methods/gc/run.d.ts.map +1 -0
- package/dist/methods/gc/run.js +56 -0
- package/dist/methods/gc/run.js.map +1 -0
- package/dist/methods/index.d.ts +6 -0
- package/dist/methods/index.d.ts.map +1 -0
- package/dist/methods/index.js +78 -0
- package/dist/methods/index.js.map +1 -0
- package/dist/methods/instance/check.d.ts +30 -0
- package/dist/methods/instance/check.d.ts.map +1 -0
- package/dist/methods/instance/check.js +34 -0
- package/dist/methods/instance/check.js.map +1 -0
- package/dist/methods/instance/status.d.ts +102 -0
- package/dist/methods/instance/status.d.ts.map +1 -0
- package/dist/methods/instance/status.js +83 -0
- package/dist/methods/instance/status.js.map +1 -0
- package/dist/methods/live/push.d.ts +28 -0
- package/dist/methods/live/push.d.ts.map +1 -0
- package/dist/methods/live/push.js +35 -0
- package/dist/methods/live/push.js.map +1 -0
- package/dist/methods/mostra/initialize.d.ts +143 -0
- package/dist/methods/mostra/initialize.d.ts.map +1 -0
- package/dist/methods/mostra/initialize.js +97 -0
- package/dist/methods/mostra/initialize.js.map +1 -0
- package/dist/methods/mostra/shutdown.d.ts +14 -0
- package/dist/methods/mostra/shutdown.d.ts.map +1 -0
- package/dist/methods/mostra/shutdown.js +22 -0
- package/dist/methods/mostra/shutdown.js.map +1 -0
- package/dist/methods/port/drafts-mirror.d.ts +30 -0
- package/dist/methods/port/drafts-mirror.d.ts.map +1 -0
- package/dist/methods/port/drafts-mirror.js +33 -0
- package/dist/methods/port/drafts-mirror.js.map +1 -0
- package/dist/methods/port/secrets-get.d.ts +19 -0
- package/dist/methods/port/secrets-get.d.ts.map +1 -0
- package/dist/methods/port/secrets-get.js +31 -0
- package/dist/methods/port/secrets-get.js.map +1 -0
- package/dist/methods/port/submissions-deliver.d.ts +38 -0
- package/dist/methods/port/submissions-deliver.d.ts.map +1 -0
- package/dist/methods/port/submissions-deliver.js +38 -0
- package/dist/methods/port/submissions-deliver.js.map +1 -0
- package/dist/methods/port/trusted-controls-activated.d.ts +27 -0
- package/dist/methods/port/trusted-controls-activated.d.ts.map +1 -0
- package/dist/methods/port/trusted-controls-activated.js +33 -0
- package/dist/methods/port/trusted-controls-activated.js.map +1 -0
- package/dist/methods/port/trusted-controls-policy.d.ts +21 -0
- package/dist/methods/port/trusted-controls-policy.d.ts.map +1 -0
- package/dist/methods/port/trusted-controls-policy.js +27 -0
- package/dist/methods/port/trusted-controls-policy.js.map +1 -0
- package/dist/methods/results/get.d.ts +32 -0
- package/dist/methods/results/get.d.ts.map +1 -0
- package/dist/methods/results/get.js +36 -0
- package/dist/methods/results/get.js.map +1 -0
- package/dist/methods/secret/delete.d.ts +22 -0
- package/dist/methods/secret/delete.d.ts.map +1 -0
- package/dist/methods/secret/delete.js +32 -0
- package/dist/methods/secret/delete.js.map +1 -0
- package/dist/methods/secret/list.d.ts +21 -0
- package/dist/methods/secret/list.d.ts.map +1 -0
- package/dist/methods/secret/list.js +29 -0
- package/dist/methods/secret/list.js.map +1 -0
- package/dist/methods/secret/set.d.ts +37 -0
- package/dist/methods/secret/set.d.ts.map +1 -0
- package/dist/methods/secret/set.js +41 -0
- package/dist/methods/secret/set.js.map +1 -0
- package/dist/methods/state/get.d.ts +25 -0
- package/dist/methods/state/get.d.ts.map +1 -0
- package/dist/methods/state/get.js +29 -0
- package/dist/methods/state/get.js.map +1 -0
- package/dist/methods/state/patch.d.ts +32 -0
- package/dist/methods/state/patch.d.ts.map +1 -0
- package/dist/methods/state/patch.js +29 -0
- package/dist/methods/state/patch.js.map +1 -0
- package/dist/methods/view/default.d.ts +19 -0
- package/dist/methods/view/default.d.ts.map +1 -0
- package/dist/methods/view/default.js +23 -0
- package/dist/methods/view/default.js.map +1 -0
- package/dist/methods/view/launch.d.ts +27 -0
- package/dist/methods/view/launch.d.ts.map +1 -0
- package/dist/methods/view/launch.js +30 -0
- package/dist/methods/view/launch.js.map +1 -0
- package/dist/methods/view/revoke.d.ts +19 -0
- package/dist/methods/view/revoke.d.ts.map +1 -0
- package/dist/methods/view/revoke.js +26 -0
- package/dist/methods/view/revoke.js.map +1 -0
- package/dist/methods/view/rotate.d.ts +21 -0
- package/dist/methods/view/rotate.d.ts.map +1 -0
- package/dist/methods/view/rotate.js +27 -0
- package/dist/methods/view/rotate.js.map +1 -0
- package/dist/methods/view/url.d.ts +52 -0
- package/dist/methods/view/url.d.ts.map +1 -0
- package/dist/methods/view/url.js +43 -0
- package/dist/methods/view/url.js.map +1 -0
- package/dist/methods/wait/wait.d.ts +37 -0
- package/dist/methods/wait/wait.d.ts.map +1 -0
- package/dist/methods/wait/wait.js +39 -0
- package/dist/methods/wait/wait.js.map +1 -0
- package/dist/revision.d.ts +43 -0
- package/dist/revision.d.ts.map +1 -0
- package/dist/revision.js +69 -0
- package/dist/revision.js.map +1 -0
- package/dist/rpc/error.d.ts +47 -0
- package/dist/rpc/error.d.ts.map +1 -0
- package/dist/rpc/error.js +77 -0
- package/dist/rpc/error.js.map +1 -0
- package/dist/rpc/lines.d.ts +30 -0
- package/dist/rpc/lines.d.ts.map +1 -0
- package/dist/rpc/lines.js +63 -0
- package/dist/rpc/lines.js.map +1 -0
- package/dist/rpc/messages.d.ts +92 -0
- package/dist/rpc/messages.d.ts.map +1 -0
- package/dist/rpc/messages.js +133 -0
- package/dist/rpc/messages.js.map +1 -0
- package/dist/rpc/peer.d.ts +81 -0
- package/dist/rpc/peer.d.ts.map +1 -0
- package/dist/rpc/peer.js +208 -0
- package/dist/rpc/peer.js.map +1 -0
- package/dist/serializer.d.ts +178 -0
- package/dist/serializer.d.ts.map +1 -0
- package/dist/serializer.js +929 -0
- package/dist/serializer.js.map +1 -0
- package/dist/verify.d.ts +254 -0
- package/dist/verify.d.ts.map +1 -0
- package/dist/verify.js +243 -0
- package/dist/verify.js.map +1 -0
- package/dist/view.d.ts +103 -0
- package/dist/view.d.ts.map +1 -0
- package/dist/view.js +110 -0
- package/dist/view.js.map +1 -0
- package/dist/wire-registry.js +11 -0
- package/dist/wire-registry.js.map +1 -0
- package/dist/worker.d.ts +249 -0
- package/dist/worker.d.ts.map +1 -0
- package/dist/worker.js +158 -0
- package/dist/worker.js.map +1 -0
- package/package.json +114 -3
- package/schemas/protocol.draft-07.json +5120 -0
- package/schemas/protocol.schema.json +4964 -0
- package/src/actions.ts +418 -0
- package/src/artifact.ts +187 -0
- package/src/bridge.ts +618 -0
- package/src/browser.ts +374 -0
- package/src/bundle.ts +264 -0
- package/src/canonical.ts +49 -0
- package/src/capability.ts +92 -0
- package/src/diagnostics/codes/a11y.ts +41 -0
- package/src/diagnostics/codes/action.ts +125 -0
- package/src/diagnostics/codes/artifact.ts +137 -0
- package/src/diagnostics/codes/build.ts +65 -0
- package/src/diagnostics/codes/cli.ts +53 -0
- package/src/diagnostics/codes/console.ts +41 -0
- package/src/diagnostics/codes/dep.ts +101 -0
- package/src/diagnostics/codes/env.ts +149 -0
- package/src/diagnostics/codes/field.ts +113 -0
- package/src/diagnostics/codes/home.ts +150 -0
- package/src/diagnostics/codes/host.ts +197 -0
- package/src/diagnostics/codes/hygiene.ts +175 -0
- package/src/diagnostics/codes/index.ts +142 -0
- package/src/diagnostics/codes/live.ts +41 -0
- package/src/diagnostics/codes/manifest.ts +53 -0
- package/src/diagnostics/codes/network.ts +41 -0
- package/src/diagnostics/codes/platform.ts +30 -0
- package/src/diagnostics/codes/publish.ts +53 -0
- package/src/diagnostics/codes/regression.ts +89 -0
- package/src/diagnostics/codes/runtime.ts +77 -0
- package/src/diagnostics/codes/secret.ts +29 -0
- package/src/diagnostics/codes/smoke.ts +41 -0
- package/src/diagnostics/codes/submit.ts +113 -0
- package/src/diagnostics/codes/target.ts +29 -0
- package/src/diagnostics/codes/type.ts +41 -0
- package/src/diagnostics/codes/verify.ts +113 -0
- package/src/diagnostics/diagnostic.ts +240 -0
- package/src/diagnostics/spec.ts +90 -0
- package/src/hygiene.ts +224 -0
- package/src/ids.ts +279 -0
- package/src/index.ts +576 -0
- package/src/interaction.ts +728 -0
- package/src/manifest.ts +206 -0
- package/src/method.ts +42 -0
- package/src/methods/artifact/create.ts +56 -0
- package/src/methods/artifact/get.ts +30 -0
- package/src/methods/artifact/list.ts +42 -0
- package/src/methods/artifact/publish.ts +46 -0
- package/src/methods/artifact/verify.ts +46 -0
- package/src/methods/deps/add.ts +72 -0
- package/src/methods/dev/start.ts +84 -0
- package/src/methods/dev/stop.ts +32 -0
- package/src/methods/events/ack.ts +41 -0
- package/src/methods/events/read.ts +67 -0
- package/src/methods/events/subscribe.ts +91 -0
- package/src/methods/events/unsubscribe.ts +35 -0
- package/src/methods/gc/run.ts +125 -0
- package/src/methods/index.ts +81 -0
- package/src/methods/instance/check.ts +61 -0
- package/src/methods/instance/status.ts +172 -0
- package/src/methods/live/push.ts +54 -0
- package/src/methods/mostra/initialize.ts +249 -0
- package/src/methods/mostra/shutdown.ts +31 -0
- package/src/methods/port/drafts-mirror.ts +52 -0
- package/src/methods/port/secrets-get.ts +40 -0
- package/src/methods/port/submissions-deliver.ts +70 -0
- package/src/methods/port/trusted-controls-activated.ts +51 -0
- package/src/methods/port/trusted-controls-policy.ts +38 -0
- package/src/methods/results/get.ts +59 -0
- package/src/methods/secret/delete.ts +43 -0
- package/src/methods/secret/list.ts +40 -0
- package/src/methods/secret/set.ts +69 -0
- package/src/methods/state/get.ts +44 -0
- package/src/methods/state/patch.ts +51 -0
- package/src/methods/view/default.ts +32 -0
- package/src/methods/view/launch.ts +47 -0
- package/src/methods/view/revoke.ts +39 -0
- package/src/methods/view/rotate.ts +37 -0
- package/src/methods/view/url.ts +84 -0
- package/src/methods/wait/wait.ts +58 -0
- package/src/revision.ts +101 -0
- package/src/rpc/error.ts +107 -0
- package/src/rpc/lines.ts +70 -0
- package/src/rpc/messages.ts +188 -0
- package/src/rpc/peer.ts +341 -0
- package/src/serializer.ts +1217 -0
- package/src/timers.d.ts +8 -0
- package/src/verify.ts +458 -0
- package/src/view.ts +200 -0
- package/src/web-crypto.d.ts +9 -0
- package/src/web-platform.d.ts +35 -0
- package/src/wire-registry.ts +14 -0
- package/src/worker.ts +374 -0
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Diagnostic codes of the ENV area.
|
|
3
|
+
*/
|
|
4
|
+
import type { AreaCatalog } from "../spec.ts";
|
|
5
|
+
|
|
6
|
+
/** The codes of the ENV area, in the order they were added. */
|
|
7
|
+
export const envDiagnosticCodes = [
|
|
8
|
+
"MOSTRA_ENV_WARM_MISSING",
|
|
9
|
+
"MOSTRA_ENV_PORT_TAKEN",
|
|
10
|
+
"MOSTRA_ENV_BIND_FAILED",
|
|
11
|
+
"MOSTRA_ENV_SHELL_MISSING",
|
|
12
|
+
"MOSTRA_ENV_SERVICE_FAILED",
|
|
13
|
+
"MOSTRA_ENV_BROWSER_MISSING",
|
|
14
|
+
"MOSTRA_ENV_RUNTIME_MISSING",
|
|
15
|
+
"MOSTRA_ENV_BUNDLE_INVALID",
|
|
16
|
+
"MOSTRA_ENV_BUNDLE_DOWNLOAD_FAILED",
|
|
17
|
+
"MOSTRA_ENV_BUNDLE_UNAVAILABLE",
|
|
18
|
+
"MOSTRA_ENV_NODE_UNSUPPORTED",
|
|
19
|
+
// gen:codes
|
|
20
|
+
] as const;
|
|
21
|
+
|
|
22
|
+
/** The codes of the ENV area. */
|
|
23
|
+
export type EnvDiagnosticCode = (typeof envDiagnosticCodes)[number];
|
|
24
|
+
|
|
25
|
+
/** The ENV area's catalog entries. */
|
|
26
|
+
export const envDiagnostics: AreaCatalog<EnvDiagnosticCode> = {
|
|
27
|
+
MOSTRA_ENV_WARM_MISSING: {
|
|
28
|
+
severity: "error",
|
|
29
|
+
phase: "host",
|
|
30
|
+
title: "Warm package set missing",
|
|
31
|
+
hint: "Reinstall the Mostra runtime, or set `MOSTRA_WARM_DIR` to its warm package set.",
|
|
32
|
+
docs: {
|
|
33
|
+
explanation:
|
|
34
|
+
"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.",
|
|
35
|
+
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`.",
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
MOSTRA_ENV_PORT_TAKEN: {
|
|
39
|
+
severity: "warning",
|
|
40
|
+
phase: "host",
|
|
41
|
+
title: "Leased port taken",
|
|
42
|
+
hint: "Open the artifact through a new link: `view/url` or `mostra open` mints one on the new port.",
|
|
43
|
+
docs: {
|
|
44
|
+
explanation:
|
|
45
|
+
"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.",
|
|
46
|
+
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.",
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
MOSTRA_ENV_BIND_FAILED: {
|
|
50
|
+
severity: "error",
|
|
51
|
+
phase: "host",
|
|
52
|
+
title: "Gateway can't bind",
|
|
53
|
+
hint: "Start Mostra with an address this machine has, or without `--bind` to use the loopback address.",
|
|
54
|
+
docs: {
|
|
55
|
+
explanation:
|
|
56
|
+
"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.",
|
|
57
|
+
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.",
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
MOSTRA_ENV_SHELL_MISSING: {
|
|
61
|
+
severity: "error",
|
|
62
|
+
phase: "host",
|
|
63
|
+
title: "Shell app missing",
|
|
64
|
+
hint: "Reinstall the Mostra runtime, or set `MOSTRA_SHELL_DIR` to its built shell.",
|
|
65
|
+
docs: {
|
|
66
|
+
explanation:
|
|
67
|
+
"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.",
|
|
68
|
+
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`.",
|
|
69
|
+
},
|
|
70
|
+
},
|
|
71
|
+
MOSTRA_ENV_SERVICE_FAILED: {
|
|
72
|
+
severity: "error",
|
|
73
|
+
phase: "host",
|
|
74
|
+
title: "Login service could not be installed",
|
|
75
|
+
hint: "Read the message, fix what it names, and run the install again.",
|
|
76
|
+
docs: {
|
|
77
|
+
explanation:
|
|
78
|
+
"`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.",
|
|
79
|
+
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`.",
|
|
80
|
+
},
|
|
81
|
+
},
|
|
82
|
+
MOSTRA_ENV_BROWSER_MISSING: {
|
|
83
|
+
severity: "error",
|
|
84
|
+
phase: "host",
|
|
85
|
+
title: "Browser for verify missing",
|
|
86
|
+
hint: "Run the runtime bundle's `bin/mostra-setup` (with network access) to fetch the browser verify uses, then verify again.",
|
|
87
|
+
docs: {
|
|
88
|
+
explanation:
|
|
89
|
+
"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.",
|
|
90
|
+
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.",
|
|
91
|
+
},
|
|
92
|
+
},
|
|
93
|
+
MOSTRA_ENV_RUNTIME_MISSING: {
|
|
94
|
+
severity: "error",
|
|
95
|
+
phase: "host",
|
|
96
|
+
title: "Runtime not found",
|
|
97
|
+
hint: "Reinstall Mostra, or set `MOSTRA_RUNTIME_BIN` to the runtime's `mostra-runtime` entry.",
|
|
98
|
+
docs: {
|
|
99
|
+
explanation:
|
|
100
|
+
"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.",
|
|
101
|
+
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.",
|
|
102
|
+
},
|
|
103
|
+
},
|
|
104
|
+
MOSTRA_ENV_BUNDLE_INVALID: {
|
|
105
|
+
severity: "error",
|
|
106
|
+
phase: "platform",
|
|
107
|
+
title: "Runtime bundle failed verification",
|
|
108
|
+
hint: "Nothing was installed; install Mostra again, and if it fails the same way, report it with the message.",
|
|
109
|
+
docs: {
|
|
110
|
+
explanation:
|
|
111
|
+
"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.",
|
|
112
|
+
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`.",
|
|
113
|
+
},
|
|
114
|
+
},
|
|
115
|
+
MOSTRA_ENV_BUNDLE_DOWNLOAD_FAILED: {
|
|
116
|
+
severity: "error",
|
|
117
|
+
phase: "platform",
|
|
118
|
+
title: "Runtime bundle download failed",
|
|
119
|
+
hint: "Check the network or proxy (`HTTPS_PROXY`), then run the command again: a retry starts the download over.",
|
|
120
|
+
docs: {
|
|
121
|
+
explanation:
|
|
122
|
+
"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.",
|
|
123
|
+
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.",
|
|
124
|
+
},
|
|
125
|
+
},
|
|
126
|
+
MOSTRA_ENV_BUNDLE_UNAVAILABLE: {
|
|
127
|
+
severity: "error",
|
|
128
|
+
phase: "platform",
|
|
129
|
+
title: "No runtime bundle available",
|
|
130
|
+
hint: "Run this once with network access, or point `MOSTRA_BUNDLE` at an extracted bundle.",
|
|
131
|
+
docs: {
|
|
132
|
+
explanation:
|
|
133
|
+
"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.",
|
|
134
|
+
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.",
|
|
135
|
+
},
|
|
136
|
+
},
|
|
137
|
+
MOSTRA_ENV_NODE_UNSUPPORTED: {
|
|
138
|
+
severity: "error",
|
|
139
|
+
phase: "platform",
|
|
140
|
+
title: "Node.js too old to start Mostra",
|
|
141
|
+
hint: "Run `mostra` with Node.js 22.19 or later, or run the runtime bundle's own `bin/mostra`, which needs no Node.js.",
|
|
142
|
+
docs: {
|
|
143
|
+
explanation:
|
|
144
|
+
"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.",
|
|
145
|
+
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`.",
|
|
146
|
+
},
|
|
147
|
+
},
|
|
148
|
+
// gen:entries
|
|
149
|
+
};
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Diagnostic codes of the FIELD area.
|
|
3
|
+
*/
|
|
4
|
+
import type { AreaCatalog } from "../spec.ts";
|
|
5
|
+
|
|
6
|
+
/** The codes of the FIELD area, in the order they were added. */
|
|
7
|
+
export const fieldDiagnosticCodes = [
|
|
8
|
+
"MOSTRA_FIELD_TOO_LARGE",
|
|
9
|
+
"MOSTRA_FIELD_ID_INVALID",
|
|
10
|
+
"MOSTRA_FIELD_MUTATION_ID_REUSED",
|
|
11
|
+
"MOSTRA_FIELD_CONFLICT",
|
|
12
|
+
"MOSTRA_FIELD_DUPLICATE_ID",
|
|
13
|
+
"MOSTRA_FIELD_ID_UNSTABLE",
|
|
14
|
+
"MOSTRA_FIELD_SHARED",
|
|
15
|
+
"MOSTRA_FIELD_UNBOUND",
|
|
16
|
+
// gen:codes
|
|
17
|
+
] as const;
|
|
18
|
+
|
|
19
|
+
/** The codes of the FIELD area. */
|
|
20
|
+
export type FieldDiagnosticCode = (typeof fieldDiagnosticCodes)[number];
|
|
21
|
+
|
|
22
|
+
/** The FIELD area's catalog entries. */
|
|
23
|
+
export const fieldDiagnostics: AreaCatalog<FieldDiagnosticCode> = {
|
|
24
|
+
MOSTRA_FIELD_TOO_LARGE: {
|
|
25
|
+
severity: "error",
|
|
26
|
+
phase: "runtime",
|
|
27
|
+
title: "Field value too large",
|
|
28
|
+
hint: "Split large data across fields, keeping each value under 1 MiB and the whole document under 16 MiB.",
|
|
29
|
+
docs: {
|
|
30
|
+
explanation:
|
|
31
|
+
"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.",
|
|
32
|
+
fix: "Split the value across several fields under one dotted prefix (`report.part1`, `report.part2`); they nest again in results.",
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
MOSTRA_FIELD_ID_INVALID: {
|
|
36
|
+
severity: "error",
|
|
37
|
+
phase: "runtime",
|
|
38
|
+
title: "Invalid field ID",
|
|
39
|
+
hint: "Use a stable field ID of 1 to 256 characters: dot-separated parts, none empty.",
|
|
40
|
+
docs: {
|
|
41
|
+
explanation:
|
|
42
|
+
"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.",
|
|
43
|
+
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.",
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
MOSTRA_FIELD_MUTATION_ID_REUSED: {
|
|
47
|
+
severity: "error",
|
|
48
|
+
phase: "runtime",
|
|
49
|
+
title: "Mutation ID reused",
|
|
50
|
+
hint: "Generate a new mutation ID for every new change.",
|
|
51
|
+
docs: {
|
|
52
|
+
explanation:
|
|
53
|
+
"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.",
|
|
54
|
+
fix: "Create a fresh `mut_` ID for each change and reuse an ID only to retry exactly the same change.",
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
MOSTRA_FIELD_CONFLICT: {
|
|
58
|
+
severity: "error",
|
|
59
|
+
phase: "runtime",
|
|
60
|
+
title: "Field changed by another writer",
|
|
61
|
+
hint: "Read the value again, then write it; for a value several writers change often, give each writer a field of its own.",
|
|
62
|
+
docs: {
|
|
63
|
+
explanation:
|
|
64
|
+
"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.",
|
|
65
|
+
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.",
|
|
66
|
+
},
|
|
67
|
+
},
|
|
68
|
+
MOSTRA_FIELD_DUPLICATE_ID: {
|
|
69
|
+
severity: "error",
|
|
70
|
+
phase: "lint",
|
|
71
|
+
title: "Field ID used for two different fields",
|
|
72
|
+
hint: "Give each of these fields its own ID.",
|
|
73
|
+
docs: {
|
|
74
|
+
explanation:
|
|
75
|
+
"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.",
|
|
76
|
+
fix: "Rename one of them, for example `notes` and `notes.summary`, so each persisted value has its own ID.",
|
|
77
|
+
},
|
|
78
|
+
},
|
|
79
|
+
MOSTRA_FIELD_ID_UNSTABLE: {
|
|
80
|
+
severity: "error",
|
|
81
|
+
phase: "lint",
|
|
82
|
+
title: "Field ID changes between renders",
|
|
83
|
+
hint: "Build the field's ID from stable data, such as a record's ID, never from random numbers or the time.",
|
|
84
|
+
docs: {
|
|
85
|
+
explanation:
|
|
86
|
+
"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.",
|
|
87
|
+
fix: "Derive the ID from something stable, for example a template with the record's ID instead of one with `Math.random()`.",
|
|
88
|
+
},
|
|
89
|
+
},
|
|
90
|
+
MOSTRA_FIELD_SHARED: {
|
|
91
|
+
severity: "hint",
|
|
92
|
+
phase: "lint",
|
|
93
|
+
title: "Field ID shared by several controls",
|
|
94
|
+
hint: "Nothing to fix if these controls are meant to edit one value; give each its own ID if not.",
|
|
95
|
+
docs: {
|
|
96
|
+
explanation:
|
|
97
|
+
"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.",
|
|
98
|
+
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.`.",
|
|
99
|
+
},
|
|
100
|
+
},
|
|
101
|
+
MOSTRA_FIELD_UNBOUND: {
|
|
102
|
+
severity: "hint",
|
|
103
|
+
phase: "smoke",
|
|
104
|
+
title: "Input not bound to a field",
|
|
105
|
+
hint: "Bind the input with `useField` (or a kit input with an `id`) if its value should be saved and submitted.",
|
|
106
|
+
docs: {
|
|
107
|
+
explanation:
|
|
108
|
+
"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.",
|
|
109
|
+
fix: 'Use `const [value, setValue] = useField("<id>", "")` for the input\'s value, or leave it if it isn\'t meant to persist.',
|
|
110
|
+
},
|
|
111
|
+
},
|
|
112
|
+
// gen:entries
|
|
113
|
+
};
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Diagnostic codes of the HOME area: the Mostra home, its ledger and the instance that owns it
|
|
3
|
+
* (DATA_MODEL §1, §6; FAILURE_MODEL §2, §3).
|
|
4
|
+
*/
|
|
5
|
+
import type { AreaCatalog } from "../spec.ts";
|
|
6
|
+
|
|
7
|
+
/** The codes of the HOME area, in the order they were added. */
|
|
8
|
+
export const homeDiagnosticCodes = [
|
|
9
|
+
"MOSTRA_HOME_LOCKED",
|
|
10
|
+
"MOSTRA_HOME_NOT_OWNED",
|
|
11
|
+
"MOSTRA_HOME_SOCKET_TOO_LONG",
|
|
12
|
+
"MOSTRA_HOME_TOO_NEW",
|
|
13
|
+
"MOSTRA_HOME_LEDGER_UNREADABLE",
|
|
14
|
+
"MOSTRA_HOME_DISK_FULL",
|
|
15
|
+
"MOSTRA_HOME_GONE",
|
|
16
|
+
"MOSTRA_HOME_MISMATCH",
|
|
17
|
+
"MOSTRA_HOME_INTEGRITY",
|
|
18
|
+
"MOSTRA_HOME_NOT_ALWAYS_ON",
|
|
19
|
+
"MOSTRA_HOME_GC_INCOMPLETE",
|
|
20
|
+
// gen:codes
|
|
21
|
+
] as const;
|
|
22
|
+
|
|
23
|
+
/** The codes of the HOME area. */
|
|
24
|
+
export type HomeDiagnosticCode = (typeof homeDiagnosticCodes)[number];
|
|
25
|
+
|
|
26
|
+
/** The HOME area's catalog entries. */
|
|
27
|
+
export const homeDiagnostics: AreaCatalog<HomeDiagnosticCode> = {
|
|
28
|
+
MOSTRA_HOME_LOCKED: {
|
|
29
|
+
severity: "error",
|
|
30
|
+
phase: "host",
|
|
31
|
+
title: "Home in use by another instance",
|
|
32
|
+
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.",
|
|
33
|
+
docs: {
|
|
34
|
+
explanation:
|
|
35
|
+
"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.",
|
|
36
|
+
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.",
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
MOSTRA_HOME_NOT_OWNED: {
|
|
40
|
+
severity: "error",
|
|
41
|
+
phase: "host",
|
|
42
|
+
title: "Directory not owned by you",
|
|
43
|
+
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`.",
|
|
44
|
+
docs: {
|
|
45
|
+
explanation:
|
|
46
|
+
"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.",
|
|
47
|
+
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.",
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
MOSTRA_HOME_SOCKET_TOO_LONG: {
|
|
51
|
+
severity: "error",
|
|
52
|
+
phase: "host",
|
|
53
|
+
title: "Control socket path too long",
|
|
54
|
+
hint: "Set `MOSTRA_RUNTIME_DIR` to a short directory you own, for example `/tmp/mostra-$USER`, and start again.",
|
|
55
|
+
docs: {
|
|
56
|
+
explanation:
|
|
57
|
+
"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.",
|
|
58
|
+
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.",
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
MOSTRA_HOME_TOO_NEW: {
|
|
62
|
+
severity: "error",
|
|
63
|
+
phase: "host",
|
|
64
|
+
title: "Home written by a newer Mostra",
|
|
65
|
+
hint: "Run a Mostra release at least as new as the one named in the message, or use another home with `--home`.",
|
|
66
|
+
docs: {
|
|
67
|
+
explanation:
|
|
68
|
+
"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.",
|
|
69
|
+
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`.",
|
|
70
|
+
},
|
|
71
|
+
},
|
|
72
|
+
MOSTRA_HOME_LEDGER_UNREADABLE: {
|
|
73
|
+
severity: "error",
|
|
74
|
+
phase: "host",
|
|
75
|
+
title: "Ledger can't be read",
|
|
76
|
+
hint: "Restore the ledger from the latest `ledger.sqlite.bak-*` backup in the home's `store/` directory, or move the damaged file aside.",
|
|
77
|
+
docs: {
|
|
78
|
+
explanation:
|
|
79
|
+
"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.",
|
|
80
|
+
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.",
|
|
81
|
+
},
|
|
82
|
+
},
|
|
83
|
+
MOSTRA_HOME_DISK_FULL: {
|
|
84
|
+
severity: "error",
|
|
85
|
+
phase: "host",
|
|
86
|
+
title: "Disk full",
|
|
87
|
+
hint: "Free space on the disk that holds the Mostra home, then retry.",
|
|
88
|
+
docs: {
|
|
89
|
+
explanation:
|
|
90
|
+
"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.",
|
|
91
|
+
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.",
|
|
92
|
+
},
|
|
93
|
+
},
|
|
94
|
+
MOSTRA_HOME_GONE: {
|
|
95
|
+
severity: "error",
|
|
96
|
+
phase: "host",
|
|
97
|
+
title: "Home directory removed",
|
|
98
|
+
hint: "Restore or recreate the home directory, then start Mostra again.",
|
|
99
|
+
docs: {
|
|
100
|
+
explanation:
|
|
101
|
+
"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.",
|
|
102
|
+
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.",
|
|
103
|
+
},
|
|
104
|
+
},
|
|
105
|
+
MOSTRA_HOME_MISMATCH: {
|
|
106
|
+
severity: "error",
|
|
107
|
+
phase: "host",
|
|
108
|
+
title: "Instance serves a different home",
|
|
109
|
+
hint: "Connect to the instance for the home you expect, or start it with `--home` set to that home.",
|
|
110
|
+
docs: {
|
|
111
|
+
explanation:
|
|
112
|
+
"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.",
|
|
113
|
+
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.",
|
|
114
|
+
},
|
|
115
|
+
},
|
|
116
|
+
MOSTRA_HOME_INTEGRITY: {
|
|
117
|
+
severity: "error",
|
|
118
|
+
phase: "host",
|
|
119
|
+
title: "Stored version or file damaged",
|
|
120
|
+
hint: "Publish the version's source again to rebuild a damaged version in place, and run `mostra doctor` for other damaged objects.",
|
|
121
|
+
docs: {
|
|
122
|
+
explanation:
|
|
123
|
+
"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.",
|
|
124
|
+
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.",
|
|
125
|
+
},
|
|
126
|
+
},
|
|
127
|
+
MOSTRA_HOME_NOT_ALWAYS_ON: {
|
|
128
|
+
severity: "warning",
|
|
129
|
+
phase: "host",
|
|
130
|
+
title: "Long-lived artifacts without an always-on daemon",
|
|
131
|
+
hint: "Run `mostra daemon install` so the home's daemon runs as a login service and these artifacts answer at any hour.",
|
|
132
|
+
docs: {
|
|
133
|
+
explanation:
|
|
134
|
+
"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.",
|
|
135
|
+
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.",
|
|
136
|
+
},
|
|
137
|
+
},
|
|
138
|
+
MOSTRA_HOME_GC_INCOMPLETE: {
|
|
139
|
+
severity: "warning",
|
|
140
|
+
phase: "host",
|
|
141
|
+
title: "gc didn't finish a step",
|
|
142
|
+
hint: "Run `mostra gc` again: what this run removed is in its result, and the next run picks up what it left.",
|
|
143
|
+
docs: {
|
|
144
|
+
explanation:
|
|
145
|
+
"`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.",
|
|
146
|
+
fix: "Run `mostra gc` again; a failure that repeats names its cause in the message (for example, a file the user can't remove).",
|
|
147
|
+
},
|
|
148
|
+
},
|
|
149
|
+
// gen:entries
|
|
150
|
+
};
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Diagnostic codes of the HOST area: the host protocol between clients and an instance.
|
|
3
|
+
*/
|
|
4
|
+
import type { AreaCatalog } from "../spec.ts";
|
|
5
|
+
|
|
6
|
+
/** The codes of the HOST area, in the order they were added. */
|
|
7
|
+
export const hostDiagnosticCodes = [
|
|
8
|
+
"MOSTRA_HOST_REVISION_UNSUPPORTED",
|
|
9
|
+
"MOSTRA_HOST_MALFORMED",
|
|
10
|
+
"MOSTRA_HOST_METHOD_UNKNOWN",
|
|
11
|
+
"MOSTRA_HOST_INVALID_PARAMS",
|
|
12
|
+
"MOSTRA_HOST_INTERNAL_ERROR",
|
|
13
|
+
"MOSTRA_HOST_INITIALIZE_ORDER",
|
|
14
|
+
"MOSTRA_HOST_PORT_UNSUPPORTED",
|
|
15
|
+
"MOSTRA_HOST_CONNECTION_CLOSED",
|
|
16
|
+
"MOSTRA_HOST_TIMEOUT",
|
|
17
|
+
"MOSTRA_HOST_SHUTDOWN_REFUSED",
|
|
18
|
+
"MOSTRA_HOST_REQUEST_ID_REUSED",
|
|
19
|
+
"MOSTRA_HOST_CURSOR_COMPACTED",
|
|
20
|
+
"MOSTRA_HOST_SUBSCRIPTION_UNKNOWN",
|
|
21
|
+
"MOSTRA_HOST_NOTIFICATION_UNSUPPORTED",
|
|
22
|
+
"MOSTRA_HOST_MESSAGE_TOO_LARGE",
|
|
23
|
+
// gen:codes
|
|
24
|
+
] as const;
|
|
25
|
+
|
|
26
|
+
/** The codes of the HOST area. */
|
|
27
|
+
export type HostDiagnosticCode = (typeof hostDiagnosticCodes)[number];
|
|
28
|
+
|
|
29
|
+
/** The HOST area's catalog entries. */
|
|
30
|
+
export const hostDiagnostics: AreaCatalog<HostDiagnosticCode> = {
|
|
31
|
+
MOSTRA_HOST_REVISION_UNSUPPORTED: {
|
|
32
|
+
severity: "error",
|
|
33
|
+
phase: "host",
|
|
34
|
+
title: "No common host protocol revision",
|
|
35
|
+
hint: "Run the client and the instance from the same Mostra release, for example with `mostra daemon restart`.",
|
|
36
|
+
docs: {
|
|
37
|
+
explanation:
|
|
38
|
+
"A client and a Mostra instance agree on a host protocol revision when they connect (`mostra/initialize`). The client offers the revisions it speaks, and the instance picks the newest one it also supports. This code means the two lists have nothing in common, usually because the client and the running daemon come from Mostra releases far apart.",
|
|
39
|
+
fix: "Restart the daemon so it runs the same release as the client: `mostra daemon restart`. Durable state survives the restart, and open views reconnect. A host that embeds Mostra updates its pinned Mostra runtime or its host library until both support a common revision.",
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
MOSTRA_HOST_MALFORMED: {
|
|
43
|
+
severity: "error",
|
|
44
|
+
phase: "host",
|
|
45
|
+
title: "Malformed protocol message",
|
|
46
|
+
hint: "Send each message as one line of JSON holding a single JSON-RPC 2.0 request or notification.",
|
|
47
|
+
docs: {
|
|
48
|
+
explanation:
|
|
49
|
+
"Every message on a Mostra connection is one line of JSON with one JSON-RPC 2.0 object. This code means a line wasn't valid JSON, wasn't a JSON-RPC 2.0 request or response, or was a batch (a JSON array), which revision `2026-10-10` doesn't accept. A client also reports it when a response doesn't match the method's result schema.",
|
|
50
|
+
fix: 'Encode one request per line with `"jsonrpc": "2.0"`, a `method`, an `id` for requests, and `params` as an object. Send several requests as separate lines instead of a batch.',
|
|
51
|
+
},
|
|
52
|
+
},
|
|
53
|
+
MOSTRA_HOST_METHOD_UNKNOWN: {
|
|
54
|
+
severity: "error",
|
|
55
|
+
phase: "host",
|
|
56
|
+
title: "Unknown protocol method",
|
|
57
|
+
hint: "Call only the methods listed in `capabilities.methods` of the `mostra/initialize` result.",
|
|
58
|
+
docs: {
|
|
59
|
+
explanation:
|
|
60
|
+
"The instance doesn't serve the method that was called. Either the name is misspelled, or the client is newer than the instance and calls a method the instance's release doesn't have.",
|
|
61
|
+
fix: "Check the method name against INTERFACES \u00a76, and against `capabilities.methods` in the `mostra/initialize` result, which lists every method this instance serves. Upgrade the instance if the client needs a newer method.",
|
|
62
|
+
},
|
|
63
|
+
},
|
|
64
|
+
MOSTRA_HOST_INVALID_PARAMS: {
|
|
65
|
+
severity: "error",
|
|
66
|
+
phase: "host",
|
|
67
|
+
title: "Invalid method params",
|
|
68
|
+
hint: "Fix the params named in the message so they match the method's schema.",
|
|
69
|
+
docs: {
|
|
70
|
+
explanation:
|
|
71
|
+
"The request's `params` don't match the method's published schema: a required field is missing, a value has the wrong type, or a value is outside its allowed range. The message names the first problem found.",
|
|
72
|
+
fix: "Compare the request with the method's schema in `@mostra/protocol` (or the published JSON Schema) and correct the field named in the message.",
|
|
73
|
+
},
|
|
74
|
+
},
|
|
75
|
+
MOSTRA_HOST_INTERNAL_ERROR: {
|
|
76
|
+
severity: "error",
|
|
77
|
+
phase: "host",
|
|
78
|
+
title: "Unexpected failure in the instance",
|
|
79
|
+
hint: "Retry the request with the same request ID; if it fails again, report it with the instance's log.",
|
|
80
|
+
docs: {
|
|
81
|
+
explanation:
|
|
82
|
+
"The instance failed while handling the request, for a reason that isn't one of its known conditions. Durable state is unaffected: a request is acknowledged only after its ledger transaction commits. The details are in the instance's log (`logs/supervisor.log` in the home), not in the response.",
|
|
83
|
+
fix: "Retry the request with the same request ID; retries are idempotent. If the failure repeats, report it with the relevant lines of `logs/supervisor.log`.",
|
|
84
|
+
},
|
|
85
|
+
},
|
|
86
|
+
MOSTRA_HOST_INITIALIZE_ORDER: {
|
|
87
|
+
severity: "error",
|
|
88
|
+
phase: "host",
|
|
89
|
+
title: "Initialize first, and only once",
|
|
90
|
+
hint: "Send `mostra/initialize` as the first request on the connection, and only once.",
|
|
91
|
+
docs: {
|
|
92
|
+
explanation:
|
|
93
|
+
"Every connection starts with `mostra/initialize`, which agrees the protocol revision and registers the client's ports. The instance received another request before it, or a second `mostra/initialize` on the same connection.",
|
|
94
|
+
fix: "Send `mostra/initialize` first and wait for its result before any other request. To renegotiate, open a new connection.",
|
|
95
|
+
},
|
|
96
|
+
},
|
|
97
|
+
MOSTRA_HOST_PORT_UNSUPPORTED: {
|
|
98
|
+
severity: "warning",
|
|
99
|
+
phase: "host",
|
|
100
|
+
title: "Port not supported by this instance",
|
|
101
|
+
hint: "Leave the port out of `mostra/initialize`, or run a Mostra release that lists it in `capabilities.ports`.",
|
|
102
|
+
docs: {
|
|
103
|
+
explanation:
|
|
104
|
+
"The client registered a port this instance doesn't call, so registering it has no effect. The port may be reserved for a later release (such as `ai`), or the client may be newer than the instance. The session continues without the port, and Mostra uses its standalone behavior instead.",
|
|
105
|
+
fix: "Register only the ports listed in `capabilities.ports` of the `mostra/initialize` result. If the host needs the port, upgrade the instance to a release that supports it.",
|
|
106
|
+
},
|
|
107
|
+
},
|
|
108
|
+
MOSTRA_HOST_CONNECTION_CLOSED: {
|
|
109
|
+
severity: "error",
|
|
110
|
+
phase: "host",
|
|
111
|
+
title: "Connection closed",
|
|
112
|
+
hint: "Reconnect, then retry the request with the same request ID.",
|
|
113
|
+
docs: {
|
|
114
|
+
explanation:
|
|
115
|
+
"The connection to the other side closed before a response arrived, for example because the instance exited or restarted. The request may or may not have taken effect.",
|
|
116
|
+
fix: "Reconnect and send `mostra/initialize` again, then retry the request with the same request ID. Mutating methods are idempotent by request ID, so a retry never applies twice.",
|
|
117
|
+
},
|
|
118
|
+
},
|
|
119
|
+
MOSTRA_HOST_TIMEOUT: {
|
|
120
|
+
severity: "error",
|
|
121
|
+
phase: "host",
|
|
122
|
+
title: "Request timed out",
|
|
123
|
+
hint: "Retry the request with the same request ID, or allow it more time.",
|
|
124
|
+
docs: {
|
|
125
|
+
explanation:
|
|
126
|
+
"No response arrived within the time the caller allowed. The other side may still be working on the request, and it may still take effect.",
|
|
127
|
+
fix: "Retry with the same request ID, which returns the recorded result if the first attempt completed. Allow a longer timeout for slow operations.",
|
|
128
|
+
},
|
|
129
|
+
},
|
|
130
|
+
MOSTRA_HOST_SHUTDOWN_REFUSED: {
|
|
131
|
+
severity: "error",
|
|
132
|
+
phase: "host",
|
|
133
|
+
title: "Only the spawning host can stop this instance",
|
|
134
|
+
hint: "Ask the host that started this instance to stop it, or end the connection you opened instead.",
|
|
135
|
+
docs: {
|
|
136
|
+
explanation:
|
|
137
|
+
"An instance started by a host over stdio (`mostra host`) lives as long as that host's connection, so only the host may stop it with `mostra/shutdown`. A client that attached through the home's socket asked it to stop. A daemon (`mostra daemon`) accepts `mostra/shutdown` from every attached client (D87).",
|
|
138
|
+
fix: "Close your own connection when you are done. To stop the instance, stop the host that spawned it, or have the host send `mostra/shutdown` or close its stdio.",
|
|
139
|
+
},
|
|
140
|
+
},
|
|
141
|
+
MOSTRA_HOST_REQUEST_ID_REUSED: {
|
|
142
|
+
severity: "error",
|
|
143
|
+
phase: "host",
|
|
144
|
+
title: "A requestId was reused with other parameters",
|
|
145
|
+
hint: "Send a new `requestId` for a new request; repeat the exact parameters only to retry one.",
|
|
146
|
+
docs: {
|
|
147
|
+
explanation:
|
|
148
|
+
"A mutating method recorded its result under this `requestId` for different parameters. Replaying that result would answer a request nobody made (a link for another artifact or with other scopes, another source's publish), so the instance refuses (H-03). Retries with the same parameters still return the recorded result.",
|
|
149
|
+
fix: "Generate a fresh `requestId` for every new request, and reuse one only to retry the same request after a timeout or a lost connection.",
|
|
150
|
+
},
|
|
151
|
+
},
|
|
152
|
+
MOSTRA_HOST_CURSOR_COMPACTED: {
|
|
153
|
+
severity: "error",
|
|
154
|
+
phase: "host",
|
|
155
|
+
title: "Events compacted",
|
|
156
|
+
hint: "Read from the cursor in the message to receive the compaction summary, then continue from there.",
|
|
157
|
+
docs: {
|
|
158
|
+
explanation:
|
|
159
|
+
"Events before a cursor were compacted on request (`mostra gc --compact-events`, DATA_MODEL §4): an artifact's old events were replaced by one `artifact.compacted` event that summarizes them. A reader asking for events after an earlier cursor would miss some, and Mostra never leaves a silent gap.",
|
|
160
|
+
fix: "Read again with `after` set to the cursor the message names: the next event is the `artifact.compacted` summary. Rebuild what you track from it and continue as usual.",
|
|
161
|
+
},
|
|
162
|
+
},
|
|
163
|
+
MOSTRA_HOST_SUBSCRIPTION_UNKNOWN: {
|
|
164
|
+
severity: "error",
|
|
165
|
+
phase: "host",
|
|
166
|
+
title: "Unknown subscription",
|
|
167
|
+
hint: "Subscribe again with `events/subscribe`, then use the ID it returns.",
|
|
168
|
+
docs: {
|
|
169
|
+
explanation:
|
|
170
|
+
"The subscription ID belongs to no subscription on this connection: it was never created here, was ended with `events/unsubscribe`, or belonged to a connection that closed. Subscriptions live as long as their connection; a named subscriber's acknowledged cursor outlives it.",
|
|
171
|
+
fix: "Call `events/subscribe` again on this connection. With the same `name`, delivery resumes after the last acknowledged cursor.",
|
|
172
|
+
},
|
|
173
|
+
},
|
|
174
|
+
MOSTRA_HOST_NOTIFICATION_UNSUPPORTED: {
|
|
175
|
+
severity: "error",
|
|
176
|
+
phase: "host",
|
|
177
|
+
title: "Notification not accepted",
|
|
178
|
+
hint: "List the notification in `capabilities.notifications` when you initialize.",
|
|
179
|
+
docs: {
|
|
180
|
+
explanation:
|
|
181
|
+
"Mostra sends a client only the notifications it listed in `mostra/initialize` (D84). This method would send one the client didn't list, such as `events/notify` for `events/subscribe`.",
|
|
182
|
+
fix: 'Reconnect and initialize with `capabilities: { notifications: ["events/notify"] }`, or poll with `events/read` instead.',
|
|
183
|
+
},
|
|
184
|
+
},
|
|
185
|
+
MOSTRA_HOST_MESSAGE_TOO_LARGE: {
|
|
186
|
+
severity: "error",
|
|
187
|
+
phase: "host",
|
|
188
|
+
title: "Message too large for the protocol",
|
|
189
|
+
hint: "Ask for less at once: a specific submission, fewer events, or smaller values.",
|
|
190
|
+
docs: {
|
|
191
|
+
explanation:
|
|
192
|
+
"One host-protocol message is one line of JSON, and a line holds at most 64 Mi characters (`MAX_LINE_LENGTH`), so neither side buffers without bound. Mostra checks every message before it writes it: an answer that would be longer is replaced by this error, and a delivery whose envelope would be longer is recorded as undeliverable instead of being sent and retried forever.",
|
|
193
|
+
fix: "Read less per request (`events/read` with a smaller `limit`, `results/get` for one submission), and keep artifacts' values within the field and document limits.",
|
|
194
|
+
},
|
|
195
|
+
},
|
|
196
|
+
// gen:entries
|
|
197
|
+
};
|