@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
package/dist/worker.d.ts
ADDED
|
@@ -0,0 +1,249 @@
|
|
|
1
|
+
import { Frame, WireError } from "./serializer.js";
|
|
2
|
+
import { ActionError, Batches, RunProgress } from "./actions.js";
|
|
3
|
+
import { DocumentRevision, FieldOp, MutationResult } from "./interaction.js";
|
|
4
|
+
import * as z from "zod";
|
|
5
|
+
//#region src/worker.d.ts
|
|
6
|
+
/** The worker channel's revision, which a worker states in its `worker/start` answer. */
|
|
7
|
+
export declare const WORKER_CHANNEL_REVISION = "2026-10-16";
|
|
8
|
+
/** The limits a worker runs under (D62): stability, never security. */
|
|
9
|
+
export interface WorkerLimits {
|
|
10
|
+
/** The V8 old-space heap, in MiB (default 1024). */
|
|
11
|
+
readonly heapMb: number;
|
|
12
|
+
/** How long the event loop may be blocked before the worker is stopped, in ms (default 10 000). */
|
|
13
|
+
readonly watchdogMs: number;
|
|
14
|
+
/** Idle minutes before the worker is evicted (default 10). */
|
|
15
|
+
readonly idleMinutes: number;
|
|
16
|
+
}
|
|
17
|
+
/** The default limits (D62). */
|
|
18
|
+
export declare const DEFAULT_WORKER_LIMITS: WorkerLimits;
|
|
19
|
+
/**
|
|
20
|
+
* Names a version for a launcher (D124): its ID, the digest of its build output, and where its
|
|
21
|
+
* portable bundle is. A local launcher resolves a `home:` locator to the version's directory in
|
|
22
|
+
* its home; a remote one fetches the bundle and checks the digest. Never a directory path.
|
|
23
|
+
*/
|
|
24
|
+
export interface WorkerVersionRef {
|
|
25
|
+
/** The version. */
|
|
26
|
+
readonly versionId: string;
|
|
27
|
+
/** The SHA-256 of the version's build output (DATA_MODEL §2). */
|
|
28
|
+
readonly outputDigest: string;
|
|
29
|
+
/** `home:versions/<versionId>` for the home's own store; other schemes for other launchers. */
|
|
30
|
+
readonly locator: string;
|
|
31
|
+
}
|
|
32
|
+
/** The Zod schema of the `WorkerVersionRef` type. */
|
|
33
|
+
export declare const WorkerVersionRef: z.ZodType<WorkerVersionRef>;
|
|
34
|
+
/** Who a call runs for, as `@mostra/server` exposes it (`viewer()`, `dryRun()`). */
|
|
35
|
+
export interface CallContext {
|
|
36
|
+
/** `call`: a plain call. `run`: an action run. */
|
|
37
|
+
readonly kind: "call" | "run";
|
|
38
|
+
/** The run's `run_` ID. */
|
|
39
|
+
readonly runId?: string;
|
|
40
|
+
/** The view the page was opened as (D104). */
|
|
41
|
+
readonly viewId?: string;
|
|
42
|
+
/** The viewer, when there is one. */
|
|
43
|
+
readonly viewer?: {
|
|
44
|
+
readonly id: string;
|
|
45
|
+
readonly name?: string;
|
|
46
|
+
};
|
|
47
|
+
/** True only during `verify`'s smoke test (D55). */
|
|
48
|
+
readonly dryRun: boolean;
|
|
49
|
+
}
|
|
50
|
+
/** How a live source produces values, as the worker found it in `live.ts`. */
|
|
51
|
+
export interface LiveSourceInfo {
|
|
52
|
+
/** The live source's key. */
|
|
53
|
+
readonly key: string;
|
|
54
|
+
/** Whether it has a `load` function. */
|
|
55
|
+
readonly load: boolean;
|
|
56
|
+
/** The refresh interval, in ms. */
|
|
57
|
+
readonly refreshMs?: number;
|
|
58
|
+
/** The globs it watches. */
|
|
59
|
+
readonly watch?: readonly string[];
|
|
60
|
+
/** Whether it has a `stream` function. */
|
|
61
|
+
readonly stream: boolean;
|
|
62
|
+
/** Whether it runs without viewers (D63). */
|
|
63
|
+
readonly always: boolean;
|
|
64
|
+
/** How many values it keeps for append mode. */
|
|
65
|
+
readonly ring?: number;
|
|
66
|
+
}
|
|
67
|
+
/** `worker/start`: the first request; the worker loads the version's server bundle. */
|
|
68
|
+
export interface WorkerStartParams {
|
|
69
|
+
/** The artifact. */
|
|
70
|
+
readonly artifactId: string;
|
|
71
|
+
/** The version to load. */
|
|
72
|
+
readonly version: WorkerVersionRef;
|
|
73
|
+
/** The server bundle to load, relative to the version (the render mode's `serverEntry`, D19). */
|
|
74
|
+
readonly entry: string;
|
|
75
|
+
/** The limits it runs under. */
|
|
76
|
+
readonly limits: WorkerLimits;
|
|
77
|
+
}
|
|
78
|
+
/** What a started worker serves. */
|
|
79
|
+
export interface WorkerStartResult {
|
|
80
|
+
/** The value's revision. */
|
|
81
|
+
readonly revision: string;
|
|
82
|
+
/** The server function IDs of the version. */
|
|
83
|
+
readonly functions: readonly string[];
|
|
84
|
+
/** The live sources of `live.ts`. */
|
|
85
|
+
readonly live: readonly LiveSourceInfo[];
|
|
86
|
+
}
|
|
87
|
+
/** The Zod schema of the `WorkerStartResult` type (the supervisor checks the worker's answer). */
|
|
88
|
+
export declare const WorkerStartResult: z.ZodType<WorkerStartResult>;
|
|
89
|
+
/** The Zod schema of the `WorkerStartParams` type. */
|
|
90
|
+
export declare const WorkerStartParams: z.ZodType<WorkerStartParams>;
|
|
91
|
+
/**
|
|
92
|
+
* `worker/call`: runs a server function. Its result streams as `worker/batch` notifications
|
|
93
|
+
* before the answer, which says how it ended.
|
|
94
|
+
*/
|
|
95
|
+
export interface WorkerCallParams {
|
|
96
|
+
/** Unique on this channel; batches, cancellation and server requests name it. */
|
|
97
|
+
readonly callId: string;
|
|
98
|
+
/** The server function: `<module path>#<export>`. */
|
|
99
|
+
readonly fnId: string;
|
|
100
|
+
/** The arguments, serialized as one array value. */
|
|
101
|
+
readonly args: Batches;
|
|
102
|
+
/** Who the call runs for. */
|
|
103
|
+
readonly context: CallContext;
|
|
104
|
+
}
|
|
105
|
+
/** The Zod schema of the `WorkerCallParams` type. */
|
|
106
|
+
export declare const WorkerCallParams: z.ZodType<WorkerCallParams>;
|
|
107
|
+
/** How a call ended. */
|
|
108
|
+
export type WorkerCallOutcome = {
|
|
109
|
+
readonly status: "succeeded";
|
|
110
|
+
} | {
|
|
111
|
+
readonly status: "cancelled";
|
|
112
|
+
} | {
|
|
113
|
+
readonly status: "failed";
|
|
114
|
+
readonly error: ActionError;
|
|
115
|
+
};
|
|
116
|
+
/** The Zod schema of the `WorkerCallOutcome` type. */
|
|
117
|
+
export declare const WorkerCallOutcome: z.ZodType<WorkerCallOutcome>;
|
|
118
|
+
/** `worker/cancel` (notification): aborts a call's `abortSignal`. */
|
|
119
|
+
export interface WorkerCancelParams {
|
|
120
|
+
/** The call to cancel. */
|
|
121
|
+
readonly callId: string;
|
|
122
|
+
/** Why, for the run's log. */
|
|
123
|
+
readonly reason?: string;
|
|
124
|
+
}
|
|
125
|
+
/** `worker/ping`: the watchdog's question. */
|
|
126
|
+
export interface WorkerPingResult {
|
|
127
|
+
/** How long the worker's event loop has gone without a turn, in ms. */
|
|
128
|
+
readonly blockedMs: number;
|
|
129
|
+
/** Whether it is blocked on purpose, waiting for a secret (`secret()` is synchronous). */
|
|
130
|
+
readonly waitingForSecret: boolean;
|
|
131
|
+
/** The V8 heap in use, in bytes. */
|
|
132
|
+
readonly heapUsed: number;
|
|
133
|
+
}
|
|
134
|
+
/** The Zod schema of the `WorkerPingResult` type. */
|
|
135
|
+
export declare const WorkerPingResult: z.ZodType<WorkerPingResult>;
|
|
136
|
+
/** `worker/live.start` and `worker/live.stop` (requests), `worker/live.refresh` (notification). */
|
|
137
|
+
export interface WorkerLiveParams {
|
|
138
|
+
/** The live source's key. */
|
|
139
|
+
readonly key: string;
|
|
140
|
+
}
|
|
141
|
+
/** `worker/batch` (notification): a batch of a call's result. */
|
|
142
|
+
export interface WorkerBatchParams {
|
|
143
|
+
/** The call it belongs to. */
|
|
144
|
+
readonly callId: string;
|
|
145
|
+
/** One batch of the result. */
|
|
146
|
+
readonly batch: readonly Frame[];
|
|
147
|
+
}
|
|
148
|
+
/** The Zod schema of the `WorkerBatchParams` type. */
|
|
149
|
+
export declare const WorkerBatchParams: z.ZodType<WorkerBatchParams>;
|
|
150
|
+
/** `server/progress` (notification). */
|
|
151
|
+
export interface ServerProgressParams extends RunProgress {
|
|
152
|
+
/** The call it belongs to. */
|
|
153
|
+
readonly callId: string;
|
|
154
|
+
}
|
|
155
|
+
/** The Zod schema of the `ServerProgressParams` type. */
|
|
156
|
+
export declare const ServerProgressParams: z.ZodType<ServerProgressParams>;
|
|
157
|
+
/** `server/log` (notification): a line of a run's log, or of the worker's own log. */
|
|
158
|
+
export interface ServerLogParams {
|
|
159
|
+
/** The call it belongs to. */
|
|
160
|
+
readonly callId?: string;
|
|
161
|
+
/** One line. */
|
|
162
|
+
readonly line: string;
|
|
163
|
+
}
|
|
164
|
+
/** The Zod schema of the `ServerLogParams` type. */
|
|
165
|
+
export declare const ServerLogParams: z.ZodType<ServerLogParams>;
|
|
166
|
+
/** `server/secret`: a secret by name (D44); `MOSTRA_SECRET_MISSING` when no store has it. */
|
|
167
|
+
export interface ServerSecretParams {
|
|
168
|
+
/** The secret's name. */
|
|
169
|
+
readonly name: string;
|
|
170
|
+
}
|
|
171
|
+
/** The Zod schema of the `ServerSecretParams` type. */
|
|
172
|
+
export declare const ServerSecretParams: z.ZodType<ServerSecretParams>;
|
|
173
|
+
/** `server/signal`: raises `signal.raised` with `source: "action"` (AC-05). */
|
|
174
|
+
export interface ServerSignalParams {
|
|
175
|
+
/** The call it belongs to. */
|
|
176
|
+
readonly callId?: string;
|
|
177
|
+
/** The signal's name. */
|
|
178
|
+
readonly name: string;
|
|
179
|
+
/** Any JSON, at most 64 KiB. */
|
|
180
|
+
readonly payload?: unknown;
|
|
181
|
+
}
|
|
182
|
+
/** The Zod schema of the `ServerSignalParams` type. */
|
|
183
|
+
export declare const ServerSignalParams: z.ZodType<ServerSignalParams>;
|
|
184
|
+
/** `server/emit`: appends a `host.<name>` event (AC-05). */
|
|
185
|
+
export interface ServerEmitParams {
|
|
186
|
+
/** The call it belongs to. */
|
|
187
|
+
readonly callId?: string;
|
|
188
|
+
/** `host.<name>`. */
|
|
189
|
+
readonly type: string;
|
|
190
|
+
/** Any JSON, at most 64 KiB. */
|
|
191
|
+
readonly payload?: unknown;
|
|
192
|
+
}
|
|
193
|
+
/** The Zod schema of the `ServerEmitParams` type. */
|
|
194
|
+
export declare const ServerEmitParams: z.ZodType<ServerEmitParams>;
|
|
195
|
+
/** `server/state.get`: reads the artifact's shared state. */
|
|
196
|
+
export interface ServerStateGetParams {
|
|
197
|
+
/** The fields to read; absent: all. */
|
|
198
|
+
readonly ids?: readonly string[];
|
|
199
|
+
}
|
|
200
|
+
/** The Zod schema of the `ServerStateGetParams` type. */
|
|
201
|
+
export declare const ServerStateGetParams: z.ZodType<ServerStateGetParams>;
|
|
202
|
+
/** `server/state.patch`: writes the artifact's shared state as the agent (D63). */
|
|
203
|
+
export interface ServerStatePatchParams {
|
|
204
|
+
/** The call it belongs to. */
|
|
205
|
+
readonly callId?: string;
|
|
206
|
+
/** The field changes. */
|
|
207
|
+
readonly ops: readonly FieldOp[];
|
|
208
|
+
/** The change's ID, for idempotent retries. */
|
|
209
|
+
readonly mutationId?: string;
|
|
210
|
+
/** The state revision read; fields changed after it conflict. */
|
|
211
|
+
readonly baseRevision?: DocumentRevision;
|
|
212
|
+
}
|
|
213
|
+
/** The Zod schema of the `ServerStatePatchParams` type. */
|
|
214
|
+
export declare const ServerStatePatchParams: z.ZodType<ServerStatePatchParams>;
|
|
215
|
+
/** The answer of `server/state.patch`. */
|
|
216
|
+
export type ServerStatePatchResult = MutationResult;
|
|
217
|
+
/** `server/live.value` (notification): a producer's new value, or its failure. */
|
|
218
|
+
export interface ServerLiveValueParams {
|
|
219
|
+
/** The live source's key. */
|
|
220
|
+
readonly key: string;
|
|
221
|
+
/** The value, serialized. */
|
|
222
|
+
readonly value?: Batches;
|
|
223
|
+
/** What went wrong. */
|
|
224
|
+
readonly error?: WireError;
|
|
225
|
+
}
|
|
226
|
+
/** The Zod schema of the `ServerLiveValueParams` type. */
|
|
227
|
+
export declare const ServerLiveValueParams: z.ZodType<ServerLiveValueParams>;
|
|
228
|
+
/** The channel's method names. */
|
|
229
|
+
export declare const WORKER_METHODS: {
|
|
230
|
+
readonly start: "worker/start";
|
|
231
|
+
readonly call: "worker/call";
|
|
232
|
+
readonly cancel: "worker/cancel";
|
|
233
|
+
readonly ping: "worker/ping";
|
|
234
|
+
readonly liveStart: "worker/live.start";
|
|
235
|
+
readonly liveStop: "worker/live.stop";
|
|
236
|
+
readonly liveRefresh: "worker/live.refresh";
|
|
237
|
+
readonly stop: "worker/stop";
|
|
238
|
+
readonly batch: "worker/batch";
|
|
239
|
+
readonly progress: "server/progress";
|
|
240
|
+
readonly log: "server/log";
|
|
241
|
+
readonly secret: "server/secret";
|
|
242
|
+
readonly signal: "server/signal";
|
|
243
|
+
readonly emit: "server/emit";
|
|
244
|
+
readonly stateGet: "server/state.get";
|
|
245
|
+
readonly statePatch: "server/state.patch";
|
|
246
|
+
readonly liveValue: "server/live.value";
|
|
247
|
+
};
|
|
248
|
+
//#endregion
|
|
249
|
+
//# sourceMappingURL=worker.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"worker.d.ts","names":[],"sources":["../src/worker.ts"],"mappings":";;;;;;qBAiBa;;iBAGI;;WAEN;;WAEA;;WAEA;;;qBAIE,uBAAuB;;;;;;iBAWnB;;WAEN;;WAEA;;WAEA;;;qBAIE,kBAAkB,EAAE,QAAQ;;iBAOxB;;WAEN;;WAEA;;WAEA;;WAEA;aAAoB;aAAqB;;;WAEzC;;;iBAYM;;WAEN;;WAEA;;WAEA;;WAEA;;WAEA;;WAEA;;WAEA;;;iBAgBM;;WAEN;;WAEA,SAAS;;WAET;;WAEA,QAAQ;;;iBAIF;;WAEN;;WAEA;;WAEA,eAAe;;;qBAIb,mBAAmB,EAAE,QAAQ;;qBAO7B,mBAAmB,EAAE,QAAQ;;;;;iBAezB;;WAEN;;WAEA;;WAEA,MAAM;;WAEN,SAAS;;;qBAIP,kBAAkB,EAAE,QAAQ;;YAQ7B;WACG;;WACA;;WACA;WAA2B,OAAO;;;qBAGpC,mBAAmB,EAAE,QAAQ;;iBAOzB;;WAEN;;WAEA;;;iBAIM;;WAEN;;WAEA;;WAEA;;;qBAIE,kBAAkB,EAAE,QAAQ;;iBAOxB;;WAEN;;;iBAMM;;WAEN;;WAEA,gBAAgB;;;qBAId,mBAAmB,EAAE,QAAQ;;iBAMzB,6BAA6B;;WAEnC;;;qBAIE,sBAAsB,EAAE,QAAQ;;iBAO5B;;WAEN;;WAEA;;;qBAIE,iBAAiB,EAAE,QAAQ;;iBAMvB;;WAEN;;;qBAIE,oBAAoB,EAAE,QAAQ;;iBAG1B;;WAEN;;WAEA;;WAEA;;;qBAIE,oBAAoB,EAAE,QAAQ;;iBAO1B;;WAEN;;WAEA;;WAEA;;;qBAIE,kBAAkB,EAAE,QAAQ;;iBAOxB;;WAEN;;;qBAIE,sBAAsB,EAAE,QAAQ;;iBAK5B;;WAEN;;WAEA,cAAc;;WAEd;;WAEA,eAAe;;;qBAIb,wBAAwB,EAAE,QAAQ;;YAQnC,yBAAyB;;iBAGpB;;WAEN;;WAEA,QAAQ;;WAER,QAAQ;;;qBAIN,uBAAuB,EAAE,QAAQ;;qBAOjC;WACX;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA"}
|
package/dist/worker.js
ADDED
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
import { ActionError, Batches, LIVE_KEY_PATTERN } from "./actions.js";
|
|
2
|
+
import { DocumentRevision, FieldOp } from "./interaction.js";
|
|
3
|
+
import * as z from "zod";
|
|
4
|
+
//#region src/worker.ts
|
|
5
|
+
/**
|
|
6
|
+
* The worker channel (D124, ARCHITECTURE §7): JSON-RPC 2.0 between the supervisor and an artifact
|
|
7
|
+
* version's worker, over whatever the `WorkerLauncher` connects (a pipe for the local launcher, a
|
|
8
|
+
* socket for a launcher whose worker runs elsewhere). Every message is serializable, so a worker
|
|
9
|
+
* that runs as a separate process, or on another machine, fits without a change. Secrets reach a
|
|
10
|
+
* worker only as answers to its own `server/secret` requests, never through its environment.
|
|
11
|
+
*
|
|
12
|
+
* The supervisor validates everything a worker sends: a worker runs agent-authored code with full
|
|
13
|
+
* capability (D05), and a malformed message must never take the supervisor down.
|
|
14
|
+
*/
|
|
15
|
+
/** The worker channel's revision, which a worker states in its `worker/start` answer. */
|
|
16
|
+
const WORKER_CHANNEL_REVISION = "2026-10-16";
|
|
17
|
+
/** The default limits (D62). */
|
|
18
|
+
const DEFAULT_WORKER_LIMITS = {
|
|
19
|
+
heapMb: 1024,
|
|
20
|
+
watchdogMs: 1e4,
|
|
21
|
+
idleMinutes: 10
|
|
22
|
+
};
|
|
23
|
+
/** The Zod schema of the `WorkerVersionRef` type. */
|
|
24
|
+
const WorkerVersionRef = z.object({
|
|
25
|
+
versionId: z.string(),
|
|
26
|
+
outputDigest: z.string().regex(/^[0-9a-f]{64}$/),
|
|
27
|
+
locator: z.string().min(1)
|
|
28
|
+
});
|
|
29
|
+
const CallContextSchema = z.object({
|
|
30
|
+
kind: z.enum(["call", "run"]),
|
|
31
|
+
runId: z.string().exactOptional(),
|
|
32
|
+
viewId: z.string().exactOptional(),
|
|
33
|
+
viewer: z.object({
|
|
34
|
+
id: z.string(),
|
|
35
|
+
name: z.string().exactOptional()
|
|
36
|
+
}).exactOptional(),
|
|
37
|
+
dryRun: z.boolean()
|
|
38
|
+
});
|
|
39
|
+
const LiveSourceInfoSchema = z.object({
|
|
40
|
+
key: z.string().regex(LIVE_KEY_PATTERN),
|
|
41
|
+
load: z.boolean(),
|
|
42
|
+
refreshMs: z.int().min(1).exactOptional(),
|
|
43
|
+
watch: z.array(z.string()).readonly().exactOptional(),
|
|
44
|
+
stream: z.boolean(),
|
|
45
|
+
always: z.boolean(),
|
|
46
|
+
ring: z.int().min(1).exactOptional()
|
|
47
|
+
});
|
|
48
|
+
/** The Zod schema of the `WorkerStartResult` type (the supervisor checks the worker's answer). */
|
|
49
|
+
const WorkerStartResult = z.object({
|
|
50
|
+
revision: z.string(),
|
|
51
|
+
functions: z.array(z.string()).readonly(),
|
|
52
|
+
live: z.array(LiveSourceInfoSchema).readonly()
|
|
53
|
+
});
|
|
54
|
+
/** The Zod schema of the `WorkerStartParams` type. */
|
|
55
|
+
const WorkerStartParams = z.object({
|
|
56
|
+
artifactId: z.string(),
|
|
57
|
+
version: WorkerVersionRef,
|
|
58
|
+
entry: z.string().min(1),
|
|
59
|
+
limits: z.object({
|
|
60
|
+
heapMb: z.int().min(16),
|
|
61
|
+
watchdogMs: z.int().min(100),
|
|
62
|
+
idleMinutes: z.number().min(0)
|
|
63
|
+
})
|
|
64
|
+
});
|
|
65
|
+
/** The Zod schema of the `WorkerCallParams` type. */
|
|
66
|
+
const WorkerCallParams = z.object({
|
|
67
|
+
callId: z.string().min(1).max(64),
|
|
68
|
+
fnId: z.string().min(1),
|
|
69
|
+
args: Batches,
|
|
70
|
+
context: CallContextSchema
|
|
71
|
+
});
|
|
72
|
+
/** The Zod schema of the `WorkerCallOutcome` type. */
|
|
73
|
+
const WorkerCallOutcome = z.union([
|
|
74
|
+
z.object({ status: z.literal("succeeded") }),
|
|
75
|
+
z.object({ status: z.literal("cancelled") }),
|
|
76
|
+
z.object({
|
|
77
|
+
status: z.literal("failed"),
|
|
78
|
+
error: ActionError
|
|
79
|
+
})
|
|
80
|
+
]);
|
|
81
|
+
/** The Zod schema of the `WorkerPingResult` type. */
|
|
82
|
+
const WorkerPingResult = z.object({
|
|
83
|
+
blockedMs: z.number().min(0),
|
|
84
|
+
waitingForSecret: z.boolean(),
|
|
85
|
+
heapUsed: z.number().min(0)
|
|
86
|
+
});
|
|
87
|
+
/** The Zod schema of the `WorkerBatchParams` type. */
|
|
88
|
+
const WorkerBatchParams = z.object({
|
|
89
|
+
callId: z.string(),
|
|
90
|
+
batch: z.array(z.record(z.string(), z.unknown())).readonly()
|
|
91
|
+
});
|
|
92
|
+
/** The Zod schema of the `ServerProgressParams` type. */
|
|
93
|
+
const ServerProgressParams = z.object({
|
|
94
|
+
callId: z.string(),
|
|
95
|
+
fraction: z.number().min(0).max(1).exactOptional(),
|
|
96
|
+
message: z.string().max(1e3).exactOptional()
|
|
97
|
+
});
|
|
98
|
+
/** The Zod schema of the `ServerLogParams` type. */
|
|
99
|
+
const ServerLogParams = z.object({
|
|
100
|
+
callId: z.string().exactOptional(),
|
|
101
|
+
line: z.string()
|
|
102
|
+
});
|
|
103
|
+
/** The Zod schema of the `ServerSecretParams` type. */
|
|
104
|
+
const ServerSecretParams = z.object({ name: z.string() });
|
|
105
|
+
/** The Zod schema of the `ServerSignalParams` type. */
|
|
106
|
+
const ServerSignalParams = z.object({
|
|
107
|
+
callId: z.string().exactOptional(),
|
|
108
|
+
name: z.string(),
|
|
109
|
+
payload: z.unknown().exactOptional()
|
|
110
|
+
});
|
|
111
|
+
/** The Zod schema of the `ServerEmitParams` type. */
|
|
112
|
+
const ServerEmitParams = z.object({
|
|
113
|
+
callId: z.string().exactOptional(),
|
|
114
|
+
type: z.string(),
|
|
115
|
+
payload: z.unknown().exactOptional()
|
|
116
|
+
});
|
|
117
|
+
/** The Zod schema of the `ServerStateGetParams` type. */
|
|
118
|
+
const ServerStateGetParams = z.object({ ids: z.array(z.string()).readonly().exactOptional() });
|
|
119
|
+
/** The Zod schema of the `ServerStatePatchParams` type. */
|
|
120
|
+
const ServerStatePatchParams = z.object({
|
|
121
|
+
callId: z.string().exactOptional(),
|
|
122
|
+
ops: z.array(FieldOp).min(1).max(1e3).readonly(),
|
|
123
|
+
mutationId: z.string().exactOptional(),
|
|
124
|
+
baseRevision: DocumentRevision.exactOptional()
|
|
125
|
+
});
|
|
126
|
+
/** The Zod schema of the `ServerLiveValueParams` type. */
|
|
127
|
+
const ServerLiveValueParams = z.object({
|
|
128
|
+
key: z.string().regex(LIVE_KEY_PATTERN),
|
|
129
|
+
value: Batches.exactOptional(),
|
|
130
|
+
error: z.object({
|
|
131
|
+
message: z.string(),
|
|
132
|
+
code: z.string().exactOptional()
|
|
133
|
+
}).exactOptional()
|
|
134
|
+
});
|
|
135
|
+
/** The channel's method names. */
|
|
136
|
+
const WORKER_METHODS = {
|
|
137
|
+
start: "worker/start",
|
|
138
|
+
call: "worker/call",
|
|
139
|
+
cancel: "worker/cancel",
|
|
140
|
+
ping: "worker/ping",
|
|
141
|
+
liveStart: "worker/live.start",
|
|
142
|
+
liveStop: "worker/live.stop",
|
|
143
|
+
liveRefresh: "worker/live.refresh",
|
|
144
|
+
stop: "worker/stop",
|
|
145
|
+
batch: "worker/batch",
|
|
146
|
+
progress: "server/progress",
|
|
147
|
+
log: "server/log",
|
|
148
|
+
secret: "server/secret",
|
|
149
|
+
signal: "server/signal",
|
|
150
|
+
emit: "server/emit",
|
|
151
|
+
stateGet: "server/state.get",
|
|
152
|
+
statePatch: "server/state.patch",
|
|
153
|
+
liveValue: "server/live.value"
|
|
154
|
+
};
|
|
155
|
+
//#endregion
|
|
156
|
+
export { DEFAULT_WORKER_LIMITS, ServerEmitParams, ServerLiveValueParams, ServerLogParams, ServerProgressParams, ServerSecretParams, ServerSignalParams, ServerStateGetParams, ServerStatePatchParams, WORKER_CHANNEL_REVISION, WORKER_METHODS, WorkerBatchParams, WorkerCallOutcome, WorkerCallParams, WorkerPingResult, WorkerStartParams, WorkerStartResult, WorkerVersionRef };
|
|
157
|
+
|
|
158
|
+
//# sourceMappingURL=worker.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"worker.js","names":[],"sources":["../src/worker.ts"],"sourcesContent":["/**\n * The worker channel (D124, ARCHITECTURE §7): JSON-RPC 2.0 between the supervisor and an artifact\n * version's worker, over whatever the `WorkerLauncher` connects (a pipe for the local launcher, a\n * socket for a launcher whose worker runs elsewhere). Every message is serializable, so a worker\n * that runs as a separate process, or on another machine, fits without a change. Secrets reach a\n * worker only as answers to its own `server/secret` requests, never through its environment.\n *\n * The supervisor validates everything a worker sends: a worker runs agent-authored code with full\n * capability (D05), and a malformed message must never take the supervisor down.\n */\nimport * as z from \"zod\";\nimport { ActionError, Batches, LIVE_KEY_PATTERN, type RunProgress } from \"./actions.ts\";\nimport type { MutationResult } from \"./interaction.ts\";\nimport { DocumentRevision, FieldOp } from \"./interaction.ts\";\nimport type { Frame, WireError } from \"./serializer.ts\";\n\n/** The worker channel's revision, which a worker states in its `worker/start` answer. */\nexport const WORKER_CHANNEL_REVISION = \"2026-10-16\";\n\n/** The limits a worker runs under (D62): stability, never security. */\nexport interface WorkerLimits {\n /** The V8 old-space heap, in MiB (default 1024). */\n readonly heapMb: number;\n /** How long the event loop may be blocked before the worker is stopped, in ms (default 10 000). */\n readonly watchdogMs: number;\n /** Idle minutes before the worker is evicted (default 10). */\n readonly idleMinutes: number;\n}\n\n/** The default limits (D62). */\nexport const DEFAULT_WORKER_LIMITS: WorkerLimits = {\n heapMb: 1024,\n watchdogMs: 10_000,\n idleMinutes: 10,\n};\n\n/**\n * Names a version for a launcher (D124): its ID, the digest of its build output, and where its\n * portable bundle is. A local launcher resolves a `home:` locator to the version's directory in\n * its home; a remote one fetches the bundle and checks the digest. Never a directory path.\n */\nexport interface WorkerVersionRef {\n /** The version. */\n readonly versionId: string;\n /** The SHA-256 of the version's build output (DATA_MODEL §2). */\n readonly outputDigest: string;\n /** `home:versions/<versionId>` for the home's own store; other schemes for other launchers. */\n readonly locator: string;\n}\n\n/** The Zod schema of the `WorkerVersionRef` type. */\nexport const WorkerVersionRef: z.ZodType<WorkerVersionRef> = z.object({\n versionId: z.string(),\n outputDigest: z.string().regex(/^[0-9a-f]{64}$/),\n locator: z.string().min(1),\n});\n\n/** Who a call runs for, as `@mostra/server` exposes it (`viewer()`, `dryRun()`). */\nexport interface CallContext {\n /** `call`: a plain call. `run`: an action run. */\n readonly kind: \"call\" | \"run\";\n /** The run's `run_` ID. */\n readonly runId?: string;\n /** The view the page was opened as (D104). */\n readonly viewId?: string;\n /** The viewer, when there is one. */\n readonly viewer?: { readonly id: string; readonly name?: string };\n /** True only during `verify`'s smoke test (D55). */\n readonly dryRun: boolean;\n}\n\nconst CallContextSchema: z.ZodType<CallContext> = z.object({\n kind: z.enum([\"call\", \"run\"]),\n runId: z.string().exactOptional(),\n viewId: z.string().exactOptional(),\n viewer: z.object({ id: z.string(), name: z.string().exactOptional() }).exactOptional(),\n dryRun: z.boolean(),\n});\n\n/** How a live source produces values, as the worker found it in `live.ts`. */\nexport interface LiveSourceInfo {\n /** The live source's key. */\n readonly key: string;\n /** Whether it has a `load` function. */\n readonly load: boolean;\n /** The refresh interval, in ms. */\n readonly refreshMs?: number;\n /** The globs it watches. */\n readonly watch?: readonly string[];\n /** Whether it has a `stream` function. */\n readonly stream: boolean;\n /** Whether it runs without viewers (D63). */\n readonly always: boolean;\n /** How many values it keeps for append mode. */\n readonly ring?: number;\n}\n\nconst LiveSourceInfoSchema: z.ZodType<LiveSourceInfo> = z.object({\n key: z.string().regex(LIVE_KEY_PATTERN),\n load: z.boolean(),\n refreshMs: z.int().min(1).exactOptional(),\n watch: z.array(z.string()).readonly().exactOptional(),\n stream: z.boolean(),\n always: z.boolean(),\n ring: z.int().min(1).exactOptional(),\n});\n\n// ── Supervisor → worker ────────────────────────────────────────────────────────────────────\n\n/** `worker/start`: the first request; the worker loads the version's server bundle. */\nexport interface WorkerStartParams {\n /** The artifact. */\n readonly artifactId: string;\n /** The version to load. */\n readonly version: WorkerVersionRef;\n /** The server bundle to load, relative to the version (the render mode's `serverEntry`, D19). */\n readonly entry: string;\n /** The limits it runs under. */\n readonly limits: WorkerLimits;\n}\n\n/** What a started worker serves. */\nexport interface WorkerStartResult {\n /** The value's revision. */\n readonly revision: string;\n /** The server function IDs of the version. */\n readonly functions: readonly string[];\n /** The live sources of `live.ts`. */\n readonly live: readonly LiveSourceInfo[];\n}\n\n/** The Zod schema of the `WorkerStartResult` type (the supervisor checks the worker's answer). */\nexport const WorkerStartResult: z.ZodType<WorkerStartResult> = z.object({\n revision: z.string(),\n functions: z.array(z.string()).readonly(),\n live: z.array(LiveSourceInfoSchema).readonly(),\n});\n\n/** The Zod schema of the `WorkerStartParams` type. */\nexport const WorkerStartParams: z.ZodType<WorkerStartParams> = z.object({\n artifactId: z.string(),\n version: WorkerVersionRef,\n entry: z.string().min(1),\n limits: z.object({\n heapMb: z.int().min(16),\n watchdogMs: z.int().min(100),\n idleMinutes: z.number().min(0),\n }),\n});\n\n/**\n * `worker/call`: runs a server function. Its result streams as `worker/batch` notifications\n * before the answer, which says how it ended.\n */\nexport interface WorkerCallParams {\n /** Unique on this channel; batches, cancellation and server requests name it. */\n readonly callId: string;\n /** The server function: `<module path>#<export>`. */\n readonly fnId: string;\n /** The arguments, serialized as one array value. */\n readonly args: Batches;\n /** Who the call runs for. */\n readonly context: CallContext;\n}\n\n/** The Zod schema of the `WorkerCallParams` type. */\nexport const WorkerCallParams: z.ZodType<WorkerCallParams> = z.object({\n callId: z.string().min(1).max(64),\n fnId: z.string().min(1),\n args: Batches,\n context: CallContextSchema,\n});\n\n/** How a call ended. */\nexport type WorkerCallOutcome =\n | { readonly status: \"succeeded\" }\n | { readonly status: \"cancelled\" }\n | { readonly status: \"failed\"; readonly error: ActionError };\n\n/** The Zod schema of the `WorkerCallOutcome` type. */\nexport const WorkerCallOutcome: z.ZodType<WorkerCallOutcome> = z.union([\n z.object({ status: z.literal(\"succeeded\") }),\n z.object({ status: z.literal(\"cancelled\") }),\n z.object({ status: z.literal(\"failed\"), error: ActionError }),\n]);\n\n/** `worker/cancel` (notification): aborts a call's `abortSignal`. */\nexport interface WorkerCancelParams {\n /** The call to cancel. */\n readonly callId: string;\n /** Why, for the run's log. */\n readonly reason?: string;\n}\n\n/** `worker/ping`: the watchdog's question. */\nexport interface WorkerPingResult {\n /** How long the worker's event loop has gone without a turn, in ms. */\n readonly blockedMs: number;\n /** Whether it is blocked on purpose, waiting for a secret (`secret()` is synchronous). */\n readonly waitingForSecret: boolean;\n /** The V8 heap in use, in bytes. */\n readonly heapUsed: number;\n}\n\n/** The Zod schema of the `WorkerPingResult` type. */\nexport const WorkerPingResult: z.ZodType<WorkerPingResult> = z.object({\n blockedMs: z.number().min(0),\n waitingForSecret: z.boolean(),\n heapUsed: z.number().min(0),\n});\n\n/** `worker/live.start` and `worker/live.stop` (requests), `worker/live.refresh` (notification). */\nexport interface WorkerLiveParams {\n /** The live source's key. */\n readonly key: string;\n}\n\n// ── Worker → supervisor ────────────────────────────────────────────────────────────────────\n\n/** `worker/batch` (notification): a batch of a call's result. */\nexport interface WorkerBatchParams {\n /** The call it belongs to. */\n readonly callId: string;\n /** One batch of the result. */\n readonly batch: readonly Frame[];\n}\n\n/** The Zod schema of the `WorkerBatchParams` type. */\nexport const WorkerBatchParams: z.ZodType<WorkerBatchParams> = z.object({\n callId: z.string(),\n batch: z.array(z.record(z.string(), z.unknown())).readonly(),\n}) as unknown as z.ZodType<WorkerBatchParams>;\n\n/** `server/progress` (notification). */\nexport interface ServerProgressParams extends RunProgress {\n /** The call it belongs to. */\n readonly callId: string;\n}\n\n/** The Zod schema of the `ServerProgressParams` type. */\nexport const ServerProgressParams: z.ZodType<ServerProgressParams> = z.object({\n callId: z.string(),\n fraction: z.number().min(0).max(1).exactOptional(),\n message: z.string().max(1000).exactOptional(),\n});\n\n/** `server/log` (notification): a line of a run's log, or of the worker's own log. */\nexport interface ServerLogParams {\n /** The call it belongs to. */\n readonly callId?: string;\n /** One line. */\n readonly line: string;\n}\n\n/** The Zod schema of the `ServerLogParams` type. */\nexport const ServerLogParams: z.ZodType<ServerLogParams> = z.object({\n callId: z.string().exactOptional(),\n line: z.string(),\n});\n\n/** `server/secret`: a secret by name (D44); `MOSTRA_SECRET_MISSING` when no store has it. */\nexport interface ServerSecretParams {\n /** The secret's name. */\n readonly name: string;\n}\n\n/** The Zod schema of the `ServerSecretParams` type. */\nexport const ServerSecretParams: z.ZodType<ServerSecretParams> = z.object({ name: z.string() });\n\n/** `server/signal`: raises `signal.raised` with `source: \"action\"` (AC-05). */\nexport interface ServerSignalParams {\n /** The call it belongs to. */\n readonly callId?: string;\n /** The signal's name. */\n readonly name: string;\n /** Any JSON, at most 64 KiB. */\n readonly payload?: unknown;\n}\n\n/** The Zod schema of the `ServerSignalParams` type. */\nexport const ServerSignalParams: z.ZodType<ServerSignalParams> = z.object({\n callId: z.string().exactOptional(),\n name: z.string(),\n payload: z.unknown().exactOptional(),\n}) as z.ZodType<ServerSignalParams>;\n\n/** `server/emit`: appends a `host.<name>` event (AC-05). */\nexport interface ServerEmitParams {\n /** The call it belongs to. */\n readonly callId?: string;\n /** `host.<name>`. */\n readonly type: string;\n /** Any JSON, at most 64 KiB. */\n readonly payload?: unknown;\n}\n\n/** The Zod schema of the `ServerEmitParams` type. */\nexport const ServerEmitParams: z.ZodType<ServerEmitParams> = z.object({\n callId: z.string().exactOptional(),\n type: z.string(),\n payload: z.unknown().exactOptional(),\n}) as z.ZodType<ServerEmitParams>;\n\n/** `server/state.get`: reads the artifact's shared state. */\nexport interface ServerStateGetParams {\n /** The fields to read; absent: all. */\n readonly ids?: readonly string[];\n}\n\n/** The Zod schema of the `ServerStateGetParams` type. */\nexport const ServerStateGetParams: z.ZodType<ServerStateGetParams> = z.object({\n ids: z.array(z.string()).readonly().exactOptional(),\n});\n\n/** `server/state.patch`: writes the artifact's shared state as the agent (D63). */\nexport interface ServerStatePatchParams {\n /** The call it belongs to. */\n readonly callId?: string;\n /** The field changes. */\n readonly ops: readonly FieldOp[];\n /** The change's ID, for idempotent retries. */\n readonly mutationId?: string;\n /** The state revision read; fields changed after it conflict. */\n readonly baseRevision?: DocumentRevision;\n}\n\n/** The Zod schema of the `ServerStatePatchParams` type. */\nexport const ServerStatePatchParams: z.ZodType<ServerStatePatchParams> = z.object({\n callId: z.string().exactOptional(),\n ops: z.array(FieldOp).min(1).max(1000).readonly(),\n mutationId: z.string().exactOptional(),\n baseRevision: DocumentRevision.exactOptional(),\n});\n\n/** The answer of `server/state.patch`. */\nexport type ServerStatePatchResult = MutationResult;\n\n/** `server/live.value` (notification): a producer's new value, or its failure. */\nexport interface ServerLiveValueParams {\n /** The live source's key. */\n readonly key: string;\n /** The value, serialized. */\n readonly value?: Batches;\n /** What went wrong. */\n readonly error?: WireError;\n}\n\n/** The Zod schema of the `ServerLiveValueParams` type. */\nexport const ServerLiveValueParams: z.ZodType<ServerLiveValueParams> = z.object({\n key: z.string().regex(LIVE_KEY_PATTERN),\n value: Batches.exactOptional(),\n error: z.object({ message: z.string(), code: z.string().exactOptional() }).exactOptional(),\n});\n\n/** The channel's method names. */\nexport const WORKER_METHODS = {\n start: \"worker/start\",\n call: \"worker/call\",\n cancel: \"worker/cancel\",\n ping: \"worker/ping\",\n liveStart: \"worker/live.start\",\n liveStop: \"worker/live.stop\",\n liveRefresh: \"worker/live.refresh\",\n stop: \"worker/stop\",\n batch: \"worker/batch\",\n progress: \"server/progress\",\n log: \"server/log\",\n secret: \"server/secret\",\n signal: \"server/signal\",\n emit: \"server/emit\",\n stateGet: \"server/state.get\",\n statePatch: \"server/state.patch\",\n liveValue: \"server/live.value\",\n} as const;\n"],"mappings":"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"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,117 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mostra/protocol",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Mostra's shared protocol vocabulary: IDs, dated revisions and diagnostics, with Zod schemas and generated JSON Schema.",
|
|
5
|
+
"license": "Apache-2.0",
|
|
6
|
+
"author": "The Mostra Authors",
|
|
7
|
+
"homepage": "https://github.com/mostra-dev/mostra/tree/main/packages/protocol#readme",
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "git+https://github.com/mostra-dev/mostra.git",
|
|
11
|
+
"directory": "packages/protocol"
|
|
12
|
+
},
|
|
13
|
+
"bugs": "https://github.com/mostra-dev/mostra/issues",
|
|
14
|
+
"keywords": [
|
|
15
|
+
"mostra",
|
|
16
|
+
"agent",
|
|
17
|
+
"artifact",
|
|
18
|
+
"protocol",
|
|
19
|
+
"json-schema"
|
|
20
|
+
],
|
|
21
|
+
"type": "module",
|
|
22
|
+
"sideEffects": false,
|
|
23
|
+
"exports": {
|
|
24
|
+
".": {
|
|
25
|
+
"@mostra/source": "./src/index.ts",
|
|
26
|
+
"types": "./dist/index.d.ts",
|
|
27
|
+
"default": "./dist/index.js"
|
|
28
|
+
},
|
|
29
|
+
"./schemas/*": "./schemas/*",
|
|
30
|
+
"./package.json": "./package.json"
|
|
31
|
+
},
|
|
32
|
+
"files": [
|
|
33
|
+
"dist",
|
|
34
|
+
"schemas",
|
|
35
|
+
"src",
|
|
36
|
+
"!src/**/*.test.ts"
|
|
37
|
+
],
|
|
38
|
+
"engines": {
|
|
39
|
+
"node": ">=24"
|
|
40
|
+
},
|
|
41
|
+
"publishConfig": {
|
|
42
|
+
"access": "public",
|
|
43
|
+
"provenance": true
|
|
44
|
+
},
|
|
45
|
+
"dependencies": {
|
|
46
|
+
"zod": "4.6.5"
|
|
47
|
+
},
|
|
48
|
+
"devDependencies": {
|
|
49
|
+
"@mostra/tools": "0.0.0",
|
|
50
|
+
"@size-limit/preset-small-lib": "14.1.0",
|
|
51
|
+
"@types/node": "24.19.1",
|
|
52
|
+
"fast-check": "4.10.2",
|
|
53
|
+
"react": "19.3.0",
|
|
54
|
+
"react-dom": "19.3.0",
|
|
55
|
+
"react-server-dom-parcel": "19.3.0",
|
|
56
|
+
"size-limit": "14.1.0",
|
|
57
|
+
"tsdown": "0.23.0",
|
|
58
|
+
"typescript": "7.0.2",
|
|
59
|
+
"vitest": "5.0.3"
|
|
60
|
+
},
|
|
61
|
+
"size-limit": [
|
|
62
|
+
{
|
|
63
|
+
"name": "@mostra/protocol whole entry (zod excluded)",
|
|
64
|
+
"path": "dist/index.js",
|
|
65
|
+
"import": "*",
|
|
66
|
+
"ignore": [
|
|
67
|
+
"zod"
|
|
68
|
+
],
|
|
69
|
+
"limit": "48 kB"
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
"name": "@mostra/protocol JSON-RPC core (D83, zod excluded)",
|
|
73
|
+
"path": "dist/index.js",
|
|
74
|
+
"import": "{ RpcPeer, RpcError, encodeLine, LineSplitter }",
|
|
75
|
+
"ignore": [
|
|
76
|
+
"zod"
|
|
77
|
+
],
|
|
78
|
+
"limit": "6 kB"
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
"name": "@mostra/protocol IDs alone (zod excluded)",
|
|
82
|
+
"path": "dist/index.js",
|
|
83
|
+
"import": "{ ArtifactId, VersionId, Cursor }",
|
|
84
|
+
"ignore": [
|
|
85
|
+
"zod"
|
|
86
|
+
],
|
|
87
|
+
"limit": "1.5 kB"
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
"name": "@mostra/protocol bridge (SH-04, zod excluded)",
|
|
91
|
+
"path": "dist/index.js",
|
|
92
|
+
"import": "{ connectBridge, uiInitialize, uiInitialized, mostraReady }",
|
|
93
|
+
"ignore": [
|
|
94
|
+
"zod"
|
|
95
|
+
],
|
|
96
|
+
"limit": "8.5 kB"
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
"name": "@mostra/protocol server-function serializer (D54)",
|
|
100
|
+
"path": "dist/index.js",
|
|
101
|
+
"import": "{ ValueWriter, ValueReader, serializeAll, deserializeAll }",
|
|
102
|
+
"ignore": [
|
|
103
|
+
"zod"
|
|
104
|
+
],
|
|
105
|
+
"limit": "5 kB"
|
|
106
|
+
}
|
|
107
|
+
],
|
|
108
|
+
"scripts": {
|
|
109
|
+
"build": "tsdown",
|
|
110
|
+
"typecheck": "tsc -b",
|
|
111
|
+
"test": "vitest run",
|
|
112
|
+
"api": "mostra-tools api",
|
|
113
|
+
"size": "size-limit",
|
|
114
|
+
"schemas": "mostra-tools schemas check",
|
|
115
|
+
"gen:schemas": "mostra-tools schemas write"
|
|
116
|
+
}
|
|
6
117
|
}
|