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